/* ============================================================
   STACKED POKER HANDS — prototype-specific styles
   (loaded after the Until It Breaks Minimal flat restyle)
   ============================================================ */

/* header brand fits the ai-bar */
#ai-bar .brand { font-size: 17px; }
#ai-bar .ai-identity { min-width: 300px; }

/* tighter 3-column body: precalc · center · loadout */
.game-body { grid-template-columns: 260px minmax(0, 1fr) 250px; }

#target-strip { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }

/* ================= Center layout — slots vertically centered ================= */
#center #board-panel {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
}
#center #board-panel .panel-title { flex: 0 0 auto; }

#center #play-area { min-height: 0; }
#center #hand-area { flex: 0 0 auto; min-height: auto; }
#left-rail { overflow-y: visible; }

/* ================= Hand slots (5 across) ================= */
.hand-slot {
  flex: 1; min-width: 0; height: 184px;
  border: 1px dashed rgba(255, 255, 255, 0.14); border-radius: 12px;
  position: relative; overflow: visible;
  background: var(--flat-1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 6px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.15s;
}
.hand-slot:hover { background: var(--flat-2); }
.hand-slot .slot-num { position: absolute; top: 5px; left: 8px; font-family: var(--mono); font-size: 9px; color: var(--ink-faint); }

.hand-slot.empty .slot-hint {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 4px;
  align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  color: var(--ink-faint); text-align: center; padding: 8px; pointer-events: none;
}
.hand-slot.empty.has-charge-cards .slot-hint { justify-content: flex-start; padding-top: 30px; color: var(--gold); }
.hand-slot.empty.has-charge-cards .slot-hint span:last-child { color: var(--ink-faint); }
.hand-slot.filled { border-style: solid; border-color: rgba(255, 215, 94, 0.25); background: var(--flat-2); }
.hand-slot.has-charge-cards { border-color: rgba(176,107,255,0.28); }
.hand-slot.special-slot { border-style: solid; }
.hand-slot.special-electric { border-color: rgba(255, 215, 94, 0.52); box-shadow: inset 0 0 22px rgba(255,215,94,0.08); }
/* RAINBOW: a thick animated rainbow STROKE only — the body stays flat/dark. */
.hand-slot.special-rainbow {
  border: 5px solid transparent;
  background:
    linear-gradient(var(--flat-1), var(--flat-1)) padding-box,
    linear-gradient(0deg,
      #ff3b7b 0%, #ff9f43 13%, #ffd75e 26%, #41f58f 39%,
      #2ee6a8 52%, #3fd9ff 65%, #b06bff 78%, #ff3b7b 100%) border-box;
  background-size: auto, 100% 320%;
  background-position: 0 0, 0 0;
  animation: rainbowSlotScroll 1.45s linear infinite;
}
.hand-slot.special-rainbow.filled {
  background:
    linear-gradient(var(--flat-2), var(--flat-2)) padding-box,
    linear-gradient(0deg,
      #ff3b7b 0%, #ff9f43 13%, #ffd75e 26%, #41f58f 39%,
      #2ee6a8 52%, #3fd9ff 65%, #b06bff 78%, #ff3b7b 100%) border-box;
  background-size: auto, 100% 320%;
  animation: rainbowSlotScroll 1.45s linear infinite;
}
.hand-slot.special-flipped { border-color: rgba(46,230,168,0.46); box-shadow: inset 0 0 22px rgba(46,230,168,0.08); }
.hand-slot.ai-blocked {
  border-color: rgba(255,77,94,0.56);
  background:
    repeating-linear-gradient(135deg, rgba(255,77,94,0.12) 0 8px, transparent 8px 16px),
    var(--flat-1);
  cursor: not-allowed;
}

/* legality glow while something is selected */
.hand-slot.can-place { border-color: var(--gold); border-style: dashed; box-shadow: 0 0 14px rgba(255,215,94,0.22); }
.hand-slot.can-place .slot-hint { color: var(--gold); }
.hand-slot.can-fuse { border-color: var(--crypto); border-style: solid; box-shadow: 0 0 16px var(--crypto-glow); }
.hand-slot.no-target { opacity: 0.5; }
.hand-slot.unit-selected { border-color: var(--gold); border-style: solid; box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(255,215,94,0.3); transform: translateY(-3px); }
.hand-slot.drop-hover { background: var(--flat-3); transform: translateY(-2px); }

/* fuse preview bubble over a can-fuse slot */
@keyframes rainbowSlotScroll {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 0, 0 -320%; }
}
@keyframes rainbowBadgeScroll {
  0% { background-position: 0 50%; }
  100% { background-position: 260% 50%; }
}

.fuse-bubble {
  position: absolute; left: 50%; top: -14px; transform: translateX(-50%);
  z-index: 24; white-space: nowrap; pointer-events: none;
  font-family: var(--mono); font-size: 9px; font-weight: 950; letter-spacing: 0.05em;
  color: #041016; background: var(--crypto);
  border-radius: 999px; padding: 3px 9px;
  box-shadow: 0 0 14px var(--crypto-glow), 0 3px 10px rgba(0,0,0,0.5);
  animation: typeFloatWiggle 1.2s ease-in-out infinite;
}
.hand-slot.can-place .fuse-bubble { color: #140b02; background: var(--gold); box-shadow: 0 0 14px rgba(255,215,94,0.5), 0 3px 10px rgba(0,0,0,0.5); }
.fuse-bubble.full { color: #fff; background: var(--red); box-shadow: 0 0 12px rgba(255,77,94,0.5), 0 3px 10px rgba(0,0,0,0.5); animation: none; }

.special-badge {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.08em;
  color: #071018;
  background: var(--gold);
  border-radius: 999px;
  padding: 3px 7px;
  box-shadow: 0 0 14px rgba(255,215,94,0.4), 0 2px 8px rgba(0,0,0,0.45);
  pointer-events: none;
}
.special-rainbow .special-badge {
  color: #fff;
  background: linear-gradient(90deg, var(--surge), var(--gold), var(--crypto), var(--luck), var(--surge));
  background-size: 260% 100%;
  animation: rainbowBadgeScroll 1.4s linear infinite;
  box-shadow: 0 0 18px rgba(176,107,255,0.58), 0 0 16px rgba(46,230,168,0.34), 0 2px 8px rgba(0,0,0,0.45);
}
.special-flipped .special-badge { color: #031018; background: var(--crypto); }
.hand-slot.empty .slot-hint.special-waiting { padding-top: 46px; justify-content: flex-start; }
.blocker-badge {
  position: absolute;
  inset: 44px 10px auto;
  z-index: 8;
  display: grid;
  place-items: center;
  min-height: 24px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(255,77,94,0.86);
  border: 1px solid rgba(255,255,255,0.26);
  border-radius: 8px;
  box-shadow: 0 0 18px rgba(255,77,94,0.5);
  pointer-events: none;
}

/* mini cards inside a unit — larger, fanned corner-index style */
.unit-cards { display: flex; justify-content: center; margin-bottom: 8px; padding-top: 4px; }
.mcard {
  width: 46px; height: 64px; margin: 0 -14px;
  border-radius: 7px; border: 1px solid var(--line-bright);
  background: linear-gradient(165deg, #182238, #0c1220);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  padding: 5px 6px;
  font-family: var(--mono); font-size: 17px; font-weight: 800; line-height: 1;
  flex-shrink: 0; position: relative;
  box-shadow: -3px 0 8px rgba(0,0,0,0.45);
}
.mcard:first-child { margin-left: 0; }
.mcard > span:first-child { font-size: 17px; }
.mcard .m-suit { font-size: 14px; margin-top: 1px; }
.mcard.hearts { color: var(--hearts); }
.mcard.diamonds { color: var(--diamonds); }
.mcard.clubs { color: var(--clubs); }
.mcard.spades { color: var(--spades); }
/* NAPKIN junk card: crumpled-paper look + a clean icon (no overflowing label) */
.mcard.napkin, .hs-card.napkin {
  background: repeating-linear-gradient(135deg, #1c1a14, #1c1a14 5px, #171511 5px, #171511 10px);
  border-color: #4d4430; color: var(--orange);
  align-items: center; justify-content: center; padding: 0;
}
.mcard.napkin .m-napkin, .hs-card.napkin .m-napkin {
  font-size: 20px; line-height: 1;
}
.hs-card.napkin .m-napkin { font-size: 26px; }

/* loose card: part of the stack but outside the best hand — heat liability */
.mcard.leftover {
  border-style: dashed;
  border-color: rgba(255, 77, 94, 0.6);
  filter: saturate(0.5) brightness(0.72);
  opacity: 0.85;
}
.mcard.leftover::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 7px;
  background: repeating-linear-gradient(45deg, rgba(255,77,94,0.16) 0 4px, transparent 4px 8px);
  pointer-events: none;
}

.unit-name {
  font-family: var(--mono); font-size: 10px; font-weight: 950; letter-spacing: 0.06em;
  color: var(--gold); text-align: center; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%;
}
.unit-score { font-family: var(--mono); font-size: 12px; font-weight: 800; color: var(--ink); }
.unit-score b { color: var(--orange); }
.unit-heat { font-family: var(--mono); font-size: 8px; color: var(--ink-faint); }
.unit-leftover { font-family: var(--mono); font-size: 8px; font-weight: 800; color: var(--red); letter-spacing: 0.02em; text-align: center; }
.hand-slot.incomplete { border-color: rgba(255, 77, 94, 0.3); }

/* Charge Cards staged inside a card slot. They do not count toward the
   poker-card stack cap; the slot has a separate 5-card charge bay. */
.slot-charge-tray {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  min-height: 26px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  z-index: 5;
}
.slot-charge-empty {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 9px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  color: rgba(226,232,255,0.24);
  text-align: center;
  pointer-events: none;
}
.slot-charge-card {
  width: 24px;
  height: 30px;
  border: 1px solid var(--tc);
  border-radius: 6px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tc) 24%, transparent), transparent 62%),
    rgba(7,11,18,0.96);
  color: var(--tc);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 14px 12px;
  align-items: center;
  justify-items: center;
  padding: 2px;
  cursor: grab;
  box-shadow: 0 0 10px color-mix(in srgb, var(--tc) 22%, transparent), 0 2px 8px rgba(0,0,0,0.35);
}
.slot-charge-card:hover { transform: translateY(-4px); z-index: 8; }
.slot-charge-card span { font-size: 11px; line-height: 1; }
.slot-charge-card b {
  font-family: var(--mono);
  font-size: 8px;
  color: #071018;
  background: var(--tc);
  border-radius: 3px;
  padding: 0 2px;
}
.slot-charge-card em {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  color: #fff;
  text-shadow: 0 0 7px var(--tg);
}

/* unit discard ✕ */
.unit-x {
  position: absolute; top: 3px; right: 4px; z-index: 6;
  width: 18px; height: 18px; border-radius: 6px;
  border: none; background: transparent; color: var(--ink-faint);
  font-size: 11px; line-height: 1; padding: 0;
  opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.hand-slot:hover .unit-x { opacity: 1; }
.unit-x:hover { color: var(--red); background: rgba(255,77,94,0.12); }

/* resolve-time slot states */
.hand-slot.resolving-now { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange), 0 0 22px rgba(255,159,67,0.4); transform: translateY(-4px); }
.hand-slot.synergy-hit { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 28px rgba(255,215,94,0.55); transform: translateY(-4px); }
.hand-slot.resolved { opacity: 0.45; filter: saturate(0.4); }
.hand-slot.wiping { animation: flyDiscard 0.5s ease-in forwards; }
.mcard.score-tick { animation: scoreTick 0.34s cubic-bezier(0.22,1,0.36,1); z-index: 18; }
.hand-slot.fused-pop { animation: summonPop 0.4s cubic-bezier(0.22,1,0.36,1); }

/* ================= Hand cards ================= */
#hand-cards { display: flex; justify-content: center; padding: 18px 0 6px; max-width: 100%; flex-wrap: wrap; row-gap: 14px; }
.tcard.dealing { animation: dealIn 0.3s cubic-bezier(0.22,1,0.36,1) both; }
.tcard.discarding { animation: flyDiscard 0.45s ease-in forwards; pointer-events: none; }
.tcard[draggable="true"] { -webkit-user-drag: element; }
.tcard.drag-ghost { opacity: 0.35; }

/* ================= Preview panel ================= */
#preview-panel {
  min-height: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#left-rail #preview-panel {
  position: sticky;
  top: 0;
}
#left-rail #preview-main {
  width: 100%;
  display: block;
  justify-content: initial;
}
#left-rail .pv-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
#left-rail .pv-empty,
#left-rail .pv-hand,
#left-rail .pv-formula,
#left-rail .pv-final,
#left-rail .pv-sel-invalid,
#left-rail .pv-sel-valid {
  display: block;
  text-align: left;
  line-height: 1.35;
}
.pv-total {
  margin-left: auto;
  text-align: right;
  font-family: var(--mono);
}
#left-rail .pv-total {
  margin-left: 0;
  text-align: left;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.pv-total .pvt-label { display: block; font-size: 9px; letter-spacing: 0.14em; color: var(--ink-faint); }
