/* Asların Yarışı · MeMoDe — Kraliyet Hipodromu teması */

:root {
  color-scheme: dark;
  --font-display: "Cinzel", "Palatino Linotype", "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  --felt-0: #030c08;
  --felt-1: #07180f;
  --felt-2: #0c2a1c;
  --paper: #fff6e6;
  --paper-dim: #d6cbb6;
  --muted: #93a79b;
  --line: rgba(242, 195, 90, 0.14);
  --line-strong: rgba(242, 195, 90, 0.32);
  --glass: rgba(4, 16, 10, 0.74);

  --gold: #f2c35a;
  --gold-deep: #a9782a;
  --crimson: #d22246;
  --ember: #d64826;
  --card-ink: #16171b;
  --card-red: #cc1f3d;

  --club: #6fd6a8;
  --diamond: #ffb454;
  --heart: #ff4d6d;
  --spade: #8fb4ff;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --label-col: 132px;
  --finish-col: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--paper);
  background: var(--felt-0);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

kbd {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--paper-dim);
  background: rgba(255, 255, 255, 0.04);
  font: 700 11px/1 var(--font-body);
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(24, 90, 60, 0.55), transparent 65%),
    radial-gradient(ellipse at 50% 120%, rgba(210, 34, 70, 0.22), transparent 55%),
    linear-gradient(180deg, var(--felt-1), var(--felt-0));
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 4px 4px;
}

/* ----------------------------------------------------------------- screens */

.screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.screen.is-active {
  display: grid;
  animation: screen-in 480ms var(--ease) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.kicker {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

.field__label {
  display: block;
  margin-bottom: 10px;
  color: var(--paper-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------------- menu */

.screen--menu {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  padding-left: max(24px, 7vw);
}

.menu {
  max-width: 480px;
}

.logo {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: clamp(50px, 6.6vw, 100px);
  font-weight: 900;
  line-height: 0.95;
  text-shadow: 0 0 40px rgba(242, 195, 90, 0.2);
}

.tagline {
  margin: 14px 0 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: clamp(15px, 1.35vw, 19px);
  font-weight: 500;
}

.menu__list {
  display: grid;
  margin-top: 36px;
  gap: 4px;
}

.menu__item {
  display: grid;
  padding: 14px 22px;
  gap: 3px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 3px;
  background: transparent;
  text-align: left;
  transition:
    background 260ms var(--ease),
    border-color 260ms var(--ease),
    transform 260ms var(--ease);
}

.menu__item span {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.menu__item small {
  color: var(--muted);
  font-size: 13px;
}

.menu__item:hover,
.menu__item:focus-visible,
.menu__item.is-primary {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(210, 34, 70, 0.92), rgba(214, 72, 38, 0.72));
  transform: translateX(4px);
  outline: none;
}

.menu__item:hover small,
.menu__item:focus-visible small,
.menu__item.is-primary small {
  color: rgba(255, 246, 230, 0.8);
}

.menu__list:hover .menu__item.is-primary:not(:hover) {
  border-left-color: transparent;
  background: transparent;
  transform: none;
}

.menu__list:hover .menu__item.is-primary:not(:hover) small {
  color: var(--muted);
}

.records {
  display: flex;
  margin: 32px 0 0;
  gap: 28px;
}

.records div {
  display: grid;
  gap: 2px;
}

.records dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.records dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.menu__stage {
  display: grid;
  place-items: center;
}

.fan {
  position: relative;
  width: min(32vw, 440px);
  height: min(32vw, 440px);
}

.fan .card {
  --w: min(12vw, 170px);
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform-origin: 50% 110%;
  animation: fan-in 900ms var(--ease) both;
}

.fan .card:nth-child(1) {
  transform: translateX(-50%) rotate(-27deg);
}
.fan .card:nth-child(2) {
  transform: translateX(-50%) rotate(-9deg);
  animation-delay: 80ms;
}
.fan .card:nth-child(3) {
  transform: translateX(-50%) rotate(9deg);
  animation-delay: 160ms;
}
.fan .card:nth-child(4) {
  transform: translateX(-50%) rotate(27deg);
  animation-delay: 240ms;
}

@keyframes fan-in {
  from {
    opacity: 0;
    transform: translateX(-50%) rotate(0deg) translateY(40px);
  }
}

.footer {
  grid-column: 1 / -1;
  justify-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer i {
  margin: 0 8px;
  color: var(--gold-deep);
  font-style: normal;
}

/* ------------------------------------------------------------------- cards */

.card {
  --w: 96px;
  position: relative;
  display: block;
  width: var(--w);
  aspect-ratio: 5 / 7;
  border-radius: calc(var(--w) * 0.08);
  color: var(--card-ink);
  background: linear-gradient(160deg, #fffdf6, #f3ead6);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  font-family: var(--font-display);
}

.card.is-red {
  color: var(--card-red);
}

.card__corner {
  position: absolute;
  top: 7%;
  left: 9%;
  display: grid;
  justify-items: center;
  font-size: calc(var(--w) * 0.2);
  font-weight: 700;
  line-height: 0.9;
}

.card__corner--end {
  top: auto;
  right: 9%;
  bottom: 7%;
  left: auto;
  transform: rotate(180deg);
}

.card__corner small {
  font-size: 0.8em;
}

.card__pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--w) * 0.5);
  line-height: 1;
}

.card--back {
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg, rgba(242, 195, 90, 0.2) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgba(242, 195, 90, 0.2) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #a6122f, #5c0718);
}

.card--back span {
  position: absolute;
  inset: 7%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 195, 90, 0.6);
  border-radius: calc(var(--w) * 0.05);
}

.card--back span::after {
  content: "M";
  color: var(--gold);
  font-family: var(--font-display);
  font-size: calc(var(--w) * 0.34);
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------- bet */

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

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 200ms var(--ease);
}

.icon-btn:hover {
  border-color: var(--gold);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-btn.is-muted {
  color: var(--muted);
}

.icon-btn.is-muted .wave {
  opacity: 0;
}

.bank,
.hud-chip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glass);
}

.bank span,
.hud-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.bank strong,
.hud-chip strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.bank strong::after,
.hud-chip strong::after {
  content: " çip";
  color: var(--paper-dim);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
}

.screen--bet {
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.bet {
  display: grid;
  width: min(100%, 980px);
  margin: 0 auto;
  align-content: center;
  gap: 26px;
}

.bet__head {
  text-align: center;
}

.bet__head h2 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
}

.bet__lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.picks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 24px);
}

