/* Horse Racing: betting controls, pixel race stage, win celebration, lobby lineup
   Load order matters: these stylesheets are ordered fragments of one cascade
   (see index.html). Mobile overrides live in responsive.css. */

.horse-racing-controls {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.85rem;
}

.horse-race-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 18rem;
  border: 1px solid rgba(108, 229, 255, 0.34);
  border-radius: 18px;
  padding: 1rem;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 247, 168, 0.14) 0 2px, transparent 3px),
    radial-gradient(circle at 48% 16%, rgba(191, 245, 255, 0.15) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 8%, rgba(255, 145, 181, 0.13) 0 2px, transparent 3px),
    linear-gradient(180deg, rgba(53, 93, 139, 0.42) 0 48%, transparent 48%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 2.5rem),
    linear-gradient(135deg, rgba(12, 32, 54, 0.95), rgba(18, 15, 48, 0.96));
  box-shadow: inset 0 -1.2rem 0 rgba(34, 91, 65, 0.38);
}

.horse-race-stage::before {
  content: "";
  position: absolute;
  inset: 3.8rem 0 auto;
  height: 2.2rem;
  background:
    radial-gradient(circle, #ff91b5 0 3px, transparent 4px) 0 0 / 1.5rem 1.1rem,
    radial-gradient(circle, #6ce5ff 0 3px, transparent 4px) 0.75rem 0.35rem / 1.5rem 1.1rem,
    linear-gradient(180deg, rgba(12, 14, 35, 0.45), rgba(12, 14, 35, 0.82));
  opacity: 0.7;
  animation: pixel-crowd-wave 720ms steps(2, end) infinite alternate;
}

.horse-race-stage::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 0 42%, rgba(108, 229, 255, 0.08) 48%, transparent 54%) -12rem 0 / 12rem 100% no-repeat;
  pointer-events: none;
  animation: race-light-sweep 3.2s linear infinite;
}

.horse-race-stage-title {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.horse-race-stage-title > span {
  font-size: clamp(2rem, 7vw, 3.4rem);
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.25));
}

.horse-race-stage-title div {
  display: grid;
  gap: 0.15rem;
}

.horse-race-stage-title strong {
  font-size: clamp(1.1rem, 4vw, 1.65rem);
}

.horse-race-stage-title div span {
  color: var(--casino-muted);
  font-size: 0.85rem;
}

.horse-bet-total-strip {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.horse-bet-total-strip > span {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(108, 229, 255, 0.24);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  background: rgba(7, 9, 23, 0.64);
  color: var(--party-cyan);
}

.horse-bet-total-strip > span.red-horse {
  border-color: rgba(255, 79, 139, 0.28);
  color: var(--party-pink);
}

.horse-bet-total-strip small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--party-cream);
  font-size: 0.68rem;
}

.horse-race-card {
  position: relative;
  z-index: 1;
  width: 3.65rem;
  aspect-ratio: 0.72;
  display: grid;
  place-content: center;
  border: 2px solid rgba(108, 229, 255, 0.38);
  border-radius: 10px;
  background:
    repeating-linear-gradient(135deg, #5b35ba 0 8px, #713dd1 8px 16px);
  color: transparent;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
  transform-origin: center;
}

.horse-race-card.has-card {
  gap: 0.1rem;
  background: #f8f7ff;
  color: #11121b;
}

.horse-race-card.has-card.animate-card {
  animation: horse-card-reveal 650ms cubic-bezier(0.2, 0.85, 0.3, 1.2) both;
}

.horse-race-card.red-card {
  color: #d82f5e;
}

.horse-race-card strong {
  font-size: 1.55rem;
  line-height: 1;
}

.horse-race-card span {
  font-size: 1.6rem;
  line-height: 1;
}

.horse-race-histories {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.horse-race-history {
  border: 1px solid rgba(108, 229, 255, 0.24);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(108, 229, 255, 0.08), rgba(139, 92, 246, 0.09)),
    rgba(7, 9, 23, 0.7);
}

.horse-race-history-setback {
  border-color: rgba(255, 79, 139, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.1), rgba(255, 171, 104, 0.07)),
    rgba(7, 9, 23, 0.7);
}

.horse-race-history summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1rem;
  align-items: center;
  gap: 0.65rem;
  min-height: 5.25rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.horse-race-history summary::-webkit-details-marker {
  display: none;
}

