* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #cfd8de;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  user-select: none; -webkit-user-select: none;
}
canvas { display: block; touch-action: none; cursor: crosshair; }

.hidden { display: none !important; }

#hud {
  position: fixed; top: 14px; left: 14px;
  display: flex; gap: 8px; flex-wrap: wrap;
  pointer-events: none;
}
.pill {
  background: rgba(40, 44, 56, 0.5);
  color: #f6f0e2; padding: 6px 14px; border-radius: 999px;
  font-size: 16px; backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 245, 225, 0.18);
}
.pill .lbl { opacity: 0.7; font-size: 13px; margin-right: 4px; }

.hearts { color: #f2a0a8; letter-spacing: 1px; }

#mute { right: 14px; }
#menuBtn { right: 64px; }
.hudBtn {
  position: fixed; top: 12px;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255, 245, 225, 0.25);
  background: rgba(40, 44, 56, 0.5); color: #fff;
  font-size: 18px; cursor: pointer;
}

#tools {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; gap: 8px;
}
.tool {
  font: inherit; font-size: 15px; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(40, 44, 56, 0.5); color: #f6f0e2;
  border: 1px solid rgba(255, 245, 225, 0.2);
  backdrop-filter: blur(4px);
}
.tool.active { background: rgba(246, 239, 225, 0.92); color: #39373a; border-color: #fff; }
@media (max-width: 420px) { .tool span { display: none; } .tool { font-size: 20px; padding: 8px 16px; } }

#hint {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%);
  background: rgba(40, 44, 56, 0.55); color: #f6f0e2;
  padding: 8px 18px; border-radius: 999px; font-size: 15px;
  pointer-events: none; transition: opacity 1.2s;
  max-width: calc(100% - 32px); text-align: center;
}
#hint.fade { opacity: 0; }

#overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30, 36, 48, 0.35);
  padding: 16px;
}
.card {
  max-width: 440px; width: 100%;
  background: #f6efe1; color: #39373a;
  border-radius: 22px; padding: 26px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  border: 4px solid #7d8796;
}
.card h1 { margin: 0 0 10px; color: #4f5a6e; font-size: 34px; }
.card p { margin: 8px 0; line-height: 1.45; }
.btn {
  display: block; width: 100%; margin-top: 18px;
  font: inherit; font-size: 19px; font-weight: bold;
  padding: 12px; border: 0; border-radius: 14px;
  background: #6c7890; color: #fff; cursor: pointer;
  box-shadow: 0 4px 0 #4a5468;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #4a5468; }
#resume { margin-bottom: 4px; }
.card .small { font-size: 12px; opacity: 0.65; margin-top: 12px; min-height: 1em; }

.field {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; font-size: 15px;
}
.field select {
  font: inherit; font-size: 15px;
  padding: 7px 10px; border-radius: 10px;
  border: 2px solid #c8c2b2; background: #fffaf0; color: #39373a;
  cursor: pointer; min-width: 0; flex: 1; max-width: 240px;
}
.field select:disabled { opacity: 0.6; cursor: default; }
