/* Max Vert Game Styles */

:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #121b26;
  --panel-light: #1a2634;
  --text: #e8eef5;
  --muted: #8fa3b8;
  /* Aliases used by profile/history/secondary controls (must resolve — undefined vars drop backgrounds). */
  --bg-card: var(--panel);
  --fg: var(--text);
  --fg-muted: var(--muted);
  --border: rgba(255, 255, 255, 0.14);
  --accent: #5ec8ff;
  --accent-dim: #2a7aa8;
  --green: #4a9d3a;
  --blue: #3a7bd5;
  --black: #1a1a1a;
  --red: #ff4444;
  --gold: #ffd700;
  --radius: 0.75rem;
  --card-radius: 0.5rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 2.5rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, #16324a 0%, transparent 55%),
    linear-gradient(180deg, #0b1118 0%, #070b10 100%);
  color: var(--text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* Selected-run scenic background (constructs horizontal_rectangle art, panning). */
.run-scene-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease;
}
.run-scene-bg.is-active {
  opacity: 1;
}
.run-scene-bg__pan {
  position: absolute;
  top: -6%;
  left: 0;
  width: 140%;
  height: 112%;
  background-color: #0b1118;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  will-change: transform;
  animation: run-scene-pan 48s ease-in-out infinite alternate;
  /* Dim enough to stay behind UI, but still clearly readable as the run. */
  filter: saturate(0.95) brightness(0.78) contrast(1.05);
}
.run-scene-bg__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 11, 16, 0.22) 0%, rgba(7, 11, 16, 0.38) 45%, rgba(7, 11, 16, 0.58) 100%),
    radial-gradient(ellipse at center, rgba(7, 11, 16, 0.05) 0%, rgba(7, 11, 16, 0.28) 100%);
}
@keyframes run-scene-pan {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-100% + 100vw), 0, 0); }
}
body.has-run-scene {
  background: #070b10;
}
body.has-run-scene #game-root {
  position: relative;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .run-scene-bg__pan {
    animation: none;
    width: 100%;
    left: 0;
    transform: none;
  }
}

/* Native Solo vs AI — step chips + face-down table stacks. */
html.native-shell .native-step-indicator {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.35rem 0.75rem 0.55rem;
  font-size: 0.72rem;
}
html.native-shell .native-step-indicator .step {
  /* Solid black chip — scenic run art must not show through. */
  background: #000;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.18);
  opacity: 1;
  font-weight: 600;
}
html.native-shell .native-step-indicator .step.active {
  background: #000;
  color: var(--accent);
  border-color: var(--accent);
}
html.native-shell .native-step-indicator .step.done {
  background: #000;
  color: #44ff44;
  border-color: #44ff44;
}
html.native-shell .native-table-condition {
  margin: 0.35rem 0.85rem 0.55rem;
  max-width: 26rem;
  width: calc(100% - 1.7rem);
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
html.native-shell .native-table-condition .lineup-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
html.native-shell .native-table-condition .card.micro-card {
  width: min(100%, 18rem);
  max-width: none;
}
html.native-shell .native-table-condition .micro-card-img {
  width: 100%;
  height: auto;
  border-radius: 0.7rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}
html.native-shell .native-table-intro {
  /* Solid black — mustard table texture must not wash out the hint. */
  margin: 0.35rem 1rem 0.75rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #e8eef5;
  line-height: 1.35;
  text-align: center;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.7rem;
  box-sizing: border-box;
}
html.native-shell .native-table-stacks {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 0.15rem 0.75rem 1.6rem;
  max-width: 28rem;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
html.native-shell .native-line-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}
/* Run + face-down line cards side by side (not stacked). */
html.native-shell .native-line-stage {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  min-height: 7.25rem;
}
html.native-shell .native-line-run {
  flex: 0 0 auto;
  width: min(10.5rem, 46%);
  opacity: 0.98;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}
html.native-shell .native-line-run .card.micro-card {
  width: 100%;
}
html.native-shell .native-line-run .micro-card-img {
  width: 100%;
  height: auto;
  border-radius: 0.7rem;
}
html.native-shell .native-line-cards {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
}
html.native-shell .native-line-cards .facedown-fan,
html.native-shell .native-line-cards .facedown-fan-lg {
  /* Width grows with fan count so side-by-side cards stay readable. */
  width: min(100%, calc(3.4rem + (var(--fan-count, 1) * 1.55rem)));
  height: 6.5rem;
  margin: 0;
}
html.native-shell .native-line-cards .facedown-fan-card {
  bottom: 0.15rem;
}
html.native-shell .native-line-cards .card.card-back.small {
  width: 58px;
  min-width: 58px;
  height: 82px;
  padding: 3px;
  border-radius: 0.45rem;
}
html.native-shell .native-line-cards .card.card-back.small .card-back-art {
  border-radius: 0.25rem;
}
html.native-shell .native-line-label {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.85rem;
  border-radius: 0.7rem;
  /* Solid black — scenic / mustard texture must not show through. */
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}
html.native-shell .native-line-player {
  font-size: 1rem;
  font-weight: 800;
}
html.native-shell .native-line-count {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e8eef5;
  background: #000;
  padding: 0.2rem 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
/* Label introduces the line below it — tint ownership before the cards. */
html.native-shell .native-line-stack.is-opponent .native-line-label {
  border-color: rgba(255, 120, 120, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 120, 120, 0.12);
  background: #000;
}
html.native-shell .native-line-stack.is-you .native-line-label {
  border-color: rgba(94, 200, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(94, 200, 255, 0.2);
  background: #000;
}
html.native-shell .native-line-bail-micro {
  width: 100%;
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.45);
}

/* Thumb-zone action bar (phone / native shell) — sits above the score strip */
.mobile-action-bar {
  display: none;
}

@media (max-width: 700px) {
  :root {
    --mobile-action-bar-height: 3.6rem;
    --score-bar-height: 2.75rem;
  }

  body {
    padding-bottom: calc(
      var(--mobile-action-bar-height) + var(--score-bar-height) + env(safe-area-inset-bottom, 0px)
    );
  }

  .mobile-action-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--score-bar-height) + env(safe-area-inset-bottom, 0px));
    z-index: 210;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: var(--mobile-action-bar-height);
    padding: 0.45rem 0.75rem;
    background: rgba(18, 27, 38, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
  }

  .mobile-action-bar .nav-btn {
    flex: 1;
    max-width: 12rem;
    padding: 0.7rem 1rem;
    font-size: 1rem;
  }

  .bottom-score-bar {
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
  }
}

html.native-shell {
  height: 100%;
}
html.native-shell body {
  /* Grow with content so padding-bottom is scrollable clearance under the dock.
     (height:100% + border-box padding left the last hand cards stuck under Send.) */
  min-height: 100%;
  height: auto;
  /* Action dock only — score strip is hidden on native. Extra room for card
     stats / ⓘ on the last hand row above the full-bleed Send/Safe bar. */
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}
/* Run picker (and other screens with no dock) — reclaim the thumb-zone gap. */
html.native-shell body:not(:has(.mobile-action-bar)) {
  padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
}
/* Setup home owns the viewport — no body pad or page scroll clipping Start. */
html.native-shell body:has(.setup-screen-native) {
  min-height: 100%;
  height: 100%;
  padding-bottom: 0;
  overflow: hidden;
}
html.native-shell #game-root:has(.setup-screen-native) {
  height: 100%;
  overflow: hidden;
}
/* End screen owns the viewport so Play Again stays pinned while summaries scroll. */
html.native-shell body:has(.game-end-screen-native) {
  min-height: 100%;
  height: 100%;
  padding-bottom: 0;
  overflow: hidden;
}
html.native-shell #game-root:has(.game-end-screen-native) {
  height: 100%;
  overflow: hidden;
}
/* No debug / problem-report FABs in the native mobile shell. */
html.native-shell #debug-fab,
html.native-shell .report-fab,
html.native-shell #report-problem-btn {
  display: none !important;
}

/* Full-bleed sticky nav on native — edge to edge, roomy inner padding. */
html.native-shell .game-screen,
html.native-shell .game-screen-native {
  max-width: none;
  margin: 0;
  padding: 0;
}
html.native-shell .game-nav {
  max-width: none;
  width: 100%;
  margin: 0 0 0.45rem;
  border-radius: 0;
  background: rgba(18, 27, 38, 0.98);
  backdrop-filter: blur(10px);
  padding: calc(0.45rem + env(safe-area-inset-top, 0px)) 1rem 0.55rem;
}
html.native-shell .game-nav-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
html.native-shell .game-nav-info {
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  overflow: visible;
}
html.native-shell .game-nav-info.is-mc {
  flex-wrap: nowrap;
}
html.native-shell .game-nav-phase {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58%;
  text-align: right;
}
html.native-shell .game-nav-row.game-nav-scores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 1rem;
  padding-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text);
}
html.native-shell .nav-score-player {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  min-width: 0;
}
html.native-shell .nav-score-name {
  font-weight: 700;
  font-size: 0.75rem;
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.native-shell .nav-score-vert {
  display: inline-block;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text);
  transform-origin: center bottom;
}
html.native-shell .nav-score-vert::after {
  content: " ft";
  font-weight: 500;
  font-size: 0.65em;
  color: var(--muted);
  margin-left: 0.1rem;
}
/* Emphasize banked vert after that skier’s resolution result settles. */
html.native-shell .nav-score-vert.nav-score-vert-bump {
  animation: nav-score-vert-bump 0.55s ease-out;
}
@keyframes nav-score-vert-bump {
  0% {
    transform: scale(1);
    color: var(--text);
    text-shadow: none;
  }
  35% {
    transform: scale(1.28);
    color: #fff;
    text-shadow: 0 0 10px rgba(94, 200, 255, 0.85), 0 0 2px rgba(94, 200, 255, 0.6);
  }
  100% {
    transform: scale(1);
    color: var(--text);
    text-shadow: none;
  }
}

/* Level marks: green circle, blue square, black diamond + white border */
.level-mark {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.72rem;
  height: 0.72rem;
  vertical-align: middle;
  box-sizing: border-box;
}
.level-mark-green {
  border-radius: 50%;
  background: #4a9d3a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.level-mark-blue {
  border-radius: 2px;
  background: #3a7bd5;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.level-mark-black {
  width: 0.58rem;
  height: 0.58rem;
  margin: 0 0.08rem;
  background: #0a0a0a;
  border: 1.5px solid #ffffff;
  border-radius: 1px;
  transform: rotate(45deg);
}

html.native-shell .game-nav-row.game-nav-mode {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.72rem;
  padding-top: 0.3rem;
  gap: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
html.native-shell .game-nav-row.game-nav-mode > .mc-pressure {
  flex: 0 0 auto;
  margin-right: auto;
  white-space: nowrap;
}
html.native-shell .game-nav-row.game-nav-mode > .mc-nav-stats {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
  white-space: nowrap;
}
html.native-shell .game-nav-row.game-nav-mode > .mc-nav-stats > span {
  white-space: nowrap;
  flex: 0 0 auto;
}
html.native-shell .game-nav-row.game-nav-mode .player-level-badge {
  font-size: 0.62rem;
  padding: 0.08rem 0.32rem;
  line-height: 1.15;
}
html.native-shell .nav-info-btn {
  margin-left: 0;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid rgba(94, 200, 255, 0.35);
  border-radius: 999px;
  background: rgba(94, 200, 255, 0.12);
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.game-menu-btn {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #e8eef5);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.game-menu-btn:hover,
.game-menu-btn:focus-visible {
  border-color: rgba(94, 200, 255, 0.45);
  background: rgba(94, 200, 255, 0.14);
  color: var(--accent);
  outline: none;
}
.game-menu-fab {
  position: fixed;
  top: calc(0.55rem + env(safe-area-inset-top, 0px));
  right: calc(0.75rem + env(safe-area-inset-right, 0px));
  z-index: 120;
  width: 2.4rem;
  height: 2.4rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  background: rgba(18, 27, 38, 0.92);
}
.game-menu-dialog .game-menu-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.game-menu-dialog .game-menu-pref {
  margin: 0 0 1.1rem;
}
.game-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.game-menu-actions .btn-primary,
.game-menu-actions .btn-secondary {
  width: 100%;
  text-align: center;
}
.game-menu-exit {
  border-color: rgba(255, 107, 107, 0.45) !important;
  color: #ff8f8f !important;
}
/* Primary destructive: solid danger fill + dark label (not red-on-accent blue). */
.btn-primary.game-menu-exit {
  background: #e85a5a;
  color: #0b1118 !important;
  border: none;
}
.btn-primary.game-menu-exit:hover:not(:disabled) {
  background: #f07070;
}
html.native-shell .game-nav-phase {
  max-width: calc(58% - 2.2rem);
}
.nav-info-dialog {
  position: relative;
  width: min(22rem, 92vw);
  max-height: 80vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
  padding: 1.1rem 1rem 1rem;
  color: var(--text);
}
/* Keep the ✕ inside the panel — overflow:auto clips the hanging card-detail close. */
.nav-info-dialog > .card-detail-close {
  top: 0.55rem;
  right: 0.55rem;
}
.nav-info-dialog h3 {
  margin: 0 2rem 0.75rem 0;
  font-size: 1.05rem;
}
.nav-info-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--muted);
}
.nav-info-list strong {
  color: var(--text);
}

/* Line status — multi-section contribution walkthrough */
.nav-info-dialog.lineup-status-dialog {
  display: flex;
  flex-direction: column;
  width: min(26rem, 94vw);
  max-height: min(88vh, 40rem);
  overflow: hidden;
  padding: 0;
}
.lineup-status-chrome {
  position: relative;
  flex: 0 0 auto;
  z-index: 3;
  padding: 1.05rem 1rem 0.7rem;
  background: var(--panel);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem 0.85rem 0 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}
.lineup-status-chrome > .card-detail-close {
  top: 0.55rem;
  right: 0.55rem;
}
.lineup-status-chrome h3 {
  margin: 0 2rem 0.65rem 0;
  font-size: 1.05rem;
}
.lineup-status-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.75rem 1rem 1rem;
}
.lineup-status-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}
.lineup-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.lineup-status-pill.is-good {
  color: #9fe3b0;
  border-color: rgba(159, 227, 176, 0.35);
  background: rgba(46, 125, 70, 0.22);
}
.lineup-status-pill.is-bad {
  color: #ffb4a8;
  border-color: rgba(255, 140, 120, 0.4);
  background: rgba(140, 40, 30, 0.28);
}
.lineup-status-section {
  margin: 0 0 0.95rem;
  padding: 0.7rem 0.65rem 0.55rem;
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.lineup-status-section-head {
  margin: 0 0 0.45rem;
}
.lineup-status-section-head h4 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.lineup-status-section-total {
  color: var(--accent, #f0c75e);
  font-weight: 800;
}
.lineup-status-section-head p,
.lineup-status-section-foot,
.lineup-contrib-empty {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}
.lineup-status-section-foot {
  margin-top: 0.45rem;
}
.lineup-contrib-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.lineup-contrib-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  min-height: 2.6rem;
}
.lineup-contrib-row.is-note {
  opacity: 0.78;
}
.lineup-contrib-micro {
  width: 4.6rem;
  flex: 0 0 auto;
}
.lineup-contrib-micro .card.micro-card {
  width: 4.6rem;
  cursor: pointer;
}
.lineup-contrib-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.6rem;
  min-height: 2.4rem;
  padding: 0.25rem 0.3rem;
  border-radius: 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}
.lineup-contrib-level {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.6rem;
  min-height: 2.4rem;
}
.lineup-contrib-level-dot {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--level-color, #4a9d3a);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.35);
}
.lineup-contrib-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.45rem;
  row-gap: 0.05rem;
  align-items: baseline;
  min-width: 0;
}
.lineup-contrib-delta {
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 2.1rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #9fe3b0;
}
.lineup-contrib-delta.is-neg {
  color: #ffb4a8;
}
.lineup-contrib-delta.is-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.lineup-contrib-delta small {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lineup-contrib-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lineup-contrib-reason {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.25;
}
.lineup-status-flags {
  margin-top: 0.25rem;
}

/* Full-bleed bottom action dock (no side/bottom gaps, covers home indicator). */
html.native-shell .mobile-action-bar {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  z-index: 210;
  align-items: center;
  justify-content: stretch;
  gap: 0.6rem;
  min-height: calc(3.6rem + env(safe-area-inset-bottom, 0px));
  padding: 0.55rem 0.85rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  background: #121b26;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  box-sizing: border-box;
}

html.native-shell .mobile-action-bar .nav-btn {
  flex: 1;
  max-width: none;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
}

html.native-shell .mobile-action-bar .nav-warning {
  flex: 0 0 auto;
  align-self: center;
}
html.native-shell .mobile-action-bar:has(.nav-struggle-note) {
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.35rem 0.6rem;
  min-height: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  padding-top: 0.4rem;
}
html.native-shell .mobile-action-bar .nav-struggle-note {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.15rem 0.25rem 0.05rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #d4a017;
  text-align: center;
  line-height: 1.25;
}
html.native-shell .mobile-action-bar .nav-struggle-note.struggle-note-enter {
  animation: struggle-note-enter 0.55s ease-out;
}
@keyframes struggle-note-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
html.native-shell .mobile-action-bar .nav-struggle-note .nav-change-run {
  font-size: inherit;
  font-weight: 800;
  padding: 0;
  white-space: nowrap;
}
html.native-shell body:has(.nav-struggle-note) {
  padding-bottom: calc(8.1rem + env(safe-area-inset-bottom, 0px));
}

/* Resolution results: Next stays the dominant thumb CTA above line microcards. */
html.native-shell body:has(.native-resolution) {
  padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
}
html.native-shell .native-resolution .mobile-action-bar {
  min-height: calc(4.35rem + env(safe-area-inset-bottom, 0px));
  padding: 0.7rem 0.85rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  background: #0e1620;
  border-top: 1px solid rgba(94, 200, 255, 0.28);
  box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.55);
}
html.native-shell .native-resolution .mobile-action-bar .nav-btn-next {
  padding: 1.05rem 1.2rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 0.75rem;
  box-shadow: 0 4px 18px rgba(94, 200, 255, 0.4);
}
html.native-shell .native-resolution .mobile-action-bar .nav-btn-next.is-skip-anim {
  box-shadow: 0 4px 18px rgba(94, 200, 255, 0.28);
}

#game-root {
  min-height: 100vh;
  padding: 0;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #0b1118;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary:hover:not(:disabled) {
  background: #7dd4ff;
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary.btn-large {
  padding: 1rem 2rem;
  font-size: 1.15rem;
  width: 100%;
  max-width: 400px;
}
.btn-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.btn-link:hover { color: var(--accent); }

/* --- Setup Screen --- */
.setup-screen {
  max-width: 32rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  text-align: center;
}
/* Keep setup controls readable over the random home-screen run art. */
body.has-run-scene .setup-screen .mode-btn.active,
body.has-run-scene .setup-screen .count-btn.active {
  background: rgba(18, 27, 38, 0.92);
}
body.has-run-scene .setup-screen .setup-prefs-btn {
  background: rgba(18, 27, 38, 0.88);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}
body.has-run-scene .setup-screen .setup-prefs-btn:hover,
body.has-run-scene .setup-screen .setup-prefs-btn:focus-visible {
  background: rgba(24, 38, 54, 0.95);
  border-color: rgba(94, 200, 255, 0.45);
  color: var(--accent);
}
/* Native shell: home fills the WebView; main scrolls; footer chrome stays docked. */
.setup-screen-native {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  /* No side/bottom padding — bottom chrome is full-bleed black to the device edge. */
  padding: 0.85rem 0 0;
  overflow: hidden;
}
.setup-screen-native .setup-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 1rem 0.35rem;
}
.setup-screen-native .setup-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.4rem 0 0;
  background: linear-gradient(to top, rgba(6, 10, 16, 0.98) 55%, rgba(6, 10, 16, 0.78) 85%, transparent);
}
.setup-screen-native .setup-footer .btn-primary.btn-large {
  margin: 0 1rem 0.45rem;
  width: calc(100% - 2rem);
  min-height: 3rem;
  padding: 0.85rem 1rem;
}
/* How to Play / History + TM notice: solid black, edge-to-edge under the home indicator. */
.setup-screen-native .setup-footer-meta {
  margin: 0;
  padding: 0.65rem 1.15rem 0.35rem;
  background: #000;
  border-radius: 0;
}
.setup-screen-native .setup-footer-link {
  color: rgba(220, 229, 236, 0.72);
}
.setup-screen-native .setup-footer-link:hover,
.setup-screen-native .setup-footer-link:focus-visible {
  color: rgba(242, 246, 250, 0.95);
}
.setup-screen-native .setup-tm-notice {
  margin: 0;
  padding: 0.15rem 1.15rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  background: #000;
  color: rgba(220, 229, 236, 0.42);
  font-size: 0.58rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0.01em;
}
.setup-top {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  text-align: left;
}
.setup-title-card {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.55rem 0.75rem 0.7rem;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(22, 28, 36, 0.96) 0%, rgba(8, 12, 18, 0.96) 100%);
  border: 1px solid rgba(212, 175, 106, 0.28);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 235, 180, 0.08);
}
.setup-title-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin: 0.55rem 0 0;
}
.setup-prefs-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(220, 229, 236, 0.45);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.setup-prefs-link:hover,
.setup-prefs-link:focus-visible {
  color: rgba(220, 229, 236, 0.85);
  outline: none;
}
.setup-title-gold {
  margin: 0;
  font-size: clamp(1.85rem, 7.5vw, 2.55rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-align: left;
  background:
    linear-gradient(
      185deg,
      #fff6c8 0%,
      #f0d78c 18%,
      #d4af6a 42%,
      #8a6914 58%,
      #f5e2a0 72%,
      #c4a050 88%,
      #6e5210 100%
    );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 236, 170, 0.35)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}
