/* Velocity Goal Clash · championship blue */
:root {
  --navy-950: #020817;
  --navy-900: #030b24;
  --navy-800: #061436;
  --navy-700: #0a2463;
  --navy-600: #123a8f;
  --blue-600: #1e5eff;
  --blue-500: #2f80ff;
  --blue-400: #5b9dff;
  --sky-300: #7cc4ff;
  --sky-100: #d9ecff;
  --cyan: #22d3ee;
  --cyan-soft: #9ff3ff;
  --gold: #ffd84d;
  --red: #ff6b81;
  --green: #3ddc97;
  --text: #eef5ff;
  --text-dim: #a9c1ea;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(124, 196, 255, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --fs: 15px;
  color-scheme: dark;
}
html.large-text { --fs: 17.5px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: radial-gradient(130% 70% at 50% -10%, #1e5eff 0%, #0a2463 42%, #030b24 100%) fixed, var(--navy-900);
  color: var(--text);
  font: 400 var(--fs)/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 12px; }
svg.ic { flex: none; display: block; }
svg:not([width]):not([height]):not(.art) { width: 24px; height: 24px; flex: none; }
.noscript { padding: 24px; text-align: center; }
[hidden] { display: none !important; }

/* ─── screens ─────────────────────────────────────────────────────────────── */
#app { position: fixed; inset: 0; overflow: hidden; }
.scr {
  position: absolute; inset: 0;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 4px) 0 calc(var(--safe-bottom) + 24px);
  transition: transform .22s ease, opacity .22s ease;
}
.scr.enter-forward { transform: translateX(24px); opacity: 0; }
.scr.enter-backward { transform: translateX(-24px); opacity: 0; }
.scr.enter-fade { opacity: 0; }
.scr.leaving { opacity: 0; pointer-events: none; }
html.reduce-motion .scr { transition: none; }

.content { width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 16px 16px; }
.content.center { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100% - 8px); gap: 6px; }
.muted { color: var(--text-dim); }
.small { font-size: .86em; }
.center { text-align: center; }
h3.section { font-size: .78em; letter-spacing: .12em; text-transform: uppercase; color: var(--sky-300); margin: 22px 4px 10px; }

/* ─── top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto; padding: 8px 12px;
  background: linear-gradient(180deg, rgba(3, 11, 36, .92), rgba(3, 11, 36, .7));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tb-title { flex: 1; font-size: 1.15em; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-spacer { width: 44px; flex: none; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .1s ease, background .15s ease;
}
.icon-btn:active { transform: scale(.94); background: var(--panel-strong); }
.icon-btn.small { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.glass { background: rgba(3, 11, 36, .45); border-color: rgba(255, 255, 255, .25); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 7px 12px 7px 9px; border-radius: 999px; background: rgba(255, 216, 77, .12);
  border: 1px solid rgba(255, 216, 77, .35); color: #ffe89a; font-weight: 800; min-width: 44px;
}

/* ─── buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 14px;
  background: var(--panel-strong); border: 1px solid var(--line); font-weight: 700;
  transition: transform .1s ease, filter .15s ease;
  text-align: center;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #ffffff, #dcebff); color: var(--navy-700); border-color: #fff; box-shadow: 0 8px 22px rgba(47, 128, 255, .35); }
.btn.primary .ic { color: var(--blue-600); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--sky-100); }
.btn.danger { background: linear-gradient(180deg, #ff8095, #e5485f); border-color: #ff8095; color: #fff; }
.btn.big { min-height: 56px; font-size: 1.08em; width: 100%; }
.btn.small { min-height: 38px; padding: 8px 14px; border-radius: 11px; font-size: .9em; }
.btn.dim { filter: saturate(.3) brightness(.8); }
.btn-col { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 14px; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row .btn { flex: 1; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(180deg, rgba(3, 11, 36, 0), rgba(3, 11, 36, .85) 30%); }
.link { color: var(--sky-300); font-weight: 700; padding: 10px 12px; min-height: 44px; }

/* ─── lists, rows, toggles ────────────────────────────────────────────────── */
.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list + .btn, .list + .tip { margin-top: 14px; }
.list.tight { margin: 14px 0 6px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 14px; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: rgba(255, 255, 255, .05); }
.row-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(47, 128, 255, .2); color: var(--sky-300); flex: none; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-text small { color: var(--text-dim); font-size: .84em; }
.row-chev { color: var(--text-dim); }
.danger-row .row-ic { background: rgba(255, 107, 129, .18); color: var(--red); }
.switch { width: 50px; height: 30px; border-radius: 15px; background: rgba(255, 255, 255, .18); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch.on { background: var(--blue-500); }
.switch.on i { transform: translateX(20px); }
.slider-row input { flex: 1.3; min-width: 0; accent-color: var(--blue-500); height: 28px; }
.slider-row output { width: 36px; text-align: right; font-weight: 700; color: var(--sky-300); }
.label-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgba(47, 128, 255, .2); border: 1px solid var(--line); font-size: .82em; font-weight: 700; color: var(--sky-100); white-space: nowrap; }
.label-pill.glass { background: rgba(3, 11, 36, .5); }
.label-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .82em; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.tag.on { color: var(--green); }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; width: 100%; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue-500), var(--cyan)); }
.tip, .note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .3); color: var(--sky-100); margin: 14px 0; }
.tip p { margin: 0; }
.tip .ic, .note .ic { color: var(--cyan); margin-top: 1px; }

