/* Crownspire Podracing: the betting hall's look. Loaded after the page's own
   styles: it changes how the room looks, never where things sit or how the
   book works.

   A race-day hall: the race called on an amber tote board under hazard
   trim, racer cards in brass frames with lit odds, and a race board like a
   departures board. Brass and rivets as in the Sabacc room and on the slot
   cabinets, with the warm light of a desert circuit. */

.podracing-room {
  --brass: #b8893e;
  --brass-lit: #f0c978;
  --brass-dark: #5a3d16;
  --amber: #ffb547;
  --amber-dim: #a86a1c;
  --led-green: #7dff9a;
  --led-red: #ff6a5a;
  --glass: #070605;
  --hazard: repeating-linear-gradient(135deg, #f2b632 0 12px, #141008 12px 24px);
  background-color: #13110f;
  background-image:
    radial-gradient(90% 900px at 50% 0%, rgba(255, 150, 60, 0.12), transparent 70%),
    linear-gradient(180deg, #1c1712 0, #13110f 1200px);
  background-repeat: no-repeat;
}

/* ---- the frame every plate shares: brass, riveted at the corners ---- */
.podracing-room .panel,
.podracing-room .entry {
  position: relative;
  border: 0;
  border-radius: 6px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(240, 201, 120, 0.07), transparent 65%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #24211d, #141210 60%, #0d0c0a);
  box-shadow:
    0 0 0 1px #000, 0 0 0 2px var(--brass-dark), 0 0 0 3px var(--brass), 0 0 0 4px var(--brass-dark),
    0 18px 36px -18px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.podracing-room .panel::after,
.podracing-room .entry::after {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  --rivet: radial-gradient(circle at 4px 4px, #e2c07a 0 1.8px, #4a3412 2.4px, transparent 3.4px);
  background:
    var(--rivet) top left / 9px 9px no-repeat, var(--rivet) top right / 9px 9px no-repeat,
    var(--rivet) bottom left / 9px 9px no-repeat, var(--rivet) bottom right / 9px 9px no-repeat;
}

/* Section heads: a brass rule with a lit end. */
.podracing-room h2.display {
  color: var(--brass-lit);
  border-bottom-color: var(--brass);
  text-shadow: 0 0 12px rgba(255, 181, 71, 0.25);
}
.podracing-room .lead { color: #b3a68f; }

/* ---- the race called: an amber tote board under hazard trim ---- */
.podracing-room .panel.prime {
  padding-top: 1.75rem;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(255, 181, 71, 0.12), transparent 70%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #120d07, #070605);
  box-shadow:
    0 0 0 1px #000, 0 0 0 3px var(--brass-dark), 0 0 0 5px var(--brass), 0 0 0 6px var(--brass-lit), 0 0 0 8px var(--brass-dark),
    0 0 50px -8px rgba(255, 150, 60, 0.3), 0 28px 50px -22px rgba(0, 0, 0, 0.95), inset 0 0 50px rgba(0, 0, 0, 0.7);
}
.podracing-room .panel.prime::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 10px;
  border-radius: 6px 6px 0 0;
  background: var(--hazard);
  opacity: 0.9;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.6);
}
.podracing-room .panel.prime .track-facts { color: var(--amber-dim); letter-spacing: 0.04em; }
.podracing-room .panel.prime #race-number {
  font-family: var(--display);
  font-size: 0.875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}
.podracing-room .track-name {
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255, 181, 71, 0.75), 0 0 22px rgba(255, 140, 40, 0.35);
}
.podracing-room .panel.prime .lead { color: #c9b48c; }
.podracing-room .phase { border-top-color: rgba(255, 181, 71, 0.25); }
.podracing-room .phase-name {
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  background: rgba(255, 181, 71, 0.08);
  text-shadow: 0 0 6px rgba(255, 181, 71, 0.6);
}
/* The countdown: lit figures in a black glass window (hidden when there is none). */
.podracing-room .phase-clock:empty { display: none; }
.podracing-room .phase-clock {
  padding: 0.1rem 0.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--led-green);
  background: #020402;
  border: 1px solid #1d2a1d;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.9);
  text-shadow: 0 0 6px rgba(125, 255, 154, 0.8);
}
.podracing-room .phase-words { color: #b3a68f; }

/* ---- the result and the patron's wager ---- */
.podracing-room #result {
  background:
    radial-gradient(80% 70% at 50% 0%, rgba(255, 210, 110, 0.18), transparent 70%),
    linear-gradient(180deg, #24211d, #0d0c0a);
}
.podracing-room .winner {
  color: var(--brass-lit);
  text-shadow: 0 0 8px rgba(240, 201, 120, 0.7), 0 0 26px rgba(255, 170, 60, 0.35);
}
.podracing-room .mine strong { color: var(--amber); }

/* ---- the slip ---- */
.podracing-room .slip { box-shadow:
    0 0 0 1px #000, 0 0 0 2px var(--brass-dark), 0 0 0 3px var(--brass-lit), 0 0 0 4px var(--brass-dark),
    0 0 24px -4px rgba(255, 181, 71, 0.35); }
.podracing-room .slip label { color: var(--brass-lit); font-family: var(--display); letter-spacing: 0.06em; }
.podracing-room .slip .cs-input {
  font-family: var(--display);
  color: var(--amber);
  background: #050403;
  border-color: var(--brass-dark);
  text-shadow: 0 0 5px rgba(255, 181, 71, 0.5);
}

/* ---- racer cards ---- */
.podracing-room .entry { padding-top: 1.1rem; }
/* A thin band of the circuit's colours along the top of each card. */
.podracing-room .entry::before {
  content: "";
  position: absolute;
  left: 4px; right: 4px; top: 4px;
  height: 4px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #7a3b12, #d9822b 30%, #f2c15b 50%, #d9822b 70%, #7a3b12);
  opacity: 0.85;
}
.podracing-room .entry h3 { color: #f3e6cc; }
.podracing-room .entry .tag { color: var(--brass-lit); }
.podracing-room .entry .about,
.podracing-room .entry .record { color: #a99a80; }
.podracing-room .face {
  border: 2px solid var(--brass);
  box-shadow: 0 0 0 1px #000, 0 0 0 3px var(--brass-dark), inset 0 0 10px rgba(0, 0, 0, 0.8);
  background: radial-gradient(circle at 50% 35%, #3a2a14, #0b0a08 75%);
  color: var(--brass-lit);
}
.podracing-room .ratings dt { color: #a99a80; }
.podracing-room .ratings dd { color: var(--amber); text-shadow: 0 0 5px rgba(255, 181, 71, 0.45); }
.podracing-room .machine { border-top-color: rgba(184, 137, 62, 0.35); }
.podracing-room .machine .name { color: var(--brass-lit); }
.podracing-room .machine .model { color: #8f8169; }
/* The odds: a lit display window. */
.podracing-room .price {
  min-width: 5.5rem;
  padding: 0.25rem 0.6rem 0.3rem;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
  background: var(--glass);
  border: 1px solid #2a1d0c;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--brass-dark);
  text-shadow: 0 0 6px rgba(255, 181, 71, 0.8), 0 0 16px rgba(255, 140, 40, 0.35);
  line-height: 1.05;
}
.podracing-room .price small { color: var(--amber-dim); text-shadow: none; }
.podracing-room .entry.chosen {
  box-shadow:
    0 0 0 1px #000, 0 0 0 2px var(--brass-dark), 0 0 0 3px var(--brass-lit), 0 0 0 4px var(--brass-dark),
    0 0 26px -2px rgba(255, 181, 71, 0.55);
}
.podracing-room .entry.backed {
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(125, 255, 154, 0.08), transparent 65%),
    linear-gradient(180deg, #1f241d, #10140f 60%, #0b0d0a);
  box-shadow:
    0 0 0 1px #000, 0 0 0 2px #1c3a22, 0 0 0 3px #4fbf6a, 0 0 0 4px #1c3a22,
    0 0 22px -4px rgba(125, 255, 154, 0.4);
}

/* ---- the race board: a departures board ---- */
.podracing-room #live .two > section {
  position: relative;
  margin-top: 1rem;
  padding: 0.2rem 1rem 1rem;
  border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #0c0a07, #050403);
  box-shadow:
    0 0 0 1px #000, 0 0 0 2px var(--brass-dark), 0 0 0 3px var(--brass), 0 0 0 4px var(--brass-dark),
    inset 0 0 40px rgba(0, 0, 0, 0.8);
}
.podracing-room #live .two > section h2.display { margin-top: 0.9rem; }
.podracing-room .board th { color: var(--amber-dim); border-bottom-color: rgba(255, 181, 71, 0.3); }
.podracing-room .board td {
  border-top-color: rgba(255, 181, 71, 0.1);
  color: #f2d9a6;
  font-variant-numeric: tabular-nums;
}
.podracing-room .board .place { color: var(--amber); text-shadow: 0 0 6px rgba(255, 181, 71, 0.7); }
.podracing-room .board .up { color: var(--led-green); text-shadow: 0 0 5px rgba(125, 255, 154, 0.5); }
.podracing-room .board .down { color: var(--led-red); text-shadow: 0 0 5px rgba(255, 106, 90, 0.5); }
.podracing-room .board .dim { color: #8f8169; }
.podracing-room .board tr.backed td { background: rgba(125, 255, 154, 0.07); }
/* From the circuit: the commentary feed. */
.podracing-room .feed > li { border-top-color: rgba(255, 181, 71, 0.12); }
.podracing-room .feed h3 { color: var(--amber); }
.podracing-room .feed p { color: #a99a80; }
.podracing-room .feed p.lead-line { color: #f3e6cc; }

/* ---- recent races and the league ---- */
.podracing-room .recent li,
.podracing-room .league > li { border-top-color: rgba(184, 137, 62, 0.25); }
.podracing-room .recent strong { color: #f3e6cc; }
.podracing-room .league .rank { color: var(--brass-lit); }
.podracing-room .league summary:hover { background: rgba(240, 201, 120, 0.06); }
.podracing-room .league .tally strong { color: var(--amber); }
.podracing-room .league li.running .who { color: var(--amber); }
.podracing-room .bio .facts { color: var(--brass-lit); }
.podracing-room .bio blockquote { border-left-color: var(--brass); }

/* ---- keys ---- */
.podracing-room main .cs-button {
  border-color: var(--brass);
  color: #f3e6cc;
}
.podracing-room main .cs-button:hover:not(:disabled),
.podracing-room main .cs-button:focus-visible {
  background: rgba(240, 201, 120, 0.14);
  border-color: var(--brass-lit);
  color: #fff;
}
.podracing-room main .cs-button.gold {
  color: #1c1308;
  font-weight: 700;
  border-color: #ffe7ad;
  background: linear-gradient(180deg, #ffe7ad, var(--brass-lit) 40%, #a8742a);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.podracing-room main .cs-button.gold:hover:not(:disabled),
.podracing-room main .cs-button.gold:focus-visible {
  background: linear-gradient(180deg, #fff1cc, #ffd98f 40%, #c08834);
  color: #1c1308;
}

@media (prefers-reduced-motion: no-preference) {
  .podracing-room .phase-clock { animation: pod-tick 2s ease-in-out infinite; }
  @keyframes pod-tick { 50% { text-shadow: 0 0 9px rgba(125, 255, 154, 1); } }
}
