@font-face { font-family: Fredoka; src: url(/fonts/fredoka.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: Nunito; src: url(/fonts/nunito.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --bg: #1a1250; --bg2: #2a1f66; --bg3: #3a2a85; --line: rgba(255,255,255,.14);
  --sun: #ffd166; --sun2: #ffa94d; --mint: #7ee0b0; --pink: #ff8fab; --ink: #2a1f4d; --text: #f6f3ff; --muted: #c5bdea;
  --easy: #2ee59d; --medium: #ffb020; --hard: #ff4d6d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg) radial-gradient(1000px 600px at 75% -10%, #4b2c94 0%, transparent 70%) no-repeat; color: var(--text); font: 17px/1.55 Nunito, system-ui, sans-serif; }
h1, h2, h3, .brand, .btn, .tier, .hud, .points b, .rating { font-family: Fredoka, "Arial Rounded MT Bold", system-ui, sans-serif; }
h1, h2, h3 { line-height: 1.12; margin: 0; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: 1.7rem; }
a { color: var(--mint); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(16px, 4vw, 40px); }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 1.5rem; font-weight: 700; }
.brand i { color: var(--sun); font-style: normal; }
.brand .mascot { width: 30px; height: 37px; }
.top nav { display: flex; gap: clamp(10px, 2.4vw, 26px); }
.top nav a { color: var(--text); text-decoration: none; font-weight: 800; font-size: .95rem; }
.top nav a:hover { color: var(--sun); }
.top-right { display: flex; align-items: center; gap: clamp(10px, 2.4vw, 26px); }
.account:empty { display: none; }
.signin { border: 0; border-radius: 999px; padding: 6px 14px; background: var(--sun); color: var(--ink); font: 600 .95rem Fredoka, sans-serif; cursor: pointer; white-space: nowrap; }
.member { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--mint); color: var(--ink); font-weight: 800; text-decoration: none; }
.member img { width: 100%; height: 100%; object-fit: cover; display: block; }
dialog { border: 1px solid var(--line); border-radius: 22px; background: var(--bg2); color: var(--text); padding: 24px; width: min(360px, calc(100vw - 32px)); text-align: center; }
dialog::backdrop { background: rgba(10,6,40,.7); }
dialog p { color: var(--muted); }
dialog .small { font-size: .85rem; }
#google-button { display: flex; justify-content: center; min-height: 44px; }
#signin-note:empty { display: none; }
.account-page input { flex: 1; min-width: 0; font: inherit; padding: 11px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: #fff; }
.account-page label { display: block; font-weight: 800; margin-bottom: 6px; }
.account-page form .row { flex-wrap: nowrap; }
.account-page #stats { margin-bottom: 26px; }
#name-note:empty { display: none; }
.danger { border: 0; background: none; color: var(--hard); font: inherit; font-weight: 800; cursor: pointer; }

main { width: min(1120px, 100%); margin: 0 auto; padding: 20px clamp(16px, 4vw, 40px) 56px; flex: 1; }
main > section { margin-top: 64px; }
main > section.hero { margin-top: 24px; }
.lead { color: var(--muted); margin: 8px 0 22px; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.more { color: var(--mint); font-weight: 800; }

.btn { display: inline-block; border: 0; border-radius: 16px; padding: 13px 24px; background: var(--sun); color: var(--ink); font-size: 1.1rem; font-weight: 600; text-decoration: none; cursor: pointer; box-shadow: 0 5px 0 var(--sun2); transition: transform .08s, box-shadow .08s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 0 var(--sun2); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--sun2); }
.btn:disabled { background: #5d5398; color: #d8d2f3; box-shadow: none; cursor: not-allowed; }
.btn.big { font-size: 1.35rem; padding: 17px 32px; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--sun); }
.btn.ghost:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 0 0 2px var(--sun2); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.7rem, 7vw, 4.8rem); }
.hero h1 em { color: var(--sun); font-style: normal; }
.hero-copy > p { font-size: 1.2rem; color: var(--muted); max-width: 32em; margin: 18px 0 26px; }
.hero-copy .note { font-size: .95rem; margin-top: 18px; }
.hero-board { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 24px; padding: 22px; }
.hero-board h2 { font-size: 1.3rem; margin-bottom: 10px; }
.mascot.peek { width: 86px; height: 107px; }
.hero-board .mascot { position: absolute; top: -66px; right: 22px; width: 76px; height: 95px; }

