:root {
  --background: #f4f6ee;
  --foreground: #111418;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --ink-soft: #667085;
  --line: rgba(17, 20, 24, 0.12);
  --field: #2f8b55;
  --field-dark: #155c3a;
  --gold: #f5bd37;
  --coral: #ef5f4d;
  --cyan: #1aa4c8;
  --green: #178a55;
  --shadow: 0 24px 70px rgba(23, 35, 28, 0.16);
}

body.dark-mode {
  --background: #0e1317;
  --foreground: #eef2f3;
  --panel: rgba(20, 27, 33, 0.9);
  --panel-solid: #161f26;
  --ink-soft: #9aa8b8;
  --line: rgba(226, 232, 240, 0.14);
  --field: #24744b;
  --field-dark: #0e3f29;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(26, 164, 200, 0.18), transparent 30%),
    linear-gradient(135deg, #f7f1db 0%, #e7f3ee 45%, #eef1f8 100%);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}

body.dark-mode {
  background:
    radial-gradient(circle at 12% 8%, rgba(26, 164, 200, 0.18), transparent 30%),
    linear-gradient(135deg, #10151b 0%, #13231f 48%, #0f1720 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
button[aria-busy="true"] {
  cursor: not-allowed;
  opacity: 0.58;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.3rem, 5vw, 5.2rem);
  line-height: 0.94;
}

h2 {
  margin-bottom: 0;
  line-height: 1.05;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.site-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(170px, 0.5fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 42px rgba(23, 35, 28, 0.08);
}

body.dark-mode .site-nav {
  background: rgba(20, 27, 33, 0.84);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--foreground);
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: #101814;
  color: var(--gold);
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  color: var(--ink-soft);
  font-weight: 800;
}

.nav-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: rgba(17, 20, 24, 0.06);
}

.nav-tab {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  padding: 0 14px;
  font-weight: 900;
}

body.dark-mode .nav-tabs {
  background: rgba(226, 232, 240, 0.08);
}

body.dark-mode .nav-tab {
  color: #cbd5e1;
}

.nav-tab.active {
  background: #101814;
  color: #ffffff;
}

body.dark-mode .nav-tab.active {
  background: #f5bd37;
  color: #101814;
}

.nav-actions {
  display: flex;
  justify-self: end;
  gap: 8px;
  align-items: center;
}

.nav-actions .wallet {
  min-width: 132px;
}

.auth-controls {
  display: flex;
  align-items: center;
  min-height: 58px;
}

.settings-auth {
  align-items: stretch;
  min-height: auto;
}

.auth-signed-out,
.auth-signed-in {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-auth .auth-signed-out,
.settings-auth .auth-signed-in {
  width: 100%;
}

.auth-button {
  min-height: 46px;
  padding: 0 14px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.settings-auth .auth-button {
  flex: 1 1 0;
}

#clerk-user-button {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 46px;
}

.settings-button {
  display: grid;
  place-items: center;
  width: 58px;
  min-width: 58px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--foreground);
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.settings-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.settings-icon::before {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background:
    conic-gradient(
      from 0deg,
      currentColor 0 16deg,
      transparent 16deg 44deg,
      currentColor 44deg 60deg,
      transparent 60deg 104deg,
      currentColor 104deg 120deg,
      transparent 120deg 164deg,
      currentColor 164deg 180deg,
      transparent 180deg 224deg,
      currentColor 224deg 240deg,
      transparent 240deg 284deg,
      currentColor 284deg 300deg,
      transparent 300deg 344deg,
      currentColor 344deg 360deg
  );
  content: "";
  -webkit-mask: radial-gradient(circle, transparent 0 13px, #000 14px 17px, transparent 18px);
  mask: radial-gradient(circle, transparent 0 13px, #000 14px 17px, transparent 18px);
}

.settings-icon::after {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.settings-button:hover {
  box-shadow: 0 10px 24px rgba(17, 20, 24, 0.12);
  transform: translateY(-1px);
}

.settings-button[aria-expanded="true"] {
  border-color: rgba(245, 189, 55, 0.55);
  box-shadow: 0 0 0 3px rgba(245, 189, 55, 0.14);
}

.theme-toggle {
  position: relative;
  display: block;
  width: 68px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 3px;
  overflow: hidden;
  transition:
    transform 180ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.theme-toggle:hover {
  box-shadow: 0 10px 24px rgba(17, 20, 24, 0.14);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(circle at 24% 35%, rgba(255, 255, 255, 0.95), transparent 13px),
    linear-gradient(135deg, #bfe8ff, #f7d66a);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7);
  transition:
    background 360ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-thumb {
  position: absolute;
  z-index: 3;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff9c8 0 15%, transparent 16%),
    linear-gradient(135deg, #ffffff, #f7c948);
  box-shadow:
    0 7px 16px rgba(17, 20, 24, 0.24),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
  transition:
    transform 420ms cubic-bezier(0.2, 0.9, 0.2, 1.08),
    background 320ms ease,
    box-shadow 320ms ease;
}

.theme-sun,
.theme-moon {
  position: absolute;
  inset: 0;
  transition:
    opacity 240ms ease,
    transform 420ms cubic-bezier(0.2, 0.9, 0.2, 1.08);
}

.theme-sun::before {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff7ad;
  box-shadow:
    0 -8px 0 -5px #fff7ad,
    0 8px 0 -5px #fff7ad,
    8px 0 0 -5px #fff7ad,
    -8px 0 0 -5px #fff7ad,
    6px 6px 0 -5px #fff7ad,
    -6px -6px 0 -5px #fff7ad,
    6px -6px 0 -5px #fff7ad,
    -6px 6px 0 -5px #fff7ad;
  content: "";
}

.theme-moon {
  opacity: 0;
  transform: translateX(-12px) scale(0.88);
}

.theme-moon::before,
.theme-moon::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.theme-moon::before {
  top: 8px;
  left: 13px;
  width: 16px;
  height: 16px;
  background: #dbeafe;
  box-shadow:
    19px 2px 0 -7px #dbeafe,
    25px 13px 0 -8px #dbeafe,
    6px 20px 0 -8px #dbeafe;
}

.theme-moon::after {
  top: 6px;
  left: 18px;
  width: 16px;
  height: 16px;
  background: #1a2330;
}

.wallet {
  display: grid;
  gap: 3px;
  min-width: 164px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: right;
}

body.dark-mode .wallet,
body.dark-mode .settings-button,
body.dark-mode .theme-toggle {
  background: var(--panel-solid);
}

body.dark-mode .theme-toggle {
  border-color: rgba(245, 189, 55, 0.24);
}

body.dark-mode .theme-track {
  background:
    radial-gradient(circle at 70% 28%, rgba(255, 255, 255, 0.18), transparent 11px),
    linear-gradient(135deg, #111827, #233044);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

body.dark-mode .theme-thumb {
  background:
    radial-gradient(circle at 63% 31%, #233044 0 25%, transparent 26%),
    linear-gradient(135deg, #f8fafc, #b6c2cf);
  box-shadow:
    0 7px 16px rgba(0, 0, 0, 0.38),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
  transform: translateX(30px);
}

body.dark-mode .theme-sun {
  opacity: 0;
  transform: translateX(14px) rotate(35deg) scale(0.84);
}

body.dark-mode .theme-moon {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.wallet span,
.city,
.action-row span,
.result-panel span,
.ticket span {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.wallet strong {
  font-size: 1.2rem;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
}

.settings-card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 22px;
}

.brand-editor-card {
  grid-column: 1 / -1;
}

.settings-card h2 {
  font-size: 1.45rem;
}

.settings-form {
  display: grid;
  gap: 12px;
}

.settings-field {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 900;
}

.settings-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 13px;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 900;
}

.settings-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-button-row .primary-action,
.settings-button-row .ghost-action {
  flex: 1 1 160px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 12px;
}

body.dark-mode .settings-row {
  background: rgba(255, 255, 255, 0.06);
}

.settings-row strong,
.settings-row span {
  display: block;
}

.settings-row strong {
  font-size: 1rem;
}

.settings-row span {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.settings-note {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 900;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.tutorial-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 24px;
  background: rgba(8, 13, 17, 0.58);
  pointer-events: auto;
}

.tutorial-overlay.top-card {
  align-items: start;
}

.tutorial-overlay.hidden {
  display: none;
}

.tutorial-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  padding: 18px;
}

body.dark-mode .tutorial-card {
  background: rgba(20, 27, 33, 0.98);
}

.tutorial-card span {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 950;
}

.tutorial-card strong {
  color: var(--foreground);
  font-size: 1.35rem;
}

.tutorial-card p {
  margin-bottom: 4px;
  color: #425466;
  font-weight: 750;
  line-height: 1.48;
}

body.dark-mode .tutorial-card p {
  color: #b6c2cf;
}

.tutorial-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tutorial-focus {
  position: relative;
  z-index: 40;
  animation: tutorial-pop 980ms ease-in-out infinite;
  outline: 4px solid rgba(245, 189, 55, 0.95);
  outline-offset: 6px;
}

.tutorial-lift {
  z-index: 40;
}

.tutorial-toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 28px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101814;
  color: #ffffff;
  box-shadow: var(--shadow);
  padding: 13px 16px;
  font-weight: 950;
  transform: translate(-50%, 18px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.tutorial-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.dark-mode .tutorial-toast {
  background: #f5bd37;
  color: #101814;
}

.update-modal {
  position: fixed;
  z-index: 130;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 13, 17, 0.62);
  backdrop-filter: blur(12px);
}

.update-modal.hidden {
  display: none;
  pointer-events: none;
}

.update-banner {
  display: grid;
  gap: 10px;
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(245, 189, 55, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(239, 95, 77, 0.18), transparent 34%),
    linear-gradient(145deg, #111827 0%, #172820 58%, #2d2413 100%);
  color: #ffffff;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.38);
  padding: 22px;
  animation: update-pop 320ms cubic-bezier(0.2, 0.9, 0.2, 1.08);
}

.clerk-modal {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 13, 17, 0.58);
  backdrop-filter: blur(14px);
}

.clerk-modal.hidden {
  display: none;
  pointer-events: none;
}

.clerk-modal-panel {
  display: grid;
  gap: 18px;
  width: min(480px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid rgba(11, 29, 22, 0.16);
  border-radius: 8px;
  background: rgba(252, 253, 250, 0.98);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.28);
  padding: 22px;
  animation: update-pop 260ms cubic-bezier(0.2, 0.9, 0.2, 1.08);
}

body.dark-mode .clerk-modal-panel {
  border-color: rgba(255, 255, 255, 0.12);
  background: #101914;
}

.clerk-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.clerk-modal-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
}

.clerk-modal-close {
  min-height: 42px;
  padding: 0 16px;
}

.clerk-modal-host {
  min-height: 420px;
}

.clerk-status-window {
  display: grid;
  gap: 10px;
  min-height: 220px;
  align-content: center;
  border: 1px dashed rgba(11, 29, 22, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 22px;
  text-align: center;
}

.clerk-status-window strong {
  font-size: 1.35rem;
}

.clerk-status-window p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

body.dark-mode .clerk-status-window {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.update-banner span {
  width: fit-content;
  border-radius: 999px;
  background: rgba(245, 189, 55, 0.16);
  color: var(--gold);
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.update-banner strong {
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1;
}

.update-banner p {
  margin-bottom: 4px;
  color: #d7dee7;
  font-weight: 800;
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 6px;
  color: #24756a;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lobby-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  min-height: 470px;
  margin-bottom: 18px;
}

.hero-copy,
.sport-select,
.board-card,
.team-panel,
.bet-console,
.slip-panel,
.invest-chart-panel,
.invest-control-panel,
.settings-card,
.history-board,
.ranking-board,
.record-card,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.simple-lobby {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  min-height: min(620px, calc(100vh - 150px));
}

.hero-copy {
  display: grid;
  align-content: center;
  padding: clamp(26px, 5vw, 60px);
  overflow: hidden;
}

.hero-copy h1 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.hero-line {
  max-width: 660px;
  margin: 18px 0 0;
  color: #425466;
  font-size: clamp(1rem, 2vw, 1.28rem);
  font-weight: 750;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.primary-action,
.ghost-action,
.danger-action,
.pick,
.stake-row button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.primary-action:hover,
.ghost-action:hover,
.danger-action:hover,
.pick:hover,
.stake-row button:hover {
  transform: translateY(-1px);
}

.primary-action {
  padding: 0 18px;
  background: linear-gradient(135deg, #101814, #254b36);
  color: #ffffff;
  font-weight: 950;
}

.ghost-action {
  padding: 0 16px;
  background: #ffffff;
  color: #1d2939;
  font-weight: 900;
}

.danger-action {
  padding: 0 16px;
  background: #fff1f0;
  color: #b42318;
  font-weight: 950;
}

body.dark-mode .ghost-action,
body.dark-mode .danger-action,
body.dark-mode .sport-card,
body.dark-mode .odds-strip span,
body.dark-mode .metric-line,
body.dark-mode .pick,
body.dark-mode .stake-row input,
body.dark-mode .settings-field input,
body.dark-mode .stake-slider,
body.dark-mode .stake-row button,
body.dark-mode .invest-metrics div,
body.dark-mode .ticket,
body.dark-mode .history-item,
body.dark-mode .ranking-item,
body.dark-mode .empty-history,
body.dark-mode .empty-ranking {
  background: var(--panel-solid);
  color: var(--foreground);
}

body.dark-mode .danger-action {
  border-color: rgba(239, 95, 77, 0.32);
  background: rgba(239, 95, 77, 0.14);
  color: #ffb4a8;
}

body.dark-mode .hero-line,
body.dark-mode .result-panel p,
body.dark-mode .notice,
body.dark-mode .version-info,
body.dark-mode .sport-card span {
  color: #b6c2cf;
}

.sport-select {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(24px, 4vw, 46px);
  background:
    linear-gradient(135deg, rgba(16, 24, 20, 0.96), rgba(37, 75, 54, 0.9)),
    #101814;
  color: #ffffff;
}

body.dark-mode .sport-select {
  background:
    linear-gradient(135deg, rgba(8, 13, 17, 0.98), rgba(21, 54, 42, 0.94)),
    #0b1114;
}

body.dark-mode .sport-select .sport-card {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

body.dark-mode .sport-select .sport-card.active {
  background: rgba(245, 189, 55, 0.18);
}

.sport-select h2 {
  max-width: 480px;
  color: #ffffff;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.sport-grid {
  display: grid;
  gap: 10px;
}

.sport-card {
  display: grid;
  gap: 4px;
  min-height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 14px;
  color: #ffffff;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.sport-card:hover {
  transform: translateY(-1px);
}

.sport-card.active {
  border-color: rgba(245, 189, 55, 0.7);
  background: rgba(245, 189, 55, 0.16);
}

.sport-card span {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 850;
}

.sport-card strong {
  font-size: 1.55rem;
}

.board-card {
  min-height: 150px;
  padding: 18px;
}

.board-card h2 {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.odds-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.odds-strip span,
.metric-line {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.odds-strip span {
  padding: 9px 10px;
  font-size: 0.86rem;
  font-weight: 900;
}

.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 0;
  padding: 11px 12px;
}

.metric-line span {
  color: var(--ink-soft);
  font-weight: 800;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 12px;
}

.section-head h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.match-card {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(420px, 1fr) minmax(170px, 220px) minmax(250px, 300px);
  gap: 12px;
  align-items: stretch;
}

.team-panel {
  display: flex;
  min-height: 0;
  max-height: calc(100vh - 170px);
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
}

.team-panel.right {
  text-align: right;
}

.team-panel.right .club-mark,
.team-panel.right .form-pill {
  align-self: flex-end;
}

.club-mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  box-shadow: 0 16px 34px rgba(18, 20, 23, 0.18);
  font-weight: 950;
}

.team-panel h2 {
  margin-bottom: 0;
  font-size: clamp(1.15rem, 1.5vw, 1.7rem);
  line-height: 1.03;
}

.stats {
  display: grid;
  gap: 10px;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.stat-track {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5e9df;
}

body.dark-mode .stat-track {
  background: rgba(226, 232, 240, 0.16);
}

.stat-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
}

.driver-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
  padding: 8px 9px;
}

body.dark-mode .driver-row {
  background: rgba(255, 255, 255, 0.06);
}

.driver-row span {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.driver-row strong {
  flex: 0 0 auto;
  color: var(--foreground);
  font-size: 0.86rem;
}

.form-pill {
  width: fit-content;
  padding: 8px 11px;
  border-radius: 999px;
  background: #132015;
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 800;
}

.bet-console {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  max-height: calc(100vh - 170px);
  overflow: hidden;
  padding: 12px;
}

.bet-live-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.bet-live-head h2 {
  font-size: clamp(1.25rem, 2vw, 2rem);
}

.match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-meta span {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.match-meta strong {
  font-size: 1.1rem;
}

.versus-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 86px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(239, 95, 77, 0.14), transparent, rgba(26, 164, 200, 0.14)),
    #101814;
  color: #ffffff;
  padding: 12px 16px;
  text-align: center;
}

.versus-panel strong {
  overflow-wrap: anywhere;
  color: var(--gold);
  font-size: clamp(1.8rem, 3vw, 3.1rem);
  font-weight: 950;
}

.versus-panel span {
  color: rgba(255, 255, 255, 0.68);
  font-weight: 950;
}

.betting-panel {
  display: grid;
  gap: 8px;
}

.slip-panel {
  align-content: start;
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding: 12px;
}

.slip-panel h2 {
  font-size: 1.18rem;
}

.pick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.pick {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #f9fbf5;
  color: var(--foreground);
}

.pick.active {
  border-color: #101814;
  background: #101814;
  color: #f8fafc;
  box-shadow: 0 12px 28px rgba(18, 20, 23, 0.16);
}

.pick span {
  font-size: 0.82rem;
  font-weight: 800;
}

.pick strong {
  font-size: 1.08rem;
}

.stake-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.stake-row label {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 900;
}

.stake-row input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
  font-weight: 900;
}

.stake-slider {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.stake-slider input {
  grid-column: auto;
  width: 100%;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--green);
}

body.dark-mode .stake-slider input {
  accent-color: var(--gold);
}

.stake-slider-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 850;
}

.stake-slider-labels strong {
  color: var(--foreground);
  font-size: 0.82rem;
}

.stake-slider-labels span:last-child {
  text-align: right;
}

.stake-row button {
  min-height: 38px;
  background: #ffffff;
  color: #1d2939;
  font-weight: 900;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}

.action-row > div {
  display: grid;
  min-height: 46px;
  align-content: center;
  border: 1px dashed rgba(18, 20, 23, 0.18);
  border-radius: 8px;
  padding: 6px 10px;
}

.action-row strong {
  font-size: 1rem;
}

.slip-panel .primary-action {
  min-height: 42px;
}

.ticket {
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: right;
}

.ticket strong {
  font-size: 1.18rem;
}

.stadium-wrap {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 0;
}

.scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 42px;
  border-radius: 8px;
  background: #101814;
  color: #f8fafc;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.16);
  font-weight: 900;
}

.scoreboard strong {
  color: var(--gold);
  font-size: 1.42rem;
}

.event-banner {
  position: absolute;
  z-index: 6;
  top: 54px;
  left: 50%;
  min-width: 180px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(16, 24, 20, 0.9);
  color: #ffffff;
  padding: 8px 12px;
  text-align: center;
  font-weight: 950;
}

.stadium {
  position: relative;
  height: clamp(300px, 43vh, 430px);
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, #193825 0%, #0c1712 100%);
  perspective: 900px;
  box-shadow: var(--shadow);
}

.stand {
  position: absolute;
  left: 4%;
  width: 92%;
  height: 60px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, #28333b 0 26px, #c93f3f 26px 34px, #28333b 34px 60px, #e5b641 60px 68px);
  opacity: 0.92;
}

.top-stand {
  top: 18px;
  transform: rotateX(58deg);
}

.bottom-stand {
  bottom: 12px;
  transform: rotateX(-58deg);
}

.pitch {
  position: absolute;
  inset: 62px 6% 48px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 9%, transparent 9% 18%),
    linear-gradient(90deg, var(--field-dark), var(--field), var(--field-dark));
  box-shadow: 0 35px 45px rgba(0, 0, 0, 0.32);
  transform: rotateX(58deg) rotateZ(0deg);
  transform-origin: 50% 65%;
  transform-style: preserve-3d;
}

.f1-track {
  position: absolute;
  inset: 44px 5% 40px;
  display: none;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 74px 74px,
    linear-gradient(135deg, #26313a, #101820 58%, #0c1116);
  box-shadow: 0 35px 45px rgba(0, 0, 0, 0.32);
  transform: rotateX(56deg) translateY(26px);
  transform-origin: 50% 68%;
  transform-style: preserve-3d;
}

.f1-track::before,
.f1-track::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.f1-track::before {
  opacity: 0.28;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 26px,
      rgba(255, 255, 255, 0.34) 26px 38px,
      transparent 38px 92px
    );
  transform: translateX(0);
}

.f1-track::after {
  background:
    radial-gradient(circle at 22% 50%, rgba(245, 189, 55, 0.22), transparent 18%),
    radial-gradient(circle at 78% 50%, rgba(26, 164, 200, 0.18), transparent 20%);
  mix-blend-mode: screen;
}

.f1-mode .pitch {
  display: none;
}

.f1-mode .f1-track {
  display: block;
}

.f1-mode .event-banner {
  display: none;
}

.track-glow {
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(245, 189, 55, 0.25);
  border-radius: 50%;
  box-shadow:
    inset 0 0 34px rgba(245, 189, 55, 0.16),
    0 0 38px rgba(26, 164, 200, 0.14);
}

.finish-line {
  position: absolute;
  top: 9%;
  right: 10%;
  width: 14px;
  height: 82%;
  background:
    repeating-linear-gradient(
      0deg,
      #f8fafc 0 10px,
      #111827 10px 20px
    );
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.22);
}

.race-lane {
  position: absolute;
  left: 6%;
  right: 12%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.52) 0 24px,
      transparent 24px 72px
    );
  opacity: 0.42;
}

.lane-1 {
  top: 22%;
}

.lane-2 {
  top: 36%;
}

.lane-3 {
  top: 50%;
}

.lane-4 {
  top: 64%;
}

.lane-5 {
  top: 78%;
}

.f1-car {
  position: absolute;
  z-index: 5;
  --car-color: #ef4444;
  --car-accent: #ffffff;
  left: 7%;
  width: 76px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px 9px 9px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0 22%, transparent 24% 62%, rgba(0, 0, 0, 0.24) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 22% 72%, rgba(0, 0, 0, 0.28)),
    var(--car-color);
  box-shadow:
    0 10px 0 rgba(0, 0, 0, 0.34),
    0 18px 24px rgba(0, 0, 0, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.44),
    inset -12px 0 18px rgba(0, 0, 0, 0.22);
  transform: perspective(180px) rotateX(18deg) rotateZ(-1deg) skewX(-8deg);
  translate: 0 0;
  transform-origin: 50% 55%;
  transform-style: preserve-3d;
}

.f1-car::before,
.f1-car::after {
  position: absolute;
  content: "";
}

.f1-car::before {
  z-index: 2;
  top: 6px;
  left: 31px;
  width: 21px;
  height: 15px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 12px 7px 7px 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(15, 23, 42, 0.46)),
    var(--car-accent);
  box-shadow:
    15px 1px 0 -6px rgba(255, 255, 255, 0.58),
    -24px 1px 0 -7px rgba(255, 255, 255, 0.38);
}

.f1-car::after {
  top: -6px;
  left: 10px;
  width: 13px;
  height: 10px;
  border-radius: 999px;
  background: #05070a;
  box-shadow:
    0 32px 0 #05070a,
    46px 0 0 #05070a,
    46px 32px 0 #05070a,
    -7px 16px 20px 2px rgba(0, 0, 0, 0.42);
}

.f1-car span {
  position: relative;
  z-index: 3;
  display: grid;
  height: 100%;
  place-items: center;
  padding-left: 16px;
  font-size: 0.6rem;
  font-weight: 950;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.46);
}

.f1-car span::before {
  position: absolute;
  left: -42px;
  width: 52px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82));
  filter: blur(1px);
  opacity: 0;
  content: "";
}

.car-0 {
  top: calc(22% - 12px);
}

.car-1 {
  top: calc(36% - 12px);
}

.car-2 {
  top: calc(50% - 12px);
}

.car-3 {
  top: calc(64% - 12px);
}

.car-4 {
  top: calc(78% - 12px);
}

.is-racing .f1-track {
  animation: race-camera 10s ease-in-out forwards;
}

.is-racing .f1-track::before {
  animation: track-rush 260ms linear infinite;
}

.is-racing .race-lane {
  animation: lane-rush 210ms linear infinite;
}

.is-racing .f1-car {
  animation:
    f1-sprint 10s linear forwards,
    car-tremble 170ms linear infinite;
}

.is-racing .f1-car span::before {
  animation: speed-flare 310ms linear infinite;
}

.is-racing .f1-car::after {
  animation: wheel-hum 100ms linear infinite;
}

.race-finished .f1-car {
  filter: saturate(1.1);
}

.is-running .pitch {
  animation: camera-sway 10s ease-in-out forwards;
}

.midline,
.center-circle,
.box,
.goal,
.net {
  position: absolute;
  border-color: rgba(255, 255, 255, 0.84);
}

.midline {
  inset: 0 auto 0 50%;
  border-left: 2px solid rgba(255, 255, 255, 0.78);
}

.center-circle {
  top: 50%;
  left: 50%;
  width: 112px;
  height: 112px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.box {
  top: 22%;
  width: 16%;
  height: 56%;
  border: 2px solid rgba(255, 255, 255, 0.78);
}

.box-left {
  left: 0;
  border-left: 0;
}

.box-right {
  right: 0;
  border-right: 0;
}

.goal,
.net {
  top: 39%;
  width: 14px;
  height: 22%;
  border: 2px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.2);
}

.goal-left,
.net-left {
  left: -12px;
}

.goal-right,
.net-right {
  right: -12px;
}

.net {
  z-index: 4;
  opacity: 0.8;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.65) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.65) 0 2px, transparent 2px 9px);
}

.goal-left-side .net-left,
.goal-right-side .net-right {
  animation: net-ripple 850ms ease-out;
}

.keeper,
.player,
.ball {
  position: absolute;
  z-index: 3;
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
  transform: translateZ(18px);
}

.keeper {
  width: 20px;
  height: 20px;
}

.keeper-left {
  left: 6%;
  top: 47%;
}

.keeper-right {
  right: 6%;
  top: 47%;
}

.player {
  width: 18px;
  height: 18px;
}

.player::after,
.keeper::after {
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: inherit;
  content: "";
}

.ball {
  left: 48%;
  top: 48%;
  width: 14px;
  height: 14px;
  background: #f8fafc;
  border: 3px solid #141414;
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.22);
}

.p1 {
  left: 18%;
  top: 46%;
}

.p2 {
  left: 35%;
  top: 28%;
}

.p3 {
  left: 38%;
  top: 68%;
}

.p4 {
  left: 78%;
  top: 48%;
}

.p5 {
  left: 63%;
  top: 30%;
}

.p6 {
  left: 60%;
  top: 68%;
}

.is-running .p1 {
  animation: player-one 10s ease-in-out forwards;
}

.is-running .p2 {
  animation: player-two 10s ease-in-out forwards;
}

.is-running .p3 {
  animation: player-three 10s ease-in-out forwards;
}

.is-running .p4 {
  animation: player-four 10s ease-in-out forwards;
}

.is-running .p5 {
  animation: player-five 10s ease-in-out forwards;
}

.is-running .p6 {
  animation: player-six 10s ease-in-out forwards;
}

.is-running .ball {
  animation: ball-path 10s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.goal-right-side .ball {
  animation: strike-right 1100ms cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
}

.goal-left-side .ball {
  animation: strike-left 1100ms cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
}

.miss-right-side .ball {
  animation: miss-right 950ms ease-out;
}

.miss-left-side .ball {
  animation: miss-left 950ms ease-out;
}

.shot-trail {
  position: absolute;
  z-index: 2;
  left: 44%;
  top: 48%;
  width: 180px;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(246, 190, 63, 0.95), transparent);
  filter: blur(1px);
  opacity: 0;
  transform: rotate(-18deg) translateZ(11px);
}

.goal-right-side .shot-trail,
.miss-right-side .shot-trail {
  animation: trail-right 900ms ease-out;
}

.goal-left-side .shot-trail,
.miss-left-side .shot-trail {
  animation: trail-left 900ms ease-out;
}

.goal-flash {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  opacity: 0;
  border-radius: 8px;
  background: rgba(245, 189, 55, 0.95);
  color: #101814;
  padding: 12px 16px;
  font-size: 1.6rem;
  font-weight: 950;
  transform: translate(-50%, -50%) translateZ(40px) scale(0.8);
}

.goal-left-side .goal-flash,
.goal-right-side .goal-flash {
  animation: goal-flash 900ms ease-out 420ms;
}

.timeline {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 20, 23, 0.12);
}

