/* Hoop Hop — self-contained styles (legacy-static, no Tailwind). Dark arena
   theme; the canvas paints the court, this just frames it + the menus/HUD. */
:root {
  --bg0: #0b1020;
  --bg1: #131a30;
  --ink: #eef2ff;
  --muted: #9aa6c8;
  --accent: #ff8a3d;   /* basketball orange */
  --accent2: #ffb066;
  --good: #5be59a;
  --panel: rgba(16, 22, 42, 0.92);
  --line: rgba(255, 255, 255, 0.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: radial-gradient(120% 90% at 50% 0%, #16203c 0%, var(--bg0) 60%);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden; overscroll-behavior: none; touch-action: none;
}

#stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

/* The canvas keeps a portrait play area, centered and letterboxed by JS. */
#game {
  display: block;
  width: 100%; height: 100%;
  touch-action: none;
}

/* ─── HUD ─────────────────────────────────────────────────────────────── */
#hud {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; flex-direction: column; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 14px 14px;
}
#hud[hidden] { display: none; }

#hud-score {
  font-size: clamp(40px, 9vh, 72px); font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 138, 61, 0.35);
  line-height: 1;
}
#hud-goal {
  margin-top: 4px; font-size: 14px; color: var(--muted);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
#hud-goal.done { color: var(--good); }
#hud-goal b { color: inherit; }

#claim-btn {
  pointer-events: auto;
  margin-top: 14px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  color: #20130a; border: 0; border-radius: 999px;
  font-size: 15px; font-weight: 800; padding: 11px 20px;
  cursor: pointer; box-shadow: 0 6px 18px rgba(255, 138, 61, 0.45);
  animation: pop 0.35s ease both;
}
#claim-btn[hidden] { display: none; }

#claim-panel {
  pointer-events: auto;
  margin-top: 12px;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: pop 0.35s ease both;
}
#claim-panel[hidden] { display: none; }
.claim-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted);
}
#claim-word {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 18px; font-weight: 700; color: var(--good);
  letter-spacing: 0.04em;
}
#claim-copy {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06);
  color: var(--ink); border-radius: 8px; padding: 5px 10px;
  font-size: 12px; cursor: pointer;
}

#banner {
  pointer-events: none;
  margin-top: auto; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 14px;
  font-size: 14px; max-width: 90%; text-align: center;
  transition: opacity 0.4s ease;
}
#banner[hidden] { display: none; }

/* ─── overlays / menus ────────────────────────────────────────────────── */
.overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 11, 23, 0.72); backdrop-filter: blur(3px);
  padding: 20px;
}
.overlay[hidden] { display: none; }

.panel {
  width: min(420px, 92vw);
  background: linear-gradient(180deg, var(--bg1), var(--bg0));
  border: 1px solid var(--line); border-radius: 20px;
  padding: 26px 24px; text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
#menu-start .logo {
  display: block; width: 150px; height: auto; margin: 0 auto 6px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}
.panel h1 {
  margin: 0 0 6px; font-size: 34px; font-weight: 900;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline { margin: 0 0 18px; color: var(--muted); font-size: 15px; }

.btn {
  appearance: none; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  color: #20130a; font-weight: 800; font-size: 17px;
  padding: 13px 30px; border-radius: 999px;
  box-shadow: 0 8px 22px rgba(255, 138, 61, 0.4);
}
/* press feedback that does NOT shift layout (no translate) */
.btn:active { filter: brightness(0.92); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); box-shadow: none;
  font-size: 15px; padding: 10px 22px;
}

/* win modal: Copy + Play again on one row, fixed widths so nothing jumps when
   the copy button swaps to "Copied!", GC link sits below on its own line */
.win-actions {
  display: flex; gap: 8px; justify-content: center; align-items: stretch;
  flex-wrap: wrap; margin-bottom: 6px;
}
.win-actions .btn { margin: 0; font-size: 15px; padding: 11px 14px; white-space: nowrap; }
.btn-copy { min-width: 150px; }            /* fits "Copy codeword" so "Copied!" can't shrink it */
.win-actions .btn-ghost { min-width: 104px; }

.howto {
  list-style: none; margin: 20px 0 0; padding: 0;
  text-align: left; color: var(--muted); font-size: 14px;
}
.howto li { padding: 6px 0; border-top: 1px solid var(--line); }
.howto li:first-child { border-top: 0; }
.key {
  display: inline-block; min-width: 1.4em; text-align: center;
  padding: 1px 7px; margin: 0 1px;
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; background: rgba(255, 255, 255, 0.05);
  font-size: 12px; color: var(--ink);
}

.win-title { color: var(--good) !important; -webkit-text-fill-color: var(--good); }
.win-sub, .lose-sub { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.keyword-box {
  margin: 0 0 16px; padding: 14px;
  background: rgba(91, 229, 154, 0.10);
  border: 1px dashed rgba(91, 229, 154, 0.5); border-radius: 12px;
}
.keyword-box code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 24px; font-weight: 800; color: var(--good);
  letter-spacing: 0.06em; word-break: break-word;
}
.gc-link {
  display: block; margin: 12px 0 0; color: var(--accent2);
  font-size: 14px; text-decoration: none;
}
.gc-link:hover { text-decoration: underline; }
.loading { color: var(--muted); font-size: 16px; }

@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