.pv-total .pvt-value { font-size: 24px; font-weight: 950; color: var(--orange); text-shadow: 0 0 14px rgba(255,159,67,0.4); }
#left-rail .pv-total .pvt-value { font-size: 34px; line-height: 1; }
.pv-total .pvt-bonus { display: block; font-size: 9px; color: var(--gold); }
.pv-sel-invalid { color: var(--red); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }
.pv-sel-valid { color: var(--green); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }
#left-rail #preview-warnings {
  margin-top: 0;
  text-align: left;
}
#left-rail #preview-warnings .pv-warn {
  font-size: 10px;
  line-height: 1.35;
}

/* ================= Right rail loadout ================= */
.rail-crew, .rail-spike {
  --tc: var(--gold);
  --tg: rgba(255,215,94,0.25);
  display: flex; align-items: center; gap: 9px;
  padding: 8px; margin-bottom: 7px;
  border-radius: 8px; background: var(--flat-1);
  border-left: 3px solid var(--tc);
  min-width: 0;
}
.rail-crew.installed { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 35%, transparent); }
.rail-crew.spent { opacity: 0.55; filter: saturate(0.55); }
.rail-avatar, .rail-spike-symbol {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 8px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 950;
  color: var(--tc); background: rgba(7,11,18,0.86);
  border: 1px solid var(--tc);
}
.rail-spike-symbol { font-size: 16px; }
.rail-body { flex: 1; min-width: 0; }
.rail-name { font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-meta { margin-top: 2px; font-family: var(--mono); font-size: 8px; color: var(--ink-faint); letter-spacing: 0.08em; }
.rail-state { font-family: var(--mono); font-size: 8px; font-weight: 950; color: var(--tc); letter-spacing: 0.08em; }
.rail-empty { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); letter-spacing: 0.08em; padding: 8px 2px; }
.rail-spike.kind-synergy { --tc: var(--gold); }
.rail-spike.kind-slot { --tc: var(--crypto); }
.rail-spike.kind-global { --tc: var(--orange); }
.rail-spike.kind-charge { --tc: var(--luck); }
/* on-call crew keep their type colour (must beat the shared gold default above) */
.rail-crew.type-surge  { --tc: var(--surge);  --tg: var(--surge-glow); }
.rail-crew.type-luck   { --tc: var(--luck);   --tg: var(--luck-glow); }
.rail-crew.type-crypto { --tc: var(--crypto); --tg: var(--crypto-glow); }

