@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@700;800&family=JetBrains+Mono:wght@600;800&family=Manrope:wght@500;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #08091a;
  --bg2: #1a0d2e;
  --card: rgba(255, 255, 255, 0.08);
  --card2: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.18);
  --text: #f9fbff;
  --muted: #aeb8d6;
  --red: #ef3b3b;
  --yellow: #ffc93c;
  --cyan: #41d7ff;
  --green: #28e58b;
  --danger: #ff5d73;
  --radius: 26px;
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 20% 10%, rgba(239, 59, 59, .34), transparent 28%), radial-gradient(circle at 85% 0%, rgba(65, 215, 255, .25), transparent 30%), linear-gradient(160deg, var(--bg), var(--bg2)); color: var(--text); }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .16; background-image: radial-gradient(circle, #fff 1px, transparent 1px); background-size: 22px 22px; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100dvh; display: grid; place-items: center; padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); }
.phone { width: min(430px, 100%); min-height: min(860px, 100dvh - 28px); position: relative; padding: 20px 16px 92px; border: 1px solid rgba(255,255,255,.14); border-radius: 36px; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.45); background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035)); backdrop-filter: blur(18px); }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 55px rgba(0,0,0,.24); }
.hero { display: grid; gap: 18px; margin-top: 8vh; }
h1, h2 { font-family: 'Bricolage Grotesque', Manrope, sans-serif; margin: 0; line-height: .96; }
h1 { font-size: clamp(42px, 12vw, 72px); letter-spacing: -.06em; }
h2 { font-size: 26px; }
p { line-height: 1.55; color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--yellow); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; font-weight: 900; }
.legal, .muted { color: var(--muted); font-size: 12px; }
.primary, .ghost, .danger, .answers button, .tabbar button { border: 0; border-radius: 18px; padding: 14px 16px; color: var(--text); font-weight: 900; }
.primary { background: linear-gradient(135deg, var(--red), #ff784d); box-shadow: 0 15px 34px rgba(239,59,59,.32); }
.primary.big { width: 100%; font-size: 18px; padding: 18px; }
.ghost { background: rgba(255,255,255,.1); border: 1px solid var(--line); }
.danger { width: 100%; background: linear-gradient(135deg, var(--yellow), #ff8c2b); color: #220d04; margin-top: 14px; }
.hidden { display: none !important; }
.auth-card { display: grid; gap: 13px; margin-top: 6vh; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 900; }
input { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; background: rgba(0,0,0,.22); color: var(--text); outline: none; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(65,215,255,.12); }
.topline, .game-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.avatar, .pill { border: 1px solid var(--line); background: rgba(255,255,255,.1); color: var(--text); border-radius: 999px; padding: 10px 12px; font-weight: 900; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { padding: 14px 10px; }
.stat span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.stat strong { display: block; margin-top: 5px; font-family: 'JetBrains Mono', monospace; font-size: 18px; }
.start-card { display: grid; gap: 12px; }
.game-head h1, .final-card h1 { font-family: 'JetBrains Mono', monospace; color: var(--yellow); text-shadow: 0 0 22px rgba(255,201,60,.25); }
.arena { padding: 14px; }
.art-wrap { position: relative; width: 100%; aspect-ratio: 1; border-radius: 24px; overflow: hidden; background: #03040c; border: 1px solid rgba(255,255,255,.2); }
.art-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.12) contrast(1.03); }
.grid-cover { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(40, 1fr); grid-template-rows: repeat(40, 1fr); }
.grid-cover i { background: #02030a; border: .5px solid rgba(255,255,255,.035); transition: opacity .12s linear, transform .12s linear; }
.grid-cover i.revealed { opacity: 0; transform: scale(.35); }
.reveal-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 10px; }
.answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 12px; }
.answers button { min-height: 48px; background: rgba(255,255,255,.1); border: 1px solid var(--line); }
.answers button:hover { border-color: var(--cyan); }
.answers button.wrong, .answers button:disabled { opacity: .45; background: rgba(255, 93, 115, .22); }
.toast { min-height: 20px; color: var(--danger); font-weight: 900; text-align: center; }
.result-card, .final-card { display: grid; gap: 12px; text-align: center; }
.result-img { width: min(72vw, 300px); aspect-ratio: 1; object-fit: cover; border-radius: 26px; justify-self: center; border: 1px solid var(--line); }
.score-line { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); }
.score-line strong { color: var(--text); font-family: 'JetBrains Mono', monospace; }
.rankings { margin-bottom: 14px; }
ol { margin: 12px 0 0; padding-left: 22px; }
li { margin: 9px 0; color: var(--muted); }
li span { color: var(--text); font-weight: 900; }
li strong { float: right; color: var(--yellow); font-family: 'JetBrains Mono', monospace; }
.tabbar { position: absolute; left: 14px; right: 14px; bottom: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px; border-radius: 24px; background: rgba(0,0,0,.36); border: 1px solid var(--line); backdrop-filter: blur(14px); }
.tabbar button { background: rgba(255,255,255,.1); font-size: 12px; padding: 12px 8px; }
.admin p { margin-bottom: 0; }
@media (min-width: 760px) { .phone { min-height: 860px; } }
