/* Selection screens use stable slots; only page changes fade, never the fixed actions. */
html { scroll-behavior: auto; scrollbar-gutter: stable; }
body { min-width: 0; }
.screen { animation: none; }
.screen.active .screen-heading h1 { animation: none; }
.screen-heading h1:focus { outline: none; }
.setup-screen, .opponents-screen { overflow-anchor: none; padding-bottom: 160px; }
.app-shell[data-current-screen="setup"] .setup-screen { padding-bottom: calc(158px + var(--safe-bottom)); }
.app-shell[data-current-screen="opponents"] .bottom-nav { display: none; }
.journey-steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px; margin: 0 16px 16px; color: var(--muted); font-size: 12px;
}
.journey-steps > * { min-height: 36px; display: grid; place-items: center; border-bottom: 2px solid var(--line); }
.journey-steps [aria-current] { color: var(--gold); border-color: var(--gold); font-weight: 700; }
.journey-steps button:hover { color: var(--ivory); }
.ladder-screen .screen-heading, .opponents-screen .screen-heading, .setup-screen .screen-heading { min-height: 90px; }
.screen-heading h1 { font-size: 25px; line-height: 1.2; }
.ladder-path { display: grid; gap: 16px; padding: 0 16px 24px; }
.world-entry { min-width: 0; }
.world-gate { display: block; position: relative; width: 100%; height: 170px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; text-align: left; }
.world-gate > img:not(.gate-arrow) { width: 100%; height: 100%; object-fit: cover; }
.world-gate::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0c1415eb, #0c14154a 80%); pointer-events: none; }
.world-gate-copy { position: absolute; z-index: 1; inset: 0 42px 0 18px; display: flex; flex-direction: column; justify-content: center; gap: 5px; color: #fff6e5; }
.world-gate-copy small { font-size: 10px; color: #d9c5a1; }
.world-gate-copy b { font-family: var(--font-display); font-size: 25px; line-height: 1.15; }
.world-gate-copy > span { font-size: 12px; }
.world-gate .gate-arrow { position: absolute; z-index: 1; right: 14px; top: 73px; width: 24px; height: 24px; transform: rotate(180deg); filter: invert(1); }
.world-gate:hover, .world-gate:focus-visible { border-color: var(--gold); }
.opponent-stage { height: 246px; position: relative; overflow: hidden; background: #101816; }
.opponent-stage-background { position: absolute; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.opponent-stage::after { position: absolute; content: ""; inset: 0; background: linear-gradient(90deg, #081414e6, transparent 85%); pointer-events: none; }
.opponent-stage-portrait { position: absolute; right: 0; height: 100%; width: 52%; object-fit: contain; object-position: center; }
.opponent-stage-copy { position: absolute; z-index: 1; inset: 0 auto 0 18px; width: 55%; display: flex; justify-content: center; flex-direction: column; gap: 9px; }
.opponent-stage-copy h2 { color: #fff6e5; font-size: 28px; line-height: 1.12; overflow-wrap: anywhere; }
.opponent-stage-copy p { color: #e2d8cb; font-size: 12px; }
.opponent-stage-copy .eyebrow { color: #f2cd88; font-size: 11px; }
.opponent-selector { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; padding: 16px; }
.opponent-selector .boss-nav { width: 44px; height: 48px; background: var(--surface); }
.guardian-roster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.guardian-token, .master-token { position: relative; min-width: 0; border: 2px solid transparent; border-radius: 4px; background: var(--surface); overflow: hidden; }
.guardian-token { height: 68px; }
.guardian-token > img:not(.token-lock) { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.guardian-token > span { position: absolute; bottom: 0; left: 0; width: 20px; background: #090a0dd9; color: #fff; font-size: 11px; }
.guardian-token.selected, .master-token.selected { border-color: var(--gold); }
.guardian-token .token-lock, .master-token .token-lock { position: absolute; right: 3px; top: 3px; width: 17px; height: 17px; background: #fff0d5; padding: 2px; border-radius: 3px; }
.battle-conditions { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 14px; height: 150px; margin: 0 16px 16px; padding-block: 12px; border-block: 1px solid var(--line); }
.battle-conditions > div:first-child { display: flex; flex-direction: column; color: var(--gold); }
.battle-conditions > div:first-child span { font-size: 11px; }
.battle-conditions > div:first-child b { font-size: 27px; }
.battle-conditions > div:last-child { overflow-y: auto; }
.battle-conditions b { font-size: 13px; }
.battle-conditions p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 5px; }
.battle-conditions #opponent-unlock { color: var(--gold); }
.setup-screen .opponent-brief { margin: 0 16px 12px; padding: 0; min-height: 60px; height: 60px; border: 0; background: none; grid-template-columns: 48px minmax(0, 1fr); }
.setup-screen .opponent-brief > img { width: 44px; height: 54px; min-height: 0; border-radius: 4px; object-fit: cover; }
.setup-screen .opponent-brief > div { padding: 0; align-self: center; }
.setup-screen .opponent-brief p { margin-top: 2px; }
.setup-screen .opponent-brief h2 { font: 700 14px var(--font-ui); }
.setup-screen .opponent-brief p, .setup-screen .opponent-brief span { font-size: 11px; }
.setup-screen .opponent-brief p { color: var(--muted); }
.master-stage { display: grid; grid-template-columns: 40% minmax(0, 1fr); height: 200px; margin: 0 16px 14px; gap: 14px; }
.master-stage-art { height: 200px; min-width: 0; background: var(--ink-soft); overflow: hidden; border-radius: 4px; }
.master-stage-art img { width: 100%; height: 100%; object-fit: contain; }
.master-stage-copy { align-self: center; min-width: 0; }
.master-stage-copy h2 { font-size: 25px; line-height: 1.14; height: 50px; display: flex; align-items: center; }
.master-stage-copy > p { height: 32px; color: var(--muted); font-size: 11px; }
.master-stage-copy > .eyebrow { font-size: 10px; }
.master-ability { height: 98px; padding-top: 8px; border-top: 1px solid var(--line); overflow-y: auto; }
.master-ability b { color: var(--gold); font-size: 12px; }
.master-ability p { margin-top: 6px; font-size: 12px; line-height: 1.45; }
.setup-screen .master-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.master-token { display: grid; grid-template-rows: 50px 28px; width: 100%; text-align: center; }
.master-token > img:not(.token-lock) { height: 50px; width: 100%; object-fit: cover; object-position: center 18%; }
.master-token b { display: grid; place-items: center; font: 600 10px/1.15 var(--font-ui); padding: 2px; overflow-wrap: anywhere; }
.master-token.locked { opacity: .75; }
.master-token.locked.selected { opacity: 1; }
.setup-screen .setup-actionbar, .opponents-screen .ladder-actionbar {
  position: fixed; inset: auto 0 0; width: 100%; max-width: 580px; margin-inline: auto;
  padding: 10px 16px calc(10px + var(--safe-bottom)); background: var(--surface); backdrop-filter: none;
}
.setup-actionbar .command, .opponents-screen .command { height: 66px; min-height: 66px; }
.opponents-screen .command b, .setup-actionbar .command b { font-size: 18px; }
.opponents-screen .command small, .setup-actionbar .command small { font-size: 11px; }
.setup-actionbar .selected-summary { height: 41px; padding-bottom: 8px; }
.setup-actionbar .command-seal, .opponents-screen .command-seal { width: 32px; height: 32px; font-size: 24px; }
.offer-card .offer-advice { display: block; min-height: 14px; }
.offer-card .offer-advice:empty { visibility: hidden; }
.offer-card .sphere-stage > img { animation: none; }
:root[data-theme="light"] .boss-nav img,
:root[data-theme="light"] .icon-button > img,
:root[data-theme="light"] .record-button > img { filter: brightness(0); opacity: .82; }
@media (min-width: 700px) {
  .ladder-path { grid-template-columns: 1fr 1fr; }
  .world-gate { height: 215px; }
  .world-gate-copy { right: 20px; }
  .world-gate-copy b { font-size: 24px; }
  .world-gate .gate-arrow { display: none; }
}
@media (max-width: 350px) {
  .screen-heading h1 { font-size: 21px; }
  .journey-steps { font-size: 11px; }
  .opponent-selector { gap: 5px; padding-inline: 12px; }
  .guardian-roster { gap: 4px; }
  .master-stage { gap: 9px; }
  .master-stage-copy h2 { font-size: 22px; }
  .setup-screen .master-list { gap: 4px; }
  .master-token b { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen *, .screen *::before, .screen *::after { animation: none !important; transition: none !important; }
}
