/* umage.ai Studio brand font (as on studio.umage.ai): Press Start 2P, OFL, self-hosted for offline play. Badge + eyebrows only. */
@font-face { font-family: 'Press Start 2P'; src: url('../assets/fonts/press-start-2p-latin.woff2') format('woff2'); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }
/* css/style.css - tokens, reset, screens, buttons, cards, modals, toasts. Owner: WP-shell (SPEC section 14.4).
   Rules: no backdrop-filter anywhere; animate transform/opacity only; nothing animates on a hidden screen (display:none). */

:root {
  --bg: #05060f;
  --bg2: #0b1024;
  --ink: #eaf0ff;
  --ink-dim: #a3b0dc;
  --ink-faint: #6e7baa;
  --panel: rgba(12, 18, 42, .86);
  --panel-solid: #0c122b;
  --panel-hi: rgba(26, 38, 82, .92);
  --line: rgba(160, 190, 255, .16);
  --line-hi: rgba(160, 200, 255, .34);
  --gold: #ffd36b;
  --gold-rgb: 255 211 107;
  --crystal: #7df9ff;
  --crystal-rgb: 125 249 255;
  --danger: #ff5c7a;
  --danger-rgb: 255 92 122;
  --ok: #6bffb0;
  /* chapter theme (set on <body> by LL.Game; cards override locally) */
  --ch-accent: #8fd3ff;
  --ch-rgb: 143 211 255;
  --ch-bg0: #060818;
  --ch-bg1: #141a3f;
  --font: "Segoe UI Variable Display", "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --hud-bar: 56px;
  --z-screen: 10;
  --z-hud: 20;
  --z-results: 25;
  --z-sheet: 30;
  --z-settings: 35;
  --z-toast: 40;
  --z-confirm: 45;
  --z-splash: 50;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
}
body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  /* painted worlds come from the canvas; this is the fallback behind it (and what the first frame shows) */
  background:
    radial-gradient(120% 70% at 50% -10%, var(--ch-bg1) 0%, transparent 65%),
    radial-gradient(90% 60% at 50% 120%, rgb(var(--ch-rgb) / .12) 0%, transparent 70%),
    var(--ch-bg0);
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#safe-probe {
  position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
