/* Hold & Spin engine (res/games/hold.js). Every class starts with bq-hs-.
   Motion: transform and opacity only (filter for glows); reels and respins
   are cut to near-instant under prefers-reduced-motion by brook.css. */

.bq-hs {
  --bq-hs-gap: clamp(3px, 0.7vw, 7px);
  position: relative;
  display: grid;
  gap: var(--bq-s3);
  width: min(100%, 760px, max(320px, (100dvh - 330px) * 1.55));
  margin-inline: auto;
}

/* ------------------------------------------------------------------ HUD */
.bq-hs-hud {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--bq-s3);
  min-height: 48px;
  padding: 6px 6px 6px 8px;
  border-radius: var(--bq-r-pill);
  background: linear-gradient(180deg, rgba(10, 33, 36, 0.88), rgba(6, 23, 25, 0.92));
  border: 1px solid var(--bq-line-2);
  box-shadow: var(--bq-shadow-1);
}

.bq-hs-chip {
  padding: 6px 12px;
  border-radius: var(--bq-r-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bq-line);
  color: var(--bq-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bq-hs-centre {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.bq-hs-hint {
  overflow: hidden;
  color: var(--bq-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bq-hs-pips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bq-hs-pips__cap,
.bq-hs-meter__cap {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bq-faint);
}

.bq-hs-pip {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bq-line-2);
  transition: transform var(--bq-med) var(--bq-ease-out), background-color var(--bq-med) var(--bq-ease-out),
    box-shadow var(--bq-med) var(--bq-ease-out);
}

.bq-hs-pip.is-on {
  background: radial-gradient(circle at 35% 30%, #fff6d6, var(--bq-gold) 45%, #f0a020);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(255, 207, 90, 0.6);
}

.bq-hs-pip.is-refill { animation: bq-hs-pip 420ms var(--bq-ease-out); }
.bq-hs-pip.is-refill:nth-child(3) { animation-delay: 60ms; }
.bq-hs-pip.is-refill:nth-child(4) { animation-delay: 120ms; }

@keyframes bq-hs-pip {
  0% { transform: scale(0.6); }
  55% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.bq-hs-meter {
  display: grid;
  justify-items: end;
  padding: 2px var(--bq-s4) 2px var(--bq-s3);
  border-radius: var(--bq-r-pill);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 207, 90, 0.18);
  min-width: 110px;
}

.bq-hs-meter__cap { font-size: 10px; line-height: 1.3; }

.bq-hs-meter__value {
  font-family: var(--bq-font-display);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.15;
  color: var(--bq-gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255, 207, 90, 0.35);
}

.bq-hs-meter.is-bump .bq-hs-meter__value { animation: bq-hs-bump 300ms var(--bq-ease-out); }

@keyframes bq-hs-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* ------------------------------------------------------------------ board */
.bq-hs-frame {
  position: relative;
  padding: clamp(6px, 1.4vw, 12px);
  border-radius: calc(var(--bq-r-l) + 4px);
  background:
    linear-gradient(160deg, rgba(20, 52, 57, 0.92), rgba(6, 23, 25, 0.96)) padding-box,
    linear-gradient(140deg, rgba(255, 207, 90, 0.8), rgba(255, 123, 92, 0.55) 40%, rgba(95, 227, 181, 0.35) 75%, rgba(255, 207, 90, 0.65)) border-box;
  border: 2px solid transparent;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: box-shadow 400ms var(--bq-ease-out);
}

.bq-hs.is-feature .bq-hs-frame {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 207, 90, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.bq-hs-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--bq-hs-gap);
  aspect-ratio: 5 / 3;
  padding: var(--bq-hs-gap);
  border-radius: var(--bq-r);
  background: radial-gradient(120% 80% at 50% 0%, rgba(95, 227, 181, 0.1), transparent 60%), rgba(3, 14, 16, 0.6);
  box-shadow: inset 0 2px 18px rgba(0, 0, 0, 0.55);
  user-select: none;
  -webkit-user-select: none;
}

.bq-hs-reel {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--bq-r) - 4px);
  background: linear-gradient(180deg, rgba(173, 232, 220, 0.06), rgba(173, 232, 220, 0.02) 50%, rgba(173, 232, 220, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(173, 232, 220, 0.05);
  transition: box-shadow 260ms var(--bq-ease-out);
}

/* Soft shade at the top and bottom of each reel. */
.bq-hs-reel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 14, 16, 0.45), transparent 16%, transparent 84%, rgba(3, 14, 16, 0.45));
  pointer-events: none;
  z-index: 2;
}

