/* MICROVERSE - an iOS-style game shell in the MDT look: near-black glass,
   MDT gold for the main actions, each level's neon accent (--acc) for the rest */
:root {
  --ink: #f4f7ff; --mute: #9aa6c0; --faint: #5f6a84; --bg: #05070d; --glass: rgba(12, 17, 30, 0.84); --glass2: rgba(22, 30, 50, 0.72);
  --line: rgba(255, 255, 255, 0.1); --line2: rgba(255, 255, 255, 0.18);
  --gold: #f0c868; --gold2: #ffd98a; --goldInk: #2a1c04; --acc: #43d9ff; --good: #46e39a; --bad: #ff5f6d; --hint: #8ab4ff;
  --font: Inter, -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; --title: Orbitron, Inter, system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --r: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input { -webkit-user-select: text; user-select: text; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
svg { flex: none; }
#buildTag { position: fixed; right: 6px; bottom: calc(4px + var(--safe-b)); font: 10px system-ui, sans-serif; color: rgba(255, 255, 255, 0.35); z-index: 95; pointer-events: none; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.kick { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--acc); }

/* --- loading */
#loading { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, #0d1a36, var(--bg) 68%); transition: opacity 0.5s; }
#loading.gone { opacity: 0; pointer-events: none; }
.ld { text-align: center; width: 270px; }
.ld b { display: block; font: 900 30px var(--title); letter-spacing: 3px; background: linear-gradient(180deg, #fff, #9fe8ff 50%, #43a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ld .bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); margin: 16px 0 10px; overflow: hidden; }
.ld .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #43d9ff, var(--gold)); transition: width 0.3s; }
.ld span { color: var(--mute); font-size: 13.5px; }

/* --- buttons and form bits */
.btn { flex: 1; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.08); font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; transition: transform 0.12s, background 0.2s; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold) 60%, #d9a640); border-color: rgba(255, 230, 160, 0.7); color: var(--goldInk); box-shadow: 0 6px 20px rgba(240, 200, 104, 0.22); }
.btn.big { min-height: 54px; font-size: 17px; }
.btn.sm { flex: none; min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(255, 95, 109, 0.16); border-color: rgba(255, 95, 109, 0.5); color: #ffb0b8; }
.btn:disabled { opacity: 0.45; }
.btns { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.link { background: none; border: 0; color: var(--gold); padding: 10px 0; font-weight: 600; }
.err { color: var(--bad); min-height: 18px; font-size: 13px; margin: 4px 0; }
.card input:not([type=range]) { width: 100%; height: 48px; border-radius: 13px; border: 1px solid var(--line2); background: rgba(0, 0, 0, 0.35); color: var(--ink); padding: 0 14px; font: inherit; margin-bottom: 8px; }
form { margin: 0; }
.seg { display: flex; background: rgba(255, 255, 255, 0.07); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--mute); }
.seg button.on { background: rgba(255, 255, 255, 0.92); color: #0c1220; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 150px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--gold) var(--p, 50%), rgba(255, 255, 255, 0.16) var(--p, 50%)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; }
.switch { position: relative; flex: none; width: 51px; height: 31px; border-radius: 16px; border: 0; padding: 0; background: rgba(255, 255, 255, 0.16); transition: background 0.2s; }
.switch i { position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 0.2s; }
.switch.on { background: var(--good); }
.switch.on i { transform: translateX(20px); }

/* --- the menu */
#menu { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; pointer-events: none; }
#menu > * { pointer-events: auto; }
.mTop { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) calc(14px + var(--safe-r)) 6px calc(14px + var(--safe-l)); }
.mdt-back { color: var(--mute); text-decoration: none; font-weight: 600; font-size: 14px; }
.acct { display: inline-flex; align-items: center; gap: 8px; background: rgba(8, 12, 22, 0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line2); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 14px; }
.acct .mxc { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); }
.acct .mxc:empty { display: none; }
.mPages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px calc(16px + var(--safe-r)) 24px calc(16px + var(--safe-l)); }
.page { max-width: 460px; }
#menu[data-tab=play] .mPages { display: flex; flex-direction: column; }
#pgPlay { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
#menu:not([data-tab=play]) .mPages { background: linear-gradient(180deg, rgba(5, 7, 13, 0.82), rgba(5, 7, 13, 0.94)); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.logo { display: flex; flex-direction: column; gap: 4px; }
.logo .l0 { font-size: 12px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.logo .l1 { font: 900 clamp(36px, 10.5vw, 54px)/1 var(--title); letter-spacing: 2px; background: linear-gradient(180deg, #ffffff 15%, #9fe8ff 55%, #3a9cff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(67, 200, 255, 0.35)); }
.tagline { margin: 0; color: #c8d4ee; font-size: 15px; max-width: 400px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.contCard { --acc: #43d9ff; text-align: left; border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent); border-radius: 22px; padding: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--acc) 20%, rgba(10, 14, 26, 0.92)), rgba(10, 14, 26, 0.92)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 30px color-mix(in srgb, var(--acc) 18%, transparent); transition: transform 0.15s; }
.contCard:active { transform: scale(0.98); }
.ccTop { display: flex; gap: 14px; align-items: center; }
.lvNum { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font: 900 24px var(--title); background: color-mix(in srgb, var(--acc) 22%, #0a0e18); border: 1px solid color-mix(in srgb, var(--acc) 60%, transparent); color: var(--acc); }
.ccTop > div { display: flex; flex-direction: column; min-width: 0; }
.ccTop b { font-size: 21px; line-height: 1.2; }
.ccTop .scale { color: var(--mute); font-size: 13px; }
.ccPlay { display: flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 15px; font-weight: 750; font-size: 17px; color: var(--goldInk); background: linear-gradient(180deg, var(--gold2), var(--gold) 60%, #d9a640); box-shadow: 0 6px 22px rgba(240, 200, 104, 0.3); }
.ccPlay svg { width: 18px; height: 18px; fill: currentColor; }
.statRow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: rgba(10, 14, 26, 0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.stat span { font-size: 11.5px; color: var(--mute); line-height: 1.2; }
.stat .big { font: 800 22px/38px var(--title); height: 38px; }
.ring { --p: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.12) 0); }
.ring b { width: 30px; height: 30px; border-radius: 50%; background: #0a0e18; display: grid; place-items: center; font: 800 14px var(--title); }
.pending { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, rgba(240, 200, 104, 0.2), rgba(240, 200, 104, 0.06)); border: 1px solid rgba(240, 200, 104, 0.45); border-radius: 16px; padding: 10px 12px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.pending > div { flex: 1; display: flex; flex-direction: column; }
.pending b { color: var(--gold2); }
.pending span { font-size: 12.5px; color: var(--mute); }
.lg { font: 800 32px/1.15 var(--font); letter-spacing: -0.5px; margin: 10px 0 4px; }
.pSub { margin: 0 0 14px; font-size: 14px; }
/* journey */
.jList { display: flex; flex-direction: column; gap: 8px; position: relative; }
.jRow { --acc: #43d9ff; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--glass2); border-radius: 16px; padding: 10px 12px; }
.jRow.cur { border-color: color-mix(in srgb, var(--acc) 60%, transparent); box-shadow: 0 0 20px color-mix(in srgb, var(--acc) 22%, transparent); }
.jRow.locked { opacity: 0.45; }
.jNum { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font: 800 16px var(--title); color: var(--acc); background: color-mix(in srgb, var(--acc) 16%, #0a0e18); border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent); }
.jNum svg { width: 17px; height: 17px; fill: var(--mute); }
.jTxt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jTxt b { font-size: 16px; }
.jTxt span { font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jStars i { font-style: normal; color: rgba(255, 255, 255, 0.18); font-size: 14px; }
.jStars i.on { color: var(--gold); }
.chev { width: 18px; height: 18px; color: var(--faint); }
/* codex */
.cxGroup { --acc: #43d9ff; margin-bottom: 16px; }
.cxHead { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.cxHead .jNum { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.cxHead b { flex: 1; font-size: 15px; }
.cxHead em { font-style: normal; font-size: 13px; color: var(--mute); }
.cxCard { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--glass2); border-radius: 14px; padding: 11px 13px; margin-bottom: 6px; }
.cxCard b { display: block; font-size: 15px; }
.cxCard .cxBody { display: none; color: #c8d4ee; font-size: 14px; margin-top: 4px; }
.cxCard.open { border-color: color-mix(in srgb, var(--acc) 50%, transparent); }
.cxCard.open .cxBody { display: block; }
.cxCard em { display: block; font-style: normal; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(240, 200, 104, 0.1); color: #f0dca8; font-size: 13px; }
.cxCard.locked { opacity: 0.45; }
.cxCard.locked span { font-size: 12.5px; color: var(--mute); }
/* settings: inset grouped */
.group { margin-bottom: 18px; }
.gHead { font-size: 12.5px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--mute); margin: 0 4px 6px; }
.gRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; padding: 8px 14px; background: var(--glass2); border: 0; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; }
.group .gRow:nth-child(2) { border-radius: 14px 14px 0 0; }
.group .gRow:last-child, .group .gRow:has(+ .gNote) { border-radius: 0 0 14px 14px; border-bottom: 0; }
.group .gRow:nth-child(2):last-child, .group .gRow:nth-child(2):has(+ .gNote) { border-radius: 14px; }
.gRow.link span { color: var(--ink); }
.gRow.danger span { color: var(--bad); }
.gNote { font-size: 12.5px; color: var(--mute); margin: 6px 4px 0; }
.ver { text-align: center; color: var(--faint); font-size: 12px; margin: 8px 0 20px; }
/* the tab bar */
.tabbar { display: flex; justify-content: space-around; padding: 6px calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l)); background: rgba(8, 11, 20, 0.86); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; max-width: 120px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--faint); font-size: 10.5px; font-weight: 600; }
.tabbar svg { width: 25px; height: 25px; fill: currentColor; }
.tabbar button.on { color: var(--gold); }

/* --- the level HUD */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hTop { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
.hTop > * { pointer-events: auto; }
.ibtn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line2); background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: grid; place-items: center; flex: none; }
.ibtn svg { width: 20px; height: 20px; fill: currentColor; }
.hMid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none; margin-right: 54px; }
.hLevel { font-size: 13px; font-weight: 650; color: #dfe6f6; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9); display: flex; align-items: center; gap: 7px; }
.hLevel b { font: 800 11px var(--title); color: var(--acc); border: 1px solid color-mix(in srgb, var(--acc) 60%, transparent); border-radius: 6px; padding: 1px 6px; }
.obj { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); border-radius: 999px; padding: 7px 16px; font-weight: 650; font-size: 14px; text-align: center; box-shadow: 0 0 18px color-mix(in srgb, var(--acc) 15%, transparent); }
.steps { display: flex; gap: 6px; }
.steps i { width: 26px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
.steps i.done { background: var(--good); }
.steps i.cur { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
#guide { position: absolute; top: calc(118px + var(--safe-t)); left: 50%; width: 38px; height: 38px; display: none; pointer-events: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7)); }
#guide svg { width: 100%; height: 100%; fill: var(--acc); }
body[data-ui=info] #guide, body[data-ui=console] #guide { display: none !important; }
#useBtn { position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(28px + var(--safe-b)); height: 54px; padding: 0 20px 0 16px; border-radius: 27px; border: 1px solid rgba(255, 230, 160, 0.7); background: linear-gradient(180deg, var(--gold2), var(--gold) 60%, #d9a640); color: var(--goldInk); font-weight: 750; font-size: 16px; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(240, 200, 104, 0.35); animation: pulse 1.8s ease-in-out infinite; }
#useBtn svg { width: 22px; height: 22px; fill: currentColor; }
body.touch #useBtn { bottom: calc(112px + var(--safe-b)); }
@keyframes pulse { 50% { box-shadow: 0 8px 34px rgba(240, 200, 104, 0.6); } }
body[data-ui=info] .hTop .obj, body[data-ui=console] .hTop .obj { opacity: 0.6; }

/* the touch stick and jump */
#controls { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
body:not(.touch) #controls { display: none; }
#stickZone { position: absolute; left: 0; bottom: 0; width: 45%; height: 55%; pointer-events: auto; touch-action: none; }
#stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); background: rgba(10, 16, 30, 0.3); left: calc(90px + var(--safe-l)); top: calc(100% - 110px - var(--safe-b)); pointer-events: none; opacity: 0.55; transition: opacity 0.2s; }
#stick.on { opacity: 1; }
#stick i { position: absolute; left: 34px; top: 34px; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.88); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
#jumpBtn { position: absolute; right: calc(20px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 68px; height: 68px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); background: rgba(10, 16, 30, 0.5); pointer-events: auto; touch-action: none; display: grid; place-items: center; }
#jumpBtn svg { width: 30px; height: 30px; fill: #fff; }

/* --- panels: a data card and the console dock. A bottom sheet on a phone,
   a side panel on a wide screen */
.panel { --acc: #43d9ff; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 56%; overflow-y: auto; -webkit-overflow-scrolling: touch; background: rgba(8, 12, 22, 0.9); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); border-top: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); border-radius: 24px 24px 0 0; padding: 8px calc(18px + var(--safe-r)) calc(16px + var(--safe-b)) calc(18px + var(--safe-l)); box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.5); animation: sheetUp 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1); touch-action: pan-y; }
@keyframes sheetUp { from { transform: translateY(40%); opacity: 0; } }
.grab { width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); margin: 2px auto 10px; }
@media (min-aspect-ratio: 5/4) and (min-width: 700px) {
  .panel { left: auto; top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); width: min(410px, 42vw); max-height: none; border-radius: 24px; border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent); padding: 18px 20px; animation: sheetIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
  .panel .grab { display: none; }
  @keyframes sheetIn { from { transform: translateX(30%); opacity: 0; } }
  body[data-ui=info] .hMid, body[data-ui=console] .hMid { margin-right: calc(min(410px, 42vw) + 30px); }
}
#info h2 { margin: 6px 0 8px; font-size: 24px; line-height: 1.2; }
#info .body { margin: 0 0 12px; font-size: 16px; line-height: 1.55; color: #dfe6f6; }
.fact { background: linear-gradient(90deg, rgba(240, 200, 104, 0.14), rgba(240, 200, 104, 0.04)); border: 1px solid rgba(240, 200, 104, 0.3); border-radius: 14px; padding: 10px 12px; font-size: 14px; color: #f0e2bc; }
.fact b { display: block; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold); margin-bottom: 2px; }
.pFoot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.codexNote { flex: 1; font-size: 13px; color: var(--good); }
.pFoot .btn { flex: none; min-width: 120px; }
/* the dock */
.dHead { display: flex; align-items: flex-start; gap: 10px; }
.dHead > div { flex: 1; display: flex; flex-direction: column; }
.dHead b { font-size: 21px; line-height: 1.25; }
.x { border: 0; background: rgba(255, 255, 255, 0.1); width: 34px; height: 34px; border-radius: 50%; color: var(--mute); font-size: 15px; flex: none; }
.dGoal { margin: 8px 0 12px; color: #dfe6f6; font-size: 15px; }
#dCtrls { display: flex; flex-direction: column; gap: 10px; }
.ctrl { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 14px; padding: 9px 11px; }
.cLab { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.ctrl.tog { display: flex; align-items: center; justify-content: space-between; }
.ctrl.tog .cLab { margin: 0; }
.ctrl .switch { width: auto; min-width: 84px; padding: 0 12px 0 36px; display: flex; align-items: center; justify-content: center; font-weight: 750; font-size: 14px; }
.ctrl .switch span { color: #0c1220; }
.ctrl .switch:not(.on) span { color: var(--ink); }
.ctrl .switch.on { background: var(--acc); padding: 0 36px 0 12px; }
.ctrl .switch.on i { transform: none; left: auto; right: 2px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 44px; height: 40px; border-radius: 11px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.08); font-size: 22px; font-weight: 600; line-height: 1; }
.stepper button:active:not(:disabled) { background: color-mix(in srgb, var(--acc) 30%, transparent); }
.stepper b { flex: 1; text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.06); border-radius: 11px; padding: 7px 12px; display: flex; flex-direction: column; align-items: flex-start; min-height: 40px; justify-content: center; }
.chips button b { font-size: 14px; font-weight: 650; }
.chips button span { font-size: 11px; color: var(--mute); }
.chips button.on { background: color-mix(in srgb, var(--acc) 26%, transparent); border-color: var(--acc); box-shadow: 0 0 12px color-mix(in srgb, var(--acc) 30%, transparent); }
.chips button.on span { color: #dfe6f6; }
.bitRow { display: flex; gap: 5px; }
.bitB { flex: 1; min-width: 0; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 6px 0 4px; display: flex; flex-direction: column; align-items: center; }
.bitB b { font: 800 19px var(--title); color: var(--faint); }
.bitB span { font-size: 10px; color: var(--mute); white-space: nowrap; }
.bitB.on { background: color-mix(in srgb, var(--acc) 24%, transparent); border-color: var(--acc); }
.bitB.on b { color: var(--acc); text-shadow: 0 0 10px var(--acc); }
.slots { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.slot { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line2); background: rgba(0, 0, 0, 0.2); border-radius: 11px; padding: 7px 10px; text-align: left; min-height: 40px; }
.slot i { font-style: normal; font: 800 12px var(--title); color: var(--faint); width: 16px; }
.slot span { flex: 1; color: var(--faint); font-size: 14px; }
.slot.full { border-style: solid; border-color: color-mix(in srgb, var(--acc) 50%, transparent); background: color-mix(in srgb, var(--acc) 12%, transparent); }
.slot.full span { color: var(--ink); font-weight: 600; }
.slot.full i { color: var(--acc); }
.slot em { font-style: normal; color: var(--mute); font-size: 13px; }
.slot:disabled { opacity: 1; }
.pools { display: flex; flex-wrap: wrap; gap: 6px; }
.pool { border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.07); border-radius: 10px; padding: 7px 11px; font-size: 13.5px; font-weight: 600; text-align: left; }
.ctrl.act { background: none; border: 0; padding: 0; }
.btn.act { width: 100%; border-color: var(--acc); background: color-mix(in srgb, var(--acc) 20%, transparent); }
#dTable table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
#dTable th { color: var(--mute); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 4px; text-align: center; }
#dTable td { padding: 5px 4px; text-align: center; border-top: 1px solid var(--line); }
#dTable tr.ok td:last-child { color: var(--good); font-weight: 800; }
#dTable tr.bad td { background: rgba(255, 95, 109, 0.1); }
#dTable tr.bad td:last-child { color: var(--bad); font-weight: 800; }
.dMsg { margin-top: 10px; border-radius: 13px; font-size: 14.5px; line-height: 1.45; }
.dMsg:empty { display: none; }
.dMsg.warn { padding: 10px 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line2); color: #e8ecf6; }
.dMsg.hint { padding: 10px 12px; background: rgba(138, 180, 255, 0.12); border: 1px solid rgba(138, 180, 255, 0.4); color: #d4e2ff; }
.dMsg.good { padding: 10px 12px; background: rgba(70, 227, 154, 0.14); border: 1px solid rgba(70, 227, 154, 0.5); color: #c8f8de; animation: pop 0.5s; }
@keyframes pop { 30% { transform: scale(1.03); } }
.dBtns { display: flex; gap: 10px; margin-top: 12px; }
.dBtns .btn.ghost { flex: none; }

/* --- toast */
#toast { position: fixed; left: 50%; top: calc(150px + var(--safe-t)); transform: translate(-50%, -10px); z-index: 60; background: rgba(10, 14, 26, 0.94); border: 1px solid rgba(240, 200, 104, 0.45); color: #fff4d8; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; max-width: calc(100% - 30px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* --- sheets: intro, check, results, pause */
.screen { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: calc(14px + var(--safe-t)) 14px calc(14px + var(--safe-b)); background: rgba(3, 5, 10, 0.45); }
.card { width: min(480px, 100%); max-height: 100%; overflow-y: auto; background: rgba(10, 14, 26, 0.9); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); border: 1px solid var(--line2); border-radius: 26px; padding: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); touch-action: pan-y; animation: cardIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
@keyframes cardIn { from { transform: scale(0.94) translateY(12px); opacity: 0; } }
.card h2 { margin: 6px 0 8px; font-size: 26px; line-height: 1.18; letter-spacing: -0.3px; }
.card h3 { margin: 18px 0 4px; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold); }
.card p { margin: 6px 0 10px; }
.intro .kick, .result .kick { color: var(--acc); }
.intro .sub { margin: 0 0 12px; color: #c8d4ee; font-size: 16px; }
.learn { display: flex; flex-direction: column; background: color-mix(in srgb, var(--acc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent); border-radius: 14px; padding: 9px 12px; margin-bottom: 12px; }
.learn b { font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--acc); }
.stepsList { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stepsList li { display: flex; gap: 12px; align-items: center; }
.stepsList i { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 13px var(--title); font-style: normal; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line2); }
.stepsList div { display: flex; flex-direction: column; }
.stepsList span { font-size: 13.5px; color: var(--mute); }
.lcStats { display: flex; flex-wrap: wrap; gap: 6px; }
.lcStats span { background: rgba(255, 255, 255, 0.07); border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 600; }
/* the check */
.qTop { display: flex; align-items: center; justify-content: space-between; }
.quiz .kick { color: var(--acc); }
.qDots { display: flex; gap: 5px; }
.qDots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.qDots i.cur { background: var(--acc); }
.qDots i.ok { background: var(--good); }
.qDots i.bad { background: var(--bad); }
.qNum { color: var(--mute); font-size: 13px; margin-top: 12px; }
.quiz h2 { font-size: 22px; }
.answers { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ans { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.06); border-radius: 15px; padding: 12px 14px; font-size: 15.5px; font-weight: 550; transition: transform 0.12s; }
.ans:active:not(:disabled) { transform: scale(0.98); }
.ans i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 800; background: rgba(255, 255, 255, 0.1); }
.ans.right { border-color: var(--good); background: rgba(70, 227, 154, 0.16); }
.ans.right i { background: var(--good); color: #062014; }
.ans.wrong { border-color: var(--bad); background: rgba(255, 95, 109, 0.16); }
.ans.wrong i { background: var(--bad); color: #2a0408; }
.ans.dim { opacity: 0.45; }
.ans:disabled { cursor: default; }
.why { margin-top: 12px; border-radius: 14px; padding: 10px 12px; font-size: 14.5px; }
.why.ok { background: rgba(70, 227, 154, 0.12); color: #c8f8de; }
.why.bad { background: rgba(255, 95, 109, 0.12); color: #ffd0d4; }
.review { display: flex; flex-direction: column; gap: 8px; }
.review div { background: rgba(255, 255, 255, 0.06); border-radius: 13px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.review span { color: #c8f8de; }
/* results */
.bigStars { font-size: 50px; letter-spacing: 8px; margin: 2px 0 8px; text-align: center; }
.bigStars i { font-style: normal; color: rgba(255, 255, 255, 0.16); display: inline-block; }
.bigStars i.on { color: var(--gold); text-shadow: 0 0 22px rgba(240, 200, 104, 0.8); animation: starIn 0.5s both; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); opacity: 0; } 70% { transform: scale(1.3); } }
.sLines { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sLine { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--mute); }
.sLine i { font-style: normal; color: rgba(255, 255, 255, 0.2); }
.sLine.on { color: var(--ink); }
.sLine.on i { color: var(--gold); }
.mxcLine { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 24px; }
.mxcLine > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.mxcLine .paid { color: var(--gold2); font-size: 18px; }
.mxc-coin { vertical-align: -3px; }

/* --- phones */
@media (max-width: 640px) {
  .hLevel { font-size: 12px; }
  .obj { font-size: 13px; padding: 6px 13px; }
  #toast { top: calc(132px + var(--safe-t)); }
  .card { padding: 18px; border-radius: 22px; }
  .card h2 { font-size: 23px; }
}
@media (min-width: 761px) {
  #menu { flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
  .mTop { width: 100%; }
  .mPages { flex: none; width: 480px; height: calc(100% - 140px - var(--safe-t) - var(--safe-b)); padding-left: calc(28px + var(--safe-l)); }
  #menu:not([data-tab=play]) .mPages { border-radius: 0 24px 24px 0; }
  .tabbar { position: absolute; left: calc(20px + var(--safe-l)); bottom: calc(16px + var(--safe-b)); width: 440px; border-radius: 22px; border: 1px solid var(--line2); padding: 6px 8px; }
  #pgPlay { padding-bottom: 20px; }
}
@media (max-width: 760px) {
  #menu[data-tab=play] .mPages { background: linear-gradient(180deg, rgba(5, 7, 13, 0) 30%, rgba(5, 7, 13, 0.8) 70%); }
}
@media (max-height: 520px) and (min-aspect-ratio: 5/4) {
  .logo .l1 { font-size: 34px; }
  .tagline { display: none; }
  #pgPlay { gap: 10px; }
}