.timeline-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--cyan));
}

.timeline-fill.run {
  animation: fill-time 10s linear forwards;
}

.invest-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 12px;
  align-items: stretch;
}

.invest-chart-panel,
.invest-control-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.invest-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.invest-head h2,
.invest-control-panel h2 {
  font-size: clamp(1.35rem, 2.3vw, 2.1rem);
}

.invest-clock {
  display: grid;
  min-width: 110px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 12px;
  text-align: right;
}

body.dark-mode .invest-clock {
  background: var(--panel-solid);
}

.invest-clock span,
.invest-metrics span {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 850;
}

.invest-clock strong {
  font-size: 1.18rem;
}

.chart-frame {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 25%, rgba(245, 189, 55, 0.14), transparent 26%),
    linear-gradient(135deg, #09100d, #132018);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.32);
}

.chart-frame::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 56px 56px;
  pointer-events: none;
  content: "";
}

#invest-chart {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 360px;
}

.invest-control-panel {
  align-content: start;
}

.invest-metrics {
  display: grid;
  gap: 8px;
}

.invest-metrics div {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.invest-metrics strong {
  font-size: 1.05rem;
}

.invest-stake-row {
  margin-top: 2px;
}

.invest-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.invest-actions button {
  min-height: 44px;
}

.result-screen {
  min-height: 520px;
  align-content: center;
}

.result-screen.active {
  display: grid;
}

.result-panel {
  display: grid;
  gap: 8px;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px;
  text-align: center;
}

.result-panel.hidden {
  display: none;
}

.result-panel.win {
  background:
    linear-gradient(135deg, rgba(23, 138, 85, 0.16), rgba(255, 255, 255, 0.86)),
    #ffffff;
  border: 1px solid rgba(31, 157, 85, 0.25);
}

body.dark-mode .result-panel.win {
  background:
    linear-gradient(135deg, rgba(23, 138, 85, 0.2), rgba(20, 27, 33, 0.9)),
    var(--panel-solid);
}

.result-panel.lose {
  background:
    linear-gradient(135deg, rgba(239, 95, 77, 0.16), rgba(255, 255, 255, 0.86)),
    #ffffff;
  border: 1px solid rgba(239, 95, 77, 0.25);
}

body.dark-mode .result-panel.lose {
  background:
    linear-gradient(135deg, rgba(239, 95, 77, 0.18), rgba(20, 27, 33, 0.9)),
    var(--panel-solid);
}

.result-panel strong {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.result-panel p {
  margin-bottom: 0;
  color: #1d2939;
  font-size: 1.2rem;
  font-weight: 900;
}

.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.history-screen {
  min-height: 560px;
}

.history-dashboard,
.ranking-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ranking-dashboard {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.record-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  align-content: center;
  padding: 18px;
}

.record-card span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 900;
}

.record-card strong {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
}

#ranking-player-id {
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  word-break: break-all;
}

