/* ══════════════════════════════════════════════════════════════
   TURF LEGENDS — arcade horse racing
   Original visual system: night turf, lime + gold, CRT flavour.
   ══════════════════════════════════════════════════════════════ */

:root {
  --ink: #050806;
  --ink-2: #070d0a;
  --panel: #0a1310;
  --panel-2: #0e1a15;
  --panel-3: #12211a;
  --turf: #1c5c3d;
  --turf-deep: #0f3323;
  --lime: #b8f36a;
  --lime-hot: #d5ff8e;
  --lime-deep: #78cc2f;
  --gold: #ffcf5c;
  --gold-deep: #b88520;
  --cream: #f4f0df;
  --muted: #93a89e;
  --dim: #61766b;
  --line: rgba(184, 243, 106, 0.16);
  --line-strong: rgba(184, 243, 106, 0.34);
  --line-soft: rgba(255, 255, 255, 0.07);
  --red: #ff6b6f;
  --blue: #65c7ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --sans: "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Courier New", monospace;
  --display: "Arial Black", "Segoe UI Black", "Impact", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(32, 92, 58, 0.42), transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(255, 207, 92, 0.055), transparent 70%),
    linear-gradient(180deg, #08110c 0%, #040705 55%, #030504 100%);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button {
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
a { color: var(--gold); }
img, svg, canvas { display: block; }
::selection { background: var(--gold); color: #111; }

/* ── Screen/atmosphere ─────────────────────────────────────── */

.app { position: relative; z-index: 1; min-height: 100dvh; }

.screen {
  display: none;
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  flex-direction: column;
}
.screen.active { display: flex; animation: screenIn 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.fx-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background:
    radial-gradient(ellipse 40% 50% at 20% 0%, rgba(184, 243, 106, 0.06), transparent 65%),
    radial-gradient(ellipse 40% 50% at 80% 0%, rgba(255, 207, 92, 0.05), transparent 65%);
}
.fx-crt {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.24) 0px,
    rgba(0, 0, 0, 0.24) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.15;
  mix-blend-mode: multiply;
}
.fx-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.52) 100%);
}

/* ── Shared UI ─────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 17, 12, 0.96), rgba(7, 13, 10, 0.89));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--line-soft);
}
.topbar-spacer { flex: 1; }

.brand { display: flex; align-items: center; gap: 10px; user-select: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: -0.06em;
  box-shadow: inset 0 0 18px rgba(255, 207, 92, 0.1);
  transform: rotate(-3deg);
}
.brand-name {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.12em;
  line-height: 1.05;
}
.brand-name em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--lime);
}

.race-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.race-chip b { color: var(--cream); font-size: 12px; }
.race-of { margin-left: 3px; color: var(--dim); font-size: 8px; letter-spacing: 0.04em; }

.balance {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 207, 92, 0.2);
  border-radius: 2px;
  background: rgba(255, 207, 92, 0.035);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}
.balance b { font-family: var(--mono); font-size: 15px; color: var(--gold); letter-spacing: 0.02em; }
.coin-dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6cc, #ffcf5c 35%, #b88520 78%, #78500d);
  box-shadow: 0 0 9px rgba(255, 207, 92, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  flex: 0 0 auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
  transition: 0.18s ease;
  flex: 0 0 auto;
}
.icon-btn:hover { color: var(--cream); border-color: var(--line-strong); background: rgba(184, 243, 106, 0.06); }
.icon-btn.off { color: var(--dim); text-decoration: line-through; }
.lang-btn { font-size: 9px; letter-spacing: 0.04em; font-weight: 600; }
.icon-btn.lang-btn { width: 42px; font-size: 9px; }
html[lang="en"] .en-hide { display: none !important; }
html[lang="en"] #btn-start-race small,
html[lang="en"] #btn-add small { display: none !important; }
html[lang="en"] .bet-type small { display: none; }

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 107, 111, 0.09), 0 0 12px rgba(255, 107, 111, 0.7);
  animation: livePulse 1.5s ease-in-out infinite;
  flex: 0 0 auto;
}
.live-dot.small { width: 5px; height: 5px; }
@keyframes livePulse { 50% { opacity: 0.35; box-shadow: 0 0 0 2px rgba(255, 107, 111, 0.04); } }

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 2px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  overflow: hidden;
}
.btn small {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 500;
  opacity: 0.65;
}
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0) scale(0.995); }
.btn:disabled { opacity: 0.32; cursor: not-allowed; filter: grayscale(0.5); }

.btn-primary {
  border: 1px solid rgba(255, 207, 92, 0.55);
  color: #171103;
  background: linear-gradient(180deg, #ffe18e 0%, var(--gold) 45%, #d7a532 100%);
  box-shadow: 0 5px 20px rgba(255, 207, 92, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn-primary:not(:disabled):hover { box-shadow: 0 8px 28px rgba(255, 207, 92, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.6); }

.btn-race {
  border: 1px solid rgba(213, 255, 142, 0.75);
  color: #081008;
  background: linear-gradient(180deg, var(--lime-hot), var(--lime) 45%, var(--lime-deep));
  box-shadow: 0 6px 26px rgba(184, 243, 106, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  min-height: 52px;
}
.btn-race:not(:disabled):hover { box-shadow: 0 9px 34px rgba(184, 243, 106, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.7); }

.btn-ghost {
  min-height: 34px;
  border: 1px solid transparent;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.btn-ghost:hover { color: var(--muted); border-color: var(--line-soft); }

.reward-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  margin-top: 2px;
  padding: 7px 9px;
  border: 1px dashed rgba(255, 207, 92, 0.26);
  border-radius: 2px;
  background: rgba(255, 207, 92, 0.025);
  color: rgba(255, 207, 92, 0.78);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  transition: 0.16s ease;
}
.reward-link:hover {
  border-color: var(--gold);
  background: rgba(255, 207, 92, 0.07);
  color: var(--gold);
}
.slip .reward-link,
.payout-panel .reward-link { width: 100%; }
.title-reward { margin-top: 15px; padding: 6px 12px; font-size: 9px; }
.title-ranking { margin-top: 4px; padding: 5px 10px; font-size: 8px; color: var(--muted); border-style: solid; border-color: var(--line-soft); }

.kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════════
   TITLE
   ══════════════════════════════════════════════════════════════ */

.title-screen {
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 28px 20px;
  background:
    radial-gradient(ellipse 55% 42% at 50% 37%, rgba(28, 92, 61, 0.24), transparent 70%),
    radial-gradient(ellipse 25% 25% at 50% 42%, rgba(255, 207, 92, 0.07), transparent 70%);
}
.title-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(184, 243, 106, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 243, 106, 0.028) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 0%, transparent 75%);
  pointer-events: none;
}

.title-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1120px, 132vw);
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.72;
  filter: blur(0.1px);
  pointer-events: none;
}

.title-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(830px, 100%);
  max-width: 100%;
  min-width: 0;
  text-align: center;
}

.title-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  animation: fadeUp 0.7s 0.1s both;
}
.title-kicker span { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.title-kicker span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }

