/* Arena presentation only: preserve the shared race geometry and betting layout. */
.app-shell {
  --arena-navy: #001527;
  --arena-panel: #052b3d;
  --arena-gold: #f3d17b;
  --arena-muted: #aec8d5;
  background: var(--arena-navy);
  color: #f5f4e9;
}
.app-shell .race-panel {
  background: var(--arena-navy);
  border-color: #7d784f;
}
.app-shell .race-toolbar,
.app-shell .gameplay-controls {
  background: linear-gradient(110deg, #062e43, #001624 75%);
  border-color: #b19a55;
  box-shadow: none;
}
.app-shell .race-toolbar {
  border-bottom: 1px solid #b19a55;
}
.app-shell .race-heading {
  min-width: 0;
}
.app-shell .race-heading-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.app-shell .race-heading-line h2 {
  white-space: nowrap;
  flex-shrink: 0;
}
.app-shell #header-course {
  color: var(--arena-muted);
  font-size: 11px;
  line-height: 1.2;
}
.app-shell .phase-indicator {
  position: relative;
}
.app-shell #header-section {
  display: block;
  margin-top: 3px;
  color: var(--arena-muted);
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
@media (max-width: 700px) {
  .app-shell .race-heading-line {
    gap: 6px;
  }
  .app-shell #header-course {
    max-width: 110px;
    font-size: 10px;
  }
}
.app-shell .race-toolbar h2 {
  font-family: Arial, sans-serif;
  font-weight: 800;
  color: #fff1c4;
}
.app-shell .race-toolbar .eyebrow {
  color: var(--arena-gold);
  letter-spacing: 1.8px;
}
.app-shell .race-toolbar .phase-tag {
  color: #e5eedf;
  background: #063c35;
  border: 1px solid #a7b76a;
  border-radius: 20px;
}
.app-shell .race-toolbar .timer strong {
  color: #ffe290;
  font-variant-numeric: tabular-nums;
}
.app-shell .race-toolbar .timer > span {
  color: var(--arena-muted);
}
.app-shell .game-credits {
  width: clamp(100px, 12vw, 150px);
  color: var(--arena-gold);
  padding: 2px 12px;
  border: 1px solid #bda76a;
  border-radius: 24px;
  background: #00151e;
}
.app-shell .game-credits > span {
  color: #cfdfdf;
}
.app-shell .game-credits > strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.app-shell .game-credits > strong[data-long-balance='true'] {
  font-size: clamp(16px, 2.4vw, 24px);
}
.app-shell .phase-progress {
  background: #163748;
}
.app-shell .phase-progress > span {
  background: linear-gradient(90deg, #bf8f2d, #ffe68a);
}
.app-shell .lobby-scene,
.app-shell .lobby-scene[data-theme='night'] {
  background: radial-gradient(ellipse at 50% 0, #0a4053, #001725 75%);
}
.app-shell .odds-panel {
  background: linear-gradient(130deg, #062f43ed, #001624fa);
  border-color: #b59c57;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 #e5d69730;
}
.app-shell .odds-panel h2 {
  color: #ffe18b;
  font-family: Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 1px;
}
.app-shell .odds-board > b {
  color: #e0d69f;
}
.app-shell .odds-board button {
  background: linear-gradient(145deg, #104153, #052333);
  color: #ffe398;
  border: 1px solid #7c8a69;
  border-radius: 7px;
  box-shadow: inset 0 1px 0 #cce8ef10;
  text-shadow: none;
}
.app-shell .odds-board button small {
  color: #b9d1db;
}
.app-shell .odds-board button[aria-pressed='true'] {
  background: linear-gradient(#ffe593, #d5a338);
  color: #10222c;
  border-color: #fff0b1;
  box-shadow: inset 0 0 0 1px #ffeab0;
}
.app-shell .odds-board button[aria-pressed='true'] small {
  color: #163d44;
}
.app-shell .odds-board button:disabled {
  opacity: 0.6;
}
.app-shell .invalid-pair {
  background: none;
}
.app-shell .last-win {
  color: var(--arena-gold);
  background: #052c3d;
  border-color: #ab9862;
}
.app-shell .last-win small {
  color: var(--arena-muted);
}
.app-shell .board-footer {
  border-color: #416171;
}
.app-shell .board-history > span,
.app-shell .board-history > div {
  background: #0b3342;
  border-color: #6d806a;
  color: #e7e3c3;
}
.app-shell #last-result-indicator {
  background: #063d35;
  border-color: #dfc276;
  color: #ffe59a;
}
.app-shell #bet-amounts {
  color: #e5d9ab;
}
.app-shell #bet-amounts button {
  background: #082f41;
  color: #efdaa0;
  border-color: #748469;
  border-radius: 6px;
  text-shadow: none;
  box-shadow: none;
}
.app-shell #bet-amounts button[aria-pressed='true'] {
  background: linear-gradient(#ffe78f, #d9a136);
  color: #10222c;
  border-color: #ffeab0;
  filter: none;
  box-shadow: inset 0 -2px 0 #b47f24;
}
.app-shell .compact-bet-action {
  background: linear-gradient(#0a4b48, #05312f);
  color: #fff0b8;
  border: 1px solid #bba969;
  border-radius: 7px;
}
.app-shell .game-brand {
  color: #ffe18b;
  font-family: Arial, sans-serif;
  font-weight: 900;
  padding: 3px 6px;
  border-right: 1px solid #7d794e;
}
.app-shell .game-brand strong {
  color: #ffe18b;
}
.app-shell .game-brand img {
  display: block;
  width: clamp(80px, 12vw, 140px);
  height: auto;
  object-fit: contain;
}
.app-shell .game-brand small {
  font-size: 7px;
  text-align: center;
  letter-spacing: 0.3px;
}
.app-shell .bet-hud #selection-summary {
  color: #ffe49a;
}
.app-shell .bet-hud #gameplay-status {
  color: #c1d3dc;
}
.app-shell .sound-button,
.app-shell .horse-character-button,
.app-shell #show-results,
.app-shell #close-results,
.app-shell #close-horses {
  background: linear-gradient(#0b3b4d, #032333);
  border: 1px solid #9f915b;
  border-radius: 7px;
  color: #ffe49a;
  box-shadow: none;
}
.app-shell .sound-button,
.app-shell #show-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px;
  width: 48px;
  height: 44px;
  flex-shrink: 0;
}
.app-shell .sound-button svg,
.app-shell #show-results svg {
  width: 24px;
  height: 24px;
}
.app-shell .sound-button span,
.app-shell #show-results span {
  font:
    800 7px Arial,
    sans-serif;
  color: #ffe49a;
}
.app-shell .sound-button[aria-pressed='false'] {
  color: #96acb7;
}
.app-shell #close-results svg,
.app-shell #close-horses svg {
  width: 24px;
  height: 24px;
}
.app-shell .track-caption,
.app-shell .race-distance,
.app-shell .course-section {
  background: #001d30;
  border: 1px solid #a99764;
  color: #f7eac4;
  border-radius: 5px;
}
.app-shell .phase-stack .stretch-banner {
  background: linear-gradient(#ffe28a, #cd9c32);
  color: #142b35;
  border: 1px solid #ffefb4;
  border-radius: 5px;
  text-shadow: none;
}
.app-shell .betting-closed {
  background: linear-gradient(#083b4b, #001c2e);
  color: #ffe18b;
  border-color: #e2c16d;
  border-radius: 10px;
}
.app-shell .betting-closed span {
  color: #d1e1e6;
}
.app-shell .loading {
  background: #001c2e;
  color: #f0dfb1;
}
.app-shell .spinner {
  border-color: #21485a;
  border-top-color: #ffde80;
}
.app-shell .track-results {
  background: linear-gradient(110deg, #073348, #001726);
  border-color: #ad995c;
  color: #eee6cf;
}
.app-shell .track-places > div {
  background: #052737;
  border-color: #d4ba71;
  border-radius: 6px;
}
.app-shell .track-places .track-second {
  border-color: #9bbecb;
}
.app-shell .track-places b {
  color: #f6d783;
}
.app-shell .track-places strong {
  color: #fff7e5;
}
.app-shell .race-payout {
  background: #021b2a;
  border-color: #9e8e5d;
  color: #f8e6b8;
}
.app-shell .race-payout.won {
  background: #064335;
  border-color: #f6db7a;
}
.app-shell #results-pane,
.app-shell #horse-characters {
  background: radial-gradient(ellipse at top, #08364a, #001726);
  border-color: #c4ad65;
  color: #eef1e8;
}
.app-shell #results-pane .results-board {
  background: none;
  border: 0;
  box-shadow: none;
}
.app-shell #results-pane .podium-card,
.app-shell .horse-character-card {
  background: linear-gradient(#0c3a4b, #052331);
  border-color: #c4aa5b;
  border-radius: 8px;
}
.app-shell #results-pane .second-place {
  border-color: #a1becb;
}
.app-shell #results-pane .results-heading h2,
.app-shell #results-pane .place-label,
.app-shell .character-heading h2 {
  color: #ffe196;
  font-family: Arial, sans-serif;
}
.app-shell #results-pane .second-place .place-label {
  color: #c5e4ef;
}
.app-shell #results-pane .recent-panel {
  background: #052534;
  border-color: #48606a;
}
.app-shell #results-pane .history-item {
  background: #0a3140;
  border-color: #526b6d;
}
.app-shell #results-pane .results-rule,
.app-shell #results-pane .runnerup-note,
.app-shell .character-note {
  color: #bed1db;
}
.app-shell .connection-status,
.app-shell #pick-error {
  background: #123343;
  border: 1px solid #dab769;
  color: #ffe7b0;
}
.app-shell .orientation-notice {
  background: radial-gradient(ellipse, #08394d, #001527);
  color: #fff0c5;
}
.app-shell .game-layout button:focus-visible,
.app-shell #results-pane button:focus-visible,
.app-shell #horse-characters button:focus-visible {
  outline: 2px solid #fff2bd;
  outline-offset: 2px;
}
@media (max-width: 700px) {
  .app-shell .game-credits {
    padding: 2px 8px;
  }
  .app-shell .sound-button,
  .app-shell #show-results {
    width: 40px;
  }
  .app-shell .game-brand {
    padding-inline: 3px;
  }
}

