/* Honey Trail: game-only styles on top of candy-kit (kit.css + theme.css): the trail board, the
 * board HUD, the difficulty selector, the STEP button, the wordmark, the preloader and modal bits.
 * Everything else is kit components themed by tokens. */

html, body { margin: 0; height: 100%; background: var(--ck-bg); color: var(--ck-text); font-family: var(--ck-font); }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
#ht-root { height: 100vh; height: 100dvh; }

/* ---- stage: our scene replaces the kit multiplier HUD ---- */
.ht-shell .ck-stage__hud, .ht-shell .ck-stage__trail { display: none; }
.ht-scene {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; gap: 6px;
  padding: clamp(12px, 2.4cqi, 22px) clamp(12px, 2.6cqi, 26px) clamp(10px, 2cqi, 18px);
  /* faint honeycomb texture, flat */
  background:
    radial-gradient(circle at 18% 12%, rgba(246, 166, 35, .10), transparent 42%),
    radial-gradient(circle at 86% 92%, rgba(240, 80, 143, .08), transparent 40%);
}
.ht-hud { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 16px; min-height: 0; }
.ht-hud__left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ht-hud__label { font-size: var(--ck-fs-xs, 12px); font-weight: 600; letter-spacing: var(--ck-tracking-caps, .06em); text-transform: uppercase; color: var(--ck-text-muted); }
.ht-hud__mult { font-size: clamp(30px, 6.2cqi, 56px); font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: #fff; }
.ht-hud[data-tone="won"] .ht-hud__mult { color: var(--ck-success); }
.ht-hud[data-tone="lost"] .ht-hud__mult { color: var(--ck-danger); }
.ht-hud__right { text-align: right; }
.ht-hud__next { display: inline-block; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--ck-line); font-size: var(--ck-fs-sm, 13px); font-weight: 600; color: var(--ht-honey-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ht-hud__status { grid-column: 1 / -1; margin: 0; min-height: 1.3em; font-size: var(--ck-fs-sm, 13px); color: rgba(251, 243, 234, .72); }
.ht-hud[data-tone="lost"] .ht-hud__status { color: #ffb3c4; }
.ht-hud[data-tone="won"] .ht-hud__status { color: #a9f0e2; }

/* ---- street (src/ui/road.js): kerb | lanes | kerb, Candy crosses left → right ---- */
.ht-boardhost { position: relative; min-height: 0; margin: 0 calc(-1 * clamp(12px, 2.6cqi, 26px)) calc(-1 * clamp(10px, 2cqi, 18px)); }
.ht-road { position: absolute; inset: 0; overflow: hidden; background: #2b2427; border-top: 1px solid var(--ck-line);
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ht-road.is-dragging { cursor: grabbing; }
.ht-road.is-dragging .ht-road__track { transition: none; }
.ht-road img { -webkit-user-drag: none; pointer-events: none; }
.ht-road__track { position: relative; height: 100%; display: flex; transition: transform 520ms cubic-bezier(.3, .7, .3, 1); will-change: transform; }
.ht-kerb {
  flex: none; width: var(--ht-kerb-w); height: 100%; position: relative;
  background:
    linear-gradient(90deg, rgba(0,0,0,.18) 0 4px, transparent 4px calc(100% - 6px), #f2c9d6 calc(100% - 6px)),
    repeating-linear-gradient(0deg, #4a3a40 0 38px, #433439 38px 40px);
}
.ht-kerb--finish { background:
    linear-gradient(90deg, #f2c9d6 0 6px, transparent 6px),
    repeating-linear-gradient(0deg, #4a3a40 0 38px, #433439 38px 40px); }
.ht-kerb__label { position: absolute; left: 0; right: 0; top: 10px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(251, 243, 234, .55); }
.ht-kerb__bet { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; font-weight: 600; color: rgba(251, 243, 234, .6); font-variant-numeric: tabular-nums; }
.ht-lane {
  flex: none; width: var(--ht-lane-w); height: 100%; position: relative; overflow: hidden;
  /* dashed white divider on the right edge */
  background: linear-gradient(0deg, transparent 0 50%, rgba(255, 255, 255, .28) 50%) right top / 3px 34px repeat-y, #2b2427;
}
.ht-lane:last-of-type { background: #2b2427; }
.ht-lane.is-passed, .ht-lane.is-current { background-color: #30282b; }
.ht-lane__cars { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ht-road { --ht-car-ar: .54; /* car.webp 227×420 */ --ht-car-w: calc(var(--ht-lane-w) * .82); --ht-car-h: calc(var(--ht-car-w) / var(--ht-car-ar)); --ht-stop-y: 22%; }
.ht-car {
  position: absolute; left: 50%; top: calc(-1 * var(--ht-car-h)); width: var(--ht-car-w); height: var(--ht-car-h);
  transform: translateX(-50%); animation: ht-drive var(--ht-car-dur, 2s) linear forwards; filter: hue-rotate(var(--ht-car-hue, 0deg));
}
.ht-car img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(0,0,0,.4)); }
.ht-car:not(.has-art) { border-radius: 30% 30% 22% 22%; background: linear-gradient(180deg, #e8436b, #b5254a); box-shadow: inset 0 -10px 0 rgba(0,0,0,.18); }
/* the car that stops for Candy: brakes just above the barricade and waits there (the lane stays closed) */
.ht-car--stop { animation: ht-brake 900ms cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes ht-brake {
  0% { top: calc(-1 * var(--ht-car-h)); }
  78% { top: calc(var(--ht-stop-y) - var(--ht-car-h) + 3%); }
  100% { top: calc(var(--ht-stop-y) - var(--ht-car-h)); }
}
@keyframes ht-drive { from { top: calc(-1 * var(--ht-car-h)); } to { top: 112%; } }
.ht-car.is-fading { opacity: 0; transition: opacity 240ms ease-out; }

.ht-barrier { position: absolute; left: 6%; right: 6%; top: var(--ht-stop-y, 22%); height: 12%; z-index: 3; opacity: 0; transform: translateY(-30%); transition: opacity 240ms ease, transform 300ms cubic-bezier(.3, 1.4, .5, 1); pointer-events: none; }
.ht-barrier img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); }
.ht-barrier:not(.has-art) { height: 10px; border-radius: 6px; background: repeating-linear-gradient(135deg, #fff 0 10px, #e8436b 10px 20px); }
/* the barricade drops only once the server confirmed the step (never while it is pending) */
.ht-lane.is-passed .ht-barrier, .ht-lane.is-current .ht-barrier { opacity: 1; transform: none; }

.ht-plate {
  position: absolute; left: 50%; top: 66%; width: min(78%, 120px); aspect-ratio: 1; transform: translate(-50%, -50%);
  margin: 0; padding: 0; border: 0; border-radius: 50%; font: inherit; cursor: default;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: rgba(251, 243, 234, .62); background-repeat: no-repeat; background-position: center; background-size: contain;
  background-color: #3a3135;
  box-shadow: inset 0 0 0 3px #4d4247, inset 0 0 0 7px #332a2e, inset 0 0 0 9px #4d4247, 0 2px 0 rgba(0, 0, 0, .3);
  transition: transform 160ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
.ht-plate__step { font-size: 11px; font-weight: 600; opacity: .7; line-height: 1; }
.ht-plate__mult { font-size: clamp(13px, calc(var(--ht-lane-w) * .15), 20px); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ht-lane.is-next .ht-plate { cursor: pointer; color: var(--ck-text); box-shadow: inset 0 0 0 3px var(--ht-honey), inset 0 0 0 7px #332a2e, inset 0 0 0 9px #4d4247, 0 0 0 4px rgba(246, 166, 35, .22); animation: ht-plate-breathe 1.8s ease-in-out infinite; }
.ht-lane.is-next .ht-plate__mult { color: var(--ht-honey-light); }
.ht-lane.is-next .ht-plate:hover, .ht-lane.is-next .ht-plate:focus-visible { background-color: #4a3e33; outline: none; }
.ht-lane.is-next .ht-plate:focus-visible { box-shadow: 0 0 0 3px var(--ck-focus); }
.ht-lane.is-stepping .ht-plate { color: var(--ck-text); box-shadow: inset 0 0 0 3px var(--ht-honey); animation: ht-wait .9s ease-in-out infinite; }
.ht-lane.is-passed .ht-plate, .ht-lane.is-current .ht-plate { background-color: #c98419; color: #3a2200; box-shadow: inset 0 0 0 3px #ffd27a, 0 2px 0 rgba(0, 0, 0, .3); }
.ht-lane.is-trap .ht-plate, .ht-lane.is-trap-hit .ht-plate { background-color: transparent; box-shadow: none; width: min(96%, 150px); aspect-ratio: 360 / 265; color: #ffd27a; justify-content: flex-end; }
.ht-lane.is-trap .ht-plate:not(.has-pit), .ht-lane.is-trap-hit .ht-plate:not(.has-pit) { background: radial-gradient(circle, #f6a623 0 45%, #3a2a1a 46% 60%, transparent 61%); }
.ht-lane.is-trap .ht-plate__mult, .ht-lane.is-trap-hit .ht-plate__mult { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; transform: translateY(130%); text-shadow: 0 1px 2px #000; }
.ht-lane.is-trap .ht-plate__step, .ht-lane.is-trap-hit .ht-plate__step { display: none; }
.ht-lane.is-trap-hit .ht-plate { animation: ht-shake 420ms ease-in-out 1; }
@keyframes ht-plate-breathe { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.05); } }
@keyframes ht-wait { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
@keyframes ht-shake { 0%, 100% { transform: translate(-50%, -50%); } 25% { transform: translate(-54%, -50%); } 75% { transform: translate(-46%, -50%); } }

/* Candy: feet on the plate centre (66 % from the top) */
.ht-candy {
  position: absolute; bottom: 33%; height: 38%; aspect-ratio: 411 / 640; z-index: 3;
  transform: translateX(-50%); pointer-events: none;
  transition: left 520ms cubic-bezier(.3, .7, .3, 1);
}
.ht-candy__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom center; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .4)); }
.ht-candy:not(.has-art) .ht-candy__img { display: none; }
.ht-candy__shadow { position: absolute; left: 18%; right: 18%; bottom: -3%; height: 7%; border-radius: 50%; background: rgba(0, 0, 0, .35); }
.ht-candy__token { display: none; }
.ht-candy:not(.has-art) { height: auto; aspect-ratio: auto; width: calc(var(--ht-lane-w) * .4); }
.ht-candy:not(.has-art) .ht-candy__token {
  display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; border: 2px solid #fff;
  background: repeating-conic-gradient(from 20deg, var(--ht-candy) 0 30deg, #fff 30deg 45deg);
}
.ht-candy.is-walking .ht-candy__img, .ht-candy.is-walking .ht-candy__token { animation: ht-strut 520ms ease-in-out; }
.ht-candy.is-candy-win { height: 40%; }
.ht-candy.is-candy-fall .ht-candy__img { animation: ht-slip 700ms ease-out both; }
.ht-candy.is-candy-fall.has-fall .ht-candy__img { animation: none; }
@keyframes ht-strut { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-5%) rotate(2deg); } 65% { transform: translateY(-2%) rotate(-2deg); } }
@keyframes ht-slip { 0% { transform: none; } 40% { transform: translateY(-6%) rotate(-10deg); } 100% { transform: translateY(18%) rotate(8deg); clip-path: inset(0 0 22% 0); } }

/* result card over the board after a round */
.ht-result {
  position: absolute; right: clamp(10px, 2cqi, 18px); bottom: clamp(10px, 2cqi, 18px); z-index: 5;
  display: grid; justify-items: center; gap: 2px; padding: 12px 18px; min-width: 150px;
  border-radius: 14px; background: rgba(22, 16, 19, .92); border: 1px solid var(--ck-line-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4); text-align: center; pointer-events: none;
  animation: ht-pop 260ms ease-out both;
}
.ht-result[hidden] { display: none; }
.ht-result__title { font-size: var(--ck-fs-xs, 12px); font-weight: 700; text-transform: uppercase; letter-spacing: var(--ck-tracking-caps, .06em); color: var(--ck-text-muted); }
.ht-result__amount { font-size: clamp(22px, 4cqi, 32px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ht-result.is-won .ht-result__amount { color: var(--ck-win); }
.ht-result.is-lost .ht-result__amount { color: var(--ck-text); }
.ht-result.is-lost .ht-result__title { color: #ff9db8; }
.ht-result__sub { font-size: var(--ck-fs-sm, 13px); color: var(--ck-text-muted); }
@keyframes ht-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---- bet panel additions: difficulty + STEP ---- */
.ht-shell .ck-betpanel__top:empty { display: none; }
.ht-shell .ck-betpanel__top:has(.ht-risk) { display: block; padding: 0; }
.ht-risk { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: var(--ck-surface-3); width: 100%; }
.ht-risk__btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; min-height: 40px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ck-text-muted); font: inherit; cursor: pointer;
}
.ht-risk__label { font-size: var(--ck-fs-sm, 13px); font-weight: 700; }
.ht-risk__traps { font-size: 11px; opacity: .8; }
.ht-risk__btn:hover:not(:disabled) { background: var(--ck-surface-hover); color: var(--ck-text); }
.ht-risk__btn.is-active { background: var(--ck-surface-active); color: var(--ck-text); box-shadow: inset 0 0 0 1px rgba(246, 166, 35, .55); }
.ht-risk__btn.is-active .ht-risk__traps { color: var(--ht-honey-light); opacity: 1; }
.ht-risk__btn:disabled { cursor: not-allowed; opacity: .4; }
.ht-risk.is-locked .ht-risk__btn.is-active { opacity: 1; }
.ht-risk__btn:focus-visible { outline: 2px solid var(--ck-focus); outline-offset: 1px; }

.ht-ctas { display: grid !important; grid-template-columns: 1fr; gap: 8px; }
.ht-ctas:has(.ht-step:not([hidden])) { grid-template-columns: 1fr 1fr; }
.ht-ctas .ck-cta__progress { grid-column: 1 / -1; }
.ht-step { background: var(--ck-cta-gradient); color: var(--ck-cta-text); }
.ht-step[hidden] { display: none; }
.ht-step.is-busy { filter: saturate(.7); }

/* ---- wordmark ---- */
.ht-wordmark {
  display: inline-flex; align-items: center; gap: .3em; font-family: var(--ck-font);
  font-weight: 800; line-height: 1; letter-spacing: -.03em; text-transform: uppercase; white-space: nowrap; user-select: none;
}
.ht-wordmark__mark { width: 1em; height: 1.05em; flex: none; background: url("../../assets/honey-mark.svg") center / contain no-repeat; }
.ht-wordmark__a { color: var(--ck-text); }
.ht-wordmark__b { color: var(--ht-honey); margin-left: -.1em; }
.ht-logo--side { font-size: 22px; }
.ht-logo--phone { font-size: 12px; }
.ht-logo--phone .ht-wordmark__mark { display: none; }

/* ---- phone ---- */
@container ck-shell (max-width: 767.98px) {
  .ht-shell .ck-slot--stage { flex: 1 1 auto; aspect-ratio: auto; min-height: max(300px, 74vw); }
  .ht-shell .ck-stepper__cur { display: none; }
  .ht-risk__traps { display: none; }
  .ht-risk__btn { min-height: 34px; }
  /* during a round the amount is locked: give STEP and CASH OUT the full width */
  .ht-shell .ck-betpanel__main:has(.ht-step:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .ht-shell .ck-betpanel__main:has(.ht-step:not([hidden])) .ck-betpanel__amount { display: none; }
}

/* ---- modals ---- */
.ht-list { margin: 0 0 12px; padding-left: 20px; line-height: 1.55; }
.ht-list li + li { margin-top: 4px; }
.ht-h3 { margin: 16px 0 8px; font-size: var(--ck-fs-xs, 12px); font-weight: 600; text-transform: uppercase; letter-spacing: var(--ck-tracking-caps, .06em); color: var(--ck-text-muted); }
.ht-muted { color: var(--ck-text-muted); font-size: var(--ck-fs-sm, 13px); line-height: 1.5; }
.ht-menu { display: grid; gap: 8px; margin-bottom: 12px; }
.ht-menu-btn { justify-content: flex-start; width: 100%; }
.ht-fair .ck-select { appearance: auto; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 6px; background: var(--ck-surface-3); border: 1px solid var(--ck-line-strong); font: 500 12px var(--ck-font-mono); text-align: center; }

/* ---- preloader (index.html #ht-preloader, driven by src/ui/preloader.js) ---- */
.ht-pre {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: end center;
  background: radial-gradient(circle at 60% 30%, #3a2416 0%, #1a1013 60%, #0e0a0c 100%); color: var(--ck-text); overflow: hidden;
  padding: 24px 16px max(28px, env(safe-area-inset-bottom));
  transition: opacity 400ms ease, visibility 0s linear 400ms;
}
.ht-pre.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.ht-pre__art, .ht-pre__art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ht-pre__art img { object-fit: cover; object-position: 58% 32%; animation: ht-pre-drift 14s ease-in-out infinite alternate; }
.ht-pre__veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14, 10, 12, 0) 38%, rgba(14, 10, 12, .55) 62%, rgba(14, 10, 12, .94) 100%);
}
.ht-pre__panel { position: relative; width: min(460px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.ht-pre__title { margin: 0; font-size: clamp(34px, 6vw, 58px); line-height: 1; text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.ht-pre__tagline { margin: 0 0 6px; font-size: var(--ck-fs-md, 15px); color: rgba(251, 243, 234, .86); text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.ht-pre__bar { width: min(320px, 80%); height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .16); }
.ht-pre__fill { display: block; height: 100%; background: var(--ht-honey); border-radius: inherit; transform: scaleX(0); transform-origin: left center; transition: transform 240ms ease-out; }
.ht-pre__status { margin: 0; min-height: 1.4em; font-size: var(--ck-fs-sm, 13px); color: rgba(251, 243, 234, .75); }
.ht-pre__choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 4px; }
.ht-pre__choices[hidden] { display: none; }
.ht-pre__btn { min-height: 52px; gap: 8px; font-size: var(--ck-fs-md, 15px); text-transform: uppercase; letter-spacing: var(--ck-tracking-caps, .06em); font-weight: 700; }
.ht-pre__choices .ck-btn--ghost { background: rgba(22, 16, 19, .72); backdrop-filter: blur(4px); }
.ht-pre__hint { margin: 0; font-size: var(--ck-fs-xs, 12px); color: rgba(251, 243, 234, .6); }
.ht-pre:not(.is-ready) .ht-pre__hint { visibility: hidden; }
.ht-pre.is-ready .ht-pre__bar { opacity: 0; height: 0; margin: -6px 0 0; transition: opacity 200ms, height 200ms, margin 200ms; }
.ht-pre.is-ready .ht-pre__choices { animation: ht-pre-up 260ms ease-out both; }
@keyframes ht-pre-drift { from { transform: scale(1.01); } to { transform: scale(1.045) translateY(-.6%); } }
@keyframes ht-pre-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* wide screens: Candy owns the centre of the art, the panel sits on the left over a soft dark fade */
@media (min-aspect-ratio: 9/10) {
  .ht-pre { place-items: center start; padding-left: clamp(24px, 6vw, 110px); }
  .ht-pre__art img { object-position: 50% 30%; }
  .ht-pre__veil { background:
    linear-gradient(90deg, rgba(14, 10, 12, .92) 0%, rgba(14, 10, 12, .7) 24%, rgba(14, 10, 12, 0) 44%),
    linear-gradient(180deg, rgba(14, 10, 12, 0) 70%, rgba(14, 10, 12, .5) 100%); }
  .ht-pre__panel {
    width: min(420px, 34vw); padding: 26px 24px 20px; border-radius: 18px;
    background: rgba(18, 12, 15, .58); border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .ht-pre__title { font-size: clamp(30px, 4vw, 54px); }
}
@media (prefers-reduced-motion: reduce) { .ht-pre__art img { animation: none; } }

@media (prefers-reduced-motion: reduce) {
  .ht-shell *, .ck-overlay *, .ht-pre * { transition-duration: 0ms !important; animation-duration: 0ms !important; animation-iteration-count: 1 !important; }
}

/* Candy poses with their own proportions (art sizes: walk 411×640, win 386×640, fall 640×494) */
.ht-candy.is-candy-win.has-pose { aspect-ratio: 386 / 640; }
.ht-candy.is-candy-fall.has-fall { aspect-ratio: 640 / 494; height: 30%; bottom: 27%; animation: ht-plop 420ms cubic-bezier(.3, 1.5, .5, 1) both; }
.ht-candy.is-candy-fall.has-fall .ht-candy__shadow { display: none; }
@keyframes ht-plop { from { transform: translate(-50%, -18%) scale(.85); opacity: .4; } to { transform: translateX(-50%); opacity: 1; } }

/* ---- the car-crash loss (road.js crashInto): a car comes down the trap lane and bumps Candy ---- */
.ht-car--hit { z-index: 4; animation: ht-hit 420ms cubic-bezier(.5, 0, .9, .5) forwards; }
@keyframes ht-hit { from { top: calc(-1 * var(--ht-car-h)); } to { top: calc(44% - var(--ht-car-h)); } }
/* the wreck sprite is wider (steam): widen the box so the car keeps its size */
.ht-car--hit.is-wrecked { animation: ht-wreck 360ms ease-out forwards; width: calc(var(--ht-car-w) * 1.57); }
@keyframes ht-wreck {
  0% { top: calc(44% - var(--ht-car-h)); transform: translateX(-50%) rotate(0); }
  40% { top: calc(40% - var(--ht-car-h)); transform: translateX(-50%) rotate(-6deg); }
  100% { top: calc(41% - var(--ht-car-h)); transform: translateX(-50%) rotate(-4deg); }
}
.ht-road.is-crash .ht-lane.is-trap-hit .ht-plate {
  background-color: #3a3135; background-image: none !important; width: min(78%, 120px); aspect-ratio: 1;
  box-shadow: inset 0 0 0 3px var(--ck-danger), inset 0 0 0 7px #332a2e, 0 2px 0 rgba(0, 0, 0, .3); color: #ffb3c4;
}
.ht-road.is-crash .ht-lane.is-trap-hit .ht-plate__mult { transform: none; font-size: 13px; }
.ht-road::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 6; }
.ht-road.is-impact::after { animation: ht-flash 380ms ease-out; }
@keyframes ht-flash { 0% { opacity: .55; } 100% { opacity: 0; } }
.ht-road.is-impact .ht-road__track { animation: ht-jolt 380ms ease-out; }
@keyframes ht-jolt { 0%, 100% { translate: 0 0; } 20% { translate: -6px 3px; } 45% { translate: 5px -2px; } 70% { translate: -3px 1px; } }
.ht-candy.is-candy-hurt { animation: ht-knock 420ms cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes ht-knock { from { transform: translate(-50%, -14%) rotate(-12deg); } to { transform: translateX(-35%); } }
.ht-candy.is-candy-hurt .ht-candy__shadow { display: none; }
@media (prefers-reduced-motion: reduce) { .ht-road.is-impact::after, .ht-road.is-impact .ht-road__track { animation: none; } }
.ht-candy.is-candy-hurt.has-pose { aspect-ratio: 577 / 640; height: 34%; bottom: 29%; }
.ht-road.is-crash .ht-lane.is-trap-hit { overflow: visible; z-index: 2; }

/* hearts when Candy blows a kiss (cash-out / trail complete) */
.ht-heart {
  position: absolute; left: 58%; top: 22%; width: 18px; height: 18px; pointer-events: none; z-index: 4;
  background: var(--ht-candy); transform: rotate(45deg) scale(var(--ht-hs, 1)); opacity: 0;
  animation: ht-heart 1.8s ease-out var(--ht-hd, 0s) forwards;
}
.ht-heart::before, .ht-heart::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: inherit; }
.ht-heart::before { left: -9px; } .ht-heart::after { top: -9px; }
@keyframes ht-heart {
  0% { opacity: 0; translate: 0 0; }
  15% { opacity: 1; }
  100% { opacity: 0; translate: var(--ht-hx, 0) -160%; }
}