.history-board {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
}

.ranking-screen {
  min-height: 560px;
}

.ranking-board {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
}

.ranking-board-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.ranking-board-head span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: right;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-item,
.empty-ranking {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.ranking-item.mine {
  border-color: rgba(245, 189, 55, 0.7);
  background: linear-gradient(135deg, rgba(245, 189, 55, 0.18), #ffffff);
}

body.dark-mode .ranking-item.mine {
  background: linear-gradient(135deg, rgba(245, 189, 55, 0.16), var(--panel-solid));
}

.ranking-item strong {
  color: #f5bd37;
  font-size: 1.18rem;
}

.ranking-item span,
.ranking-item b {
  font-weight: 950;
}

.ranking-item em,
.empty-ranking {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
}

.ranking-item b {
  font-size: 1rem;
}

.history-list {
  display: flex;
  min-width: 0;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.history-item,
.empty-history {
  flex: 0 0 auto;
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.history-item {
  display: grid;
  gap: 3px;
}

.history-item span {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.history-item strong {
  font-size: 1.1rem;
}

.history-item em {
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 950;
}

.positive {
  color: #087443;
}

.negative {
  color: #c0362c;
}

.empty-history {
  display: grid;
  min-width: 280px;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
  margin: 14px 2px 0;
  color: #59646f;
}

.notice {
  margin: 0;
  color: #59646f;
  font-size: 0.84rem;
  font-weight: 700;
}

.version-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  color: #59646f;
  font-size: 0.76rem;
  font-weight: 800;
}

.version-info span,
.version-info strong {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  padding: 0 9px;
}

.version-info strong {
  color: var(--foreground);
}

body.dark-mode .version-info span,
body.dark-mode .version-info strong {
  background: rgba(20, 27, 33, 0.68);
}

@keyframes fill-time {
  to {
    width: 100%;
  }
}

@keyframes update-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tutorial-pop {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(245, 189, 55, 0.58),
      var(--shadow);
    transform: scale(1);
  }
  45% {
    box-shadow:
      0 0 0 12px rgba(245, 189, 55, 0),
      var(--shadow);
    transform: scale(1.018);
  }
}

@keyframes camera-sway {
  0%,
  100% {
    transform: rotateX(58deg) rotateZ(0deg) scale(1);
  }
  35% {
    transform: rotateX(58deg) rotateZ(-1.5deg) scale(1.04);
  }
  70% {
    transform: rotateX(58deg) rotateZ(1.3deg) scale(1.02);
  }
}

@keyframes race-camera {
  0%,
  100% {
    transform: rotateX(56deg) translateY(26px) scale(1);
  }
  42% {
    transform: rotateX(58deg) translateY(20px) scale(1.03);
  }
  76% {
    transform: rotateX(54deg) translateY(30px) scale(1.05);
  }
}

@keyframes track-rush {
  to {
    transform: translateX(-92px);
  }
}

@keyframes lane-rush {
  to {
    background-position: -72px 0;
  }
}

@keyframes car-tremble {
  0%,
  100% {
    translate: 0 0;
    filter: brightness(1);
  }
  25% {
    translate: 0 -2px;
    filter: brightness(1.05);
  }
  50% {
    translate: 0 1px;
    filter: brightness(0.98);
  }
  75% {
    translate: 0 -1px;
    filter: brightness(1.04);
  }
}

@keyframes speed-flare {
  0% {
    opacity: 0;
    transform: translateX(18px) scaleX(0.4);
  }
  35% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
    transform: translateX(-20px) scaleX(1.35);
  }
}

@keyframes wheel-hum {
  0%,
  100% {
    filter: blur(0);
  }
  50% {
    filter: blur(1px);
  }
}

@keyframes f1-sprint {
  0% {
    left: 7%;
  }
  12% {
    left: 14%;
  }
  24% {
    left: 22%;
  }
  36% {
    left: 31%;
  }
  48% {
    left: 40%;
  }
  60% {
    left: 49%;
  }
  72% {
    left: 57%;
  }
  86% {
    left: calc(var(--finish-x, 76%) - 7%);
  }
  100% {
    left: var(--finish-x, 76%);
  }
}

@keyframes ball-path {
  0% {
    left: 48%;
    top: 48%;
  }
  18% {
    left: 38%;
    top: 30%;
  }
  32% {
    left: 64%;
    top: 38%;
  }
  50% {
    left: 52%;
    top: 65%;
  }
  70% {
    left: 36%;
    top: 55%;
  }
  100% {
    left: 50%;
    top: 48%;
  }
}

@keyframes strike-right {
  0% {
    left: 48%;
    top: 48%;
    transform: translateZ(18px) scale(1);
  }
  55% {
    left: 83%;
    top: 44%;
    transform: translateZ(44px) scale(1.14);
  }
  100% {
    left: 98%;
    top: 48%;
    transform: translateZ(20px) scale(0.86);
  }
}

@keyframes strike-left {
  0% {
    left: 52%;
    top: 48%;
    transform: translateZ(18px) scale(1);
  }
  55% {
    left: 17%;
    top: 43%;
    transform: translateZ(44px) scale(1.14);
  }
  100% {
    left: 0%;
    top: 48%;
    transform: translateZ(20px) scale(0.86);
  }
}

@keyframes miss-right {
  0% {
    left: 52%;
    top: 48%;
  }
  70% {
    left: 92%;
    top: 34%;
  }
  100% {
    left: 87%;
    top: 29%;
  }
}

@keyframes miss-left {
  0% {
    left: 48%;
    top: 48%;
  }
  70% {
    left: 8%;
    top: 34%;
  }
  100% {
    left: 13%;
    top: 29%;
  }
}

@keyframes trail-right {
  0% {
    left: 48%;
    top: 49%;
    opacity: 0;
    transform: rotate(-8deg) translateZ(11px) scaleX(0.3);
  }
  40% {
    opacity: 1;
  }
  100% {
    left: 70%;
    top: 46%;
    opacity: 0;
    transform: rotate(-8deg) translateZ(11px) scaleX(1.4);
  }
}

@keyframes trail-left {
  0% {
    left: 38%;
    top: 49%;
    opacity: 0;
    transform: rotate(188deg) translateZ(11px) scaleX(0.3);
  }
  40% {
    opacity: 1;
  }
  100% {
    left: 14%;
    top: 45%;
    opacity: 0;
    transform: rotate(188deg) translateZ(11px) scaleX(1.4);
  }
}

@keyframes net-ripple {
  0%,
  100% {
    transform: translateX(0) skewX(0);
  }
  35% {
    transform: translateX(7px) skewX(-12deg);
  }
  65% {
    transform: translateX(-4px) skewX(8deg);
  }
}

@keyframes goal-flash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateZ(40px) scale(0.72);
  }
  35% {
    opacity: 1;
    transform: translate(-50%, -50%) translateZ(40px) scale(1.04);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateZ(40px) scale(1.28);
  }
}

