/* ============================================================
   CART-CADE — the holiday booths (holiday-games.js, SQL 16)
   SNOWBALL FIGHT and REINDEER RACE. The scenes are drawn art (their own
   colors); everything around them uses the site's variables, so they sit
   right in Neon Snow, Christmas, and in a back-office theme preview.
   Nothing here moves until a round is played (no ambient motion), and
   only transform / opacity are animated.
   ============================================================ */
.hg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* the holiday awnings: icy neon for Neon Snow, a candy cane for Christmas */
html[data-theme="winter"] .booth--holiday .booth__awning { background: repeating-linear-gradient(90deg, #19e3d0 0 28px, #1a1440 28px 56px); }
html[data-theme="christmas"] .booth--holiday .booth__awning { background: repeating-linear-gradient(90deg, #d8283c 0 28px, #fff6ec 28px 56px); }

/* the little "+3" that floats off a hit (the shared one, placed on the target) */
.hg-float { left: 50%; bottom: auto; top: 4%; z-index: 3; }

/* =================== SNOWBALL FIGHT =================== */
.sb-field {
  position: relative; height: 300px; margin-bottom: 10px; overflow: hidden; border-radius: 16px;
  border: 1px solid var(--line); background: #0c0a20; contain: layout paint;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.sb-field.is-playing { cursor: crosshair; }
.sb-back { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sb-spots { position: absolute; inset: 0; }
.sb-spot {
  position: absolute; left: calc(var(--x) - var(--w) / 2); bottom: var(--b); width: var(--w); aspect-ratio: 1 / 1.22;
  padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: inherit;
  -webkit-tap-highlight-color: transparent;
}
.sb-spot:disabled { cursor: default; }
.sb-spot:focus-visible { outline: 3px solid var(--candle); outline-offset: 2px; border-radius: 10px; }
/* who pops up: they rise out from behind the fort */
.sb-win { position: absolute; left: 3%; right: 3%; top: 0; bottom: 27%; overflow: hidden; pointer-events: none; }
.sb-who { position: absolute; inset: 0; transform: translateY(106%); transition: transform .14s ease-out; }
.sb-who svg { display: block; width: 100%; height: 100%; }
.sb-spot.is-up .sb-who { transform: translateY(0); }
.sb-spot.is-hit .sb-who { transform: translateY(20%) rotate(-10deg); transition-duration: .08s; }
.sb-spot.is-oops .sb-who { animation: sbHiss .32s ease; }
@keyframes sbHiss { 25% { transform: translateX(-7%) rotate(-4deg); } 50% { transform: translateX(7%) rotate(4deg); } 75% { transform: translateX(-4%); } 100% { transform: none; } }
/* the golden gift glows; the cat gets a "don't" ring */
.sb-win::before { content: ""; position: absolute; left: 8%; right: 8%; top: 18%; bottom: -10%; border-radius: 50%; opacity: 0; transition: opacity .14s; }
.sb-spot.is-up.is-k-g .sb-win::before { opacity: 1; background: radial-gradient(closest-side, rgba(255, 210, 74, .7), rgba(255, 210, 74, 0)); }
.sb-spot.is-up.is-k-c .sb-win::before { opacity: 1; background: radial-gradient(closest-side, rgba(255, 59, 87, 0) 62%, rgba(255, 59, 87, .55) 72%, rgba(255, 59, 87, 0) 88%); }
.sb-fort { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; pointer-events: none; }
.sb-fort svg { display: block; width: 100%; height: 100%; }
.sb-key { position: absolute; right: 9%; bottom: 12%; font: 800 10px/1 var(--ui); font-style: normal; color: #7d93b8; display: none; }
@media (hover: hover) and (pointer: fine) { .sb-key { display: block; } }
/* the splat on whatever a snowball hits */
.sb-splat {
  position: absolute; left: 20%; top: 16%; width: 60%; aspect-ratio: 1; opacity: 0; pointer-events: none; transform: scale(.4); z-index: 2;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 30%, transparent 31%),
    radial-gradient(circle at 18% 30%, #fff 0 11%, transparent 12%),
    radial-gradient(circle at 82% 26%, #eef5ff 0 10%, transparent 11%),
    radial-gradient(circle at 76% 80%, #fff 0 12%, transparent 13%),
    radial-gradient(circle at 22% 76%, #eef5ff 0 9%, transparent 10%);
}
.sb-splat.is-splat { animation: sbSplat .42s ease-out; }
@keyframes sbSplat { 0% { opacity: 1; transform: scale(.4); } 35% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12); } }
/* the snowballs in flight (four, reused; holiday-games.js moves them) */
.sb-balls { position: absolute; inset: 0; pointer-events: none; }
.sb-ball {
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 34% 30%, #fff, #e3ecfb 58%, #9db6da);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .35);
}
.sb-hud { z-index: 4; }
.sb-hint { z-index: 4; }
.sb-hint:not(.is-count) { background: radial-gradient(closest-side, rgba(9, 13, 42, .6), rgba(9, 13, 42, 0)); }
.sb-field.is-shaken { animation: fieldShake .35s ease; }
/* what each one is worth */
.sb-key-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; list-style: none; margin: 0 0 10px; padding: 0; }
.sb-key-list li { display: flex; align-items: center; gap: 2px; font: 800 13px/1 var(--ui); color: var(--ink-dim); }
.sb-key-list svg { width: 22px; height: 26px; }
.sb-key-list .is-gold { color: var(--candle); }
.sb-key-list .is-bad { color: var(--blood); }

/* =================== REINDEER RACE =================== */
.rr-track {
  position: relative; height: 256px; margin-bottom: 12px; overflow: hidden; border-radius: 16px;
  border: 1px solid var(--line); background: #e6eefb; contain: layout paint;
}
.rr-back { position: absolute; left: 0; top: 0; width: 100%; height: 64px; display: block; }
/* five snowy lanes down the causeway */
.rr-lanes { position: absolute; left: 0; right: 0; top: 64px; bottom: 0; display: grid; grid-template-rows: repeat(5, 1fr); }
.rr-lane { position: relative; border-bottom: 2px dashed #bcd0ea; }
.rr-lane:last-child { border-bottom: 0; }
.rr-lane::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); opacity: .85; }
.rr-lane.is-mine { background: linear-gradient(90deg, rgba(255, 210, 74, .42), rgba(255, 210, 74, 0) 72%); }
.rr-runner { position: absolute; left: 0; top: 50%; width: 56px; height: 42px; margin-top: -23px; transform: translate(6px, 0); }
.rr-runner svg { display: block; width: 100%; height: 100%; color: var(--c); overflow: visible; }
.rr-bib {
  position: absolute; left: 19px; top: 17px; z-index: 1; min-width: 13px; padding: 1px 2px; border-radius: 3px; text-align: center;
  font: 900 9px/1 var(--ui); color: #2a1630; background: #fff; border: 1.5px solid var(--c);
}
.rr-track.is-jump .rr-runner { transition: transform .6s ease-out; }
/* the finish line */
.rr-finish {
  position: absolute; top: 64px; bottom: 0; right: 24px; width: 10px; z-index: 0;
  background: repeating-conic-gradient(#1a1440 0 25%, #fff 0 50%) 0 0 / 10px 10px;
}
.rr-finish::after { content: "FINISH"; position: absolute; top: 3px; right: 14px; white-space: nowrap; font: 900 9px/1 var(--ui); letter-spacing: .14em; color: #6b5a8e; }
.rr-flash { position: absolute; inset: 0; z-index: 5; background: #fff; opacity: 0; pointer-events: none; }
/* the finish photo */
.rr-photo {
  position: absolute; left: 50%; top: 52%; z-index: 6; width: min(86%, 290px); transform: translate(-50%, -50%) rotate(-2deg);
  padding: 9px 12px 11px; border: 6px solid #fff; border-bottom-width: 14px; border-radius: 4px; text-align: center;
  background: #fffdf6; color: #2a1630; box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  animation: rrPhoto .36s ease-out;
}
.rr-photo[hidden] { display: none; }
@keyframes rrPhoto { from { opacity: 0; transform: translate(-50%, -40%) rotate(4deg) scale(.9); } }
.rr-photo__kicker { display: block; font: 800 11px/1.2 var(--ui); letter-spacing: .2em; color: #7a6a92; }
.rr-photo__win { display: block; margin: 4px 0 6px; font-family: var(--spooky); font-weight: 400; font-size: 25px; line-height: 1.05; color: #2a1630; text-decoration: underline 4px var(--c); text-underline-offset: 5px; }
.rr-photo__order { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; margin: 0; padding: 0; list-style: none; font: 700 12px/1.4 var(--ui); color: #4a3a62; }
.rr-photo__order span { color: #8a7aa2; font-weight: 800; }
.rr-photo__order .is-mine { color: #2a1630; font-weight: 900; }
/* the five to pick from */
.rr-picks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.rr-pick {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 8px 2px 7px; border-radius: 10px; cursor: pointer;
  font-family: var(--ui); color: var(--ink); background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
}
.rr-pick i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 900 12px/1 var(--ui); font-style: normal; color: #fff; background: var(--c); text-shadow: 0 1px 1px rgba(0, 0, 0, .4); }
.rr-pick b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8.6px; font-weight: 800; letter-spacing: 0; }
.rr-pick small { font-size: 10.5px; font-weight: 800; color: var(--candle); white-space: nowrap; }
.rr-pick.is-sel { border-color: var(--candle); box-shadow: 0 0 0 1px var(--candle), 0 0 14px rgb(var(--candle-rgb) / .35); background: rgb(var(--candle-rgb) / .1); }
.rr-pick:focus-visible { outline: 2px solid var(--candle); outline-offset: 2px; }
.rr-picks.is-locked .rr-pick { pointer-events: none; opacity: .55; }
.rr-picks.is-locked .rr-pick.is-sel { opacity: 1; }

/* =================== calm: reduced motion, and the "no effects" tier =================== */
@media (prefers-reduced-motion: reduce) {
  .sb-who, .sb-win::before { transition-duration: 0s; }
  .sb-spot.is-oops .sb-who, .sb-field.is-shaken { animation: none; }
  .sb-splat.is-splat { animation: sbFade .3s linear; }
  .rr-photo { animation: none; }
}
html.fx-off .sb-spot.is-oops .sb-who, html.fx-off .sb-field.is-shaken, html.fx-off .rr-photo { animation: none; }
html.fx-off .sb-splat.is-splat { animation: sbFade .3s linear; }
@keyframes sbFade { 0% { opacity: .9; transform: none; } 100% { opacity: 0; transform: none; } }