.value-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-family: var(--mono); font-size: 10px; padding: 3px 2px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.value-row:last-child { border-bottom: none; }
.value-row .v-name { color: var(--ink-dim); }
.value-row .v-score { color: var(--gold); font-weight: 800; white-space: nowrap; }
.value-row .v-heat { color: var(--red); font-size: 9px; white-space: nowrap; }
.fusion-row { font-size: 10px; color: var(--ink-dim); line-height: 1.5; padding: 3px 2px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.fusion-row:last-child { border-bottom: none; }
.fusion-row b { color: var(--crypto); font-family: var(--mono); }
.fusion-row .f-note { color: var(--ink-faint); font-size: 9px; }
.fusion-note { margin-top: 9px; font-size: 9.5px; line-height: 1.5; color: var(--ink-faint); border-top: 1px dashed rgba(255,255,255,0.1); padding-top: 8px; }

/* stack-bonus spotlight (reuses crew-spotlight geometry) */
.stack-spotlight { --tc: var(--gold); --tg: rgba(255,215,94,0.55); }
.stack-spotlight .cs-avatar { font-size: 30px; }
.stack-spotlight .stack-math {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--mono);
}
.stack-spotlight .stack-math span {
  color: var(--ink-dim);
  font-size: 15px;
}
.stack-spotlight .stack-math b {
  color: var(--gold);
  font-size: 15px;
}
.stack-spotlight .stack-math strong {
  color: var(--orange);
  font-size: 23px;
  line-height: 1;
  text-shadow: 0 0 14px rgba(255,159,67,0.55);
}
.stack-spotlight.applying {
  box-shadow: 0 22px 80px rgba(0,0,0,0.58), 0 0 0 1px rgba(255,215,94,0.5), 0 0 38px rgba(255,215,94,0.42);
}

/* resolving: lock the board visually */
#screen-game.resolving #actions .btn,
#screen-game.resolving .tcard,
#screen-game.resolving .hand-slot { pointer-events: none; }
#screen-game.resolving #actions .btn { opacity: 0.35; }

@media (max-height: 760px) {
  .hand-slot { height: 152px; }
  .mcard { width: 40px; height: 56px; margin: 0 -13px; font-size: 15px; }
  .mcard > span:first-child { font-size: 15px; }
  .mcard .m-suit { font-size: 12px; }
}

/* ============================================================
   HEAT — prominence, escalating alert, penalty feedback
   ============================================================ */
#heat-panel {
  position: relative;
  --heat-a: 0; --heat-glow: 0px;
  transition: background 0.4s, box-shadow 0.4s;
}
#heat-panel .panel-title { transition: color 0.3s, text-shadow 0.3s; }
#heat-pct { transition: color 0.3s, text-shadow 0.3s; }
.heat-bar { height: 30px !important; transition: box-shadow 0.4s; }
.heat-bar .bar-fill {
  transition: transform 0.55s cubic-bezier(0.22,1,0.36,1), filter 0.4s, box-shadow 0.4s;
}

/* idle breathing — stronger & faster the hotter it gets */
@keyframes heatBreathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,77,94,0); }
  50% {
    box-shadow: 0 0 var(--heat-glow) rgba(255,77,94,var(--heat-a)),
                inset 0 0 26px rgba(255,77,94,calc(var(--heat-a) * 0.4));
  }
}
#heat-panel.heat-t1 { --heat-a: 0.22; --heat-glow: 16px; animation: heatBreathe 3.4s ease-in-out infinite; }
#heat-panel.heat-t2 { --heat-a: 0.4;  --heat-glow: 26px; animation: heatBreathe 2.3s ease-in-out infinite; }
#heat-panel.heat-t3 { --heat-a: 0.62; --heat-glow: 40px; animation: heatBreathe 1.4s ease-in-out infinite; }
#heat-panel.heat-t4 { --heat-a: 0.9;  --heat-glow: 60px; animation: heatBreathe 0.82s ease-in-out infinite; }

#heat-panel.heat-t2 .bar-fill { filter: saturate(1.15) brightness(1.08); box-shadow: 0 0 14px rgba(255,120,60,0.5); }
#heat-panel.heat-t3 .bar-fill { filter: saturate(1.3) brightness(1.15); box-shadow: 0 0 20px rgba(255,77,94,0.65); }
#heat-panel.heat-t4 .bar-fill { filter: saturate(1.5) brightness(1.25); box-shadow: 0 0 30px rgba(255,77,94,0.85); }
#heat-panel.heat-t3 .panel-title, #heat-panel.heat-t3 #heat-pct { color: var(--orange) !important; text-shadow: 0 0 12px rgba(255,159,67,0.6); }
#heat-panel.heat-t4 .panel-title, #heat-panel.heat-t4 #heat-pct { color: var(--red) !important; text-shadow: 0 0 14px rgba(255,77,94,0.8); }

/* jolt when a penalty lands */
@keyframes heatJolt {
  0% { transform: translateX(0) scale(1); }
  15% { transform: translateX(-5px) scale(1.02); }
  30% { transform: translateX(5px) scale(1.03); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0) scale(1); }
}
#heat-panel.heat-jolt { animation: heatJolt 0.5s ease-out; }
@keyframes heatAbsorb { 0% { box-shadow: 0 0 0 0 rgba(255,77,94,0.9); } 100% { box-shadow: 0 0 0 22px rgba(255,77,94,0); } }
#heat-panel.heat-absorb::after {
  content: ""; position: absolute; inset: 0; border-radius: 14px;
  animation: heatAbsorb 0.6s ease-out; pointer-events: none;
}
@keyframes heatCoolFlash {
  0% { box-shadow: 0 0 0 0 rgba(93,220,255,0.95), inset 0 0 28px rgba(93,220,255,0.22); }
  100% { box-shadow: 0 0 0 24px rgba(93,220,255,0), inset 0 0 0 rgba(93,220,255,0); }
}
#heat-panel.heat-cool-flash {
  animation: heatCoolFlash 0.76s ease-out;
  border-color: rgba(93,220,255,0.62) !important;
}

/* whole-screen red breathing vignette — ramps in past ~55%, loud by 80% */
#heat-vignette {
  position: fixed; inset: 0; z-index: 77; pointer-events: none;
  opacity: var(--vig, 0); transition: opacity 0.8s ease;
  background: radial-gradient(ellipse at 50% 50%, transparent 46%, rgba(150,0,18,0.30) 100%);
  box-shadow: inset 0 0 200px 34px rgba(255,24,48,0.5);
  animation: heatVigPulse 2.2s ease-in-out infinite;
}
@keyframes heatVigPulse { 0%,100% { filter: brightness(0.7) saturate(1); } 50% { filter: brightness(1.55) saturate(1.35); } }
#heat-vignette.alarm { animation-duration: 1.05s; }

/* ============================================================
   HEAT BUBBLES — vibrating cost flags above action buttons
   ============================================================ */