@keyframes player-one {
  40% {
    left: 34%;
    top: 42%;
  }
  74% {
    left: 28%;
    top: 54%;
  }
}

@keyframes player-two {
  28% {
    left: 48%;
    top: 28%;
  }
  52% {
    left: 66%;
    top: 37%;
  }
}

@keyframes player-three {
  50% {
    left: 48%;
    top: 62%;
  }
  82% {
    left: 23%;
    top: 58%;
  }
}

@keyframes player-four {
  30% {
    left: 70%;
    top: 48%;
  }
  75% {
    left: 31%;
    top: 45%;
  }
}

@keyframes player-five {
  42% {
    left: 78%;
    top: 37%;
  }
  86% {
    left: 18%;
    top: 41%;
  }
}

@keyframes player-six {
  25% {
    left: 52%;
    top: 63%;
  }
  64% {
    left: 39%;
    top: 67%;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    padding: 18px;
  }

  .site-nav,
  .lobby-hero,
  .match-card,
  .invest-layout {
    grid-template-columns: 1fr;
  }

  .wallet {
    text-align: left;
  }

  .nav-actions {
    justify-self: stretch;
  }

  .nav-actions .wallet {
    flex: 1;
  }

  .nav-tabs {
    justify-content: stretch;
  }

  .nav-tab {
    flex: 1;
  }

  .team-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  body {
    background: #050807;
  }

  body.dark-mode {
    background: #050807;
  }

  .app-shell {
    width: min(430px, 100%);
    padding: 14px 12px 22px;
  }

  .site-nav {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    overflow: hidden;
    background: rgba(246, 251, 248, 0.92);
  }

  body.dark-mode .site-nav {
    background: rgba(246, 251, 248, 0.92);
  }

  .brand {
    min-width: 0;
  }

  body.dark-mode .site-nav .brand,
  body.dark-mode .site-nav .wallet,
  body.dark-mode .site-nav .wallet strong {
    color: #111418;
  }

  body.dark-mode .site-nav .brand small,
  body.dark-mode .site-nav .wallet span {
    color: #667085;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  .brand strong {
    font-size: 1rem;
    line-height: 1.05;
  }

  .brand small {
    font-size: 0.78rem;
  }

  .nav-actions {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-items: stretch;
    gap: 6px;
    max-width: none;
  }

  .auth-button {
    min-height: 44px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .settings-button {
    flex: 0 0 58px;
    width: 58px;
    min-width: 58px;
    min-height: 44px;
    padding: 0 8px;
    background: #ffffff;
    color: #111418;
  }

  .settings-icon {
    width: 20px;
    height: 20px;
    border-width: 2px;
  }

  .settings-icon::before {
    inset: -7px;
    -webkit-mask: radial-gradient(circle, transparent 0 11px, #000 12px 15px, transparent 16px);
    mask: radial-gradient(circle, transparent 0 11px, #000 12px 15px, transparent 16px);
  }

  body.dark-mode .site-nav .settings-button {
    background: #ffffff;
    color: #111418;
  }

  .theme-toggle {
    flex: 0 0 auto;
    width: 46px;
    height: 30px;
    padding: 2px;
  }

  .theme-thumb {
    width: 24px;
    height: 24px;
  }

  body.dark-mode .theme-thumb {
    transform: translateX(16px);
  }

  .wallet {
    flex: 0 1 112px;
    min-width: 0;
    padding: 7px 10px;
    background: #ffffff;
    text-align: left;
  }

  body.dark-mode .wallet {
    background: #ffffff;
  }

  .wallet span {
    font-size: 0.64rem;
  }

  .wallet strong {
    font-size: 0.83rem;
  }

  .settings-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-card {
    padding: 16px;
  }

  .settings-card h2 {
    font-size: 1.25rem;
  }

  .settings-row {
    gap: 10px;
    padding: 10px 12px;
  }

  .settings-row > div {
    min-width: 0;
  }

  .nav-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    padding: 6px;
    background: rgba(17, 20, 24, 0.08);
  }

  body.dark-mode .nav-tabs {
    background: rgba(17, 20, 24, 0.08);
  }

  .nav-tab {
    min-height: 48px;
    color: #344054;
    padding: 0 7px;
    font-size: 0.78rem;
  }

  body.dark-mode .nav-tab {
    color: #344054;
  }

  body.dark-mode .nav-tab.active {
    background: #101814;
    color: #ffffff;
  }

  .lobby-hero,
  .simple-lobby {
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: auto;
    margin-bottom: 14px;
  }

  .hero-copy {
    align-content: start;
    min-height: 232px;
    padding: 26px 22px 22px;
  }

  .hero-copy h1 {
    font-size: clamp(2.15rem, 12vw, 2.8rem);
    line-height: 1;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 24px;
  }

  .hero-actions .primary-action,
  .hero-actions .ghost-action,
  .hero-actions .danger-action {
    display: grid;
    width: 100%;
    min-height: auto;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    padding: 8px;
    font-size: clamp(0.72rem, 3.3vw, 0.86rem);
    line-height: 1.18;
    text-align: center;
    word-break: keep-all;
  }

  .hero-actions .primary-action {
    box-shadow: 0 12px 28px rgba(16, 24, 20, 0.18);
  }

  .sport-select {
    align-content: start;
    min-height: 242px;
    padding: 24px 22px 22px;
  }

  .sport-select h2 {
    font-size: clamp(1.65rem, 8vw, 2.2rem);
  }

  .sport-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
  }

  .sport-card {
    display: grid;
    width: min(100%, 148px);
    min-height: auto;
    aspect-ratio: 1;
    justify-self: center;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    padding: 14px;
    text-align: center;
  }

  .sport-card span {
    font-size: clamp(0.68rem, 3vw, 0.78rem);
  }

  .sport-card strong {
    font-size: clamp(1.35rem, 7vw, 1.9rem);
  }

  .tutorial-overlay {
    padding: 12px;
  }

  .tutorial-card {
    padding: 14px;
  }

  .section-head,
  .history-board,
  .invest-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .invest-chart-panel,
  .invest-control-panel {
    padding: 14px;
  }

  .invest-clock {
    min-width: 0;
    text-align: left;
  }

  .chart-frame {
    min-height: 260px;
  }

  #invest-chart {
    height: 260px;
  }

  .history-dashboard {
    grid-template-columns: 1fr;
  }

  .ranking-dashboard {
    grid-template-columns: 1fr;
  }

  .ranking-board-head,
  .ranking-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .ranking-board-head {
    display: grid;
  }

  .ranking-board-head span {
    text-align: left;
  }

  .ranking-item {
    gap: 5px;
  }

  .ranking-item b {
    font-size: 1.18rem;
  }

  .team-panel.right {
    text-align: left;
  }

  .team-panel.right .club-mark,
  .team-panel.right .form-pill {
    align-self: flex-start;
  }

  .stadium {
    min-height: 430px;
  }

  .pitch {
    inset: 88px 6% 72px;
  }

  .pick-grid,
  .action-row,
  .stake-row {
    grid-template-columns: 1fr;
  }

  .stake-row button,
  .ghost-action,
  .danger-action,
  .primary-action {
    width: 100%;
  }

  .ticket {
    text-align: left;
  }

  .app-footer,
  .version-info {
    justify-content: flex-start;
  }

  .app-footer {
    gap: 10px;
    margin-top: 18px;
  }

  .notice {
    width: 100%;
    color: #8994a3;
  }

  .version-info {
    gap: 6px;
  }

  .version-info span,
  .version-info strong {
    min-height: 28px;
    background: rgba(255, 255, 255, 0.74);
    font-size: 0.72rem;
    padding: 0 10px;
  }
}
