/* Soccalator: a floodlit stadium at night, a green pitch, Mr J's gold. */
@font-face { font-family: Bravura; src: url(bravura.woff2) format('woff2'); font-display: block; }

:root {
  --gold: #ffc21a;
  --ink: #04140b;
  --grass: #1f8a3e;
  --wrong: #ff4040;
  --right: #22d36e;
  --text: #f2fff6;
  --muted: #a9c9b4;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
/* No double-tap zoom on iPads (game.js does the rest), and no copy menu on a long press. */
body { background: var(--ink); color: var(--text); font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  display: flex; flex-direction: column; touch-action: manipulation; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

/* ── Top bar ── */
.bar { flex: none; display: flex; align-items: center; gap: 14px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(4, 20, 11, .9); border-bottom: 1px solid rgba(255, 194, 26, .25); z-index: 3; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: 3px; font-size: 18px; }
.logo { width: 30px; height: 30px; background: url(icon.svg) center / contain no-repeat; }
.hud { flex: 1; display: flex; justify-content: center; gap: 26px; font-size: 15px; color: var(--muted); font-weight: 700; }
.hud b { color: var(--text); font-size: 20px; margin-left: 4px; }
.lives { display: flex; gap: 5px; align-items: center; }
.lives i { width: 20px; height: 20px; background: url(icon-ball.svg) center / contain no-repeat; }
.lives i.gone { opacity: .18; }
.bar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bar-btn { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 7px 14px; font-weight: 700; }
.chip { font-size: 13px; color: var(--muted); }

/* ── The pitch ── */
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #071a2e; }
#pitch { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.banner { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); font-size: clamp(40px, 9vw, 96px); font-weight: 900; z-index: 4;
  color: var(--gold); letter-spacing: 4px; text-shadow: 0 4px 0 #6b4d00, 0 0 30px rgba(255, 194, 26, .8); pointer-events: none; animation: banner 1.3s ease-out forwards; white-space: nowrap; }
.banner.saved { color: #fff; text-shadow: 0 4px 0 #444, 0 0 26px rgba(255, 255, 255, .6); }
.banner.small { font-size: clamp(26px, 5vw, 52px); }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }

/* ── Panels ── */
.panel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 16px 20px; text-align: center; z-index: 2; overflow: auto;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .14), transparent 55%), rgba(3, 16, 9, .72); }
.panel::before, .panel::after { content: ''; margin: auto; }
.title { margin: 0; font-size: clamp(42px, 9vw, 92px); font-weight: 900; letter-spacing: clamp(3px, 1vw, 10px);
  color: #fff; text-shadow: 0 5px 0 #127034, 0 0 24px rgba(255, 255, 255, .35); }
.small-title { font-size: clamp(34px, 6vw, 60px); }
.tag { margin: 6px 0 10px; font-size: clamp(17px, 2.6vw, 24px); color: var(--gold); font-weight: 900; letter-spacing: 1px; }
.menu-keeper { height: clamp(120px, 24vh, 230px); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
.how { max-width: 560px; font-size: 16.5px; line-height: 1.4; margin: 10px 0 14px; }
.small { color: var(--muted); font-size: 14px; max-width: 560px; }
.best { color: var(--gold); font-weight: 800; min-height: 1em; margin: 0 0 8px; }
.go, .ghost { border-radius: 999px; padding: 13px 26px; font-weight: 900; font-size: 18px; }
.go { background: var(--gold); color: #111; border: 0; box-shadow: 0 5px 0 #a87800; }
.big-go { font-size: 22px; padding: 15px 34px; }
.ghost { background: transparent; border: 1.5px solid rgba(255, 255, 255, .45); }
#boards-btn { color: var(--gold); border-color: var(--gold); }
.big-score { margin: 10px 0 0; font-size: clamp(28px, 5vw, 44px); font-weight: 900; }
.over-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ── The top 10 ── */
.board-wrap, .over-board { width: min(420px, 92vw); margin: 10px 0 18px; }
.over-board h3 { margin: 0 0 6px; color: var(--gold); }
.board { list-style: none; padding: 0; margin: 0; counter-reset: rank; text-align: left; }
.board li { display: grid; grid-template-columns: 30px minmax(56px, max-content) 1fr auto; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; counter-increment: rank; }
.board li::before { content: counter(rank); font-weight: 900; color: var(--muted); }
.board li:nth-child(odd) { background: rgba(255, 255, 255, .07); }
.board li.mine { background: var(--gold); color: #111; }
.board li.mine::before, .board li.mine .cls { color: #111; }
.board .who { font-weight: 900; font-size: 18px; letter-spacing: 2px; white-space: nowrap; }
.board .cls { color: var(--muted); font-size: 14px; }
.board .pts { font-weight: 900; font-size: 18px; }
.ini-card { background: rgba(4, 30, 15, .9); border: 1.5px solid var(--gold); border-radius: 18px; padding: 14px 16px; }
.ini-card h3 { color: var(--gold); font-size: 22px; margin: 0 0 6px; }
.cls-pick { display: flex; gap: 10px; align-items: center; justify-content: center; font-weight: 700; margin: 8px 0 4px; }
.cls-pick select { font: inherit; font-size: 17px; padding: 8px 10px; border-radius: 10px; }
.ini { display: flex; gap: 10px; justify-content: center; margin: 8px 0 10px; }
.ini input { width: 72px; height: 76px; padding: 0; font-size: 40px; font-weight: 900; text-align: center; text-transform: uppercase; border: 3px solid var(--gold); border-radius: 12px;
  -webkit-user-select: text; user-select: text; }
.err { color: #ff8080; font-weight: 700; margin: 0 0 8px; }

/* ── The keyboard: one octave, no names on the keys ── */
.controls { flex: none; padding: 10px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: #020a05; border-top: 2px solid rgba(255, 194, 26, .35); }
.piano { position: relative; display: flex; height: clamp(140px, 25vh, 240px); max-width: 860px; margin: 0 auto; touch-action: none; }
.key { position: relative; -webkit-tap-highlight-color: transparent; }
.key.white { flex: 1; background: linear-gradient(#fff, #e9ecf0); border: 1px solid #0a0a0a; border-top: 0; border-radius: 0 0 10px 10px; margin: 0 2px; }
.key.black { position: absolute; top: 0; width: calc(100% / 7 * .62); height: 60%; background: linear-gradient(#2a2d33, #0c0d10); border: 1px solid #000;
  border-radius: 0 0 8px 8px; z-index: 2; box-shadow: inset 0 -6px 0 #333; }
.key.down.white { background: #d7dce4; }
.key.down.black { background: #444; }
.key.right { animation: right .4s ease-out; }
.key.wrong-flash { animation: wrong-flash .26s steps(1) 3; }
@keyframes right { 0% { box-shadow: inset 0 0 0 999px rgba(34, 211, 110, .9), 0 0 24px var(--right); } 100% { box-shadow: inset 0 0 0 999px rgba(34, 211, 110, 0); } }
@keyframes wrong-flash { 0% { box-shadow: inset 0 0 0 999px rgba(255, 64, 64, .95), 0 0 24px var(--wrong); } 60% { box-shadow: none; } }

@media (max-width: 640px) {
  .brand { font-size: 0; gap: 0; }
  .hud { gap: 14px; font-size: 13px; }
}

/* ── Help: most of the screen ── */
.help { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .6); display: flex; padding: 3vh 3vw; }
.help-card { flex: 1; overflow: auto; background: #06210f; border: 2px solid rgba(255, 194, 26, .5); border-radius: 22px; padding: 14px 22px 22px; }
.help-head { display: flex; justify-content: space-between; align-items: center; }
.help-head h2 { margin: 0; color: var(--gold); }
.help-card h3 { margin: 14px 0 8px; }
.help-warn { color: #ff9a9a; font-weight: 800; margin: 8px 0 0; text-align: center; }
.help-keys { position: relative; display: flex; height: 140px; max-width: 600px; margin: 0 auto; }
.help-keys i { flex: 1; background: #fff; color: #111; border: 1px solid #000; border-radius: 0 0 8px 8px; margin: 0 1px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; font-style: normal; font-size: 20px; }
.help-keys u { position: absolute; top: 0; width: calc(100% / 7 * .62); height: 62%; background: #15161f; color: #fff; text-decoration: none; border-radius: 0 0 6px 6px;
  display: flex; align-items: flex-end; justify-content: center; text-align: center; padding-bottom: 6px; font-size: 12px; font-weight: 800; line-height: 1.15; }
.help-stave { width: 100%; max-height: 34vh; display: block; }
.help-stave .ln { stroke: #9fe0b4; stroke-width: .9; }
.help-stave .ledger { stroke: #fff; stroke-width: 1.2; }
.mus { font-family: Bravura; font-size: 40px; fill: #fff; }
.help-stave .nm { font-size: 11px; font-weight: 900; fill: var(--gold); text-anchor: middle; }
.help-tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.help-tips p { margin: 0; background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px 12px; font-size: 15px; line-height: 1.4; }