button, input, a { font: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ch-accent); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ic { display: inline-flex; width: 24px; height: 24px; flex: none; align-items: center; justify-content: center; }
.ic svg { width: 100%; height: 100%; display: block; }
.scroll { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

/* ---------------------------------------------------------------- screens and transitions */
.screen {
  position: absolute; inset: 0; z-index: var(--z-screen);
  display: none; opacity: 0; pointer-events: none;
  transform: translate3d(0, 12px, 0);
  transition: opacity .28s var(--ease), transform .36s var(--ease);
}
.screen.is-shown { display: block; will-change: transform, opacity; }
.screen.is-active { opacity: 1; transform: none; pointer-events: auto; }
.screen.is-leaving { opacity: 0; transform: translate3d(0, -6px, 0); transition-duration: .16s; }
.screen-play, .screen-play.is-active, .screen-play.is-leaving { transform: none; pointer-events: none; transition: opacity .2s ease; }

/* ---------------------------------------------------------------- buttons, chips */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-md);
  border: 1px solid var(--line-hi);
  background: linear-gradient(180deg, rgba(38, 54, 108, .92), rgba(18, 27, 62, .94));
  color: var(--ink); font-weight: 650; font-size: 16px; letter-spacing: .02em; line-height: 1.1; text-decoration: none;
  cursor: pointer; transition: transform .14s var(--ease), box-shadow .2s ease, filter .2s ease;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.btn:active { transform: scale(.972); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn .ic { width: 22px; height: 22px; }
.btn-primary {
  border-color: rgb(var(--ch-rgb) / .95); color: #06101f;
  background: linear-gradient(180deg, rgb(var(--ch-rgb) / 1), rgb(var(--ch-rgb) / .74));
  box-shadow: 0 10px 34px -10px rgb(var(--ch-rgb) / .75), 0 0 0 1px rgb(var(--ch-rgb) / .25), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn-secondary { border-color: rgb(var(--ch-rgb) / .5); box-shadow: 0 6px 22px -10px rgb(var(--ch-rgb) / .5), inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn-ghost { background: rgba(16, 24, 56, .66); border-color: var(--line); box-shadow: none; }
.btn-danger { border-color: rgb(var(--danger-rgb) / .8); background: linear-gradient(180deg, rgba(120, 28, 52, .95), rgba(70, 14, 34, .95)); color: #ffe3ea; }
.btn-xl { min-height: 60px; font-size: 19px; border-radius: 20px; width: 100%; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; border-radius: 14px; }
.btn-link { background: none; border-color: transparent; box-shadow: none; color: var(--ink-dim); min-height: 48px; padding: 0 14px; font-weight: 600; font-size: 15px; }
.btn-link .ic { width: 20px; height: 20px; }
.btn-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.btn-xl .btn-text { align-items: center; text-align: center; }
.btn-sub { font-size: 12px; font-weight: 500; opacity: .75; letter-spacing: .02em; }
.btn-mode { flex-direction: row; justify-content: flex-start; padding: 0 16px; min-height: 64px; text-align: left; border-radius: 18px; }
.btn-mode .ic { width: 26px; height: 26px; color: rgb(var(--ch-rgb)); }
.btn.is-locked { opacity: .62; }
.btn.is-locked .ic { color: var(--ink-faint); }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--gold); color: #1a1204; font: 800 12px/22px var(--font); text-align: center; }
.btn-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; padding: 0; border-radius: 14px; cursor: pointer;
  background: rgba(14, 22, 52, .72); border: 1px solid var(--line); color: var(--ink);
  transition: transform .14s var(--ease), background .2s ease, opacity .2s ease;
}
.btn-icon:active { transform: scale(.92); background: rgba(40, 58, 120, .8); }
.btn-icon[disabled], .btn-icon[aria-disabled="true"] { opacity: .32; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 9px; border-radius: 16px;
  background: rgba(8, 13, 34, .78); border: 1px solid var(--line); color: var(--ink);
  font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip .ic { width: 18px; height: 18px; }
.chip-star .ic { color: var(--gold); }
.chip-crystal .ic { color: var(--crystal); }
.chip-soft { color: var(--ink-dim); font-weight: 600; }
.stars { display: inline-flex; gap: 2px; }
.stars .ic { width: 16px; height: 16px; }
.ic.on { color: var(--gold); }
.ic.off { color: rgba(255, 255, 255, .22); }
.studio { color: #cfe9ff; font-weight: 750; }

/* ---------------------------------------------------------------- shared screen chrome */
.screen-head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  height: calc(var(--sat) + 64px); padding: var(--sat) calc(12px + var(--sar)) 0 calc(12px + var(--sal));
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(4, 6, 16, .88) 0%, rgba(4, 6, 16, .6) 62%, rgba(4, 6, 16, 0) 100%);
}
.head-title { flex: 1; min-width: 0; margin: 0; font-size: 22px; font-weight: 750; letter-spacing: .01em; }
.head-title-2 h2 { margin: 0; font-size: 20px; font-weight: 750; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-title-2 p { margin: 2px 0 0; font-size: 13px; color: rgb(var(--ch-rgb)); font-weight: 600; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-spacer { width: 44px; flex: none; }
.screen > .scroll {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--sat) + 60px);
  padding: 6px calc(16px + var(--sar)) calc(var(--sab) + 28px) calc(16px + var(--sal));
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .8); }

/* ---------------------------------------------------------------- splash */
.screen-splash { z-index: var(--z-splash); background: var(--bg); transform: none; transition: opacity .5s ease; }
.screen-splash.is-shown { display: flex; align-items: center; justify-content: center; }
.splash-stage { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 24px; text-align: center; }
.screen-splash .brand-mark { width: clamp(180px, 56vw, 300px); opacity: 0; transform: scale(.9); transition: opacity .4s ease, transform .7s var(--ease); }
.screen-splash.t-mark .brand-mark { opacity: 1; transform: none; }
.screen-splash.is-later .brand-mark { transition-duration: .3s; }
.screen-splash .splash-text { margin: 0; font-size: 15px; font-weight: 550; letter-spacing: .14em; color: var(--ink-dim); opacity: 0; transform: translateY(6px); transition: opacity .9s ease, transform .9s var(--ease); }
.screen-splash.t-text .splash-text { opacity: 1; transform: none; }
.screen-splash.is-later .splash-text { transition-duration: .3s; }
.screen-splash.t-out { opacity: 0; }
.brand-mark { display: block; width: 100%; aspect-ratio: 160.477 / 57.08; }
.brand-mark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mark-sweep { transform: translateX(0); }
.screen-splash.t-sweep .mark-sweep { animation: markSweep .7s ease-in-out both; }
@keyframes markSweep { from { transform: translateX(0); } to { transform: translateX(240px); } }

/* ---------------------------------------------------------------- title */
.screen-title { padding: calc(var(--sat) + 14px) calc(20px + var(--sar)) calc(var(--sab) + 18px) calc(20px + var(--sal)); }
.screen-title.is-shown { display: flex; flex-direction: column; }
.screen-title::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, rgba(4, 6, 16, .92) 0%, rgba(4, 6, 16, .7) 26%, rgba(4, 6, 16, 0) 46%), linear-gradient(180deg, rgba(4, 6, 16, .5) 0%, rgba(4, 6, 16, 0) 22%);
}
.title-chips { display: flex; justify-content: flex-end; gap: 8px; min-height: 32px; }
.title-art { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.wordmark-fallback { display: none; flex-direction: column; align-items: center; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; line-height: 1.02; margin-right: -.22em; }
body[data-titleart="dom"] .wordmark-fallback { display: flex; }
.wm-a, .wm-b { font-size: clamp(40px, 14vw, 88px); }
.wm-a { color: #f4fdff; text-shadow: 0 0 6px #3df5ff, 0 0 22px rgba(61, 245, 255, .7), 0 0 58px rgba(61, 140, 255, .55); }
.wm-b { color: #fff6fe; text-shadow: 0 0 6px #ff4ff0, 0 0 22px rgba(255, 79, 240, .65), 0 0 58px rgba(160, 90, 255, .5); }
.wordmark-fallback::after {
  content: ''; display: block; width: 78%; height: 3px; margin: 18px 0 0 .22em; border-radius: 2px;
  background: linear-gradient(90deg, rgba(61, 245, 255, 0), #3df5ff 20%, #ff4ff0 80%, rgba(255, 79, 240, 0));
  box-shadow: 0 0 14px rgba(120, 140, 255, .9);
}
body[data-titleart="canvas"] .brand-line { position: absolute; left: var(--title-brand-x, 50%); top: var(--title-brand-y, 31%); translate: -50% 0; white-space: nowrap; }
.brand-line { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .14em; color: #e4ecff; text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 14px rgba(0, 0, 0, .9), 0 0 4px rgba(0, 0, 0, .8); }
.title-menu { width: min(420px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.title-primary { display: flex; flex-direction: column; gap: 12px; }
.title-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.title-modes.is-empty { display: none; }
.title-modes .btn-mode:only-child { grid-column: 1 / -1; }
.title-foot { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.screen-title.is-active .title-primary .btn, .screen-title.is-active .title-modes .btn, .screen-title.is-active .title-foot .btn, .screen-title.is-active .title-chips .chip, .screen-title.is-active .brand-line {
  animation: riseIn .6s var(--ease) both;
}
.screen-title.is-active .brand-line { animation-delay: .25s; }
.screen-title.is-active .title-primary .btn { animation-delay: .32s; }
.screen-title.is-active .title-primary .btn + .btn { animation-delay: .4s; }
.screen-title.is-active .title-modes .btn { animation-delay: .48s; }
.screen-title.is-active .title-foot .btn { animation-delay: .56s; }
@keyframes riseIn { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- chapters */
.screen-chapters::before, .screen-levels::before, .screen-daily::before, .screen-infinite::before, .screen-about::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 40%, rgba(4, 6, 16, .35), rgba(4, 6, 16, .78));
}
.chapter-list { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; display: flex; flex-direction: column; gap: 12px; }
.chapter-card {
  position: relative; display: block; width: 100%; min-height: 100px; padding: 0; text-align: left; overflow: hidden; cursor: pointer;
  border-radius: 22px; border: 1px solid rgb(var(--ch-rgb) / .38);
  background: linear-gradient(135deg, var(--ch-bg1), var(--ch-bg0));
  box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .3);
  transition: transform .16s var(--ease), border-color .2s ease, box-shadow .2s ease;
  color: var(--ink);
}
.chapter-card:active { transform: scale(.985); }
.chapter-card:not(.is-locked) { box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .85), 0 0 26px -10px rgb(var(--ch-rgb) / .5); }
.ch-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; }
.ch-thumb.is-ready { opacity: .92; filter: brightness(.95) saturate(1.1); }
/* the shade only sits behind the text (left), the painting is clearly visible on the right */
.ch-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 6, 16, .8) 0%, rgba(4, 6, 16, .52) 48%, rgba(4, 6, 16, 0) 86%); }
.ch-num {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 52px; min-width: 52px; text-align: center; white-space: nowrap;
  font-size: clamp(34px, 10vw, 40px); font-weight: 850; line-height: 1; color: rgb(var(--ch-rgb)); text-shadow: 0 0 18px rgb(var(--ch-rgb) / .7); font-variant-numeric: tabular-nums;
}
.ch-num.is-two { font-size: clamp(28px, 8.4vw, 34px); }
.ch-body { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 100px; padding: 14px 76px 14px 74px; }
.ch-name { font-size: 19px; font-weight: 750; line-height: 1.15; text-shadow: 0 1px 10px rgba(0, 0, 0, .8); }
.ch-world { font-size: 13px; color: var(--ink-dim); font-weight: 550; letter-spacing: .02em; }
.ch-stats { display: flex; gap: 14px; margin-top: 4px; }
.stat { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat .ic { width: 17px; height: 17px; }
.stat i { font-style: normal; font-weight: 550; color: var(--ink-faint); margin-left: -3px; }
.stat-star .ic { color: var(--gold); }
.stat-crystal .ic { color: var(--crystal); }
.ch-ring { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; }
.ch-ring svg { position: absolute; inset: 0; width: 44px; height: 44px; }
.ch-ring b { position: relative; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rg-bg { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 4; }
.rg-fg { fill: none; stroke: rgb(var(--ch-rgb)); stroke-width: 4; stroke-linecap: round; filter: none; }
.chapter-card.is-locked { border-color: var(--line); }
.chapter-card.is-locked .ch-thumb { filter: grayscale(.85) brightness(.75); opacity: .7; }
.chapter-card.is-locked .ch-shade { background: linear-gradient(90deg, rgba(4, 6, 16, .9), rgba(4, 6, 16, .66)); }
.chapter-card.is-locked .ch-num { color: var(--ink-faint); text-shadow: none; }
.chapter-card.is-locked .ch-name { color: var(--ink-dim); }
.ch-locked, .gate-line { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-dim); }
.ch-locked .ic, .gate-line .ic { width: 16px; height: 16px; }
.ch-gate { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.gate-line b { color: var(--gold); font-variant-numeric: tabular-nums; }
.gate-bar { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; max-width: 190px; }
.gate-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, rgb(var(--gold-rgb) / .7), var(--gold)); }
.gate-note { font-size: 12px; color: var(--ink-dim); }
.gate-ok { color: var(--ok); }
.gate-ok b { color: var(--ink); font-weight: 650; font-variant-numeric: normal; }
.gate-ok .ic { color: var(--ok); }
.chapter-card.is-gate { border-color: rgb(var(--gold-rgb) / .45); }
.ch-start { align-self: flex-start; margin-bottom: 1px; padding: 3px 9px; border-radius: 10px; background: rgb(var(--ch-rgb)); color: #06101f; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.screen-chapters.is-active .chapter-list > li { animation: riseIn .5s var(--ease) both; }
.screen-chapters.is-active .chapter-list > li:nth-child(2) { animation-delay: .04s; }
.screen-chapters.is-active .chapter-list > li:nth-child(3) { animation-delay: .08s; }
.screen-chapters.is-active .chapter-list > li:nth-child(4) { animation-delay: .12s; }
.screen-chapters.is-active .chapter-list > li:nth-child(5) { animation-delay: .16s; }
.screen-chapters.is-active .chapter-list > li:nth-child(n+6) { animation-delay: .2s; }

/* two campaigns: the tab switch above the chapter cards (C2 section 9.6) */
.campaign-tabs { max-width: 560px; margin: 0 auto 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.campaign-tab {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 76px; padding: 11px 14px 10px; text-align: left; cursor: pointer; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--line); background: rgba(12, 18, 42, .72); color: var(--ink);
  transition: transform .16s var(--ease), border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.campaign-tab:active { transform: scale(.98); }
.campaign-tab[data-campaign="2"] { --tab-rgb: 224 139 255; }
.campaign-tab[data-campaign="1"] { --tab-rgb: 143 211 255; }
.campaign-tab.is-on { border-color: rgb(var(--tab-rgb) / .75); background: linear-gradient(135deg, rgb(var(--tab-rgb) / .2), rgba(12, 18, 42, .86)); box-shadow: 0 10px 26px -14px rgb(var(--tab-rgb) / .8), 0 0 22px -12px rgb(var(--tab-rgb) / .6); }
.ct-label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: clamp(10.5px, 3.2vw, 12px); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.ct-label b { font-weight: 800; }
.ct-label .ic { width: 14px; height: 14px; }
.campaign-tab.is-on .ct-label { color: rgb(var(--tab-rgb)); }
.ct-name { font-size: clamp(13px, 4.1vw, 16px); font-weight: 750; line-height: 1.15; overflow-wrap: break-word; max-width: 100%; }
.ct-stars { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ct-stars .ic { width: 15px; height: 15px; color: var(--gold); }
.ct-stars i { font-style: normal; font-weight: 550; color: var(--ink-faint); margin-left: -3px; }
.ct-locked { font-size: 13px; font-weight: 600; color: var(--ink-dim); }
.campaign-tab.is-locked { background: rgba(8, 12, 28, .6); }
.campaign-tab.is-locked .ct-name { color: var(--ink-dim); }
.chapter-card.is-fresh { animation: freshGlow 1.6s ease-out 3 both; }
@keyframes freshGlow { 0%, 100% { box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .85), 0 0 26px -10px rgb(var(--ch-rgb) / .5); } 45% { box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .85), 0 0 0 2px rgb(var(--ch-rgb) / .9), 0 0 44px -4px rgb(var(--ch-rgb) / .85); } }
@media (prefers-reduced-motion: reduce) { .chapter-card.is-fresh { animation: none; box-shadow: 0 0 0 2px rgb(var(--ch-rgb) / .9), 0 0 30px -6px rgb(var(--ch-rgb) / .7); } }
html[data-motion="reduced"] .chapter-card.is-fresh { animation: none; box-shadow: 0 0 0 2px rgb(var(--ch-rgb) / .9), 0 0 30px -6px rgb(var(--ch-rgb) / .7); }

/* ---------------------------------------------------------------- levels */
.levels-progress { margin: 0 auto 12px; max-width: 520px; text-align: center; font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.tile-grid { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  aspect-ratio: 1 / 1.08; min-height: 76px; padding: 6px 4px 8px; border-radius: 18px; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 30, 68, .86), rgba(10, 15, 38, .9));
  border: 1px solid rgb(var(--ch-rgb) / .22);
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: transform .14s var(--ease), border-color .2s ease;
  color: var(--ink);
}
.tile:active { transform: scale(.94); }
.lv-summary {
  max-width: 520px; margin: 18px auto 8px; padding: 18px 18px 16px; border-radius: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: linear-gradient(135deg, rgb(var(--ch-rgb) / .14), rgba(10, 15, 38, .82)); border: 1px solid rgb(var(--ch-rgb) / .32);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .85);
}
.lv-world { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--ch-rgb)); }
.lv-name { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.15; }
.lv-blurb { margin: 0; font-size: 14.5px; line-height: 1.4; color: var(--ink-dim); }
.lv-stats { display: flex; gap: 16px; margin: 4px 0 6px; }
.lv-continue { align-self: stretch; margin-top: 6px; min-height: 52px; }
.tile-num { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgb(var(--ch-rgb) / .5); }
.tile-stars .ic { width: 15px; height: 15px; }
.tile.is-open { border-color: rgb(var(--ch-rgb) / .85); background: linear-gradient(180deg, rgb(var(--ch-rgb) / .22), rgba(10, 15, 38, .92)); box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .9), 0 0 24px -6px rgb(var(--ch-rgb) / .6), inset 0 1px 0 rgba(255, 255, 255, .1); }
.tile.is-done { border-color: rgb(var(--ch-rgb) / .5); background: linear-gradient(180deg, rgb(var(--ch-rgb) / .14), rgba(10, 15, 38, .9)); }
.tile.is-locked, .tile.is-soon { opacity: .55; }
.tile.is-locked .tile-num, .tile.is-soon .tile-num { color: var(--ink-dim); text-shadow: none; }
.tile-lock { width: 20px; height: 20px; color: var(--ink-faint); }
.tile-note { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.tile-crystal { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; color: var(--crystal); }
.tile-flag { position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; color: var(--gold); }
.tile.is-finale { border-color: rgb(var(--gold-rgb) / .5); }
.tile-ribbon { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 2px 3px; text-align: center; font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; background: rgb(var(--gold-rgb) / .2); color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.is-skipped .tile-stars { margin-bottom: 8px; }
.screen-levels.is-active .tile { animation: tileIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms + 60ms); }
@keyframes tileIn { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.94); } to { opacity: 1; transform: none; } }
.tile.is-locked, .tile.is-soon { animation-name: tileInDim; }
@keyframes tileInDim { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.94); } to { opacity: .55; transform: none; } }