.pick {
  --tone: var(--gold);
  position: relative;
  display: grid;
  padding: 16px 12px 14px;
  justify-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  transition:
    border-color 220ms var(--ease),
    transform 260ms var(--ease),
    background 220ms var(--ease);
}

.pick .card {
  --w: clamp(64px, 9vw, 112px);
  transition: transform 300ms var(--ease);
}

.pick:hover .card {
  transform: translateY(-6px) rotate(-2deg);
}

.pick[aria-checked="true"] {
  border-color: var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, rgba(0, 0, 0, 0.3));
  box-shadow: 0 0 0 1px var(--tone), 0 0 40px color-mix(in srgb, var(--tone) 30%, transparent);
  transform: translateY(-6px);
}

.pick__name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pick__odds {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.pick__rivals {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 3px;
}

.pick__rivals i {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: var(--felt-0);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.pick kbd {
  position: absolute;
  top: 10px;
  left: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.stake {
  text-align: center;
}

.chip {
  --chip: var(--gold);
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 3px dashed rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: var(--felt-0);
  background: radial-gradient(circle, #fff6e6 0 42%, var(--chip) 43%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  font-weight: 900;
  transition: transform 220ms var(--ease);
}

.chip:nth-child(2) {
  --chip: #4fb3ff;
}
.chip:nth-child(3) {
  --chip: #ff5d7a;
}
.chip:nth-child(4) {
  --chip: #9d7bff;
}
.chip:nth-child(5) {
  --chip: #2f2f35;
  color: var(--gold);
  background: radial-gradient(circle, #0c0c10 0 42%, var(--chip) 43%);
}

.chip small {
  font-size: 10px;
}

.chip:hover {
  transform: translateY(-3px) rotate(8deg);
}

.chip[aria-checked="true"] {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  transform: translateY(-4px);
}

.chip:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.rivals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.rival {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 13px;
}

.rival__avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--felt-0);
  font-weight: 900;
}

.rival b {
  font-weight: 700;
}

.rival span {
  color: var(--muted);
}

.bet__actions {
  display: flex;
  justify-content: center;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  min-height: 50px;
  padding: 0 26px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    background 220ms var(--ease),
    border-color 220ms var(--ease),
    transform 220ms var(--ease),
    opacity 220ms var(--ease);
}

.btn:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(90deg, var(--crimson), var(--ember));
  box-shadow: 0 10px 30px rgba(210, 34, 70, 0.35);
}

.btn--primary:hover {
  border-color: transparent;
  background: linear-gradient(90deg, #e52a52, #e8572d);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.stack {
  display: grid;
  margin-top: 22px;
  gap: 10px;
}

.stack--row {
  grid-auto-flow: column;
  justify-content: center;
}

/* -------------------------------------------------------------------- race */

.screen--race {
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.hud-chip--bet {
  margin-right: auto;
}

.hud-chip--bet b {
  font-family: var(--font-display);
  font-size: 18px;
}

.speed {
  display: flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
}

.speed button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: var(--paper-dim);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.speed button[aria-checked="true"] {
  color: var(--felt-0);
  background: var(--gold);
}

.race {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
}

.track {
  --cols: var(--label-col) repeat(9, minmax(0, 1fr)) var(--finish-col);
  display: grid;
  padding: 18px;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(4, 18, 11, 0.78);
  box-shadow: var(--shadow), inset 0 0 80px rgba(0, 0, 0, 0.4);
}

.gates,
.lane {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  column-gap: 0;
}

.gates__label,
.lane__label {
  padding-right: 10px;
}

.gates__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.gate {
  display: grid;
  justify-items: center;
  gap: 4px;
  perspective: 600px;
}

.gate small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.gate .flip {
  --w: clamp(24px, 2.9vw, 46px);
}

.gate__flag {
  color: var(--gold);
  font-size: 18px;
}

.lane {
  --tone: var(--gold);
  position: relative;
  min-height: 86px;
}

.lane--club {
  --tone: var(--club);
}
.lane--diamond {
  --tone: var(--diamond);
}
.lane--heart {
  --tone: var(--heart);
}
.lane--spade {
  --tone: var(--spade);
}

.lane__label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lane__symbol {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  font-size: 22px;
}

.lane__name {
  display: grid;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lane__name small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.lane__name em {
  width: fit-content;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--felt-0);
  background: var(--gold);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.16em;
}

.rail {
  position: relative;
  grid-column: 2 / 11;
  height: 100%;
  min-height: 86px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 9 - 1px), rgba(255, 255, 255, 0.07) calc(100% / 9 - 1px) calc(100% / 9)),
    linear-gradient(90deg, color-mix(in srgb, var(--tone) 10%, transparent), transparent 80%);
}

.lane.is-mine .rail {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 50%, transparent);
}

.rail__trail {
  position: absolute;
  top: 50%;
  left: 0;
  width: calc(var(--pos) / 9 * 100% + 100% / 18);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--tone));
  opacity: 0.6;
  transform: translateY(-50%);
  transition: width 520ms var(--ease);
}

