/* Interface styles. Colors are easier to change in config.js -> colors. */
/* ZOMBIE RUSH — arcade UI. Layout: portrait 9:16 column, full-bleed on phones.
   Layout: portrait 9:16 column, full-bleed on phones, centred column with key-art backdrop on desktop. */
:root {
  --acc-rgb: 141, 255, 74; --void-rgb: 10, 16, 11; --panel-rgb: 20, 31, 22;
  --void: #0a100b; --panel: #141f16; --panel-2: #1c2c1f; --line: rgba(var(--acc-rgb), 0.22);
  --cyan: #35e6ff; --ember: #ff5a2c; --blood: #ff2b3d; --gold: #ffc93c; --magenta: #ff2d7a; --acid: #8dff4a;
  --ink: #eef3ff; --mute: #a197c7;
  --display: "Russo One", "Arial Black", Impact, sans-serif;
  --body: "Chakra Petch", "Trebuchet MS", system-ui, 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);
  --keyart: url("../assets/keyart.jpg");
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--void); color: var(--ink); font-family: var(--body); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
svg { width: 1.1em; height: 1.1em; flex: none; }

#stage { position: fixed; inset: 0; display: flex; justify-content: center; background: var(--void); }
#stage::before { content: ""; position: absolute; inset: -40px; background: var(--keyart) center/cover; filter: blur(28px) brightness(0.35) saturate(1.2); }
#wrap { position: relative; height: 100%; width: min(100%, calc(100vh * 0.62)); width: min(100%, calc(100dvh * 0.62)); overflow: hidden; background: var(--void); box-shadow: 0 0 80px rgba(0,0,0,0.8); }
#game { position: absolute; inset: 0; display: block; touch-action: none; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#pauseBtn { pointer-events: auto; position: absolute; top: calc(var(--sat) + 38px); right: calc(var(--sar) + 12px); width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(10, 6, 24, 0.6); border: 1px solid var(--line); color: var(--ink); }
#pauseBtn svg { width: 20px; height: 20px; }

/* ---------- overlay root ---------- */
.ui { position: absolute; inset: 0; display: none; z-index: 5; }
.ui.show { display: block; }
.ui.overlay { background: rgba(var(--void-rgb), 0.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); overflow-y: auto; animation: fade .2s ease; }
.ui.full { background: var(--void); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.96); } }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.muted { color: var(--mute); font-size: 14px; line-height: 1.45; margin: 0; }
.center-t { text-align: center; }
.tiny { font-size: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px;
  font-family: var(--display); font-size: 15px; letter-spacing: 0.04em; background: var(--panel-2); border: 1px solid var(--line); transition: transform .08s, filter .15s; }