/* ---------------------------------------------------------------- daily / infinite skeleton, about */
.mode-body { display: flex; flex-direction: column; align-items: center; }
.mode-card { width: min(100%, 460px); margin: 20px auto 0; padding: 32px 24px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; border-color: rgb(var(--ch-rgb) / .35); }
.mode-card h3 { margin: 0; font-size: 24px; font-weight: 780; }
.mode-card p { margin: 0; color: var(--ink-dim); max-width: 32ch; }
.mode-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 26px; color: rgb(var(--ch-rgb)); background: rgb(var(--ch-rgb) / .12); border: 1px solid rgb(var(--ch-rgb) / .4); box-shadow: 0 0 40px -8px rgb(var(--ch-rgb) / .6); }
.mode-icon .ic { width: 38px; height: 38px; }
.about-card { max-width: 460px; margin: 6px auto 0; padding: 30px 22px 26px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; border-radius: 28px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .8); }
.about-card .brand-mark { width: 168px; margin-bottom: 6px; }
.studio-lockup { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.screen-splash .studio-lockup { gap: 26px; }
.about-card .studio-lockup { margin-bottom: 8px; }
.lockup-line { margin: 0; font-size: 15px; font-weight: 550; letter-spacing: .14em; color: var(--ink-dim); }
.about-name { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #f4fdff; text-shadow: 0 0 20px rgba(61, 245, 255, .45); }
.about-tag { margin: 0; color: var(--ink-dim); }
.about-version { margin: 2px 0 10px; font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.about-made { margin: 0; font-size: 17px; font-weight: 600; }
.about-link { margin: 10px 0 12px; }
.about-credit { margin: 0; font-size: 13px; color: var(--ink-faint); max-width: 38ch; }

/* ---------------------------------------------------------------- modals and sheets */
.modal { position: fixed; inset: 0; z-index: var(--z-settings); display: none; pointer-events: none; }
.modal.is-shown { display: block; }
.modal.is-open { pointer-events: auto; }
.modal-menu { z-index: var(--z-sheet); }
.modal-confirm { z-index: var(--z-confirm); }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 4, 12, .66); opacity: 0; transition: opacity .28s ease; }
.modal.is-open .modal-backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: min(100%, 540px); max-height: min(88%, 760px);
  display: flex; flex-direction: column; border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #131c40, var(--panel-solid)); border: 1px solid var(--line-hi); border-bottom: 0;
  box-shadow: 0 -20px 70px -20px rgba(0, 0, 0, .9), 0 -2px 40px -10px rgb(var(--ch-rgb) / .3);
  transform: translate3d(0, 104%, 0); transition: transform .36s var(--ease);
  padding-bottom: var(--sab);
}
.modal.is-open .sheet { transform: none; }
.sheet:focus, .dialog:focus { outline: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 8px 22px; }
.sheet-head h2 { margin: 0; font-size: 21px; font-weight: 780; }
.sheet-body { padding: 4px 18px 22px; flex: 1 1 auto; min-height: 0; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(160, 190, 255, .09); min-height: 56px; }
.set-row:last-of-type { border-bottom: 0; }
.set-row.is-switch { cursor: pointer; min-height: 60px; }
.set-icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: rgb(var(--ch-rgb) / .12); color: rgb(var(--ch-rgb)); }
.set-icon .ic { width: 20px; height: 20px; }
.set-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-label b { font-size: 16px; font-weight: 650; }
.set-label small { font-size: 12px; color: var(--ink-faint); line-height: 1.3; }
.set-row.is-wide { flex-wrap: wrap; row-gap: 0; }
.set-row.is-wide .set-label { flex-basis: calc(100% - 50px); }
.set-row.is-wide > :last-child { flex: 1 1 100%; margin: 6px 0 0 48px; width: auto; }
.set-btns { display: flex; gap: 8px; }
.set-version { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 14px; background: rgba(0, 0, 0, .32); border: 1px solid var(--line); }
.seg-opt { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 11px; border: 0; background: transparent; color: var(--ink-dim); font-weight: 650; font-size: 14px; cursor: pointer; transition: background .2s ease, color .2s ease; flex: 1 1 auto; }
.seg-opt.is-on { background: rgb(var(--ch-rgb)); color: #06101f; box-shadow: 0 4px 16px -4px rgb(var(--ch-rgb) / .7); }
.is-perf .seg { display: flex; }
.is-perf .seg-opt { padding: 0 4px; min-width: 0; font-size: 13px; }
.switch { position: relative; flex: none; width: 54px; height: 32px; padding: 0; border-radius: 16px; border: 1px solid var(--line-hi); background: rgba(0, 0, 0, .35); cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #c6d2f5; transition: transform .24s var(--ease-back), background .2s ease; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.switch.is-on { background: rgb(var(--ch-rgb) / .9); border-color: rgb(var(--ch-rgb)); }
.switch.is-on i { transform: translateX(22px); background: #06101f; }
.switch::after { content: ''; position: absolute; inset: -7px -4px; }
.slider-wrap { display: flex; align-items: center; gap: 12px; }
.slider { -webkit-appearance: none; appearance: none; flex: 1; height: 44px; margin: 0; background: transparent; cursor: pointer; --fill: 50%; }
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgb(var(--ch-rgb)) var(--fill), rgba(255, 255, 255, .16) var(--fill)); }
.slider::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .16); }
.slider::-moz-range-progress { height: 6px; border-radius: 3px; background: rgb(var(--ch-rgb)); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #f1f6ff; border: 0; box-shadow: 0 0 0 4px rgb(var(--ch-rgb) / .35), 0 3px 10px rgba(0, 0, 0, .6); }
.slider::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #f1f6ff; border: 0; box-shadow: 0 0 0 4px rgb(var(--ch-rgb) / .35); }
.slider-out { width: 44px; text-align: right; font-size: 13px; font-weight: 650; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.dialog {
  position: absolute; left: 50%; top: 50%; width: min(86vw, 380px); padding: 24px 22px 20px; border-radius: 26px; text-align: center;
  background: linear-gradient(180deg, #162046, var(--panel-solid)); border: 1px solid var(--line-hi); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .95);
  transform: translate(-50%, -46%) scale(.94); opacity: 0; transition: transform .3s var(--ease-back), opacity .2s ease;
}
.modal.is-open .dialog { transform: translate(-50%, -50%); opacity: 1; }
.dlg-title { margin: 0 0 8px; font-size: 20px; font-weight: 780; }
.dlg-body { margin: 0 0 18px; color: var(--ink-dim); font-size: 15px; }
.dlg-actions { display: flex; gap: 10px; }
.dlg-actions .btn { flex: 1; padding: 0 12px; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--sat) + 12px); z-index: var(--z-toast); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
body[data-screen="play"] .toasts { top: calc(var(--hud-bar) + 8px); }
.toast {
  display: flex; align-items: center; gap: 12px; max-width: min(94vw, 460px); padding: 11px 16px; border-radius: 16px; pointer-events: auto; cursor: pointer;
  background: linear-gradient(180deg, rgba(30, 44, 94, .97), rgba(14, 22, 54, .98)); border: 1px solid var(--line-hi);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .9); font-size: 14.5px; font-weight: 550; line-height: 1.3;
  opacity: 0; transform: translate3d(0, -14px, 0) scale(.97); transition: opacity .22s ease, transform .32s var(--ease-back);
}
.toast.is-in { opacity: 1; transform: none; }
.toast.is-out { opacity: 0; transform: translate3d(0, -10px, 0); }
.toast-danger { border-color: rgb(var(--danger-rgb) / .7); box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .9), 0 0 24px -6px rgb(var(--danger-rgb) / .55); }
.toast-action { flex: none; min-height: 36px; padding: 0 14px; border-radius: 12px; border: 1px solid rgb(var(--ch-rgb) / .8); background: rgb(var(--ch-rgb) / .18); color: rgb(var(--ch-rgb)); font-weight: 750; font-size: 14px; cursor: pointer; }