.runner {
  position: absolute;
  top: 50%;
  left: calc(var(--pos) / 9 * 100% + 100% / 18);
  transform: translate(-50%, -50%);
  transition: left 520ms var(--ease);
}

.runner .card {
  --w: clamp(30px, 3.3vw, 54px);
}

.lane.is-leader .runner .card {
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 0 0 2px var(--tone),
    0 0 24px color-mix(in srgb, var(--tone) 60%, transparent);
}

.runner.is-bump {
  animation: runner-bump 520ms var(--ease);
}

.runner.is-hit {
  animation: runner-hit 520ms var(--ease);
}

@keyframes runner-bump {
  40% {
    transform: translate(-50%, -64%) scale(1.08);
  }
}

@keyframes runner-hit {
  25% {
    transform: translate(-58%, -50%) rotate(-8deg);
  }
  60% {
    transform: translate(-44%, -50%) rotate(5deg);
  }
}

.finish {
  grid-column: 11;
  align-self: stretch;
  border-radius: 4px;
  background:
    repeating-conic-gradient(#fff6e6 0 25%, #16171b 0 50%) 0 0 / 10px 10px;
  opacity: 0.8;
}

.lane.is-winner {
  animation: lane-win 900ms var(--ease) infinite alternate;
}

@keyframes lane-win {
  to {
    background: color-mix(in srgb, var(--tone) 10%, transparent);
  }
}

/* ------------------------------------------------------------------ dealer */

.dealer {
  display: grid;
  justify-items: stretch;
  gap: 16px;
}

.dealer__cards {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
}

.pile {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.pile .card {
  --w: 92px;
  box-shadow:
    3px 3px 0 #3a0610,
    6px 6px 0 #2a040b,
    0 14px 30px rgba(0, 0, 0, 0.5);
}

.pile small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.pile small::after {
  content: " KART";
}

.flip {
  --w: 116px;
  width: var(--w);
  aspect-ratio: 5 / 7;
  perspective: 900px;
}

.flip__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 520ms var(--ease);
}

.flip.is-open .flip__inner {
  transform: rotateY(180deg);
}

.flip__face {
  --w: inherit;
  position: absolute;
  inset: 0;
  width: 100%;
  backface-visibility: hidden;
}

.flip__front {
  transform: rotateY(180deg);
}

.gate .flip__face {
  width: 100%;
}

.gate .flip.is-open .flip__front {
  box-shadow: 0 0 0 2px var(--gold), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.btn--draw {
  min-height: 60px;
  font-size: 16px;
}

.btn--draw kbd {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  background: rgba(0, 0, 0, 0.2);
}

.btn--draw.is-auto {
  background: linear-gradient(90deg, #7a1a2e, #6b2a17);
}

.powers {
  display: grid;
  gap: 8px;
}

.power {
  display: grid;
  padding: 10px 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  text-align: left;
  transition:
    border-color 220ms var(--ease),
    background 220ms var(--ease),
    opacity 220ms var(--ease);
}

.power:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(242, 195, 90, 0.08);
}

.power:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.power.is-used {
  opacity: 0.3;
  text-decoration: line-through;
}

.power__icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--felt-0);
  background: var(--gold);
  font-size: 20px;
  font-weight: 900;
}