.btn:active { transform: scale(0.96); }
.btn.primary { background: linear-gradient(180deg, #ff7a3c, #e2321f); border-color: #ff9a6a; color: #fff; box-shadow: 0 6px 22px rgba(255, 90, 44, 0.35), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn.ghost { background: rgba(255, 255, 255, 0.04); }
.btn.danger { background: rgba(255, 43, 61, 0.12); border-color: rgba(255, 43, 61, 0.5); color: #ff8a96; }
.btn.ad { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border-color: var(--cyan); color: var(--cyan); }
.btn.ad small, .btn small { font-family: var(--body); font-size: 11px; opacity: 0.8; letter-spacing: 0; }
.btn.big { min-height: 60px; font-size: 20px; width: 100%; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.locked { opacity: 0.55; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(10, 6, 24, 0.55); border: 1px solid var(--line); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 9px; font-family: var(--display); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 4px; white-space: nowrap; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.row-gap { display: flex; gap: 10px; }

.pills { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px 0 7px; border-radius: 16px; background: rgba(10, 6, 24, 0.7); border: 1px solid rgba(255, 201, 60, 0.35); font-family: var(--display); font-size: 13px; font-variant-numeric: tabular-nums; }
.pill.gem { border-color: rgba(255, 45, 122, 0.4); }
.pill svg { width: 18px; height: 18px; }

/* ---------- splash + menu ---------- */
.keyart { position: absolute; inset: 0; background: var(--void) var(--keyart) center top/100% auto no-repeat; }
.splash, .menu { position: absolute; inset: 0; overflow: hidden; }
.splash-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(var(--void-rgb),0.95) 88%); }
.splash-foot { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 48px); display: grid; justify-items: center; gap: 12px; padding: 0 24px; }
.btn.tap { font-size: 22px; min-height: 64px; padding: 0 40px; background: rgba(var(--void-rgb), 0.75); border: 2px solid var(--cyan); color: var(--cyan); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 32px rgba(var(--acc-rgb), 0.55); transform: scale(1.03); } }
.splash-foot .tiny { color: var(--mute); margin: 0; }

.menu .keyart { animation: drift 24s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.08) translateY(-12px); } }
.menu-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--void-rgb),0.55) 0%, transparent 18%, transparent 36%, rgba(var(--void-rgb),0.88) 62%, var(--void) 84%); }
.menu-top { position: absolute; top: calc(var(--sat) + 12px); left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; }
.menu-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 16px calc(var(--sab) + 18px); display: grid; gap: 12px; animation: rise .35s ease; }
.bests { display: flex; justify-content: center; gap: 18px; font-family: var(--display); font-size: 14px; color: var(--gold); }
.bests span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.bests.intro { font-family: var(--body); font-weight: 600; color: var(--ink); text-align: center; font-size: 15px; text-wrap: balance; }
.loadout { display: flex; align-items: center; gap: 10px; justify-content: center; min-height: 40px; padding: 0 14px; border-radius: 12px; background: rgba(var(--panel-rgb), 0.85); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.loadout span { display: inline-flex; align-items: center; gap: 6px; }
.loadout .sep { width: 4px; height: 4px; border-radius: 2px; background: var(--mute); }
.loadout .chg { font-family: var(--display); font-size: 11px; color: var(--cyan); margin-left: 4px; }
.btn-play { position: relative; height: 76px; border-radius: 18px; font-family: var(--display); font-size: 34px; letter-spacing: 0.08em; color: #fff;
  background: linear-gradient(180deg, #ff8a3c 0%, #ff3b1f 55%, #c41a2a 100%); border: 2px solid #ffb38a;
  box-shadow: 0 10px 40px rgba(255, 74, 30, 0.5), inset 0 2px 0 rgba(255,255,255,0.4); text-shadow: 0 3px 0 rgba(120, 10, 10, 0.6); overflow: hidden; }
.btn-play::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent); transform: skewX(-20deg); animation: shine 2.8s ease-in-out infinite; }
@keyframes shine { 60%, 100% { left: 130%; } }
.btn-play:active { transform: scale(0.97); }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-grid button { position: relative; display: grid; justify-items: center; gap: 4px; padding: 11px 4px 9px; border-radius: 14px; background: rgba(var(--panel-rgb), 0.88); border: 1px solid var(--line); font-weight: 700; font-size: 13px; letter-spacing: 0.02em; }
.menu-grid button svg { width: 24px; height: 24px; color: var(--cyan); }
.menu-grid button:active { transform: scale(0.95); }
.badge { position: absolute; top: -6px; right: 6px; font-style: normal; font-family: var(--display); font-size: 10px; padding: 2px 6px; border-radius: 6px; background: var(--magenta); }

