:root { --gold: #ffcc33; --ink: #14060a; --pixel: "Press Start 2P", ui-monospace, monospace; }
body { margin: 0; min-height: 100vh; font-family: "Chakra Petch", system-ui, sans-serif; color: #fff; background-color: var(--bg-bottom); background-image: linear-gradient(rgba(0, 0, 0, .12) 2px, transparent 2px), linear-gradient(90deg, rgba(0, 0, 0, .12) 2px, transparent 2px), linear-gradient(180deg, var(--bg-top), var(--bg-bottom)); background-size: 32px 32px, 32px 32px, 100% 100%; background-attachment: fixed; }
main { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 60px 16px 16px; }
body.typing { --bg-top: #22a757; --bg-bottom: #0d5a2c; }
body.speed { --bg-top: #10a8bc; --bg-bottom: #075c69; }
body.bar { --bg-top: #b8860b; --bg-bottom: #5e4200; --gold: #fff3b0; }
body.reaction { --bg-top: #2b6be0; --bg-bottom: #0e2c78; }
p { text-shadow: 1px 1px 0 rgba(0, 0, 0, .45); }
h1 { font-family: var(--pixel); font-weight: 400; font-size: 1.1rem; line-height: 1.4; color: var(--gold); text-shadow: 3px 3px 0 var(--ink); }
.back { display: inline-block; padding: 9px 12px; font-family: var(--pixel); font-size: .6rem; color: var(--ink); text-decoration: none; background: var(--gold); box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); }
.reaction-pad { display: block; width: 100%; height: 220px; font-family: var(--pixel); font-size: .85rem; line-height: 1.6; color: #fff; border: 3px solid var(--gold); cursor: pointer; }
.reaction-pad[data-state="ready"] { background: var(--skin-ready, rgba(0, 0, 0, .35)); }
.reaction-pad[data-state="waiting"] { background: var(--skin-wait, #b71c1c); }
.reaction-pad[data-state="go"] { color: var(--ink); background: var(--skin-go, #4cd964); }
body.reaction .reaction-pad[data-state="go"] { background: #4cd964; }
.reaction-best { margin-top: 10px; font-weight: 700; color: var(--gold); }
.typing-text { position: relative; height: 112px; overflow: hidden; padding: 10px 12px; font-size: 1.15rem; line-height: 34px; color: var(--skin-text, #fff); background: var(--skin-box, rgba(0, 0, 0, .35)); border: 3px solid var(--gold); box-sizing: border-box; }
.typing-text .right { color: var(--skin-right, #6dff9b); }
.typing-text .wrong { color: #fff; background: #d62828; }
.typing-text .current { color: var(--ink); background: var(--gold); }
.typing-input { display: block; width: 100%; margin: 8px 0; padding: 10px; font: inherit; font-size: 1.05rem; box-sizing: border-box; border: 3px solid var(--gold); }
.typing-status { font-weight: 700; }
.typing-restart { margin-top: 8px; padding: 8px 12px; font-family: var(--pixel); font-size: .55rem; color: var(--ink); background: var(--gold); border: 0; cursor: pointer; }
.top-strip { position: relative; display: flex; justify-content: center; align-items: center; gap: 12px; height: 120px; padding: 0 16px; color: #fff; background: linear-gradient(180deg, #0a1636, #1f3f8a 65%, #7fb4e8); box-sizing: border-box; }
.top-strip > img, .top-strip > div { position: relative; }
.home-hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 60%; }
.top-strip img { height: 54px; width: auto; }
.top-strip div { display: grid; gap: 5px; }
.top-strip strong { font-family: var(--pixel); font-size: .75rem; font-weight: 400; line-height: 1.2; }
.top-strip span { font-size: .85rem; color: #ffcc33; }
.strip-waves { position: absolute; left: 0; top: calc(100% - 1px); width: 100%; height: 44px; transform: scaleY(-1); pointer-events: none; }
.share { display: block; margin-top: 10px; padding: 9px 12px; font-family: var(--pixel); font-size: .55rem; color: var(--ink); background: #fff; border: 0; box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); cursor: pointer; }
.share[hidden] { display: none; }
.bar-track { position: relative; height: 70px; overflow: hidden; background: var(--skin-track, rgba(0, 0, 0, .4)); border: 3px solid var(--gold); cursor: pointer; }
.bar-zone { position: absolute; top: 0; bottom: 0; background: var(--skin-zone, var(--gold)); }
.bar-marker { position: absolute; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: var(--skin-marker, #fff); box-shadow: 0 0 8px var(--skin-marker, #fff); }
.bar-status { margin-top: 10px; }
.bar-button { display: block; width: 100%; margin-top: 10px; padding: 14px; font-family: var(--pixel); font-size: .8rem; color: var(--ink); background: var(--gold); border: 0; box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); cursor: pointer; }
body.tiles { --bg-top: #e0762b; --bg-bottom: #7a3410; }
body.mazes { --bg-top: #d13f8f; --bg-bottom: #661447; }
body.codes { --bg-top: #7a3fd1; --bg-bottom: #2f1466; }
body.runners { --bg-top: #4a6a8a; --bg-bottom: #1c2c40; }
body.dodges { --bg-top: #2a2a5e; --bg-bottom: #0b0b24; }
.size-picker { display: flex; gap: 8px; margin-bottom: 10px; }
.size-picker button { flex: 1; min-height: 40px; padding: 8px; font-family: var(--pixel); font-size: .55rem; color: #fff; background: rgba(0, 0, 0, .35); border: 3px solid var(--gold); cursor: pointer; }
.size-picker button[aria-pressed="true"] { color: var(--ink); background: var(--gold); }
.bar-button[hidden] { display: none; }
.game-canvas { display: block; width: min(100%, 50vh); margin: 0 auto 10px; border: 3px solid var(--gold); box-sizing: border-box; touch-action: none; }
.game-canvas.wide { width: 100%; }
.game-canvas.tall { width: min(100%, 52vh); }
.pad { display: grid; gap: 6px; width: min(100%, 300px); margin: 10px auto; }
.pad button { min-height: 52px; font-family: var(--pixel); font-size: .7rem; color: var(--ink); background: var(--gold); border: 0; box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); cursor: pointer; touch-action: none; user-select: none; }
.pad-two { grid-template-columns: 1fr 1fr; }
.pad-four { grid-template-columns: repeat(3, 1fr); }
.pad-four [data-move="up"] { grid-column: 2; }
.pad-four [data-move="left"] { grid-column: 1; grid-row: 2; }
.pad-four [data-move="down"] { grid-column: 2; grid-row: 2; }
.pad-four [data-move="right"] { grid-column: 3; grid-row: 2; }
.tile-board { display: grid; gap: 3px; width: min(100%, 58vh); aspect-ratio: 1056 / 870; margin: 0 auto 10px; padding: 3px; background: #14060a; border: 3px solid var(--gold); box-sizing: border-box; }
.tile { position: relative; padding: 2px 4px; font-family: var(--pixel); font-size: .55rem; color: #fff; text-align: left; vertical-align: top; text-shadow: 1px 1px 0 #000; background-color: #0f2147; background-image: var(--skin-picture, url("logo/logo-on-dark.png")); border: 0; cursor: pointer; display: flex; align-items: flex-start; }
.tile.blank { background: none; cursor: default; }
.code-clue { padding: 12px; font-family: var(--pixel); font-size: 1rem; text-align: center; word-spacing: 2px; color: var(--skin-letter, #fff); background: var(--skin-clue, rgba(0, 0, 0, .35)); border: 3px solid var(--skin-edge, var(--gold)); }
.code-form .typing-input { margin-top: 10px; }
.code-form .bar-button { margin: 0 0 10px; }
.code-guesses { padding-left: 24px; }
.code-guesses li { margin-top: 4px; }
.code-guesses strong { color: var(--gold); text-transform: uppercase; }
.game-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.game-button { min-height: 34px; padding: 9px 12px; font-family: var(--pixel); font-size: .6rem; color: #fff; background: rgba(0, 0, 0, .45); border: 2px solid var(--gold); cursor: pointer; }
.game-button:hover { background: rgba(0, 0, 0, .7); }
.paused-screen { position: fixed; inset: 0; z-index: 40; display: grid; gap: 14px; place-content: center; justify-items: center; padding: 16px; background: #0f2147; }
.paused-screen[hidden] { display: none; }
.paused-screen h2 { margin: 0 0 6px; font-family: var(--pixel); font-size: 1.2rem; font-weight: 400; color: var(--gold); }
.paused-screen button { min-width: 220px; min-height: 48px; padding: 12px; font-family: var(--pixel); font-size: .7rem; color: var(--ink); background: var(--gold); border: 0; box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); cursor: pointer; }
.paused-screen button + button { color: #fff; background: rgba(255, 255, 255, .15); }
@media (max-width: 600px) { .game-button, .back { box-sizing: border-box; min-height: 44px; display: inline-flex; align-items: center; } }
.account-tag { position: absolute; top: 12px; right: 12px; z-index: 5; max-width: 30vw; overflow: hidden; padding: 6px 10px; font-family: "Chakra Petch", system-ui, sans-serif; font-size: .85rem; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; text-decoration: none; color: #fff; background: #0f2147; border: 2px solid #ffcc33; }
:root[data-fun] .account-tag { right: 110px; }
@media (max-width: 1040px) {
  .account-tag, :root[data-fun] .account-tag { top: 62px; right: 8px; max-width: 70vw; }
  .account-tag-label { display: none; }
}
.challenge-banner { padding: 8px 10px; font-weight: 700; background: rgba(0, 0, 0, .35); border-left: 4px solid var(--gold); }
.cookie-note { position: fixed; top: 72px; left: 50%; z-index: 30; margin: 0; padding: 8px 14px; font-weight: 700; color: #14060a; background: #ffcc33; border: 2px solid #14060a; transform: translateX(-50%); animation: cookie-note 2.4s ease-out forwards; pointer-events: none; }
@keyframes cookie-note { 0% { opacity: 0; } 10%, 75% { opacity: 1; } 100% { opacity: 0; } }
.cookie-note.small { top: auto; right: 12px; bottom: 12px; left: auto; padding: 4px 8px; font-size: .85rem; transform: none; }
@media (max-width: 600px) { .top-strip { justify-content: flex-start; } }