#actions .btn { position: relative; overflow: visible; }
.heat-bubble {
  position: absolute; left: 50%; bottom: 100%; margin-bottom: 8px;
  transform: translateX(-50%);
  z-index: 30; pointer-events: none; white-space: nowrap;
  font-family: var(--mono); font-size: 10px; font-weight: 950; letter-spacing: 0.04em;
  color: #fff; background: var(--red);
  border-radius: 999px; padding: 3px 9px;
  box-shadow: 0 0 12px rgba(255,77,94,0.6), 0 3px 8px rgba(0,0,0,0.5);
  animation: heatBubbleWiggle 0.9s ease-in-out infinite;
}
.heat-bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--red);
}
.heat-bubble.hidden-bubble { display: none; }
@keyframes heatBubbleWiggle {
  0%, 100% { transform: translateX(-50%) rotate(-4deg); }
  50% { transform: translateX(-50%) rotate(4deg); }
}
/* re-deal: way more prominent, faster, bigger, hotter */
.heat-bubble.redeal-bubble {
  font-size: 13px; padding: 4px 12px; margin-bottom: 10px;
  color: #1a0402;
  background: linear-gradient(180deg, #ffb055, var(--red));
  box-shadow: 0 0 20px rgba(255,77,94,0.85), 0 0 34px rgba(255,120,40,0.5), 0 4px 10px rgba(0,0,0,0.5);
  animation: heatBubblePump 0.62s ease-in-out infinite;
}
.heat-bubble.redeal-bubble::after { border-top-color: var(--red); }
.heat-bubble.redeal-bubble::before {
  content: "🔥"; margin-right: 4px; font-size: 11px;
}
.heat-bubble.redeal-bubble.danger {
  animation-duration: 0.4s;
  box-shadow: 0 0 26px rgba(255,40,60,1), 0 0 40px rgba(255,80,30,0.7), 0 4px 12px rgba(0,0,0,0.5);
}
.heat-bubble.play-bubble { background: var(--orange); color: #1a0c02; }
.heat-bubble.play-bubble::after { border-top-color: var(--orange); }
.heat-bubble.play-bubble.danger { background: var(--red); color: #fff; animation-duration: 0.45s; }
.heat-bubble.play-bubble.danger::after { border-top-color: var(--red); }
@keyframes heatBubblePump {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-5deg) scale(1); }
  50% { transform: translateX(-50%) translateY(-2px) rotate(5deg) scale(1.08); }
}

/* ============================================================
   RESOLUTION — per-hand spotlight (name + points, paced)
   ============================================================ */
.hand-spotlight {
  position: fixed; left: 50%; top: 30vh; transform: translate(-50%, -50%);
  z-index: 89; width: min(440px, 64vw);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 26px 22px; text-align: center;
  border: 1px solid var(--orange); border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(255,159,67,0.18), transparent 60%),
    rgba(8, 11, 18, 0.97);
  box-shadow: 0 0 0 1px rgba(255,159,67,0.32), 0 24px 74px rgba(0,0,0,0.72), 0 0 44px rgba(255,159,67,0.4);
  animation: crewSpotlightIn 0.26s cubic-bezier(0.22,1,0.36,1) both;
  pointer-events: none;
}
.hand-spotlight.leaving { animation: crewSpotlightOut 0.2s ease-in forwards; }
.hand-spotlight .hs-slot { font-family: var(--mono); font-size: 10px; font-weight: 800; letter-spacing: 0.2em; color: var(--ink-faint); }
.hand-spotlight .hs-slot .hs-loose { color: var(--red); }
.hand-spotlight .hs-name {
  font-family: var(--mono); font-size: 27px; font-weight: 950; letter-spacing: 0.08em;
  color: var(--gold); text-shadow: 0 0 22px rgba(255,215,94,0.45);
}
.hand-spotlight .hs-value {
  font-family: var(--mono); font-size: 46px; font-weight: 950; line-height: 1;
  color: var(--orange); text-shadow: 0 0 24px rgba(255,159,67,0.6);
}
.hand-spotlight.hs-punch .hs-value { animation: corePop 0.32s cubic-bezier(0.22,1,0.36,1); }
.hand-spotlight .hs-detail { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); letter-spacing: 0.04em; }
.hand-spotlight .hs-detail b { color: var(--ink); }

/* ============================================================
   ULTRA STACKS — prep screen, crew-slot row, e-Chips
   ============================================================ */

/* ---- Prep screen (flat 3-panel) ---- */
.prep-header {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 22px; border-bottom: 1px solid var(--flat-line);
  background: linear-gradient(180deg, rgba(16,24,42,0.5), rgba(10,14,22,0.15));
}
.prep-header .brand { font-size: 22px; }
.prep-title { flex: 1; }
.prep-tagline { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); letter-spacing: 0.04em; }
.prep-sub { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); letter-spacing: 0.1em; margin-top: 3px; }
.prep-header-right { display: flex; gap: 10px; align-items: center; }
.prep-main { flex: 1; display: grid; grid-template-columns: 300px 1.35fr 1fr; gap: 12px; padding: 14px 18px; min-height: 0; }
#screen-prep .panel {
  background: var(--flat-1) !important; border: none !important; border-radius: 14px !important;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
#screen-prep .panel-title { color: var(--ink-faint) !important; font-size: 10px !important; letter-spacing: 0.16em !important; margin-bottom: 10px !important; flex: 0 0 auto; }
#prep-ai-list { overflow-y: auto; }
#crew-grid, #spike-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; align-content: start; overflow-y: auto; padding: 2px; }

.ai-rule-row { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 12px; background: var(--flat-1); margin-bottom: 8px; cursor: help; border-left: 3px solid var(--flat-line); }
.ai-rule-row:hover { background: var(--flat-2); }
.ai-rule-icon { font-size: 22px; line-height: 1; }
.ai-rule-name { font-family: var(--mono); font-weight: 800; font-size: 13px; letter-spacing: 0.03em; }
.prep-legend { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.prep-legend .type-badge { cursor: help; }

/* ---- pick tiles (crew + spikes) ---- */
.pick-tile {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 12px; background: var(--flat-1);
  border: 1px solid transparent; border-left: 3px solid var(--tc, var(--flat-line));
  cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.pick-tile:hover { background: var(--flat-2); transform: translateY(-1px); }
.pick-tile.selected { background: var(--flat-2); box-shadow: 0 0 0 1px var(--tc, var(--gold)), 0 0 14px var(--tg, rgba(255,215,94,0.22)); }
.pick-tile.locked { opacity: 0.38; cursor: not-allowed; }
.pick-avatar { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 900; font-size: 14px; background: var(--bg1); border: 1px solid var(--tc, var(--line-bright)); color: var(--tc, var(--ink)); flex-shrink: 0; }
.spike-avatar { font-size: 18px; }
.pick-body { flex: 1; min-width: 0; }
.pick-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-meta { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-family: var(--mono); font-size: 9px; color: var(--ink-faint); }
.pick-cost { color: var(--gold); }
.spike-kind { text-transform: uppercase; letter-spacing: 0.08em; }
.pick-check { position: absolute; top: 8px; right: 9px; color: var(--tc, var(--gold)); font-weight: 900; font-size: 13px; opacity: 0; transition: opacity 0.15s; }
.pick-tile.selected .pick-check { opacity: 1; }
.spike-tile.kind-synergy { --tc: var(--gold);   --tg: rgba(255,215,94,0.3); }
.spike-tile.kind-slot    { --tc: var(--crypto); --tg: var(--crypto-glow); }
.spike-tile.kind-global  { --tc: var(--orange); --tg: rgba(255,159,67,0.3); }
.spike-tile.kind-charge  { --tc: var(--luck);   --tg: var(--luck-glow); }

/* ---- Crew Slot row (game, above card slots) ---- */
.crew-slot {
  flex: 1; min-width: 0; height: 100px;
  border: 1px dashed rgba(255,255,255,0.14); border-radius: 12px;
  position: relative; overflow: visible; background: var(--flat-1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.crew-slot.has-charge, .crew-slot.has-crew, .crew-slot.ready { border-style: solid; border-color: var(--tc, var(--line-bright)); }
.crew-slot.drop-hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--gold), 0 0 20px rgba(255,215,94,0.35); }
.crew-slot.has-crew { box-shadow: inset 0 0 16px color-mix(in srgb, var(--tc) 12%, transparent); }
.crew-slot.ready { box-shadow: 0 0 14px var(--tg, rgba(255,215,94,0.3)); }
.crew-slot .slot-num { position: absolute; top: 4px; left: 6px; font-family: var(--mono); font-size: 9px; color: var(--ink-faint); z-index: 3; }
.crew-slot .slot-stars { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); display: flex; gap: 1px; font-size: 9px; z-index: 3; }
.slot-stars .star-on { color: var(--gold); text-shadow: 0 0 6px rgba(255,215,94,0.7); }
.slot-stars .star-off { color: #2a3040; }
.cs-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 55%, transparent), color-mix(in srgb, var(--tc) 20%, transparent)); transition: height 0.4s cubic-bezier(0.22,1,0.36,1); z-index: 0; }
.cs-type-btn { position: relative; z-index: 2; border: 1px solid var(--tc); background: rgba(7,11,18,0.82); color: var(--tc); font-family: var(--mono); font-size: 9px; font-weight: 900; letter-spacing: 0.05em; border-radius: 7px; padding: 3px 9px; }
.cs-type-btn:hover { box-shadow: 0 0 10px var(--tg); }
.cs-empty { position: relative; z-index: 2; margin-top: 6px; text-align: center; font-family: var(--mono); }
.cs-empty b { display: block; color: var(--tc); font-size: 14px; }
.cs-empty span { font-size: 8px; color: var(--ink-faint); letter-spacing: 0.1em; }
.cs-crew { position: relative; z-index: 2; text-align: center; padding: 0 4px; }
.cs-avatar { width: 34px; height: 34px; border-radius: 9px; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 900; font-size: 13px; background: var(--bg1); border: 1px solid var(--tc); color: var(--tc); }
.cs-name { font-size: 9.5px; font-weight: 800; margin-top: 3px; line-height: 1.1; }
.cs-charge { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--tc); margin-top: 1px; }
.cs-ready { position: relative; z-index: 2; }
.cs-ready .sb-call { border: 1px solid var(--gold-deep); color: var(--gold); background: linear-gradient(180deg, rgba(68,52,17,0.95), rgba(44,33,10,0.95)); font-family: var(--mono); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; border-radius: 8px; padding: 7px 16px; animation: heartPulse 1.1s ease infinite; }