.power__text {
  display: grid;
  gap: 2px;
}

.power__text b {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.power__text small {
  color: var(--muted);
  font-size: 12px;
}

.power__text em {
  color: var(--gold);
  font-style: normal;
  font-weight: 700;
}

.commentary {
  min-height: 48px;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--paper-dim);
  background: var(--glass);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.commentary b {
  color: var(--gold);
}

.commentary.is-flash {
  animation: flash 700ms var(--ease);
}

@keyframes flash {
  0% {
    border-color: var(--gold);
    background: rgba(242, 195, 90, 0.16);
  }
}

/* ---------------------------------------------------------------- overlays */

.overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(2, 8, 5, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 260ms var(--ease) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.panel {
  width: min(560px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: rise 420ms var(--ease) both;
}

.panel--compact {
  width: min(420px, 100%);
}

.panel h2 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.05;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.panel--result {
  text-align: center;
}

.result-card {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.result-card .card {
  --w: 110px;
  animation: result-card 900ms var(--ease) both;
}

@keyframes result-card {
  from {
    opacity: 0;
    transform: rotateY(90deg) scale(0.8);
  }
}

.result-title {
  font-size: clamp(34px, 6vw, 56px) !important;
}

.result-delta {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
}

.result-delta.is-gain {
  color: var(--club);
}

.result-delta.is-loss {
  color: var(--heart);
}

.payouts {
  display: grid;
  margin: 18px 0 0;
  padding: 0;
  gap: 6px;
  list-style: none;
  text-align: left;
}

.payouts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.payouts li.is-you {
  outline: 1px solid var(--line-strong);
}

.payouts b.is-gain {
  color: var(--club);
}

.payouts b.is-loss {
  color: var(--heart);
}

.trap-options {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.trap-options button {
  display: grid;
  padding: 12px 8px;
  justify-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.trap-options button:hover {
  border-color: var(--heart);
}

.trap-options .card {
  --w: 58px;
}

.rules__list {
  display: grid;
  margin: 22px 0 0;
  padding: 0;
  gap: 12px;
  list-style: none;
}

.rules__list li {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--paper-dim);
  font-size: 14px;
  line-height: 1.6;
}

.rules__list b {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- confetti */

.confetti {
  position: fixed;
  z-index: 30;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: fall var(--dur) cubic-bezier(0.25, 0.6, 0.4, 1) forwards;
}

@keyframes fall {
  to {
    transform: translate(var(--dx), 110vh) rotate(var(--rot));
  }
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .race {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }

  .dealer {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .dealer__cards {
    grid-row: span 2;
  }

  .powers {
    grid-template-columns: 1fr 1fr;
  }

  .runner .card {
    --w: clamp(28px, 4.6vw, 50px);
  }
}

@media (max-width: 860px) {
  .screen--menu {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-content: start;
    padding-top: max(40px, 8vh);
  }

  .menu__stage {
    display: none;
  }

  .footer {
    align-self: end;
  }

  :root {
    --label-col: 44px;
    --finish-col: 12px;
  }

  .lane__name,
  .gates__label {
    display: none;
  }

  .lane {
    min-height: 60px;
  }

  .rail {
    min-height: 60px;
  }

  .runner .card {
    --w: clamp(22px, 7.4vw, 40px);
  }

  .track {
    padding: 10px;
    gap: 6px;
  }

  .gate small {
    font-size: 9px;
  }

  .picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-wrap: wrap;
  }

  .hud-chip--bet {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-right: 0;
  }
}

@media (max-width: 560px) {
  .screen {
    padding-inline: 12px;
  }

  .logo {
    font-size: 46px;
  }

  .dealer {
    grid-template-columns: minmax(0, 1fr);
  }

  .dealer__cards {
    grid-row: auto;
  }

  .pile .card {
    --w: 64px;
  }

  .flip {
    --w: 80px;
  }

  .powers {
    grid-template-columns: minmax(0, 1fr);
  }

  .power kbd,
  .btn--draw kbd,
  .pick kbd {
    display: none;
  }

  .chip {
    width: 58px;
    height: 58px;
  }

  .speed button {
    padding: 0 8px;
    font-size: 11px;
  }

  .rules__list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .stack--row {
    grid-auto-flow: row;
  }

  .trap-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lane__symbol {
    width: 30px;
    height: 30px;
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