.bq-hs-reel.is-tease {
  box-shadow: inset 0 0 0 2px rgba(255, 207, 90, 0.7), 0 0 26px rgba(255, 207, 90, 0.45);
}

.bq-hs-strip {
  display: flex;
  flex-direction: column;
  height: 100%;
  will-change: transform;
}

.bq-hs-strip > .bq-hs-cell { flex: 0 0 calc(100% / 3); }

.bq-hs-strip.is-landed { animation: bq-hs-land 240ms var(--bq-ease-out); }

@keyframes bq-hs-land {
  0% { transform: translateY(-3%); }
  60% { transform: translateY(1.2%); }
  100% { transform: translateY(0); }
}

.bq-hs-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 6%;
  transition: opacity 200ms ease-out;
}

.bq-hs-sym {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.bq-hs-sym img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.bq-hs-cell.is-blur .bq-hs-sym img { filter: blur(1.5px) brightness(0.92); opacity: 0.85; }

/* Stand-in tile while a symbol image is missing. */
.bq-hs-sym--plain {
  width: 82%;
  height: 82%;
  border-radius: 22%;
  background: radial-gradient(80% 70% at 35% 25%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(160deg, var(--tint), color-mix(in srgb, var(--tint) 55%, #06171a));
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.35);
  color: rgba(6, 23, 25, 0.82);
  font-family: var(--bq-font-display);
  font-size: clamp(16px, 4vw, 32px);
  font-weight: 900;
}

.bq-hs-sym--plain.is-round { border-radius: 50%; }

.bq-hs-cell.is-wild .bq-hs-sym img {
  filter: drop-shadow(0 0 7px rgba(255, 207, 90, 0.6)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
}

/* Coins and their value tags. */
.bq-hs-cell.is-coin .bq-hs-sym { transform: scale(0.92) translateY(-6%); }

.bq-hs-cell.is-coin:not(.is-blur) .bq-hs-sym img {
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--bq-sky) 70%, transparent)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
}

.bq-hs-val {
  position: absolute;
  left: 50%;
  bottom: 6%;
  display: grid;
  justify-items: center;
  min-width: 52%;
  padding: 2px 8px;
  border-radius: var(--bq-r-pill);
  background: linear-gradient(180deg, rgba(6, 23, 25, 0.92), rgba(15, 43, 47, 0.92));
  border: 1px solid rgba(255, 207, 90, 0.6);
  color: var(--bq-gold);
  font-family: var(--bq-font-display);
  font-size: clamp(11px, 2vw, 16px);
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.bq-hs-val.is-tier {
  background: linear-gradient(180deg, var(--bq-coral-2), var(--bq-coral) 55%, #e65a3c);
  border-color: rgba(255, 235, 200, 0.85);
  color: var(--bq-on-coral);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), 0 0 16px rgba(255, 123, 92, 0.55);
}

.bq-hs-val__name {
  font-size: 0.72em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bq-hs-cell.is-tiercoin:not(.is-blur) .bq-hs-sym img {
  filter: drop-shadow(0 0 10px rgba(255, 123, 92, 0.8)) drop-shadow(0 0 3px #fff);
}

/* Line pays. */
.bq-hs-cell.is-dim { opacity: 0.42; }

.bq-hs-cell.is-win .bq-hs-sym { animation: bq-hs-win 700ms var(--bq-ease-out); }
.bq-hs-cell.is-win .bq-hs-sym img { filter: drop-shadow(0 0 10px rgba(255, 207, 90, 0.85)) brightness(1.1); }

@keyframes bq-hs-win {
  0% { transform: scale(1); }
  35% { transform: scale(1.14); }
  70% { transform: scale(0.98); }
  100% { transform: scale(1.04); }
}

.bq-hs-lines {
  position: absolute;
  inset: var(--bq-hs-gap);
  width: calc(100% - var(--bq-hs-gap) * 2);
  height: calc(100% - var(--bq-hs-gap) * 2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease-out;
  z-index: 3;
}

.bq-hs-lines.is-on { opacity: 1; }

.bq-hs-line {
  fill: none;
  stroke: #fff2c2;
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.bq-hs-line--glow {
  stroke: var(--bq-gold);
  stroke-width: 9px;
  opacity: 0.45;
  filter: blur(3px);
}

.bq-hs-fx { position: absolute; inset: 0; pointer-events: none; z-index: 4; }

/* ------------------------------------------------------------------ feature */
.bq-hs.is-feature .bq-hs-reel::after { opacity: 0.4; }

.bq-hs-slot {
  width: 64%;
  height: 64%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(173, 232, 220, 0.08), rgba(0, 0, 0, 0.25) 70%);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(173, 232, 220, 0.08);
}

.bq-hs-cell.is-locked::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 18%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bq-gold) 30%, transparent), transparent);
  box-shadow: inset 0 0 0 2px rgba(255, 207, 90, 0.55);
  animation: bq-hs-glow 1800ms ease-in-out infinite alternate;
}

@keyframes bq-hs-glow {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.bq-hs-cell.is-new .bq-hs-sym { animation: bq-hs-new 460ms var(--bq-ease-out); }
.bq-hs-cell.is-new .bq-hs-val { animation: bq-hs-tag 460ms var(--bq-ease-out); }

@keyframes bq-hs-new {
  0% { transform: scale(0.5); opacity: 0.3; }
  60% { transform: scale(1.12) translateY(-6%); opacity: 1; }
  100% { transform: scale(0.92) translateY(-6%); }
}

@keyframes bq-hs-tag {
  0% { transform: translateX(-50%) scale(0.4); opacity: 0; }
  70% { transform: translateX(-50%) scale(1.12); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); }
}

.bq-hs-cell.is-count .bq-hs-val { animation: bq-hs-count 320ms var(--bq-ease-out); }

@keyframes bq-hs-count {
  0% { transform: translateX(-50%) scale(1); }
  45% { transform: translateX(-50%) scale(1.3); box-shadow: 0 0 22px rgba(255, 207, 90, 0.9); }
  100% { transform: translateX(-50%) scale(1); }
}

.bq-hs-cell.is-spinner { padding: 0; }

.bq-hs-mini {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.bq-hs-mini__strip {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bq-hs-mini__strip > .bq-hs-cell { flex: 0 0 100%; }

/* ------------------------------------------------------------------ overlays */
.bq-hs-over {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  padding: var(--bq-s4);
  background: radial-gradient(60% 60% at 50% 48%, rgba(10, 33, 36, 0.7), rgba(3, 12, 13, 0.88));
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease-out;
  overflow: hidden;
}

.bq-hs-over.is-in { opacity: 1; transition-duration: 260ms; }
.bq-hs-over.is-panel { cursor: default; }

.bq-hs-over > p { position: relative; margin: 0; }

.bq-hs-over__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150%;
  aspect-ratio: 1;
  background: conic-gradient(from 0deg, rgba(255, 207, 90, 0.16), transparent 12%, rgba(255, 123, 92, 0.14) 25%, transparent 37%,
    rgba(255, 207, 90, 0.16) 50%, transparent 62%, rgba(255, 123, 92, 0.14) 75%, transparent 87%, rgba(255, 207, 90, 0.16));
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: bq-hs-turn 14s linear infinite;
  pointer-events: none;
}

@keyframes bq-hs-turn {
  to { transform: translate(-50%, -50%) rotate(1turn); }
}

.bq-hs-over__kicker {
  color: var(--bq-mint);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bq-hs-over__word {
  font-family: var(--bq-font-display);
  font-size: clamp(32px, 7.5vw, 62px);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff3c4 10%, var(--bq-gold) 45%, #ff9f43 75%, var(--bq-coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 rgba(90, 30, 10, 0.55)) drop-shadow(0 0 22px rgba(255, 180, 60, 0.45));
}

.bq-hs-over.is-in .bq-hs-over__word { animation: bq-hs-word 520ms var(--bq-ease-out); }

@keyframes bq-hs-word {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.bq-hs-over[data-tier="sensational"] .bq-hs-over__word,
.bq-hs-over.is-crown .bq-hs-over__word {
  background-image: linear-gradient(180deg, #ffffff 5%, #ffd0c2 30%, var(--bq-coral-2) 55%, #ff5a7a 90%);
}

.bq-hs-over__value {
  font-family: var(--bq-font-display);
  font-size: clamp(26px, 5.5vw, 44px);
  font-weight: 900;
  color: var(--bq-ink);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(95, 227, 181, 0.35);
}

.bq-hs-over__sub { color: var(--bq-mint); font-weight: 800; }

.bq-hs-over__hint {
  margin-top: var(--bq-s3) !important;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bq-faint);
}

.bq-hs-spark {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 25%, var(--tint) 45%, transparent 72%);
  box-shadow: 0 0 10px var(--tint);
  pointer-events: none;
}

.bq-hs-spark.is-star {
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: linear-gradient(135deg, #fff, var(--tint));
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  box-shadow: none;
}

/* Summary at the end of the feature. */
.bq-hs-panel {
  position: relative;
  display: grid;
  gap: var(--bq-s3);
  width: min(360px, 100%);
  padding: var(--bq-s5);
  border-radius: var(--bq-r-l);
  background: linear-gradient(180deg, rgba(26, 64, 70, 0.96), rgba(15, 43, 47, 0.97));
  border: 1px solid rgba(255, 207, 90, 0.45);
  box-shadow: var(--bq-shadow-2), 0 0 40px rgba(255, 207, 90, 0.2);
  text-align: left;
  animation: bq-hs-panel 380ms var(--bq-ease-out);
}

@keyframes bq-hs-panel {
  from { transform: translateY(10px) scale(0.95); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.bq-hs-panel__kicker {
  margin: 0;
  color: var(--bq-mint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bq-hs-panel__title {
  margin: 0;
  font-size: clamp(24px, 4vw, 30px);
  color: var(--bq-gold);
}

.bq-hs-panel__list { display: grid; gap: 6px; margin: 0; }

.bq-hs-panel__row {
  display: flex;
  justify-content: space-between;
  gap: var(--bq-s3);
  padding: 6px 0;
  border-bottom: 1px solid var(--bq-line);
}

.bq-hs-panel__row dt { color: var(--bq-muted); }
.bq-hs-panel__row dt,
.bq-hs-panel__row dd { white-space: nowrap; }
.bq-hs-panel__row dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.bq-hs-panel__row.is-crown dd { color: var(--bq-coral-2); }

.bq-hs-panel__row.is-total {
  border-bottom: 0;
  font-size: 18px;
}

.bq-hs-panel__row.is-total dd { color: var(--bq-gold); font-family: var(--bq-font-display); font-size: 21px; }

.bq-hs-panel__btn { width: 100%; }

/* ------------------------------------------------------------------ deck buttons */
.bq-hs-go { min-width: 170px; }

.bq-hs-quick[aria-pressed="true"] {
  background: rgba(255, 207, 90, 0.14);
  border-color: rgba(255, 207, 90, 0.55);
  color: var(--bq-gold);
}

/* ------------------------------------------------------------------ narrow screens */
@media (max-width: 560px) {
  .bq-hs { gap: var(--bq-s2); }
  .bq-hs-hud { grid-template-columns: 1fr auto; padding: 4px 4px 4px 10px; min-height: 44px; }
  .bq-hs-chip { display: none; }
  .bq-hs-centre { justify-content: flex-start; }
  .bq-hs-hint { font-size: 12px; text-align: left; }
  .bq-hs-meter { min-width: 0; padding: 2px 12px 2px 10px; }
  .bq-hs-meter__value { font-size: 17px; }
  .bq-hs-pip { width: 14px; height: 14px; }
  .bq-hs-cell { padding: 4%; }
  .bq-hs-val { padding: 1px 5px; bottom: 3%; font-size: 11px; }
  .bq-hs-frame { border-radius: var(--bq-r-l); }
  .bq-hs-panel { padding: var(--bq-s4); gap: var(--bq-s2); }
  .bq-hs-panel__row { padding: 3px 0; font-size: 14px; }
  .bq-hs-panel__row.is-total { font-size: 15px; }
  .bq-hs-panel__row.is-total dd { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .bq-hs-over__glow,
  .bq-hs-cell.is-locked::before { animation: none; }
}