/* e-Chips header counter */
.counter-echips > span + span { color: var(--gold); text-shadow: 0 0 12px rgba(255,215,94,0.35); }

/* ---- two-row board layout (crew row + card row) — fit the viewport ---- */
#center { gap: 6px; }
#center #board-panel { flex: 0 0 auto; justify-content: flex-start; }
#center #board-panel { flex: 0 0 auto; }
#center #preview-panel { min-height: 0; }
#center #hand-area { flex: 0 0 auto; min-height: 0; }
#center .hand-slot { height: 148px; }
#center .crew-slot { height: 86px; }
#center .mcard { width: 40px; height: 56px; margin: 0 -13px; font-size: 15px; }
#center .mcard > span:first-child { font-size: 15px; }
#center .mcard .m-suit { font-size: 12px; }

/* shorter viewports: compress the two-row board so actions stay on-screen */
@media (max-height: 860px) {
  #center .crew-slot { height: 74px; }
  #center .hand-slot { height: 118px; }
  #center .mcard { width: 34px; height: 48px; margin: 0 -12px; font-size: 13px; }
  #center .mcard > span:first-child { font-size: 13px; }
  #center .mcard .m-suit { font-size: 10px; }
  #center #hand-cards { padding: 8px 0 4px; }
  .crew-slot .cs-empty { margin-top: 3px; }
  .crew-slot .cs-empty b { font-size: 12px; }
  #ai-bar { padding: 5px 18px; }
}

/* ============================================================
   ULTRA STACKS — charge cards, charge counter, CALL dialog
   ============================================================ */

/* charge cards sit to the right of the poker hand */
#hand-strip { display: flex; align-items: flex-end; justify-content: center; gap: 22px; }
#type-hand-area { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.type-hand-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: var(--ink-faint); }
.type-hand-label span { color: var(--gold); }
#type-cards { display: flex; align-items: flex-end; gap: 6px; min-height: 90px; }
#center .type-card { width: 52px; height: 74px; }
.type-card-sym { font-size: 13px; color: var(--tc); }
.type-card-name { font-size: 8px; }
.type-card-points { font-size: 15px; }
.type-card.dealing { animation: dealIn 0.3s cubic-bezier(0.22,1,0.36,1) both; }

/* charge-by-type counter in the preview panel */
#tp-bars { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
#tp-bars:empty { display: none; }
.tp-lead { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--ink-faint); }
#tp-bars .tp-bar { flex: 0 0 auto; min-width: 62px; padding: 3px 9px; }
#tp-bars .tp-val { font-size: 15px; }

/* crew-slot resolve animations */
@keyframes slotReadyPop { 0% { transform: scale(0.9); } 55% { transform: scale(1.06); } 100% { transform: scale(1); } }
.crew-slot.slot-ready-pop { animation: slotReadyPop 0.45s cubic-bezier(0.22,1,0.36,1); }
.crew-slot.activating { filter: brightness(1.6) saturate(1.3); }
.cs-crew.armed .cs-charge { color: var(--gold); text-shadow: 0 0 8px rgba(255,215,94,0.7); }
.crew-slot .cs-crew.armed { animation: heartPulse 1s ease infinite; }

#firewall-panel.damage-charging {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 1px rgba(255,215,94,0.38), 0 0 34px rgba(255,215,94,0.42), inset 0 0 24px rgba(255,215,94,0.12);
}

/* CALL dialog */
#call-wrap { position: fixed; inset: 0; z-index: 84; display: flex; align-items: center; justify-content: center; background: rgba(4,6,10,0.68); backdrop-filter: blur(3px); }
#call-dialog { width: 460px; max-width: 92vw; background: var(--panel-solid); border: 1px solid var(--line-bright); border-radius: 14px; padding: 20px; box-shadow: 0 26px 70px rgba(0,0,0,0.65); animation: modalIn 0.24s cubic-bezier(0.22,1,0.36,1); }
#call-dialog .cd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
#call-dialog .cd-title { font-family: var(--mono); font-size: 14px; font-weight: 900; letter-spacing: 0.08em; color: var(--gold); }
#call-dialog .cd-close { padding: 4px 10px; font-size: 12px; }
#call-dialog .call-options { display: grid; gap: 8px; }
.call-option { display: flex; flex-direction: column; gap: 5px; text-align: left; border: 1px solid var(--tc, var(--line-bright)); border-radius: 10px; padding: 10px 11px; background: rgba(8,12,20,0.92); color: var(--text); cursor: pointer; transition: transform 0.1s, box-shadow 0.15s; }
.call-option:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 0 16px var(--tg); }
.call-option:disabled { opacity: 0.4; cursor: not-allowed; }
.call-option.free { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 28%, transparent); }
.call-option.paid { border-style: dashed; }
.co-head { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; font-weight: 800; }
.co-mini { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; background: var(--bg1); border: 1px solid var(--tc); color: var(--tc); flex-shrink: 0; }
.co-head b { flex: 1; }
.co-head .star-req { color: var(--gold); }
.co-ability { font-size: 11px; line-height: 1.35; color: var(--dim); }
.co-foot { display: flex; justify-content: flex-end; }
.co-free { font-family: var(--mono); font-size: 11px; font-weight: 900; color: var(--green); letter-spacing: 0.08em; }
.co-cost { font-family: var(--mono); font-size: 11px; font-weight: 900; color: var(--gold); }

/* shorter viewports: shrink charge cards too */
@media (max-height: 860px) {
  #center .type-card { width: 46px; height: 62px; }
  #type-cards { min-height: 66px; }
}

/* ---- current increment: taller slot composition + visible Charge Card labels ---- */
#center .hand-slot {
  height: 220px;
  justify-content: flex-start;
  padding: 34px 6px 66px;
}
#center .hand-slot.special-slot { padding-top: 49px; }
#center .unit-name {
  position: absolute;
  top: 24px;
  left: 22px;
  right: 22px;
  z-index: 4;
}
#center .hand-slot.special-slot .unit-name { top: 40px; }
#center .unit-cards {
  margin: 0 0 4px;
  padding-top: 0;
  min-height: 56px;
  align-items: flex-start;
}
.unit-precalc {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  z-index: 4;
  text-align: center;
}
#center .slot-charge-tray { bottom: 41px; min-height: 50px; gap: 0; }
#center .slot-charge-empty { bottom: 57px; }
#center .hand-slot.empty .slot-hint { padding-bottom: 42px; }
#center .hand-slot.empty.has-charge-cards .slot-hint { padding-top: 32px; }
#center .hand-slot .synergy-arrow { right: -30px; transform: translateY(-50%) scale(0.72); pointer-events: auto; }

