:root { --pink: #ff5fa2; --teal: #3fd6c6; --ink: #1d1030; --cream: #fff4e8; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0820; color: #fff; font: 15px/1.35 system-ui, -apple-system, sans-serif; -webkit-user-select: none; user-select: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#overlay { pointer-events: none; }

#hud { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.pill { background: rgba(29, 16, 48, .72); border-radius: 999px; padding: 6px 12px; font-weight: 700; backdrop-filter: blur(6px); }
#h-score { color: var(--pink); }
#h-shots { letter-spacing: 1px; }
#h-arrow { display: inline-block; color: var(--teal); transition: transform .2s; }
#h-time.low { color: #ff6b6b; }

#toast { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); font: 800 26px/1.1 system-ui; color: var(--cream); text-shadow: 0 3px 0 #5c1e3c, 0 0 18px rgba(255, 95, 162, .7); pointer-events: none; text-align: center; opacity: 0; transition: opacity .25s; white-space: nowrap; }
#toast.on { opacity: 1; }
#toast small { display: block; font-size: 15px; font-weight: 700; color: #ffd23f; text-shadow: 0 2px 0 #5c1e3c; }

#breath { position: fixed; left: 50%; bottom: 4%; width: 160px; height: 8px; margin-left: -80px; background: rgba(255, 255, 255, .2); border-radius: 4px; overflow: hidden; }
#breath i { display: block; height: 100%; width: 100%; background: var(--teal); }

.card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 520px); background: rgba(29, 16, 48, .88); border-radius: 22px; padding: 24px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); backdrop-filter: blur(10px); }
.card h1 { margin: 0 0 6px; font-size: 40px; line-height: 1; } .card h1 b { color: var(--pink); }
.card h2 { margin: 0 0 10px; font-size: 28px; }
.sub { opacity: .85; margin: 0 0 16px; }
#maps { display: grid; gap: 8px; }
button { font: inherit; font-weight: 800; border: 0; border-radius: 14px; cursor: pointer; color: #fff; }
.map { background: linear-gradient(135deg, var(--pink), #c8559a); padding: 12px; font-size: 18px; }
.map:nth-child(n+2) { background: linear-gradient(135deg, #2fb5a8, #2a7f9e); }
.map small { display: block; font-size: 12px; font-weight: 600; opacity: .85; }
.keys { font-size: 12px; opacity: .65; margin: 14px 0 0; }
.best { color: #ffd23f; font-weight: 700; margin: 8px 0 0; min-height: 1em; }
.go { background: var(--pink); padding: 12px 28px; font-size: 18px; margin-top: 10px; }
.go:disabled { opacity: .5; cursor: wait; }
.ghost { background: transparent; color: #fff; opacity: .7; padding: 10px 18px; margin-top: 10px; }
#e-stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; text-align: left; margin: 0 auto; max-width: 320px; }
#e-stats b { text-align: right; color: var(--pink); }
#e-stats .stars { grid-column: 1 / -1; text-align: center; font-size: 34px; color: #ffd23f; letter-spacing: 6px; }

#touch { position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto auto; gap: 10px; }
#touch button { width: 76px; height: 76px; border-radius: 50%; background: rgba(29, 16, 48, .65); border: 2px solid rgba(255, 255, 255, .35); font-size: 14px; }
#b-fire { grid-column: 2; grid-row: 1 / span 2; width: 96px !important; height: 96px !important; align-self: center; background: rgba(255, 95, 162, .85) !important; }
#osm { position: fixed; right: 8px; bottom: 6px; font-size: 10px; opacity: .7; pointer-events: none; }
[hidden] { display: none !important; }
#adprompt { position: fixed; left: 50%; top: 58%; transform: translateX(-50%); background: rgba(29, 16, 48, .8); border: 2px solid var(--pink); border-radius: 999px; padding: 6px 14px; font-weight: 700; pointer-events: none; }
#adcard { z-index: 5; } .adtag { margin: 0; font-size: 11px; letter-spacing: 2px; opacity: .6; text-transform: uppercase; }
#e-sponsor { margin: 14px 0 0; font-size: 13px; opacity: .9; } #e-sponsor .ghost { padding: 4px 8px; margin: 0; color: var(--teal); opacity: 1; }
#b-visit { grid-column: 1 / -1; width: auto !important; height: 44px !important; border-radius: 22px !important; background: rgba(255, 95, 162, .85) !important; }
#board { z-index: 6; max-height: 86vh; overflow: auto; }
#board-tabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
#board-tabs button { background: rgba(255, 255, 255, .1); padding: 6px 10px; font-size: 13px; } #board-tabs button.on { background: var(--pink); }
#board-list { list-style: none; padding: 0; margin: 0; text-align: left; }
#board-list li { display: grid; grid-template-columns: 2em 1fr auto; gap: 2px 10px; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
#board-list .rk { color: #ffd23f; font-weight: 800; } #board-list .sc { color: var(--pink); font-weight: 800; } #board-list .tm { grid-column: 2 / -1; font-size: 12px; opacity: .65; }
#board-list .muted { display: block; opacity: .7; text-align: center; }
.post { font-size: 13px; margin: 10px 0 0; min-height: 1em; } .post a { color: var(--teal); }
.links { font-size: 13px; margin: 12px 0 0; } .links a { color: var(--teal); }

/* site header over the title screens only; the game itself stays full screen */
body .dn-head { position: fixed; top: 0; left: 0; right: 0; z-index: 8; }
body:not([data-state="title"]):not([data-state="end"]) .dn-head { display: none; }
#title, #end, #brief, #opts, #board { max-height: calc(100dvh - var(--hh, 0px) - 24px); overflow: auto; top: calc(50% + var(--hh, 0px) / 2); }
.pick { margin: 6px 0 8px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; opacity: .7; }
.menu-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.menu-row button, .menu-row .mbtn { background: rgba(255, 255, 255, .1); color: #fff; padding: 9px 12px; border-radius: 12px; font: 700 14px system-ui, sans-serif; text-decoration: none; }
.menu-row button:hover, .menu-row .mbtn:hover, .menu-row :focus-visible { background: rgba(255, 95, 162, .5); outline: none; }
#title .dn-foot { margin: 16px -24px -24px; border-radius: 0 0 22px 22px; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); font-weight: 700; }
.opt button { background: var(--teal); color: #10202a; padding: 6px 14px; } .opt select { font: inherit; padding: 4px 8px; border-radius: 8px; }
#intro-cap { position: fixed; left: 0; right: 0; bottom: 12%; text-align: center; font: 800 clamp(22px, 5vw, 52px)/1.1 system-ui, sans-serif; color: #fff4e8; text-shadow: 0 4px 0 #5c1e3c, 0 0 30px rgba(255, 95, 162, .6); pointer-events: none; transition: opacity .6s; }
#intro-cap small { display: block; font-size: .4em; letter-spacing: 3px; opacity: .8; margin-top: 8px; }
body[data-state="intro"] #hud, body[data-state="intro"] #touch { display: none !important; }
@media (max-height: 520px) and (orientation: landscape) { #title, #end, #brief, #opts, #board { top: 50%; max-height: calc(100dvh - 20px); padding: 14px; } body .dn-head { display: none; } .card h1 { font-size: 28px; } .keys { display: none; } }
@media (max-width: 380px) { .card { padding: 16px; } .card h1 { font-size: 30px; } }
.card { box-sizing: border-box; }
@media (max-width: 380px) { #title .dn-foot { margin: 14px -16px -16px; } }

/* Speed: no frosted blur over the live 3D city (re-blurred every frame) */
.pill { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(29, 16, 48, .86); }