.title-logo {
  margin: 18px 0 0;
  max-width: 100%;
  font-family: var(--display);
  font-size: clamp(44px, 12.8vw, 148px);
  line-height: 0.78;
  letter-spacing: -0.045em;
  transform: skew(-3deg);
  user-select: none;
}
.logo-line { display: block; }
.logo-a {
  color: transparent;
  -webkit-text-stroke: 2px rgba(244, 240, 223, 0.72);
  letter-spacing: 0.035em;
  text-shadow: 0 0 40px rgba(184, 243, 106, 0.08);
  animation: fadeUp 0.7s 0.18s both;
}
.logo-b {
  background: linear-gradient(180deg, #fff3bb 0%, var(--gold) 38%, #d79c2b 68%, #ffe8a0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(255, 207, 92, 0.17));
  letter-spacing: 0.01em;
  animation: fadeUp 0.7s 0.26s both;
}
.title-sub {
  margin: 18px 0 0;
  color: var(--cream);
  font-family: var(--mono);
  font-size: clamp(11px, 1.4vw, 14px);
  letter-spacing: 0.3em;
  animation: fadeUp 0.7s 0.34s both;
}
.title-sub i { color: var(--gold); font-style: normal; }

.title-marquee {
  width: min(600px, 92%);
  margin: 24px 0 0;
  padding: 7px 0;
  border-top: 1px solid rgba(184, 243, 106, 0.15);
  border-bottom: 1px solid rgba(184, 243, 106, 0.15);
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  min-width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee-track b { color: var(--gold); font-size: 7px; }
@keyframes marquee { to { transform: translateX(-50%); } }

.title-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 30px;
  animation: fadeUp 0.7s 0.42s both;
}
.coin-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 290px;
  padding: 11px 18px 11px 12px;
  border: 1px solid rgba(255, 207, 92, 0.62);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 207, 92, 0.13), rgba(255, 207, 92, 0.035)),
    rgba(9, 17, 12, 0.82);
  box-shadow: 0 0 0 1px rgba(255, 207, 92, 0.08), 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: left;
  transition: 0.2s ease;
  overflow: hidden;
}
.coin-btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: skewX(-18deg);
  animation: coinShine 3.4s ease-in-out infinite;
}
@keyframes coinShine {
  0%, 55% { left: -60%; }
  82%, 100% { left: 125%; }
}
.coin-btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(255, 207, 92, 0.2), 0 16px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 207, 92, 0.12);
}
.coin-glyph {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6cc, #ffcf5c 40%, #b88520 80%);
  box-shadow: 0 0 20px rgba(255, 207, 92, 0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}
.coin-glyph i {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid rgba(80, 52, 4, 0.55);
  color: #6e4a08;
  font-style: normal;
  font-size: 19px;
  font-family: var(--mono);
}
.coin-label {
  display: flex;
  flex-direction: column;
  color: var(--cream);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.25;
}
.coin-label small {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.22em;
  margin-top: 4px;
}
.coin-arrow { margin-left: auto; color: var(--gold); font-size: 26px; line-height: 1; opacity: 0.7; }

.btn-help {
  padding: 0 22px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(9, 17, 12, 0.65);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  transition: 0.18s ease;
}
.btn-help:hover { color: var(--cream); border-color: var(--line-strong); background: rgba(184, 243, 106, 0.05); }

.silk-row {
  display: flex;
  gap: 5px;
  margin-top: 26px;
  animation: fadeUp 0.7s 0.5s both;
}
.silk-row span {
  position: relative;
  width: 23px;
  height: 23px;
  border-radius: 2px;
  background:
    linear-gradient(135deg, transparent 0 45%, var(--b) 45% 55%, transparent 55%),
    var(--a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 3px 10px rgba(0, 0, 0, 0.3);
  transform: rotate(45deg);
}
.silk-row span:nth-child(2n) { transform: rotate(45deg) translateY(3px); }

.title-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 28px;
  border: 1px solid var(--line-soft);
  background: rgba(5, 10, 7, 0.55);
  animation: fadeUp 0.7s 0.56s both;
}
.title-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 104px;
  padding: 8px 18px;
  border-right: 1px solid var(--line-soft);
  text-align: center;
}
.title-stats span { color: var(--dim); font-family: var(--mono); font-size: 8px; letter-spacing: 0.18em; }
.title-stats b { color: var(--cream); font-family: var(--mono); font-size: 15px; font-weight: 500; }
.title-stats > div:nth-child(2) b { color: var(--gold); }
.title-stats > div:nth-child(3) b { color: var(--lime); }
.title-sound {
  width: 40px;
  height: 100%;
  min-height: 43px;
  border: 0;
  border-left: 1px solid var(--line-soft);
  border-radius: 0;
}
.title-foot {
  max-width: 92%;
  margin: 20px 0 0;
  color: #53665c;
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.08em;
  animation: fadeUp 0.7s 0.62s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* If the intro animations are paused by a background tab or an unusual
   browser setting, make sure the title content is never left invisible. */
.title-screen.title-static .title-kicker,
.title-screen.title-static .logo-a,
.title-screen.title-static .logo-b,
.title-screen.title-static .title-sub,
.title-screen.title-static .title-actions,
.title-screen.title-static .silk-row,
.title-screen.title-static .title-stats,
.title-screen.title-static .title-foot {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.title-screen.title-static .logo-line { transform: none; }

/* ══════════════════════════════════════════════════════════════
   BETTING
   ══════════════════════════════════════════════════════════════ */

.bet-screen { background: linear-gradient(180deg, rgba(14, 26, 19, 0.35), transparent 38%); }

.bet-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 366px;
  gap: 16px;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 22px 34px;
  align-items: start;
  flex: 1;
}

.race-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(184, 243, 106, 0.03), transparent 160px),
    linear-gradient(180deg, rgba(11, 21, 16, 0.96), rgba(7, 14, 10, 0.96));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.race-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(90deg, rgba(184, 243, 106, 0.055), transparent 48%),
    radial-gradient(ellipse 60% 140% at 100% 0%, rgba(255, 207, 92, 0.05), transparent 70%);
}
.race-head-main { min-width: 0; }
.race-head h2 {
  margin: 5px 0 5px;
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.race-meta-line { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.09em; }
.race-head-side { display: flex; gap: 8px; flex: 0 0 auto; }
.going-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 62px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.16);
}
.going-box span { color: var(--dim); font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em; }
.going-box b { color: var(--lime); font-size: 16px; font-weight: 700; }

.bet-type-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.15);
}
.bet-type {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 84px;
  padding: 12px 13px 11px;
  border-right: 1px solid rgba(255, 255, 255, 0.045);
  color: var(--dim);
  transition: 0.18s ease;
}
.bet-type span { font-size: 15px; font-weight: 800; letter-spacing: 0.12em; }
.bet-type small { font-family: var(--mono); font-size: 7px; letter-spacing: 0.18em; opacity: 0.7; }
.bet-type:hover { color: var(--muted); background: rgba(184, 243, 106, 0.03); }
.bet-type.active { color: var(--gold); background: linear-gradient(180deg, rgba(255, 207, 92, 0.08), transparent); }
.bet-type.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(255, 207, 92, 0.4);
}
.bet-type-desc {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
  padding: 0 8px 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.field-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(184, 243, 106, 0.025);
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.02em;
}
.field-note-icon {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 9px;
  flex: 0 0 auto;
}
.field-note-tip { margin-left: auto; color: var(--gold); font-family: var(--mono); white-space: nowrap; }

.season-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.13);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.season-strip-label { color: var(--muted); white-space: nowrap; }
.season-dots { display: flex; gap: 3px; flex: 1; max-width: 390px; }
.season-dots i { height: 4px; flex: 1; background: rgba(255, 255, 255, 0.08); transition: 0.2s ease; }
.season-dots i.done { background: rgba(255, 207, 92, 0.55); }
.season-dots i.current { background: var(--lime); box-shadow: 0 0 8px rgba(184, 243, 106, 0.35); }
.season-strip-count { margin-left: auto; color: var(--cream); font-size: 9px; white-space: nowrap; }
.featured-banner {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 22px;
  border-bottom: 1px solid rgba(255, 207, 92, 0.18);
  background: linear-gradient(90deg, rgba(255, 207, 92, 0.09), rgba(255, 207, 92, 0.02));
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.03em;
}
.featured-banner span {
  padding: 2px 5px;
  border: 1px solid rgba(255, 207, 92, 0.4);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.horse-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 14px;
}