.horse-race-history summary::after {
  content: "›";
  color: var(--party-cyan);
  font-size: 1.45rem;
  font-weight: 900;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.horse-race-history[open] summary::after {
  transform: rotate(-90deg);
}

.horse-race-history summary > div:first-child {
  min-width: 0;
  display: grid;
  gap: 0.14rem;
}

.horse-race-history summary > div:first-child span {
  color: var(--party-cyan);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.horse-race-history-setback summary > div:first-child span {
  color: var(--party-pink);
}

.horse-race-history summary > div:first-child strong {
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.horse-race-history-content {
  display: grid;
  gap: 0.55rem;
  border-top: 1px solid rgba(108, 229, 255, 0.16);
  padding: 0.65rem 0.75rem 0.75rem;
}

.horse-race-history-content > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--casino-muted);
  font-size: 0.78rem;
}

.horse-race-history-cards {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.35rem;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  touch-action: pan-x;
  scrollbar-width: thin;
}

.horse-race-history-cards > p {
  margin: 0;
  color: var(--casino-muted);
  font-size: 0.86rem;
}

.horse-race-history-item {
  flex: 0 0 5.5rem;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  scroll-snap-align: start;
  text-align: center;
}

.horse-race-history-item > span {
  color: var(--casino-muted);
  font-size: 0.68rem;
  line-height: 1.2;
}

.horse-race-card.small {
  width: 2.8rem;
}

.horse-race-card.small.has-card {
  animation: none;
}

.horse-race-card.small strong,
.horse-race-card.small span {
  font-size: 1.15rem;
}

.pixel-horse-course {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  overflow: hidden;
  border: 3px solid #080b1d;
  border-radius: 12px;
  padding: 5.4rem 5px 5px;
  background:
    linear-gradient(180deg, #253f79 0 26%, #8b5c87 26% 31%, #192444 31% 100%);
  box-shadow:
    0 0 0 2px rgba(108, 229, 255, 0.34),
    inset 0 0 24px rgba(0, 0, 0, 0.55),
    0 16px 34px rgba(0, 0, 0, 0.28);
  image-rendering: pixelated;
  contain: paint;
}

.pixel-race-scenery {
  position: absolute;
  inset: 0 0 auto;
  height: 5.25rem;
  overflow: hidden;
  border-bottom: 4px solid #69dcf4;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.8) 0 2px, transparent 3px),
    radial-gradient(circle at 73% 16%, rgba(255, 247, 168, 0.8) 0 2px, transparent 3px),
    linear-gradient(180deg, #1c376f, #6a4b79);
}

.pixel-race-sun {
  position: absolute;
  z-index: 0;
  top: 0.65rem;
  right: 8%;
  width: 1.5rem;
  height: 1.5rem;
  background: #fff7a8;
  box-shadow: 0 0 0 5px rgba(255, 247, 168, 0.14);
}

.pixel-race-clouds {
  position: absolute;
  z-index: 1;
  inset: 0;
  animation: pixel-race-cloud-scroll 10s linear infinite;
  will-change: transform;
}

.pixel-race-clouds i {
  position: absolute;
  top: 1rem;
  left: 12%;
  width: 2.4rem;
  height: 0.45rem;
  background: rgba(191, 245, 255, 0.62);
  box-shadow:
    0.55rem -0.45rem 0 rgba(191, 245, 255, 0.62),
    1.25rem -0.2rem 0 rgba(191, 245, 255, 0.62);
}

.pixel-race-clouds i:nth-child(2) {
  top: 1.85rem;
  left: 48%;
  transform: scale(0.72);
}

.pixel-race-clouds i:nth-child(3) {
  top: 0.8rem;
  left: 82%;
  transform: scale(0.88);
}

.pixel-race-horizon {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0.75rem;
  width: 200%;
  height: 3.2rem;
  display: flex;
  animation: pixel-race-horizon-scroll 2.7s linear infinite;
  will-change: transform;
}

.pixel-race-horizon-strip {
  flex: 0 0 50%;
  display: flex;
  align-items: end;
  justify-content: space-around;
  padding-inline: 1rem;
}

.pixel-race-tree {
  position: relative;
  width: 0.35rem;
  height: 1.25rem;
  background: #462d52;
}

.pixel-race-tree::before {
  content: "";
  position: absolute;
  left: -0.65rem;
  bottom: 0.65rem;
  width: 1.65rem;
  height: 1.55rem;
  background:
    linear-gradient(135deg, transparent 24%, #2aa382 25% 74%, transparent 75%);
}

.pixel-race-building {
  width: 1.45rem;
  height: 2.45rem;
  border: 3px solid #161b3c;
  border-bottom: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(255, 247, 168, 0.72) 5px 8px, transparent 8px 13px),
    repeating-linear-gradient(0deg, #343568 0 7px, #444581 7px 10px);
}

.pixel-race-crowd {
  position: absolute;
  z-index: 3;
  inset: auto 0 0;
  height: 0.9rem;
  background:
    radial-gradient(circle, #ff91b5 0 2px, transparent 3px) 0 0 / 1rem 0.8rem,
    radial-gradient(circle, #6ce5ff 0 2px, transparent 3px) 0.5rem 0.25rem / 1rem 0.8rem,
    #10152f;
  animation: pixel-race-crowd-jump 380ms steps(2, end) infinite alternate;
}

.pixel-horse-lane {
  position: relative;
  height: 3.65rem;
  overflow: hidden;
  border-bottom: 2px solid rgba(255, 221, 173, 0.25);
  background:
    repeating-linear-gradient(100deg, transparent 0 1.7rem, rgba(255, 231, 196, 0.09) 1.7rem 1.85rem, transparent 1.85rem 3.5rem),
    linear-gradient(180deg, #a9653f, #6d3d2b);
  background-size: 3.5rem 100%, 100% 100%;
  animation: pixel-track-run 360ms linear infinite;
}

.pixel-horse-lane:last-child {
  border-bottom: 0;
}

.pixel-horse-lane.is-fallback {
  animation:
    pixel-track-run 360ms linear infinite,
    pixel-fallback-lane-flash 1.3s steps(4, end) both;
}

.pixel-horse-lane.is-fallback .pixel-horse-sprite::before {
  width: 0.38rem;
  height: 0.38rem;
  box-shadow:
    -0.55rem 0.1rem 0 rgba(255, 226, 186, 0.62),
    -1rem -0.12rem 0 rgba(255, 226, 186, 0.42),
    0.45rem -0.2rem 0 rgba(255, 226, 186, 0.32);
  animation: pixel-horse-fall-dust 1.25s steps(6, end) both;
}

.pixel-horse-lane::before {
  content: "";
  position: absolute;
  inset: auto -50% 0.28rem;
  height: 3px;
  background: repeating-linear-gradient(90deg, rgba(255, 235, 201, 0.62) 0 1.8rem, transparent 1.8rem 3.2rem);
  animation: pixel-lane-rush 280ms linear infinite;
}

.pixel-horse-lane::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 2.2rem;
  width: 0.55rem;
  border-inline: 2px solid rgba(16, 18, 36, 0.75);
  background:
    conic-gradient(rgba(248, 247, 255, 0.5) 25%, transparent 0 50%, rgba(248, 247, 255, 0.5) 0 75%, transparent 0) 0 0 / 6px 6px;
  opacity: 0.46;
}

.pixel-finish-line {
  position: absolute;
  z-index: 4;
  inset: 0 0.55rem 0 auto;
  width: 0.8rem;
  border-inline: 2px solid #101224;
  background:
    conic-gradient(#f8f7ff 25%, #101224 0 50%, #f8f7ff 0 75%, #101224 0) 0 0 / 8px 8px;
}

.pixel-horse-score {
  position: absolute;
  z-index: 5;
  left: 0.35rem;
  top: 0.25rem;
  min-width: 2.65rem;
  border: 2px solid rgba(108, 229, 255, 0.42);
  padding: 0.1rem 0.25rem;
  background: rgba(7, 9, 23, 0.82);
  color: var(--party-cyan);
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
}

.pixel-horse-score.red-score {
  border-color: rgba(255, 79, 139, 0.48);
  color: #ff91b5;
}

.pixel-horse-sprite {
  --pixel-horse-color: #ff5d91;
  position: absolute;
  z-index: 3;
  left: clamp(3.25rem, var(--pixel-horse-position), calc(100% - 3.6rem));
  top: 54%;
  width: 4.2rem;
  height: 2.35rem;
  transform: translate(-50%, -50%);
  filter: drop-shadow(4px 4px 0 rgba(25, 12, 19, 0.48));
  animation: pixel-horse-run-bob 260ms steps(2, end) infinite alternate;
  will-change: left, transform;
}

.pixel-horse-sprite::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  bottom: 0;
  width: 0.24rem;
  height: 0.24rem;
  background: rgba(255, 226, 186, 0.7);
  box-shadow:
    -0.45rem 0.08rem 0 rgba(255, 226, 186, 0.46),
    -0.9rem -0.08rem 0 rgba(255, 226, 186, 0.25);
  animation: pixel-horse-dust 420ms steps(3, end) infinite;
}

.pixel-horse-sprite::after {
  content: "";
  position: absolute;
  right: calc(100% + 0.2rem);
  top: 0.9rem;
  width: 1.6rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(108, 229, 255, 0.58));
  box-shadow:
    -0.7rem 0.5rem 0 rgba(255, 255, 255, 0.25),
    0.3rem -0.5rem 0 rgba(255, 145, 181, 0.32);
  animation: pixel-speed-lines 300ms steps(2, end) infinite;
}

.pixel-horse-hearts {
  --pixel-horse-color: #ff5d91;
}

.pixel-horse-diamonds {
  --pixel-horse-color: #ffab68;
}

.pixel-horse-clubs {
  --pixel-horse-color: #6ce5ff;
}

.pixel-horse-spades {
  --pixel-horse-color: #b690ff;
}

.pixel-horse-body {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  width: 1.9rem;
  height: 0.72rem;
  background: var(--pixel-horse-color);
  box-shadow:
    -0.45rem -0.15rem 0 -0.08rem var(--pixel-horse-color),
    1.4rem -0.25rem 0 -0.04rem var(--pixel-horse-color);
  animation: pixel-horse-gallop 260ms steps(2, end) infinite alternate;
}

.pixel-horse-body::before {
  content: "";
  position: absolute;
  right: -0.9rem;
  top: -0.38rem;
  width: 0.72rem;
  height: 0.58rem;
  background: var(--pixel-horse-color);
  box-shadow:
    0.38rem -0.18rem 0 -0.08rem var(--pixel-horse-color),
    0.46rem 0.25rem 0 -0.12rem #20142b;
}

.pixel-horse-body::after {
  content: "";
  position: absolute;
  left: -0.65rem;
  top: -0.1rem;
  width: 0.85rem;
  height: 0.24rem;
  background: var(--pixel-horse-color);
  transform: rotate(24deg);
  transform-origin: right center;
  animation: pixel-horse-tail 260ms steps(2, end) infinite alternate;
}

.pixel-horse-leg {
  position: absolute;
  top: 0.55rem;
  width: 0.22rem;
  height: 0.85rem;
  background: var(--pixel-horse-color);
  transform-origin: top center;
  animation: pixel-horse-leg-a 260ms steps(2, end) infinite alternate;
}

.pixel-horse-leg::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.13rem;
  width: 0.38rem;
  height: 0.18rem;
  background: #21152b;
}

.pixel-horse-leg.leg-1 {
  left: 0.2rem;
}

.pixel-horse-leg.leg-2 {
  left: 0.63rem;
  animation-name: pixel-horse-leg-b;
}

.pixel-horse-leg.leg-3 {
  right: 0.5rem;
  animation-name: pixel-horse-leg-b;
}

.pixel-horse-leg.leg-4 {
  right: 0.12rem;
}

.pixel-horse-rider {
  position: absolute;
  left: 1.65rem;
  top: 0.08rem;
  width: 0.46rem;
  height: 0.72rem;
  background: #f8f7ff;
  box-shadow:
    0.06rem -0.38rem 0 -0.04rem #fff7a8,
    0.46rem 0.28rem 0 -0.09rem #f8f7ff,
    -0.25rem 0.08rem 0 -0.08rem #6ce5ff;
  animation: pixel-rider-bob 260ms steps(2, end) infinite alternate;
}

.pixel-horse-sprite > b {
  position: absolute;
  z-index: 3;
  left: 1.55rem;
  top: 0.7rem;
  color: #101224;
  font-size: 0.62rem;
  line-height: 1;
}

.pixel-horse-forward {
  animation:
    pixel-horse-advance 900ms steps(8, end) both,
    pixel-horse-run-bob 260ms 900ms steps(2, end) infinite alternate;
}

.pixel-horse-backward {
  animation:
    pixel-horse-trip 1.35s steps(10, end) both,
    pixel-horse-run-bob 260ms 1.35s steps(2, end) infinite alternate;
}

.pixel-horse-bounce {
  animation:
    pixel-horse-advance-trip 1.55s steps(12, end) both,
    pixel-horse-run-bob 260ms 1.55s steps(2, end) infinite alternate;
}

.pixel-horse-winner {
  animation:
    pixel-horse-advance 900ms steps(8, end) both,
    pixel-horse-victory 520ms 900ms steps(4, end) infinite alternate;
}

.pixel-horse-trip-label {
  position: absolute;
  z-index: 6;
  top: 0.22rem;
  left: clamp(3.25rem, var(--pixel-horse-position), calc(100% - 4rem));
  border: 2px solid #ff6872;
  padding: 0.08rem 0.3rem;
  background: #090a17;
  color: #ff9aa2;
  font-size: 0.62rem;
  font-style: italic;
  transform: rotate(-7deg);
  animation: pixel-trip-label-pop 1.3s steps(5, end) both;
}

.horse-win-celebration {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: grid;
  grid-template-columns: auto auto;
  place-content: center;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  border-radius: inherit;
  background: rgba(8, 10, 24, 0.78);
  text-align: left;
  animation: horse-winner-pop 580ms cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
  backdrop-filter: blur(3px);
}

.horse-win-portrait {
  position: relative;
  width: clamp(7.5rem, 25vw, 10rem);
  height: clamp(5.3rem, 17vw, 6.6rem);
  overflow: hidden;
  border: 3px solid var(--party-cyan);
  background:
    radial-gradient(circle at 76% 22%, #fff7a8 0 0.45rem, transparent 0.5rem),
    linear-gradient(180deg, #31518c 0 58%, #7c4b32 58%);
  box-shadow:
    5px 5px 0 rgba(139, 92, 246, 0.65),
    inset 0 0 0 3px rgba(8, 10, 24, 0.56);
  image-rendering: pixelated;
}

.horse-win-portrait::before {
  content: "";
  position: absolute;
  inset: auto 0 36%;
  height: 1.1rem;
  background:
    radial-gradient(circle, #ff91b5 0 2px, transparent 3px) 0 0 / 0.9rem 0.8rem,
    radial-gradient(circle, #6ce5ff 0 2px, transparent 3px) 0.45rem 0.25rem / 0.9rem 0.8rem,
    #10152f;
}

.horse-win-portrait::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  border-top: 3px solid rgba(255, 235, 201, 0.66);
  background:
    repeating-linear-gradient(100deg, transparent 0 1.3rem, rgba(255, 231, 196, 0.13) 1.3rem 1.45rem),
    #7c4b32;
  animation: pixel-track-run 360ms linear infinite;
}

.horse-win-picture-horse {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 51%;
  width: 4.2rem;
  height: 2.35rem;
  filter: drop-shadow(4px 4px 0 rgba(25, 12, 19, 0.48));
  animation: horse-winner-gallop 430ms steps(4, end) infinite alternate;
}

.horse-win-picture-horse > b {
  position: absolute;
  z-index: 3;
  left: 1.55rem;
  top: 0.7rem;
  color: #101224;
  font-size: 0.62rem;
  line-height: 1;
}

.horse-win-medal {
  position: absolute;
  z-index: 4;
  right: 0.25rem;
  bottom: 0.2rem;
  font-size: 1.7rem !important;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.4));
  animation: horse-medal-bounce 560ms steps(4, end) infinite alternate;
}

.horse-win-celebration > div:not(.horse-win-confetti) {
  display: grid;
}

.horse-win-celebration > div > span {
  color: var(--party-cyan);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.horse-win-celebration > div > strong {
  font-size: clamp(1.25rem, 5vw, 2rem);
}

.horse-win-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.horse-win-confetti i {
  --horse-confetti-x: 8%;
  --horse-confetti-delay: 0ms;
  position: absolute;
  left: var(--horse-confetti-x);
  top: -0.6rem;
  width: 7px;
  height: 11px;
  background: var(--party-pink);
  animation: horse-confetti-fall 1.5s var(--horse-confetti-delay) linear infinite;
}

.horse-win-confetti i:nth-child(2) { --horse-confetti-x: 16%; --horse-confetti-delay: 250ms; background: var(--party-cyan); }
.horse-win-confetti i:nth-child(3) { --horse-confetti-x: 24%; --horse-confetti-delay: 520ms; background: #fff7a8; }
.horse-win-confetti i:nth-child(4) { --horse-confetti-x: 33%; --horse-confetti-delay: 130ms; background: var(--party-violet); }
.horse-win-confetti i:nth-child(5) { --horse-confetti-x: 41%; --horse-confetti-delay: 680ms; background: var(--party-lime); }
.horse-win-confetti i:nth-child(6) { --horse-confetti-x: 49%; --horse-confetti-delay: 360ms; background: var(--party-pink); }
.horse-win-confetti i:nth-child(7) { --horse-confetti-x: 58%; --horse-confetti-delay: 40ms; background: var(--party-cyan); }
.horse-win-confetti i:nth-child(8) { --horse-confetti-x: 66%; --horse-confetti-delay: 450ms; background: #fff7a8; }
.horse-win-confetti i:nth-child(9) { --horse-confetti-x: 74%; --horse-confetti-delay: 190ms; background: var(--party-violet); }
.horse-win-confetti i:nth-child(10) { --horse-confetti-x: 82%; --horse-confetti-delay: 590ms; background: var(--party-lime); }
.horse-win-confetti i:nth-child(11) { --horse-confetti-x: 90%; --horse-confetti-delay: 310ms; background: var(--party-pink); }
.horse-win-confetti i:nth-child(12) { --horse-confetti-x: 96%; --horse-confetti-delay: 740ms; background: var(--party-cyan); }

.horse-auto-status,
.horse-manual-status {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0.15rem;
  border: 1px solid rgba(108, 229, 255, 0.25);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: rgba(108, 229, 255, 0.07);
}

.horse-auto-status span,
.horse-manual-status span {
  color: var(--casino-muted);
  font-size: 0.86rem;
}

.horse-auto-timer {
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: rgba(108, 229, 255, 0.12);
}

.horse-auto-timer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--party-cyan), var(--party-violet));
  transform-origin: left;
  animation: horse-auto-countdown 2.8s linear both;
}

.horse-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  width: 100%;
}

.horse-lobby-lineup {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.horse-lobby-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  min-height: 3.5rem;
  padding: 0.55rem 0.65rem;
}

.horse-lobby-card strong {
  font-size: 0.92rem;
}

.horse-lobby-bet-total {
  grid-column: 2;
  color: var(--casino-muted);
  font-size: 0.7rem;
}

.horse-lobby-icon {
  width: 2.1rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(108, 229, 255, 0.12);
  color: var(--party-cyan);
  font-size: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(108, 229, 255, 0.24);
}

.horse-lobby-card.red-horse .horse-lobby-icon {
  background: rgba(255, 79, 139, 0.12);
  color: var(--party-pink);
  box-shadow: inset 0 0 0 1px rgba(255, 79, 139, 0.24);
}

.horse-lane {
  display: grid;
  gap: 0.65rem;
  width: 100%;
  border: 1px solid rgba(216, 180, 95, 0.24);
  border-radius: 8px;
  padding: 0.7rem;
  background: rgba(255, 245, 227, 0.07);
}

.horse-bet-counter {
  grid-template-columns: 2.75rem 2.25rem 2.75rem;
  justify-content: end;
}

.give-counter {
  grid-template-columns: 2.75rem 2.25rem 3.25rem 2.75rem;
}

.give-max-button {
  min-height: 2.5rem;
  min-width: 3.25rem;
  padding: 0 0.55rem;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.horse-debug-bets {
  display: grid;
  gap: 0.65rem;
}

.horse-debug-player {
  display: grid;
  gap: 0.55rem;
  border: 1px solid rgba(216, 180, 95, 0.24);
  border-radius: 8px;
  padding: 0.7rem;
  background: rgba(255, 245, 227, 0.06);
}

.horse-debug-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.55rem;
}

.horse-debug-counter {
  display: grid;
  grid-template-columns: 1.6rem auto;
  align-items: center;
  gap: 0.45rem;
}

.horse-bet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