/* ---------- generic screens ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: radial-gradient(120% 60% at 50% 0%, var(--panel-2) 0%, var(--void) 60%); }
.bar { display: flex; align-items: center; gap: 10px; padding: calc(var(--sat) + 10px) 14px 10px; border-bottom: 1px solid rgba(var(--acc-rgb), 0.1); }
.bar h2 { flex: 1; margin: 0; font-family: var(--display); font-size: 20px; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .pill { height: 28px; font-size: 12px; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(var(--sab) + 24px); display: grid; align-content: start; gap: 12px; }
.sec { margin: 8px 0 0; font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: 0.12em; color: var(--cyan); text-transform: uppercase; }
.list { display: grid; gap: 10px; }
.tabs { display: flex; gap: 6px; padding: 10px 16px 0; overflow-x: auto; }
.tab { flex: none; height: 38px; padding: 0 14px; border-radius: 10px; font-weight: 700; font-size: 14px; background: rgba(255,255,255,0.04); border: 1px solid transparent; color: var(--mute); }
.tab.on { color: var(--ink); border-color: var(--cyan); background: rgba(var(--acc-rgb), 0.1); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 11px; color: var(--mute); }
.tag.on { color: var(--acid); }
.chip { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: rgba(var(--acc-rgb),0.1); border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

/* ---------- panels (overlays) ---------- */
.panel { margin: calc(var(--sat) + 40px) auto 30px; width: min(92%, 380px); padding: 24px 18px; border-radius: 22px; background: rgba(var(--panel-rgb), 0.94); border: 1px solid var(--line); display: grid; gap: 12px; animation: rise .3s ease; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.panel.center { text-align: center; justify-items: stretch; margin-top: max(calc(var(--sat) + 40px), 18vh); }
.panel h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: 0.03em; text-align: center; text-wrap: balance; }
.red { color: var(--blood); text-shadow: 0 0 24px rgba(255, 43, 61, 0.5); }
.gold { color: var(--gold); text-shadow: 0 0 24px rgba(255, 201, 60, 0.5); }
.new-best { margin: 2px 0 0; color: #ffc93c; font-family: var(--display); font-size: 15px; letter-spacing: 1px; }
.big-time { margin: 0; font-family: var(--display); font-size: 54px; font-variant-numeric: tabular-nums; }
.unlock { font-family: var(--display); color: var(--ember); letter-spacing: 0.08em; padding: 10px; border-radius: 12px; border: 1px dashed rgba(255, 90, 44, 0.6); animation: pop .5s ease .2s both; }
.win { position: relative; overflow: hidden; }
.win h1 { animation: pop .5s ease both; font-size: 38px; }
.stats { display: grid; gap: 2px; }
.stat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 15px; }
.stat span { color: var(--mute); font-weight: 600; }
.stat b { font-family: var(--display); font-weight: 400; font-size: 17px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 8px; }
.new { font-style: normal; font-size: 10px; padding: 2px 6px; border-radius: 6px; background: var(--magenta); color: #fff; animation: pop .4s ease both; }
.reward { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px; font-family: var(--display); }
.reward svg { width: 30px; height: 30px; }
.reward b { font-size: 34px; color: var(--gold); font-weight: 400; }
.reward span { color: var(--mute); font-family: var(--body); font-weight: 600; }
.ach-list h4 { margin: 4px 0 6px; font-family: var(--display); font-weight: 400; font-size: 13px; color: var(--cyan); letter-spacing: 0.08em; text-transform: uppercase; }
.ach-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255, 201, 60, 0.08); border: 1px solid rgba(255, 201, 60, 0.3); margin-bottom: 6px; animation: rise .4s ease both; }
.ach-row svg { color: var(--gold); width: 22px; height: 22px; }
.ach-row span { display: grid; } .ach-row small { color: var(--mute); }