#center .slot-charge-card {
  width: 34px;
  height: 48px;
  margin: 0 -5px;
  grid-template-rows: 20px 1fr;
  border-radius: 7px;
}
#center .slot-charge-card span { font-size: 14px; }
#center .slot-charge-card b { font-size: 10px; padding: 1px 3px; }
#center .slot-charge-card em { font-size: 13px; }

#center .type-card {
  width: 68px;
  height: 96px;
  margin: 0 -6px;
}
#center .type-card .type-card-top,
#center .type-card .type-card-size,
#center .type-card .type-card-sym,
#center .type-card .type-card-name,
#center .type-card .type-card-points {
  display: flex !important;
}
#center .type-card .type-card-top { display: flex !important; }
#center .type-card .type-card-name,
#center .type-card .type-card-points { display: block !important; }

/* crew-slot charge forecast */
.crew-slot .cs-preview-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--tc) 34%, transparent) 0 6px, color-mix(in srgb, var(--tc) 18%, transparent) 6px 11px);
  opacity: 0.72;
  transition: height 0.28s ease;
}
.crew-slot {
  min-height: 104px;
}
#center .crew-slot {
  height: 104px;
}
.crew-slot .cs-forecast {
  position: absolute;
  right: 5px;
  bottom: 4px;
  z-index: 5;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 950;
  color: #071018;
  background: var(--tc);
  border-radius: 999px;
  padding: 2px 6px;
  box-shadow: 0 0 12px var(--tg);
}
.crew-slot .cs-forecast span { color: #fff; opacity: 0.7; }
.crew-slot.charge-preview { border-style: solid; box-shadow: inset 0 0 18px color-mix(in srgb, var(--tc) 14%, transparent), 0 0 14px color-mix(in srgb, var(--tc) 20%, transparent); }
.crew-slot.will-ready, .crew-slot.will-activate { box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(255,215,94,0.48), inset 0 0 20px color-mix(in srgb, var(--tc) 18%, transparent); }
.crew-slot.will-activate .cs-forecast, .crew-slot.will-ready .cs-forecast { background: var(--gold); color: #160b00; animation: heatBubblePump 0.8s ease-in-out infinite; }
.crew-slot.armed, .crew-slot.will-activate { border-color: var(--gold) !important; }
.crew-slot.crew-activate-pop { animation: slotReadyPop 0.85s cubic-bezier(0.22,1,0.36,1); filter: brightness(1.45) saturate(1.35); }
#center .crew-slot .synergy-arrow { right: -30px; transform: translateY(-50%) scale(0.62); pointer-events: auto; }
.crew-slot.locked {
  opacity: 0.46;
  border-style: dashed !important;
  filter: saturate(0.45);
}
.crew-slot .cs-lock {
  position: absolute;
  inset: auto 7px 20px;
  z-index: 5;
  display: grid;
  place-items: center;
  height: 20px;
  border-radius: 7px;
  background: rgba(255,255,255,0.08);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

/* larger slot scoring modal with cards + charge cards */
.hand-spotlight {
  width: min(680px, 82vw);
  top: 34vh;
  gap: 9px;
}
.hand-spotlight .hs-card-row,
.hand-spotlight .hs-charge-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 7px;
  max-width: 100%;
  flex-wrap: wrap;
}
.hs-card {
  width: 54px;
  height: 74px;
  border-radius: 8px;
  border: 1px solid var(--line-bright);
  background: linear-gradient(165deg, #182238, #0c1220);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px;
  font-family: var(--mono);
  font-weight: 950;
  box-shadow: 0 7px 20px rgba(0,0,0,0.35);
}
.hs-card span:first-child { font-size: 18px; }
.hs-card span:nth-child(2) { font-size: 15px; margin-top: 1px; }
.hs-card b { margin-top: auto; align-self: flex-end; font-size: 12px; color: #fff; }
.hs-card.loose { opacity: 0.58; border-style: dashed; border-color: rgba(255,77,94,0.62); }
.hs-charge-card {
  width: 42px;
  height: 54px;
  border: 1px solid var(--tc);
  border-radius: 8px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--tc) 23%, transparent), rgba(7,11,18,0.95));
  color: var(--tc);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 20px 1fr;
  align-items: center;
  justify-items: center;
  padding: 4px;
  box-shadow: 0 0 14px var(--tg), 0 7px 18px rgba(0,0,0,0.35);
}
.hs-charge-card b {
  color: #071018;
  background: var(--tc);
  border-radius: 4px;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 10px;
}
.hs-charge-card em {
  grid-column: 1 / -1;
  color: #fff;
  font-style: normal;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 950;
}
.hs-charge-card.wasted { opacity: 0.55; border-style: dashed; filter: saturate(0.55); }
.hs-card.score-tick, .hs-charge-card.score-tick { animation: scoreTick 0.42s cubic-bezier(0.22,1,0.36,1); box-shadow: 0 0 24px var(--gold); }
.hs-charge-card.score-tick {
  box-shadow: 0 0 0 1px var(--tc), 0 0 24px var(--tg), 0 7px 18px rgba(0,0,0,0.35);
}
.slot-charge-card.score-tick {
  box-shadow: 0 0 0 1px var(--tc), 0 0 22px var(--tg), 0 8px 18px rgba(0,0,0,0.4);
}
.hs-card.loose-tick, .hs-charge-card.loose-tick, .mcard.loose-tick, .slot-charge-card.loose-tick { animation: scoreTick 0.38s cubic-bezier(0.22,1,0.36,1); filter: brightness(1.15) saturate(0.6); }
.slot-charge-card.score-tick { animation: scoreTick 0.42s cubic-bezier(0.22,1,0.36,1); }
.hand-spotlight .hs-meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(360px, 100%);
}
.hand-spotlight .hs-meters div {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  padding: 6px 10px;
}
.hand-spotlight .hs-meters span {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.hand-spotlight .hs-meters b {
  display: block;
  font-family: var(--mono);
  font-size: 30px;
  line-height: 1;
  color: var(--orange);
  text-shadow: 0 0 18px rgba(255,159,67,0.55);
}

@media (max-height: 860px) {
  #center .hand-slot { height: 168px; padding-bottom: 52px; }
  #center .crew-slot { height: 88px; min-height: 88px; }
  #center .hand-slot.special-slot { padding-top: 45px; }
  #center .slot-charge-tray { bottom: 31px; min-height: 44px; }
  #center .slot-charge-empty { bottom: 41px; }
  .unit-precalc { bottom: 4px; }
  .hand-spotlight { top: 36vh; transform: translate(-50%, -50%) scale(0.9); }
  #center .type-card { width: 68px; height: 96px; }
}
@media (max-height: 760px) {
  #center .type-card { width: 62px; height: 88px; margin: 0 -7px; }
}

/* firewall counter badge + breach spotlight */
.fw-count { font-family: var(--mono); font-size: 10px; font-weight: 900; color: var(--gold); background: rgba(255,215,94,0.12); border: 1px solid rgba(255,215,94,0.3); border-radius: 999px; padding: 1px 8px; letter-spacing: 0.06em; }
.firewall-spotlight { --tc: var(--green); --tg: rgba(65,245,143,0.5); border-color: var(--green); }
.firewall-spotlight .cs-avatar { font-size: 34px; }

/* ============================================================
   ULTRA STACKS — round 3: barrier, shield, slot boxes, precalc,
   crew-slot restyle, heat bar, button pass, economy panel
   ============================================================ */

/* ---- top strip: barrier 20 · shield · firewall 40 · heat 40 ---- */
#target-strip {
  display: grid;
  grid-template-columns: 20fr 30px 40fr 40fr;
  gap: 8px;
  align-items: stretch;
}
#barrier-panel { display: flex; flex-direction: column; min-width: 0; }
#barrier-panel.broken { opacity: 0.75; }
#barrier-inline { display: flex; flex-direction: column; gap: 5px; cursor: help; }
.barrier-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.barrier-label { font-family: var(--mono); font-size: 9px; font-weight: 950; letter-spacing: 0.12em; color: var(--hearts); }
.barrier-head b { font-family: var(--mono); font-size: 17px; font-weight: 950; color: var(--ink); }
#barrier-inline.broken .barrier-label, #barrier-inline.broken .barrier-head b { color: var(--green); }
.b-tokens { display: flex; flex-wrap: wrap; gap: 3px; }
.b-token {
  min-width: 14px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; color: #39202a;
  border-radius: 4px; background: rgba(255,255,255,0.05);
  transition: color 0.3s, text-shadow 0.3s, background 0.3s;
}
.b-token.lit { color: var(--hearts); background: rgba(255,93,122,0.14); text-shadow: 0 0 8px rgba(255,93,122,0.9); }
.b-token.diamonds.lit { color: var(--diamonds); background: rgba(63,217,255,0.12); text-shadow: 0 0 8px rgba(63,217,255,0.9); }
.b-token.clubs.lit { color: var(--clubs); background: rgba(88,224,126,0.12); text-shadow: 0 0 8px rgba(88,224,126,0.9); }
.b-token.spades.lit { color: var(--spades); background: rgba(201,212,255,0.1); text-shadow: 0 0 8px rgba(201,212,255,0.8); }
.barrier-foot { font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; color: var(--ink-faint); }
#barrier-inline.broken .barrier-foot { color: var(--green); }
.barrier-none { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); padding: 6px 0; }
@keyframes barrierHitFx { 0% { filter: brightness(2.4); } 100% { filter: brightness(1); } }
#barrier-inline.barrier-hit { animation: barrierHitFx 0.5s ease-out; }

