@font-face { font-family: 'Fredoka'; font-weight: 500; src: url('fonts/fredoka-latin-500-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Fredoka'; font-weight: 600; src: url('fonts/fredoka-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Fredoka'; font-weight: 700; src: url('fonts/fredoka-latin-700-normal.woff2') format('woff2'); font-display: swap; }
:root { --u: 1; --coral: #ff5a4e; --teal: #17b6b0; --ink: #23263a; --cream: #fff8ea; --gold: #ffc23d; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d2a44; font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
#app { position: fixed; inset: 0; overflow: hidden; }
#c { position: absolute; inset: 0; display: block; outline: none; }
.hidden { display: none !important; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25), 0 0 8px rgba(0,0,0,.25); }
.hud-left { position: absolute; left: 14px; top: 10px; }
#score { font-size: calc(40px * var(--u)); font-weight: 700; line-height: 1; letter-spacing: .5px; }
#best-hud { font-size: calc(14px * var(--u)); font-weight: 600; opacity: .9; margin-top: 2px; }
.hud-center { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); text-align: center; }
#world-chip { display: inline-block; background: rgba(35,38,58,.55); border: 2px solid rgba(255,255,255,.75); border-radius: 999px; padding: 4px 14px; font-weight: 600; font-size: calc(16px * var(--u)); white-space: nowrap; }
#prog { width: calc(160px * var(--u)); height: 7px; background: rgba(0,0,0,.25); border-radius: 9px; margin: 6px auto 0; overflow: hidden; border: 1px solid rgba(255,255,255,.5); }
#prog-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--coral)); }
.hud-right { position: absolute; right: 12px; top: 10px; display: flex; gap: 10px; align-items: center; pointer-events: auto; }
#shield-chip { display: flex; align-items: center; gap: 4px; background: rgba(35,38,58,.55); border: 2px solid rgba(111,232,255,.9); border-radius: 999px; padding: 3px 12px 3px 6px; font-weight: 700; font-size: calc(20px * var(--u)); }
#shield-chip svg { width: calc(24px * var(--u)); height: calc(24px * var(--u)); }
#shield-chip.empty { opacity: .45; border-color: rgba(255,255,255,.5); }
.icon-btn { width: calc(44px * var(--u)); height: calc(44px * var(--u)); min-width: 38px; min-height: 38px; border-radius: 12px; border: 2px solid rgba(255,255,255,.8); background: rgba(35,38,58,.5); cursor: pointer; padding: 6px; }
.icon-btn svg { width: 100%; height: 100%; }
#combo { position: absolute; left: 14px; top: calc(72px * var(--u)); font-weight: 700; font-size: calc(20px * var(--u)); color: var(--gold); display: none; }
#rails-chip { position: absolute; left: 50%; top: calc(70px * var(--u)); transform: translateX(-50%); font-weight: 700; color: #7ff9ff; font-size: calc(18px * var(--u)); display: none; }
#popups { position: absolute; left: 50%; top: 32%; pointer-events: none; }
.pop { position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 700; font-size: calc(26px * var(--u)); color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25); -webkit-text-stroke: 1px rgba(0,0,0,.15); }
.pop.edge { color: var(--gold); font-size: calc(30px * var(--u)); }
.pop.stamp { color: #fff; }
.pop.power { color: #7ff9ff; font-size: calc(30px * var(--u)); }
#banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; background: var(--cream); color: var(--ink); padding: 12px 34px 14px; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.25); border: 4px dashed var(--coral); outline: 6px solid var(--cream); }
#banner .b-small { font-weight: 700; font-size: calc(16px * var(--u)); letter-spacing: 4px; color: var(--coral); }
#banner .b-big { font-weight: 700; font-size: calc(50px * var(--u)); line-height: 1.05; }
#banner .b-country { font-weight: 600; font-size: calc(17px * var(--u)); opacity: .75; }
#msg { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); background: rgba(23,182,176,.92); color: #fff; font-weight: 700; padding: 8px 22px; border-radius: 999px; font-size: calc(24px * var(--u)); pointer-events: none; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
#hint { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); background: rgba(35,38,58,.6); color: #fff; font-weight: 600; padding: 8px 18px; border-radius: 999px; font-size: calc(18px * var(--u)); pointer-events: none; white-space: nowrap; }
#toast { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); background: rgba(35,38,58,.85); color: #fff; padding: 8px 16px; border-radius: 10px; font-weight: 600; pointer-events: none; z-index: 20; }
#count { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: calc(110px * var(--u)); font-weight: 700; color: #fff; text-shadow: 0 6px 0 rgba(0,0,0,.22); pointer-events: none; }

/* screens */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; }
#title { background: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(5,20,40,.35) 100%); color: #fff; text-align: center; gap: calc(10px * var(--u)); }
.logo { position: relative; line-height: .86; margin-bottom: 6px; }
.logo .l1, .logo .l2 { font-weight: 700; letter-spacing: 2px; color: #fff; -webkit-text-stroke: calc(3px * var(--u)) var(--ink); paint-order: stroke fill; text-shadow: 0 calc(7px * var(--u)) 0 var(--ink); }
.logo .l1 { font-size: calc(64px * var(--u)); color: var(--cream); }
.logo .l2 { font-size: calc(104px * var(--u)); color: var(--coral); }
.stamp-badge { position: absolute; right: calc(-34px * var(--u)); top: calc(-18px * var(--u)); background: var(--gold); color: var(--ink); font-weight: 700; font-size: calc(15px * var(--u)); padding: 6px 10px; border: 3px dashed var(--ink); border-radius: 4px; transform: rotate(12deg); }
.tagline { font-weight: 600; font-size: calc(20px * var(--u)); text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.stats { font-size: calc(17px * var(--u)); font-weight: 500; text-shadow: 0 2px 4px rgba(0,0,0,.45); }
.controls { font-size: calc(15px * var(--u)); background: rgba(35,38,58,.5); padding: 6px 14px; border-radius: 999px; }
.btn { font-family: inherit; font-weight: 700; font-size: calc(24px * var(--u)); color: #fff; background: var(--coral); border: none; border-radius: 16px; padding: 10px 34px; cursor: pointer; box-shadow: 0 5px 0 #b83a31, 0 8px 18px rgba(0,0,0,.25); transition: transform .08s; min-width: 200px; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b83a31; }
.btn.big { font-size: calc(40px * var(--u)); padding: 10px 60px; border-radius: 22px; }
.btn.alt { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #c9c2b0, 0 8px 18px rgba(0,0,0,.18); }
.btn.small { font-size: calc(18px * var(--u)); padding: 6px 24px; min-width: 140px; }
.btn.ad { background: var(--teal); box-shadow: 0 5px 0 #0e7d79, 0 8px 18px rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; padding: 8px 26px; }
.btn.ad .c1 { font-size: calc(22px * var(--u)); }
.btn.ad .c2 { font-size: calc(15px * var(--u)); font-weight: 600; display: flex; align-items: center; gap: 4px; opacity: .95; }
.btn.ad svg { width: 16px; height: 16px; }
.toggles { display: flex; gap: 10px; margin-top: 4px; }
.tog { font-family: inherit; font-weight: 600; font-size: calc(16px * var(--u)); color: var(--ink); background: rgba(255,255,255,.92); border: 2px solid var(--ink); border-radius: 999px; padding: 5px 16px; cursor: pointer; }
.tog::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2fc06a; margin-right: 7px; vertical-align: middle; }
.tog.off { opacity: .6; text-decoration: line-through; }
.tog.off::before { background: #c44; }
.panel { background: var(--cream); color: var(--ink); border-radius: 10px; padding: calc(14px * var(--u)) calc(30px * var(--u)) calc(16px * var(--u)); display: flex; flex-direction: column; align-items: center; gap: calc(7px * var(--u)); box-shadow: 0 16px 50px rgba(0,0,0,.35); border: 4px dashed rgba(255,90,78,.8); outline: 7px solid var(--cream); max-height: 96%; max-width: 96%; text-align: center; }
.panel h2 { margin: 0; font-size: calc(40px * var(--u)); color: var(--coral); line-height: 1; letter-spacing: 1px; }
.o-score { font-size: calc(52px * var(--u)); font-weight: 700; line-height: 1; }
.o-best { font-size: calc(17px * var(--u)); font-weight: 600; opacity: .8; }
.newbest { background: var(--gold); color: var(--ink); border-radius: 6px; padding: 1px 8px; margin-left: 6px; font-weight: 700; }
.o-world { font-size: calc(20px * var(--u)); font-weight: 700; color: var(--teal); }
.o-next { font-size: calc(15px * var(--u)); font-weight: 600; opacity: .75; }
.o-stats { font-size: calc(14px * var(--u)); opacity: .6; }
.o-note { font-size: calc(13px * var(--u)); font-weight: 600; opacity: .7; max-width: 300px; }
#adcover { position: absolute; inset: 0; background: rgba(8,16,30,.85); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; z-index: 30; }
@media (max-height: 560px) { .logo .l2 { font-size: calc(80px * var(--u)); } .panel { gap: 4px; padding: 10px 22px; } .panel h2 { font-size: 32px; } .o-score { font-size: 40px; } }
@media (max-width: 520px) { #world-chip { font-size: 13px; padding: 3px 10px; } #score { font-size: 30px; } .hud-center { top: 54px; } .logo .l1 { font-size: 46px; } .logo .l2 { font-size: 74px; } .stamp-badge { right: -10px; } .controls { font-size: 13px; } .btn.big { font-size: 34px; } #banner .b-big { font-size: 38px; } #hint { font-size: 14px; } }