.horse-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 11px 12px 9px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 3px;
  background:
    radial-gradient(ellipse 90% 100% at 0% 0%, rgba(255, 255, 255, 0.035), transparent 55%),
    linear-gradient(160deg, #0d1a15 0%, #09120e 75%);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.horse-card:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 243, 106, 0.32);
  background:
    radial-gradient(ellipse 90% 100% at 0% 0%, rgba(184, 243, 106, 0.06), transparent 60%),
    linear-gradient(160deg, #102019 0%, #09130f 75%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}
.horse-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(255, 207, 92, 0.55), 0 0 28px rgba(255, 207, 92, 0.09), inset 0 0 26px rgba(255, 207, 92, 0.035);
  background:
    radial-gradient(ellipse 90% 100% at 0% 0%, rgba(255, 207, 92, 0.075), transparent 62%),
    linear-gradient(160deg, #151c12 0%, #0a120e 75%);
}
.horse-card.selected .hc-odds { padding-right: 14px; }
.horse-card.selected::after {
  content: "✓";
  position: absolute;
  top: -1px;
  right: -1px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--gold);
  color: #161103;
  font-size: 12px;
  font-weight: 900;
  border-radius: 0 2px 0 3px;
  box-shadow: 0 0 18px rgba(255, 207, 92, 0.25);
}
.horse-card.dimmed { opacity: 0.48; }

.hc-top { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.num-badge {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: var(--silk, #2f9e63);
  color: #fff;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 3px var(--silk2, rgba(255, 255, 255, 0.9)),
    inset 0 0 0 4px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.38);
  flex: 0 0 auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.num-badge.dark-text { color: #111; text-shadow: none; }
.hc-name { min-width: 0; padding-top: 1px; }
.hc-name b {
  display: block;
  overflow: hidden;
  color: var(--cream);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hc-name small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hc-odds {
  display: flex;
  gap: 9px;
  margin-left: auto;
  padding-top: 1px;
  flex: 0 0 auto;
  text-align: right;
}
.hc-odds > div { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.hc-odds b { color: var(--gold); font-family: var(--mono); font-size: 17px; font-weight: 500; line-height: 1; }
.hc-odds > div:last-child b { color: var(--muted); font-size: 12px; }
.hc-odds span { color: var(--dim); font-family: var(--mono); font-size: 7px; letter-spacing: 0.1em; }

.hc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.hc-stat { display: flex; align-items: center; gap: 5px; min-width: 0; }
.hc-stat > span { color: var(--dim); font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; flex: 0 0 auto; }
.hc-stat > i {
  position: relative;
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
}
.hc-stat > i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--bar, 50%);
  background: linear-gradient(90deg, rgba(184, 243, 106, 0.55), var(--lime));
  box-shadow: 0 0 7px rgba(184, 243, 106, 0.2);
}
.hc-stat > b { color: var(--muted); font-family: var(--mono); font-size: 8px; font-weight: 500; min-width: 15px; text-align: right; }

.hc-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
}
.style-chip {
  padding: 1px 4px;
  border: 1px solid rgba(255, 207, 92, 0.22);
  border-radius: 1px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 700;
  flex: 0 0 auto;
}
.hc-form { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hc-form b { color: var(--muted); font-weight: 500; letter-spacing: 0.04em; }
.hc-tip {
  margin-left: auto;
  overflow: hidden;
  color: #6d8377;
  font-family: var(--sans);
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 90px;
}
.hc-bond {
  padding: 1px 4px;
  border: 1px solid rgba(255, 143, 180, 0.35);
  color: #ff9bbf;
  font-family: var(--mono);
  font-size: 7px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.trend { margin-left: auto; font-family: var(--sans); font-size: 8px; flex: 0 0 auto; }
.trend.down { color: #78e08a; }
.trend.up { color: #ff8588; }

/* ── Bet slip ─────────────────────────────────────────────── */

.slip {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 16px;
  border: 1px solid rgba(255, 207, 92, 0.23);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 207, 92, 0.045), transparent 170px),
    linear-gradient(180deg, rgba(12, 22, 17, 0.98), rgba(7, 13, 10, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.slip-head { display: flex; align-items: center; justify-content: space-between; }
.slip-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.slip-head h2 small {
  margin-left: 5px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.13em;
}
.count-pill {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 10px;
}

.selection-box {
  display: flex;
  align-items: center;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px dashed rgba(184, 243, 106, 0.19);
  background: rgba(0, 0, 0, 0.18);
  color: var(--dim);
  font-size: 11px;
  transition: 0.18s ease;
}
.selection-box.has { border-color: rgba(255, 207, 92, 0.4); background: rgba(255, 207, 92, 0.035); color: var(--muted); }
.selection-box .sel-main { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.selection-box .sel-main.many .sel-num { width: 22px; height: 22px; font-size: 10px; }
.selection-box .sel-main.many .sel-copy b { white-space: normal; line-height: 1.3; }
.sel-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--silk, #2f9e63);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--silk2, rgba(255, 255, 255, 0.8));
  flex: 0 0 auto;
}
.sel-copy { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.sel-copy b { overflow: hidden; color: var(--cream); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.sel-copy small { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.sel-odds { margin-left: auto; color: var(--gold); font-family: var(--mono); font-size: 15px; white-space: nowrap; }
.sel-odds span { color: var(--dim); font-size: 8px; }
.selection-empty { color: var(--dim); }
.sel-hint { display: block; margin-top: 3px; color: var(--dim); font-size: 9px; }

.stake-row { display: flex; align-items: center; gap: 8px; }
.stake-label { color: var(--dim); font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; white-space: nowrap; }
.stake-chips { display: flex; gap: 3px; margin-left: auto; }
.stake-chip {
  min-width: 40px;
  padding: 6px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  transition: 0.15s ease;
}
.stake-chip:hover { border-color: var(--line-strong); color: var(--cream); }
.stake-chip.active { border-color: var(--gold); background: rgba(255, 207, 92, 0.1); color: var(--gold); }

.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 208px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.ticket-empty {
  margin: 0;
  padding: 15px 4px;
  color: var(--dim);
  font-size: 11px;
  text-align: center;
  line-height: 1.7;
}
.ticket-empty span { color: #4e6257; font-size: 9px; }
.ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 8px;
  padding: 7px 8px;
  border-left: 2px solid var(--gold);
  background: rgba(255, 255, 255, 0.032);
  animation: ticketIn 0.2s ease both;
}
@keyframes ticketIn { from { opacity: 0; transform: translateX(6px); } }
.ticket-main {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--cream);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ticket-main b { color: var(--gold); }
.ticket-type { margin-right: 4px; color: var(--muted); font-family: var(--mono); font-size: 8px; }
.ticket-stake { grid-column: 2; grid-row: 1; color: var(--muted); font-family: var(--mono); font-size: 9px; white-space: nowrap; }
.ticket-return { grid-column: 2; grid-row: 2; color: var(--gold); font-family: var(--mono); font-size: 8px; text-align: right; }
.ticket-remove {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--dim);
  font-size: 14px;
  transition: 0.15s ease;
}
.ticket-remove:hover { color: var(--red); }

.slip-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 9px 0 2px;
  border-top: 1px solid var(--line-soft);
}
.slip-summary > div { display: flex; flex-direction: column; gap: 1px; }
.slip-summary span { color: var(--dim); font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; }
.slip-summary b { color: var(--cream); font-family: var(--mono); font-size: 16px; font-weight: 500; }
.slip-summary > div:last-child { text-align: right; }
.slip-summary > div:last-child b { color: var(--gold); }

/* ══════════════════════════════════════════════════════════════
   RACE
   ══════════════════════════════════════════════════════════════ */

.race-screen {
  height: 100dvh;
  overflow: hidden;
  background: #040705;
}
.race-topbar { flex: 0 0 auto; min-height: 56px; }
.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 107, 111, 0.28);
  background: rgba(255, 107, 111, 0.06);
  color: #ff9b9e;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}
.race-title {
  min-width: 0;
  overflow: hidden;
  color: var(--cream);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.race-facts { color: var(--dim); font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; white-space: nowrap; }

.race-body {
  position: relative;
  display: block;
  flex: 1;
  min-height: 0;
}
.stage {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 65% 70% at 50% 45%, rgba(26, 80, 51, 0.17), transparent 70%),
    #040705;
  isolation: isolate;
}
#track-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage.shake { animation: stageShake 0.45s ease; }
@keyframes stageShake {
  0%, 100% { transform: translate(0, 0); }
  18% { transform: translate(-3px, 2px); }
  37% { transform: translate(3px, -1px); }
  56% { transform: translate(-2px, 1px); }
  75% { transform: translate(1px, -1px); }
}

.stage-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(255, 207, 92, 0.35);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
.stage-corner.tl { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.stage-corner.tr { top: 12px; right: 12px; border-width: 1px 1px 0 0; }
.stage-corner.bl { bottom: 12px; left: 12px; border-width: 0 0 1px 1px; }
.stage-corner.br { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }

.countdown {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
  background: radial-gradient(ellipse 40% 45% at 50% 50%, rgba(3, 8, 5, 0.56), transparent 70%);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.countdown.gone { opacity: 0; transform: scale(1.06); }
.countdown-main {
  color: var(--gold);
  font-family: var(--display);
  font-size: clamp(82px, 14vw, 170px);
  line-height: 0.8;
  text-shadow: 0 0 34px rgba(255, 207, 92, 0.32), 0 8px 28px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.03em;
}
.countdown-main.go { color: var(--lime); font-size: clamp(64px, 10vw, 122px); letter-spacing: 0.03em; }
.countdown-sub {
  color: var(--cream);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  opacity: 0.8;
}
.countdown.pop .countdown-main { animation: countPop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes countPop { from { transform: scale(1.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.final-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 207, 92, 0.45);
  background: rgba(6, 12, 8, 0.82);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.26em;
  transform: translate(-50%, -18px);
  opacity: 0;
  pointer-events: none;
  transition: 0.35s ease;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.final-banner b { color: var(--cream); font-family: var(--sans); font-size: 10px; letter-spacing: 0.14em; }
.final-banner.show { transform: translate(-50%, 0); opacity: 1; animation: bannerPulse 1.2s ease-in-out infinite; }
@keyframes bannerPulse { 50% { border-color: rgba(255, 207, 92, 0.85); box-shadow: 0 0 22px rgba(255, 207, 92, 0.12); } }

.photo-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 26px;
  border: 1px solid var(--gold);
  background: rgba(5, 10, 7, 0.88);
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  box-shadow: 0 0 50px rgba(255, 207, 92, 0.14);
}
.photo-banner span { color: var(--gold); font-family: var(--display); font-size: 22px; letter-spacing: 0.06em; }
.photo-banner b { color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: 0.28em; }
.photo-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: photoFlash 0.9s ease 2; }
@keyframes photoFlash { 50% { box-shadow: 0 0 90px rgba(255, 207, 92, 0.28); border-color: #fff0bd; } }

.skip-btn {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 5;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  background: rgba(4, 9, 6, 0.65);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  backdrop-filter: blur(4px);
  transition: 0.18s ease;
  opacity: 0;
  pointer-events: none;
}
.skip-btn.show { opacity: 1; pointer-events: auto; }
.skip-btn:hover { color: var(--cream); border-color: var(--line-strong); }
.skip-btn span { color: var(--gold); margin-left: 3px; }

.order-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 292px;
  max-height: calc(100% - 24px);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(184, 243, 106, 0.035), transparent 190px),
    rgba(5, 11, 8, 0.86);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
}
.panel-head > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.race-clock { color: var(--gold); font-size: 10px; letter-spacing: 0.04em; }
.order-rows { display: flex; flex-direction: column; gap: 3px; min-height: 0; }
.order-row {
  display: grid;
  grid-template-columns: 14px 23px minmax(0, 1fr) 30px auto;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-size: 11px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.order-row .pos { color: var(--dim); font-family: var(--mono); font-size: 9px; }
.ord-num {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--silk, #2f9e63);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--silk2, rgba(255, 255, 255, 0.85));
  flex: 0 0 auto;
}
.order-row .ord-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.order-row .ord-odds { color: rgba(255, 207, 92, 0.62); font-family: var(--mono); font-size: 8px; text-align: right; white-space: nowrap; }
.order-row .gap { padding-left: 4px; color: var(--dim); font-family: var(--mono); font-size: 8px; white-space: nowrap; }
.order-row.lead { border-color: rgba(184, 243, 106, 0.14); border-left-color: var(--lime); background: rgba(184, 243, 106, 0.055); color: var(--cream); }
.order-row.lead .gap { color: var(--lime); }
.order-row.is-bet { border-left-color: var(--gold); }
.order-row.lead.is-bet { border-left-color: var(--gold); }
.order-row.flash { animation: orderFlash 0.4s ease; }
@keyframes orderFlash { 0% { background: rgba(255, 207, 92, 0.16); } }

.leader-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 207, 92, 0.18);
  background:
    radial-gradient(ellipse 90% 100% at 0% 0%, rgba(255, 207, 92, 0.055), transparent 70%),
    rgba(255, 255, 255, 0.018);
}
.leader-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.16em;
}
.leader-card-head span:last-child { color: var(--gold); font-size: 8px; letter-spacing: 0.04em; }
.leader-card-body { display: flex; align-items: center; gap: 9px; min-width: 0; }
.leader-card-num {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: var(--silk, #2f9e63);
  color: #fff;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  box-shadow: inset 0 0 0 3px var(--silk2, rgba(255, 255, 255, 0.9)), inset 0 0 0 4px rgba(0, 0, 0, 0.2), 0 0 18px rgba(255, 207, 92, 0.1);
  flex: 0 0 auto;
}
.leader-card-copy { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.leader-card-copy b { overflow: hidden; color: var(--cream); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.leader-card-copy small { overflow: hidden; color: var(--dim); font-family: var(--mono); font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.leader-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
}
.leader-card-foot span:last-child { color: rgba(255, 207, 92, 0.75); }

.race-ticket-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}
.panel-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.panel-subhead span:last-child { color: var(--gold); }
.race-tickets { display: flex; flex-direction: column; gap: 4px; max-height: 126px; overflow-y: auto; }
.race-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 6px;
  border-left: 1px solid var(--gold);
  background: rgba(255, 207, 92, 0.03);
  color: var(--muted);
  font-size: 9px;
}
.race-ticket b { color: var(--cream); font-weight: 500; }
.race-ticket .rt-odds { color: var(--gold); font-family: var(--mono); font-size: 9px; white-space: nowrap; }
.race-ticket-empty { padding: 8px 2px; color: var(--dim); font-size: 9px; text-align: center; }
.panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  color: #4e6257;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.race-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  flex: 0 0 auto;
  padding: 10px 20px 12px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(6, 12, 9, 0.92), rgba(4, 8, 6, 0.98));
}
.commentary-box { min-width: 0; }
.commentary-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 9px; }
.eq i { width: 2px; background: var(--lime); opacity: 0.7; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(1) { height: 4px; animation-delay: 0s; }
.eq i:nth-child(2) { height: 8px; animation-delay: 0.18s; }
.eq i:nth-child(3) { height: 5px; animation-delay: 0.36s; }
@keyframes eq { 50% { transform: scaleY(0.4); opacity: 0.35; } }
.commentary-prev {
  height: 15px;
  overflow: hidden;
  color: var(--dim);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.commentary-main {
  overflow: hidden;
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.commentary-main.flash { animation: commentIn 0.35s ease; }
@keyframes commentIn { from { opacity: 0.2; transform: translateY(4px); } }

.progress-box { min-width: 0; align-self: end; }
.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.09em;
}
.progress-head span:last-child { color: var(--gold); }
.progress-track {
  position: relative;
  height: 7px;
  margin: 6px 0 4px;
  background: rgba(255, 255, 255, 0.055);
  overflow: visible;
}
.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(184, 243, 106, 0.32), var(--lime));
  box-shadow: 0 0 12px rgba(184, 243, 106, 0.3);
  transition: width 0.12s linear;
}
.progress-horses { position: absolute; inset: -3px 0; pointer-events: none; }
.progress-horses i {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--silk, #fff);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 6px var(--silk, transparent);
  transition: left 0.1s linear;
}
.progress-marks {
  display: flex;
  justify-content: space-between;
  color: #44574d;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════════════════
   RESULT
   ══════════════════════════════════════════════════════════════ */

.result-screen {
  overflow-y: auto;
  background:
    radial-gradient(ellipse 55% 40% at 50% 0%, rgba(184, 243, 106, 0.08), transparent 65%),
    radial-gradient(ellipse 40% 50% at 100% 100%, rgba(255, 207, 92, 0.05), transparent 65%);
}
.result-wrap { position: relative; width: min(1180px, 100%); margin: 0 auto; padding: 28px 22px 50px; }
.result-top { margin-bottom: 22px; text-align: center; }
.result-kicker {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.result-headline {
  margin: 7px 0 4px;
  font-family: var(--display);
  font-size: clamp(34px, 5.2vw, 64px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.result-headline .gold { color: var(--gold); }
.result-headline .win { color: var(--gold); text-shadow: 0 0 30px rgba(255, 207, 92, 0.18); }
.result-headline .lose { color: var(--muted); }
.result-sub { margin: 0; color: var(--muted); font-size: 12px; }
.result-sub b { color: var(--cream); }

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.result-top, .result-grid { position: relative; z-index: 2; }
.result-left { min-width: 0; }

.podium {
  display: grid;
  grid-template-columns: 1fr 1.14fr 1fr;
  align-items: end;
  gap: 7px;
  margin-bottom: 14px;
}
.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  padding: 14px 13px 12px;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 50%),
    linear-gradient(180deg, #0c1712, #080f0b);
  overflow: hidden;
}
.podium-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--silk, var(--lime));
}
.podium-card.p1 {
  min-height: 186px;
  border-color: rgba(255, 207, 92, 0.42);
  background:
    radial-gradient(ellipse 100% 80% at 50% 0%, rgba(255, 207, 92, 0.12), transparent 65%),
    linear-gradient(180deg, #16180d, #0a100b);
  box-shadow: 0 0 40px rgba(255, 207, 92, 0.07);
}
.podium-card.p2 { min-height: 146px; }
.podium-card.p3 { min-height: 124px; }
.podium-rank {
  position: absolute;
  top: 8px;
  right: 11px;
  color: rgba(255, 255, 255, 0.07);
  font-family: var(--display);
  font-size: 54px;
  line-height: 1;
}
.podium-card.p1 .podium-rank { color: rgba(255, 207, 92, 0.16); }
.podium-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.podium-card.p1 .podium-label { color: var(--gold); }
.podium-silk {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  background: var(--silk, #2f9e63);
  color: #fff;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  box-shadow: inset 0 0 0 4px var(--silk2, rgba(255, 255, 255, 0.9)), inset 0 0 0 5px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.podium-name {
  overflow: hidden;
  color: var(--cream);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.podium-card.p1 .podium-name { color: var(--gold); font-size: 19px; }
.podium-meta { color: var(--dim); font-family: var(--mono); font-size: 8px; }
.podium-time { color: var(--muted); font-family: var(--mono); font-size: 10px; }

.finish-table {
  border: 1px solid var(--line-soft);
  background: #08100b;
}
.finish-table-head, .finish-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 108px 56px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
}
.finish-table-head {
  height: 28px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.finish-table-head span:nth-child(3), .finish-table-head span:nth-child(4) { text-align: right; }
.finish-row {
  min-height: 37px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
}
.finish-row:last-child { border-bottom: 0; }
.finish-row.top1 { background: rgba(255, 207, 92, 0.055); color: var(--cream); }
.finish-row.top2, .finish-row.top3 { color: var(--cream); }
.finish-row.is-bet { box-shadow: inset 2px 0 0 var(--gold); }
.finish-rank { color: var(--dim); font-family: var(--mono); font-size: 10px; }
.finish-row.top1 .finish-rank { color: var(--gold); }
.finish-horse { display: flex; align-items: center; gap: 8px; min-width: 0; }
.finish-horse .ord-num { width: 23px; height: 23px; font-size: 9px; }
.finish-horse b { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.finish-horse small { color: var(--dim); font-family: var(--mono); font-size: 8px; }
.finish-time { color: var(--dim); font-family: var(--mono); font-size: 9px; text-align: right; white-space: nowrap; }
.finish-odds { color: var(--gold); font-family: var(--mono); font-size: 10px; text-align: right; }

.payout-panel {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 207, 92, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 207, 92, 0.05), transparent 180px),
    linear-gradient(180deg, #0d1812, #070d0a);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}
.payout-label { color: var(--dim); font-size: 11px; letter-spacing: 0.12em; }
.payout-label small { margin-left: 4px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.15em; }
.payout-amount {
  color: var(--gold);
  font-family: var(--display);
  font-size: 54px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 0 30px rgba(255, 207, 92, 0.12);
}
.payout-amount small { font-family: var(--mono); font-size: 13px; color: var(--gold-deep); letter-spacing: 0.1em; }
.payout-net { padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-family: var(--mono); font-size: 10px; }
.payout-net.positive { color: #86e895; }
.payout-net.negative { color: var(--red); }
.result-bonus {
  padding: 6px 8px;
  border-left: 2px solid var(--gold);
  background: rgba(255, 207, 92, 0.05);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
}
.ticket-results { display: flex; flex-direction: column; gap: 5px; }
.tr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px;
  border-left: 2px solid var(--dim);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
}
.tr-row.hit { border-left-color: var(--lime); background: rgba(184, 243, 106, 0.045); }
.tr-row .tr-copy { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
.tr-row .tr-copy b { color: var(--cream); font-weight: 500; }
.tr-row .tr-return { color: var(--dim); font-family: var(--mono); white-space: nowrap; }
.tr-row.hit .tr-return { color: var(--lime); }
.tr-empty { padding: 10px 2px; color: var(--dim); font-size: 9px; text-align: center; }

.bankroll-after {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 4px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
}
.bankroll-after b { display: flex; align-items: center; gap: 6px; color: var(--cream); font-family: var(--mono); font-size: 18px; font-weight: 500; }
.payout-note { color: #4c5f55; font-size: 8px; text-align: center; letter-spacing: 0.03em; }

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 7px;
  height: 12px;
  opacity: 0;
  animation: confettiFall var(--dur, 2.8s) linear var(--delay, 0s) forwards;
}
@keyframes confettiFall {
  0% { transform: translate3d(0, -10px, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translate3d(var(--drift, 40px), 90vh, 0) rotate(720deg); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   SEASON RESULT / RANKING
   ══════════════════════════════════════════════════════════════ */

.season-screen {
  overflow-y: auto;
  background:
    radial-gradient(ellipse 55% 45% at 50% 0%, rgba(255, 207, 92, 0.09), transparent 65%),
    radial-gradient(ellipse 40% 50% at 100% 100%, rgba(184, 243, 106, 0.05), transparent 70%);
}
.season-wrap { width: min(1080px, 100%); margin: 0 auto; padding: 32px 22px 50px; }
.season-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; color: var(--cream); font-family: var(--display); font-size: 13px; letter-spacing: 0.12em; }
.season-brand .brand-mark { width: 34px; height: 34px; }
.season-brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.season-brand em { margin-top: 4px; color: var(--lime); font-family: var(--mono); font-size: 8px; font-style: normal; letter-spacing: 0.26em; }
.season-kicker { color: var(--lime); font-family: var(--mono); font-size: 9px; letter-spacing: 0.26em; }
.season-headline { margin: 8px 0 5px; font-family: var(--display); font-size: clamp(42px, 6.5vw, 80px); line-height: 0.95; letter-spacing: -0.03em; }
.season-sub { margin: 0; color: var(--muted); font-size: 12px; }
.season-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 16px; margin-top: 24px; align-items: stretch; }
.season-score-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(255, 207, 92, 0.36);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 207, 92, 0.10), transparent 70%),
    linear-gradient(180deg, #12180e, #070e09);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.season-score-label { color: var(--dim); font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em; }
.season-score { color: var(--gold); font-family: var(--display); font-size: clamp(60px, 8vw, 112px); line-height: 0.82; letter-spacing: -0.04em; text-shadow: 0 0 36px rgba(255, 207, 92, 0.13); }
.season-score.negative { color: var(--red); text-shadow: 0 0 30px rgba(255, 107, 111, 0.12); }
.season-grade-row { display: flex; align-items: center; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line-soft); color: var(--dim); font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; }
.season-grade { font-family: var(--display); font-size: 30px; line-height: 1; letter-spacing: 0; }
.season-rank { margin-left: auto; color: var(--cream); font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; }
.season-best { color: var(--lime); font-family: var(--mono); font-size: 10px; }
.season-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.season-stats > div { display: flex; flex-direction: column; gap: 2px; }
.season-stats span { color: var(--dim); font-family: var(--mono); font-size: 7px; letter-spacing: 0.06em; }
.season-stats b { color: var(--cream); font-family: var(--mono); font-size: 15px; font-weight: 500; }
.season-start-note { color: #4e6257; font-size: 8px; }
.season-ranking-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 15, 11, 0.78);
}
.ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.15em;
}
.ranking-head span:last-child { color: var(--gold); }
.ranking-table { display: flex; flex-direction: column; gap: 3px; }
.ranking-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 32px 82px 42px;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 5px 8px;
  border-left: 2px solid transparent;
  background: rgba(255, 255, 255, 0.022);
  color: var(--muted);
  font-size: 10px;
}
.ranking-row.ranking-head-row { min-height: 22px; padding: 0 8px; background: none; color: var(--dim); font-family: var(--mono); font-size: 7px; letter-spacing: 0.1em; }
.ranking-row.is-current { border-left-color: var(--gold); background: rgba(255, 207, 92, 0.055); color: var(--cream); }
.rank-pos { color: var(--dim); font-family: var(--mono); font-size: 10px; }
.ranking-row.is-current .rank-pos { color: var(--gold); }
.rank-season { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-grade { font-family: var(--display); font-size: 15px; line-height: 1; text-align: center; }
.rank-score { color: var(--gold); font-family: var(--mono); font-size: 12px; text-align: right; }
.rank-meta { color: var(--dim); font-family: var(--mono); font-size: 8px; text-align: right; }
.grade-S { color: #ffe078; text-shadow: 0 0 16px rgba(255, 207, 92, 0.3); }
.grade-A { color: var(--lime); }
.grade-B { color: var(--blue); }
.grade-C { color: var(--muted); }
.grade-D { color: var(--red); }
.ranking-note { margin: auto 0 0; color: #4c6055; font-size: 8px; line-height: 1.6; }
.ranking-empty { padding: 26px 12px; color: var(--dim); font-size: 10px; line-height: 1.8; text-align: center; }
.season-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.season-actions .btn { width: auto; min-width: 0; }
.season-actions .btn-race { flex: 1; max-width: 420px; }
.ranking-modal { width: min(620px, 100%); }
.ranking-intro { margin: -5px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.7; }

/* ── Daily hub / bond ─────────────────────────────────────── */

.daily-modal { width: min(760px, 100%); }
.daily-intro { margin: -5px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.daily-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.daily-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.018);
}
.daily-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; color: var(--cream); font-size: 12px; }
.daily-card h3 span { color: var(--dim); font-family: var(--mono); font-size: 8px; font-weight: 400; letter-spacing: 0.04em; }
.login-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.login-cell { padding: 5px 2px 4px; border: 1px solid rgba(255, 255, 255, 0.06); color: var(--dim); font-family: var(--mono); font-size: 6px; text-align: center; }
.login-cell b { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 500; }
.login-cell.done { border-color: rgba(184, 243, 106, 0.25); background: rgba(184, 243, 106, 0.05); color: var(--lime); }
.login-cell.today { border-color: var(--gold); color: var(--gold); background: rgba(255, 207, 92, 0.06); }
.login-cell.future { opacity: 0.55; }
.daily-card .btn { min-height: 38px; font-size: 11px; }
.daily-card > small { color: var(--dim); font-size: 8px; line-height: 1.5; }
.mission-list { display: flex; flex-direction: column; gap: 4px; }
.mission-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 5px 6px; background: rgba(255, 255, 255, 0.025); font-size: 9px; color: var(--muted); }
.mission-row .mission-check { color: var(--dim); font-family: var(--mono); font-size: 10px; }
.mission-row.done { color: var(--cream); background: rgba(184, 243, 106, 0.05); }
.mission-row.done .mission-check { color: var(--lime); }
.mission-row b { color: var(--gold); font-family: var(--mono); font-size: 8px; font-weight: 500; white-space: nowrap; }
.mission-row small { display: block; color: var(--dim); font-size: 7px; }
.daily-chest { padding: 5px 6px; border: 1px dashed rgba(255, 207, 92, 0.25); color: var(--gold); font-family: var(--mono); font-size: 8px; text-align: center; }
.daily-chest.done { border-style: solid; background: rgba(255, 207, 92, 0.06); color: var(--lime); }
#daily-featured { color: var(--muted); font-size: 10px; line-height: 1.7; }
#daily-featured b { color: var(--gold); }
.featured-mini { padding: 9px; border-left: 2px solid var(--gold); background: rgba(255, 207, 92, 0.04); }
.featured-mini span { display: block; color: var(--dim); font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; }
.featured-mini strong { display: block; margin: 3px 0; color: var(--cream); font-size: 13px; }
.featured-mini small { color: var(--gold); font-size: 8px; }
.bond-list { display: flex; flex-direction: column; gap: 4px; }
.bond-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 7px; padding: 4px 6px; background: rgba(255, 255, 255, 0.025); font-size: 9px; color: var(--muted); }
.bond-row b { overflow: hidden; color: var(--cream); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.bond-row .bond-level { color: #ff9bbf; font-family: var(--mono); font-size: 8px; }
.bond-row .bond-xp { color: var(--dim); font-family: var(--mono); font-size: 7px; }
.bond-empty { color: var(--dim); font-size: 9px; line-height: 1.7; }

@media (max-width: 760px) {
  .daily-grid { grid-template-columns: 1fr; }
  .login-cell { padding: 4px 1px; font-size: 5px; }
}

/* ══════════════════════════════════════════════════════════════
   MODAL / TOAST
   ══════════════════════════════════════════════════════════════ */

body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 5, 3, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modalFade 0.2s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes modalFade { from { opacity: 0; } }
.modal {
  position: relative;
  width: min(650px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  padding: 26px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(184, 243, 106, 0.045), transparent 220px),
    linear-gradient(180deg, #0d1913, #070d0a);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
  animation: modalIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--dim);
  font-size: 20px;
  transition: 0.15s ease;
}
.modal-close:hover { color: var(--cream); }
.modal-kicker { color: var(--gold); font-family: var(--mono); font-size: 8px; letter-spacing: 0.28em; }
.modal h2 { margin: 5px 0 18px; font-family: var(--display); font-size: 30px; letter-spacing: -0.01em; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.help-item { padding: 12px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.02); }
.help-num { color: var(--gold); font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; }
.help-item h3 { margin: 4px 0 5px; font-size: 13px; }
.help-item p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.help-item p b { color: var(--cream); }
.help-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--lime);
  background: rgba(184, 243, 106, 0.035);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
.help-tip span { margin-right: 6px; color: var(--lime); font-weight: 700; }
.modal-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.modal-actions .btn { width: auto; min-width: 150px; }
.link-btn { color: var(--dim); font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--red); }
.modal-foot { margin: 16px 0 0; color: #4b5e53; font-size: 8px; line-height: 1.6; }

/* ── Rewards / ad / coffee ───────────────────────────────── */

.rewards-modal { width: min(720px, 100%); }
.rewards-intro { margin: -5px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.rewards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reward-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse 80% 70% at 0% 0%, rgba(255, 207, 92, 0.06), transparent 70%),
    rgba(255, 255, 255, 0.018);
}
.reward-card h3 { margin: 3px 0 0; font-size: 14px; }
.reward-card p { min-height: 42px; margin: 0 0 5px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.reward-card .btn { min-height: 42px; font-size: 12px; }
.reward-card > small { color: var(--dim); font-family: var(--mono); font-size: 8px; text-align: center; }
.reward-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 207, 92, 0.4);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 246, 204, 0.32), rgba(255, 207, 92, 0.1) 55%, transparent 75%);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  box-shadow: inset 0 0 18px rgba(255, 207, 92, 0.08), 0 0 24px rgba(255, 207, 92, 0.07);
}
.reward-icon span { font-size: 11px; opacity: 0.55; margin-right: 1px; }
.coffee-card .reward-icon { font-family: var(--sans); font-size: 24px; }
.btn-coffee {
  border: 1px solid rgba(255, 207, 92, 0.48);
  background: linear-gradient(180deg, rgba(255, 207, 92, 0.14), rgba(255, 207, 92, 0.035));
  color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn-coffee:not(:disabled):hover { box-shadow: 0 8px 24px rgba(255, 207, 92, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.13); }
.reward-foot { margin: 14px 0 0; color: #4c6055; font-size: 8px; line-height: 1.7; text-align: center; }

#rewards-ad { display: flex; flex-direction: column; gap: 10px; }
.ad-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.ad-top span { display: inline-flex; align-items: center; gap: 7px; }
.ad-top b { color: var(--gold); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; }
.ad-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 207, 92, 0.22);
  background:
    radial-gradient(ellipse 50% 65% at 50% 42%, rgba(255, 207, 92, 0.10), transparent 72%),
    radial-gradient(ellipse 90% 100% at 50% 120%, rgba(31, 107, 69, 0.3), transparent 65%),
    #06100b;
  isolation: isolate;
}
.ad-scanline {
  position: absolute;
  inset: -30%;
  background: repeating-linear-gradient(115deg, transparent 0 34px, rgba(184, 243, 106, 0.022) 34px 35px);
  animation: adScan 9s linear infinite;
  pointer-events: none;
}
@keyframes adScan { to { transform: translateX(80px); } }
.ad-sponsor {
  position: relative;
  z-index: 1;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.3em;
  text-align: center;
}
.ad-logo {
  position: relative;
  z-index: 1;
  margin: 13px 0 10px;
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 70px);
  line-height: 0.78;
  letter-spacing: -0.04em;
  text-align: center;
  transform: skew(-3deg);
}
.ad-logo span {
  display: block;
  background: linear-gradient(180deg, #fff3bb, var(--gold) 42%, #d79c2b 75%, #ffe8a0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.08em;
}
.ad-logo .ad-turf {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 240, 223, 0.68);
  font-size: 0.78em;
  letter-spacing: 0.025em;
}
.ad-tagline {
  position: relative;
  z-index: 1;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
}
.ad-oval {
  position: absolute;
  bottom: -28px;
  left: 50%;
  width: 380px;
  height: 150px;
  border: 1px solid rgba(184, 243, 106, 0.16);
  border-radius: 50%;
  transform: translateX(-50%) rotate(-5deg);
  opacity: 0.7;
}
.ad-oval i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 207, 92, 0.7);
  animation: adBlink 1.4s ease-in-out infinite;
}
.ad-oval i:nth-child(1) { left: 12%; top: 42%; animation-delay: 0s; }
.ad-oval i:nth-child(2) { left: 50%; top: 8%; animation-delay: 0.3s; background: var(--lime); }
.ad-oval i:nth-child(3) { left: 84%; top: 48%; animation-delay: 0.6s; background: var(--blue); }
@keyframes adBlink { 50% { opacity: 0.25; } }
.ad-progress {
  position: relative;
  z-index: 1;
  width: 82%;
  height: 4px;
  margin-top: 26px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.ad-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--lime), var(--gold));
  box-shadow: 0 0 14px rgba(255, 207, 92, 0.4);
  transition: width 0.1s linear;
}
.ad-status {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 150;
  max-width: min(420px, 90vw);
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 14, 10, 0.96);
  color: var(--cream);
  font-size: 11px;
  text-align: center;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { border-color: rgba(255, 207, 92, 0.45); color: var(--gold); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1180px) {
  .bet-main { grid-template-columns: minmax(0, 1fr) 330px; }
  .result-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 980px) {
  .bet-main { grid-template-columns: 1fr; max-width: 860px; }
  .slip { position: static; }
  .result-grid { grid-template-columns: 1fr; max-width: 820px; margin: 0 auto; }
  .payout-panel { position: static; }
  .order-panel { width: 250px; padding: 10px; }
  .order-row { font-size: 10px; }
  .race-title { max-width: 34vw; }
  .season-grid { grid-template-columns: 1fr; max-width: 820px; margin-left: auto; margin-right: auto; }
}

