:root {
  --f: "Arial Black", "Segoe UI Black", "Segoe UI", Roboto, system-ui, sans-serif;
  --cyan: #5ffcff; --pink: #ff2bd6; --gold: #ffc400; --green: #39ff88; --red: #ff3b5c;
  --panel: rgba(18, 6, 44, .94); --line: rgba(170, 120, 255, .55);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a0020; color: #fff; font-family: var(--f);
  touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
#app { position: fixed; inset: 0; overflow: hidden; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hide { display: none !important; }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }
button { font-family: var(--f); }

/* ---------- buttons ---------- */
.btn { --c1: #9b5cff; --c2: #6a2cff; --sh: #36108f; --tx: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font-size: 18px; letter-spacing: .5px; color: var(--tx); border: 0; border-radius: 16px; padding: 14px 24px; cursor: pointer;
  background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: 0 6px 0 var(--sh), 0 10px 22px rgba(0, 0, 0, .35);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25); transition: transform .08s, filter .15s; position: relative; white-space: nowrap; }
.btn::after { content: ""; position: absolute; left: 10%; right: 10%; top: 4px; height: 35%; border-radius: 12px; background: rgba(255, 255, 255, .22); pointer-events: none; }
.btn:hover { filter: brightness(1.12); transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--sh), 0 4px 10px rgba(0, 0, 0, .3); }
.btn svg { font-size: 1.25em; }
.btn.primary { --c1: #7ffdff; --c2: #00b7ff; --sh: #00679a; --tx: #002238; text-shadow: none; }
.btn.purple { --c1: #b07bff; --c2: #7a3cff; --sh: #3c138f; }
.btn.pink { --c1: #ff7bee; --c2: #e0149f; --sh: #7a0656; }
.btn.gold { --c1: #ffe36b; --c2: #ffab00; --sh: #9a5a00; --tx: #3a1d00; text-shadow: none; }
.btn.green { --c1: #7dffb4; --c2: #19c46e; --sh: #0b6b3c; --tx: #013a1c; text-shadow: none; }
.btn.red { --c1: #ff7a8e; --c2: #e8163e; --sh: #7a0820; }
.btn.ad { --c1: #7dffb4; --c2: #12b865; --sh: #0b6b3c; --tx: #013a1c; text-shadow: none; }
.btn.ad::before { content: "AD"; position: absolute; top: -8px; right: -6px; font-size: 10px; background: #fff; color: #0b6b3c; padding: 2px 6px; border-radius: 8px; box-shadow: 0 2px 0 #0b6b3c; }
.btn.ghost { --c1: rgba(255, 255, 255, .14); --c2: rgba(255, 255, 255, .06); --sh: rgba(0, 0, 0, .45); border: 2px solid rgba(255, 255, 255, .25); }
.btn.big { font-size: 22px; padding: 16px 34px; }
.btn.xl { font-size: clamp(24px, 4.2vh, 34px); padding: clamp(14px, 2.4vh, 20px) clamp(48px, 9vw, 80px); border-radius: 22px; }
.btn.sm { font-size: 14px; padding: 9px 14px; border-radius: 12px; box-shadow: 0 4px 0 var(--sh); }
.btn:disabled { filter: grayscale(.5) brightness(.8); cursor: default; transform: none; }
.btn.poor { filter: grayscale(.6) brightness(.85); }
.btn.locked { --c1: #3a3456; --c2: #2a2442; --sh: #151126; --tx: #bfb6e6; }
.ibtn { width: 50px; height: 50px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, .22); cursor: pointer; color: #fff; font-size: 26px;
  display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(120, 70, 255, .55), rgba(60, 20, 150, .55));
  box-shadow: 0 5px 0 rgba(0, 0, 0, .45); transition: transform .08s; }
.ibtn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.row.nw { flex-wrap: nowrap; align-items: center; }
.btn.sq { padding: 14px; }
.btn.sq::after { left: 18%; right: 18%; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; border-radius: 999px; font-size: 18px;
  background: rgba(8, 0, 26, .6); border: 2px solid rgba(255, 255, 255, .16); box-shadow: inset 0 0 12px rgba(0, 0, 0, .4); }
.chip i { display: inline-flex; font-size: 24px; }
.chip.star i { color: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 196, 0, .6)); }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 45%, rgba(10, 0, 30, .15), rgba(5, 0, 18, .78)); }
.topbar { width: 100%; display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.scr-title { margin: 0 0 0 6px; font-size: clamp(20px, 3.6vh, 30px); font-style: italic; letter-spacing: 1px; text-shadow: 0 0 14px rgba(95, 252, 255, .6), 0 3px 0 #2a0b6b; }

/* logo */
.logo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: .86; transform: skewX(-8deg); }
.glitch { position: relative; display: block; font-style: italic; font-size: clamp(44px, min(13vw, 15vh), 132px); letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 10px var(--cyan), 0 0 34px rgba(0, 183, 255, .8), 0 6px 0 #2a0b6b; }
.glitch.l2 { color: #ffe9fb; text-shadow: 0 0 10px var(--pink), 0 0 34px rgba(255, 43, 214, .8), 0 6px 0 #2a0b6b; margin-left: .5em; }
.glitch::before, .glitch::after { content: attr(data-t); position: absolute; inset: 0; text-shadow: none; pointer-events: none; opacity: .85; }
.glitch::before { color: var(--pink); animation: gl1 3.2s infinite steps(1); clip-path: inset(0 0 100% 0); }
.glitch::after { color: var(--cyan); animation: gl2 2.7s infinite steps(1); clip-path: inset(100% 0 0 0); }
@keyframes gl1 { 0%, 88%, 100% { transform: none; clip-path: inset(0 0 100% 0); } 89% { transform: translate(6px, -2px); clip-path: inset(12% 0 58% 0); }
  92% { transform: translate(-5px, 1px); clip-path: inset(48% 0 22% 0); } 95% { transform: translate(4px, 0); clip-path: inset(70% 0 5% 0); } }
@keyframes gl2 { 0%, 80%, 100% { transform: none; clip-path: inset(100% 0 0 0); } 81% { transform: translate(-6px, 2px); clip-path: inset(62% 0 12% 0); }
  85% { transform: translate(5px, -1px); clip-path: inset(20% 0 55% 0); } }

/* loading */
#sLoad { justify-content: center; gap: 26px; background: radial-gradient(ellipse at center, #2a0a58, #07001c 70%); }
.loadbar { width: min(320px, 70vw); height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; border: 2px solid rgba(255, 255, 255, .2); }
.loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width .3s; box-shadow: 0 0 12px var(--cyan); }
.loadtxt { margin: 0; font-size: 14px; letter-spacing: 6px; opacity: .7; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* menu */
.menu-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2vh, 18px); }
.tagline { margin: 0; font-size: clamp(13px, 2.2vh, 18px); letter-spacing: 3px; color: #d8cfff; opacity: .9; text-transform: uppercase; }
.menu-btns { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: clamp(4px, 1.5vh, 14px); }
.menu-btns .row { margin-top: 14px; }
.menu-btns .row .btn { min-width: 150px; }
.btn.play { flex-direction: column; gap: 4px; }
.btn.play .pl { display: inline-flex; align-items: center; gap: .4em; }
.btn.play small { font: 800 12px system-ui, sans-serif; letter-spacing: 1px; opacity: .75; text-transform: uppercase; }
.btn.play small:empty { display: none; }
#bSkip { margin-left: 4px; }
#hud .chip.bump { animation: bump .25s ease-out; }
@keyframes bump { 40% { transform: scale(1.18); border-color: var(--gold); } }
#attempt em { display: block; font-style: normal; font-size: .36em; letter-spacing: 3px; color: var(--gold); margin-top: 4px; }
#wipe { position: absolute; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
#wipe i { position: absolute; left: 0; right: 0; height: 16.8%; transform: translateX(-101%); background: linear-gradient(90deg, #ff2bd6, #7a3cff 45%, #5ffcff); }
#wipe i:nth-child(1) { top: 0; } #wipe i:nth-child(2) { top: 16.66%; } #wipe i:nth-child(3) { top: 33.33%; }
#wipe i:nth-child(4) { top: 50%; } #wipe i:nth-child(5) { top: 66.66%; } #wipe i:nth-child(6) { top: 83.33%; }
#wipe.go i { animation: wipe .42s cubic-bezier(.6, 0, .4, 1) both; }
#wipe.go i:nth-child(even) { animation-name: wipe2; }
#wipe.go i:nth-child(2) { animation-delay: .02s; } #wipe.go i:nth-child(3) { animation-delay: .04s; } #wipe.go i:nth-child(4) { animation-delay: .01s; }
#wipe.go i:nth-child(5) { animation-delay: .03s; } #wipe.go i:nth-child(6) { animation-delay: .05s; }
@keyframes wipe { 0% { transform: translateX(-101%); } 42%, 58% { transform: translateX(0); } 100% { transform: translateX(101%); } }
@keyframes wipe2 { 0% { transform: translateX(101%); } 42%, 58% { transform: translateX(0); } 100% { transform: translateX(-101%); } }
.menu-foot { font-size: 14px; letter-spacing: 2px; opacity: .8; }
.menu-foot b { color: var(--cyan); }
.rotate-tip { display: none; font-size: 12px; opacity: .7; letter-spacing: 1px; }
@media (orientation: portrait) and (pointer: coarse) { .rotate-tip { display: block; } }

/* level select */
#sLevels { --tc: #5ffcff; --tc2: #ff2bd6; }
#sLevels[data-theme="medium"] { --tc: #ffb000; --tc2: #ff5a1f; }
#sLevels[data-theme="hard"] { --tc: #39ff88; --tc2: #b388ff; }
.lv-wrap { flex: 1; width: min(100%, 660px); display: flex; flex-direction: column; justify-content: center; gap: clamp(8px, 1.8vh, 16px); }
.tabs { display: flex; gap: 10px; }
.tab { flex: 1; border: 2px solid rgba(255, 255, 255, .15); border-radius: 18px; padding: 10px 8px; cursor: pointer; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(180deg, rgba(40, 20, 90, .85), rgba(15, 6, 40, .9)); box-shadow: 0 5px 0 rgba(0, 0, 0, .45); transition: transform .1s; opacity: .75; }
.tab b { font-size: clamp(16px, 2.8vh, 22px); font-style: italic; }
.tab small { font-size: 10px; letter-spacing: 1.5px; opacity: .75; font-family: system-ui, sans-serif; font-weight: 800; }
.tab .ts { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--gold); }
.tab.on { opacity: 1; transform: translateY(-3px) scale(1.03); }
.tab.t-easy.on { border-color: #5ffcff; background: linear-gradient(180deg, #7a1fa8, #2a0a58); box-shadow: 0 5px 0 #13032e, 0 0 22px rgba(95, 252, 255, .5); }
.tab.t-medium.on { border-color: #ffb000; background: linear-gradient(180deg, #a8521f, #3a1a0a); box-shadow: 0 5px 0 #1a0a02, 0 0 22px rgba(255, 176, 0, .5); }
.tab.t-hard.on { border-color: #39ff88; background: linear-gradient(180deg, #2a1f6a, #07001a); box-shadow: 0 5px 0 #000, 0 0 22px rgba(57, 255, 136, .45); }
.world { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 4px; flex-wrap: wrap; }
.wname { font-size: clamp(16px, 3vh, 24px); font-style: italic; color: var(--tc); text-shadow: 0 0 12px var(--tc); }
.winfo { font: 800 12px system-ui, sans-serif; letter-spacing: 1px; opacity: .8; text-transform: uppercase; }
.lgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1.6vh, 14px); width: min(100%, 118vh); margin: 0 auto; }
.lvl { position: relative; aspect-ratio: 1; border-radius: 18px; border: 2px solid color-mix(in srgb, var(--tc) 55%, transparent); cursor: pointer; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(160deg, rgba(50, 26, 110, .92), rgba(16, 6, 40, .95)); box-shadow: 0 5px 0 rgba(0, 0, 0, .5), inset 0 0 18px rgba(0, 0, 0, .35); transition: transform .1s; }
.lvl:hover { transform: translateY(-3px); }
.lvl:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.lvl .num { font-size: clamp(22px, 5vh, 38px); font-style: italic; text-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.lvl .stars { display: flex; gap: 1px; font-size: clamp(12px, 2.4vh, 18px); }
.lvl .best { position: absolute; top: 5px; right: 8px; font: 800 11px system-ui, sans-serif; color: var(--tc); }
.lvl .lk { font-size: clamp(22px, 4.4vh, 34px); opacity: .7; }
.lvl.locked { background: linear-gradient(160deg, rgba(40, 36, 60, .85), rgba(18, 14, 30, .9)); border-color: rgba(255, 255, 255, .1); cursor: not-allowed; }
.lvl.done { background: linear-gradient(160deg, color-mix(in srgb, var(--tc2) 55%, #1a0840), rgba(20, 6, 46, .95)); border-color: var(--tc); }
.lvl.cur { border-color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 5px 0 rgba(0, 0, 0, .5), 0 0 24px var(--tc); } }
.st { color: rgba(255, 255, 255, .18); display: inline-flex; }
.st.on { color: var(--gold); filter: drop-shadow(0 0 5px rgba(255, 196, 0, .7)); }

/* shop */
.shop { flex: 1; width: min(100%, 900px); overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; padding: 14px 4px; align-content: start; touch-action: pan-y; }
.skin { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; border-radius: 18px; background: linear-gradient(160deg, rgba(50, 26, 110, .9), rgba(16, 6, 40, .95));
  border: 2px solid rgba(255, 255, 255, .12); box-shadow: 0 5px 0 rgba(0, 0, 0, .45); }
.skin.eq { border-color: var(--green); box-shadow: 0 5px 0 rgba(0, 0, 0, .45), 0 0 18px rgba(57, 255, 136, .35); }
.skin canvas { width: 76px; height: 76px; }
.skin b { font-size: 15px; font-style: italic; }
#shopTop .btn { margin-right: 4px; }

/* ---------- HUD ---------- */
#hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 12px; pointer-events: none;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
#hud > * { pointer-events: auto; }
#hud .hud-mid { pointer-events: none; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
#hud .hud-mid .pbar { flex: 1; width: auto; max-width: 440px; }
.pbar { position: relative; width: min(46vw, 440px); height: 14px; border-radius: 99px; background: rgba(0, 0, 0, .45); border: 2px solid rgba(255, 255, 255, .25); overflow: hidden; }
.pfill { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: 0 0 10px var(--cyan); }
#pmarks i { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--green); box-shadow: 0 0 6px var(--green); }
.ptxt { font-size: 18px; min-width: 52px; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
#hud.endless .pbar { display: none; }
#hud.endless .ptxt { font-size: 26px; font-style: italic; }
#attempt { position: absolute; left: 0; right: 0; top: 22%; text-align: center; font-size: clamp(26px, min(7vh, 10vw), 54px); font-style: italic; opacity: 0; pointer-events: none;
  text-shadow: 0 0 16px rgba(95, 252, 255, .7), 0 4px 0 #2a0b6b; }
#attempt small { display: block; font-size: .38em; letter-spacing: 3px; opacity: .85; }
#attempt.go { animation: att 1.9s ease-out forwards; }
@keyframes att { 0% { opacity: 0; transform: scale(1.4); } 15% { opacity: 1; transform: scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
#tapStart { position: absolute; left: 0; right: 0; bottom: 14%; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#tapStart b { font-size: clamp(20px, 4vh, 30px); letter-spacing: 2px; animation: blink 1.1s infinite; text-shadow: 0 0 12px var(--cyan), 0 3px 0 #2a0b6b; }
#tapStart small { font: 800 12px system-ui, sans-serif; letter-spacing: 2px; opacity: .8; text-transform: uppercase; }
.tapring { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--cyan); display: flex; align-items: center; justify-content: center; animation: ring 1.1s infinite; }
.tapring span { width: 16px; height: 16px; border-radius: 50%; background: var(--cyan); }
@keyframes ring { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.35); opacity: .2; } }

/* ---------- modal ---------- */
#modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4, 0, 14, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: 12px; }
.panel { width: min(94vw, 460px); max-height: 96%; overflow-y: auto; text-align: center; padding: clamp(16px, 3vh, 26px) 22px; border-radius: 26px; background: var(--panel);
  border: 2px solid var(--line); box-shadow: 0 0 0 5px rgba(0, 0, 0, .35), 0 0 50px rgba(140, 80, 255, .35), inset 0 0 40px rgba(140, 80, 255, .12); animation: pop .28s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.title { margin: 0; font-size: clamp(30px, 6vh, 44px); font-style: italic; letter-spacing: 1px; transform: skewX(-6deg);
  background: linear-gradient(180deg, #fff, #9ef9ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgba(95, 252, 255, .6)) drop-shadow(0 4px 0 #2a0b6b); }
.title.danger { background-image: linear-gradient(180deg, #fff, #ff7a9c); filter: drop-shadow(0 0 12px rgba(255, 59, 92, .7)) drop-shadow(0 4px 0 #4a0616); }
.title.win { font-size: clamp(26px, 5.4vh, 38px); white-space: nowrap; background-image: linear-gradient(180deg, #fffbd0, #ffc400); filter: drop-shadow(0 0 14px rgba(255, 196, 0, .7)) drop-shadow(0 4px 0 #5a3000); }
.sub { margin: 8px 0 0; font: 800 14px system-ui, sans-serif; letter-spacing: 1.5px; opacity: .85; text-transform: uppercase; }
.sub.small { font-size: 12px; opacity: .7; }
.hint { margin: 14px 0 0; font: 700 12px system-ui, sans-serif; opacity: .55; letter-spacing: 1px; }
.credits { margin: 16px 0 0; font-size: 11px; opacity: .4; letter-spacing: 2px; }
.pct { margin: 16px auto 4px; width: min(100%, 340px); }
.pbar.big { width: 100%; height: 20px; }
.pbar .bestmark { position: absolute; top: -2px; bottom: -2px; width: 3px; background: #fff; box-shadow: 0 0 6px #fff; }
.ptext { display: flex; justify-content: space-between; margin-top: 6px; font-size: 20px; }
.ptext span { font: 800 13px system-ui, sans-serif; opacity: .7; align-self: center; }
.bigstars { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 14px 0 6px; }
.bigstars .st { font-size: clamp(48px, 10vh, 70px); }
.bigstars .st:nth-child(2) { font-size: clamp(60px, 13vh, 88px); transform: translateY(-8px); }
.bigstars .st.pop { animation: starpop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes starpop { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1); } }
.bigstars .st:nth-child(2).pop { animation-name: starpop2; }
@keyframes starpop2 { 0% { transform: translateY(-8px) scale(0) rotate(-40deg); } 100% { transform: translateY(-8px) scale(1); } }
.reward { display: inline-flex; align-items: center; gap: 8px; font-size: 34px; margin-top: 6px; }
.reward svg { font-size: 36px; filter: drop-shadow(0 0 8px rgba(255, 196, 0, .7)); }
.dist { margin-top: 10px; display: flex; flex-direction: column; align-items: center; }
.dist b { font-size: clamp(48px, 11vh, 76px); font-style: italic; line-height: 1; text-shadow: 0 0 20px rgba(95, 252, 255, .7), 0 5px 0 #2a0b6b; }
.dist span { font: 800 13px system-ui, sans-serif; letter-spacing: 4px; opacity: .7; }
.newbest { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 16px; animation: blink .8s infinite; }
.toggles { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.tgl { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; font-size: 14px; }
.tgl svg { font-size: 22px; }
.tgl i { width: 38px; height: 22px; border-radius: 99px; background: #3a3456; position: relative; transition: background .2s; }
.tgl i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.tgl.on i { background: var(--green); }
.tgl.on i::after { transform: translateX(16px); }
.tgl:not(.on) { opacity: .6; }

/* ---------- toast & ad placeholder ---------- */
#toast { position: absolute; left: 50%; top: 70px; transform: translate(-50%, -30px); padding: 10px 20px; border-radius: 999px; background: rgba(10, 0, 30, .9);
  border: 2px solid var(--cyan); font-size: 16px; letter-spacing: 1px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; white-space: nowrap; box-shadow: 0 0 20px rgba(95, 252, 255, .4); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#fakeAd { position: absolute; inset: 0; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; z-index: 50; }
.fa-box { text-align: center; }
.fa-box b { display: inline-block; font-size: 44px; padding: 6px 22px; border-radius: 12px; background: #fff; color: #000; }
.fa-box p { font: 700 16px system-ui, sans-serif; opacity: .8; }
.fa-bar { width: 260px; height: 8px; border-radius: 99px; background: #333; overflow: hidden; margin: 0 auto; }
.fa-bar i { display: block; height: 100%; width: 0; background: var(--green); }

/* ---------- small screens ---------- */
@media (max-height: 520px) {
  .ibtn { width: 42px; height: 42px; font-size: 22px; border-radius: 13px; }
  .chip { font-size: 15px; padding: 4px 11px 4px 6px; }
  .chip i { font-size: 20px; }
  .tab { padding: 6px; border-radius: 14px; }
  .tab small { display: none; }
  .lvl { border-radius: 14px; }
  .menu-btns .row { margin-top: 8px; }
  .btn.big { font-size: 18px; padding: 12px 24px; }
  .row { margin-top: 8px; }
  .panel { padding: 12px 18px; border-radius: 20px; }
  .panel .btn { padding: 9px 18px; font-size: 16px; }
  .panel .btn.sq { padding: 9px 12px; }
  .panel .btn.big { padding: 11px 26px; font-size: 18px; }
  .title { font-size: 28px; }
  .title.win { font-size: 26px; }
  .sub { margin-top: 3px; font-size: 12px; }
  .hint { display: none; }
  .pct { margin: 8px auto 0; }
  .dist { margin-top: 2px; }
  .dist b { font-size: 40px; }
  .reward { font-size: 24px; margin-top: 0; }
  .reward svg { font-size: 26px; }
  .bigstars { margin: 2px 0 0; }
  .bigstars .st { font-size: 38px; }
  .bigstars .st:nth-child(2) { font-size: 48px; }
  .toggles { margin-top: 8px; }
  .tgl { padding: 7px 10px; }
}
.panel::-webkit-scrollbar { width: 0; }
@media (max-width: 560px) {
  .menu-btns .row { gap: 8px; }
  .menu-btns .row .btn { min-width: 0; padding: 12px 14px; font-size: 15px; }
}
@media (max-width: 420px) {
  .menu-btns .row .btn { min-width: 0; }
  .btn { font-size: 16px; padding: 12px 18px; }
  .tab small { display: none; }
  .scr-title { font-size: 18px; }
  #shopTop .btn { font-size: 11px; padding: 7px 9px; }
  #hud { gap: 8px; }
  #hud .chip { font-size: 14px; padding: 4px 10px 4px 5px; }
  #hud .chip i { font-size: 18px; }
  .ptxt { font-size: 15px; min-width: 40px; }
}