.setup-title-card .setup-tagline {
  display: block;
  max-width: none;
  margin: 0.4rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(242, 246, 250, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.setup-medals-card {
  --rarity: #e8e2d4;
  flex: 0 0 auto;
  width: 7.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  margin: 0;
  padding: 0.45rem 0.4rem 0.5rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--rarity) 42%, rgba(255, 255, 255, 0.12));
  background:
    linear-gradient(180deg, rgba(22, 28, 36, 0.96) 0%, rgba(8, 12, 18, 0.96) 100%);
  color: inherit;
  cursor: pointer;
  font: inherit;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px color-mix(in srgb, var(--rarity) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.setup-medals-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  width: 100%;
}
.setup-featured-medal-pin {
  position: relative;
  width: 4.6rem;
  height: 4.6rem;
  /* Pin art already carries its own rim — no CSS circle/well around it. */
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}
.setup-featured-medal-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  background: transparent;
}
.setup-featured-medal-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
}
.setup-featured-medal-art.is-missing,
.setup-featured-medal-art.is-empty-art {
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 55%),
    #1a1520;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.setup-featured-medal-art.is-missing img {
  display: none;
}
.setup-featured-medal-label {
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--rarity) 92%, #fff);
  background: color-mix(in srgb, var(--rarity) 18%, rgba(8, 12, 18, 0.92));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rarity) 42%, transparent);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
}
.setup-medals-card.rarity-common {
  --rarity: #e8e2d4;
}
.setup-featured-medal-name {
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  color: #f4ead5;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.setup-featured-medal-value {
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--gold, #d4af6a);
  letter-spacing: 0.02em;
}
.setup-medals-points-total {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.setup-medals-card-progress {
  margin-top: 0.08rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(220, 229, 236, 0.62);
  font-variant-numeric: tabular-nums;
}
.setup-medals-card.is-empty {
  opacity: 0.9;
}
.setup-medals-card.is-empty .setup-featured-medal-pin {
  --rarity: rgba(220, 229, 236, 0.45);
  opacity: 0.7;
}
.setup-footer-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}
.setup-footer-meta > :first-child {
  justify-self: start;
}
.setup-footer-meta > :nth-child(2) {
  justify-self: center;
  text-align: center;
}
.setup-footer-meta > :last-child {
  justify-self: end;
  text-align: right;
}
.setup-footer-link {
  margin: 0;
  padding: 0.35rem 0.15rem;
  border: 0;
  background: transparent;
  color: rgba(220, 229, 236, 0.55);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.setup-footer-link:hover,
.setup-footer-link:focus-visible {
  color: rgba(220, 229, 236, 0.9);
  outline: none;
}
a.setup-footer-link {
  color: rgba(220, 229, 236, 0.55);
}
.setup-screen-native .setup-top {
  margin-bottom: 0.7rem;
}
.setup-screen-native .setup-title-gold {
  font-size: clamp(1.7rem, 7vw, 2.25rem);
}
.btc-mode-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.btc-mode-tabs::-webkit-scrollbar { display: none; }
.btc-mode-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(220, 229, 236, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: #dce5ec;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btc-mode-tab.active {
  background: rgba(94, 200, 255, 0.16);
  border-color: rgba(94, 200, 255, 0.55);
  color: #f4ead5;
}
.btc-medal-rarity {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.btc-medal-value {
  font-size: 0.65rem;
  opacity: 0.8;
}
/* Pass & Play options bay (web). Solo expand nests under its mode row. */
.setup-screen-native .setup-mode-options {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-bottom: 0;
  min-height: 0;
}
.setup-screen-native .setup-mode-options:not(:has(.setup-section)) {
  display: none;
}
.setup-screen-native .setup-mode-options > .setup-section {
  margin-bottom: 0.25rem;
}
.setup-screen-native .setup-title-card .setup-tagline {
  font-size: 0.78rem;
}
.setup-screen-native .setup-section {
  margin-bottom: 0.75rem;
}
.setup-screen-native .mode-btn {
  padding: 0.65rem 0.85rem;
}
.setup-screen-native .mode-buttons {
  flex-direction: column;
  gap: 0.7rem;
}
.setup-screen-native .mode-row {
  flex: 0 0 auto;
  width: 100%;
}
.setup-screen-native .mode-start-btn {
  min-height: 2.65rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.95rem;
}
.setup-screen-native .setup-solo-expand .count-btn {
  padding: 0.45rem;
  font-size: 1.15rem;
}
.setup-screen-native .setup-solo-start {
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
}
.setup-screen-native .setup-mc-expand {
  padding: 0.5rem 0.65rem 0.6rem;
}
.setup-screen-native .setup-mc-seed-toggle {
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
}
.game-screen-native .shop-header {
  padding: 0.2rem 0.1rem 0.45rem;
}
.game-screen-native .shop-header h2,
.game-screen-native .shop-marquee-sign h2 {
  font-size: 1.38rem;
}
.game-screen-native .shop-wallet-credits {
  font-size: 1.28rem;
}
.game-screen-native .shop-draw-again {
  min-height: 2.2rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
}
.game-screen-native .shop-draw-again-hint {
  font-size: 0.58rem;
}
.game-screen-native .shop-upgrades-held,
.game-screen-native .shop-passes-held {
  padding: 0.65rem 0.55rem 0.55rem;
}
.game-screen-native .shop-mini-rail {
  font-size: 0.42rem;
}
.game-screen-native .shop-mini-name {
  font-size: 0.58rem;
}
.game-screen-native .shop-mini-card.is-compact .shop-mini-name {
  font-size: 0.48rem;
}
.setup-screen-native .setup-mc-seed-input,
.setup-screen-native .setup-mc-seed-new {
  min-height: 2.25rem;
}
.setup-header h1 {
  margin: 0;
  font-size: clamp(2.5rem, 10vw, 4rem);
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #5ec8ff, #4a9d3a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.setup-tagline {
  display: inline-block;
  max-width: 22rem;
  margin: 0.55rem auto 1.75rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.55rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: #f2f6fa;
  background: rgba(6, 10, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.setup-section {
  margin-bottom: 2rem;
  text-align: left;
}
.setup-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}
/* Keep section titles readable over scenic run-art backgrounds. */
body.has-run-scene .setup-screen .setup-section h2,
.setup-screen-native .setup-section h2 {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 0.45rem;
  color: #7dd4ff;
  background: rgba(6, 10, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.setup-prefs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.setup-prefs-btn:hover,
.setup-prefs-btn:focus-visible {
  color: var(--accent);
  border-color: rgba(94, 200, 255, 0.4);
  background: rgba(94, 200, 255, 0.08);
  outline: none;
}
.prefs-dialog .game-menu-pref:not(.prefs-options-item) + .game-menu-pref:not(.prefs-options-item) {
  margin-top: 0.55rem;
}
.prefs-dialog .prefs-reset-btn {
  width: 100%;
  border-color: rgba(255, 140, 120, 0.45);
  color: #ffd0c4;
}
.pref-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.pref-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.pref-toggle.pref-language {
  flex-wrap: wrap;
  cursor: default;
}
.pref-language-label {
  flex: 1 1 auto;
}
.pref-locale-select {
  min-width: 10rem;
  max-width: 100%;
  margin-left: auto;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #0e1620;
  color: var(--text);
  font: inherit;
  font-weight: 600;
}
.pref-language-block {
  margin: 0 0 0.65rem;
}
.pref-sport-block {
  margin: 0 0 0.75rem;
}
.pref-sport-block .pref-language-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.pref-sport-buttons {
  justify-content: flex-start;
}
.pref-language-help {
  margin: 0.25rem 0 0;
  padding: 0 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  font-weight: 500;
}
/* Settings / in-game menu: sticky head+foot, scrollable toggles (phone + iPad).
   Prefer ~90dvh so language + toggles fit without inner scroll; rem caps were
   forcing a short panel and leftover empty viewport. Scroll remains overflow safety. */
.nav-info-dialog.game-menu-dialog.prefs-dialog {
  display: flex;
  flex-direction: column;
  width: min(22rem, 92vw);
  max-height: 90vh;
  max-height: 90dvh;
  max-height: min(
    90dvh,
    calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1.25rem)
  );
  overflow: hidden;
  padding: 0;
}
.prefs-dialog-head {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 2.75rem 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel);
}
.prefs-dialog-head h3 {
  margin: 0;
  flex: 1 1 auto;
  font-size: 1.05rem;
}
.nav-info-dialog.prefs-dialog > .prefs-dialog-head > .card-detail-close {
  top: 0.65rem;
  right: 0.55rem;
}
.prefs-dialog-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.prefs-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.75rem 1rem 0.55rem;
}
.prefs-dialog-scroll-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.25rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: linear-gradient(to bottom, rgba(14, 22, 32, 0), var(--panel, #0e1620) 85%);
}
.prefs-dialog-scroll-fade.is-visible {
  opacity: 1;
}
.prefs-dialog-body .game-menu-pref:not(.prefs-options-item) {
  margin: 0 0 0.55rem;
}
.prefs-dialog-body .ftue-pref-row:not(.prefs-options-item) {
  margin-top: 0.35rem;
  margin-bottom: 0.15rem;
}
.prefs-options {
  margin: 0.15rem 0 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.prefs-options-summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}
.prefs-options-summary::-webkit-details-marker {
  display: none;
}
.prefs-options-summary::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  margin-top: -0.1rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.prefs-options[open] > .prefs-options-summary::before {
  transform: rotate(45deg);
  margin-top: 0;
}
.prefs-options-summary:hover,
.prefs-options-summary:focus-visible {
  background: rgba(94, 200, 255, 0.06);
  outline: none;
}
.prefs-options-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0 0.25rem;
}
.prefs-options-item.pref-toggle,
.prefs-options-item.game-menu-pref {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0.65rem 0.85rem;
}
.prefs-options-item + .prefs-options-item {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.prefs-options-item.ftue-pref-row {
  margin: 0;
  padding: 0.55rem 0.75rem 0.65rem;
}
.prefs-options-item.ftue-pref-row .btn-secondary {
  width: 100%;
}
.prefs-advanced {
  margin-top: 0.35rem;
  opacity: 0.78;
}
.prefs-advanced > .prefs-options-summary {
  font-size: 0.82rem;
  color: var(--muted);
}
.prefs-mc-seed-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem 0.2rem;
}
.prefs-mc-seed-row .setup-mc-seed-input {
  flex: 1;
  min-width: 0;
}
.prefs-mc-seed-hint {
  margin: 0;
  padding: 0.15rem 0.85rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}
.prefs-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.75rem 0 0.15rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.prefs-links .btn-secondary {
  width: 100%;
}
.prefs-dialog-foot {
  flex: 0 0 auto;
  padding: 0.55rem 1rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel);
  box-shadow: 0 -6px 14px rgba(0, 0, 0, 0.22);
}
.prefs-dialog-foot.game-menu-actions {
  margin-top: 0;
}
.prefs-dialog-foot .btn-primary {
  width: 100%;
}
@media (max-width: 420px) {
  .nav-info-dialog.game-menu-dialog.prefs-dialog {
    width: min(22rem, 94vw);
    max-height: min(
      92dvh,
      calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 0.75rem)
    );
  }
  .prefs-dialog-body .game-menu-pref:not(.prefs-options-item) {
    margin-bottom: 0.45rem;
  }
}
@media (min-width: 768px) {
  .nav-info-dialog.game-menu-dialog.prefs-dialog {
    width: min(24rem, 92vw);
    max-height: min(
      90dvh,
      calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1.5rem)
    );
  }
}
.player-count-buttons {
  display: flex;
  gap: 0.75rem;
}
.count-btn {
  flex: 1;
  padding: 1rem;
  background: var(--panel);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.count-btn.active {
  border-color: var(--accent);
  background: rgba(94,200,255,0.1);
}
.setup-name-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.player-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.setup-name-field input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 1rem;
}
.setup-name-field input:focus {
  outline: none;
  border-color: var(--accent);
}
.setup-rules ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.setup-rules li {
  padding: 0.4rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.setup-rules li strong {
  color: var(--text);
}

/* --- Privacy Screen --- */
.privacy-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}
.privacy-card {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--panel);
  border: 2px solid;
  border-radius: 1rem;
  max-width: 24rem;
}
.privacy-round {
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.privacy-phase {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0 1rem;
}
.privacy-name {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.privacy-instruction {
  color: var(--muted);
  margin: 0.5rem 0 1.5rem;
}

/* --- Game Screen --- */
.game-screen {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem;
}
.game-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.round-info {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.phase-label {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}
.current-player {
  font-weight: 700;
  font-size: 1.1rem;
}

/* --- Condition Bar --- */
.condition-bar {
  margin-bottom: 0.5rem;
}
 .condition-bar .card {
   max-width: 20rem;
 }
.market-reduced-note {
  font-size: 0.75rem;
  color: var(--warn, #e8a060);
  text-align: center;
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.market-empty-draw {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem 0.25rem;
  text-align: center;
}
.market-empty-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.btn-draw-market-run {
  border: none;
  border-radius: 8px;
  background: #2a5a8a;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  cursor: pointer;
}
.btn-draw-market-run:hover {
  background: #1e4569;
}

/* --- Runs --- */
.runs-bar h3, .commit-left h3, .gear-up-section h3, .skills-section h3, .style-choice h3, .equipped-preview h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.runs-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

/* --- Cards --- */
.card {
  width: 145px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: all 0.15s;
  position: relative;
  flex-shrink: 0;
}
.card.small {
  width: 125px;
}
.card.selectable {
  cursor: pointer;
}
.card.selectable:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(94,200,255,0.2);
}
.card.selected {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 0 0 2px var(--accent), 0 4px 12px rgba(94,200,255,0.3);
}
.card-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 80px;
}
.card-type-bar {
  padding: 0.2rem 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  color: #fff;
}
.card-body {
  padding: 0.4rem 0.5rem;
}
.card-name {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.15rem;
}
.card.small .card-name {
  font-size: 0.75rem;
}
.card-subtitle {
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.card-stats {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.2rem;
}
.stat {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,0.3);
  border-radius: 0.3rem;
  padding: 0.15rem 0.3rem;
  text-align: center;
}
.stat-label {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
}
.stat-value {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  word-break: break-word;
}
.stat-mod-star {
  font-size: 0.65em;
  font-weight: 700;
  vertical-align: super;
  margin-left: 1px;
  opacity: 0.8;
  line-height: 1;
}
.card-traits {
  margin-bottom: 0.4rem;
}
.trait {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.15rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.card-flavor {
  font-size: 0.72rem;
  font-style: italic;
  color: rgba(143,163,184,0.7);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 0.3rem;
}
.card-effect {
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.diff-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  z-index: 1;
}
.skill-type-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

/* --- Hand --- */
.hand {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.hand.empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem;
}
.no-skills {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem;
}

/* Disabled (reactive) skill cards — visible but not selectable */
.card.disabled {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.4);
}
.card.disabled .skill-type-badge {
  background: #555 !important;
}

/* Reactive skill prompt (post-crash) */
.reactive-prompt-inline {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.12);
  border: 2px solid var(--accent, #c00);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.reactive-prompt {
  background: rgba(0, 0, 0, 0.08);
  border: 2px solid var(--accent, #c00);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.reactive-prompt-text {
  font-size: 0.9rem;
  flex: 1;
  min-width: 200px;
}
.reactive-cost {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}
.reactive-prompt-buttons {
  display: flex;
  gap: 0.5rem;
}
.nav-btn-primary {
  background: var(--accent, #c00);
  color: #fff;
}
.nav-btn-secondary {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--muted);
}

/* --- Gear Up --- */
.gear-up-section {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.selection-info {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.selection-info strong {
  color: var(--text);
}

/* --- Commit Layout --- */
.commit-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
  .commit-layout {
    grid-template-columns: 1fr;
  }
}
.commit-left, .commit-right {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.5rem;
}
.run-option {
  position: relative;
  margin-bottom: 0.5rem;
}
.run-option.selected .card {
  border-color: var(--accent);
  border-width: 2px;
}
.below-level-warning {
  position: absolute;
  bottom: -1.2rem;
  left: 0;
  font-size: 0.75rem;
  color: #aa8800;
}
.bail-card {
  width: 100%;
  cursor: pointer;
}
.bail-card .card-body {
  text-align: center;
}

/* --- Loadout Preview --- */
.equipped-preview {
  margin-bottom: 1rem;
}
.loadout-cards {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.loadout-stats {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(0,0,0,0.3);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}

/* --- Stat Breakdown Panel --- */
.stat-breakdown-panel {
  background: rgba(0,0,0,0.3);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.stat-label {
  font-weight: 700;
  min-width: 3.5rem;
  color: var(--muted);
}
.stat-math {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  flex-wrap: wrap;
}
.stat-part {
  color: #ccc;
}
.stat-op {
  color: var(--muted);
  font-weight: 700;
}
.stat-total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}
.stat-total.good {
  color: #2ecc71;
}
.stat-total.bad {
  color: #ff6b6b;
}
.stat-target {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.crash-penalty-row {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.stat-hint {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.7;
  margin-top: -0.2rem;
  margin-bottom: 0.3rem;
}

/* --- Style Choice --- */
.style-choice {
  margin-top: 1rem;
}
.style-buttons {
  display: flex;
  gap: 0.75rem;
}
.style-btn {
  flex: 1;
  padding: 0.75rem;
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.style-btn.active {
  border-color: var(--accent);
  background: rgba(94,200,255,0.1);
}
.style-btn-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}
.style-btn-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

/* --- Style Roll Preview --- */
.style-roll-preview {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
}
.srp-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--accent);
}
.srp-mod {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}
.srp-range {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.srp-outcomes {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.srp-outcome {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3rem;
  font-weight: 600;
}
.srp-outcome.crashed { background: rgba(255,60,60,0.2); color: #ff6060; }
.srp-outcome.sketchy { background: rgba(255,180,60,0.2); color: #ffb43c; }
.srp-outcome.clean { background: rgba(60,255,120,0.15); color: #3cff78; }
.srp-outcome.stomped { background: rgba(60,200,80,0.25); color: #3cd24c; }

/* --- Skill bonus indicator --- */
.stat-breakdown.skill-bonus {
  color: #3cff78;
  font-weight: 600;
}

/* --- Action Bar --- */
.action-bar {
  text-align: center;
  padding: 1rem 0 2rem;
}

/* --- Resolution --- */
.resolution-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.resolution-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  flex: 1 1 300px;
  min-width: 280px;
  max-width: 420px;
  background: var(--panel);
  border-radius: var(--radius);
  border-left: 4px solid var(--player-color);
}
.resolution-row.crashed {
  background: rgba(255,68,68,0.08);
}
.resolution-row.stomped {
  background: rgba(255,215,0,0.08);
}
.res-player {
  flex-shrink: 0;
  min-width: 120px;
}
.res-name {
  font-weight: 700;
  font-size: 1rem;
}
.res-run {
  font-size: 0.85rem;
  color: var(--muted);
}
.res-skills {
  margin-top: 0.3rem;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.res-skill-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  background: rgba(94,200,255,0.15);
  color: var(--accent);
  border: 1px solid rgba(94,200,255,0.2);
}
.res-detail {
  flex: 1;
}
.res-result {
  font-size: 0.9rem;
}
.res-result.crashed { color: var(--red); }
.res-result.stomped { color: var(--gold); }
.res-result.clean { color: #44ff44; }
.res-result.struggle { color: #aa8800; }
.res-score {
  text-align: center;
  min-width: 60px;
}
.res-score-value {
  font-size: 1.5rem;
  font-weight: 800;
}
.res-score-label {
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- Dice --- */
.dice-roll {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}
.die {
  width: 32px;
  height: 32px;
  background: #fff;
  color: #0b1118;
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
}
.die-face {
  width: 2.75rem;
  height: 2.75rem;
  background: linear-gradient(145deg, #fffdf8 0%, #f0e6d4 100%);
  color: #1a2430;
  border-radius: 0.55rem;
  box-shadow:
    inset 0 0 0 2px rgba(26, 36, 48, 0.85),
    0 3px 10px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-areas:
    "p1 p2 p3"
    "p4 p5 p6"
    "p7 p8 p9";
  padding: 0.32rem;
  flex-shrink: 0;
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}
/* Keep-highest discard (Commit: 3d6 keep 2) — dim the dropped die */
.die-face.is-discarded,
.die-slot.is-discarded {
  opacity: 0.32;
  filter: grayscale(0.45);
}
.die-slot.is-discarded {
  transform: scale(0.92);
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}
.die-slot.is-discarded .die-face,
.die-slot.is-discarded .die-cube,
.die-slot.is-discarded .die-shadow {
  opacity: 1; /* parent owns the dim so nested faces don't double-fade */
  filter: none;
}
.die-pip {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #1a2430;
  justify-self: center;
  align-self: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.die-slot {
  display: inline-flex;
  --die-size: 2.75rem;
  --die-radius: calc(var(--die-size) / 2);
}
.die-stage {
  position: relative;
  width: var(--die-size);
  height: var(--die-size);
  perspective: 520px;
  perspective-origin: 50% 40%;
}
.die-cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.die-cube-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-areas:
    "p1 p2 p3"
    "p4 p5 p6"
    "p7 p8 p9";
  padding: 0.32rem;
  background:
    linear-gradient(145deg, #fffdf8 0%, #f0e6d4 62%, #e2d4bc 100%);
  border-radius: 0.48rem;
  box-shadow:
    inset 0 0 0 2px rgba(26, 36, 48, 0.88),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.die-cube-f1 { transform: rotateY(0deg) translateZ(var(--die-radius)); }
.die-cube-f6 { transform: rotateY(180deg) translateZ(var(--die-radius)); }
.die-cube-f3 { transform: rotateY(90deg) translateZ(var(--die-radius)); }
.die-cube-f4 { transform: rotateY(-90deg) translateZ(var(--die-radius)); }
.die-cube-f2 { transform: rotateX(90deg) translateZ(var(--die-radius)); }
.die-cube-f5 { transform: rotateX(-90deg) translateZ(var(--die-radius)); }

.die-cube.is-rolling {
  animation: die-cube-roll 0.55s linear infinite;
}
.die-slot:nth-child(2) .die-cube.is-rolling {
  animation-duration: 0.48s;
  animation-direction: reverse;
}
.die-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -0.35rem;
  height: 0.45rem;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45) 0%, transparent 72%);
  transform: scaleX(1);
  opacity: 0.75;
  pointer-events: none;
}
.die-cube.is-rolling + .die-shadow {
  animation: die-shadow-pulse 0.55s ease-in-out infinite;
}
.die-slot:nth-child(2) .die-cube.is-rolling + .die-shadow {
  animation-duration: 0.48s;
  animation-direction: reverse;
}

/* Settle so the rolled face points at the camera. */
.die-cube.is-settled {
  transition: transform 0.38s cubic-bezier(0.18, 1.25, 0.32, 1);
}
.die-cube.is-settled[data-show="1"] { transform: rotateX(0deg) rotateY(0deg); }
.die-cube.is-settled[data-show="2"] { transform: rotateX(-90deg) rotateY(0deg); }
.die-cube.is-settled[data-show="3"] { transform: rotateX(0deg) rotateY(-90deg); }
.die-cube.is-settled[data-show="4"] { transform: rotateX(0deg) rotateY(90deg); }
.die-cube.is-settled[data-show="5"] { transform: rotateX(90deg) rotateY(0deg); }
.die-cube.is-settled[data-show="6"] { transform: rotateX(0deg) rotateY(180deg); }
.die-cube.is-landing + .die-shadow {
  animation: die-shadow-land 0.38s cubic-bezier(0.18, 1.25, 0.32, 1);
}

@keyframes die-cube-roll {
  0% {
    transform: translateY(0) rotateX(12deg) rotateY(-18deg) rotateZ(8deg);
  }
  20% {
    transform: translateY(-14px) rotateX(140deg) rotateY(96deg) rotateZ(-40deg);
  }
  40% {
    transform: translateY(-2px) rotateX(268deg) rotateY(210deg) rotateZ(55deg);
  }
  60% {
    transform: translateY(-16px) rotateX(400deg) rotateY(300deg) rotateZ(-25deg);
  }
  80% {
    transform: translateY(-4px) rotateX(520deg) rotateY(410deg) rotateZ(70deg);
  }
  100% {
    transform: translateY(0) rotateX(612deg) rotateY(522deg) rotateZ(8deg);
  }
}
@keyframes die-shadow-pulse {
  0%, 100% { transform: scaleX(1); opacity: 0.7; }
  40% { transform: scaleX(0.62); opacity: 0.35; }
  70% { transform: scaleX(0.85); opacity: 0.55; }
}
@keyframes die-shadow-land {
  0% { transform: scaleX(0.7); opacity: 0.4; }
  55% { transform: scaleX(1.15); opacity: 0.85; }
  100% { transform: scaleX(1); opacity: 0.7; }
}
.dice-mod {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.dice-mod-part {
  background: rgba(255,255,255,0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}
.dice-mod-part.negative {
  color: var(--red);
}
.dice-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-left: 0.25rem;
}
.dice-total-uncapped {
  color: var(--muted);
  font-weight: 600;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.dice-total-capped {
  color: var(--accent);
  font-weight: 700;
}

/* Native resolution — result first, then dice/calc, then microcards */
html.native-shell .resolution-list-native {
  display: block;
  margin: 0;
}
html.native-shell .native-res-row {
  max-width: none;
  min-width: 0;
  margin: 0.35rem 0.45rem 0.75rem;
  padding: 0;
  background: transparent;
  border-left: none;
  gap: 0.45rem;
}
html.native-shell .native-res-hero {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  background: rgba(18, 27, 38, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html.native-shell .native-res-player {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
}
html.native-shell .native-res-player-level {
  display: inline-flex;
  align-items: center;
}
html.native-shell .native-res-player-level .level-mark {
  width: 0.85rem;
  height: 0.85rem;
}
html.native-shell .native-res-player-level .level-mark-black {
  width: 0.7rem;
  height: 0.7rem;
}
html.native-shell .native-res-hero.did-level-up .native-res-player-level .level-mark {
  box-shadow: 0 0 0 2px rgba(212, 175, 106, 0.85), 0 0 12px rgba(212, 175, 106, 0.45);
}
html.native-shell .native-res-hero.is-you {
  border-color: rgba(94, 200, 255, 0.35);
}
html.native-shell .native-res-loadout.is-collapsed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: calc(100% - 0.9rem);
  margin: 0.15rem 0.45rem 0.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  font: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
html.native-shell button.native-res-loadout.is-collapsed {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html.native-shell button.native-res-loadout.is-collapsed:active {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(94, 200, 255, 0.35);
}
html.native-shell .native-res-loadout.is-collapsed .play-loadout-label {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #e8eef5;
}
html.native-shell .native-res-expand-hint {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(94, 200, 255, 0.95);
}
html.native-shell .native-res-loadout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin: 0 0 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
html.native-shell .native-res-loadout-head .play-loadout-label {
  margin: 0;
}
html.native-shell .native-res-outcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
html.native-shell .native-res-outcome-label {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
html.native-shell .native-res-hero.stomped .native-res-outcome-label { color: var(--gold, #f0c040); }
html.native-shell .native-res-hero.clean .native-res-outcome-label { color: #6bc45a; }
html.native-shell .native-res-hero.sketchy .native-res-outcome-label { color: #f0c040; }
html.native-shell .native-res-hero.crashed .native-res-outcome-label { color: #ff6b6b; }
html.native-shell .native-res-hero.struggle .native-res-outcome-label { color: #d4a017; }
html.native-shell .native-res-hero.blocked .native-res-outcome-label,
html.native-shell .native-res-hero.bail .native-res-outcome-label { color: var(--muted); }
/* Pass remap (Send It Bro): keep the rolled band struck, show the counted band. */
html.native-shell .native-res-outcome-was {
  text-decoration: line-through;
  text-decoration-thickness: 0.12em;
  opacity: 0.55;
  margin-right: 0.15em;
}
html.native-shell .native-res-hero.pass-shifted-clean .native-res-outcome-now {
  color: #6bc45a;
}
html.native-shell .native-res-hero.pass-shifted-stomped .native-res-outcome-now {
  color: var(--gold, #f0c040);
}
html.native-shell .native-res-score-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  min-width: 0;
}
html.native-shell .native-res-outcome-score {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.1;
}
html.native-shell .native-res-outcome-score small {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
html.native-shell .native-res-score-calc {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.2;
}
html.native-shell .native-res-runline {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}
html.native-shell .native-res-calc {
  margin: 0;
}
html.native-shell .native-res-narrative {
  display: block;
  margin: 0.25rem 0.45rem 0.35rem;
  padding: 0.65rem 0.8rem 0.75rem;
  border-radius: 0.7rem;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
html.native-shell .native-res-narrative-title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(212, 175, 106, 0.95);
}
html.native-shell .native-res-narrative-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(232, 238, 245, 0.92);
}
html.native-shell .native-res-narrative.is-ready {
  opacity: 1;
  transform: translateY(0);
}
html.native-shell .native-res-narrative.is-loading {
  opacity: 1;
  transform: translateY(0);
}
html.native-shell .native-res-narrative.is-loading .native-res-narrative-text {
  opacity: 0.6;
  font-style: italic;
  font-weight: 500;
  color: rgba(232, 238, 245, 0.7);
}
html.native-shell .native-res-narrative.is-idle {
  display: none;
}
html.native-shell .native-res-calc-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  margin-bottom: 0;
}
html.native-shell .native-res-calc-head .native-readout-info {
  margin-left: auto;
  flex-shrink: 0;
}
html.native-shell .native-res-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
html.native-shell .native-res-eq-part {
  white-space: nowrap;
  color: var(--text);
}
html.native-shell .native-res-eq-part.neg {
  color: #ff8a8a;
}
html.native-shell .native-res-eq-part small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.12rem;
}
html.native-shell .native-res-eq-eq {
  color: var(--muted);
  font-weight: 700;
}
html.native-shell .native-res-eq-total {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}
html.native-shell .native-res-eq-uncapped {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.55);
}
html.native-shell .native-res-dice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
}
html.native-shell .native-res-dice .die-face,
html.native-shell .native-res-dice .die-slot {
  --die-size: 3.25rem;
}
html.native-shell .native-res-dice .die-face {
  width: var(--die-size);
  height: var(--die-size);
}
html.native-shell .native-res-dice {
  gap: 0.85rem;
  min-height: 3.7rem;
  align-items: flex-end;
  padding-bottom: 0.35rem;
}
html.native-shell .native-res-outcome-label.is-indeterminate {
  filter: blur(7px);
  opacity: 0.55;
  letter-spacing: 0.18em;
  user-select: none;
}
html.native-shell .native-res-score-stack.is-pending,
html.native-shell .native-res-calc.is-pending .native-res-equation {
  filter: blur(5px);
  opacity: 0.4;
  user-select: none;
  pointer-events: none;
}
html.native-shell .native-res-hero.is-rolling {
  border-color: rgba(94, 200, 255, 0.35);
}
html.native-shell .reactive-prompt-inline.is-anim-hidden {
  display: none;
}
html.native-shell .nav-btn.is-skip-anim {
  background: rgba(94, 200, 255, 0.18);
  border-color: rgba(94, 200, 255, 0.45);
}
.nav-info-subhead {
  margin: 1rem 0 0.55rem;
  font-size: 0.95rem;
}
html.native-shell .native-res-loadout {
  margin: 0.15rem 0 0;
}
html.native-shell .native-res-loadout:not(.is-collapsed) {
  margin: 0.15rem 0.45rem 0.35rem;
  padding: 0.45rem 0.55rem 0.55rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
html.native-shell .native-res-loadout .play-micro-slot {
  cursor: default;
}
html.native-shell .native-res-loadout .micro-card.is-inspectable,
html.native-shell .native-res-pass-slot {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html.native-shell .native-res-loadout .micro-card.is-inspectable:active,
html.native-shell .native-res-pass-slot:active {
  transform: scale(0.98);
  opacity: 0.92;
}
html.native-shell button.native-res-pass-slot {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
}
.held-pass-dialog .held-pass-hero {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  align-items: stretch;
  margin-top: 0.35rem;
  border-radius: 0.7rem;
  overflow: hidden;
  background: #121a24;
  border: 1.5px solid var(--pass-accent, rgba(255, 255, 255, 0.18));
}
.held-pass-dialog .held-pass-hero-art {
  width: 100%;
  height: 100%;
  min-height: 5.5rem;
  object-fit: cover;
  display: block;
  background: #0f1620;
}
.held-pass-dialog .held-pass-hero-copy {
  padding: 0.65rem 0.7rem 0.7rem 0;
  min-width: 0;
}
.held-pass-dialog .held-pass-type {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pass-accent, #7ababa);
}
.held-pass-dialog .held-pass-name {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #f4ead5;
  line-height: 1.15;
}
.held-pass-dialog .held-pass-effect {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(232, 238, 245, 0.92);
}
.held-pass-dialog .held-pass-note {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(232, 238, 245, 0.55);
}
html.native-shell .native-res-passes {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
html.native-shell .native-res-passes-label {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(212, 175, 106, 0.95);
}
html.native-shell .native-res-loadout .play-loadout-chips {
  column-gap: 0.75rem;
  row-gap: 0.55rem;
}
html.native-shell .native-res-pass-chips {
  grid-template-columns: 1fr 1fr;
}
html.native-shell .native-res-pass-slot .micro-card {
  width: 100%;
}
html.native-shell .native-resolution .scoreboard-mini {
  display: none;
}

/* --- Scoreboard --- */
.scoreboard-mini, .final-scoreboard {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.score-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.score-row:last-child { border-bottom: none; }
.score-row.winner {
  font-size: 1.1rem;
}
.score-rank {
  width: 30px;
  text-align: center;
}
.score-name {
  flex: 1;
  font-weight: 700;
}
.score-level {
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
}
.score-vert {
  font-weight: 800;
  font-size: 1.1rem;
  color: #f5f8fc;
}

/* --- Game End --- */
.game-end-screen {
  position: relative;
  max-width: 36rem;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 4rem;
  text-align: center;
}
/* Pin the result chrome so Play Again stays visible while recap content scrolls. */
html:has(.game-end-screen .end-main),
html:has(.game-end-screen .end-main) body {
  height: 100%;
  overflow: hidden;
}
html:has(.game-end-screen .end-main) body {
  padding-bottom: 0;
}
#game-root:has(.game-end-screen .end-main) {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}
.game-end-screen:has(.end-main),
.game-end-screen-native {
  max-width: 36rem;
  height: 100%;
  min-height: 100%;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.game-end-screen-native {
  max-width: none;
}
.game-end-screen .end-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2.75rem 1.1rem 1rem;
  padding-top: calc(2.5rem + env(safe-area-inset-top, 0px));
}
.game-end-screen .end-footer.action-bar {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0;
  padding: 0.55rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(11, 17, 24, 0.92), #0b1118 35%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.game-end-screen .end-footer .btn-primary,
.game-end-screen .end-footer .btn-secondary {
  width: 100%;
  max-width: none;
  margin: 0;
}
.game-end-screen .end-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.1rem 0;
  padding: 0.05rem 0 0.1rem;
}
.game-end-screen .end-link-btn {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0.4rem 0.7rem;
  background: transparent;
  border: none;
  color: #9ec9e8;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
.game-end-screen .end-link-btn:hover,
.game-end-screen .end-link-btn:focus-visible {
  color: #c7e7ff;
  outline: none;
}
.game-end-screen .end-link-btn + .end-link-btn {
  border-left: 1px solid rgba(232, 238, 245, 0.22);
}
.game-end-screen .end-result-card .winner-vert {
  margin-bottom: 0.15rem;
}
.end-run-recap {
  margin: 0.85rem auto 0.25rem;
  width: min(100%, 24rem);
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(10, 16, 24, 0.92);
  border: 1px solid rgba(212, 175, 106, 0.28);
  text-align: left;
}
.end-run-recap h3 {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold, #d4af6a);
}
.end-run-recap-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #eaf1f8;
  font-weight: 600;
}
.end-run-recap-text.is-loading {
  opacity: 0.65;
  font-style: italic;
  font-weight: 500;
}
.turn-summaries {
  margin: 0.85rem auto 0.25rem;
  width: min(100%, 24rem);
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}
.turn-summaries h3 {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold, #d4af6a);
}
.turn-summaries-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.turn-summary-item {
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.turn-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(232, 238, 245, 0.65);
}
.turn-summary-item.crashed .turn-summary-meta {
  color: rgba(255, 107, 107, 0.9);
}
.turn-summary-item.stomped .turn-summary-meta {
  color: rgba(240, 192, 64, 0.95);
}
.turn-summary-item.clean .turn-summary-meta {
  color: rgba(107, 196, 90, 0.95);
}
.turn-summary-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(232, 238, 245, 0.92);
}
.history-detail .turn-summaries {
  width: 100%;
  margin: 0.75rem 0 1rem;
}
.end-home-btn {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  z-index: 2;
  margin: 0;
  padding: 0.45rem 0.75rem;
  background: #0a1018;
  color: #f5f8fc;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.end-home-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
html.native-shell .end-home-btn {
  top: calc(0.35rem + env(safe-area-inset-top, 0px));
  left: max(0.75rem, env(safe-area-inset-left, 0px));
}
.setup-screen:has(.end-home-btn) {
  position: relative;
  padding-top: 2.75rem;
}
.setup-screen-native:has(.end-home-btn) {
  padding-top: calc(2.25rem + env(safe-area-inset-top, 0px));
}
.history-page .action-bar,
.history-detail .action-bar,
.deck-explore-page .action-bar,
.howto-page .action-bar {
  text-align: center;
  padding: 1rem 0 0.5rem;
}
.history-page .action-bar .btn-secondary,
.history-detail .action-bar .btn-secondary,
.deck-explore-page .action-bar .btn-secondary,
.howto-page .action-bar .btn-secondary {
  margin-top: 0.5rem;
}
.game-end-screen .action-bar .btn-primary.btn-large {
  margin-bottom: 0;
  padding: 0.85rem 1.25rem;
  font-size: 1.05rem;
}
.end-header h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
  margin: 0;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.9);
}
.winner-banner {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 1rem 0 0.25rem;
}
.game-end-screen .end-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}
/* Solid opaque card — scenic mountain art must not show through result text. */
.game-end-screen .end-result-card {
  width: min(100%, 22rem);
  margin: 0 auto;
  padding: 0.85rem 1rem 1rem;
  border-radius: 0.75rem;
  background: #0a1018;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.game-end-screen .end-result-card.is-win {
  background: #0b1a14;
  border-color: rgba(140, 230, 170, 0.4);
}
.game-end-screen .end-result-card.is-loss {
  background: #1a1210;
  border-color: rgba(255, 180, 150, 0.35);
}
.end-safari-hero {
  width: min(100%, 22rem);
  margin: 0 auto 0.2rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #1a140c;
  border: 2px solid rgba(212, 175, 106, 0.55);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.end-safari-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.end-safari-hero figcaption {
  margin: 0;
  padding: 0.45rem 0.75rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0c040;
  background: #120e0a;
}
.game-end-screen.is-mc-safari .end-header h1,
.game-end-screen.is-mc-summit .end-header h1,
.game-end-screen.is-mc-flame .end-header h1,
.game-end-screen.is-btc-win .end-header h1,
.game-end-screen.is-btc-miss .end-header h1 {
  color: #f0c040;
  text-shadow: 0 2px 18px rgba(240, 192, 64, 0.35), 0 0 2px rgba(0, 0, 0, 0.9);
}
.game-end-screen .end-result-msg {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  color: #f5f8fc;
  margin: 0 0 0.35rem;
}
.game-end-screen .end-result-card.is-win .end-result-msg {
  color: #d4ffe0;
}
.game-end-screen .end-result-card.is-loss .end-result-msg {
  color: #ffe0d4;
}
.game-end-screen .end-result-meta {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  font-style: normal;
  color: #e8eef5;
}
.game-end-screen .end-result-card .winner-vert {
  margin: 0.15rem 0 0.2rem;
  text-shadow: none;
}
.game-end-screen .end-result-card .mc-score-breakdown {
  margin: 0.65rem 0 0.35rem;
  background: rgba(0, 0, 0, 0.28);
}
.game-end-screen .final-scoreboard,
.game-end-screen .log {
  background: #0a1018;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}
.game-end-screen .score-name {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}
.game-end-screen .winner-vert {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.9);
}
/* Force readable log colors over scenic backgrounds / player classes. */
.game-end-screen .log-entry,
.game-end-screen .log-entry.info,
.game-end-screen .log-entry.commit,
.game-end-screen .log-entry.condition {
  color: #eaf1f8 !important;
  font-weight: 600;
}
.game-end-screen .log-entry.system {
  color: #b6e7ff !important;
  font-weight: 700;
}
.game-end-screen .log-entry.resolve {
  color: #ffffff !important;
  font-weight: 700;
}
.game-end-screen .log-entry.level {
  color: #9dffad !important;
}
.game-end-screen .game-log h3 {
  color: #eaf1f8;
}
.game-end-screen .action-bar .btn-secondary {
  color: #f5f8fc;
  background: #0a1018;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
/* Legacy class names still used elsewhere — keep readable if they appear. */
.game-end-screen .winner-banner,
.game-end-screen .btc-target-info,
.game-end-screen .btc-rounds-info {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-style: normal;
  color: #f5f8fc !important;
  background: #0a1018;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.winner-vert {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 2rem;
}
.mc-score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 18rem;
  margin: 1rem auto 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  background: rgba(18, 27, 38, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}
.mc-score-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.mc-score-row strong {
  color: var(--text);
  font-weight: 800;
}
.mc-score-row.mc-score-total {
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.05rem;
  color: var(--text);
}
.mc-score-row.mc-score-total strong {
  color: var(--gold);
  font-size: 1.35rem;
}
.mc-final-score-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin: 1.25rem 0 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(240, 192, 64, 0.35);
}
.mc-final-score-footer > span:first-child {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.mc-final-score-footer strong {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.1;
}
.mc-final-score-parts {
  font-size: 0.82rem;
  color: var(--muted);
}
.setup-history-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}
.setup-history-hint {
  font-size: 0.72rem;
  color: var(--muted);
}
.setup-medals-entry {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  margin-left: auto;
}
.setup-medals-entry-label {
  font-weight: 700;
}
.setup-medals-entry-counts {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold, #d4af6a);
  font-variant-numeric: tabular-nums;
}
.btc-points-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  width: 100%;
  margin: 0.85rem 0 0.45rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 106, 0.35);
  background:
    linear-gradient(180deg, rgba(40, 32, 18, 0.92) 0%, rgba(14, 18, 24, 0.94) 100%);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.btc-points-total:hover,
.btc-points-total:focus-visible {
  border-color: rgba(212, 175, 106, 0.65);
  outline: none;
}
.btc-points-total.is-active {
  border-color: rgba(94, 200, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(94, 200, 255, 0.22);
}
.btc-points-total-num {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--gold, #d4af6a);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.btc-points-total-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(242, 230, 196, 0.7);
}
.btc-points-total-hint {
  margin-top: 0.1rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(220, 229, 236, 0.5);
}
.btc-progress-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0 0 0.25rem;
}
.btc-progress-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(220, 229, 236, 0.16);
  background: rgba(15, 24, 32, 0.9);
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.btc-progress-pill.active {
  border-color: rgba(212, 175, 106, 0.55);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 106, 0.25);
}
.btc-progress-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--gold, #d4af6a);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.btc-progress-label {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.8;
}
.btc-earned-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
}
.btc-earned-sort-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-right: 0.15rem;
}
.btc-earned-sort-btn {
  border: 1px solid rgba(220, 229, 236, 0.2);
  background: transparent;
  color: #dce5ec;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btc-earned-sort-btn.active {
  background: rgba(212, 175, 106, 0.18);
  border-color: rgba(212, 175, 106, 0.55);
  color: #f4ead5;
}
.btc-medal-earned-at {
  margin-top: 0.15rem;
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.65;
  line-height: 1.2;
}
.btc-earned-empty-wrap {
  padding: 0.35rem 0 0.15rem;
}
.btc-earned-empty {
  margin: 0.35rem 0 0;
  padding: 1rem 0.85rem;
  border-radius: 10px;
  border: 1px dashed rgba(220, 229, 236, 0.22);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(220, 229, 236, 0.75);
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}
.btc-challenge-select-screen .btc-challenge-buttons {
  max-height: none;
}
.history-page,
.history-detail {
  text-align: left;
}

/* === Secondary pages (Explore Deck, History, How to Play) === */
.secondary-page-screen.setup-screen,
.deck-explore-screen.setup-screen {
  max-width: 36rem;
}
.secondary-page-screen.setup-screen-native,
.deck-explore-screen.setup-screen-native {
  padding: 0;
}
.deck-explore-nav {
  flex: 0 0 auto;
  z-index: 6;
  padding: 0.55rem 1rem 0.55rem;
  background: rgba(6, 10, 16, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: left;
}
html.native-shell .deck-explore-nav {
  padding-top: calc(0.45rem + env(safe-area-inset-top, 0px));
}
.secondary-page-screen:not(.setup-screen-native),
.deck-explore-screen:not(.setup-screen-native) {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
}
.secondary-page-screen:not(.setup-screen-native) .deck-explore-nav,
.deck-explore-screen:not(.setup-screen-native) .deck-explore-nav {
  position: sticky;
  top: 0;
}
.deck-explore-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}
.deck-explore-nav:not(:has(.deck-explore-toc)) .deck-explore-nav-bar {
  margin-bottom: 0;
}
.deck-explore-home {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #0a1018;
  color: #f5f8fc;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.deck-explore-home:hover,
.deck-explore-home:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.deck-explore-nav-title {
  min-width: 0;
  flex: 1 1 auto;
}
.deck-explore-nav-title h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #f4f7fa;
  line-height: 1.15;
}
.deck-explore-nav-title p {
  margin: 0.12rem 0 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(220, 229, 236, 0.58);
}
.deck-explore-toc {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0 0 0.1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.deck-explore-toc::-webkit-scrollbar {
  display: none;
}
.deck-explore-toc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--card-color) 55%, transparent);
  background: color-mix(in srgb, var(--card-color) 18%, rgba(8, 12, 18, 0.85));
  color: #f2f5f8;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  opacity: 0.82;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.deck-explore-toc-link span {
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.deck-explore-toc-link.is-active {
  opacity: 1;
  border-color: color-mix(in srgb, var(--card-color) 85%, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-color) 45%, transparent);
  background: color-mix(in srgb, var(--card-color) 32%, rgba(8, 12, 18, 0.9));
}
.deck-explore-page,
.secondary-page-body {
  text-align: left;
  padding: 0.85rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
.secondary-page-screen.setup-screen-native .secondary-page-body.setup-main,
.deck-explore-screen.setup-screen-native .deck-explore-page.setup-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.85rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
/* How to Play: opaque near-black panel so copy stays readable over scenic run art. */
.howto-screen.setup-screen,
.howto-screen.setup-screen-native {
  background: #000;
}
.howto-screen .deck-explore-nav {
  background: #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.howto-screen .howto-page.secondary-page-body {
  background: #000;
  color: #f2f5f8;
}
.howto-section {
  margin-bottom: 1.5rem;
  scroll-margin-top: 0.5rem;
}
.howto-section-lead {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(220, 229, 236, 0.78);
}
.howto-tip-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.howto-tip {
  margin: 0;
  padding: 0.8rem 0.9rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid color-mix(in srgb, var(--card-color) 80%, #fff);
  background: #0a0c10;
}
.howto-tip-head {
  margin: 0 0 0.4rem;
  padding: 0 0 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--card-color) 55%, transparent);
}
.howto-tip-head h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f4f7fa;
}
.howto-section-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(232, 238, 244, 0.94);
}
.howto-section-body strong {
  color: #f4ead5;
}
.howto-actions {
  margin: 1rem 0 0.25rem;
}
.howto-actions .btn-secondary {
  width: 100%;
  background: #0a0c10;
  border-color: rgba(255, 255, 255, 0.22);
  color: #f2f5f8;
}
.howto-screen .action-bar .btn-secondary {
  background: #0a0c10;
  border-color: rgba(255, 255, 255, 0.22);
  color: #f2f5f8;
}
.deck-explore-group {
  margin-bottom: 1.35rem;
  scroll-margin-top: 0.5rem;
}
.deck-explore-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.65rem;
  padding: 0.35rem 0.15rem 0.45rem;
  border-bottom: 2px solid color-mix(in srgb, var(--card-color) 70%, transparent);
}
.deck-explore-group-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f4f7fa;
}
.deck-explore-group-head span {
  font-size: 0.78rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--card-color) 85%, #fff);
  font-variant-numeric: tabular-nums;
}
.deck-explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.7rem 0.55rem;
}
.deck-explore-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.deck-explore-card-img {
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  object-fit: contain;
  border-radius: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 10px 18px rgba(0, 0, 0, 0.35);
  background: #121820;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.deck-explore-card:hover .deck-explore-card-img,
.deck-explore-card:focus-visible .deck-explore-card-img {
  transform: translateY(-3px) rotate(-0.6deg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 6px 12px rgba(0, 0, 0, 0.4),
    0 16px 28px rgba(0, 0, 0, 0.35),
    0 0 0 2px color-mix(in srgb, var(--card-color) 65%, transparent);
}
.deck-explore-card:focus-visible {
  outline: none;
}
.deck-explore-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0 0.1rem;
}
.deck-explore-card-type {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--card-color) 80%, #fff);
}
.deck-explore-card-name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  color: rgba(242, 246, 250, 0.92);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.deck-explore-page .action-bar {
  margin-top: 0.5rem;
}
@media (max-width: 420px) {
  .deck-explore-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem 0.4rem;
  }
  .deck-explore-card-name {
    font-size: 0.66rem;
  }
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .deck-explore-toc-link {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(12, 16, 22, 0.85);
  }
  .deck-explore-toc-link.is-active {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(28, 38, 52, 0.95);
    box-shadow: none;
  }
  .deck-explore-group-head {
    border-bottom-color: rgba(255, 255, 255, 0.22);
  }
  .deck-explore-group-head span,
  .deck-explore-card-type {
    color: rgba(220, 229, 236, 0.75);
  }
}
.history-row {
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
/* History: opaque near-black panel so list/nav stay readable (same treatment as How to Play). */
.history-screen.setup-screen,
.history-screen.setup-screen-native {
  background: #000;
}
.history-screen .deck-explore-nav {
  background: #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.history-screen .history-page.secondary-page-body,
.history-screen .history-detail.secondary-page-body {
  background: #000;
  color: #f2f5f8;
}
.history-screen .history-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.history-screen .history-row.profile-game-row {
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f2f5f8;
}
.history-screen .history-row .game-mode-label,
.history-screen .history-row .game-vert {
  color: #f2f5f8;
}
.history-screen .history-row .game-row-details {
  color: rgba(220, 229, 236, 0.72);
}
.history-screen .profile-empty {
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(220, 229, 236, 0.78);
}
.history-screen .action-bar .btn-secondary {
  background: #0a0c10;
  border-color: rgba(255, 255, 255, 0.22);
  color: #f2f5f8;
}
/* History mode chips are <button>s — keep them pill-sized like Explore Deck <a> chips. */
.history-screen .deck-explore-toc-link {
  width: auto;
  max-width: none;
  box-sizing: border-box;
}
.history-screen .history-detail h3 {
  margin: 0.85rem 0 0.55rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.4rem;
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f2f5f8;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.history-screen .mc-score-breakdown {
  background: #0a0c10;
  border-color: rgba(255, 255, 255, 0.14);
}
.history-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.8rem;
}
.history-detail .btc-new-pins {
  margin: 0 0 1.1rem;
}
.history-pins-missing {
  margin: 0 0 1rem;
  font-size: 0.82rem;
}
.history-detail-meta > span {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 0.4rem;
  color: #f2f5f8;
  background: rgba(12, 16, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 600;
}
.history-detail-winner {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
}
.history-rounds {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}
.history-round-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr 1fr 1fr;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
  background: rgba(12, 16, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  font-weight: 600;
  color: #f2f5f8;
}
.history-round-row.is-crash {
  color: #ffc4c4;
  background: rgba(72, 22, 28, 0.78);
  border-color: rgba(255, 140, 140, 0.28);
}
.history-round-card {
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  background: rgba(12, 16, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.history-round-card.is-crash {
  border-color: rgba(255, 140, 140, 0.28);
  background: rgba(72, 22, 28, 0.55);
}
.history-round-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #f2f5f8;
}
.history-round-condition {
  font-size: 0.72rem;
  font-weight: 600;
  color: #c5d4e4;
}
.history-round-players {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.history-round-player {
  display: grid;
  grid-template-columns: minmax(4.5rem, 1.1fr) minmax(4rem, 1.2fr) 4.2rem 3.4rem 3.6rem;
  gap: 0.3rem;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #e8eef5;
}
.history-round-player.is-crash {
  color: #ffc4c4;
}
.history-round-player-name {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-round-player-run {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d5e0eb;
}
.history-round-player-result {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.history-round-player-vert,
.history-round-player-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.history-round-player-total {
  color: #c5d4e4;
}
@media (max-width: 420px) {
  .history-round-player {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "name result"
      "run run"
      "vert total";
    gap: 0.15rem 0.45rem;
    padding: 0.3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  .history-round-player-name { grid-area: name; }
  .history-round-player-result { grid-area: result; text-align: right; }
  .history-round-player-run { grid-area: run; }
  .history-round-player-vert { grid-area: vert; text-align: left; }
  .history-round-player-total { grid-area: total; }
}
.game-log {
  text-align: left;
  margin: 1.5rem 0;
}
.game-log h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c5d4e4;
  margin: 0 0 0.5rem;
}
.log {
  max-height: 200px;
  overflow-y: auto;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.log-entry {
  font-size: 0.84rem;
  line-height: 1.4;
  padding: 0.22rem 0;
  color: #c5d4e4;
}
.log-entry.system { color: #9fdfff; font-weight: 700; }
.log-entry.resolve { color: #f2f6fa; font-weight: 600; }
.log-entry.info,
.log-entry.commit,
.log-entry.condition { color: #d5e0eb; }
.log-entry.level { color: #7dff8a; font-weight: 700; font-size: 0.9rem; padding: 0.4rem 0; border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); }

/* --- Player Panel --- */
.player-panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--player-color);
  margin-bottom: 0.5rem;
}
.player-panel.current {
  background: var(--panel-light);
  box-shadow: 0 0 0 1px var(--player-color);
}
.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.player-name {
  font-weight: 700;
}
.player-level {
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.75rem;
  color: #fff;
}
.player-stats {
  display: flex;
  gap: 1rem;
}
.ps {
  display: flex;
  flex-direction: column;
}
.ps-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
}
.ps-value {
  font-weight: 700;
  font-size: 1rem;
}

/* --- Mode Buttons (Setup) --- */
.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.mode-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}
.mode-btn {
  flex: 1;
  min-width: 0;
  padding: 1rem;
  background: var(--panel);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.mode-btn.active {
  border-color: var(--accent);
  background: rgba(94,200,255,0.1);
}
.mode-start-btn {
  flex: 0 0 auto;
  align-self: center;
  min-width: 4.5rem;
  min-height: 2.85rem;
  padding: 0.65rem 1.05rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  border-radius: var(--radius);
}
.mode-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}
.mode-desc {
  font-size: 0.8rem;
  color: var(--muted);
}
/* Solo vs AI: nested expand under the Solo row (not a floating bay below). */
.mode-row-solo {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.mode-row-solo > .mode-btn {
  width: 100%;
}
.mode-row-solo.is-selected {
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(94, 200, 255, 0.08);
  overflow: hidden;
}
.mode-row-solo.is-selected > .mode-btn.active {
  border-color: transparent;
  border-radius: 0;
  background: transparent;
}
.setup-solo-expand {
  padding: 0.55rem 0.7rem 0.7rem;
  border-top: 1px solid rgba(94, 200, 255, 0.28);
  background: rgba(6, 10, 16, 0.35);
}
.setup-solo-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.setup-solo-options .player-count-buttons {
  gap: 0.45rem;
}
.setup-solo-options .count-btn {
  padding: 0.55rem;
  font-size: 1.2rem;
}
.setup-solo-start {
  display: block;
  margin-top: 0.55rem;
  width: 100%;
  max-width: none;
  min-height: 2.45rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.mode-row-mc {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.mode-row-mc-main {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}
.mode-row-mc-main > .mode-btn {
  flex: 1;
  min-width: 0;
}
.setup-mc-seed-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}
.setup-mc-seed-input {
  flex: 1;
  min-width: 0;
  min-height: 2.45rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(6, 10, 16, 0.55);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.setup-mc-seed-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.setup-mc-seed-new {
  flex: 0 0 auto;
  min-height: 2.45rem;
  padding: 0.5rem 0.85rem;
  font-weight: 700;
}
.setup-mc-seed-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}
.mc-deal-seed {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.05rem 0.4rem;
  border: 1px solid rgba(94, 200, 255, 0.35);
  border-radius: 999px;
  background: rgba(94, 200, 255, 0.1);
  color: #9ad8ff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

/* --- Help Panel --- */
.help-panel {
  margin-bottom: 1rem;
}
.help-panel details {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}
.help-panel summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  user-select: none;
}
.help-content {
  padding: 0.5rem 0;
}
.help-item {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.3rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.help-item:first-child { border-top: none; }
.help-item strong { color: var(--text); }

/* --- Player Level Badge --- */
.player-level-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

/* --- Run Info --- */
.run-preview {
  position: relative;
}
.run-tds {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  padding: 0.2rem;
  background: rgba(0,0,0,0.3);
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  margin-top: -2px;
}
.run-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.3rem 0;
  font-size: 0.72rem;
}
.run-info .run-tds {
  background: rgba(94,200,255,0.15);
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
}
.can-complete { color: #44ff44; }
.cant-complete { color: var(--red); }

/* --- AI Spinner --- */
.ai-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 1rem auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .card { width: 125px; }
  .card.small { width: 110px; }
  .game-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .phase-label { order: 3; flex-basis: 100%; text-align: left; }
  .resolution-row {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .mode-buttons {
    flex-direction: column;
  }
  .mode-row {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* Level Choice Screen */
.level-choice-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin: 1rem auto;
}
.level-choice-card {
  background: var(--panel);
  border: 2px solid var(--player-color, var(--accent));
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
}
.lc-player {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--player-color, var(--accent));
  margin-bottom: 0.3rem;
}
.lc-reason {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}
.lc-levels {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.lc-level-current, .lc-level-new {
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
}
.lc-arrow {
  font-size: 1.5rem;
  color: var(--muted);
}
.lc-effect {
  color: var(--text);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}
.lc-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.lc-buttons button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-accept {
  background: #00b300;
  color: #fff;
}
.btn-decline {
  background: var(--panel-light);
  color: var(--muted);
  border: 1px solid var(--muted) !important;
}
.lc-ai {
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
}
.level-choice-continue {
  text-align: center;
  margin-top: 1.5rem;
}
.level-choice-continue button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 0.7rem 2rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

/* --- Login Screen --- */
.login-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 1rem;
  color: var(--fg-muted);
}
.login-section {
  max-width: 360px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  text-align: center;
}
.login-section h2 {
  margin-bottom: 0.5rem;
}
.login-subtitle {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  border: none;
  background: #fff;
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-google:hover:not(:disabled) {
  background: #f0f0f0;
}
.btn-google:disabled {
  opacity: 0.6;
  cursor: default;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--fg-muted);
  font-size: 0.85rem;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.login-guest-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* --- Player Profile Bar --- */
.player-profile-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}
.player-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.player-profile-info {
  flex: 1;
  min-width: 0;
}
.player-profile-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: block;
}
.player-stats-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--fg-muted);
}
.stats-loading {
  font-size: 0.8rem;
  color: var(--fg-muted);
}
.btn-signout {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-signout:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}

/* --- Commit Step Indicator --- */
.commit-step-indicator {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.25rem 0 0.5rem;
}
.commit-step-indicator .step {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  background: #000;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.commit-step-indicator .step.active {
  background: #000;
  color: var(--accent);
  border-color: var(--accent);
}
.commit-step-indicator .step.done {
  background: #000;
  color: #44ff44;
  border-color: #44ff44;
}

/* --- Disabled Run Option --- */
.run-option.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.run-option.disabled .card {
  filter: grayscale(0.7);
}
.too-high-warning {
  color: var(--red);
  font-weight: 700;
  font-size: 0.8rem;
}

/* --- Commit Step 1 Full Width --- */
.commit-left-full {
  margin-bottom: 1rem;
}
.commit-left-full h3 {
  margin-bottom: 0.5rem;
}

/* --- Opponent Summary --- */
.opponent-summary {
  margin-bottom: 1rem;
}
.opp-commit {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid;
  border-radius: 4px;
  background: var(--bg-card);
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}
.opp-commit.opp-first {
  color: var(--muted);
  font-style: italic;
}
.opp-name { font-weight: 700; }
.opp-run { color: var(--accent); }
.opp-skills { color: var(--muted); }
.opp-style { color: var(--fg); }

/* --- Selected Run Display --- */
.selected-run-display {
  margin-bottom: 1rem;
}
.selected-run-display .btn-small {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
}
.selected-run-display .btn-small:hover {
  color: var(--accent);
}

/* --- Resolution Card Breakdown --- */
.res-card-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0;
}
.res-card-slot {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.res-card-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Download Log Button --- */
.btn-secondary {
  background: var(--bg-card);
  color: var(--fg);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === TABLE LAYOUT === */
.table-layout {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}
.table-reveal-info {
  text-align: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.selection-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
  .selection-layout {
    grid-template-columns: 1fr;
  }
}
.selection-runs, .selection-gear {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.5rem;
}
.selection-runs-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.45rem 0 0.55rem;
}
.selection-runs-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.selection-runs-meta {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex: 0 0 auto;
}
.selection-min-vert,
.selection-run-of {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffd76a;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.selection-run-of {
  color: #dce5ec;
}
.selection-runs .runs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.run-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.run-preview.selected .card {
  box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(255,215,0,0.4);
}
.run-preview.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.run-preview.disabled .btn-replace-run {
  pointer-events: auto;
  opacity: 1;
}
.run-preview .run-tds {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}
.run-preview .run-warn {
  display: block;
  font-size: 0.65rem;
  color: var(--warn, #e8a060);
  text-align: center;
}
.run-preview .run-warn.run-below-min {
  color: #e74c3c;
  font-weight: 700;
}
.run-preview .run-warn.run-below-level {
  font-weight: 700;
}
.table-run {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 120px;
  max-width: 180px;
  flex: 1 1 140px;
}
.table-run .run-card-slot {
  position: relative;
}
.table-run .run-card-slot .card {
  cursor: pointer;
}
.table-run.selected .run-card-slot .card {
  box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(255,215,0,0.4);
}
.table-run.disabled .run-card-slot .card {
  opacity: 0.4;
  pointer-events: none;
}
.table-run .run-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}
.table-run .run-warn {
  display: block;
  font-size: 0.65rem;
  color: var(--warn, #e8a060);
  margin-top: 0.15rem;
}
.table-run .run-warn.run-below-min {
  color: #e74c3c;
  font-weight: 700;
}
.table-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-height: 50px;
}
.table-player-cards {
  display: flex;
  gap: 0.2rem;
  align-items: center;
}
.table-player-cards .player-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* === FACE-DOWN CARD BACK (Max Vert deck art) ===
   Print backs use a white matte around the art (.uniform-back); mirror that here. */
.card.card-back {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.card.card-back.small {
  width: 48px;
  min-width: 48px;
  height: 67px;
  padding: 3px;
  border-radius: 0.4rem;
}
.card.card-back.micro {
  width: 44px;
  min-width: 44px;
  height: 62px;
  padding: 2.5px;
  border-radius: 0.35rem;
}
.card-back-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  border-radius: 0.22rem;
}
/* Fan of face-down backs in front of a run microcard. */
.facedown-fan {
  position: relative;
  width: 5.5rem;
  height: 4.6rem;
  margin: 0 auto;
}
.facedown-fan-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(calc(-50% + var(--fan-x, 0px))) rotate(var(--fan-rot, 0deg));
  transform-origin: 50% 90%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}
.facedown-fan-empty {
  width: 2.5rem;
  height: 1rem;
}

/* === COMMIT TABLE (step 2 + resolution) === */
.commit-table {
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.commit-table .table-layout {
  padding: 0;
}

/* === STICKY NAV BAR === */
.game-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Keep label row below notch / status bar when viewport-fit=cover (PWA / native). */
  padding: calc(0.35rem + env(safe-area-inset-top, 0px)) 0.5rem 0.35rem;
  background: var(--panel);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.5rem;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}
.game-nav-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  overflow: hidden;
}
.game-nav-row.game-nav-mode {
  justify-content: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 0.2rem;
  gap: 0.6rem;
}
.game-nav-info {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 1;
  min-width: 0;
  flex-wrap: wrap;
  overflow: visible;
}
.game-nav-info .player-level-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
}
.game-nav-phase {
  flex: 1;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-nav-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.nav-btn {
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  color: #0b1118;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-btn:hover:not(:disabled) {
  background: #7dd4ff;
}
.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-btn.safe {
  background: var(--green);
  color: #fff;
}
.nav-btn.safe:hover:not(:disabled) {
  background: #5fcc5f;
}
.nav-btn.push {
  background: var(--gold);
  color: #0b1118;
}
.nav-btn.push:hover:not(:disabled) {
  background: #ffe580;
}

/* === CARD DETAILS (expandable) === */
.card-details {
  margin-top: 0.25rem;
}
.card-details summary {
  font-size: 0.65rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  padding: 0.15rem 0;
  list-style: none;
  text-align: center;
}
.card-details summary::before {
  content: 'ⓘ Details';
}
.card-details summary::-webkit-details-marker {
  display: none;
}
.card-details[open] summary {
  margin-bottom: 0.2rem;
}
.card-details[open] summary::before {
  content: 'ⓘ Hide';
}

/* === COMPACT CARD MODE === */
.card.compact {
  width: 120px;
}
.card.compact .card-name {
  font-size: 0.75rem;
}
.card.compact .stat-value {
  font-size: 0.75rem;
}
.card.compact .stat-label {
  font-size: 0.55rem;
}
.card.compact .stat {
  padding: 0.1rem 0.2rem;
}
.card.compact .card-body {
  padding: 0.3rem 0.4rem;
}
@media (max-width: 640px) {
  .card.compact { width: 105px; }
}

/* === REPORT PROBLEM BUTTON & MODAL === */
.report-fab {
  position: fixed;
  bottom: 2.75rem;
  right: 0.75rem;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(200, 60, 60, 0.85);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.report-fab:hover {
  background: rgba(220, 80, 80, 0.95);
  transform: scale(1.1);
}
.report-fab:active {
  transform: scale(0.95);
}

.report-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.report-modal {
  background: var(--panel);
  border-radius: var(--radius);
  max-width: 28rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.report-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.report-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--accent);
}
.report-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}
.report-modal-close:hover {
  color: #fff;
}
.report-modal-body {
  padding: 1rem;
}
.report-modal-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.report-textarea {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: #fff;
  padding: 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 5rem;
  box-sizing: border-box;
}
.report-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.report-modal-info {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.report-screenshot-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.report-screenshot-toggle input {
  cursor: pointer;
}
.report-modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.report-status {
  padding: 0 1rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 1.2rem;
}

/* v0.9.1: Fresh Tracks & Cut Line — Special skills during Selection */
.fresh-tracks-tag {
  display: inline-block;
  font-size: 0.6rem;
  color: #4a9eff;
  font-weight: 600;
  margin-bottom: 2px;
}
.btn-replace-run {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(45, 138, 78, 0.9);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 5;
}
.btn-replace-run:active {
  background: rgba(30, 100, 55, 0.95);
}
.cut-line-queued {
  font-size: 0.7rem;
  color: #e8a040;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.3rem;
  background: rgba(232, 160, 64, 0.1);
  border-radius: 4px;
}
.special-skills-section {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border: 1px dashed rgba(74, 158, 255, 0.4);
  border-radius: 8px;
}
.special-skills-section h3 {
  font-size: 0.8rem;
  margin: 0 0 0.4rem;
  color: #4a9eff;
}
.special-skills-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.special-skill-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.btn-special {
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid #4a9eff;
  background: rgba(74, 158, 255, 0.15);
  color: #4a9eff;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-special:hover:not(:disabled) {
  background: rgba(74, 158, 255, 0.3);
}
.btn-special.disabled,
.btn-special:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
html.native-shell .special-skills-section-native {
  margin: 0.45rem 0 0.15rem;
  padding: 0.45rem;
  border-color: rgba(232, 160, 64, 0.45);
  background: rgba(0, 0, 0, 0.28);
}
html.native-shell .special-skills-section-native .special-skills-list {
  justify-content: stretch;
}
html.native-shell .special-skills-section-native .btn-special {
  flex: 1;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  border-color: rgba(232, 160, 64, 0.7);
  background: rgba(232, 160, 64, 0.18);
  color: #f0d4a0;
  text-align: center;
}
html.native-shell .special-skills-section-native .btn-special:hover:not(:disabled),
html.native-shell .special-skills-section-native .btn-special:active:not(:disabled) {
  background: rgba(232, 160, 64, 0.32);
}

/* --- Bottom Score Bar --- */
.bottom-score-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--panel);
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
  max-width: 64rem;
  margin: 0 auto;
}
.bsb-player {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.bsb-name {
  font-weight: 600;
  font-size: 0.75rem;
}
.bsb-level {
  font-size: 0.9rem;
  line-height: 1;
}
.bsb-vert {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
}
.bsb-vert::after {
  content: " ft";
  font-weight: 400;
  font-size: 0.65rem;
  color: var(--muted);
}

/* Beat the Clock — bottom score bar target progress */
.bsb-btc {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.bsb-btc-label {
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}
.bsb-btc-bar {
  width: 80px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.bsb-btc-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a9d3a, #6bc45a);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.bsb-btc-pct {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
}

.bsb-btc-compact {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.bsb-btc-compact .bsb-btc-bar {
  width: 60px;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.bsb-btc-compact .bsb-btc-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a9d3a, #6bc45a);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.bsb-btc-compact .bsb-btc-pct {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text);
}
.btc-win-banner {
  background: linear-gradient(135deg, #4a9d3a, #6bc45a);
  color: white;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
  margin: 0.5rem 0;
}
.mc-end-banner {
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 8px;
  margin: 0.5rem 0;
}
.mc-end-banner.is-win {
  background: linear-gradient(135deg, #4a9d3a, #6bc45a);
  color: white;
}
.mc-end-banner.is-freeze {
  background: linear-gradient(135deg, #c9a227, #e8c85a);
  color: #1a1408;
  border: 1px solid rgba(255, 230, 150, 0.55);
}
.mc-end-banner.is-flame {
  background: linear-gradient(135deg, #8a3a28, #4a1810);
  color: #ffe0d4;
  border: 1px solid rgba(255, 170, 130, 0.3);
}
.level-up-banner {
  background: linear-gradient(135deg, #2a5a9a, #3a7bd5);
  color: #f4ead5;
  text-align: center;
  padding: 0.65rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 8px;
  margin: 0.45rem 0 0.35rem;
  border: 1px solid rgba(212, 175, 106, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  animation: ftue-coach-fade-in 220ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .level-up-banner {
    animation: none;
  }
}

.mc-life-banner {
  text-align: center;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
  margin: 0.45rem 0 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  animation: ftue-coach-fade-in 220ms ease-out;
  line-height: 1.35;
}
.mc-life-banner.is-warn {
  background: linear-gradient(135deg, #8a4a12, #c47a2a);
  color: #fff8ec;
}
.mc-life-banner.is-danger {
  background: linear-gradient(135deg, #7a1f1f, #b33a3a);
  color: #fff5f5;
}
.mc-life-banner.is-safe {
  background: linear-gradient(135deg, #1f5a3a, #2f8a55);
  color: #f2fff6;
}
.mc-life-banner.is-info {
  background: linear-gradient(135deg, #1f4a6a, #2f6f9a);
  color: #f2f8ff;
}
.mc-life-banner-link {
  display: inline;
  margin-left: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  opacity: 0.92;
}
.mc-life-banner-link:hover,
.mc-life-banner-link:focus-visible {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .mc-life-banner {
    animation: none;
  }
}

button.mc-privilege {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.05rem 0.28rem;
  border: 1px solid rgba(140, 200, 255, 0.35);
  border-radius: 999px;
  background: rgba(40, 90, 130, 0.35);
  color: #d8f0ff;
  font: inherit;
  font-size: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
button.mc-privilege.is-ready {
  border-color: rgba(120, 210, 255, 0.55);
  background: rgba(45, 110, 150, 0.45);
}
button.mc-privilege.is-cooldown {
  border-color: rgba(160, 180, 200, 0.35);
  background: rgba(50, 70, 90, 0.4);
  color: #c5d7e6;
}
button.mc-privilege:focus-visible {
  outline: 2px solid rgba(160, 220, 255, 0.8);
  outline-offset: 1px;
}

.nav-info-lead,
.nav-info-status {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--text, #e8eef5);
}
.nav-info-status {
  margin-top: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: rgba(80, 140, 190, 0.18);
  border: 1px solid rgba(140, 200, 255, 0.25);
}

/* Beat the Clock — nav bar target info */
.btc-nav-info {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6bc45a;
  white-space: nowrap;
}

/* Beat the Clock — base (game-end-screen overrides these for contrast) */
.btc-target-info {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.btc-rounds-info {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.above-level-warning {
  background: rgba(230, 126, 34, 0.15);
  border: 1px solid rgba(230, 126, 34, 0.4);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #e67e22;
  font-weight: 600;
}
.nav-warning {
  color: #e67e22;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0 0.4rem;
  align-self: center;
}

/* --- Profile Page --- */
.profile-page {
  max-width: 600px;
  margin: 0 auto;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}
.profile-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
}
.profile-avatar-lg.profile-avatar-placeholder {
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
.profile-header-info {
  flex: 1;
  min-width: 0;
}
.profile-header-info h2 {
  margin: 0;
  font-size: 1.2rem;
}
.profile-email {
  font-size: 0.8rem;
  color: var(--fg-muted);
  display: block;
  margin-top: 0.2rem;
}
.profile-loading {
  text-align: center;
  padding: 2rem;
  color: var(--fg-muted);
}
.profile-loading .ai-spinner {
  margin: 0 auto 0.5rem;
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.profile-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.5rem;
  text-align: center;
}
.profile-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
}
.profile-stat-label {
  font-size: 0.7rem;
  color: var(--fg-muted);
  margin-top: 0.2rem;
}
.profile-empty {
  text-align: center;
  color: var(--fg-muted);
  padding: 1.5rem;
  font-size: 0.9rem;
}
.profile-games-section {
  margin-bottom: 1.5rem;
}
.profile-games-section h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}
.profile-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.profile-game-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.game-row-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.game-mode-label {
  font-size: 0.85rem;
  font-weight: 600;
}
.game-result {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.game-result.win {
  background: #1a5c2e;
  color: #5ec871;
}
.game-result.loss {
  background: #5c1a1a;
  color: #e74c3c;
}
.game-vert {
  font-size: 0.9rem;
  font-weight: 700;
  margin-left: auto;
}
.game-row-details {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--fg-muted);
}

/* Mountain Campaign */
.mc-nav-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8rem;
}
.mc-nav-info .mc-crashes {
  color: #e74c3c;
  font-weight: 700;
}
.mc-min,
.game-nav-round-min,
.mc-runs,
.selection-run-of {
  color: #ffd76a;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.mc-min.is-met,
.game-nav-round-min.is-met,
.selection-min-vert.is-met,
html.native-shell .turn-brief-min-value.is-met {
  color: #8ee0a8;
}
.game-nav-round-min,
.mc-min {
  display: inline-block;
  transform-origin: center;
}
.game-nav-round-min-have {
  display: inline-block;
  transform-origin: center bottom;
}
.game-nav-round-min-have.nav-score-vert-bump {
  animation: mc-min-have-bump 0.5s ease-out;
}
@keyframes mc-min-have-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.game-nav-round-min.is-just-met,
.mc-min.is-just-met {
  animation: mc-min-vert-pulse 0.7s ease-out;
}
@keyframes mc-min-vert-pulse {
  0% {
    transform: scale(1);
    text-shadow: none;
  }
  32% {
    transform: scale(1.12);
    color: #c8f8d6;
    text-shadow: 0 0 14px rgba(142, 224, 168, 0.95), 0 0 4px rgba(142, 224, 168, 0.7);
  }
  100% {
    transform: scale(1);
    text-shadow: none;
  }
}
.mc-cleared-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin: 0.15rem 0.55rem 0.25rem;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  background: rgba(46, 140, 90, 0.22);
  border: 1px solid rgba(142, 224, 168, 0.45);
  color: #8ee0a8;
  text-align: center;
}
.mc-cleared-banner strong {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mc-cleared-banner span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #d8f5e2;
}
html.native-shell .turn-brief .mc-cleared-banner {
  width: 100%;
  margin: 0.05rem 0 0;
}
.mc-runs,
.selection-run-of {
  color: #dce5ec;
}
.mc-nav-info .mc-min {
  color: #ffd76a;
}
.mc-nav-info .mc-min.is-met {
  color: #8ee0a8;
}
.mc-setup-info p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--fg-muted);
}
.bsb-mc-info {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* === MINI RUN CARD (pre-rendered PNG) === */
.card.mini-run-card {
  width: 140px;
  background: none;
  border: none;
  border-radius: 8px;
  overflow: visible;
  position: relative;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
}
.card.mini-run-card.small {
  width: 125px;
}
.card.mini-run-card.selectable:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 12px rgba(94,200,255,0.3));
}
.card.mini-run-card.selected {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(94,200,255,0.4);
}
.card.mini-run-card.disabled {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.5);
}
.mini-card-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.mini-card-details-link {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 0 2px;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.8;
}
.mini-card-details-link:hover {
  opacity: 1;
}

/* === CARD DETAIL MODAL === */
.card-detail-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 500;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.card-detail-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  max-width: min(90vw, 28rem);
  max-height: 90vh;
}
.card-detail-art {
  position: relative;
  isolation: isolate;
  max-width: 100%;
  border-radius: 12px;
}
.card-detail-art.is-upgraded {
  box-shadow:
    0 0 0 2px rgba(240, 192, 64, 0.85),
    0 0 22px rgba(240, 192, 64, 0.45),
    0 8px 32px rgba(0, 0, 0, 0.6);
}
.card-detail-img {
  display: block;
  max-width: min(90vw, 28rem);
  max-height: 72vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  object-fit: contain;
}
.card-detail-art.is-upgraded .card-detail-img {
  box-shadow: none;
}
.card-detail-art .card-upgrade-sheen {
  border-radius: 12px;
}
.card-detail-alterations {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(240, 192, 64, 0.45);
  background:
    linear-gradient(180deg, rgba(48, 36, 12, 0.96), rgba(18, 14, 8, 0.96));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  color: #f4ead5;
}
.card-detail-alterations-head {
  margin-bottom: 0.4rem;
  color: #ffe08a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.card-detail-alterations-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.card-detail-alteration-line {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.card-detail-alteration-stat {
  color: #ffe08a;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.card-detail-alteration-detail {
  color: rgba(244, 234, 213, 0.78);
  font-size: 0.78rem;
  line-height: 1.3;
}
.card-detail-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--panel);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 2;
}
.card-detail-close:hover {
  background: var(--accent);
  color: var(--bg);
}
.card-detail-nav {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(232, 226, 212, 0.35);
  background: rgba(12, 14, 18, 0.72);
  color: #f4ead5;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.card-detail-nav.prev { left: -8px; }
.card-detail-nav.next { right: -8px; }
.card-detail-nav:active {
  background: rgba(240, 192, 64, 0.28);
}
.card-detail-portrayal {
  margin-top: 0.15rem;
  color: rgba(244, 234, 213, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card-detail-gesture-hint {
  margin: 0;
  color: rgba(244, 234, 213, 0.5);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-align: center;
}
/* Explore / detail: mini + micro at the same widths used in play. */
.card-detail-overlay.is-sizes .card-detail-content {
  max-width: min(92vw, 22rem);
}
.card-detail-sizes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  width: 100%;
  padding: 0.35rem 0.25rem 0.15rem;
}
.card-detail-size-slot {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.card-detail-size-slot figcaption {
  color: rgba(244, 234, 213, 0.72);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
/* Match native hand minicard seat (~10.5rem). */
.card-detail-size-slot.is-mini .card.mini-run-card,
.card-detail-size-slot.is-mini .card.mini-run-card.small {
  width: 10.5rem;
  max-width: 10.5rem;
  pointer-events: none;
}
.card-detail-size-slot.is-mini .mini-card-img {
  max-height: 11.5rem;
  object-fit: contain;
}
/* Match play-loadout micro chip width (half of a ~22rem panel). */
.card-detail-size-slot.is-micro {
  width: min(10.5rem, 46vw);
}
.card-detail-size-slot.is-micro .card.micro-card {
  width: 100%;
  pointer-events: none;
}
.card-detail-overlay.is-sizes .card-detail-nav.prev { left: 0; }
.card-detail-overlay.is-sizes .card-detail-nav.next { right: 0; }

@media (max-width: 640px) {
  .card.mini-run-card { width: 120px; }
  .card.mini-run-card.small { width: 110px; }
  .card-detail-img { max-width: 95vw; max-height: 62vh; }
  .card-detail-size-slot.is-mini .card.mini-run-card,
  .card-detail-size-slot.is-mini .card.mini-run-card.small {
    width: 10.5rem;
    max-width: 10.5rem;
  }
}


/* === Anti-flicker for mini card images during re-renders === */
.mini-card-img {
  background: #f4ead5;
  will-change: transform;
  contain: layout style paint;
}
.card.mini-run-card {
  contain: layout style;
}


/* === PRO SHOP (MC v2) — lodge-night rack === */
.game-screen.is-pro-shop {
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(255, 168, 48, 0.28), transparent 58%),
    radial-gradient(circle at 12% 88%, rgba(255, 90, 40, 0.08), transparent 42%),
    linear-gradient(180deg, #1c140c 0%, #0b1118 46%, #070b10 100%);
}
.pro-shop {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.45rem 0.45rem 1.15rem;
}
.shop-marquee {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 0.7rem;
  padding: 0.75rem 0.75rem 0.7rem;
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(72, 42, 14, 0.72), rgba(18, 16, 14, 0.88)),
    repeating-linear-gradient(90deg, rgba(255, 196, 90, 0.04) 0 12px, transparent 12px 24px);
  border: 1px solid rgba(255, 196, 90, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 226, 150, 0.18);
}
.shop-marquee-glow {
  position: absolute;
  inset: -20% 10% auto;
  height: 4.5rem;
  background: radial-gradient(ellipse, rgba(255, 180, 60, 0.35), transparent 70%);
  pointer-events: none;
}
.shop-marquee-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}
.shop-marquee-sign {
  min-width: 0;
}
.shop-marquee-kicker {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 214, 140, 0.72);
}
.shop-marquee-sign h2,
.shop-header h2 {
  margin: 0.08rem 0 0;
  font-size: 1.7rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffe7a3;
  text-shadow:
    0 0 8px rgba(255, 176, 48, 0.85),
    0 0 22px rgba(255, 120, 20, 0.45);
}
.shop-wallet {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
}
.shop-wallet-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 214, 140, 0.7);
}
.shop-wallet-credits {
  font-size: 1.55rem;
  font-weight: 950;
  line-height: 1;
  color: #ffd76a;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255, 200, 70, 0.45);
}
.shop-wallet-vert {
  margin-top: 0.12rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(244, 234, 213, 0.78);
}
.shop-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  padding: 0.35rem 0.15rem 0.55rem;
}
.shop-header-copy {
  min-width: 0;
  flex: 1;
}
.shop-header-copy p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.2rem 0 0;
}
.shop-chase {
  margin: -0.15rem 0 0.75rem;
  padding: 0.7rem 0.8rem 0.75rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #5a3a08, #c47a12 55%, #f0c14a);
  color: #1a1208;
  box-shadow: 0 8px 22px rgba(255, 160, 40, 0.28);
  animation: shop-chase-pulse 1.8s ease-in-out infinite;
}
.shop-chase-kicker {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.shop-chase-title {
  margin-top: 0.12rem;
  font-size: 1.15rem;
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.shop-chase-effect {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  font-weight: 800;
}
.shop-chase.just-forged,
.pass-combo-featured.just-forged {
  animation: shop-forged 720ms ease-out;
}
@keyframes shop-chase-pulse {
  0%, 100% { filter: brightness(1); box-shadow: 0 8px 22px rgba(255, 160, 40, 0.28); }
  50% { filter: brightness(1.08); box-shadow: 0 10px 28px rgba(255, 180, 50, 0.4); }
}
@keyframes shop-forged {
  0% { transform: scale(0.96); filter: brightness(1.35); }
  55% { transform: scale(1.03); }
  100% { transform: scale(1); filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-chase { animation: none; }
  .shop-chase.just-forged,
  .pass-combo-featured.just-forged { animation: none; }
}
.shop-draw-again-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}
.shop-draw-again {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.45rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid rgba(255, 210, 90, 0.5);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 214, 90, 0.22), rgba(255, 150, 40, 0.12));
  color: #ffe9b0;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 230, 160, 0.25);
}
.shop-draw-again-cost {
  font-variant-numeric: tabular-nums;
  color: #ffd76a;
}
.shop-draw-again:disabled {
  opacity: 0.42;
  cursor: default;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
.shop-draw-again.is-used {
  opacity: 0.5;
}
.shop-draw-again-hint {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 214, 140, 0.7);
  text-align: right;
}
.shop-offers {
  margin: 0.15rem 0 0.95rem;
  padding: 0.7rem 0.55rem 0.65rem;
  border-radius: 0.95rem;
  background: rgba(10, 14, 18, 0.42);
  border: 1px solid rgba(255, 196, 90, 0.16);
}
.shop-upgrades-held {
  margin: 1.1rem 0 0.35rem;
  padding: 0.75rem 0.65rem 0.65rem;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, rgba(32, 26, 18, 0.7), rgba(10, 16, 24, 0.7));
  border: 1px solid rgba(255, 196, 90, 0.14);
}
.shop-upgrades-held h3 {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.shop-upgrades-empty {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.shop-upgrade-owned-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding-top: 0.3rem;
  padding-right: 0.3rem;
}
.shop-upgrade-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
}
.shop-upgrade-stack-card {
  position: absolute;
  inset: 0;
  transform: translate(
    calc(min(var(--stack-i), 3) * 0.28rem),
    calc(min(var(--stack-i), 3) * -0.28rem)
  );
  z-index: calc(var(--stack-i) + 1);
}
.shop-upgrade-stack-card .shop-held-card,
.shop-upgrade-stack-card .shop-mini-card {
  width: 100%;
  height: 100%;
}
.shop-mini-card.is-used,
.shop-held-card.is-used .shop-mini-card {
  filter: grayscale(0.7) brightness(0.7);
  opacity: 0.78;
}
.shop-held-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.shop-held-card:focus-visible {
  outline: 2px solid rgba(94, 200, 255, 0.55);
  outline-offset: 2px;
  border-radius: 0.5rem;
}
.shop-passes-held {
  margin: 0.75rem 0 0.5rem;
  padding: 0.85rem 0.65rem 0.75rem;
  border-radius: 0.95rem;
  background:
    linear-gradient(180deg, rgba(42, 30, 16, 0.7), rgba(10, 16, 24, 0.72));
  border: 1px solid rgba(255, 196, 90, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.08), 0 8px 20px rgba(0, 0, 0, 0.22);
}
.shop-passes-held.has-builds {
  border-color: rgba(255, 196, 90, 0.42);
  box-shadow: 0 0 24px rgba(255, 170, 40, 0.12), inset 0 1px 0 rgba(255, 220, 150, 0.12);
}
.shop-passes-held-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.shop-passes-held h3,
.shop-offers h3 {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8c878;
  margin: 0 0 0.45rem;
}
.shop-passes-held h3 {
  margin: 0;
}
.shop-passes-count {
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffd76a;
  letter-spacing: 0.04em;
}
.shop-passes-hint {
  margin: 0.45rem 0 0;
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
}
.pass-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}
.pass-slot {
  min-width: 0;
  aspect-ratio: 3 / 4;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 27, 38, 0.85);
}
.pass-slot-empty {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: rgba(255, 196, 90, 0.18);
  background: rgba(12, 10, 8, 0.35);
  opacity: 0.55;
}
.pass-slot-filled {
  position: relative;
  border-color: var(--pass-accent, #8aaaca);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.pass-slot-filled.rare {
  border-color: var(--gold);
}
.pass-slot-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: inherit;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.pass-slot-filled:hover,
.pass-slot-filled:focus-within {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(94, 200, 255, 0.35);
}
.pass-slot-filled.pass-tag { --pass-accent: #8aaaca; }
.pass-slot-filled.pass-style { --pass-accent: #ba7aca; }
.pass-slot-filled.pass-survival { --pass-accent: #6aaa7a; }
.pass-slot-filled.pass-economy { --pass-accent: #e0c45a; }
.pass-slot-filled.pass-wild { --pass-accent: #ff8a6a; }
.pass-slot-filled .shop-mini-card {
  border: none;
  box-shadow: none;
  height: 100%;
}
.pass-combo-lane {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.pass-combo-featured {
  position: relative;
  aspect-ratio: auto;
  min-height: 6.4rem;
  overflow: hidden;
  border: 2px solid rgba(255, 214, 90, 0.72);
  background:
    linear-gradient(115deg, rgba(255, 190, 60, 0.16), transparent 46%),
    #141018;
  box-shadow: 0 0 22px rgba(255, 176, 48, 0.22), inset 0 0 0 1px rgba(255, 230, 150, 0.12);
}
.pass-combo-t3.pass-combo-featured { border-color: #ffb048; box-shadow: 0 0 26px rgba(255, 150, 30, 0.32); }
.pass-combo-t4.pass-combo-featured { border-color: #ffe8a8; box-shadow: 0 0 30px rgba(255, 220, 120, 0.4); }
.pass-combo-featured .pass-slot-body {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  height: 100%;
  min-height: 6.4rem;
}
.pass-combo-art {
  position: relative;
  overflow: hidden;
  background: #0d1016;
}
.pass-combo-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.2) contrast(1.05);
}
.pass-combo-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.55rem 0.7rem 0.55rem 0.65rem;
  min-width: 0;
}
.pass-combo-kicker {
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffe08a;
}
.pass-combo-name {
  font-size: 1.2rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff4d2;
  line-height: 1.05;
}
.pass-combo-featured .pass-combo-effect {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffe9a8;
}
.pass-combo-count {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  z-index: 3;
  padding: 0.12rem 0.34rem;
  border-radius: 999px;
  background: #f5c84b;
  color: #17202c;
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: 0 1px 4px rgba(0,0,0,.55);
}
.pass-combo-featured .pass-combo-next,
.pass-combo-featured .pass-combo-max {
  margin-top: 0.12rem;
  color: rgba(255, 230, 150, 0.88);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pass-combo-banner {
  text-align: center;
  padding: 0.62rem 1rem;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 8px;
  margin: 0.4rem 0 0.3rem;
  border: 1px solid rgba(255, 214, 90, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  animation: ftue-coach-fade-in 220ms ease-out;
}
.pass-combo-banner-tag {
  background: linear-gradient(135deg, #3a4a1f, #7a8a2a);
  color: #fff4c8;
}
.pass-combo-banner-style {
  background: linear-gradient(135deg, #4a2460, #8a4aaa);
  color: #f6e6ff;
}
@media (prefers-reduced-motion: reduce) {
  .pass-combo-banner { animation: none; }
}
.held-pass-combo .held-pass-combo-art {
  position: relative;
  min-height: 7.2rem;
  background: #0f1620;
}
.held-pass-combo .held-pass-combo-ghost,
.held-pass-combo .held-pass-hero-art {
  position: absolute;
  width: 78%;
  height: 86%;
  object-fit: cover;
  border-radius: 0.35rem;
  box-shadow: 0 4px 10px rgba(0,0,0,.4);
}
.held-pass-combo .held-pass-combo-ghost:first-child { left: 4%; top: 4%; transform: rotate(-8deg); opacity: 0.55; }
.held-pass-combo .held-pass-combo-ghost:nth-child(2) { left: 14%; top: 2%; transform: rotate(7deg); opacity: 0.7; }
.held-pass-combo .held-pass-hero-art { left: 16%; top: 10%; transform: rotate(-1deg); }
.held-pass-combo .pass-combo-count { top: 0.35rem; right: 0.3rem; }
.held-pass-combo .held-pass-next {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffe68e;
}
.native-res-pass-slot.is-combo { position: relative; }
.native-res-pass-slot.is-combo .pass-combo-count { top: -0.15rem; right: -0.15rem; font-size: 0.62rem; }
.pass-slot-spent .shop-mini-card {
  filter: grayscale(0.3) brightness(0.9);
}
.pass-slot-remove {
  position: absolute;
  top: 0.18rem;
  right: 0.18rem;
  z-index: 2;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(180, 28, 36, 0.92);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.pass-slot-remove:hover:not(:disabled),
.pass-slot-remove:focus-visible:not(:disabled) {
  background: #e12632;
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.pass-slot-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pass-slot-remove:active:not(:disabled) {
  transform: scale(0.94);
}
.pass-slot-used {
  position: absolute;
  top: 0.18rem;
  right: 0.18rem;
  z-index: 2;
  padding: 0.12rem 0.32rem;
  border-radius: 999px;
  background: rgba(20, 24, 30, 0.92);
  color: #e8d9a8;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.pass-slot-spent .pass-slot-art,
.pass-slot-spent .shop-mini-art img {
  filter: grayscale(0.35) brightness(0.88);
}
.held-pass-dialog .shop-pass-micro {
  margin-top: 0.35rem;
}
.passes-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.offers-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem 0.4rem;
  align-items: stretch;
  padding-top: 0.25rem;
}
.shop-offer {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  height: 100%;
}
.shop-offer.is-build-hit .shop-mini-card {
  box-shadow: 0 0 0 2px #ffd24a, 0 0 18px rgba(255, 180, 40, 0.45);
  transform: translateY(-2px);
}
.shop-offer-ribbon {
  position: absolute;
  left: 50%;
  top: -0.45rem;
  z-index: 4;
  transform: translateX(-50%);
  padding: 0.14rem 0.4rem;
  border-radius: 999px;
  background: #ffd24a;
  color: #1a1208;
  font-size: 0.52rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.shop-offer .shop-mini-card {
  flex: 0 0 auto;
}
.shop-offer-inspect {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex: 0 0 auto;
}
.shop-offer-inspect:active {
  opacity: 0.9;
  transform: scale(0.99);
}
.shop-offer.unaffordable {
  opacity: 1;
}
.shop-offer.unaffordable .btn-buy:disabled {
  opacity: 0.4;
}
.shop-offer.purchased {
  opacity: 0.38;
}
.shop-offer.purchased .btn-buy {
  pointer-events: none;
}
@media (max-width: 360px) {
  .offers-list,
  .shop-upgrade-owned-list,
  .pass-slot-grid {
    gap: 0.3rem;
  }
}
.shop-offer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  padding: 0 0.05rem;
}
.shop-offer .offer-cost {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold);
}
.shop-offer .offer-sold {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.shop-offer .btn-buy {
  padding: 0.38rem 0.78rem;
  background: linear-gradient(180deg, #ffe27a, #f0b12a);
  color: #1a1208;
  border: none;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 176, 40, 0.28);
}
.shop-offer .btn-buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.shop-offer .btn-buy:not(:disabled):hover {
  background: linear-gradient(180deg, #fff1a8, #ffc24a);
}

/* Small-format shop cards — portrait, art-forward, shared by offers + inventory. */
.shop-mini-card {
  --shop-accent: #2d7a3e;
  --shop-accent-light: #6aaa7a;
  --shop-face: #f4ead5;
  --shop-ink: #2a3a2a;
  --shop-rail: 0.78rem;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 0.45rem;
  overflow: hidden;
  background: var(--shop-face);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  border: 1.5px solid var(--shop-accent);
  display: flex;
  flex-direction: column;
}
.shop-mini-card.shop-mini-upgrade.rare {
  --shop-accent: #c9a227;
  --shop-accent-light: #e0c45a;
}
.shop-mini-card.shop-mini-pass {
  --shop-accent: #8aaaca;
  --shop-accent-light: #b6d0e8;
  --shop-face: #15202c;
  --shop-ink: rgba(244, 234, 213, 0.9);
}
.shop-mini-card.shop-mini-pass.pass-tag { --shop-accent: #8aaaca; --shop-accent-light: #b6d0e8; }
.shop-mini-card.shop-mini-pass.pass-style { --shop-accent: #ba7aca; --shop-accent-light: #e0b6f0; }
.shop-mini-card.shop-mini-pass.pass-survival { --shop-accent: #6aaa7a; --shop-accent-light: #a8d4b4; }
.shop-mini-card.shop-mini-pass.pass-economy { --shop-accent: #e0c45a; --shop-accent-light: #f0e0a0; }
.shop-mini-card.shop-mini-pass.pass-wild { --shop-accent: #ff8a6a; --shop-accent-light: #ffc0a8; }
.shop-mini-card.shop-mini-pass.rare {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.18), 0 2px 10px rgba(0, 0, 0, 0.3);
}
.shop-mini-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: var(--shop-rail);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--shop-accent);
  color: #f4ead5;
  font-size: 0.46rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  line-height: 1;
}
.shop-mini-card.shop-mini-pass .shop-mini-rail {
  color: #0f1620;
  font-weight: 900;
}
.shop-mini-rare,
.shop-mini-level {
  position: absolute;
  z-index: 3;
  top: 0.22rem;
  right: 0.22rem;
  padding: 0.08rem 0.28rem;
  border-radius: 999px;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  background: rgba(12, 16, 22, 0.82);
  color: #ffd76a;
}
.shop-mini-rare {
  color: #0f1620;
  background: var(--gold);
}
.shop-mini-card.is-compact .shop-mini-rare {
  display: none;
}
.shop-mini-art {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: #1a2430;
  margin-left: var(--shop-rail);
}
.shop-mini-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.shop-mini-art::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0.7rem;
  background: linear-gradient(to bottom, transparent, var(--shop-face));
}
.shop-mini-body {
  padding: 0.22rem 0.28rem 0.28rem calc(var(--shop-rail) + 0.18rem);
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  background: var(--shop-face);
  flex: 0 0 auto;
}
.shop-mini-name {
  font-size: 0.62rem;
  font-weight: 900;
  color: var(--shop-accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-mini-card.shop-mini-pass .shop-mini-name {
  color: #f4ead5;
}
.shop-mini-effect {
  font-size: 0.52rem;
  font-weight: 650;
  color: var(--shop-ink);
  line-height: 1.2;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-mini-card.is-compact {
  --shop-rail: 0.68rem;
}
.shop-mini-card.is-compact .shop-mini-name {
  font-size: 0.5rem;
}
.shop-mini-card.is-compact .shop-mini-body {
  padding: 0.16rem 0.18rem 0.2rem calc(var(--shop-rail) + 0.1rem);
}

/* Pass badges — landscape microchip look */
.shop-pass-micro {
  --pass-accent: #7ababa;
  --pass-accent-strong: #2a5a5a;
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  min-height: 3.85rem;
  border-radius: 0.55rem;
  overflow: hidden;
  background: #1a2430;
  border: 1.5px solid var(--pass-accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.shop-pass-micro.rare {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.16);
}
.shop-pass-micro.pass-tag { --pass-accent: #8aaaca; --pass-accent-strong: #3a5a7a; }
.shop-pass-micro.pass-style { --pass-accent: #ba7aca; --pass-accent-strong: #7a3d9a; }
.shop-pass-micro.pass-survival { --pass-accent: #6aaa7a; --pass-accent-strong: #2d7a3e; }
.shop-pass-micro.pass-economy { --pass-accent: #e0c45a; --pass-accent-strong: #c9a227; }
.shop-pass-micro.pass-wild { --pass-accent: #ff8a6a; --pass-accent-strong: #c8531a; }
.shop-pass-art {
  position: relative;
  background: #0f1620;
  overflow: hidden;
}
.shop-pass-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.shop-pass-art::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1.1rem;
  background: linear-gradient(to right, transparent, #1a2430);
}
.shop-pass-body {
  padding: 0.28rem 0.4rem 0.3rem 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.shop-pass-type {
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pass-accent);
  line-height: 1;
}
.shop-pass-name {
  font-size: 0.82rem;
  font-weight: 900;
  color: #f4ead5;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.shop-pass-effect {
  margin-top: auto;
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(244, 234, 213, 0.88);
  line-height: 1.2;
}
.shop-pass-micro.is-held {
  opacity: 0.95;
}
html.native-shell .pro-shop {
  padding: 0.25rem 0.45rem 0.95rem;
}
html.native-shell .shop-marquee {
  padding: 0.65rem 0.65rem 0.6rem;
}
html.native-shell .pass-combo-name {
  font-size: 1.05rem;
}

/* --- Between-round hand review (all modes) --- */
.hand-review {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.5rem 0.55rem 1.25rem;
}
.hand-review-header {
  text-align: left;
  padding: 0.25rem 0.1rem 0.55rem;
}
.hand-review-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.hand-review-header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
/* Quiet opt-out — card draws are meant to be seen. */
.hand-review-never {
  display: inline-block;
  margin: 0.45rem 0 0;
  padding: 0.15rem 0.2rem;
  border: none;
  background: transparent;
  color: rgba(220, 229, 236, 0.38);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.hand-review-never:hover,
.hand-review-never:focus-visible {
  color: rgba(220, 229, 236, 0.72);
  outline: none;
}
.hand-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0.55rem;
  row-gap: 0.55rem;
  justify-items: center;
  margin: 0.15rem 0 0.85rem;
}
.hand-review-card {
  width: 100%;
  max-width: 11rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hand-review-card .run-card-frame {
  position: relative;
  width: 100%;
}
.hand-review-card .card,
.hand-review-card .card.compact {
  width: 100%;
}
.hand-review-card .mini-card-img {
  width: 100%;
  height: auto;
  max-height: 12rem;
  object-fit: contain;
}
.hand-review-card .card-details-hit {
  position: absolute;
  right: 0.28rem;
  bottom: 0.28rem;
  z-index: 5;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0;
  background: rgba(11, 17, 24, 0.55);
  color: rgba(232, 238, 245, 0.85);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.hand-review-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.5rem;
}
.hand-review-card.is-dealing {
  animation: hand-review-deal-in 380ms cubic-bezier(0.22, 0.82, 0.2, 1) both;
}
@keyframes hand-review-deal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hand-review-card.is-dealing {
    animation: none;
  }
}
.hand-review-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 1.25rem 0.5rem;
}
html.native-shell .hand-review {
  padding: 0.3rem 0.5rem 0.85rem;
}
/* Single Continue lives in the thumb action bar — room for dealt cards above it. */
html.native-shell .native-hand-review .hand-review {
  padding-bottom: 1.25rem;
}
html.native-shell .hand-review-header h2 {
  font-size: 1.1rem;
}
html.native-shell .hand-review-header p {
  font-size: 0.78rem;
}
@media (min-width: 640px) {
  .hand-review-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

html.native-shell .offers-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem 0.32rem;
}
html.native-shell .shop-mini-card {
  --shop-rail: 0.72rem;
}
html.native-shell .shop-mini-name {
  font-size: 0.58rem;
}
html.native-shell .shop-mini-effect {
  font-size: 0.5rem;
}
.mc-spend {
  color: var(--gold) !important;
  font-weight: 700;
}

/* MC hand-card replacement control */
.hand-card-slot { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.btn-replace-hand { margin-top: 3px; padding: 2px 7px; border: 1px solid var(--accent); border-radius: 5px; background: var(--panel-light); color: var(--accent); font-size: 0.75rem; cursor: pointer; z-index: 3; }
.btn-replace-hand:hover { background: var(--accent); color: var(--bg); }

/* Explicit labels for persistent MC upgrades on PNG cards */
.card-upgrade-label, .run-upgrade-label { color: var(--gold); font-weight: 800; font-size: 0.78rem; letter-spacing: .01em; }
.card-upgrade-label { margin-top: 2px; text-align: center; }

/* Swap controls sit above cards so they never obscure card art or stats. */
.run-preview { display: flex; flex-direction: column; align-items: center; }
.btn-replace-run { position: static; order: -1; margin: 0 0 4px; align-self: center; }
.btn-replace-hand { margin: 0 0 4px; padding: 3px 8px; }

/* Hand swaps use the same green treatment as run swaps. */
.btn-replace-hand { position: static; order: -1; align-self: center; margin: 0 0 4px; background: rgba(45, 138, 78, 0.9); color: #fff; border: none; border-radius: 4px; padding: 3px 8px; font-size: 0.6rem; font-weight: 600; cursor: pointer; z-index: 5; }
.btn-replace-hand:hover { background: rgba(30, 100, 55, 0.95); color: #fff; }
.mc-pressure { color: var(--gold) !important; font-weight: 800; }

/* === Native solitaire lineup + compact run grid === */
.lineup-block {
  margin: 0.15rem 0.45rem 0.2rem;
}
.lineup-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 0.28rem;
  min-height: 1.1rem;
}
.lineup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin: 0;
  align-items: stretch;
  justify-items: stretch;
}
.lineup-slot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.12rem;
  min-width: 0;
}
.lineup-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 238, 245, 0.88);
}
.lineup-slot .card,
.lineup-slot .card.small {
  width: 100%;
  max-width: 6.6rem;
}
.lineup-run-slot.empty .run-slot-placeholder {
  width: 100%;
  max-width: 6.6rem;
  aspect-ratio: 2.5 / 3.5;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(94, 200, 255, 0.35);
  border-radius: var(--card-radius);
  background: rgba(18, 27, 38, 0.55);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  padding: 0.3rem;
}
.lineup-run-slot.filled .card {
  box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(94, 200, 255, 0.28);
}

html.native-shell .lineup-slot .mini-card-details-link {
  display: none;
}
/* Run-picker lineup: Condition + Your Run slot — a bit larger than the old compact chips. */
html.native-shell .lineup-block {
  margin: 0.2rem 0.45rem 0.35rem;
}
html.native-shell .lineup-row:not(.lineup-row-compact) {
  margin: 0;
  gap: 0.55rem;
}
html.native-shell .lineup-row:not(.lineup-row-compact) .lineup-slot .card,
html.native-shell .lineup-row:not(.lineup-row-compact) .lineup-slot .card.small,
html.native-shell .lineup-row:not(.lineup-row-compact) .run-slot-placeholder {
  max-width: 8.9rem;
}
html.native-shell .lineup-block-hand {
  margin: 0.1rem 0.45rem 0.55rem;
}
html.native-shell .lineup-row-compact {
  margin: 0;
  gap: 0.3rem;
}
html.native-shell .lineup-row-compact .lineup-slot .card,
html.native-shell .lineup-row-compact .lineup-slot .card.small,
html.native-shell .lineup-row-compact .run-slot-placeholder {
  max-width: 5.1rem;
}

html.native-shell .selection-layout-native {
  display: block;
}
html.native-shell .selection-layout-native .selection-runs,
html.native-shell .selection-layout-native .selection-gear {
  background: transparent;
  padding: 0.1rem 0.4rem 0.5rem;
}
/* Hand step: keep the last minicard stats/ⓘ above the fixed action dock. */
html.native-shell .native-hand-step .selection-layout-native .selection-gear {
  padding-bottom: 1.75rem;
}
html.native-shell .selection-runs h3,
html.native-shell .selection-gear h3 {
  margin: 0.05rem 0 0.25rem;
  font-size: 0.7rem;
}
html.native-shell .selection-runs-header {
  margin: 0.35rem 0.1rem 0.45rem;
  padding: 0 0.1rem;
}
html.native-shell .selection-runs-header h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
}
html.native-shell .selection-min-vert {
  font-size: 0.78rem;
}
html.native-shell .selection-runs .run-warn.run-below-min,
html.native-shell .selection-runs .run-warn.run-below-level {
  font-size: 0.62rem;
  line-height: 1.2;
  margin-top: 0.1rem;
}

html.native-shell .lineup-row-micro {
  align-items: stretch;
  gap: 0.4rem;
}
html.native-shell .lineup-row-micro .lineup-slot {
  flex: 1;
  min-width: 0;
  align-items: stretch;
}
html.native-shell .lineup-row-micro .lineup-slot .card,
html.native-shell .lineup-row-micro .lineup-slot .card.micro-card {
  max-width: none;
  width: 100%;
}
html.native-shell .lineup-change-run {
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0;
  white-space: nowrap;
}
html.native-shell .lineup-row-micro .lineup-label {
  font-size: 0.72rem;
  margin-bottom: 0.12rem;
}
.card.micro-card {
  width: 100%;
  background: none;
  border: none;
  border-radius: 10px;
  overflow: visible;
  position: relative;
  flex-shrink: 0;
  padding: 0;
}
.micro-card-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
html.native-shell .lineup-run-slot.filled .card.micro-card {
  box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(94, 200, 255, 0.28);
  border-radius: 10px;
}

/* === Native turn brief + Condition overlay intro === */
/* Docked resting seats — never morph; Condition preview is a separate overlay. */
html.native-shell .turn-brief {
  --turn-brief-gap: 0.4rem;
  --turn-brief-pad-y: 0.5rem;
  --turn-brief-pad-x: 0.65rem;
  --turn-brief-min-size: clamp(1.55rem, 6.5vw, 1.9rem);
  --turn-brief-card-w: min(42vw, 152px);
  --turn-brief-meta-size: 0.88rem;
  --turn-brief-radius: 14px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--turn-brief-gap);
  margin: 0.15rem 0.55rem 0.3rem;
  padding: var(--turn-brief-pad-y) var(--turn-brief-pad-x);
  text-align: center;
  border-radius: var(--turn-brief-radius);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(94, 200, 255, 0.1), transparent 60%),
    rgba(12, 18, 26, 0.55);
  border: 1px solid rgba(94, 200, 255, 0.16);
  transform-origin: top center;
}
html.native-shell .turn-brief-min {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}
html.native-shell .turn-brief-min-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, #d4af6a);
}
html.native-shell .turn-brief-min-value {
  font-size: var(--turn-brief-min-size);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #f4f7fb;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
html.native-shell .turn-brief-min-value.is-ratio {
  font-size: clamp(1.25rem, 5.4vw, 1.7rem);
  white-space: nowrap;
}
html.native-shell .turn-brief-condition {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
}
html.native-shell .turn-brief-card-frame {
  position: relative;
  width: var(--turn-brief-card-w);
  max-width: 100%;
}
html.native-shell .turn-brief-card-art {
  display: none;
}
html.native-shell .turn-brief-mini {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  width: 100%;
  opacity: 1;
}
html.native-shell .turn-brief-mini .card.mini-run-card,
html.native-shell .turn-brief-mini .card.mini-run-card.small {
  width: 100%;
  max-width: none;
}
html.native-shell .turn-brief-details {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  z-index: 3;
}
html.native-shell .turn-brief-meta {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1.35rem;
  flex-wrap: wrap;
  width: 100%;
}
html.native-shell .turn-brief-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  min-width: 5.5rem;
}
html.native-shell .turn-brief-meta-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(220, 229, 236, 0.62);
}
html.native-shell .turn-brief-round,
html.native-shell .turn-brief-total {
  font-size: var(--turn-brief-meta-size);
  font-weight: 800;
  color: rgba(232, 238, 245, 0.95);
  line-height: 1.1;
}
html.native-shell .turn-brief-total {
  color: var(--gold, #d4af6a);
}

/* Opaque overlay — turn UI stays painted underneath and does not relayout on close. */
html.native-shell .turn-intro-overlay {
  position: fixed;
  inset: 0;
  /* Above sticky .game-nav (100) so the Min Vert line isn't sliced off. */
  z-index: 180;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse at 50% 18%, rgba(212, 175, 106, 0.22), transparent 55%),
    radial-gradient(ellipse at 50% 85%, rgba(94, 200, 255, 0.12), transparent 52%),
    linear-gradient(180deg, #0b1118 0%, #121c28 100%);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
html.native-shell .turn-intro-overlay-min {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin-top: 1.65rem;
  overflow: visible;
}
html.native-shell .turn-intro-overlay .turn-brief-min-label {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
}
html.native-shell .turn-intro-overlay .turn-brief-min-value {
  font-size: clamp(2.7rem, 13vw, 3.55rem);
  line-height: 1.2;
  overflow: visible;
  padding: 0.06em 0;
}
html.native-shell .turn-intro-overlay .turn-brief-min-value.is-ratio {
  font-size: clamp(1.55rem, 6.8vw, 2rem);
  letter-spacing: -0.03em;
  white-space: nowrap;
  line-height: 1.25;
}
html.native-shell .turn-intro-overlay .turn-brief-meta {
  margin-top: 0.35rem;
  gap: 1.75rem;
}
html.native-shell .turn-intro-overlay .turn-brief-round,
html.native-shell .turn-intro-overlay .turn-brief-total {
  font-size: 1.05rem;
}
html.native-shell .turn-intro-race {
  width: min(100%, 18.5rem);
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
html.native-shell .turn-intro-race-board {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
html.native-shell .turn-intro-race-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
html.native-shell .turn-intro-race-row.is-you {
  background: rgba(94, 200, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(94, 200, 255, 0.28);
}
html.native-shell .turn-intro-race-name {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.native-shell .turn-intro-race-vert {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f4f7fb;
  font-variant-numeric: tabular-nums;
}
html.native-shell .turn-intro-race-vert::after {
  content: " ft";
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(232, 238, 245, 0.55);
}
html.native-shell .turn-intro-race-status {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
html.native-shell .turn-intro-race-status.is-ahead {
  color: #8ee0a8;
}
html.native-shell .turn-intro-race-status.is-behind {
  color: #ffb4a8;
}
html.native-shell .turn-intro-race-status.is-tied {
  color: rgba(212, 175, 106, 0.95);
}
html.native-shell .turn-intro-overlay-card {
  width: min(72vw, 268px);
  max-width: 100%;
  flex: 0 0 auto;
}
html.native-shell .turn-intro-overlay-art,
html.native-shell .turn-intro-overlay-mini .card.mini-run-card {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(212, 175, 106, 0.45),
    0 22px 54px rgba(0, 0, 0, 0.55);
}
html.native-shell .turn-intro-overlay-bottom {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding-top: 0.35rem;
}
html.native-shell .turn-intro-overlay-draws {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
html.native-shell .turn-intro-draws-label {
  margin: 0;
  max-width: 22rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(212, 175, 106, 0.95);
  text-align: center;
}
html.native-shell .turn-intro-draws-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0 0.15rem;
}
html.native-shell .turn-intro-draw-card {
  width: min(34vw, 9.5rem);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
/* 3+ draws: shrink so Close / progress stay on screen. */
html.native-shell .turn-intro-draws-row[data-count="3"] {
  gap: 0.4rem;
}
html.native-shell .turn-intro-draws-row[data-count="3"] .turn-intro-draw-card {
  width: min(26vw, 6.85rem);
}
html.native-shell .turn-intro-draws-row[data-count="4"],
html.native-shell .turn-intro-draws-row[data-count="5"],
html.native-shell .turn-intro-draws-row[data-count="6"],
html.native-shell .turn-intro-draws-row[data-count="7"],
html.native-shell .turn-intro-draws-row[data-count="8"] {
  gap: 0.35rem;
}
html.native-shell .turn-intro-draws-row[data-count="4"] .turn-intro-draw-card,
html.native-shell .turn-intro-draws-row[data-count="5"] .turn-intro-draw-card,
html.native-shell .turn-intro-draws-row[data-count="6"] .turn-intro-draw-card,
html.native-shell .turn-intro-draws-row[data-count="7"] .turn-intro-draw-card,
html.native-shell .turn-intro-draws-row[data-count="8"] .turn-intro-draw-card {
  width: min(23vw, 5.85rem);
}
html.native-shell .turn-intro-draw-card .card,
html.native-shell .turn-intro-draw-card .card.compact,
html.native-shell .turn-intro-draw-card .card.mini-run-card {
  width: 100%;
  max-width: none;
  margin: 0;
  pointer-events: none;
}
html.native-shell .turn-intro-overlay .turn-intro-footer {
  margin-top: 0;
  padding-top: 0.15rem;
  width: 100%;
  max-width: 22rem;
}

html.native-shell .turn-intro-skip-x {
  position: absolute;
  top: calc(0.55rem + env(safe-area-inset-top, 0px));
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(232, 238, 245, 0.22);
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.55);
  color: #e8eef5;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 6;
}
html.native-shell .turn-intro-skip-x:hover,
html.native-shell .turn-intro-skip-x:focus-visible {
  background: rgba(94, 200, 255, 0.18);
  border-color: rgba(94, 200, 255, 0.45);
  outline: none;
}
html.native-shell .turn-intro-hint {
  position: static;
  align-self: stretch;
  margin: 0.15rem 2.4rem 0.55rem 0.15rem;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(220, 229, 236, 0.7);
  text-align: left;
}
html.native-shell .turn-intro-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
}
html.native-shell .turn-intro-close {
  align-self: center;
  min-width: 7.5rem;
  padding: 0.55rem 1.35rem;
  border: 1px solid rgba(232, 238, 245, 0.28);
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.72);
  color: #f4f7fb;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}
html.native-shell .turn-intro-close:hover,
html.native-shell .turn-intro-close:focus-visible {
  background: rgba(94, 200, 255, 0.2);
  border-color: rgba(94, 200, 255, 0.5);
  outline: none;
}
/* Quiet, easy-to-miss opt-out — Condition intros are meant to be seen. */
html.native-shell .turn-intro-never {
  align-self: center;
  margin: 0.15rem 0 0;
  padding: 0.2rem 0.45rem;
  border: none;
  background: transparent;
  color: rgba(220, 229, 236, 0.38);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
html.native-shell .turn-intro-never:hover,
html.native-shell .turn-intro-never:focus-visible {
  color: rgba(220, 229, 236, 0.72);
  outline: none;
}
html.native-shell .turn-intro-progress {
  position: static;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(232, 238, 245, 0.12);
  overflow: hidden;
}
html.native-shell .turn-intro-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--gold, #d4af6a), rgba(94, 200, 255, 0.85));
  animation: turn-intro-progress-shrink linear forwards;
}
@keyframes turn-intro-progress-shrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  html.native-shell .turn-intro-progress span {
    animation: none;
    transform: scaleX(0.35);
  }
}

html.native-shell .play-loadout {
  margin: 0.35rem 0.45rem 0.15rem;
}
html.native-shell .play-loadout-label {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e8eef5;
  margin-bottom: 0.25rem;
}
html.native-shell .play-loadout-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
html.native-shell .play-micro-slot {
  min-width: 0;
  cursor: pointer;
}
html.native-shell .play-micro-slot .card.micro-card {
  box-shadow: 0 0 0 2px rgba(94, 200, 255, 0.55), 0 3px 10px rgba(94, 200, 255, 0.22);
  border-radius: 10px;
}
html.native-shell .play-loadout-empty {
  margin: 0.25rem 0.45rem 0.2rem;
}
html.native-shell .play-loadout-hint {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: #e8eef5;
  background: rgba(8, 14, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.55rem;
  padding: 0.45rem 0.65rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.native-readout {
  margin: 0.55rem 0.45rem 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  background: rgba(18, 27, 38, 0.78);
  border: 1.5px solid rgba(255, 215, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* Resolution dice use a preserve-3d cube tumble. backdrop-filter on an ancestor
   flattens that context so the roll looks like a static face — drop it here. */
html.native-shell .native-res-calc.native-readout {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(18, 27, 38, 0.94);
}
/* Hand step: keep Control/Vert/Send/Risk pinned under the sticky nav while the hand scrolls. */
html.native-shell .native-hand-step .native-readout {
  position: sticky;
  top: var(--game-nav-offset, calc(env(safe-area-inset-top, 0px) + 4.5rem));
  z-index: 90;
  background: rgba(18, 27, 38, 0.96);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.native-readout-hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.native-readout-hint.native-readout-below-level {
  margin-top: 0.35rem;
  color: var(--warn, #e8a060);
  font-weight: 700;
}
.native-readout-rows {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.native-readout-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.native-readout-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  min-width: 0;
}
.native-readout-k {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.native-readout-k.good { color: #6bc45a; }
.native-readout-k.bad { color: #ff6b6b; }
.native-readout-v {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}
.native-readout-v.good { color: #6bc45a; }
.native-readout-v.bad { color: #ff6b6b; }
.native-readout-v.accent { color: var(--accent); }
.native-readout-send {
  flex-wrap: wrap;
  row-gap: 0.05rem;
}
.native-readout-send-arrow {
  margin: 0 0.12em;
  font-weight: 700;
  color: var(--muted);
}
.native-readout-cap {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.native-readout-cap.is-capped {
  color: var(--accent);
  animation: native-readout-cap-in 0.55s ease-out both;
}
@keyframes native-readout-cap-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.native-readout-row-send {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0.15rem;
}
.native-readout-row-factors {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.2;
}
.native-readout-factor {
  white-space: nowrap;
  color: #9fd0ff;
}
.native-readout-factor.neg {
  color: #ff8f8f;
}
.native-readout-factor small {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: inherit;
  opacity: 0.85;
}
.native-readout-pass {
  margin-left: auto;
  margin-right: 0.15rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffd76a;
  white-space: nowrap;
}
.native-readout-pass-row {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffd76a;
}
.native-readout-info {
  margin-left: auto;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.native-hand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.native-hand-header h3 {
  margin: 0 !important;
}
.btn-fresh-start {
  border: none;
  border-radius: 6px;
  background: #6b4c9a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-fresh-start:hover {
  background: #573d7e;
}
html.native-shell .btn-fresh-start {
  font-size: 0.68rem;
  padding: 0.4rem 0.7rem;
}
.btn-text {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.1rem;
  cursor: pointer;
}
html.native-shell .hand-grid-native {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.5rem;
  row-gap: 0.35rem;
  justify-items: center;
}
html.native-shell .hand-card-slot-native {
  width: 100%;
  max-width: 10.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
html.native-shell .hand-card-slot-native .card,
html.native-shell .hand-card-slot-native .card.compact {
  width: 100%;
}
html.native-shell .hand-card-slot-native.selected .card {
  box-shadow: 0 0 0 2px var(--accent), 0 4px 12px rgba(94, 200, 255, 0.28);
}
html.native-shell .hand-card-slot-native .mini-card-img {
  width: 100%;
  height: auto;
  max-height: 11.5rem;
  object-fit: contain;
}
html.native-shell .native-hand-step .skills-section {
  display: none;
}

/* Fit all four run cards above the action dock — scale by viewport height. */
html.native-shell .runs-grid-2x2 {
  --run-card-max-h: clamp(7.75rem, calc((100dvh - 13rem) / 2), 12.25rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.55rem;
  row-gap: 1.1rem;
  justify-items: stretch;
  margin-bottom: 0.35rem;
}
html.native-shell .run-preview-compact {
  width: 100%;
  max-width: min(100%, calc(var(--run-card-max-h) * 0.88));
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
html.native-shell .run-card-frame {
  position: relative;
  width: 100%;
}
html.native-shell .run-preview-compact .card,
html.native-shell .run-preview-compact .card.small {
  width: 100%;
}
html.native-shell .run-preview-compact .mini-card-img {
  width: 100%;
  height: auto;
  max-height: var(--run-card-max-h);
  object-fit: contain;
  object-position: top center;
}
html.native-shell .run-preview-compact .mini-card-details-link {
  display: none;
}
/* Quiet info affordance — not a loud DETAILS label. */
html.native-shell .card-details-hit {
  position: absolute;
  right: 0.28rem;
  bottom: 0.28rem;
  z-index: 5;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0;
  background: rgba(11, 17, 24, 0.55);
  color: rgba(232, 238, 245, 0.85);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transform: none;
}
/* Swap over the card, top-left — green chip, keeps run-level badge (top-right) clear. */
html.native-shell .run-preview-compact .btn-replace-run,
html.native-shell .hand-card-slot-native .btn-replace-hand {
  position: absolute;
  top: 0.28rem;
  left: 0.28rem;
  right: auto;
  z-index: 5;
  order: 0;
  margin: 0;
  min-width: 1.7rem;
  min-height: 1.7rem;
  padding: 0.15rem;
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 999px;
  background: rgba(45, 138, 78, 0.95);
  color: #fff;
  border: none;
  cursor: pointer;
  opacity: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  text-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html.native-shell .fresh-tracks-tag.compact {
  position: absolute;
  top: 0.28rem;
  left: 2rem;
  z-index: 4;
  font-size: 0.7rem;
  padding: 0.08rem 0.25rem;
  border-radius: 0.3rem;
  background: rgba(0, 0, 0, 0.55);
}
html.native-shell .bail-row {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  text-align: center;
}
.must-bail-note {
  margin: 0.65rem 0.5rem 0.35rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(240, 192, 64, 0.45);
  background: rgba(240, 192, 64, 0.12);
  color: #f5d76e;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
}
.must-bail-note strong {
  color: #ffe08a;
  font-weight: 800;
}
html.native-shell .btn-bail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10rem;
  padding: 0.55rem 1.25rem;
  border-radius: 0.65rem;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: var(--panel-light);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
html.native-shell .btn-bail:hover,
html.native-shell .btn-bail:active {
  border-color: var(--accent);
  color: var(--accent);
}
html.native-shell .btn-bail.active,
html.native-shell .btn-bail.suggested,
.btn-bail.suggested {
  border-color: #f0c040;
  color: #f0c040;
  background: rgba(240, 192, 64, 0.12);
}
html.native-shell .btn-bail.suggested {
  box-shadow: 0 0 0 1px rgba(240, 192, 64, 0.35), 0 2px 10px rgba(240, 192, 64, 0.2);
}
html.native-shell #hand-section {
  scroll-margin-top: 5.5rem;
}
html.native-shell .market-reduced-note {
  font-size: 0.65rem;
  margin-bottom: 0.2rem;
}
html.native-shell .run-slot-placeholder.bail {
  border-color: rgba(240, 192, 64, 0.45);
  color: #f0c040;
}

.card-mod-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: center;
  margin-top: 0.2rem;
}
.card-mod-badge {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.16);
  border: 1px solid rgba(255, 215, 0, 0.45);
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Balatro-like permanent Pro Shop alteration sheen */
.card.is-upgraded,
.run-card-frame.is-upgraded {
  position: relative;
  isolation: isolate;
}
.card.is-upgraded {
  overflow: hidden;
  box-shadow:
    0 0 0 1.5px rgba(240, 192, 64, 0.75),
    0 0 14px rgba(240, 192, 64, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.35);
}
.card.mini-run-card.is-upgraded.selected {
  /* Keep selection ring readable over the gold upgrade glow. */
  outline-color: #ffe08a;
}
html.native-shell .run-card-frame.is-upgraded {
  border-radius: 10px;
  box-shadow:
    0 0 0 2px rgba(240, 192, 64, 0.85),
    0 0 16px rgba(240, 192, 64, 0.4);
}
html.native-shell .run-card-frame.is-upgraded .card.mini-run-card {
  /* Frame carries the glow; keep the mini face clean under overlays. */
  box-shadow: none;
}
.card-upgrade-sheen {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  overflow: hidden;
  background:
    linear-gradient(
      115deg,
      transparent 14%,
      rgba(255, 236, 160, 0.14) 34%,
      rgba(255, 255, 255, 0.42) 48%,
      rgba(240, 192, 64, 0.22) 60%,
      transparent 78%
    );
  background-size: 220% 100%;
  animation: card-upgrade-sheen-sweep 3.6s ease-in-out infinite;
  mix-blend-mode: screen;
}
/* Extra foil layer so dark mountain mini art still reads as altered. */
.card.is-upgraded::after {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 220, 120, 0.12), transparent 42%, rgba(240, 192, 64, 0.1));
}
html.native-shell .native-res-loadout .play-micro-slot .card-mod-badges {
  margin-top: 0.12rem;
}
html.native-shell .native-res-loadout .play-micro-slot .card-mod-badge {
  font-size: 0.55rem;
}
html.native-shell .run-preview-compact.is-upgraded .card-mod-badges {
  margin-top: 0.14rem;
}
@keyframes card-upgrade-sheen-sweep {
  0%, 100% { background-position: 120% 0; opacity: 0.75; }
  45% { background-position: -20% 0; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .card-upgrade-sheen { animation: none; background-position: 40% 0; }
}

/* Reserved caption under selection cards (Pro Shop boosts, etc.). */
.card-impact-line {
  box-sizing: border-box;
  width: 100%;
  min-height: 1.15rem;
  margin-top: 0.22rem;
  padding: 0 0.15rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-impact-line.has-pass-boost {
  color: #ffd76a;
  font-weight: 800;
}
.card-impact-line.is-empty {
  visibility: hidden;
}
html.native-shell .card-impact-line {
  min-height: 1.2rem;
  margin-top: 0.18rem;
  font-size: 0.68rem;
}
html.native-shell .hand-card-slot .btn-replace-hand {
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
}
.native-instructions-overlay { position:fixed; inset:0; z-index:100; display:flex; align-items:flex-end; background:rgba(0,0,0,.62); padding:12px; }
.native-instructions-sheet { position:relative; width:100%; max-height:82vh; overflow:auto; padding:24px 20px calc(24px + env(safe-area-inset-bottom)); border-radius:18px 18px 8px 8px; background:#13202a; color:#dce5ec; box-shadow:0 -10px 30px #0008; line-height:1.5; }
.native-instructions-sheet h2 { color:var(--gold); margin-top:0; }.native-instructions-sheet strong { color:#f4ead5; }.native-instructions-close { position:absolute; top:10px; right:12px; border:0; background:none; color:#dce5ec; font-size:28px; }
.btn-mobile-instructions { margin:10px auto; display:block; }

/* --- First-run coach marks (FTUE) --- */
/*
  Spotlight = four .ftue-veil-panel bands around the target hole (built in JS).
  A full-sheet veil cannot sit above #game-root (z-index:1 under run scenes)
  without covering every card — mask/clip-path cutouts were also misaligned.
  Panels never cover the target, so the card stays bright and tappable.
  Interaction lock: .ftue-dimmed + capture click guard + action gates.
  Scroll lock: freeze the game surface so free-pan can't derail tips.
*/
html.ftue-lock,
html.ftue-lock body {
  overflow: hidden !important;
  overscroll-behavior: none;
}
html.ftue-lock body {
  /* Overflow lock only — avoid touch-action:none here; it broke WKWebView
     tap→click on .ftue-target cards (Helmet / Powder Skis). Pan is blocked
     via non-passive touchmove preventDefault (except on targets/coach). */
  position: relative;
}
html.ftue-lock #game-root {
  overflow: hidden !important;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
/* Programmatic scrollIntoView (withFtueScrollAllowed) — lift CSS lock briefly. */
html.ftue-lock.ftue-scroll-unlock,
html.ftue-lock.ftue-scroll-unlock body {
  overflow: auto !important;
}
html.ftue-lock.ftue-scroll-unlock #game-root {
  overflow: visible !important;
}
/* Spotlight targets must accept taps on iOS. */
html.ftue-lock .ftue-target,
html.ftue-lock .ftue-target * {
  touch-action: manipulation;
  pointer-events: auto !important;
}
/*
  Body-level tap proxy over the highlighted card (z-index above coach).
  Solves Tip 12: Helmet was `.disabled` with no listeners after Gloves focus.
*/
.ftue-target-proxy {
  position: fixed;
  z-index: 620;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}
/* Coach / skip-confirm may still pan their own overflow copy. */
html.ftue-lock .ftue-coach-card,
html.ftue-lock .ftue-coach-scroll,
html.ftue-lock #ftue-skip-confirm,
html.ftue-lock #ftue-skip-confirm .nav-info-dialog {
  touch-action: pan-y;
}
.ftue-veil {
  position: fixed;
  inset: 0;
  z-index: 580;
  background: transparent;
  pointer-events: none;
}
.ftue-veil-panel {
  position: absolute;
  background: rgba(4, 10, 16, 0.62);
  pointer-events: none;
}
.ftue-coach {
  position: fixed;
  left: 0;
  right: 0;
  /* Above native score bar (200) + thumb actions (210) + menus (300/500) + veil (580). */
  bottom: 0;
  z-index: 600;
  display: flex;
  justify-content: center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
html.native-shell .ftue-coach {
  bottom: calc(var(--score-bar-height, 2.75rem) + 0.25rem);
  padding-bottom: 12px;
}
.ftue-coach.ftue-coach-anchored {
  inset: 0;
  bottom: 0;
  padding: 0;
  display: block;
  background: transparent;
}
.ftue-coach.ftue-coach-above-action,
.ftue-coach.ftue-coach-upper {
  /* Tip sits above the hand / action bar; card position is set in JS. */
  pointer-events: none;
}
.ftue-coach.ftue-coach-upper .ftue-coach-card {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}
.ftue-coach-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: #152432;
  color: #dce5ec;
  border: 1px solid rgba(212, 175, 106, 0.45);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
  animation: ftue-coach-fade-in 180ms ease-out;
  /* Height clamps scroll the copy pane — never the Got it footer. */
  overflow: hidden;
}
.ftue-coach-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.ftue-coach-footer {
  flex: 0 0 auto;
  padding-top: 0.35rem;
  /* Match card fill so scrolling copy never paints over Got it. */
  background: #152432;
  position: relative;
  z-index: 1;
}
@keyframes ftue-coach-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ftue-target-pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(94, 200, 255, 0.95), 0 0 14px rgba(94, 200, 255, 0.45);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(94, 200, 255, 1), 0 0 28px rgba(94, 200, 255, 0.7);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ftue-coach-card {
    animation: none;
  }
  .ftue-target,
  #nav-safe.ftue-target,
  #nav-push.ftue-target,
  #nav-gear-ready.ftue-target,
  #selection-ready.ftue-target {
    animation: none;
  }
}
.ftue-target {
  position: relative;
  /* Within #game-root stacking context — above siblings; veil hole leaves it uncovered. */
  z-index: 40;
  border-radius: 12px;
  filter: none !important;
  opacity: 1 !important;
  box-shadow: 0 0 0 3px rgba(94, 200, 255, 0.95), 0 0 18px rgba(94, 200, 255, 0.45) !important;
  animation: ftue-target-pulse 1.35s ease-in-out infinite;
  pointer-events: auto !important;
  /* Keep highlighted hand cards above the bottom tip sheet. */
  scroll-margin-bottom: min(42vh, 280px);
  scroll-margin-top: 96px;
}
/* Lineup Control / Vert / Send / Risk strip — keep the glow above dimmed siblings. */
#native-readout.ftue-target,
.native-readout.ftue-target,
.stat-breakdown-panel.ftue-target,
.selection-info.ftue-target,
.game-nav-mode.ftue-target,
.native-res-hero.ftue-target {
  z-index: 55;
  box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.95), 0 0 22px rgba(212, 175, 106, 0.5) !important;
  background: rgba(28, 42, 58, 0.92);
  animation: none;
}
.ftue-dimmed {
  opacity: 0.28;
  filter: grayscale(0.45) brightness(0.72);
  pointer-events: none !important;
}
#nav-safe.ftue-target,
#nav-push.ftue-target,
#nav-gear-ready.ftue-target,
#selection-ready.ftue-target {
  position: relative;
  z-index: 620 !important;
  box-shadow: 0 0 0 3px rgba(94, 200, 255, 0.95), 0 0 18px rgba(94, 200, 255, 0.5) !important;
  animation: ftue-target-pulse 1.35s ease-in-out infinite;
}
html.native-shell .mobile-action-bar:has(.ftue-target),
.mobile-action-bar:has(.ftue-target) {
  z-index: 620;
}
/* During FTUE, non-target action buttons stay inert even if somehow not dimmed. */
html.ftue-lock .mobile-action-bar .nav-btn:not(.ftue-target) {
  pointer-events: none !important;
}
.ftue-setup-banner {
  margin: 0.75rem 0 0.25rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: rgba(212, 175, 106, 0.12);
  border: 1px solid rgba(212, 175, 106, 0.45);
  color: #f4ead5;
}
.ftue-setup-banner strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--gold, #d4af6a);
}
.ftue-setup-banner p {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0.92;
}
.ftue-setup-banner .btn-primary {
  width: 100%;
}
.ftue-coach-meta {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold, #d4af6a);
  margin-bottom: 0.35rem;
}
.ftue-coach-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: #f4ead5;
}
.ftue-coach-card p {
  margin: 0 0 0.75rem;
  line-height: 1.45;
  font-size: 0.92rem;
}
.ftue-coach-scroll > p:last-child {
  margin-bottom: 0.35rem;
}
.ftue-coach-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.ftue-coach-actions:empty {
  display: none;
}
.ftue-coach-actions .btn-primary {
  min-height: 40px;
  min-width: 7rem;
}
/* Centering wrapper is NOT clickable — only the inline Skip tips control is. */
.ftue-skip-row {
  display: flex;
  justify-content: center;
  margin-top: 0.55rem;
  pointer-events: none; /* row chrome never activates skip */
}
.ftue-skip-quiet {
  display: inline-block;
  width: auto;
  max-width: max-content;
  margin: 0;
  padding: 0.15rem 0.35rem;
  border: 0;
  background: none;
  color: rgba(220, 229, 236, 0.42);
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  pointer-events: auto; /* re-enable on the text control only */
}
.ftue-skip-quiet:hover,
.ftue-skip-quiet:focus-visible {
  color: rgba(220, 229, 236, 0.7);
}
/* Above coach (600) + veil panels (580) so Keep tips / Skip tips stay usable. */
.ftue-skip-confirm.card-detail-overlay {
  z-index: 650;
}
.ftue-pref-row {
  margin-top: 0.75rem;
}
/* Separate “Replay tips” from Exit / reset when still stacked in one pane. */
.ftue-pref-row + .game-menu-actions:not(.prefs-dialog-foot) {
  margin-top: 1.15rem;
}
#replay-ftue-from-help {
  display: block;
  width: 100%;
  margin-top: 1rem;
}

/* --- BTC Lift Medals --- */
.setup-optional {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.65;
}
.btc-active-challenge {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.35;
}
.btc-active-challenge strong {
  color: var(--gold, #d4af6a);
}
.btc-active-challenge.is-none {
  opacity: 0.85;
}
.btn-btc-medals {
  width: 100%;
}
/* Non-native phone: collapse empty options bay (BTC/MC use inline Start). */
@media (max-width: 700px) {
  .setup-screen:not(.setup-screen-native) .setup-mode-options:not(:has(.setup-section)) {
    display: none;
  }
}
.btc-screen-nav {
  display: flex;
  align-items: center;
  margin: 0 0 0.35rem;
  min-height: 2.25rem;
}
.btc-back-btn {
  margin: 0;
  padding: 0.45rem 0.75rem;
  background: #0a1018;
  color: #f5f8fc;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.btc-back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btc-challenge-select-screen .setup-header {
  position: relative;
  padding-top: 0;
}
.btc-medals-screen .btc-points-total {
  margin-top: 0.15rem;
}
.btc-challenge-switch-row {
  margin: 0 0 0.85rem;
}
.btc-challenge-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.35rem 0.15rem;
  border: 0;
  background: transparent;
  color: #dce5ec;
  text-align: left;
  cursor: pointer;
}
.btc-challenge-switch-track {
  position: relative;
  width: 2.7rem;
  height: 1.55rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(220, 229, 236, 0.18);
  border: 1px solid rgba(220, 229, 236, 0.22);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btc-challenge-switch-knob {
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #dce5ec;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btc-challenge-switch.is-on .btc-challenge-switch-track {
  background: rgba(94, 186, 160, 0.35);
  border-color: rgba(158, 224, 178, 0.55);
}
.btc-challenge-switch.is-on .btc-challenge-switch-knob {
  transform: translateX(1.1rem);
  background: #9ee0b2;
}
.btc-challenge-switch-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.btc-challenge-switch-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #f4ead5;
}
.btc-challenge-switch-hint {
  font-size: 0.75rem;
  opacity: 0.72;
  line-height: 1.3;
}
.btc-challenge-switch:not(.is-on) .btc-challenge-switch-title {
  opacity: 0.78;
}
.btc-challenge-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.btc-challenge-tile {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  justify-items: center;
  gap: 0.18rem;
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  max-height: none;
  padding: 0.55rem 0.45rem 0.5rem;
  border-radius: 14px;
  border: 1px solid rgba(220, 229, 236, 0.18);
  background: rgba(19, 32, 42, 0.92);
  color: #dce5ec;
  text-align: center;
  cursor: pointer;
  min-height: 0;
  overflow: hidden;
}
.btc-challenge-tile-pin {
  position: relative;
  display: grid;
  place-items: center;
  width: min(78%, 7.25rem);
  height: auto;
  align-self: end;
}
.btc-challenge-tile .btc-medal-art {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  filter: none;
}
.btc-challenge-tile .btc-medal-art.is-locked {
  opacity: 0.9;
}
.btc-challenge-tile .btc-medal-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}
.btc-challenge-tile .btc-medal-art.is-locked img {
  filter:
    grayscale(0.75) brightness(0.78)
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}
.btc-challenge-clear-badge {
  position: absolute;
  right: -0.15rem;
  bottom: -0.1rem;
  min-width: 1.45rem;
  padding: 0.12rem 0.35rem;
  border-radius: 999px;
  background: rgba(12, 18, 24, 0.94);
  border: 1px solid rgba(212, 175, 106, 0.65);
  color: #f4ead5;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  z-index: 1;
}
.btc-challenge-tile.active {
  border-color: rgba(212, 175, 106, 0.75);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 106, 0.4);
}
.btc-challenge-tile.is-earned {
  border-color: rgba(158, 224, 178, 0.28);
}
.btc-challenge-tile.is-earned.active {
  border-color: rgba(212, 175, 106, 0.75);
}
.btc-challenge-tile .btc-challenge-title {
  font-weight: 700;
  font-size: 0.78rem;
  color: #f4ead5;
  line-height: 1.15;
  max-width: 100%;
}
.btc-challenge-tile .btc-challenge-hint {
  font-size: 0.64rem;
  opacity: 0.7;
  line-height: 1.2;
  max-width: 100%;
}
.btc-challenge-progress {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(232, 226, 212, 0.9);
}
.btc-challenge-tile.is-earned .btc-challenge-progress {
  color: #9ee0b2;
}
.btc-challenge-lifetime-note {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(220, 229, 236, 0.68);
}
.btc-challenge-tile .btc-challenge-meta {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.78;
}
@media (max-width: 420px) {
  .btc-challenge-tile .btc-challenge-hint {
    display: none;
  }
  .btc-challenge-tile-pin {
    width: min(84%, 7.75rem);
  }
}
/* Legacy row layout kept for any leftover markup */
.btc-challenge-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.55rem;
}
.btc-challenge-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(220, 229, 236, 0.18);
  background: rgba(19, 32, 42, 0.9);
  color: #dce5ec;
  text-align: left;
  cursor: pointer;
  min-height: 4.5rem;
}
.btc-challenge-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #f4ead5;
  line-height: 1.2;
}
.btc-challenge-hint {
  font-size: 0.72rem;
  opacity: 0.75;
  line-height: 1.3;
}
.btc-challenge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-top: 0.1rem;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.8;
}
.btc-challenge-state {
  opacity: 0.75;
}
.btc-challenge-ladder-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.btc-challenge-clears {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: rgba(232, 226, 212, 0.72);
}
.btc-challenge-ladder-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0 0.15rem 0.15rem 3.6rem;
}
.btc-ladder-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.2rem;
  border-radius: 8px;
  border: 1px dashed rgba(220, 229, 236, 0.2);
  background: rgba(0, 0, 0, 0.18);
  color: #dce5ec;
  cursor: pointer;
}
.btc-ladder-slot.earned {
  border-style: solid;
  border-color: rgba(158, 224, 178, 0.35);
  background: rgba(30, 48, 40, 0.45);
}
.btc-ladder-slot.is-new {
  box-shadow: 0 0 0 1px rgba(212, 175, 106, 0.55);
}
.btc-ladder-slot .btc-medal-art {
  width: 40px;
  height: 40px;
}
.btc-ladder-slot-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
.btc-medal-count-chip {
  position: absolute;
  right: -0.2rem;
  bottom: -0.15rem;
  min-width: 1.35rem;
  padding: 0.05rem 0.28rem;
  border-radius: 999px;
  background: rgba(12, 18, 24, 0.92);
  border: 1px solid rgba(212, 175, 106, 0.55);
  color: #f4ead5;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
}
.btc-award-walls {
  margin: 1rem 0 0.5rem;
  padding: 0.85rem 0.75rem;
  border-radius: 12px;
  background: rgba(15, 24, 32, 0.85);
  border: 1px solid rgba(212, 175, 106, 0.25);
}
.btc-wall-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.btc-wall-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--gold, #d4af6a);
}
.btc-wall-progress {
  font-size: 0.75rem;
  opacity: 0.7;
}
.btc-wall-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.15rem;
}
.btc-wall-tabs::-webkit-scrollbar {
  display: none;
}
.btc-wall-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(220, 229, 236, 0.2);
  background: transparent;
  color: #dce5ec;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}
.btc-wall-tab.active {
  background: rgba(212, 175, 106, 0.18);
  border-color: rgba(212, 175, 106, 0.55);
  color: #f4ead5;
}
.btc-wall-tab-count {
  opacity: 0.7;
  margin-left: 0.25rem;
}
.btc-medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.45rem;
}
.btc-medal-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.btc-medal-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px dashed rgba(220, 229, 236, 0.22);
  background: rgba(0, 0, 0, 0.2);
  text-align: left;
}
.btc-medal-row.earned {
  border-style: solid;
  border-color: rgba(212, 175, 106, 0.55);
  background: rgba(212, 175, 106, 0.12);
}
.btc-medal-row.is-new {
  box-shadow: 0 0 0 1px rgba(94, 200, 255, 0.55);
}
.btc-medal-row-main {
  min-width: 0;
  flex: 1;
}
.btc-medal-row .btc-medal-name {
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}
.btc-medal-rule {
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.75;
  color: #dce5ec;
}
.btc-medal-row.empty .btc-medal-name,
.btc-medal-row.empty .btc-medal-rule {
  opacity: 0.72;
}
.btc-medal-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}
.btc-medal-state {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.btc-medal-row.earned .btc-medal-state {
  color: #9ee0b2;
  opacity: 1;
}
.btc-medal-art {
  --rarity: #e8e2d4;
  position: relative;
  width: 52px;
  height: 52px;
  /* Show the pin/medal asset as-is — no circular chrome clip or ring. */
  overflow: visible;
  flex-shrink: 0;
  background: transparent;
  /* Filter the <img>, not this wrapper — WKWebView flattens transparent PNGs onto black. */
  filter: none;
}
.btc-medal-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}
.btc-medal-art.is-locked {
  opacity: 0.72;
}
.btc-medal-art.is-locked img {
  filter:
    grayscale(0.85) brightness(0.72)
    drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}
.btc-medal-art.is-missing {
  display: none;
}
.btc-medal-slot .btc-medal-art {
  width: 56px;
  height: 56px;
  margin-bottom: 0.15rem;
}
.btc-medal-row .btc-medal-art {
  width: 56px;
  height: 56px;
}
.btc-medal-slot {
  min-height: 64px;
  border-radius: 8px;
  padding: 0.45rem 0.35rem;
  border: 1px dashed rgba(220, 229, 236, 0.22);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
}
.btc-medal-slot.earned {
  border-style: solid;
  border-color: rgba(212, 175, 106, 0.55);
  background: rgba(212, 175, 106, 0.12);
}
.btc-medal-slot.is-new {
  box-shadow: 0 0 0 1px rgba(94, 200, 255, 0.55);
}
.btc-medal-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f4ead5;
  line-height: 1.2;
}
.btc-medal-slot.empty .btc-medal-name {
  color: rgba(220, 229, 236, 0.55);
}
.btc-medal-tier {
  font-size: 0.65rem;
  opacity: 0.6;
}
.btc-new-pins {
  margin: 0.85rem 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(45, 138, 78, 0.16);
  border: 1px solid rgba(45, 138, 78, 0.45);
}
.btc-new-pins h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: #9ee0b2;
}
.btc-new-pins-compact {
  width: min(100%, 24rem);
  margin: 0.35rem auto 0;
  padding: 0.55rem 0.55rem 0.65rem;
}
.btc-new-pins-compact h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
}
.btc-new-pins-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(158, 224, 178, 0.2);
  color: #9ee0b2;
  font-size: 0.72rem;
  font-weight: 800;
}
.btc-new-pins-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}
.btc-new-pin-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.3rem 0.15rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.btc-new-pin-tile .btc-medal-art {
  width: 44px;
  height: 44px;
}
.btc-new-pin-tile-name {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
  color: #f4ead5;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.btc-missed-pins {
  margin: 0.85rem auto 0;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  background: rgba(12, 22, 36, 0.88);
  border: 1px solid rgba(240, 215, 140, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.btc-missed-pins h3 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffe9a8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btc-missed-pins .btc-new-pins-count {
  background: rgba(255, 233, 168, 0.22);
  color: #ffe9a8;
  font-size: 0.8rem;
}
.btc-missed-pins-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.btc-missed-pin-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}
.btc-missed-pin-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.4rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  min-width: 0;
}
.btc-missed-pin-art {
  flex: 0 0 auto;
  opacity: 0.72;
  filter: grayscale(0.35);
}
.btc-missed-pin-art .btc-medal-art {
  width: 40px;
  height: 40px;
}
.btc-missed-pin-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}
.btc-missed-pin-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff6e0;
}
.btc-missed-pin-progress-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffd978;
}
.btc-missed-pin-bar {
  display: block;
  height: 4px;
  margin-top: 0.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.btc-missed-pin-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c9a227, #f0d78c);
}
.btc-missed-pin-hint {
  font-size: 0.74rem;
  line-height: 1.3;
  color: rgba(236, 242, 248, 0.9);
}
.btc-missed-try-again {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(74, 144, 217, 0.55);
  background: rgba(74, 144, 217, 0.22);
  color: #d7e8ff;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
}
.btc-missed-try-again:active {
  transform: translateY(1px);
}
.history-detail .btc-missed-pins {
  margin: 0 0 1.1rem;
  width: min(100%, 24rem);
}
.btc-new-pin-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.btc-new-pin-wall {
  opacity: 0.7;
  font-size: 0.8rem;
  text-transform: capitalize;
}
.btc-new-pin-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.btc-medal-row,
.btc-medal-slot {
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.btc-medal-row {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.btc-medal-slot {
  appearance: none;
  -webkit-appearance: none;
}

/* Pin celebrate (earn) + feature detail */
.btc-pin-celebrate-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse at 50% 20%, rgba(212, 175, 106, 0.22), transparent 55%),
    linear-gradient(180deg, #0b1118 0%, #121c28 55%, #0b1118 100%);
}
.btc-pin-celebrate {
  width: min(100%, 26rem);
  text-align: center;
  animation: btc-pin-celebrate-in 420ms ease-out;
}
@keyframes btc-pin-celebrate-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btc-pin-celebrate { animation: none; }
}
.btc-pin-celebrate-eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold, #d4af6a);
}
.btc-pin-celebrate-art {
  width: min(72vw, 280px);
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(212, 175, 106, 0.45),
    0 18px 48px rgba(0, 0, 0, 0.55);
  background: rgba(0, 0, 0, 0.35);
}
.btc-pin-celebrate-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.btc-pin-celebrate-name {
  margin: 0 0 0.35rem;
  font-size: clamp(1.55rem, 6vw, 2.1rem);
  line-height: 1.15;
  color: #f4ead5;
}
.btc-pin-celebrate-wall {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(220, 229, 236, 0.75);
}
.btc-pin-celebrate-rule {
  margin: 0 auto 1.25rem;
  max-width: 22rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: rgba(220, 229, 236, 0.85);
}
.btc-pin-celebrate .btn-large {
  width: 100%;
}
.btc-pin-feature-screen .btc-pin-feature {
  text-align: center;
  padding: 0.35rem 0 1rem;
}
.btc-pin-feature-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold, #d4af6a);
}
.btc-pin-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
}
.btc-pin-crumb {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.15rem 0.1rem;
  margin: 0;
  color: var(--gold, #d4af6a);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  text-decoration: none;
  border-radius: 4px;
}
.btc-pin-crumb:hover,
.btc-pin-crumb:focus-visible {
  color: #f0d9a0;
  text-decoration: underline;
  outline: none;
}
.btc-pin-crumb.is-current {
  color: rgba(220, 229, 236, 0.72);
  cursor: default;
  text-decoration: none;
  pointer-events: none;
}
.btc-pin-crumb-sep {
  color: rgba(220, 229, 236, 0.35);
  font-weight: 700;
  pointer-events: none;
}
.btc-pin-feature-art {
  --rarity: #e8e2d4;
  position: relative;
  width: min(78vw, 300px);
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--rarity) 45%, transparent),
    0 14px 36px rgba(0, 0, 0, 0.45);
}
.btc-pin-feature-art.is-locked {
  /* Do not filter this wrapper — WebKit flattens transparent pin overlays onto black. */
  opacity: 0.85;
}
.btc-pin-feature-art.is-locked > img {
  filter: grayscale(0.7) brightness(0.78);
}
.btc-pin-feature-art > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.btc-pin-feature-pin {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  width: 28%;
  aspect-ratio: 1;
  /* Pin asset already has its rim — float it over the badge without a CSS circle. */
  overflow: visible;
  background: transparent;
  padding: 0;
}
.btc-pin-feature-pin img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}
.btc-pin-feature-name {
  margin: 0 0 0.45rem;
  font-size: clamp(1.45rem, 5.5vw, 2rem);
  color: #f4ead5;
  line-height: 1.15;
}
.btc-pin-feature-rule {
  margin: 0 auto 0.85rem;
  max-width: 24rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: rgba(220, 229, 236, 0.85);
}
.btc-pin-feature-achieved {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin: 0 auto 0.85rem;
  padding: 0.65rem 1rem;
  max-width: 22rem;
  border-radius: 12px;
  background: rgba(158, 224, 178, 0.1);
  border: 1px solid rgba(158, 224, 178, 0.28);
}
.btc-pin-feature-achieved.is-locked {
  background: rgba(220, 229, 236, 0.06);
  border-color: rgba(220, 229, 236, 0.14);
}
.btc-pin-feature-achieved-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(158, 224, 178, 0.85);
}
.btc-pin-feature-achieved.is-locked .btc-pin-feature-achieved-label {
  color: rgba(220, 229, 236, 0.45);
}
.btc-pin-feature-achieved-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #9ee0b2;
  line-height: 1.3;
  text-align: center;
}
.btc-pin-feature-achieved.is-locked .btc-pin-feature-achieved-value {
  color: rgba(220, 229, 236, 0.55);
  font-weight: 600;
}
.btc-pin-feature-swipe-hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(220, 229, 236, 0.45);
}
.btc-pin-feature-clears {
  margin: -0.35rem auto 0.85rem;
  max-width: 24rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(158, 224, 178, 0.9);
}
.btc-pin-feature-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(220, 229, 236, 0.7);
}
.btc-pin-feature-meta .is-earned {
  color: #9ee0b2;
}
.btc-pin-feature-meta .is-locked {
  color: rgba(220, 229, 236, 0.55);
}
.btc-pin-detail-screen .btc-pin-feature {
  touch-action: pan-y;
  outline: none;
}


/* Localized CSS card faces in Explore Deck */
.deck-explore-card-face {
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.deck-explore-card-face .card {
  width: 100%;
  max-width: 11rem;
  min-height: 14rem;
  font-size: 0.72rem;
}
.deck-explore-card-face .card-details {
  font-size: 0.68rem;
}
.deck-explore-card-face .card-name {
  font-size: 0.85rem;
  line-height: 1.2;
}
.card-detail-art-css {
  display: flex;
  justify-content: center;
  padding: 0.5rem;
}
.card-detail-art-css .card {
  width: min(22rem, 92vw);
  max-width: 100%;
}
.turn-brief-mini .card.small {
  min-height: 10rem;
}

/* Web browser uses the same native play UX as iOS. On wide screens, stage it
   as a phone-width column so the layout matches the app instead of stretching. */
html.play-web {
  --play-web-col: 32rem;
}

html.play-web.native-shell #debug-fab,
html.play-web.native-shell .report-fab,
html.play-web.native-shell #report-problem-btn {
  display: block !important;
}

@media (min-width: 701px) {
  html.play-web.native-shell .game-screen-native,
  html.play-web.native-shell .game-end-screen-native {
    max-width: var(--play-web-col);
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  }

  html.play-web.native-shell .mobile-action-bar,
  html.play-web.native-shell .turn-intro-overlay {
    left: 50%;
    right: auto;
    width: var(--play-web-col);
    max-width: var(--play-web-col);
    transform: translateX(-50%);
  }
}