@media (max-width: 620px) {
  .order-row { grid-template-columns: 14px 23px minmax(0, 1fr) auto; }
  .order-row .ord-odds { display: none; }
  .bet-type { flex: 1 1 0; min-width: 0; align-items: center; padding: 10px 4px; }
  .bet-type small { display: none; }
}

@media (max-width: 760px) {
  .topbar { min-height: 56px; padding: 0 12px; gap: 8px; }
  .brand-name { font-size: 11px; }
  .brand-name em { font-size: 8px; }
  .brand-mark { width: 30px; height: 30px; font-size: 11px; }
  .topbar-divider, .hide-sm { display: none; }
  .topbar .race-chip { display: none; }
  .race-chip { padding: 5px 8px; font-size: 8px; }
  .race-chip b { font-size: 10px; }
  .balance { padding: 6px 8px; font-size: 8px; }
  .balance b { font-size: 12px; }
  .icon-btn { width: 32px; height: 32px; font-size: 13px; }

  .bet-main { padding: 12px 12px 28px; }
  .race-head { padding: 15px 14px 13px; }
  .race-head h2 { font-size: 27px; }
  .race-head-side { display: none; }
  .bet-type-bar { padding: 0 8px; overflow-x: auto; }
  .bet-type { min-width: 88px; padding: 10px 12px; }
  .bet-type span { font-size: 13px; }
  .bet-type-desc { display: none; }
  .field-note { padding: 8px 14px; font-size: 9px; }
  .field-note-tip { display: none; }
  .horse-grid { padding: 9px; gap: 7px; }
  .horse-card { padding: 10px; }
  .hc-odds b { font-size: 15px; }
  .hc-tip { display: none; }
  .slip { padding: 13px; }

  .race-screen { height: auto; min-height: 100dvh; overflow: visible; }
  .race-topbar { position: sticky; }
  .race-title { flex: 1 1 auto; max-width: none; font-size: 12px; }
  .race-body { display: flex; flex: 0 0 auto; flex-direction: column; }
  .stage {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
    height: clamp(260px, 44vh, 380px);
    min-height: 0;
  }
  .order-panel {
    position: static;
    top: auto;
    right: auto;
    width: auto;
    max-height: none;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--line-soft);
    border-radius: 0;
    background: rgba(6, 12, 9, 0.95);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
    padding: 11px 12px;
    gap: 7px;
  }
  .order-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
  .leader-card { display: none; }
  .race-ticket-panel { margin-top: 4px; }
  .race-tickets { max-height: 90px; }
  .panel-foot { display: none; }
  .race-footer { grid-template-columns: 1fr; gap: 10px; padding: 10px 14px 14px; }
  .commentary-main { font-size: 12px; }
  .commentary-prev { font-size: 9px; }
  .race-clock { font-size: 9px; }

  .result-wrap { padding: 22px 12px 50px; }
  .result-headline { font-size: 38px; }
  .result-grid { display: flex; flex-direction: column; }
  .result-left { display: contents; }
  .result-grid .podium { order: 1; }
  .result-grid .payout-panel { order: 2; width: 100%; }
  .result-grid .finish-table { order: 3; width: 100%; }
  .podium { gap: 5px; }
  .podium-card { padding: 10px 9px; }
  .podium-card.p1 { min-height: 156px; }
  .podium-card.p2 { min-height: 132px; }
  .podium-card.p3 { min-height: 118px; }
  .podium-name { font-size: 13px; }
  .podium-card.p1 .podium-name { font-size: 15px; }
  .podium-silk { width: 36px; height: 36px; font-size: 13px; }
  .finish-table-head, .finish-row { grid-template-columns: 32px minmax(0, 1fr) 84px 46px; padding: 0 9px; gap: 5px; }
  .finish-table-head { font-size: 6px; }
  .finish-row { min-height: 34px; }
  .finish-horse { gap: 6px; }
  .finish-horse b { font-size: 11px; }
  .payout-panel { padding: 14px; }
  .payout-amount { font-size: 46px; }
  .help-grid { grid-template-columns: 1fr; }
  .rewards-grid { grid-template-columns: 1fr; }
  .reward-card p { min-height: 0; }
  .ad-stage { min-height: 310px; padding: 20px; }
  .ad-logo { font-size: 48px; }
  .modal { padding: 22px 18px; }

  .title-inner { width: 100%; }
  .title-actions { flex-direction: column; width: min(340px, 100%); }
  .coin-btn { min-width: 0; width: 100%; }
  .btn-help { min-height: 42px; }
  .title-stats > div { min-width: 70px; padding: 6px 7px; }
  .title-stats b { font-size: 12px; }
  .title-foot { font-size: 8px; padding: 0 12px; }
  .season-wrap { padding: 22px 12px 42px; }
  .season-brand { margin-bottom: 20px; }
  .season-headline { font-size: 42px; }
  .season-score-card, .season-ranking-card { padding: 16px; }
  .season-score { font-size: 72px; }
  .season-actions { flex-direction: column; align-items: stretch; }
  .season-actions .btn { width: 100%; max-width: none; }
  .season-strip { padding: 8px 14px; gap: 7px; }
  .season-strip-label { display: none; }
  .season-dots { max-width: none; }
  .ranking-row { grid-template-columns: 24px minmax(0, 1fr) 28px 72px 38px; gap: 5px; font-size: 9px; }
  .ranking-row.ranking-head-row { font-size: 6px; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .horse-grid { grid-template-columns: 1fr; }
  .hc-tip { display: block; max-width: 120px; }
  .hc-name b { font-size: 15px; }
  .horse-card { gap: 8px; }
  .slip { gap: 9px; }
  .ticket-list { max-height: 180px; }
  .bet-type { flex: 1; min-width: 0; align-items: center; }
  .bet-type span { font-size: 13px; }
  .bet-type small { font-size: 6px; }
  .race-head h2 { font-size: 25px; }
  .title-kicker { font-size: 7px; letter-spacing: 0.2em; }
  .title-sub { letter-spacing: 0.18em; }
  .title-marquee { font-size: 8px; }
  .title-stats > div { min-width: 62px; padding: 6px 4px; }
  .title-stats b { font-size: 11px; }
  .season-headline { font-size: 36px; }
  .season-score { font-size: 58px; }
  .season-grade { font-size: 25px; }
  .season-stats { grid-template-columns: repeat(2, 1fr); }
  .season-stats b { font-size: 13px; }
  .ranking-row { grid-template-columns: 21px minmax(0, 1fr) 25px 62px 32px; padding: 5px 6px; }
  .rank-grade { font-size: 13px; }
  .rank-score { font-size: 10px; }
  .countdown-main { font-size: 94px; }
  .countdown-main.go { font-size: 60px; }
  .final-banner { gap: 6px; padding: 6px 10px; font-size: 7px; }
  .final-banner b { font-size: 8px; }
  .result-headline { font-size: 32px; }
  .finish-table-head, .finish-row { grid-template-columns: 28px minmax(0, 1fr) 76px 40px; }
  .finish-horse small { display: none; }
  .finish-odds { font-size: 9px; }
  .finish-time { font-size: 8px; }
}

@media (min-width: 981px) and (min-height: 760px) {
  .season-screen { justify-content: center; }
}

@media (max-height: 700px) and (min-width: 761px) {
  .title-logo { font-size: clamp(70px, 9vw, 112px); }
  .title-marquee { margin-top: 16px; }
  .title-actions { margin-top: 20px; }
  .silk-row { margin-top: 18px; }
  .title-stats { margin-top: 18px; }
  .title-foot { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fx-crt { opacity: 0.08; }
}