/* ---------------------------------------------------------------- umage.ai Studio lockup (matches studio.umage.ai) */
.lockup-row { display: inline-flex; align-items: center; gap: .7em; }
.studio-badge { font-family: 'Press Start 2P', ui-monospace, monospace; font-size: .58em; letter-spacing: .1em; line-height: 1;
  padding: .55em .85em .48em; border-radius: 6px; color: #2b1300; background: linear-gradient(180deg, #ffd27a, #ffb547);
  box-shadow: 0 0 18px rgba(255, 181, 71, .35); transform: rotate(-3deg); text-transform: uppercase; white-space: nowrap; }
.pixel-eyebrow { font-family: 'Press Start 2P', ui-monospace, monospace; font-size: 11px !important; font-weight: 400 !important; letter-spacing: .12em !important; color: #e6cfa6 !important; text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px; }
.pixel-eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #ffb547; box-shadow: 0 0 10px #ffb547; }
.screen-splash .lockup-row { font-size: clamp(22px, 6.4vw, 34px); }
.screen-splash .lockup-row .brand-mark { width: clamp(150px, 44vw, 230px); }
.about-card .lockup-row { font-size: 22px; }
.about-card .lockup-row .brand-mark { width: 132px; margin-bottom: 0; }
a.brand-line { display: inline-block; text-decoration: none; font-size: 15px; letter-spacing: 0; padding: 6px 8px; border-radius: 10px; pointer-events: auto; }
a.brand-line .brand-mark { width: 74px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .9)); }
a.brand-line:hover .studio-badge, a.brand-line:focus-visible .studio-badge { box-shadow: 0 0 26px rgba(255, 181, 71, .7); }
a.brand-line:focus-visible { outline: 2px solid #ffb547; outline-offset: 2px; }
.about-card .about-link + .about-link { margin-top: -2px; }
/* Title: the studio lockup sits top-left like the nav brand on studio.umage.ai (and never collides with the board) */
.screen-title a.brand-line, body[data-titleart="canvas"] .screen-title a.brand-line {
  position: absolute; left: calc(10px + env(safe-area-inset-left, 0px)); top: calc(14px + env(safe-area-inset-top, 0px));
  translate: none; z-index: 3; text-shadow: none; }