/* ---------- level up ---------- */
.lvl { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--sat) + 20px) 16px calc(var(--sab) + 20px); gap: 16px; }
.lvl-head { text-align: center; }
.lvl-head h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 44px; color: var(--cyan); text-shadow: 0 0 30px rgba(var(--acc-rgb), 0.7), 0 4px 0 rgba(0,0,0,0.5); animation: pop .45s ease both; }
.lvl-head p { margin: 4px 0 0; color: var(--mute); font-weight: 600; }
.cards { display: grid; gap: 12px; }
.card { display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px; min-height: 96px; border-radius: 18px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 2px solid rgba(var(--acc-rgb), 0.35); animation: rise .35s ease both; animation-delay: var(--d); transition: transform .1s, border-color .15s; }
.card:active { transform: scale(0.97); border-color: var(--cyan); }
.card[disabled] { opacity: 1; pointer-events: none; }
.card.r-rare { border-color: rgba(255, 45, 122, 0.6); box-shadow: 0 0 24px rgba(255, 45, 122, 0.2); }
.card.r-epic { border-color: rgba(255, 201, 60, 0.75); box-shadow: 0 0 30px rgba(255, 201, 60, 0.28); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.card-ico { flex: none; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: rgba(var(--acc-rgb), 0.12); color: var(--cyan); }
.card-ico svg { width: 30px; height: 30px; }
.t-power .card-ico, .t-special .card-ico { background: rgba(255, 90, 44, 0.15); color: var(--ember); }
.t-defense .card-ico { background: rgba(141, 255, 74, 0.12); color: var(--acid); }
.t-crit .card-ico, .t-multi .card-ico { background: rgba(255, 45, 122, 0.14); color: var(--magenta); }
.t-utility .card-ico { background: rgba(255, 201, 60, 0.14); color: var(--gold); }
.card-body { display: grid; gap: 4px; min-width: 0; flex: 1; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card-top b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.card-top em { font-style: normal; font-family: var(--display); font-size: 10px; letter-spacing: 0.1em; color: var(--magenta); }
.r-epic .card-top em { color: var(--gold); }
.card-desc { font-size: 15px; font-weight: 600; color: #d6d0f0; }
.pips { display: flex; gap: 3px; margin-top: 2px; }
.pips i { width: 14px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); }
.pips i.on { background: var(--cyan); } .pips i.new { background: var(--gold); animation: blink 0.8s infinite; }
.pips.big i { width: 22px; height: 6px; }
@keyframes blink { 50% { opacity: 0.3; } }
.syns { display: flex; gap: 6px; flex-wrap: wrap; }
.syn { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(255, 45, 122, 0.15); color: #ff8ab6; border: 1px solid rgba(255, 45, 122, 0.35); }

/* ---------- daily ---------- */
.daily-card { display: grid; gap: 8px; padding: 20px 18px; border-radius: 20px; background: linear-gradient(160deg, var(--panel-2), var(--panel) 70%); border: 1px solid rgba(255, 90, 44, 0.45); }
.eyebrow { font-family: var(--display); font-size: 11px; letter-spacing: 0.14em; color: var(--ember); }
.daily-card h1 { margin: 4px 0 0; font-family: var(--display); font-weight: 400; font-size: 32px; text-wrap: balance; }
.daily-card p { margin: 0 0 6px; color: #d6d0f0; font-size: 16px; }

/* ---------- achievements / perm upgrades / weapons ---------- */
.ach, .perm, .weapon, .bundle, .set { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(var(--panel-rgb), 0.9); border: 1px solid rgba(var(--acc-rgb), 0.12); }
.ach-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,0.05); color: var(--mute); }
.ach.done { border-color: rgba(141, 255, 74, 0.35); } .ach.done .ach-ico { color: var(--acid); background: rgba(141, 255, 74, 0.12); }
.ach-txt { flex: 1; display: grid; gap: 2px; min-width: 0; } .ach-txt small, .perm small, .weapon p, .bundle small { color: var(--mute); font-size: 13px; }
.ach-rw { display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 13px; color: var(--gold); }
.perm-txt { flex: 1; display: grid; gap: 4px; min-width: 0; }
.perm .btn.buy { min-width: 96px; }
.weapon { flex-direction: column; align-items: stretch; gap: 8px; }
.weapon.eq { border-color: var(--cyan); background: linear-gradient(180deg, rgba(var(--acc-rgb),0.08), rgba(var(--panel-rgb),0.9)); }
.weapon.lockd b { color: var(--mute); }
.w-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.w-head b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.weapon p { margin: 0; }
.sbars { display: flex; gap: 14px; flex-wrap: wrap; }
.sbar { display: inline-flex; align-items: center; gap: 6px; }
.sbar em { font-style: normal; font-family: var(--display); font-size: 10px; color: var(--mute); letter-spacing: 0.08em; }
.sbar span { display: flex; gap: 2px; } .sbar i { width: 10px; height: 6px; border-radius: 2px; background: rgba(255,255,255,0.1); } .sbar i.on { background: var(--ember); }
.char-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: rgba(var(--acc-rgb), 0.06); border: 1px solid var(--line); text-align: left; }
.char-row img { width: 56px; height: 56px; }
.char-row span { flex: 1; display: grid; } .char-row small { color: var(--mute); } .char-row b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.char-row em { font-style: normal; color: var(--cyan); font-weight: 700; }

/* ---------- skins grid / shop ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.skin { display: grid; justify-items: center; gap: 6px; padding: 10px 8px 12px; border-radius: 16px; background: rgba(var(--panel-rgb), 0.9); border: 1px solid rgba(var(--acc-rgb), 0.12); text-align: center; }
.skin.eq { border-color: var(--cyan); }
.skin b { font-size: 14px; }
.skin .btn { width: 100%; }
.unlock-note { font-size: 11px; color: var(--mute); }
.prev { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 14px; background: radial-gradient(circle, var(--panel-2), var(--void)); }
.prev img { width: 72px; height: 72px; }
.bullet-prev { display: grid; gap: 6px; }
.bullet-prev i { display: block; width: 34px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--t), var(--b) 70%, var(--c)); box-shadow: 0 0 10px var(--b); }
.bullet-prev i:nth-child(2) { margin-left: 10px; }
.fx-prev { display: flex; flex-wrap: wrap; width: 46px; gap: 5px; justify-content: center; }
.fx-prev i { width: 10px; height: 10px; border-radius: 2px; transform: rotate(20deg); box-shadow: 0 0 8px currentColor; }
.feature { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, var(--panel-2), var(--panel)); border: 1px solid rgba(255, 45, 122, 0.5); }
.feature img { width: 84px; height: 84px; }
.feature > div { display: grid; gap: 4px; justify-items: start; } .feature b { font-family: var(--display); font-weight: 400; font-size: 20px; } .feature small { color: var(--mute); }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.pack { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border-radius: 16px; background: rgba(var(--panel-rgb), 0.9); border: 1px solid rgba(255, 45, 122, 0.25); }
.pack > svg { width: 30px; height: 30px; }
.pack b { font-size: 14px; }
.price { display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 14px; padding: 6px 10px; border-radius: 10px; background: linear-gradient(180deg, #ff7a3c, #e2321f); color: #fff; }
.bundle > div { flex: 1; display: grid; gap: 4px; min-width: 0; } .bundle b { font-family: var(--display); font-weight: 400; font-size: 17px; }

/* ---------- records ---------- */
.recs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rec { display: grid; gap: 2px; padding: 14px; border-radius: 16px; background: rgba(var(--panel-rgb), 0.9); border: 1px solid rgba(var(--acc-rgb), 0.12); }
.rec svg { color: var(--cyan); width: 20px; height: 20px; }
.rec small { color: var(--mute); font-weight: 600; }
.rec b { font-family: var(--display); font-weight: 400; font-size: 22px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid rgba(var(--acc-rgb), 0.12); }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); white-space: nowrap; }
th { font-family: var(--display); font-weight: 400; font-size: 11px; color: var(--mute); letter-spacing: 0.08em; }

