/* Neon Maze — game screen styling (shares arcade.css theme + flap-style overlays). */
.game-body { overflow: hidden; height: 100svh; }
#stage { position: fixed; inset: 0; overflow: hidden;
  background: linear-gradient(160deg, #1a0a3e, #0b0417 80%);
  touch-action: none; user-select: none; -webkit-user-select: none; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 30; display: flex;
  justify-content: space-between; align-items: center; padding: max(10px, env(safe-area-inset-top)) 14px 0; pointer-events: none; }
.icon-btn { pointer-events: auto; cursor: pointer; font: inherit; font-size: 1.3rem; line-height: 1;
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
  background: rgba(32,16,64,0.55); border: 1.5px solid var(--panel-brd); border-radius: 50%;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-decoration: none; transition: transform .1s, background .2s; }
.icon-btn:hover { background: rgba(168,85,247,0.3); }
.icon-btn:active { transform: scale(0.92); }

.hud { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.timer { position: absolute; top: max(54px, calc(env(safe-area-inset-top) + 50px)); left: 0; right: 0; text-align: center;
  font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 900; color: #fff; text-shadow: 0 0 20px rgba(217,70,239,0.8); font-variant-numeric: tabular-nums; }
.hud-players { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 0; right: 0; display: flex; flex-wrap: wrap;
  justify-content: center; gap: 6px; padding: 0 70px; }
.chip { font-size: .72rem; font-weight: 800; color: #fff; padding: .2em .6em; border-radius: 999px;
  background: rgba(32,16,64,0.6); border: 1px solid var(--panel-brd); white-space: nowrap; }
.chip.done { color: #ffd54a; }
.chip .dot { display: inline-block; width: .5em; height: .5em; border-radius: 50%; margin-right: .35em; vertical-align: middle; }

/* D-pad */
.dpad { position: absolute; z-index: 28; right: max(16px, env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 20px);
  width: 168px; height: 168px; pointer-events: none; }
.dbtn { position: absolute; pointer-events: auto; width: 56px; height: 56px; font-size: 1.3rem; color: #fff; cursor: pointer;
  background: rgba(32,16,64,0.6); border: 1.5px solid var(--panel-brd); border-radius: 14px; backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; touch-action: none; }
.dbtn:active { background: rgba(168,85,247,0.4); transform: scale(0.94); }
.dbtn.up { top: 0; left: 56px; } .dbtn.left { top: 56px; left: 0; }
.dbtn.right { top: 56px; left: 112px; } .dbtn.down { top: 112px; left: 56px; }
@media (min-width: 820px) and (pointer: fine) { .dpad { display: none !important; } }

/* overlays (reuse flap look) */
.screen { position: absolute; inset: 0; z-index: 25; display: none; align-items: center; justify-content: center;
  padding: 20px; padding-top: max(20px, calc(env(safe-area-inset-top) + 60px)); }
.screen.on { display: flex; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.title-card { text-align: center; max-width: 420px; }
.title { font-size: clamp(2.8rem, 15vw, 5rem); font-weight: 900; letter-spacing: -2px; margin: 0; line-height: .9; }
.title span { display: block; background: linear-gradient(120deg, var(--neon), var(--magenta), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 26px rgba(217,70,239,0.6)); }
.tag { color: var(--ink-dim); margin: 14px auto 22px; max-width: 28ch; }
.menu-btns { display: flex; flex-direction: column; gap: 12px; }
.best-line { color: var(--ink-mut); margin-top: 18px; font-weight: 600; } .best-line b { color: var(--neon); }

.panel.over-card, .panel.setup-card, .panel.lobby-card, .panel.results-card { width: 100%; max-width: 380px; padding: 26px 24px; text-align: center; }
.over-card h2, .setup-card h2, .results-card h2 { font-size: 1.5rem; }
.over-score { font-size: 3.4rem; font-weight: 900; color: #fff; line-height: 1; text-shadow: 0 0 30px rgba(217,70,239,0.7); }
.over-best { color: var(--ink-dim); margin: 8px 0 18px; } .over-best b { color: var(--neon); }
.new-badge { color: #ffd54a; font-weight: 900; font-size: .85rem; margin-left: 6px; }
.over-btns { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.lbl, .lobby-label { display: block; text-align: left; color: var(--ink-dim); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 6px; }
.lobby-label { text-align: center; }
.nick-row, .join-row { display: flex; gap: 8px; align-items: stretch; }
.nick-row .field, .join-row .field { flex: 1; } .nick-row .icon-btn { flex: none; border-radius: 12px; }
.nick-hint { color: var(--ink-mut); font-size: .78rem; margin: 6px 0 16px; text-align: left; }
.nick-hint.bad { color: var(--pink); }
.submit-row { margin: 8px 0; } .submit-row .btn { width: 100%; margin-top: 4px; }
.submit-done { color: #7cf29a; font-weight: 800; margin: 10px 0; }
.setup-card .btn.big { width: 100%; }
.or { color: var(--ink-mut); font-size: .8rem; margin: 16px 0 10px; }
.join-row { margin-bottom: 8px; } .join-row .btn { flex: none; }
.err { color: var(--pink); font-weight: 700; font-size: .85rem; margin: 10px 0 0; min-height: 1em; }
.btn.small { font-size: .85rem; padding: .55em 1.1em; } .setup-card .small, .lobby-card .small { margin-top: 16px; }
.code-big { font-size: 2.8rem; font-weight: 900; letter-spacing: 6px; color: #fff; text-shadow: 0 0 26px rgba(217,70,239,0.7); margin: 4px 0 10px; }
.player-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.player-list li { display: flex; align-items: center; gap: 8px; font-weight: 700; background: rgba(11,4,23,0.4);
  border: 1px solid rgba(168,85,247,0.18); border-radius: 10px; padding: .5em .8em; }
.player-list li .host { margin-left: auto; font-size: .72rem; color: #ffd54a; font-weight: 800; }
.player-list li .me { margin-left: auto; font-size: .72rem; color: var(--pink); font-weight: 800; }
.player-list .swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.wait { color: var(--ink-dim); font-weight: 700; font-style: italic; }
.count-num { font-size: clamp(6rem, 40vw, 16rem); font-weight: 900; color: #fff; text-shadow: 0 0 60px rgba(217,70,239,0.9); animation: pulse .9s ease; }
.count-num.go { color: var(--pink); }
@keyframes pulse { 0% { transform: scale(0.4); opacity: 0 } 40% { transform: scale(1.1); opacity: 1 } 100% { transform: scale(1); opacity: 1 } }
.results-list { list-style: none; counter-reset: r; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.results-list li { counter-increment: r; display: flex; align-items: center; gap: 10px; background: rgba(11,4,23,0.4);
  border: 1px solid rgba(168,85,247,0.18); border-radius: 12px; padding: .6em .9em; font-weight: 700; }
.results-list li::before { content: counter(r); font-weight: 900; color: var(--neon); width: 1.4em; }
.results-list li:first-child { border-color: #ffd54a66; background: rgba(255,213,74,0.08); }
.results-list li:first-child::before { content: "🏆"; }
.results-list li .swatch { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.results-list li .pts { margin-left: auto; color: #fff; font-weight: 900; }
.results-list li.me { color: var(--pink); }
.winner-tag { color: #ffd54a; font-weight: 900; }
.toast { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); z-index: 40;
  background: rgba(32,16,64,0.9); border: 1px solid var(--panel-brd); color: var(--ink); padding: .6em 1.1em; border-radius: 999px;
  font-weight: 700; font-size: .85rem; max-width: 90vw; text-align: center; }
@media (orientation: landscape) and (max-height: 520px) {
  .panel.over-card, .panel.setup-card, .panel.lobby-card, .panel.results-card { max-height: 86svh; overflow-y: auto; }
}
