/* Nova Coil — cosmic marble-shooter chain matcher. Full-bleed canvas. */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05060f;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: none;
  overscroll-behavior: none;
}

#canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 0; right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.hud__score {
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #d9f6ff;
  text-shadow: 0 0 10px rgba(60, 224, 255, 0.6), 0 0 32px rgba(60, 224, 255, 0.3);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hud__best {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(130, 210, 240, 0.55);
  font-variant-numeric: tabular-nums;
}

.sound-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 6;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(60, 224, 255, 0.3);
  background: rgba(8, 12, 24, 0.5);
  color: #9be6ff;
  font-size: 1.05rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 140ms ease, background 140ms ease;
}
.sound-btn:hover { border-color: rgba(60, 224, 255, 0.7); }
.sound-btn[aria-pressed="false"] { color: rgba(120, 200, 226, 0.35); }

/* ---------- overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(120% 90% at 50% 42%, rgba(12, 16, 34, 0.86), rgba(2, 3, 8, 0.96));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 260ms ease;
}
.overlay[hidden] { display: none; }
.overlay.is-hidden { opacity: 0; pointer-events: none; }

.panel {
  text-align: center;
  max-width: 470px;
  padding: 34px 30px 32px;
  border-radius: 24px;
  background: rgba(8, 12, 24, 0.85);
  border: 1px solid rgba(60, 224, 255, 0.16);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.75), inset 0 0 60px -30px rgba(60, 224, 255, 0.4);
  animation: pop 320ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.panel__title {
  margin: 0 0 6px;
  font-size: clamp(2.4rem, 10vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.95;
  padding-bottom: 0.16em;
  background: linear-gradient(176deg, #eafdff 0%, #7ce6ff 44%, #b06bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 4px 26px rgba(90, 180, 255, 0.45));
}
.panel__text { margin: 0 0 26px; font-size: clamp(0.96rem, 3.3vw, 1.06rem); line-height: 1.55; font-weight: 500; color: #c4d2e2; }
.play-btn {
  appearance: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  color: #04202b;
  background: linear-gradient(180deg, #7ce6ff, #3bb6e6);
  border: 0;
  padding: 16px 40px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 30px -6px rgba(60, 224, 255, 0.6);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.play-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(60, 224, 255, 0.75); }
.play-btn:active { transform: translateY(0); }

/* ---------- frame + hint ---------- */
.frame { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.frame__corner {
  position: absolute;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(150, 205, 235, 0.5);
}
.frame__corner--tl { top: max(14px, env(safe-area-inset-top)); left: 16px; }
.frame__corner--tr { top: max(14px, env(safe-area-inset-top)); right: 62px; }
.frame__corner--bl { bottom: 14px; left: 16px; }
.frame__corner a { color: inherit; text-decoration: none; pointer-events: auto; }
.frame__corner a:hover { color: #7ce6ff; }

.hint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(150, 205, 235, 0.5);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 300ms ease;
}
.hint.is-gone { opacity: 0; }

@media (max-width: 560px) {
  .frame__corner--bl { display: none; }
  .frame__corner--tr { display: none; }
}