/* ---------- settings ---------- */
.set { justify-content: space-between; font-weight: 600; }
.set.col { flex-direction: column; align-items: stretch; gap: 10px; }
input[type=range] { width: 100%; accent-color: var(--cyan); height: 28px; }
.switch { width: 52px; height: 30px; border-radius: 15px; background: rgba(255,255,255,0.12); position: relative; flex: none; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; transition: transform .15s; }
.switch.on { background: var(--cyan); } .switch.on i { transform: translateX(22px); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,0.3); }
.seg button { min-height: 38px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--mute); }
.seg button.on { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--cyan); }

/* ---------- sheets, toasts, simulated ads ---------- */
.sheet-back { position: absolute; inset: 0; z-index: 20; background: rgba(var(--void-rgb), 0.7); display: flex; align-items: flex-end; animation: fade .15s ease; }
.sheet { width: 100%; padding: 22px 18px calc(var(--sab) + 22px); border-radius: 22px 22px 0 0; background: var(--panel); border-top: 1px solid var(--line); display: grid; gap: 12px; animation: rise .2s ease; }
.sheet h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; }
.sheet p { margin: 0; color: #d6d0f0; line-height: 1.45; }
.sheet .note { font-size: 13px; color: var(--gold); }
.toast { position: absolute; left: 50%; top: calc(var(--sat) + 70px); transform: translateX(-50%); z-index: 30; padding: 10px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; white-space: nowrap; animation: rise .2s ease; transition: opacity .4s; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.toast.good { border-color: var(--acid); color: var(--acid); } .toast.bad { border-color: var(--blood); color: #ff8a96; }
.toast.out { opacity: 0; }
.ad-sim { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(2, 1, 6, 0.94); }
.ad-box { width: min(86%, 340px); padding: 26px 20px; border-radius: 20px; text-align: center; background: #13131c; border: 1px dashed #555; display: grid; gap: 8px; color: #ddd; font-family: var(--body); }
.ad-tag { font-family: var(--display); font-size: 11px; letter-spacing: 0.14em; color: var(--gold); }
.ad-title { font-family: var(--display); font-size: 24px; }
.ad-box p { margin: 0; font-size: 13px; color: #999; } .ad-box code { color: var(--cyan); }
.ad-count { font-family: var(--display); font-size: 40px; color: var(--cyan); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (max-height: 620px) { .bests.intro { display: none; } .menu-bottom { gap: 8px; } }

/* ---------- online leaderboard ---------- */
.world { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: rgba(var(--acc-rgb),0.07); border: 1px solid var(--line); }
.world h4 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 13px; color: var(--cyan); letter-spacing: 0.08em; text-transform: uppercase; }
.world .ranks { display: flex; gap: 8px; justify-content: space-between; }
.world .ranks span { flex: 1; display: grid; text-align: center; padding: 6px 4px; border-radius: 10px; background: rgba(10,6,24,0.5); }
.world .ranks b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--gold); font-variant-numeric: tabular-nums; }
.world .ranks small { color: var(--mute); font-size: 11px; font-weight: 600; }
.world .muted { font-size: 13px; }
.nick { display: flex; gap: 8px; }
.nick input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(10,6,24,0.7); color: var(--ink); padding: 0 12px; font: 600 16px var(--body); }
.nick .btn { min-height: 44px; }
.nick-err { color: #ff8a96; font-size: 13px; margin: 0; }
.btn.share { background: rgba(255,201,60,0.1); border-color: rgba(255,201,60,0.5); color: var(--gold); }
.lb-row.me td { color: var(--gold); }

