/* Hi-Lo: a felt-red table with one big playing card, a fan of the previous cards and two tall guess buttons. */
.play-hilo::before { background: linear-gradient(135deg, rgba(255, 107, 80, 0.7), rgba(255, 107, 80, 0) 35%, rgba(139, 92, 255, 0) 65%, rgba(139, 92, 255, 0.55)); }
.hilo-screen { align-content: start; gap: 12px; background: radial-gradient(120% 90% at 50% 0%, rgba(255, 107, 80, 0.16), transparent 60%), linear-gradient(180deg, #170d1f, #0a0819); }
.hilo-table { position: relative; display: grid; justify-items: center; align-content: end; gap: 10px; width: 100%; min-height: 220px; padding: 10px 0 0; }
.hilo-history { display: flex; justify-content: center; gap: 6px; min-height: 48px; max-width: 100%; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.hcard {
  position: relative; display: grid; grid-template-rows: 1fr auto 1fr; align-items: center; justify-items: center; width: 34px; height: 46px; border-radius: 6px;
  background: linear-gradient(160deg, #fff, #e9e6ff); color: #1d1540; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.3) inset;
  font: 800 0.9rem/1 var(--display); font-variant-numeric: tabular-nums; flex: none;
}
.hcard.is-red { color: #d6264f; }
.hcard .hcard-rank { grid-row: 2; }
.hcard .hcard-suit { display: none; }
.hcard.is-lost { filter: saturate(0.4) brightness(0.6); }
.hcard-main {
  width: clamp(120px, 15vw, 160px); height: clamp(168px, 21vw, 224px); border-radius: 14px; grid-template-rows: auto 1fr auto; align-items: start; justify-items: start; padding: 10px 12px;
  font-size: clamp(34px, 4vw, 48px); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 0 40px -10px rgba(255, 107, 80, 0.5);
  transform-style: preserve-3d; transition: transform 160ms var(--ease);
}
.hcard-main .hcard-rank { grid-row: 1; }
.hcard-main .hcard-suit { grid-row: 2; display: grid; place-self: center; font-size: clamp(56px, 7vw, 84px); line-height: 1; }
.hcard-main::after { content: attr(data-corner); grid-row: 3; justify-self: end; transform: rotate(180deg); font-size: 0.55em; opacity: 0.7; }
.hcard-main.is-back { background: repeating-linear-gradient(45deg, #3a2a6e 0 6px, #2a1f55 6px 12px), #2a1f55; color: transparent; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8), 0 0 0 4px #e9e6ff inset, 0 0 0 5px rgba(0, 0, 0, 0.3) inset; }
.hcard-main.is-back::after { content: ""; }
.hcard-main.is-deal { animation: card-deal 420ms var(--ease); }
@keyframes card-deal { 0% { transform: translateY(-30px) rotateY(90deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.hcard-main.is-lose { box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8), 0 0 0 3px var(--lose) inset, 0 0 30px -4px rgba(255, 61, 110, 0.9); animation: tile-shake 420ms var(--ease); }
.hcard-main.is-win { box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8), 0 0 0 3px var(--win) inset, 0 0 30px -4px rgba(31, 224, 138, 0.9); }
@keyframes tile-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-5px) rotate(-3deg); } 40% { transform: translateX(5px) rotate(3deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.hilo-guess { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 420px); }
.guess-btn {
  display: grid; justify-items: center; gap: 2px; min-height: 76px; padding: 10px; border: 0; border-radius: 14px; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #3a3370, #2a2457); box-shadow: 0 5px 0 #1a1640, 0 0 0 1px rgba(190, 180, 255, 0.16) inset;
  transition: transform 90ms ease, filter var(--fast), box-shadow var(--fast);
}
.guess-btn .gb-arrow { font-size: 1.1rem; line-height: 1; }
.guess-btn .gb-label { font: 800 1rem/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.guess-btn .gb-sub { font-size: 0.8rem; font-weight: 800; opacity: 0.85; min-height: 1.1em; }
.guess-hi:not([aria-disabled="true"]) { background: linear-gradient(180deg, #4cfbae, #12c477); color: #032514; box-shadow: 0 5px 0 #087a49, 0 12px 26px -8px rgba(31, 224, 138, 0.7); }
.guess-lo:not([aria-disabled="true"]) { background: linear-gradient(180deg, #ff8a6b, #e04a2d); color: #fff; box-shadow: 0 5px 0 #8f2410, 0 12px 26px -8px rgba(255, 107, 80, 0.7); }
.guess-btn:hover:not([aria-disabled="true"]) { filter: brightness(1.08); }
.guess-btn:active:not([aria-disabled="true"]) { transform: translateY(3px); box-shadow: 0 2px 0 #1a1640; }
.guess-btn[aria-disabled="true"] { cursor: not-allowed; filter: saturate(0.4) brightness(0.7); }
.guess-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.play-hilo .hud-item strong#h-payout { color: var(--gold); }
@media (max-width: 560px) {
  .hilo-table { min-height: 190px; }
  .guess-btn { min-height: 66px; }
}
/* turbo: the card flips instantly (the flash and the sound still play) */
:root.is-turbo .hcard-main, :root.is-turbo .hcard-main.is-deal, :root.is-turbo .hcard-main.is-lose { animation: none; transition: none; }