/* the shield between barrier and firewall */
.shield-gap { display: grid; place-items: center; pointer-events: none; }
.shield-icon { font-size: 20px; opacity: 0; transition: opacity 0.35s; filter: grayscale(1); }
.shield-gap.active .shield-icon {
  opacity: 1; filter: none;
  animation: shieldWiggle 1.6s ease-in-out infinite;
}
@keyframes shieldWiggle {
  0%, 100% { transform: rotate(-9deg) translateY(0); }
  50% { transform: rotate(9deg) translateY(-3px); }
}
@keyframes shieldAbsorbFx {
  0%   { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255,93,122,0)); }
  30%  { transform: scale(1.7); filter: drop-shadow(0 0 16px rgba(255,93,122,1)) brightness(1.8); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255,93,122,0)); }
}
.shield-icon.shield-absorb { animation: shieldAbsorbFx 0.9s cubic-bezier(0.22,1,0.36,1); }
@keyframes shieldShatterFx { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2.2) rotate(40deg); opacity: 0; } }
.shield-gap.shield-shatter .shield-icon { opacity: 1; animation: shieldShatterFx 0.7s ease-out forwards; }

/* ---- HEAT BAR: the re-deal bubble's gradient, slowly scrolling ---- */
.heat-bar .bar-fill {
  background: linear-gradient(90deg, #ffb055, var(--red), #ff5a2a, #ffb055) !important;
  background-size: 220% 100% !important;
  animation: heatBarScroll 4.5s linear infinite;
  box-shadow: 0 0 18px rgba(255,77,94,0.5), 0 0 34px rgba(255,120,40,0.28);
}
@keyframes heatBarScroll { 0% { background-position: 0% 50%; } 100% { background-position: 220% 50%; } }

/* ---- buttons ---- */
.btn-play-solid {
  background: var(--gold) !important;
  border: 1px solid var(--gold) !important;
  color: #120c00 !important;
  font-weight: 950;
  text-shadow: none !important;
  box-shadow: 0 0 20px rgba(255,215,94,0.34);
}
.btn-play-solid:hover:not(:disabled) { background: #ffe27a !important; box-shadow: 0 0 28px rgba(255,215,94,0.55); }
.btn-play-solid:disabled { opacity: 0.3; }
.btn-redeal {
  background: transparent !important;
  border: 1px solid var(--gold) !important;
  color: var(--gold) !important;
  font-weight: 900;
}
.btn-redeal:hover:not(:disabled) { background: rgba(255,215,94,0.1) !important; box-shadow: 0 0 16px rgba(255,215,94,0.3); }

/* ---- economy panel (e-Chips + The Van) above the precalc ---- */
#econ-panel { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.econ-chips {
  flex: 1; display: flex; align-items: baseline; gap: 7px; min-width: 0;
  cursor: help;
}
.econ-chips .econ-symbol { font-family: var(--mono); font-size: 20px; color: var(--gold); text-shadow: 0 0 12px rgba(255,215,94,0.5); }
.econ-chips b {
  font-family: var(--mono); font-size: 38px; font-weight: 950; line-height: 1;
  color: var(--gold); text-shadow: 0 0 20px rgba(255,215,94,0.5);
}
.btn-van {
  flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(68,52,17,0.95), rgba(44,33,10,0.95)) !important;
  border: 1px solid var(--gold-deep) !important;
  color: var(--gold) !important;
  font-family: var(--mono); font-size: 12px; font-weight: 900; letter-spacing: 0.06em;
  padding: 12px 14px !important;
}
.btn-van:hover { box-shadow: 0 0 18px rgba(255,215,94,0.4); border-color: var(--gold) !important; }