/* ─── stars ───────────────────────────────────────────────────────────────── */
.stars { display: inline-flex; gap: 3px; }
.stars .star { display: block; }

/* ─── modal / overlay ─────────────────────────────────────────────────────── */
#overlay-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#overlay-root.has-overlay { pointer-events: auto; }
.modal { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(2, 8, 23, 0); transition: background .2s ease; padding: 16px 12px calc(var(--safe-bottom) + 12px); }
.modal.is-open { background: rgba(2, 8, 23, .72); }
.sheet {
  width: 100%; max-width: 460px; max-height: calc(100% - var(--safe-top) - 12px); overflow-y: auto;
  background: linear-gradient(180deg, #102a6e, #0a1d52); border: 1px solid var(--line); border-radius: 24px;
  padding: 22px 18px 18px; text-align: center; box-shadow: 0 -10px 40px rgba(0, 0, 0, .45);
  transform: translateY(24px); opacity: 0; transition: transform .22s ease, opacity .22s ease;
}
.modal.is-open .sheet { transform: none; opacity: 1; }
html.reduce-motion .sheet, html.reduce-motion .modal { transition: none; }
.sheet h2 { font-size: 1.35em; margin-bottom: 6px; }
.sheet .list { text-align: left; }
.sheet.offline .art { width: 100%; height: auto; border-radius: 16px; margin-bottom: 12px; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 16px; }
.guide-grid figure { margin: 0; }
.guide-grid .art { width: 100%; height: auto; display: block; }
.guide-grid figcaption { font-size: .8em; color: var(--text-dim); margin-top: 4px; text-align: left; }
@media (max-width: 360px) { .guide-grid { grid-template-columns: 1fr; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 24px); z-index: 80; transform: translate(-50%, 20px);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: #fff; color: var(--navy-700);
  font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: #fff3c4; }
.toast.ok { background: #d8fbe9; color: #064e3b; }

/* ─── splash & onboarding ─────────────────────────────────────────────────── */
.splash { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.splash-rays { position: absolute; inset: 0; overflow: hidden; }
.splash-rays i { position: absolute; top: -10%; width: 55%; height: 130%; background: linear-gradient(180deg, rgba(159, 243, 255, .22), rgba(159, 243, 255, 0) 75%); transform-origin: top center; }
.splash-rays i:first-child { left: -8%; transform: rotate(-18deg); }
.splash-rays i:last-child { right: -8%; transform: rotate(18deg); }
.splash-brand { position: relative; padding: 0 24px; }
.logo-mark { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; display: grid; place-items: center; background: linear-gradient(145deg, #ffffff, #cfe4ff); color: var(--blue-600); box-shadow: 0 12px 36px rgba(47, 128, 255, .55); }
.splash h1 { font-size: 2.6em; font-weight: 900; letter-spacing: -.02em; text-shadow: 0 6px 24px rgba(0, 0, 0, .4); }
.splash h1 span { color: var(--cyan-soft); }
.splash p { color: var(--sky-100); margin-top: 8px; font-weight: 600; }
.splash-load { position: absolute; bottom: calc(var(--safe-bottom) + 48px); width: 160px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.splash-load i { display: block; height: 100%; width: 40%; border-radius: 3px; background: var(--cyan); animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

.onb { max-width: 460px; margin: 0 auto; padding: 8px 20px 20px; min-height: 100%; display: flex; flex-direction: column; text-align: center; }
.onb-top { display: flex; justify-content: flex-end; }
.onb-art { margin: auto 0 22px; }
.onb-art .art { width: 100%; height: auto; display: block; filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .35)); }
.onb h2 { font-size: 1.7em; font-weight: 900; }
.onb-text { color: var(--sky-100); margin: 10px 0 20px; min-height: 4.4em; }
.dots { display: flex; justify-content: center; gap: 8px; margin: auto 0 18px; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .25); transition: width .2s, background .2s; }
.dots i.on { width: 26px; background: var(--cyan); }

/* ─── profile ─────────────────────────────────────────────────────────────── */
.profile-card { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(47, 128, 255, .35), rgba(34, 211, 238, .12)); border: 1px solid var(--line); margin-bottom: 8px; }
.pc-avatar { flex: none; }
.pc-avatar .art { display: block; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
.pc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pc-name { display: flex; align-items: center; gap: 8px; width: 100%; }
.pc-name b { font-size: 1.2em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-level { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.pc-level small { color: var(--text-dim); font-size: .8em; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avatar-opt { aspect-ratio: 1; border-radius: 18px; display: grid; place-items: center; background: var(--panel); border: 2px solid transparent; }
.avatar-opt.on { border-color: var(--cyan); background: rgba(34, 211, 238, .12); }
.avatar-opt .art { max-width: 100%; height: auto; }
.title-list { display: flex; flex-wrap: wrap; gap: 8px; }
.title-opt { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: .9em; min-height: 40px; }
.title-opt.on { background: var(--blue-500); border-color: var(--sky-300); }
.title-opt[disabled] { opacity: .5; cursor: default; }
.title-opt small { color: var(--text-dim); font-weight: 600; }

/* ─── home ────────────────────────────────────────────────────────────────── */
.home-top { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto; padding: 8px 16px; }
.me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; min-height: 48px; }
.me .art { flex: none; }
.me-text { min-width: 0; display: flex; flex-direction: column; }
.me-text b, .me-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--text-dim); font-size: .8em; }
.hero-card { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 360 / 220; box-shadow: 0 14px 34px rgba(0, 0, 0, .4); border: 1px solid var(--line); }
.hero-card .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-over { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: linear-gradient(180deg, rgba(3, 11, 36, 0), rgba(3, 11, 36, .85) 55%); }
.hero-over h2 { font-size: 1.45em; font-weight: 900; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.hero-over .btn { margin-top: 4px; width: auto; min-width: 150px; padding: 0 28px; }
.hero-mover { animation: heroMove 2.6s ease-in-out infinite alternate; }
@keyframes heroMove { from { transform: translateX(-70px); } to { transform: translateX(20px); } }
html.reduce-motion .hero-mover { animation: none; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.mode-card { position: relative; border-radius: 18px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); text-align: left; display: flex; flex-direction: column; transition: transform .1s; }
.mode-card:active { transform: scale(.97); }
.mode-card .art { width: 100%; height: auto; aspect-ratio: 160 / 110; display: block; }
.mc-text { padding: 10px 12px 12px; display: flex; flex-direction: column; min-width: 0; }
.mc-text b { font-size: 1em; }
.mc-text small { color: var(--text-dim); font-size: .8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot-badge { position: absolute; top: 10px; right: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(255, 216, 77, .3); }
.shortcut-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.shortcut { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: .86em; color: var(--sky-100); }
.shortcut .ic { color: var(--sky-300); }
.shortcut:active { background: var(--panel-strong); }
.badge { position: absolute; top: 8px; right: 10px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: var(--navy-800); font-style: normal; font-size: .78em; font-weight: 900; display: grid; place-items: center; }

/* ─── campaign ────────────────────────────────────────────────────────────── */
.chapter-list { display: flex; flex-direction: column; gap: 14px; }
.chapter-card { position: relative; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); text-align: left; transition: transform .1s; }
.chapter-card:active { transform: scale(.985); }
.cc-art { position: relative; aspect-ratio: 360 / 130; overflow: hidden; }
.cc-art .art { width: 100%; height: 100%; display: block; }
.cc-lock { position: absolute; inset: 0; display: grid; place-items: center; color: #dbe7ff; }
.cc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.cc-body small { color: var(--sky-300); font-weight: 800; font-size: .76em; letter-spacing: .1em; text-transform: uppercase; }
.cc-body b { font-size: 1.15em; }
.cc-tag { color: var(--text-dim); font-size: .88em; }
.cc-prog { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cc-prog span { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: .85em; color: var(--gold); white-space: nowrap; }
.cc-done { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #053b2a; display: grid; place-items: center; }
.chapter-card.locked { opacity: .8; }
.chapter-hero { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 2 / 1; margin-bottom: 14px; border: 1px solid var(--line); }
.chapter-hero .art { display: block; width: 100%; height: 100%; }
.ch-over { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; background: linear-gradient(180deg, transparent, rgba(3, 11, 36, .85)); }
.ch-over small { color: var(--sky-300); font-weight: 800; font-size: .76em; letter-spacing: .1em; text-transform: uppercase; }
.ch-over h2 { font-size: 1.5em; font-weight: 900; }
.stat-row { display: flex; gap: 10px; width: 100%; margin: 12px 0; }
.stat { flex: 1; min-width: 0; padding: 12px 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; }
.stat b { font-size: 1.3em; font-weight: 900; }
.stat small { color: var(--text-dim); font-size: .74em; }
.trophy-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 16px; }
.trophy-row div { display: flex; flex-direction: column; }
.trophy-row small { color: var(--text-dim); }
.trophy-row .art { flex: none; }
.level-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.level-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); min-height: 128px; justify-content: center; text-align: center; transition: transform .1s; }
.level-tile:active { transform: scale(.97); }
.lt-num { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3em; font-weight: 900; background: linear-gradient(145deg, var(--blue-500), var(--blue-600)); box-shadow: 0 6px 16px rgba(30, 94, 255, .4); }
.level-tile.cleared .lt-num { background: linear-gradient(145deg, #ffffff, #cfe4ff); color: var(--navy-700); }
.level-tile.locked { opacity: .55; }
.level-tile.locked .lt-num { background: rgba(255, 255, 255, .1); box-shadow: none; }
.lt-name { font-weight: 700; font-size: .92em; }
.lt-lock { font-size: .8em; color: var(--text-dim); }

.brief-card { text-align: center; padding: 20px 16px; border-radius: 22px; background: linear-gradient(180deg, rgba(47, 128, 255, .3), rgba(255, 255, 255, .05)); border: 1px solid var(--line); }
.brief-card > small { color: var(--sky-300); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: .76em; }
.brief-card h2 { font-size: 1.7em; font-weight: 900; margin: 4px 0 8px; }
.goal-list, .rule-list { list-style: none; padding: 0; margin: 14px 0 4px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.goal-list li, .rule-list li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(3, 11, 36, .35); }
.goal-list .ic { color: var(--gold); }
.rule-list .ic { color: var(--cyan); }

/* ─── modes ───────────────────────────────────────────────────────────────── */
.mode-hero { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.mode-hero .art { width: 100%; height: auto; display: block; }
.daily-card { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); margin-bottom: 12px; }
.daily-card .art { width: 100%; height: auto; display: block; aspect-ratio: 160 / 80; }
.daily-body { padding: 12px 14px 14px; text-align: center; }
.daily-body small { color: var(--sky-300); font-weight: 700; }
.daily-body h2 { font-size: 1.5em; font-weight: 900; margin-top: 2px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 6px 0; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wk small { color: var(--text-dim); font-size: .74em; font-weight: 700; }
.wk i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 2px solid transparent; }
.wk.played i { background: rgba(47, 128, 255, .35); }
.wk.done i { background: var(--green); color: #053b2a; }
.wk.today i { border-color: var(--cyan); }
.guide-fig { margin: 0 0 16px; padding: 10px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.guide-fig .art { width: 100%; height: auto; display: block; }
.guide-fig figcaption { margin-top: 8px; color: var(--sky-100); }
.guide-fig b { display: block; color: #fff; font-size: 1.05em; }

/* ─── results ─────────────────────────────────────────────────────────────── */
.result h2 { font-size: 1.7em; font-weight: 900; }
.eyebrow { color: var(--cyan-soft); font-weight: 900; letter-spacing: .16em; text-transform: uppercase; font-size: .8em; }
.result.fail .eyebrow { color: var(--red); }
.result.perfect .eyebrow, .result.record .eyebrow { color: var(--gold); }
.result .stars { margin: 6px 0; }
.result > p { max-width: 380px; color: var(--sky-100); }
.big-number { font-size: 3.4em; font-weight: 900; line-height: 1; letter-spacing: -.02em; margin: 6px 0; display: inline-flex; align-items: center; gap: 10px; text-shadow: 0 6px 24px rgba(34, 211, 238, .35); }
.coin-total .ic { color: var(--gold); }
.burst { position: relative; height: 120px; display: grid; place-items: center; color: var(--gold); }
.burst-ic { animation: burst 2.4s linear infinite; filter: drop-shadow(0 0 16px rgba(255, 216, 77, .6)); }
@keyframes burst { to { transform: rotate(360deg); } }
html.reduce-motion .burst-ic { animation: none; }
.fail-meter { display: flex; align-items: baseline; gap: 6px; margin: 4px 0; }
.fail-meter b { font-size: 3em; font-weight: 900; }
.fail-meter span { font-size: 1.4em; color: var(--text-dim); font-weight: 800; }
.streak { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: rgba(255, 107, 129, .15); border: 1px solid rgba(255, 107, 129, .35); color: #ffc2cc; margin: 8px 0; }
.streak b { font-size: 1.5em; color: #fff; }
.levelup { display: inline-flex; gap: 6px; align-items: center; color: var(--cyan-soft); font-weight: 800; }
.coin-line { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: #ffe89a; }
.reward-list { list-style: none; padding: 0; margin: 10px 0; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 6px; }
.reward-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--panel); text-align: left; }
.reward-list b { color: #ffe89a; white-space: nowrap; }
.reward-list li.xp b { color: var(--cyan-soft); }
.unlock-art { margin-bottom: 6px; }
.unlock-art .preview { width: 240px; height: auto; max-width: 100%; border-radius: 18px; border: 2px solid var(--sky-300); box-shadow: 0 12px 34px rgba(34, 211, 238, .3); }
.medal-art { width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(255, 216, 77, .35), rgba(255, 216, 77, 0) 70%); color: var(--gold); }

/* ─── collections ─────────────────────────────────────────────────────────── */
.cabinet-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.cabinet-head .ic { color: var(--gold); }
.cabinet-head b { font-size: 1.3em; font-weight: 900; }
.cabinet-head span { color: var(--text-dim); font-size: .9em; }
.trophy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.trophy-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.trophy-card.earned { background: linear-gradient(180deg, rgba(255, 216, 77, .12), rgba(255, 255, 255, .04)); border-color: rgba(255, 216, 77, .35); }
.trophy-card small { color: var(--text-dim); font-size: .8em; }
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; }
.tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border-radius: 11px; font-weight: 800; color: var(--text-dim); }
.tab.on { background: #fff; color: var(--navy-700); }
.skin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.skin-card { border-radius: 18px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; }
.skin-card.on { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.skin-card .preview { width: 100%; height: auto; display: block; aspect-ratio: 3 / 2; }
.skin-card.locked .preview { filter: saturate(.5) brightness(.8); }
.sk-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; flex: 1; }
.sk-body small { color: var(--text-dim); font-size: .8em; flex: 1; }
.sk-body .btn, .sk-body .tag { margin-top: 6px; }
.mission-list, .ach-list { display: flex; flex-direction: column; gap: 10px; }
.mission, .ach { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.mission.done:not(.claimed) { border-color: rgba(255, 216, 77, .5); background: rgba(255, 216, 77, .08); }
.mission.claimed, .ach.done { opacity: .85; }
.ms-ic, .ach-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(47, 128, 255, .2); color: var(--sky-300); flex: none; }
.ach.done .ach-ic { background: rgba(255, 216, 77, .18); color: var(--gold); }
.ms-body, .ach-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ms-body small, .ach-body small { color: var(--text-dim); font-size: .8em; }
.ach-rw { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: #ffe89a; font-size: .85em; white-space: nowrap; }
.ach.done .ach-rw { color: var(--green); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 12px 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.stat-tile .ic { color: var(--sky-300); }
.stat-tile b { font-size: 1.12em; font-weight: 900; overflow-wrap: anywhere; }
.stat-tile small { color: var(--text-dim); font-size: .72em; line-height: 1.25; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.faq summary { padding: 14px; font-weight: 700; cursor: pointer; list-style: none; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--sky-300); font-weight: 900; }
.faq details[open] summary::after { content: "–"; }
.faq p { padding: 0 14px 14px; margin: 0; color: var(--sky-100); }
.credits dl { width: 100%; max-width: 360px; margin: 16px 0; text-align: center; }
.credits dt { color: var(--sky-300); font-size: .78em; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-top: 12px; }
.credits dd { margin: 2px 0 0; font-weight: 700; }

/* ─── gameplay ────────────────────────────────────────────────────────────── */
.scr.game { overflow: hidden; padding: 0; touch-action: none; }
.stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(var(--safe-top) + 10px) 12px 0; display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-score { flex: 1; text-align: center; display: flex; flex-direction: column; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); pointer-events: none; }
.hud-score small, .hud-meta small { font-size: .7em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--sky-100); }
.hud-score b { font-size: 2.6em; font-weight: 900; line-height: 1; }
.hud-meta { min-width: 72px; padding: 6px 10px; border-radius: 14px; background: rgba(3, 11, 36, .45); border: 1px solid rgba(255, 255, 255, .2); text-align: center; display: flex; flex-direction: column; pointer-events: none; }
.hud-meta b { font-size: 1.15em; font-weight: 900; white-space: nowrap; }
.hud-meta b.hot { color: var(--red); }
.hud-progress { position: absolute; left: 16px; right: 16px; top: calc(var(--safe-top) + 78px); height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; pointer-events: none; }
.hud-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #fff3b0); transition: width .25s ease; }
.hud-title { position: absolute; left: 0; right: 0; top: calc(var(--safe-top) + 90px); text-align: center; font-size: .8em; font-weight: 700; color: rgba(217, 236, 255, .8); pointer-events: none; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); padding: 0 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boost { position: absolute; left: 50%; top: calc(var(--safe-top) + 112px); transform: translateX(-50%); padding: 5px 14px; border-radius: 999px; background: rgba(34, 211, 238, .2); border: 1px solid var(--cyan); color: var(--cyan-soft); font-weight: 800; font-size: .85em; pointer-events: none; }
.boost b { color: #fff; }
.banner { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; text-align: center; white-space: nowrap; }
.banner.combo { top: 30%; display: flex; flex-direction: column; align-items: center; }
.banner.combo b { font-size: 2em; font-weight: 900; color: #fff; text-shadow: 0 0 18px rgba(34, 211, 238, .9), 0 3px 0 rgba(10, 36, 99, .8); letter-spacing: .02em; }
.banner.combo span { font-weight: 900; color: var(--cyan-soft); font-size: 1.05em; }
.banner.warn { bottom: calc(var(--safe-bottom) + 28px); display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; background: rgba(255, 216, 77, .95); color: var(--navy-800); font-weight: 800; font-size: .9em; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); white-space: normal; width: max-content; max-width: calc(100% - 32px); }
.banner.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
html.reduce-motion .banner.pop { animation: none; }
.coach { position: absolute; left: 16px; right: 16px; top: calc(var(--safe-top) + 146px); margin: 0 auto; max-width: 420px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .95); color: var(--navy-700); font-weight: 700; text-align: center; box-shadow: 0 10px 28px rgba(0, 0, 0, .35); pointer-events: none; }
.ready { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; padding: 16px; }
.ready-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 26px; border-radius: 22px; background: rgba(3, 11, 36, .6); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); margin-top: 18vh; text-align: center; }
.ready-card b { font-size: 1.4em; font-weight: 900; }
.ready-card small { color: var(--sky-100); }
.ready-card .ic { color: var(--cyan-soft); animation: tapHint 1.2s ease-in-out infinite; }
@keyframes tapHint { 50% { transform: translateY(6px) scale(.92); } }
html.reduce-motion .ready-card .ic { animation: none; }
.sheet.pause .btn .ic { width: 20px; height: 20px; }

/* ─── accessibility modes ─────────────────────────────────────────────────── */
html.high-contrast { --line: rgba(255, 255, 255, .55); --text-dim: #d7e6ff; --panel: rgba(255, 255, 255, .1); }
html.high-contrast .btn, html.high-contrast .icon-btn { border-width: 2px; }

/* ─── larger screens ──────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .level-grid { grid-template-columns: repeat(4, 1fr); }
  .trophy-grid, .skin-grid { grid-template-columns: repeat(3, 1fr); }
  .shortcut-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 350px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .mc-text b { font-size: .9em; }
}
