/* Car Wash Blitz - bright, chunky, kid-friendly UI */
:root {
  --sky: #2aa8ff; --sky2: #8fd8ff; --pink: #ff5fb7; --yellow: #ffd23f; --green: #3cc76a; --red: #ff4d5e; --purple: #9b6bff; --ink: #1d2a44; --card: #ffffff; --soft: #eef7ff;
  --r: 18px; --shadow: 0 6px 0 rgba(0,0,0,.18), 0 10px 24px rgba(0,40,90,.18);
  --font: "Fredoka", "Trebuchet MS", system-ui, sans-serif; --display: "Lilita One", "Fredoka", sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --topH: 52px; --dockH: 188px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fd8ff; color: var(--ink); font-family: var(--font); user-select: none; -webkit-user-select: none; touch-action: none; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
#app { position: fixed; inset: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.screen { position: absolute; inset: 0; display: none; }
.screen.show { display: block; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.center, .center { justify-content: center; text-align: center; }
.muted { opacity: .7; } .small { font-size: 13px; }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 20px; border-radius: 16px; background: #fff; color: var(--ink); font-weight: 700; font-size: 17px; text-decoration: none; box-shadow: 0 5px 0 #b9cde0; transition: transform .06s; }
.btn:active, .btn.press { transform: translateY(4px); box-shadow: 0 1px 0 #b9cde0; }
.btn.green { background: var(--green); color: #fff; box-shadow: 0 5px 0 #23934b; }
.btn.pink { background: var(--pink); color: #fff; box-shadow: 0 5px 0 #c43b86; }
.btn.yellow { background: var(--yellow); box-shadow: 0 5px 0 #c99a12; }
.btn.blue { background: var(--sky); color: #fff; box-shadow: 0 5px 0 #1478c2; }
.btn.big { font-family: var(--display); font-size: 30px; letter-spacing: 1px; padding: 14px 54px; border-radius: 22px; }
.btn[disabled], .btn.off { filter: grayscale(.7); opacity: .6; }

/* logo */
.logo { font-family: var(--display); line-height: .9; margin: 0; text-align: center; color: #fff; text-shadow: 0 4px 0 #1478c2, 0 8px 0 rgba(0,0,0,.15); }
.logo span { display: block; font-size: clamp(40px, 9vw, 86px); letter-spacing: 2px; }
.logo b { display: block; font-size: clamp(58px, 14vw, 132px); color: var(--yellow); text-shadow: 0 4px 0 #e3711b, 0 8px 0 #b24f0e, 0 14px 18px rgba(0,0,0,.25); transform: rotate(-3deg); }
.logo.small span { font-size: 30px; } .logo.small b { font-size: 46px; }

/* gate + title */
#gate { background: linear-gradient(#5ec6ff, #c6ecff); display: none; align-items: center; justify-content: center; }
#gate.show { display: flex; }
.card { background: #fff; border-radius: 26px; padding: 24px; box-shadow: var(--shadow); max-width: 440px; width: calc(100% - 32px); }
#gate .card p { font-size: 18px; }
#title { background: linear-gradient(180deg, #2aa8ff 0%, #7fd3ff 55%, #b6ebff 100%); overflow: hidden; }
#title.show { display: flex; align-items: center; justify-content: center; }
.title-wrap { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab)); max-height: 100%; overflow: auto; }
.tagline { margin: 0; font-size: 19px; font-weight: 600; color: #fff; text-shadow: 0 2px 0 rgba(0,60,120,.35); text-align: center; max-width: 520px; }
.preview-tag { background: #1d2a44; color: var(--yellow); font-weight: 700; font-size: 12px; letter-spacing: 2px; padding: 4px 12px; border-radius: 99px; }
.title-sky .bub { position: absolute; bottom: -80px; width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0 10%, rgba(255,255,255,.35) 12%, rgba(255,255,255,.12) 60%, rgba(255,255,255,.5) 70%, rgba(255,255,255,0) 72%); animation: rise 9s linear infinite; }
.title-sky .bub:nth-child(1) { left: 8%; animation-delay: 0s; } .title-sky .bub:nth-child(2) { left: 22%; width: 90px; height: 90px; animation-delay: 2s; }
.title-sky .bub:nth-child(3) { left: 48%; width: 40px; height: 40px; animation-delay: 4s; } .title-sky .bub:nth-child(4) { left: 68%; animation-delay: 1s; width: 110px; height: 110px; }
.title-sky .bub:nth-child(5) { left: 84%; animation-delay: 5s; } .title-sky .bub:nth-child(6) { left: 35%; animation-delay: 7s; width: 70px; height: 70px; }
@keyframes rise { to { transform: translateY(-120vh) translateX(40px); } }
.title-car { position: relative; width: 220px; height: 92px; animation: bounce 1.6s ease-in-out infinite; }
.tc-body { position: absolute; left: 10px; right: 10px; bottom: 18px; height: 44px; background: var(--red); border-radius: 18px 26px 12px 12px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.15); }
.tc-body::before { content: ""; position: absolute; left: 50px; top: -30px; width: 100px; height: 34px; background: #2b6bff; border-radius: 22px 22px 4px 4px; box-shadow: inset 0 0 0 6px var(--red); }
.tc-body i { position: absolute; bottom: -18px; width: 38px; height: 38px; border-radius: 50%; background: #1f2228; border: 8px solid #d9dde3; }
.tc-body i:first-child { left: 18px; } .tc-body i:last-child { right: 18px; }
.tc-foam { position: absolute; left: 0; right: 0; top: -6px; height: 50px; background: radial-gradient(circle at 20% 60%, #fff 0 18px, transparent 19px), radial-gradient(circle at 45% 40%, #ffd1ec 0 24px, transparent 25px), radial-gradient(circle at 70% 55%, #fff 0 20px, transparent 21px), radial-gradient(circle at 88% 70%, #bfe9ff 0 14px, transparent 15px); filter: drop-shadow(0 2px 0 rgba(0,0,0,.1)); }
@keyframes bounce { 50% { transform: translateY(-8px) rotate(-1deg); } }


/* ================= in-game layout: top bar / 3D band / dock ================= */
body.ingame #cv, body.ingame #floaters { top: calc(var(--topH) + var(--sat)); bottom: auto; height: calc(100% - var(--topH) - var(--dockH) - var(--sat) - var(--sab)); }
#floaters { position: absolute; left: 0; right: 0; top: 0; bottom: 0; }
#hud { pointer-events: none; }
#hud > * { pointer-events: auto; }

/* top bar */
.tbar { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--topH) + var(--sat)); padding: var(--sat) calc(8px + var(--sar)) 0 calc(8px + var(--sal)); display: flex; align-items: center; gap: 8px; background: linear-gradient(#2aa8ff, #1d8fe0); box-shadow: 0 3px 0 rgba(0,0,0,.12); z-index: 20; color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: calc(var(--topH) - 12px); padding: 0 12px; background: rgba(255,255,255,.95); color: var(--ink); border-radius: 99px; font-weight: 700; font-size: 17px; flex: none; }
.chip.money { background: linear-gradient(#fff6c8, #ffe27a); font-family: var(--display); font-size: 21px; letter-spacing: .4px; }
.chip.money small { font-family: var(--font); font-size: 12px; font-weight: 600; opacity: .7; }
.chip.money.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.12); } }
.coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff7c2 0 18%, #ffd23f 20% 60%, #e5a50a 62%); box-shadow: inset 0 -3px 0 #c7870a; display: inline-block; flex: none; }
.chip.lvl { flex-direction: column; justify-content: center; gap: 2px; font-size: 13px; padding: 0 10px; }
.xpbar { display: block; width: 56px; height: 6px; background: #dbe7f3; border-radius: 9px; overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7bd88f, #3cc76a); }
.ticker { flex: 1; min-width: 0; height: calc(var(--topH) - 12px); display: flex; align-items: center; justify-content: center; background: rgba(0,40,90,.22); border-radius: 99px; padding: 0 14px; overflow: hidden; }
.ticker span { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker span.in { animation: tickin .3s; }
@keyframes tickin { from { transform: translateY(14px); opacity: 0; } }
.ticker.gold { background: #ffd23f; color: var(--ink); } .ticker.pink { background: var(--pink); } .ticker.red { background: var(--red); } .ticker.green { background: var(--green); }
.ticker.coach { background: #fff; color: var(--ink); box-shadow: 0 0 0 3px var(--yellow); }
.ticker.coach span { white-space: normal; font-size: 14px; line-height: 1.15; text-align: center; }
.ticker.coach b { color: var(--pink); }
.tbtns { display: flex; gap: 6px; flex: none; }
.ib { width: 50px; height: calc(var(--topH) - 8px); border-radius: 12px; background: rgba(255,255,255,.18); color: #fff; font-size: 19px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ib small { font-size: 10px; font-weight: 700; margin-top: 2px; letter-spacing: .3px; max-width: 48px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ib.hot { background: #ffd23f; color: var(--ink); } .ib.on { background: var(--pink); color: #fff; }
.ib:active { transform: translateY(2px); }

/* dock */
.dock { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--dockH) + var(--sab)); padding: 8px calc(8px + var(--sar)) calc(8px + var(--sab)) calc(8px + var(--sal)); display: flex; gap: 8px; align-items: stretch; background: linear-gradient(#3b4560, #232b42); border-top: 4px solid #4b5778; color: #fff; z-index: 20; }
.dock > section, .dock > nav { background: rgba(0,0,0,.18); border-radius: 16px; padding: 6px; min-width: 0; }
.dcar { width: 250px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.lanesw { display: flex; align-items: center; justify-content: space-between; gap: 4px; position: relative; }
.lanesw button { width: 30px; height: 24px; border-radius: 8px; background: #1b2236; color: #cfe0ff; font-size: 12px; }
.lanesw b { font-size: 13px; color: var(--yellow); letter-spacing: .3px; }
.lanesw.single button { visibility: hidden; }
.alert { position: absolute; right: 34px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.25); } }
.carview { overflow: hidden; background: #fff; color: var(--ink); border-radius: 12px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; flex: 1; justify-content: center; min-height: 0; }
.cc-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 15px; }
.cc-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rar { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; color: #fff; background: #8bd17c; white-space: nowrap; }
.cc-pkg { font-family: var(--display); font-size: 13px; letter-spacing: .4px; min-height: 15px; }
.meter { position: relative; height: 20px; background: #e6eef6; border-radius: 99px; overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #ffb347, #ffd23f 40%, #3cc76a); transition: width .25s; border-radius: 99px; }
.meter span { position: relative; display: block; text-align: center; font-weight: 700; line-height: 20px; font-size: 13px; text-shadow: 0 1px 0 #fff; }
.meter.perfect > i { background: linear-gradient(90deg, #4fc3ff, #b06cff, #ff5fb7, #ffd23f); background-size: 200% 100%; animation: shine 1s linear infinite; }
@keyframes shine { to { background-position: 200% 0; } }
.kiosk { background: #fff; color: var(--ink); border-radius: 12px; padding: 5px 6px; display: flex; flex-direction: column; gap: 5px; flex: 1; justify-content: center; animation: popin .25s; }
.ksay { margin: 0; font-size: 13px; font-weight: 700; display: flex; gap: 6px; align-items: center; line-height: 1.1; }
.ksay #kWho { font-size: 20px; }
.kopts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.kopt { border-radius: 10px; padding: 6px 2px; color: #fff; font-family: var(--display); font-size: 12px; line-height: 1.05; box-shadow: 0 3px 0 rgba(0,0,0,.25); position: relative; min-height: 44px; }
.kopt small { display: block; font-family: var(--font); font-weight: 700; font-size: 12px; margin-top: 2px; }
.kopt.want { outline: 3px solid var(--yellow); outline-offset: 1px; }
.kopt:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0,0,0,.25); }
.actions { display: flex; flex-wrap: wrap; gap: 4px; }
.actions:empty, .actions:not(:has(.act:not([hidden]))) { display: none; }
.act { flex: 1 1 45%; min-width: 0; overflow: hidden; text-overflow: ellipsis; min-height: 40px; border-radius: 12px; font-weight: 700; font-size: 13px; color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.3); white-space: nowrap; padding: 0 6px; }
.act.gold { background: linear-gradient(#ffd23f, #ffb000); color: var(--ink); animation: pulse 1s infinite; }
.act.blue { background: var(--sky); } .act.pink { background: var(--pink); }
.act:active { transform: translateY(3px); box-shadow: none; }

.dctl { width: 104px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: space-between; }
.ctlrow { display: flex; gap: 6px; }
.mini-b { width: 44px; height: 40px; border-radius: 12px; font-weight: 900; font-size: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.mini-b small { font-size: 8px; font-weight: 700; margin-top: 2px; }
.mini-b.stop { background: #ffd23f; color: var(--ink); } .mini-b.estop { background: #ff3344; color: #fff; border: 2px solid #ffd23f; }
.mini-b:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.tanks { display: flex; gap: 6px; }
.tank > i { position: relative; display: block; width: 22px; height: 26px; border-radius: 6px; background: #141a2a; border: 2px solid #4b5778; overflow: hidden; }
.tank > i > i { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; background: var(--c); transition: height .4s; }
.tank.low > i { border-color: var(--red); animation: pulse 1s infinite; }

.dmach { flex: 1; display: flex; align-items: center; min-width: 0; }
.mgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 4px 4px; width: 100%; height: 100%; }
.dgauge { width: 150px; flex: none; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.gauge { background: #141a2a; border-radius: 12px; padding: 3px 6px 2px; text-align: center; }
.gauge svg { width: 100%; height: auto; display: block; max-height: 50px; }
.gauge .arc { fill: none; stroke: #2c3550; stroke-width: 9; stroke-linecap: round; }
.gauge .arcfill { fill: none; stroke: #3cff6e; stroke-width: 9; stroke-linecap: round; stroke-dasharray: 126; stroke-dashoffset: 126; transition: stroke-dashoffset .4s; }
.gauge .arcfill.blue { stroke: #4fc3ff; }
.gauge .needle { stroke: #ffd23f; stroke-width: 3; stroke-linecap: round; transform-origin: 50px 55px; transition: transform .4s; transform: rotate(-80deg); }
.gauge circle { fill: #ffd23f; }
.gauge small { font-size: 10px; font-weight: 700; letter-spacing: .5px; color: #9fb0d4; }

.dmenu { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 5px; width: 252px; }
.nbtn { min-width: 0; overflow: hidden; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 3px 0 #9fb0c2; min-height: 44px; }
.nbtn span { font-size: 24px; line-height: 1; }
.nbtn b { margin-top: 2px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.nbtn:active { transform: translateY(3px); box-shadow: 0 0 0 #9fb0c2; }
.dot { position: absolute; top: 4px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid #fff; animation: pulse 1s infinite; }

/* spray bonus replaces the dock while it runs */
.mini.dockmini { top: auto; transform: none; width: auto; max-height: none; border-radius: 0; box-shadow: none; flex-direction: row; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--dockH) + var(--sab)); z-index: 25; display: flex; align-items: center; gap: 14px; padding: 8px 16px calc(8px + var(--sab)); background: linear-gradient(#5ed1ff, #2aa8ff); color: #fff; }
.dockmini .mt { font-family: var(--display); font-size: 26px; white-space: nowrap; }
.dockmini .mh { font-weight: 700; font-size: 15px; }
.dockmini .mini-meter { flex: 1; height: 26px; }
.dockmini .timer { font-family: var(--display); font-size: 32px; min-width: 44px; text-align: center; }

/* physical machine buttons */
.mbtn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 10px; color: #fff; }
.mbtn .cap { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), rgba(255,255,255,0) 45%), var(--bc, #4fc3ff); box-shadow: 0 7px 0 var(--bd, #1478c2), 0 9px 10px rgba(0,0,0,.4), inset 0 -4px 0 rgba(0,0,0,.15); transition: transform .07s, box-shadow .07s; }
.mbtn b { font-size: 10px; font-weight: 700; letter-spacing: .3px; text-align: center; line-height: 1.1; max-width: 80px; }
.mbtn .lamp { position: absolute; top: 0; left: 50%; margin-left: -6px; width: 12px; height: 12px; border-radius: 50%; background: #3a4258; box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.mbtn.on .cap, .mbtn:active .cap, .mbtn.press .cap { transform: translateY(5px); box-shadow: 0 2px 0 var(--bd, #1478c2), 0 3px 6px rgba(0,0,0,.4), inset 0 -2px 0 rgba(0,0,0,.15), 0 0 18px var(--bc); }
.mbtn.on .lamp { background: #3cff6e; box-shadow: 0 0 10px #3cff6e; }
.mbtn.need:not(.on) .lamp { background: #ffd23f; box-shadow: 0 0 10px #ffd23f; animation: pulse .6s infinite; }
.mbtn.need:not(.on) .cap { animation: wiggle 1.2s infinite; }
@keyframes wiggle { 0%, 70%, 100% { transform: none; } 80% { transform: rotate(-8deg); } 90% { transform: rotate(8deg); } }
.mbtn.broken .lamp { background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse .4s infinite; }
.mbtn.broken .cap { filter: saturate(.4); }
.mbtn.broken .cap::after { content: "🔧"; position: absolute; font-size: 22px; transform: translate(18px, -18px); }
.mbtn.locked { opacity: .5; }
.mbtn.locked .cap { filter: grayscale(1); font-size: 20px; }
.mbtn.auto .lamp { background: #3cff6e; }
.mbtn .tag { position: absolute; top: 12px; right: 2px; background: #3cff6e; color: #0b2a15; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 6px; }
.mbtn .tag.cost { background: var(--yellow); color: var(--ink); }
.bigrow .mbtn { flex: 1; }
.bigrow .mbtn .cap { width: 64px; height: 64px; font-size: 26px; }
.mbtn.start { --bc: #3cc76a; --bd: #1f7a3f; } .mbtn.stop { --bc: #ffd23f; --bd: #b48a0a; } .mbtn.collect { --bc: #ffb347; --bd: #b86c0f; }
.mbtn.estop { --bc: #ff3344; --bd: #8f0f1b; }
.mbtn.estop .cap { border: 5px solid #ffd23f; background-clip: padding-box; font-weight: 900; }
.mbtn.collect .cap { animation: pulse .8s infinite; }

/* floating labels over the 3D world */
#floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fl { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: auto; white-space: nowrap; will-change: transform; }
.bubble { background: #fff; border-radius: 16px; padding: 6px 12px; font-weight: 700; font-size: 16px; box-shadow: 0 4px 0 rgba(0,0,0,.15); position: relative; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble.say { animation: popin .3s; }
@keyframes popin { from { transform: scale(.2); } 60% { transform: scale(1.15); } }
.coinbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; animation: hop .8s infinite; }
.coinbtn .c { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff7c2 0 15%, #ffd23f 18% 60%, #e5a50a 62%); box-shadow: inset 0 -5px 0 #c7870a, 0 5px 0 rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 20px; color: #8a5a00; }
.coinbtn small { background: var(--ink); color: #fff; border-radius: 99px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
@keyframes hop { 50% { transform: translateY(-8px); } }
.fixbtn { width: 54px; height: 54px; border-radius: 50%; background: var(--red); color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 0 #a3172a, 0 0 0 4px #fff; animation: pulse .7s infinite; position: relative; }
.fixbtn small { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); background: #fff; color: var(--red); border-radius: 99px; padding: 1px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.actbtn { background: var(--sky); color: #fff; border-radius: 16px; padding: 7px 12px; font-weight: 700; font-size: 15px; box-shadow: 0 4px 0 #1478c2; animation: hop 1s infinite; }
.actbtn.pink { background: var(--pink); box-shadow: 0 4px 0 #c43b86; }
.plus { font-family: var(--display); font-size: 26px; color: #fff; text-shadow: 0 3px 0 #1d7a3e, 0 0 10px rgba(0,0,0,.3); pointer-events: none; animation: floatup 1.4s forwards; }
.plus.tip { font-size: 18px; color: #ffe27a; text-shadow: 0 2px 0 #9a6b00; }
@keyframes floatup { to { transform: translate(-50%, -260%); opacity: 0; } }
.flycoin { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff7c2 0 18%, #ffd23f 20% 60%, #e5a50a 62%); pointer-events: none; z-index: 30; transition: transform .7s cubic-bezier(.5,-0.3,.7,1), opacity .2s .65s; }
.nametag { font-size: 12px; font-weight: 700; background: rgba(29,42,68,.8); color: #fff; padding: 2px 8px; border-radius: 99px; pointer-events: none; }
.nametag.r-rare { background: #b06cff; } .nametag.r-epic { background: #ff5fb7; } .nametag.r-legendary { background: #ffb000; } .nametag.r-mystery { background: #12c48b; }

.mgrid .mbtn { padding-top: 7px; gap: 2px; justify-content: flex-start; min-height: 0; min-width: 0; }
.mgrid .mbtn b { width: 100%; }
.mgrid .mbtn .tag { font-size: 10px; }
.mgrid .mbtn .tag.auto { width: 16px; height: 16px; padding: 0; border-radius: 50%; font-size: 10px; line-height: 16px; text-align: center; margin-right: -30px; }
.mgrid .mbtn .cap { width: 46px; height: 46px; font-size: 21px; box-shadow: 0 5px 0 var(--bd, #1478c2), 0 6px 8px rgba(0,0,0,.4), inset 0 -3px 0 rgba(0,0,0,.15); }
.mgrid .mbtn.on .cap { transform: translateY(4px); box-shadow: 0 1px 0 var(--bd, #1478c2), 0 0 16px var(--bc); }
.mgrid .mbtn b { font-size: 10px; max-width: 76px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgrid .mbtn .lamp { width: 10px; height: 10px; margin-left: -5px; }
.mgrid .mbtn .tag { top: 4px; right: 50%; margin-right: -34px; font-size: 9px; padding: 0 4px; }
.dctl .mbtn.start .cap { width: 64px; height: 64px; font-size: 28px; }
.dctl .mbtn { padding-top: 10px; }
.dctl .mbtn b { font-size: 11px; }
/* floaters are only small, non-blocking markers now */
#floaters .fl { pointer-events: none; }
.bubble { font-size: 13px; padding: 4px 9px; border-radius: 12px; }
.mark { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px #fff; animation: pulse .7s infinite; }
.mark.gold { background: #ffd23f; color: var(--ink); }
.mark.pink { background: var(--pink); }

/* banners + arrow */
.banner small { display: block; font-size: .32em; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); margin-top: 6px; white-space: normal; }
.banner.perfect { background: linear-gradient(90deg, #ffd23f, #ff5fb7, #4fc3ff, #7bd88f, #ffd23f); background-size: 200%; -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 5px 0 #fff) drop-shadow(0 8px 10px rgba(0,0,0,.25)); animation: bannerIn 2.2s forwards, shine 1s linear infinite; }
@keyframes bannerIn { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-8deg); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.15) rotate(2deg); opacity: 1; } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { transform: translate(-50%, -70%) scale(1); opacity: 0; } }

@keyframes point { 50% { margin-top: -12px; } }
.glow { box-shadow: 0 0 0 4px var(--yellow), 0 0 24px 6px var(--yellow) !important; border-radius: 18px; }
/* sheets */
.sheet { position: absolute; inset: 0; z-index: 70; background: rgba(10,30,60,.35); display: flex; align-items: center; justify-content: center; padding: calc(8px + var(--sat)) 8px calc(8px + var(--sab)); }
.sheet-card { background: #f4f9ff; border-radius: 26px; width: min(760px, 100%); max-height: 100%; height: min(760px, 100%); display: flex; flex-direction: column; box-shadow: var(--shadow); overflow: hidden; animation: slideup .25s; }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 6px; }
.sheet h2 { margin: 0; font-family: var(--display); font-size: 28px; color: var(--sky); text-shadow: 0 2px 0 #c6e6ff; }
.sheet .x { background: #e3eef9; color: var(--ink); }
.tabs { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 8px 14px; border-radius: 14px; background: #e3eef9; font-weight: 700; font-size: 15px; white-space: nowrap; position: relative; }
.tabs button.on { background: var(--sky); color: #fff; box-shadow: 0 3px 0 #1478c2; }
.tabs button .dot { top: -3px; right: -3px; width: 12px; height: 12px; }
.sheet-body { overflow-y: auto; padding: 4px 12px 16px; flex: 1; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.sheet-body p.intro { margin: 2px 4px 10px; font-weight: 600; opacity: .75; }

.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.item { background: #fff; border-radius: 18px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; box-shadow: 0 3px 0 #d5e3f1; position: relative; }
.item .ic { font-size: 34px; width: 52px; height: 52px; border-radius: 14px; background: var(--soft); display: flex; align-items: center; justify-content: center; flex: none; }
.item .tx { flex: 1; min-width: 0; }
.item .tx b { display: block; font-size: 16px; }
.item .tx .tier { font-family: var(--display); color: var(--pink); font-size: 14px; letter-spacing: .3px; }
.item .tx small { display: block; font-size: 13px; opacity: .75; line-height: 1.25; }
.pips { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.pips i { width: 12px; height: 8px; border-radius: 3px; background: #dbe7f3; }
.pips i.on { background: var(--green); }
.buy { flex: none; min-width: 92px; padding: 10px 10px; border-radius: 14px; background: var(--green); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 4px 0 #23934b; display: flex; flex-direction: column; align-items: center; line-height: 1.1; position: relative; overflow: hidden; }
.buy small { font-size: 11px; opacity: .9; }
.buy.cant { background: #c6d3e0; box-shadow: 0 4px 0 #9fb0c2; color: #5d6b7c; }
.buy.cant .reach { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--green); }
.buy.done { background: #e8f8ee; color: var(--green); box-shadow: none; }
.buy.lock { background: #e3eef9; color: #7b8aa0; box-shadow: none; font-size: 12px; }
.buy:active:not(.done):not(.lock) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.item.newly { animation: popin .4s; }
.section-h { font-family: var(--display); font-size: 19px; color: var(--ink); margin: 14px 4px 8px; letter-spacing: .3px; }

/* customize */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 40px; height: 40px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 3px 0 #d5e3f1; position: relative; }
.sw.on { outline: 4px solid var(--ink); outline-offset: 1px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { background: #fff; border-radius: 14px; padding: 8px 12px; font-weight: 700; box-shadow: 0 3px 0 #d5e3f1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 86px; }
.opt small { font-size: 11px; font-weight: 600; opacity: .7; }
.opt.on { background: var(--sky); color: #fff; box-shadow: 0 3px 0 #1478c2; }
.opt.lock { opacity: .55; }
.opt .fs { width: 48px; height: 22px; border-radius: 99px; }
.namebox { display: flex; gap: 8px; }
.namebox input { flex: 1; font: inherit; font-size: 18px; font-weight: 700; padding: 10px 14px; border-radius: 14px; border: 3px solid #d5e3f1; min-width: 0; }

/* collection */
.coll { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.vc { background: #fff; border-radius: 16px; padding: 8px; text-align: center; box-shadow: 0 3px 0 #d5e3f1; border-top: 6px solid var(--rc, #8bd17c); }
.vc canvas { width: 100%; height: auto; display: block; }
.vc b { display: block; font-size: 14px; line-height: 1.1; min-height: 31px; }
.vc small { font-size: 11px; font-weight: 700; color: var(--rc); }
.vc.unknown { background: #e9eff6; }
.bigcount { font-family: var(--display); font-size: 24px; color: var(--pink); }
.ach { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 3px 0 #d5e3f1; }
.ach .ic { font-size: 30px; }
.ach.done { background: linear-gradient(#fffbe6, #fff3c0); }
.ach.locked .ic { filter: grayscale(1); opacity: .5; }
.bar { height: 10px; background: #e3eef9; border-radius: 99px; overflow: hidden; margin-top: 4px; } .bar i { display: block; height: 100%; background: var(--green); }

/* staff */
.staff .ic { font-size: 30px; border: 4px solid var(--uc, #fff); }
.stats { display: flex; gap: 10px; font-size: 12px; font-weight: 700; margin-top: 3px; flex-wrap: wrap; }

/* modal */
.modal { position: absolute; inset: 0; z-index: 80; background: rgba(10,30,60,.45); display: flex; align-items: center; justify-content: center; }
.pop { animation: popin .35s; }
.big-num { font-family: var(--display); font-size: 44px; color: var(--sky); }
.big-num.money { color: #e3a00a; text-shadow: 0 3px 0 #ffe27a; }
.modal p { margin: 4px 0; font-weight: 600; font-size: 17px; }

/* minigames */
.mini { position: absolute; left: 50%; top: calc(60px + var(--sat)); transform: translateX(-50%); z-index: 55; background: rgba(255,255,255,.96); border-radius: 22px; padding: 10px 14px; box-shadow: var(--shadow); width: min(460px, calc(100% - 20px)); display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.mini.full { top: 50%; transform: translate(-50%, -50%); width: min(720px, calc(100% - 16px)); max-height: calc(100% - 16px); }
.mini-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.mini-top b { font-family: var(--display); font-size: 22px; color: var(--sky); }
.mini-top span { font-weight: 600; font-size: 14px; }
.mini .timer { font-family: var(--display); font-size: 26px; color: var(--pink); min-width: 40px; text-align: right; }
.mini-meter { position: relative; height: 22px; background: #e3eef9; border-radius: 99px; overflow: hidden; }
.mini-meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #4fc3ff, #3cc76a); }
.mini-meter span { position: relative; display: block; text-align: center; font-weight: 700; line-height: 22px; }
#vacCv { width: 100%; aspect-ratio: 16/10; background: #8d6e63; border-radius: 16px; touch-action: none; }
#spray .btn { align-self: center; }

/* settings */
.set-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; box-shadow: 0 3px 0 #d5e3f1; font-weight: 700; gap: 10px; }
.seg { display: flex; gap: 4px; background: #e3eef9; border-radius: 12px; padding: 3px; flex-wrap: wrap; }
.seg button { padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--sky); color: #fff; }
.help { background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 3px 0 #d5e3f1; font-size: 15px; line-height: 1.45; }
.help b { color: var(--pink); }


/* portrait phones and tablets: please turn sideways */
#rotate { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: linear-gradient(#2aa8ff, #7fd3ff); color: #fff; text-align: center; padding: 24px; }
#rotate div { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#rotate b { font-family: var(--display); font-size: 30px; text-shadow: 0 3px 0 #1478c2; }
#rotate small { font-size: 16px; font-weight: 600; }
.rphone { font-size: 80px; animation: turn 2s ease-in-out infinite; }
@keyframes turn { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (orientation: portrait) and (max-width: 1100px) { body.ingame #rotate { display: flex; } }

/* ---------------- sizes ---------------- */
@media (max-width: 1180px) { .dgauge { display: none; } }
@media (max-width: 1000px) { .dcar { width: 210px; } .dmenu { width: 210px; } .nbtn b { font-size: 11px; } .chip.money small { display: none; } }
/* phones in landscape */
@media (max-height: 520px) {
  :root { --topH: 42px; --dockH: 130px; }
  .chip { font-size: 14px; padding: 0 9px; } .chip.money { font-size: 17px; } .coin { width: 18px; height: 18px; }
  .chip.money small { display: none; }
  .xpbar { width: 44px; }
  .ticker span { font-size: 13px; } .ticker.coach span { font-size: 12px; }
  .ib { width: 42px; font-size: 17px; } .ib small { display: none; }
  .dock { padding: 5px calc(5px + var(--sar)) calc(5px + var(--sab)) calc(5px + var(--sal)); gap: 5px; border-top-width: 3px; }
  .dock > section, .dock > nav { padding: 4px; border-radius: 12px; }
  .dcar { width: 180px; gap: 4px; }
  .lanesw button { height: 26px; width: 36px; } .lanesw b { font-size: 12px; }
  .carview { padding: 4px 6px; gap: 2px; } .cc-top { font-size: 13px; } .cc-pkg { font-size: 11px; min-height: 12px; }
  .meter { height: 17px; } .meter span { line-height: 17px; font-size: 11px; }
  .kiosk { padding: 3px 4px; gap: 3px; } .ksay { font-size: 11px; } .ksay #kWho { font-size: 16px; }
  .kopt { font-size: 11px; min-height: 40px; padding: 3px 1px; } .kopt small { font-size: 11px; }
  .act { min-height: 34px; font-size: 12px; }
  .dctl { width: 84px; gap: 3px; }
  .dctl .mbtn { padding-top: 7px; } .dctl .mbtn.start .cap { width: 46px; height: 46px; font-size: 21px; } .dctl .mbtn b { display: none; }
  .mini-b { width: 38px; height: 34px; font-size: 14px; } .mini-b small { display: none; }
  .tank { padding: 4px 2px; margin: -4px 0; } .tank > i { width: 20px; height: 16px; border-radius: 4px; }
  .mgrid .mbtn { padding-top: 5px; } .mgrid .mbtn .cap { width: 36px; height: 36px; font-size: 17px; box-shadow: 0 4px 0 var(--bd, #1478c2), 0 5px 6px rgba(0,0,0,.4); }
  .mgrid .mbtn b { font-size: 10px; } .mgrid .mbtn .lamp { width: 8px; height: 8px; margin-left: -4px; }
  .mgrid .mbtn .tag { font-size: 8px; margin-right: -28px; }
  .dmenu { width: 168px; gap: 4px; } .nbtn { min-height: 0; border-radius: 10px; } .nbtn span { font-size: 19px; } .nbtn b { font-size: 10px; }
  .dot { width: 10px; height: 10px; top: 2px; right: 3px; }
  .dockmini .mt { font-size: 20px; } .dockmini .mh { display: none; } .dockmini .timer { font-size: 24px; }
}
@media (max-height: 520px) and (max-width: 760px) { .dcar { width: 156px; } .dmenu { width: 150px; } .chip.q { display: none; } .ticker { padding: 0 8px; } }
/* roomy desktops */
@media (min-height: 860px) and (min-width: 1200px) { :root { --topH: 56px; --dockH: 212px; } .mgrid .mbtn .cap { width: 54px; height: 54px; font-size: 24px; } .mgrid .mbtn b { font-size: 11px; } .dcar { width: 290px; } .dmenu { width: 300px; } .nbtn span { font-size: 28px; } .nbtn b { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; } }

#arrow { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; font-size: 34px; transform: translate(-50%, -100%); animation: point .6s infinite; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }

.ticker.coach span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-height: 520px) { .ticker.coach b { display: none; } }