.app-shell #results-pane h2,
.app-shell #results-pane h3,
.app-shell #horse-characters h3 {
  font-family: Arial, sans-serif;
}

/* Finish declaration stays in its own row, below the horses. */
.app-shell .track-results .track-places > div {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(4px, 1vw, 10px);
  padding: 4px 6px;
  min-width: 0;
  overflow: hidden;
}
.app-shell .track-places > div > div {
  min-width: 0;
  text-align: left;
}
.app-shell .track-places strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-shell .finish-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: clamp(30px, 4vw, 48px);
  height: clamp(30px, 4vw, 48px);
  border-radius: 50%;
  border: 2px solid #fff0b0;
  background: linear-gradient(135deg, #fff6bd, #e6aa28 65%, #a96806);
  color: #241600;
  font:
    900 clamp(22px, 3vw, 34px)/1 Arial,
    sans-serif;
  box-shadow: 0 0 12px #edba3655;
}
.app-shell .track-second .finish-number {
  background: linear-gradient(135deg, #f3fcff, #a6c6d4 65%, #587888);
  border-color: #d9eef5;
  color: #082131;
  box-shadow: 0 0 10px #9ac8df33;
}
.app-shell .track-results:not([hidden]) .finish-number {
  animation: finish-reveal 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.app-shell .track-results:not([hidden]) .track-second .finish-number {
  animation-delay: 180ms;
}
.app-shell .race-payout {
  position: relative;
  overflow: hidden;
}
.app-shell .track-results:not([hidden]) .race-payout.won {
  animation: payout-glow 1s ease-in-out 3;
}
.app-shell .race-payout.won::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 25%, #fff2ad66 48%, transparent 70%);
  transform: translateX(-120%);
  animation: payout-shine 1.4s ease-out 2;
}
.app-shell #results-pane .podium-number {
  display: inline-grid;
  place-items: center;
  margin: 3px auto;
  min-width: 40px;
  padding: 4px 10px;
  border: 1px solid #ffe3a0;
  border-radius: 20px;
  background: linear-gradient(#ffeaa0, #d9a527);
  color: #251a02;
  font-size: clamp(18px, 2.6vw, 30px);
  font-weight: 900;
}
.app-shell #results-pane .second-place .podium-number {
  background: linear-gradient(#effaff, #9bbfce);
  border-color: #d7eff9;
}
@keyframes finish-reveal {
  from {
    opacity: 0;
    transform: scale(0.55) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
@keyframes payout-glow {
  50% {
    box-shadow: inset 0 0 20px #ffe08055;
    border-color: #fff5bb;
  }
}
@keyframes payout-shine {
  to {
    transform: translateX(120%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell .track-results:not([hidden]) .finish-number,
  .app-shell .track-results:not([hidden]) .race-payout.won,
  .app-shell .race-payout.won::after {
    animation: none;
  }
}

/* Final call stays in the heading; every betting cell remains reachable. */
.app-shell .betting-heading h2 {
  transition:
    color 200ms,
    background-color 200ms;
}
.app-shell.betting-last-seconds .betting-heading h2 {
  position: relative;
  align-self: center;
  padding: 6px 4px 9px;
  color: #ffe5a0;
  background: #664512;
  border-radius: 6px;
  font-size: clamp(9px, 1.65vw, 20px);
  white-space: nowrap;
}
.app-shell.betting-last-seconds .betting-heading h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--closing-progress);
  background: #ffd160;
  border-radius: 3px;
}
.app-shell.betting-last-seconds .timer {
  color: #ffd160;
}
.app-shell.betting-last-seconds .phase-progress > span {
  background: #ffd160;
}
.app-shell .betting-closed:not([hidden]) {
  animation: betting-lock-in 300ms ease-out both;
}
@keyframes betting-lock-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell .betting-heading h2 {
    transition: none;
  }
  .app-shell .betting-closed:not([hidden]) {
    animation: none;
  }
}
.app-shell #odds-board button.bet-pending {
  outline: 2px dashed #ffe6a0;
  outline-offset: -3px;
}
.app-shell #odds-board button.bet-pending small {
  color: #fff1b8;
}
