@font-face { font-family: Fredoka; src: url(fredoka.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
:root { --ink: #3b2412; --cream: #fff8ea; --green: #4cc94f; --green-d: #2e9a35; --orange: #ff9a2e; --orange-d: #d86d0b; --purple: #a46bff; --purple-d: #7440d6; --blue: #3fa9ff; --blue-d: #1f78d1; --teal: #22c7b8; --teal-d: #11968a; --pink: #ff6fb1; --pink-d: #d8418a; --gold: #ffd23f; --gold-d: #e0a100; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2f6d2a; color: var(--ink); font-family: Fredoka, "Trebuchet MS", ui-rounded, system-ui, sans-serif; -webkit-user-select: none; user-select: none; touch-action: manipulation; overscroll-behavior: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#app { position: fixed; inset: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
body[data-screen="play"] #cv { cursor: none; }
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; overflow: hidden; padding: calc(10px + var(--safe-t)) 14px calc(12px + var(--safe-b)); z-index: 5; background: linear-gradient(180deg, rgba(20, 50, 15, .25), rgba(20, 40, 10, .55)); animation: fadein .25s ease; }
.scr[hidden] { display: none; }
#s-title { justify-content: space-between; background: linear-gradient(180deg, rgba(255,255,255,0) 30%, rgba(30,60,15,.55)); }
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
.t-top { width: 100%; max-width: 560px; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.t-logo { text-align: center; margin-top: 2vh; }
.logo { width: min(88vw, 430px); height: auto; filter: drop-shadow(0 8px 0 rgba(0,0,0,.18)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1deg); } }
.tag { margin: 6px 0 0; color: #fff; font-weight: 600; font-size: clamp(15px, 4vw, 19px); text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.t-btns { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.row { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 8px; }
.row.wrap { flex-wrap: wrap; }
.t-btns .row { margin: 0; } .t-btns .row .btn { flex: 1; }
.foot { color: #fff; font-size: 13px; text-shadow: 0 1px 0 rgba(0,0,0,.5); margin: 8px 0 0; }
.foot a { color: #fff; }
.btn { --c: var(--green); --d: var(--green-d); font: inherit; font-weight: 700; font-size: 17px; color: #fff; border: 0; border-radius: 16px; padding: 12px 16px; background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0) 65%), var(--c); box-shadow: 0 5px 0 var(--d), 0 8px 14px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.45); text-shadow: 0 2px 0 rgba(0,0,0,.25); cursor: pointer; transition: transform .08s, box-shadow .08s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; letter-spacing: .3px; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--d), 0 3px 6px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.45); }
.btn:focus-visible, .ib:focus-visible, .node:focus-visible, .tile:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.btn.big { font-size: 24px; padding: 16px 20px; border-radius: 20px; }
.btn.sm { font-size: 14px; padding: 8px 12px; border-radius: 12px; }
.btn.orange { --c: var(--orange); --d: var(--orange-d); } .btn.purple { --c: var(--purple); --d: var(--purple-d); } .btn.blue { --c: var(--blue); --d: var(--blue-d); }
.btn.teal { --c: var(--teal); --d: var(--teal-d); } .btn.pink { --c: var(--pink); --d: var(--pink-d); } .btn.gold { --c: var(--gold); --d: var(--gold-d); color: #5a3500; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.btn.ghost { --c: #f3e6cf; --d: #c9b28c; color: var(--ink); text-shadow: none; } .btn.dim { --c: #b9b0a2; --d: #8d8476; }
.btn.green.big { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.03); } }
body.reduce .btn.green.big, body.reduce .logo { animation: none; }
.ib { font: inherit; font-size: 22px; font-weight: 700; width: 46px; height: 46px; border-radius: 14px; border: 0; background: rgba(255,248,234,.95); color: var(--ink); box-shadow: 0 4px 0 #c9b28c, 0 6px 10px rgba(0,0,0,.2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: rgba(40,22,8,.55); color: #fff; border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 700; font-size: 16px; }
.pi { width: 26px; height: 26px; object-fit: contain; }
.card { background: var(--cream); border-radius: 24px; padding: 18px; box-shadow: 0 6px 0 #d8c39f, 0 14px 30px rgba(0,0,0,.3); width: 100%; max-width: 440px; text-align: center; }
.card h2 { margin: 2px 0 8px; font-size: 26px; } .card small { color: #8b6a4a; font-weight: 600; }
.small { font-size: 14px; color: #6b5139; } .center { text-align: center; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.5); }
.chal { display: flex; flex-direction: column; gap: 6px; align-items: center; }
/* top bars */
.bar { width: 100%; max-width: 560px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bar h2 { flex: 1; margin: 0; color: #fff; font-size: 24px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.map-scroll, .scroll, .list { width: 100%; max-width: 560px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; padding-bottom: 20px; }
.world { border-radius: 24px; margin: 0 0 16px; padding: 14px; color: #fff; background-size: cover; background-position: center 30%; box-shadow: 0 6px 0 rgba(0,0,0,.25), inset 0 0 0 3px var(--wt, #fff); position: relative; }
.world header { display: flex; justify-content: space-between; gap: 8px; text-shadow: 0 2px 2px rgba(0,0,0,.6); }
.world h3 { margin: 0; font-size: 24px; } .world p { margin: 2px 0 8px; font-size: 14px; } .world small { font-weight: 600; opacity: .9; }
.ws { background: rgba(0,0,0,.45); border-radius: 999px; padding: 4px 10px; height: fit-content; font-weight: 700; white-space: nowrap; }
.nodes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.node { position: relative; aspect-ratio: 1; border: 0; border-radius: 50%; font: inherit; background: radial-gradient(circle at 35% 30%, #fff, #ffe9b8 60%, #f0c46a); color: var(--ink); box-shadow: 0 5px 0 #b98a2c, 0 8px 12px rgba(0,0,0,.35); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.node b { font-size: 24px; line-height: 1; } .node.boss { background: radial-gradient(circle at 35% 30%, #fff, #ffc2e0 60%, #ff7fb6); box-shadow: 0 5px 0 #b8457a, 0 8px 12px rgba(0,0,0,.35); }
.node.lock { filter: grayscale(.9) brightness(.75); } .node.next { animation: pulse 1.2s ease-in-out infinite; box-shadow: 0 5px 0 #b98a2c, 0 0 0 4px #fff, 0 0 22px 6px rgba(255,255,160,.9); }
.ns { font-size: 12px; letter-spacing: -1px; } .st { font-style: normal; color: rgba(60,40,20,.25); } .st.on { color: #ffb400; text-shadow: 0 1px 0 #a35f00; }
.new { position: absolute; top: -6px; right: -6px; background: #ff4d6d; color: #fff; font-style: normal; font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 8px; }
.world.locked .nodes { filter: grayscale(.6) blur(.5px); opacity: .7; }
.lockbar { position: absolute; inset: auto 12px 12px 12px; display: flex; gap: 8px; justify-content: center; align-items: center; background: rgba(40,20,5,.8); border-radius: 16px; padding: 10px; font-weight: 700; flex-wrap: wrap; }
.world.modes { background: linear-gradient(135deg, #7a4fd6, #ff6fb1); }
/* intro */
#s-intro, #s-result, #s-pause, #s-pay, #s-draft { justify-content: center; }
.newc { display: flex; gap: 12px; align-items: center; text-align: left; background: #fff; border-radius: 18px; padding: 10px; margin: 8px 0; box-shadow: inset 0 0 0 3px #ffd98a; }
.newc em { background: #ff4d6d; color: #fff; font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; margin-right: 6px; }
.newc p { margin: 4px 0 0; font-size: 14px; } .nimg { width: 76px; height: 76px; object-fit: contain; flex: none; }
.tip { font-size: 16px; margin: 8px 0; }
.goals { display: flex; justify-content: space-around; margin: 10px 0; } .goals div { display: flex; flex-direction: column; align-items: center; font-size: 18px; } .goals b { font-size: 16px; }
/* result */
.bigstars { font-size: 64px; line-height: 1; margin: 4px 0; } .bigstars .st { color: rgba(60,40,20,.15); display: inline-block; }
.bigstars .st.on { color: #ffc21a; text-shadow: 0 4px 0 #b86a00, 0 0 22px rgba(255,200,0,.55); }
.bigstars.anim .st.on { animation: starpop .5s cubic-bezier(.2,1.6,.4,1) backwards; } .bigstars.anim .st:nth-child(2) { animation-delay: .26s; } .bigstars.anim .st:nth-child(3) { animation-delay: .52s; }
@keyframes starpop { 0% { transform: scale(0) rotate(-40deg); opacity: 0 } 100% { transform: none; opacity: 1 } }
.score { font-size: 48px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.newbest { display: inline-block; background: #ff4d6d; color: #fff; padding: 3px 12px; border-radius: 999px; font-weight: 700; animation: pulse 1s infinite; }
.near { font-size: 18px; color: #c2410c; margin: 8px 0; font-weight: 600; } .near.soft { color: #6b5139; font-size: 15px; font-weight: 400; }
.stats span { font-weight: 600; } .stats .pill { color: #fff; }
.extras { text-align: left; font-size: 14px; background: #fff3cf; border-radius: 12px; padding: 8px 8px 8px 26px; margin: 8px 0; }
/* shop / lists */
.upg { display: flex; gap: 10px; align-items: center; text-align: left; margin-bottom: 10px; max-width: none; padding: 12px; }
.uimg { width: 56px; height: 56px; object-fit: contain; flex: none; } .ut { flex: 1; } .ut p { margin: 2px 0 0; font-size: 13px; color: #6b5139; }
.pips { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; } .pips i { width: 12px; height: 12px; border-radius: 4px; background: #e5d6bb; } .pips i.on { background: var(--green); box-shadow: inset 0 -2px 0 var(--green-d); }
.sec { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.4); margin: 6px 0; } .sec small { font-size: 13px; color: #fff; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { font: inherit; border: 0; border-radius: 18px; background: var(--cream); box-shadow: 0 5px 0 #d8c39f; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--ink); }
.tile.sel { box-shadow: 0 5px 0 var(--green-d), 0 0 0 4px var(--green); } .tile.lock { opacity: .7; } .tile.lock .timg { filter: grayscale(1) brightness(.6); }
.timg { height: 86px; width: auto; } .tile small { font-size: 12px; color: #6b5139; }
.tile.wide { background-size: cover; background-position: center 35%; min-height: 110px; justify-content: flex-end; color: #fff; text-shadow: 0 2px 2px #000; } .tile.wide small { color: #fff; }
.miles { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; } .mile { flex: none; min-width: 88px; background: rgba(255,248,234,.6); border-radius: 14px; padding: 8px; text-align: center; display: flex; flex-direction: column; } .mile.got { background: var(--gold); }
.ach { display: flex; gap: 10px; align-items: center; text-align: left; margin-bottom: 8px; max-width: none; padding: 10px 12px; opacity: .7; } .ach.got { opacity: 1; } .ach p { margin: 0; font-size: 13px; } .ach div { flex: 1; } .trophy { font-size: 28px; }
/* paywall */
.pay-worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; } .pay-worlds div { aspect-ratio: 3/4; border-radius: 14px; background-size: cover; background-position: center 30%; display: flex; align-items: flex-end; justify-content: center; padding: 4px; color: #fff; font-size: 13px; text-shadow: 0 2px 2px #000; }
.perks { text-align: left; font-size: 15px; padding-left: 22px; margin: 8px 0 12px; } .perks li { margin: 4px 0; }
/* draft */
.perks3 { display: grid; gap: 10px; } .perk { font: inherit; border: 0; border-radius: 16px; padding: 12px; background: linear-gradient(180deg, #fff, #ffeec9); box-shadow: 0 5px 0 #d8b06a; cursor: pointer; color: var(--ink); } .perk b { font-size: 19px; } .perk p { margin: 2px 0 0; font-size: 14px; }
/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#hud[hidden] { display: none; }
.hud-top { position: absolute; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(96vw, 560px); display: flex; gap: 8px; align-items: center; }
.hud-top .ib { pointer-events: auto; }
.hud-score { flex: 1; background: rgba(255,248,234,.94); border-radius: 18px; padding: 4px 12px 8px; box-shadow: 0 4px 0 #c9b28c, 0 6px 12px rgba(0,0,0,.25); text-align: center; }
#h-score { font-size: 28px; font-weight: 700; line-height: 1.15; }
.tbar { position: relative; height: 12px; background: #e9dcc4; border-radius: 999px; box-shadow: inset 0 2px 3px rgba(0,0,0,.15); margin: 2px 4px 2px; }
#h-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, #ffd23f, #ff9a2e); transition: width .15s; }
.mk { position: absolute; top: 50%; transform: translate(-50%, -52%); font-style: normal; font-size: 20px; color: #c9b9a0; text-shadow: 0 1px 0 #fff; } .mk.on { color: #ffb400; text-shadow: 0 1px 0 #8a4f00; animation: starpop .4s; }
#h-time-w { min-width: 64px; height: 50px; border-radius: 16px; background: rgba(255,248,234,.94); box-shadow: 0 4px 0 #c9b28c, 0 6px 12px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; padding: 0 10px; }
#h-time-w::before { content: '⏱'; font-size: 18px; margin-right: 4px; }
#h-time-w.low { color: #e11d48; animation: pulse .5s infinite; }
#h-hearts { position: absolute; top: calc(70px + var(--safe-t)); left: 50%; transform: translateX(-50%); color: #ff4d6d; font-size: 28px; text-shadow: 0 2px 0 #fff, 0 3px 4px rgba(0,0,0,.4); letter-spacing: 2px; }
#h-combo { position: absolute; top: calc(78px + var(--safe-t)); left: 50%; transform: translateX(-50%); background: linear-gradient(180deg, #ff6fb1, #c13584); color: #fff; border-radius: 999px; padding: 4px 14px 8px; text-align: center; box-shadow: 0 4px 0 #8e1f5e; min-width: 140px; }
#h-combo[hidden] { display: none; }
#h-combo-x { font-size: 24px; font-weight: 700; margin-right: 6px; } #h-combo-n { font-size: 15px; font-weight: 600; }
.cbar { height: 5px; background: rgba(255,255,255,.3); border-radius: 9px; margin-top: 2px; } #h-combo-bar { height: 100%; background: #fff; border-radius: 9px; }
#h-powers { position: absolute; left: 10px; bottom: calc(12px + var(--safe-b)); display: flex; gap: 6px; }
.pw { position: relative; width: 52px; height: 52px; background: rgba(255,248,234,.9); border-radius: 14px; box-shadow: 0 3px 0 #c9b28c; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pwi { width: 40px; height: 40px; object-fit: contain; } .pw i { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--green); }
#h-banner { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-size: clamp(34px, 9vw, 56px); font-weight: 700; color: #fff; -webkit-text-stroke: 2px #6a2a00; text-shadow: 0 5px 0 #6a2a00, 0 8px 18px rgba(0,0,0,.4); }
#h-banner[hidden] { display: none; } #h-banner.in { animation: bannerin .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes bannerin { 0% { transform: scale(.3); opacity: 0 } 100% { transform: none; opacity: 1 } }
#h-count { position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-size: 110px; font-weight: 700; color: #fff; -webkit-text-stroke: 3px #3b2412; text-shadow: 0 8px 0 #3b2412; }
#h-count[hidden] { display: none; } #h-count.in { animation: bannerin .35s cubic-bezier(.2,1.6,.4,1); }
body.reduce #h-banner.in, body.reduce #h-count.in, body.reduce .node.next, body.reduce #h-time-w.low { animation: none; }
/* dialog + toasts */
#dlg { position: fixed; inset: 0; background: rgba(20,12,4,.55); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
#dlg[hidden] { display: none; }
#dlg-body { max-height: 88vh; overflow-y: auto; text-align: left; } #dlg-body h3 { margin: 0 0 8px; font-size: 22px; text-align: center; }
#dlg-body input[type=text], #dlg-body input:not([type]) { width: 100%; font: inherit; padding: 10px; border-radius: 12px; border: 2px solid #d8c39f; margin: 6px 0; }
.tg { display: flex; gap: 10px; align-items: center; padding: 8px 4px; font-size: 17px; cursor: pointer; } .tg input { width: 22px; height: 22px; accent-color: var(--green); }
.how { padding-left: 0; list-style: none; } .how li { display: flex; gap: 10px; align-items: center; margin: 8px 0; } .hi { width: 44px; height: 44px; object-fit: contain; flex: none; }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(80px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 30; pointer-events: none; }
.toast { background: rgba(40,22,8,.92); color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 600; max-width: 90vw; text-align: center; animation: fadein .2s; transition: opacity .5s; } .toast.out { opacity: 0; }
@media (min-width: 900px) { .card { max-width: 480px; } }
@media (max-height: 640px) { .logo { width: min(70vw, 320px); } .btn.big { font-size: 20px; padding: 12px; } .t-btns { gap: 7px; } }
.lk { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 13px; }