.board { list-style: none; counter-reset: rank; margin: 0 0 10px; padding: 0; }
.board li { counter-increment: rank; display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.board li::before { content: counter(rank); width: 1.8em; font: 600 1rem Fredoka, sans-serif; color: var(--muted); }
.board li:nth-child(1)::before { color: var(--sun); }
.board .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.board li.you { background: rgba(255,209,102,.14); border-radius: 8px; }
.board-empty { color: var(--muted); margin: 8px 0; }
.board-page { max-width: 560px; margin-bottom: 28px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.steps b { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--mint); color: var(--ink); font: 700 1.3rem Fredoka, sans-serif; margin-bottom: 10px; }
.steps p { color: var(--muted); margin: 6px 0 0; }

.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mode { display: block; padding: 20px; border-radius: 20px; background: var(--bg2); border-top: 6px solid var(--mint); color: var(--text); text-decoration: none; transition: transform .12s; }
.mode:hover { transform: translateY(-3px); }
.mode.easy { border-color: var(--easy); } .mode.medium { border-color: var(--medium); } .mode.hard { border-color: var(--hard); } .mode.random { border-color: var(--pink); }
.mode p { color: var(--muted); margin: 6px 0 0; font-size: .95rem; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card a { color: var(--text); text-decoration: none; }
.card img { width: 100%; border-radius: 16px; display: block; }
.card h3 { margin-top: 10px; font-size: 1.1rem; }
.card p { color: var(--muted); margin: 2px 0 0; font-size: .92rem; }
.shorts { display: flex; gap: 12px; overflow-x: auto; padding: 14px 0; margin-bottom: 14px; }
.shorts img { width: 170px; border-radius: 14px; display: block; aspect-ratio: 9/16; object-fit: cover; background: var(--bg2); }

.video { max-width: 860px; }
.player { margin: 18px 0; aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; background: #000; position: relative; }
.player img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player iframe { width: 100%; height: 100%; border: 0; }
.player button { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; position: relative; }
.player button i { position: absolute; inset: 50% auto auto 50%; width: 84px; height: 60px; margin: -30px 0 0 -42px; border-radius: 16px; background: var(--hard); }
.player button i::after { content: ""; position: absolute; left: 33px; top: 17px; border-left: 24px solid #fff; border-block: 13px solid transparent; }
.player button:focus-visible { outline: 3px solid var(--sun); outline-offset: -3px; }
.soon { height: 100%; }
.soon p { position: absolute; left: 16px; bottom: 6px; background: var(--ink); padding: 4px 14px; border-radius: 10px; font-weight: 800; }
.video h2 { margin-top: 34px; font-size: 1.3rem; }
.chapters { list-style: none; padding: 0; margin: 10px 0; }
.chapters b { color: var(--mint); margin-right: 10px; }
details { margin-top: 30px; background: var(--bg2); border-radius: 16px; padding: 14px 18px; }
summary { font-weight: 800; cursor: pointer; }
details h3 { margin: 18px 0 8px; }
.answers { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.answers li { display: flex; align-items: center; gap: 8px; }
.answers img { width: 30px; height: 20px; object-fit: cover; border-radius: 3px; }

.prose { max-width: 680px; }
.prose h2 { margin: 26px 0 6px; font-size: 1.3rem; }
.prose p { color: var(--muted); }
.center { text-align: center; }

footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
footer p { display: flex; align-items: center; gap: 8px; margin: 0; }
footer .mascot { width: 24px; height: 30px; }
footer nav { display: flex; gap: 18px; }

.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 16px; }
.game-card { display: flex; gap: 18px; align-items: center; padding: 22px; border-radius: 22px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .12s; }
.game-card:hover { transform: translateY(-3px); }
.game-card .mascot { flex: none; }
.game-card h3 { font-size: 1.4rem; }
.game-card p { margin: 6px 0 0; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { padding: 1px 10px; border-radius: 999px; background: var(--bg3); color: var(--text); font-size: .82rem; font-weight: 800; }

/* shape game */
.shape-wrap { display: grid; place-items: center; background: #0b1233; }
#shape { width: 100%; height: 100%; display: block; padding: 8px; }
#shape-path { fill: var(--sun); stroke: var(--sun2); stroke-width: 2; stroke-linejoin: round; transition: fill .3s; }
#shape-path.right { fill: var(--easy); stroke: #fff; }
#asker { display: grid; gap: 12px; }
.asker-top { display: flex; justify-content: space-between; align-items: center; margin: 0; color: var(--muted); font-weight: 800; }
#asker h1 { font-size: 1.5rem; }
.name-box { position: relative; }
.name-box input { width: 100%; font: inherit; padding: 13px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); color: #fff; }
.name-box input:disabled { opacity: .55; }
#suggestions { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 5; list-style: none; margin: 0; padding: 6px; border-radius: 14px; background: var(--bg3); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0,0,0,.4); }
#suggestions li { padding: 8px 10px; border-radius: 9px; cursor: pointer; font-weight: 800; }
#suggestions li.active, #suggestions li:hover { background: var(--sun); color: var(--ink); }
.tries { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tries:empty { display: none; }
.tries li { display: grid; grid-template-columns: 1fr auto 26px; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 10px; background: rgba(255,77,109,.16); }
.tries small { color: var(--muted); }
.tries b { font-size: 1.2rem; text-align: center; color: var(--sun); }
.answer-card { display: flex; align-items: center; gap: 12px; }
.answer-card img { width: 72px; height: 48px; object-fit: contain; border-radius: 6px; }
.answer-card h2 { font-size: 1.5rem; overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#stage { overflow: visible; }

/* game */
body.game { height: 100dvh; overflow: hidden; }
body.game .top { padding-block: 6px; }
.arena { width: 100%; max-width: none; padding: 0 16px 16px; flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
.arena > section { margin-top: 0; }
.globe-wrap { position: relative; min-height: 0; min-width: 0; border-radius: 22px; overflow: hidden; background: #060a1c; }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); padding: 16px; text-align: center; }
.zoom { position: absolute; right: 12px; bottom: 12px; display: grid; gap: 8px; }
.zoom button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(42,31,102,.9); color: #fff; font-size: 1.5rem; cursor: pointer; }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; }
.hud { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--muted); font-size: .95rem; }
.hud #total { color: var(--sun); font-size: 1.5rem; }
.timer { height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--mint); transform-origin: left; }
.timer i.low { background: var(--hard); }
.ask { display: flex; gap: 14px; align-items: center; }
.ask img { width: 108px; height: 72px; object-fit: contain; border-radius: 8px; background: rgba(0,0,0,.2); flex: none; }
.ask p { margin: 4px 0 0; color: var(--muted); font-weight: 800; line-height: 1; }
.ask h1 { font-size: clamp(1.5rem, 3vw, 2rem); overflow-wrap: anywhere; }
.tier { display: inline-block; padding: 1px 10px; border-radius: 999px; color: #08101f; font-size: .78rem; font-weight: 600; text-transform: uppercase; }
#next { width: 100%; }
.versus-bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.versus-bar div { min-width: 0; display: grid; }
.versus-bar div:last-child { text-align: right; }
.versus-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 800; font-size: .92rem; }
.versus-bar b { font: 600 1.6rem Fredoka, sans-serif; color: var(--sun); }
.versus-bar div:last-child b { color: var(--pink); }
.versus-bar i { color: var(--muted); font-style: normal; font-weight: 800; }
#question { display: grid; gap: 14px; }
.rival-status { margin: 0; color: var(--pink); font-weight: 800; }
.rival-status:empty { display: none; }
.link { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--bg); overflow-wrap: anywhere; font-weight: 800; }
.summary .lead { margin: 0; text-align: center; }
.summary #setup-note, .summary #lobby-note { margin: 0; color: var(--muted); }
#setup-note:empty, #lobby-note:empty { display: none; }
.duel-recap li { grid-template-columns: 1fr 60px 60px; }
#rematch { width: 100%; }
.hint { margin: 0; color: var(--muted); font-weight: 800; }
#outcome { display: grid; gap: 10px; }
.points { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.points b { font-size: 2rem; color: var(--mint); }
.points b.miss { color: var(--medium); }
.points span { text-align: right; }
#fact { margin: 0; color: var(--muted); font-size: .95rem; }
.summary { grid-column: 2; }
.summary .mascot { align-self: center; flex: none; }
.summary h1 { text-align: center; color: var(--sun); }
.summary h1 small { color: var(--muted); font-size: 1.1rem; }
.rating { text-align: center; margin: 0; font-size: 1.2rem; color: var(--mint); }
.versus { text-align: center; font-weight: 800; margin: 0; }
.recap { list-style: none; margin: 0; padding: 0; }
.recap li { display: grid; grid-template-columns: 1fr auto 60px; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.recap small { color: var(--muted); }
.recap b { text-align: right; }
.summary label { display: block; font-weight: 800; margin-bottom: 6px; }
.summary input { flex: 1; min-width: 0; font: inherit; padding: 11px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: #fff; }
.summary form .row { flex-wrap: nowrap; }
#rank, #share-note { margin: 0; color: var(--muted); }
#rank:empty, #share-note:empty { display: none; }
.summary > .row .btn { flex: 1; text-align: center; white-space: nowrap; font-size: 1rem; padding-inline: 12px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-board { margin-top: 40px; }
  .steps { grid-template-columns: 1fr; gap: 18px; }
  .modes { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .games { grid-template-columns: 1fr; }
  .arena { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; padding: 0 10px 10px; gap: 10px; }
  .panel { padding: 12px; gap: 10px; max-height: 46dvh; }
  .summary { grid-column: 1; grid-row: 1 / -1; max-height: none; }
  .ask img { width: 72px; height: 48px; }
  .top nav a { font-size: .85rem; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