/* ---- precalc symbol boxes ---- */
#precalc-boxes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 10px; }
.pb {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px; border-radius: 9px; cursor: help;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}
.pb .pb-sym { font-size: 15px; opacity: 0.85; }
.pb b { font-family: var(--mono); font-size: 26px; font-weight: 950; line-height: 1; }
.pb.pb-zero { opacity: 0.45; }
.pb.pb-zero b { color: var(--ink-faint); }
.pb.pb-hot { border-color: rgba(255,77,94,0.4); background: rgba(255,77,94,0.09); }
.pb.pb-hot b { color: var(--red); text-shadow: 0 0 14px rgba(255,77,94,0.55); }
.pb.pb-hot-max { border-color: var(--red); background: rgba(255,77,94,0.18); box-shadow: 0 0 16px rgba(255,77,94,0.3); }
.pb.pb-hot-max b { color: #fff; text-shadow: 0 0 16px rgba(255,77,94,0.95); }
.pb.pb-cool { border-color: rgba(93,220,255,0.45); background: rgba(93,220,255,0.09); }
.pb.pb-cool b { color: #5ddcff; text-shadow: 0 0 14px rgba(93,220,255,0.55); }
.pb.pb-live { border-color: rgba(176,107,255,0.45); background: rgba(176,107,255,0.09); }
.pb.pb-live b { color: var(--luck); text-shadow: 0 0 12px var(--luck-glow); }
.pb.pb-chips { border-color: rgba(255,215,94,0.4); background: rgba(255,215,94,0.08); }
.pb.pb-chips b { color: var(--gold); text-shadow: 0 0 12px rgba(255,215,94,0.5); }

/* ---- card slot: 4 title-less boxes under each slot ---- */
.slot-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.sb {
  display: grid; place-items: center; cursor: help;
  min-height: 22px; padding: 2px 1px; border-radius: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 950; line-height: 1;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
}
.sb-dmg { color: var(--orange); border-color: rgba(255,159,67,0.32); }
.sb-charge { color: var(--tc, var(--ink)); border-color: color-mix(in srgb, var(--tc, #fff) 34%, transparent); }
.sb-hot { color: var(--red); border-color: rgba(255,77,94,0.34); background: rgba(255,77,94,0.07); }
.sb-cool { color: #5ddcff; border-color: rgba(93,220,255,0.4); background: rgba(93,220,255,0.07); }
.sb-chips { color: var(--gold); border-color: rgba(255,215,94,0.3); }
.sb.sb-zero { color: var(--ink-faint); border-color: rgba(255,255,255,0.06); background: transparent; }

/* ---- HEAT BOMB ---- */
.bomb-badge {
  position: absolute; top: 4px; right: 5px; z-index: 9; cursor: help;
  font-family: var(--mono); font-size: 10px; font-weight: 950; letter-spacing: 0.04em;
  color: #fff; background: var(--red);
  border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; padding: 2px 7px;
  box-shadow: 0 0 14px rgba(255,77,94,0.7);
  animation: heatBubbleWiggle 0.8s ease-in-out infinite;
}
.bomb-badge.defused {
  background: var(--green); color: #04170c;
  box-shadow: 0 0 12px rgba(65,245,143,0.5);
  animation: none;
}
.hand-slot.bomb-live { border-color: rgba(255,77,94,0.6); }
.hand-slot.bomb-live .slot-hint span:first-child { color: var(--red); }
@keyframes bombDetonateFx {
  0% { transform: scale(1); filter: brightness(1); }
  18% { transform: scale(1.1); filter: brightness(3) saturate(2); }
  100% { transform: scale(1); filter: brightness(1); }
}
.hand-slot.bomb-detonate { animation: bombDetonateFx 0.6s ease-out; border-color: var(--red) !important; }

/* ---- CREW SLOT restyle ---- */
.crew-slot .cs-count {
  position: absolute; top: 3px; left: 6px; z-index: 5;
  display: flex; align-items: baseline; gap: 1px;
  font-family: var(--mono); line-height: 1;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}
.crew-slot .cs-count b { font-size: 22px; font-weight: 950; color: var(--tc); }
.crew-slot .cs-count span { font-size: 11px; font-weight: 800; color: var(--ink-faint); }
.crew-slot .cs-count.armed b { color: var(--gold); text-shadow: 0 0 10px rgba(255,215,94,0.8); }
.crew-slot .slot-num { top: auto; bottom: 3px; left: 6px; }
/* still charging → gray outline with a thick black inner stroke */
.crew-slot.cs-charging {
  border: 1px solid rgba(255,255,255,0.22) !important;
  box-shadow: inset 0 0 0 3px #05070b;
}
.crew-slot.cs-charging.will-ready {
  border-color: var(--gold) !important;
  box-shadow: inset 0 0 0 3px #05070b, 0 0 22px rgba(255,215,94,0.45);
}
/* crew installed → thicker type-coloured line */
.crew-slot.cs-installed {
  border: 3px solid var(--tc) !important;
  box-shadow: inset 0 0 16px color-mix(in srgb, var(--tc) 14%, transparent);
}
.crew-slot.cs-installed.armed, .crew-slot.cs-installed.will-activate {
  border-color: var(--gold) !important;
  box-shadow: inset 0 0 18px rgba(255,215,94,0.16), 0 0 22px rgba(255,215,94,0.45);
}
/* incoming-charge preview: stripes drift slowly upward */
@keyframes csPreviewDrift { 0% { background-position: 0 0; } 100% { background-position: 0 -22px; } }
.crew-slot .cs-preview-fill {
  background-size: auto 22px;
  animation: csPreviewDrift 1.5s linear infinite;
}

/* ============================================================================
   ROUND 4 — columns, ghost hands, louder bombs, barrier-vs-total sequence
   ========================================================================== */

/* ---- each card slot is grouped with the crew slot it feeds ---- */
#center #board-panel { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: flex-start; overflow: visible; }
#board-columns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; overflow: visible; }
.board-col {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px; padding: 6px;
  background: rgba(255, 255, 255, 0.014);
}
.col-mount { display: flex; min-width: 0; overflow: visible; }
.col-mount > .crew-slot, .col-mount > .hand-slot { flex: 1 1 auto; min-width: 0; }

/* ---- ghost hands: what the slot wants, without a word of instruction ---- */
.ghost-row {
  position: absolute; z-index: 1; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.gc-card-row { inset: 0; justify-content: center; padding: 22px 6px 62px; }
.gc-charge-row { left: 6px; right: 6px; bottom: 40px; }
.ghost-label {
  font-family: var(--mono); font-size: 8px; font-weight: 900;
  letter-spacing: 0.16em; color: rgba(226, 232, 255, 0.26);
}
.ghost-cards { display: flex; justify-content: center; }
.ghost-card {
  border: 1px dashed rgba(226, 232, 255, 0.16);
  background: rgba(226, 232, 255, 0.018);
}
.ghost-card.gc-card { width: 22px; height: 31px; border-radius: 4px; margin: 0 -3px; }
.ghost-card.gc-charge { width: 15px; height: 20px; border-radius: 5px; margin: 0 1px; border-color: rgba(176, 107, 255, 0.22); }
.hand-slot.can-place .gc-card-row .ghost-card { border-color: rgba(255, 215, 94, 0.42); }

/* ---- Heat Bomb: rare, so it gets to shout ---- */
.bomb-badge {
  top: 4px; right: 5px;
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; padding: 4px 10px;
  border-width: 2px; border-radius: 999px;
  animation: heatBubbleWiggle 0.8s ease-in-out infinite, bombBreathe 1.5s ease-in-out infinite;
}
.bomb-badge .bomb-icon { font-size: 17px; line-height: 1; }
.bomb-badge .bomb-need {
  font-family: var(--mono); font-size: 23px; font-weight: 950; line-height: 1;
  color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}
@keyframes bombBreathe {
  0%, 100% { border-color: #ff4d5e; background: var(--red); box-shadow: 0 0 14px rgba(255, 77, 94, 0.8); }
  50%      { border-color: #ffe14d; background: #d81b34; box-shadow: 0 0 26px rgba(255, 225, 77, 0.9); }
}
.bomb-badge.defused { animation: none; border-color: rgba(255, 255, 255, 0.3); }
.bomb-badge.defused .bomb-need { color: #04170c; text-shadow: none; }

/* ---- a locked crew slot holds nothing but the lock ----
   minimal.css flattens .crew-slot with !important and paints its own ::after
   lock, so both have to be answered here or we get a grey slot with two locks */
.crew-slot.locked {
  background: #05070b !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  box-shadow: none !important;
  opacity: 1;
  cursor: default;
}
.crew-slot.locked::after { content: none; }
.crew-slot.locked .cs-lock {
  position: static; display: grid; place-items: center;
  width: 100%; height: 100%; inset: auto;
  font-size: 20px; opacity: 0.3; background: none; border: 0;
  color: var(--ink-faint); letter-spacing: 0;
}

/* ---- precalc box reacts whenever its number moves ---- */
@keyframes pbReact {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.16); filter: brightness(1.5); }
  100% { transform: scale(1); }
}
.pb.pb-react { animation: pbReact 0.46s cubic-bezier(0.22, 1, 0.36, 1); }
.pb.pb-drain { animation: pbReact 0.62s ease-in-out; }

/* ---- the barrier's suit flies at the board total and takes its bite ---- */
.fly-symbol {
  position: fixed; z-index: 9999; pointer-events: none;
  font-size: 84px; font-weight: 950; line-height: 1;
  filter: drop-shadow(0 0 18px currentColor);
  will-change: transform;
}
.pvt-value.total-targeted {
  animation: totalTargeted 0.9s ease-in-out infinite;
  text-shadow: 0 0 22px rgba(255, 215, 94, 0.75);
}
@keyframes totalTargeted {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}
@keyframes totalStruck {
  0%   { transform: scale(1.28); filter: brightness(2.4); }
  100% { transform: scale(1); filter: brightness(1); }
}
.pvt-value.total-struck { animation: totalStruck 0.64s cubic-bezier(0.22, 1, 0.36, 1); }
.pvt-value.total-absorbing { color: var(--red); text-shadow: 0 0 18px rgba(255, 77, 94, 0.8); }
@keyframes shieldWind {
  0%   { transform: scale(1) rotate(0deg); }
  60%  { transform: scale(1.3) rotate(-16deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.shield-icon.shield-wind { animation: shieldWind 0.46s ease-in-out; }
