/* Combat page: compact layout */
.combat-page { overflow-x: hidden; }
.combat-page .nav-bar.compact-nav {
  padding: 0.25rem 1rem;
  margin-bottom: 0.75rem;
}

/* Encounter Board Layout */

.board {
  position: relative;
  width: 95vw;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0;
  /* Match terrain-backdrop.jpg aspect so percentage-positioned zones align with baked-in shields */
  aspect-ratio: 1280 / 573;
  background: transparent;
  border-radius: 16px;
  border: 2px solid rgba(120, 100, 60, 0.4);
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.2),
    0 6px 30px rgba(0, 0, 0, 0.6);
  overflow: visible;
}

/* Environmental backdrop behind the board */
.board-backdrop {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  background-position: center;
  filter: brightness(0.9) saturate(1.05);
  z-index: 0;
  pointer-events: none;
  border-radius: 16px;
  overflow: hidden;
}

/* Subtle vignette overlay */
.board-field {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%,
      transparent 30%,
      rgba(0, 0, 0, 0.15) 70%,
      rgba(0, 0, 0, 0.35) 100%);
  border-radius: 14px;
  z-index: 1;
  pointer-events: none;
}

/* All board content above backdrop */
.board > .row-label,
.board > .board-row,
.board > .battle-line {
  position: relative;
  z-index: 2;
}

/* Row labels, battle line, and per-zone text labels are conveyed by the
   background art now, so hide all of them. */
.row-label,
.battle-line,
.zone-label {
  display: none;
}

/* Board rows are no longer flex containers; they collapse so their child
   zones position absolutely against the .board (the backdrop rectangle). */
.board-row {
  display: contents;
}

/* Extra zones row (treasure, complications, stage event) in bottom bar */
.extra-zones {
  display: flex;
  gap: 0.5rem;
}

.extra-zones .zone {
  width: 55px;
  height: 75px;
}

.awaiting .mini-card.too-expensive {
  opacity: 0.5;
}

/* Deploy affordance: clicking a playable hand/awaiting card already deploys
   it (MTGA-style); the pill just makes that visible. Only rendered by
   combat.js when the card is affordable during the action phase. */
.deploy-pill {
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  padding: 3px 9px;
  border-radius: 99px;
  background: linear-gradient(#f4ead2, #d9c9a4);
  border: 2px solid #2a241a;
  color: #1e6b2e;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.6),
    0 0 14px rgba(81, 207, 102, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
.hand-card:hover .deploy-pill,
.mini-card:hover .deploy-pill {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Base zone (used by bottom-bar slots). Board zones override size/position. */
.zone {
  width: 90px;
  height: 115px;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: filter 0.2s;
  cursor: pointer;
  background: transparent;
}

/* Bottom-bar slots have no background art, so give them a simple frame */
.bottom-bar .zone,
.extra-zones .zone {
  border: 1px solid rgba(160, 130, 60, 0.35);
  border-radius: 6px;
  background: rgba(20, 16, 8, 0.35);
}

.bottom-bar .zone:hover,
.extra-zones .zone:hover {
  border-color: #c9a84c;
}

.zone-count {
  font-size: 1.2rem;
  font-weight: bold;
  color: rgba(200, 180, 140, 0.4);
  z-index: 1;
  pointer-events: none;
}

/* ── Board zones positioned over baked-in background shields ──────────────
   Coordinates measured from terrain-backdrop.jpg (1280x573) grid overlay.
   Each zone is sized/placed to sit exactly inside its background shield. */
.board .zone {
  position: absolute;
  width: 6%;
  height: 11.5%;
  z-index: 2;
  background: transparent;
  border: none;
}

.board .zone:hover {
  filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.35));
  z-index: 9;
}

/* Boss (top center, 7.5% x 13.8%) */
.board .zone[data-zone="top-leader"] { left: 47.8%; top: 3.3%; width: 7.5%; height: 13.8%; }

/* Row 1: reserves (6% x 11.5%) */
.board .zone[data-zone="villain-support-0"] { left: 39%; top: 10.9%; width: 6%; height: 11.5%; }
.board .zone[data-zone="villain-leader"]     { left: 58%; top: 10.9%; width: 6%; height: 11.5%; }

/* Row 2: villain deploy (6% x 11.5%, 7.3% spacing) */
.board .zone[data-zone="villain-deploy-0"] { left: 37.70%; top: 28.3%; width: 6%; height: 11.5%; }
.board .zone[data-zone="villain-deploy-1"] { left: 45.00%; top: 28.3%; width: 6%; height: 11.5%; }
.board .zone[data-zone="villain-deploy-2"] { left: 52.30%; top: 28.3%; width: 6%; height: 11.5%; }
.board .zone[data-zone="villain-deploy-3"] { left: 59.60%; top: 28.3%; width: 6%; height: 11.5%; }

/* Flanks (7.9% x 15.3%) */
.board .zone[data-zone="flank-l"] { left: 26.7%; top: 37.8%; width: 7.9%; height: 15.3%; }
.board .zone[data-zone="flank-r"] { left: 68.6%; top: 37.8%; width: 7.9%; height: 15.3%; }

/* Row 3: hero deploy (6% x 11.5%, 7.37% spacing) */
.board .zone[data-zone="hero-deploy-0"] { left: 37.50%; top: 46.3%; width: 6%; height: 11.5%; }
.board .zone[data-zone="hero-deploy-1"] { left: 44.87%; top: 46.3%; width: 6%; height: 11.5%; }
.board .zone[data-zone="hero-deploy-2"] { left: 52.24%; top: 46.3%; width: 6%; height: 11.5%; }
.board .zone[data-zone="hero-deploy-3"] { left: 59.61%; top: 46.3%; width: 6%; height: 11.5%; }

/* Row 4: awaiting (6.2% x 12.5%, 7.57% spacing, 8 slots) */
.board .zone[data-zone="awaiting-0"] { left: 21.90%; top: 67.4%; width: 6.2%; height: 12.5%; }
.board .zone[data-zone="awaiting-1"] { left: 29.47%; top: 67.4%; width: 6.2%; height: 12.5%; }
.board .zone[data-zone="awaiting-2"] { left: 37.04%; top: 67.4%; width: 6.2%; height: 12.5%; }
.board .zone[data-zone="awaiting-3"] { left: 44.61%; top: 67.4%; width: 6.2%; height: 12.5%; }
.board .zone[data-zone="awaiting-4"] { left: 52.18%; top: 67.4%; width: 6.2%; height: 12.5%; }
.board .zone[data-zone="awaiting-5"] { left: 59.75%; top: 67.4%; width: 6.2%; height: 12.5%; }
.board .zone[data-zone="awaiting-6"] { left: 67.32%; top: 67.4%; width: 6.2%; height: 12.5%; }
.board .zone[data-zone="awaiting-7"] { left: 74.89%; top: 67.4%; width: 6.2%; height: 12.5%; }

/* Battle line divider (legacy, hidden in 4-row layout) */

/* Side panels (unused in current layout) */

/* Bottom bar */
.bottom-bar {
  max-width: 1600px;
  margin: 0.75rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, rgba(25, 20, 10, 0.92), rgba(15, 25, 15, 0.92));
  border-radius: 12px;
  border: 1px solid rgba(160, 130, 60, 0.2);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.deck-area {
  display: flex;
  gap: 0.75rem;
}

.deck-area .zone {
  width: 65px;
  height: 88px;
}

/* Deck/discard zones use inline card-back elements as backgrounds */
.bottom-bar .deck,
.bottom-bar .discard {
  overflow: hidden;
  border: none;
  background: transparent;
}

.bottom-bar .zone > .card-back {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 6px;
}

/* Hide the double borders from card-back on mini zones */
.bottom-bar .zone > .card-back::before,
.bottom-bar .zone > .card-back::after {
  display: none;
}

.bottom-bar .zone .zone-count {
  position: relative;
  z-index: 2;
}

.bottom-bar .zone .zone-label {
  position: relative;
  z-index: 2;
}

/* Action points */
.action-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.ap-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  display: block;
  margin-bottom: 0.5rem;
}

.ap-pips {
  display: flex;
  gap: 0.4rem;
}

.ap-pip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #444;
  background: transparent;
  transition: background 0.2s;
}

.ap-pip.active {
  background: #c9a84c;
  border-color: #c9a84c;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
}

.ap-pip.spent {
  background: #333;
  border-color: #555;
}

/* Dice and button base styles are in style.css (shared).
   Board-specific overrides below. */

/* Turn info */
.turn-info {
  text-align: right;
}

.turn-phase {
  font-size: 0.85rem;
  color: #c9a84c;
  margin-bottom: 0.5rem;
}

.btn-end-step {
  background: rgba(30, 25, 15, 0.8);
  color: #e0d8c0;
  border: 1px solid rgba(160, 130, 60, 0.4);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-end-step:hover {
  background: rgba(50, 40, 20, 0.9);
  border-color: #c9a84c;
}

/* Mini cards in zones - square card with inner shield portrait.
   Gold ornate border wraps the entire card. Shield clips the portrait.
   Below the shield point: dark corners with stats.
   The card is a size container: child metrics use cq units so the same
   markup scales from board zones to deck pool slots, and a compact
   @container block below drops the name banner under 64px width. */
.mini-card {
  --fa: #a9742f;  /* Bronze frame mid */
  --fb: #5f3f1b;  /* Bronze frame dark */
  --fc: #cf9c52;  /* Bronze frame light */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  container-type: size;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  border-radius: 6px;
  overflow: hidden;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.55));
  /* Gold ornate border around entire card */
  border: 2.5px solid var(--fc);
  background: rgba(10, 8, 4, 0.85);
  box-shadow:
    inset 0 0 0 1px var(--fb),
    inset 0 1px 2px rgba(255,255,255,0.15);
}

.mini-card.quality-silver { --fa: #8e8e9a; --fb: #4f4f59; --fc: #c2c2cc; }
.mini-card.quality-gold   { --fa: #c9a84c; --fb: #856420; --fc: #ecd488; }

/* Clipped shield body holding the portrait + class tint. Sits below the
   name banner (top 14%); the compact block restores the full-height shield */
.mini-shield {
  position: absolute;
  top: 14%;
  left: 0;
  right: 0;
  height: 72%;
  clip-path: polygon(0% 0%, 100% 0%, 100% 72%, 50% 100%, 0% 72%);
  overflow: hidden;
  z-index: 1;
}

.mini-card:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 4px 12px rgba(201, 168, 76, 0.6));
  z-index: 10;
}

/* Inner gold frame following the shield contour. Lives on .mini-shield so
   it tracks the shield geometry in both normal and compact layouts (the
   shield's own clip-path clips these pseudo-elements). */
.mini-shield::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    linear-gradient(135deg,
      var(--fc) 0%,
      var(--fa) 28%,
      var(--fb) 52%,
      var(--fa) 76%,
      var(--fc) 100%) padding-box,
    transparent;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 3px;
}

/* Dark seam inside the shield frame */
.mini-shield::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)) padding-box,
    transparent;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 4.5px;
}

/* Diagonal shield border: quality-colored V-band hugging the shield's
   bottom contour. Geometry derives from the shield clip (.mini-shield spans
   14%..86% of the card with side vertices at 72% of its height and the point
   at 100%): card-space the V runs from y=65.84% at the edges to y=86% at the
   center. This element spans 65.84%..90% and traces that V with a constant
   ~4%-of-card band, so it scales with any thumbnail size. */
.mini-shield-diag {
  position: absolute;
  left: 0;
  right: 0;
  top: 65.84%;
  height: 24.16%;
  z-index: 6;
  pointer-events: none;
  clip-path: polygon(0% 0%, 50% 83.4%, 100% 0%, 100% 16.6%, 50% 100%, 0% 16.6%);
  background: linear-gradient(
    to top,
    var(--fb) 0%,
    var(--fa) 40%,
    var(--fc) 100%
  );
}

.mini-card.selected {
  filter: drop-shadow(0 0 10px rgba(81, 207, 102, 0.7));
  animation: pulse-select 1.5s ease-in-out infinite;
}

@keyframes pulse-select {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(81, 207, 102, 0.5)); }
  50% { filter: drop-shadow(0 0 16px rgba(81, 207, 102, 0.8)); }
}

/* Frame color is driven by card quality (see --fa/--fb/--fc vars above),
   matching the Unity reference where all cards share an ornate gold frame. */

/* Background class tint behind portrait */
.mini-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}

/* Portrait fills the entire shield (same crop as the full card's .tos-art) */
.mini-portrait {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 22%;
}
/* Campaign character portraits focus mid-frame, and they have no stats */
.mini-card.campaign-char .mini-portrait {
  background-position: center 40%;
}
.mini-card.campaign-char .mini-stat-corner .stat-val { display: none; }

/* Treasure art is object-centered: show the whole artwork on dark */
.mini-card.treasure .mini-portrait {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: #17120b;
}

/* Name banner: slim parchment pill above the shield, echoing the full
   card's banner. Hidden on tiny cards via the compact block below. */
.mini-info {
  position: absolute;
  top: 2.5%;
  left: 3.5%;
  right: 3.5%;
  height: 10%;
  z-index: 8;
  display: flex;
  align-items: center;
  padding: 0 6cqw;
  border-radius: 99px;
  background: linear-gradient(#f4ead2, #d9c9a4);
  border: 1px solid rgba(42, 36, 26, 0.85);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.mini-name {
  width: 100%;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(6px, 8cqw, 10.5px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #2a1f10;
  text-shadow: none;
}

.mini-stats {
  display: none;
}

.mini-atk {
  color: #ff8787;
  font-weight: 700;
}

.mini-sta {
  color: #74c0fc;
  font-weight: 700;
}

/* Quality plate frame on mini cards (hidden - shield border replaces it) */
.mini-quality {
  display: none;
}

/* Stat corners below the shield point: leather wedge with the full card's
   numeral treatment (same colors + heavy black outline as .tos-stat) */
.mini-stat-corner {
  position: absolute;
  bottom: 0;
  width: 38%;
  height: 30%;
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3cqh;
}

.mini-stat-corner.atk {
  left: 0;
  clip-path: polygon(0% 0%, 100% 62%, 100% 100%, 0% 100%);
  background: linear-gradient(160deg, #2c2216 0%, #171008 70%);
}
.mini-stat-corner.sta {
  right: 0;
  clip-path: polygon(100% 0%, 0% 62%, 0% 100%, 100% 100%);
  background: linear-gradient(200deg, #2c2216 0%, #171008 70%);
}

.mini-stat-corner img {
  display: none;
}

.mini-stat-corner .stat-val {
  font-weight: 700;
  font-size: clamp(9px, 15cqw, 22px);
  text-shadow:
    -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000,
    -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000,
    0 0 6px rgba(0,0,0,0.95);
  line-height: 1;
}

.mini-stat-corner.atk .stat-val {
  color: #ff9999;
}

.mini-stat-corner.sta .stat-val {
  color: #99ccff;
}

/* Quality rank triangles removed per user request */
.mini-quality-triangles {
  display: none;
}

/* Ability icons: centered in the dark strip below the shield point
   (inside the card, so they never overlap the row beneath) */
.mini-ability-icons {
  position: absolute;
  bottom: 2.5%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  z-index: 7;
  pointer-events: none;
}

.ability-icon {
  width: clamp(5px, 8cqw, 11px);
  height: clamp(5px, 8cqw, 11px);
  border-radius: 25%;
  border: 1px solid rgba(0, 0, 0, 0.7);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.ability-icon.action {
  background: linear-gradient(#e0bd5e, #a9742f);
}

.ability-icon.energy,
.ability-icon.talent {
  border-radius: 50%;
  background: linear-gradient(#8ec5ff, #3b82c4);
}

.ability-icon.passive {
  background: linear-gradient(#7fd98c, #3f9a4d);
}

/* Stat icon sprites (inline in stats) */
.stat-icon {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-right: 1px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.stat-icon-lg {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto 2px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.stat-icon-modal {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0 auto 4px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

/* Cost badge: same parchment square as the full card's .tos-cost,
   sitting inside the art just below the name banner */
.mini-cost {
  position: absolute;
  top: 16%;
  left: 5%;
  width: 17cqw;
  aspect-ratio: 26 / 28;
  border-radius: 18%;
  background: linear-gradient(#f2efe6, #c8c2b2);
  color: #1c150c;
  font-size: clamp(7px, 10cqw, 15px);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.7);
  border: 1.5px solid #2a241a;
  z-index: 8;
  line-height: 1;
}

.mini-damage {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(200, 30, 30, 0.95);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(200, 30, 30, 0.6), 0 0 12px rgba(200, 30, 30, 0.3);
  animation: damage-flash 0.3s ease-out;
  z-index: 5;
}

/* Red vignette on damaged cards */
.mini-card.damaged {
  filter: drop-shadow(0 0 6px rgba(200, 30, 30, 0.5));
}

/* Current HP badge */
.mini-hp {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #74c0fc;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 3px;
  border: 1px solid rgba(116, 192, 252, 0.4);
  z-index: 5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.mini-hp.critical {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.5);
  animation: hp-pulse 1.5s ease-in-out infinite;
}

@keyframes hp-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 107, 107, 0.3); }
  50% { box-shadow: 0 0 10px rgba(255, 107, 107, 0.6); }
}

@keyframes damage-flash {
  0% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* Hover tooltip (disabled - hover preview shows full card) */

/* Defeated card marker */
.mini-card.defeated {
  opacity: 0.35;
  filter: grayscale(0.8);
}

.mini-card.defeated::before {
  content: 'DEFEATED';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: 0.55rem;
  font-weight: 800;
  color: #ff6b6b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  z-index: 10;
  white-space: nowrap;
  pointer-events: none;
}

/* Combat log */
.combat-log {
  max-width: 1600px;
  margin: 0.75rem auto;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, rgba(20, 16, 8, 0.9), rgba(15, 20, 12, 0.9));
  border-radius: 12px;
  border: 1px solid rgba(160, 130, 60, 0.2);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.combat-log h3 {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #9a8560;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.combat-log h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(160, 130, 60, 0.15);
}

.log-entries {
  max-height: 100px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  line-height: 1.6;
  color: #9a9070;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 130, 60, 0.2) transparent;
}

.log-entries-inner {
  display: flex;
  flex-direction: column;
}

.log-entry {
  padding: 2px 6px;
  border-bottom: 1px solid rgba(160, 130, 60, 0.05);
  word-wrap: break-word;
  overflow-wrap: break-word;
  border-radius: 2px;
}

.log-entry:nth-child(odd) {
  background: rgba(160, 130, 60, 0.02);
}

/* Board-specific button override */
.bottom-bar .btn-action {
  margin-left: 0.5rem;
}

/* Adept marker: small triangle (the full card's Adept symbol) seated on
   the shield's V point. Letter kept in the DOM for the tooltip but hidden. */
.mini-role-badge {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 7;
}

.mini-role-badge.adept {
  bottom: 11%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(7px, 13cqw, 15px);
  height: clamp(6px, 11cqw, 13px);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(#8ec5ff, #3b82c4);
  color: transparent;
  font-size: 0;
}

/* Compact cards (narrow slots, or short ones like the main board zones):
   no room for the name banner, so the shield reclaims the full height
   (original geometry: 0..86% of the card, V from 61.92% at the edges to
   86% at the point, band to 90%). */
@container (max-width: 63px) or (max-height: 84px) {
  .mini-info { display: none; }
  .mini-ability-icons { display: none; }
  .mini-shield {
    top: 0;
    height: 86%;
  }
  .mini-shield-diag {
    top: 61.9%;
    height: 28.1%;
    clip-path: polygon(0% 0%, 50% 85.7%, 100% 0%, 100% 14.3%, 50% 100%, 0% 14.3%);
  }
  .mini-cost { top: 4%; }
}

/* Fortification badge */
.mini-fort-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(81, 207, 102, 0.9);
  color: #1a1a0e;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Fortify button active state */
.btn-action.active {
  background: #2d5016;
  border-color: #51cf66;
  color: #51cf66;
}

/* Dice rolling animation */
.die.rolling {
  animation: shake 0.1s infinite;
  border-color: #c9a84c;
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.4);
}

.die.result-high {
  color: #51cf66;
  border-color: #51cf66;
  box-shadow: 0 0 8px rgba(81, 207, 102, 0.3);
}

.die.result-low {
  color: #ff8787;
  border-color: #ff8787;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
}

@keyframes shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-2px, 1px) rotate(5deg); }
  50% { transform: translate(2px, -1px) rotate(-5deg); }
  75% { transform: translate(-1px, 2px) rotate(3deg); }
  100% { transform: translate(1px, -2px) rotate(-3deg); }
}

/* Card Detail Modal */
/* Treasure inventory modal */
.treasure-inventory {
  padding: 1rem;
  min-width: 300px;
}
.ti-header {
  color: #c9a84c;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.ti-empty { color: #888; font-size: 0.8rem; margin-bottom: 0.75rem; }
.ti-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}
.ti-row:hover { background: rgba(160, 130, 60, 0.18); }
.ti-thumb {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 5px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #17120b;
  border: 1px solid rgba(160, 130, 60, 0.4);
}
.ti-name {
  flex: 1;
  min-width: 0;
  color: #e8dcc0;
  font-size: 0.85rem;
}
.ti-name small {
  display: block;
  color: #8a7a55;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ti-use { flex: 0 0 auto; font-size: 0.7rem; padding: 4px 12px; }

.card-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.card-modal-backdrop.active {
  display: flex;
}

.card-modal {
  background: linear-gradient(135deg, #1e1a0f, #1a2518);
  border: 1px solid rgba(160, 130, 60, 0.4);
  border-radius: 16px;
  max-width: 380px;
  width: 90%;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: modal-pop 0.2s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

/* Wide (boss) cards get a landscape modal instead of the narrow squeeze */
.card-modal:has(.tos-wide) {
  max-width: 660px;
}
.card-modal .tos-wide {
  aspect-ratio: auto;
  min-height: 320px;
}
.card-modal .tos-wide .tos-frame {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}
.card-modal .tos-wide .tos-art > img.portrait {
  position: absolute;
  inset: 0;
  height: 100%;
}

@keyframes modal-pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.card-modal-portrait-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.card-modal-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
}

.card-modal-portrait {
  position: absolute;
  inset: 10px 20px;
  background-size: cover;
  background-position: center top;
  border-radius: 8px;
  border: 1px solid rgba(160, 130, 60, 0.2);
}

.card-modal-cost-badge {
  position: absolute;
  top: 16px;
  left: 26px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.95);
  color: #1a1a0e;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 5;
  border: 1px solid rgba(255, 220, 100, 0.5);
}

.card-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #e0d8c0;
  border: none;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-modal-body {
  padding: 1rem 1.25rem 1.25rem;
}

.card-modal-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #c9a84c;
  margin-bottom: 2px;
}

.card-modal-meta {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.75rem;
}

.card-modal-stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.card-modal-stat {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.card-modal-stat span {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
}

.card-modal-stat label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-top: 2px;
}

.card-modal-stat.atk span { color: #ff8787; }
.card-modal-stat.sta span { color: #74c0fc; }
.card-modal-stat.cost span { color: #c9a84c; }

.card-modal-details {
  font-size: 0.8rem;
  color: #aaa;
  line-height: 1.6;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.card-modal-details b {
  color: #ddd;
}

.card-modal-abilities {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(160, 130, 60, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ability-entry {
  font-size: 0.8rem;
  color: #ccc;
  line-height: 1.5;
}

.ability-entry b {
  color: #e0e0e0;
}

.ability-desc {
  color: #999;
  font-size: 0.75rem;
}

.ability-type {
  display: inline-block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.ability-type.action {
  background: rgba(201, 168, 76, 0.2);
  color: #c9a84c;
}

.ability-type.talent {
  background: rgba(116, 192, 252, 0.2);
  color: #74c0fc;
}

.ability-type.passive {
  background: rgba(81, 207, 102, 0.2);
  color: #51cf66;
}

.card-modal-actions {
  display: flex;
  gap: 0.5rem;
}

.card-modal-action {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(160, 130, 60, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: rgba(30, 25, 15, 0.8);
  color: #e0d8c0;
}

.card-modal-action:hover {
  border-color: #c9a84c;
}

.card-modal-action.deploy {
  background: #2d5016;
  border-color: #51cf66;
  color: #51cf66;
}

.card-modal-action.deploy:hover {
  background: #3d6020;
}

.card-modal-action.attack {
  background: #4a1520;
  border-color: #ff8787;
  color: #ff8787;
}

.card-modal-action.attack:hover {
  background: #5a2030;
}

.card-modal-action.target {
  background: #4a1520;
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.card-modal-action.fortify {
  background: rgba(30, 25, 15, 0.8);
  border-color: #74c0fc;
  color: #74c0fc;
}

.card-modal-action.use-action {
  background: #3a3010;
  border-color: #c9a84c;
  color: #c9a84c;
}

.card-modal-action.use-action:hover {
  background: #4a4018;
}

.card-modal-action.close {
  background: transparent;
  border-color: #555;
  color: #888;
}

/* Outcome / Rewards Screen */
.outcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: fade-in 0.5s ease-out;
}

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.outcome-panel {
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #1e1a0f, #1a2518);
  border: 1px solid rgba(160, 130, 60, 0.3);
  border-radius: 16px;
  overflow-x: hidden;
}

.outcome-header {
  text-align: center;
  padding: 2rem 2rem 1rem;
}

.outcome-header.victory .outcome-icon { color: #51cf66; }
.outcome-header.defeat .outcome-icon { color: #ff6b6b; }
.outcome-icon { font-size: 3rem; }

.outcome-title {
  font-size: 2rem;
  margin: 0.5rem 0 0.25rem;
}
.outcome-header.victory .outcome-title { color: #51cf66; }
.outcome-header.defeat .outcome-title { color: #ff6b6b; }

.outcome-subtitle {
  color: #888;
  font-size: 0.9rem;
}

.outcome-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 2rem;
  border-top: 1px solid rgba(160, 130, 60, 0.1);
  border-bottom: 1px solid rgba(160, 130, 60, 0.1);
}

.outcome-stat { text-align: center; }
.outcome-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #c9a84c;
}
.outcome-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-top: 2px;
}

.reward-section {
  padding: 1.25rem 1.5rem;
}

.reward-header {
  color: #c9a84c;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.reward-desc {
  color: #888;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.reward-grid {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.reward-card {
  min-width: 130px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(160, 130, 60, 0.3);
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  transition: all 0.3s;
}

.reward-card.added {
  border-color: #51cf66;
  box-shadow: 0 0 12px rgba(81, 207, 102, 0.3);
}

.reward-card-inner {
  display: flex;
  flex-direction: column;
}

.reward-portrait {
  width: 100%;
  height: 100px;
  background-size: cover;
  background-position: center top;
  background-color: rgba(201,168,76,0.1);
}

.reward-quality {
  text-align: center;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 2px;
}
.reward-quality.bronze { background: #8b6914; color: #ffd699; }
.reward-quality.silver { background: #5a5a6e; color: #d4d4e0; }
.reward-quality.gold { background: #8b7014; color: #ffe066; }

.reward-info {
  padding: 0.5rem;
}

.reward-name {
  color: #e0d8c0;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.reward-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.reward-add-btn {
  width: 100%;
  padding: 0.5rem;
  background: #2d5016;
  color: #51cf66;
  border: none;
  border-top: 1px solid rgba(81,207,102,0.2);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.reward-add-btn:hover { background: #3d6020; }
.reward-add-btn:disabled {
  background: rgba(81,207,102,0.1);
  color: #51cf66;
  cursor: default;
}

.outcome-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(160, 130, 60, 0.1);
}

.outcome-btn {
  flex: 1;
  max-width: 160px;
  text-align: center;
}

@media (max-width: 480px) {
  .outcome-panel { border-radius: 12px; }
  .outcome-title { font-size: 1.5rem; }
  .outcome-stats { gap: 1rem; }
  .reward-grid { gap: 0.5rem; }
  .reward-card { min-width: 110px; }
  .outcome-actions { flex-wrap: wrap; }
}

/* Attack animations */
.mini-card.attacking {
  z-index: 15;
  animation: attack-pulse 0.4s ease-out;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
  border-color: #ff6b6b;
}

@keyframes attack-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1.05); }
}

.mini-card.hit {
  animation: hit-shake 0.4s ease-out;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.6);
}

@keyframes hit-shake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, -1px); }
  100% { transform: translate(0, 0); }
}

.mini-card.evading {
  animation: evade-shimmer 0.8s ease-out;
  box-shadow: 0 0 20px rgba(116, 192, 252, 0.7);
  border-color: #74c0fc;
  opacity: 0.6;
}

@keyframes evade-shimmer {
  0% { transform: scale(1); opacity: 1; }
  30% { transform: scale(0.95) translateY(-3px); opacity: 0.4; }
  60% { transform: scale(1) translateY(0); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.damage-float {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  color: #ff4444;
  font-size: 1.2rem;
  font-weight: 900;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  z-index: 20;
  pointer-events: none;
  animation: float-up 0.9s ease-out forwards;
}

.damage-float.defeated {
  color: #ff6b6b;
  font-size: 0.9rem;
  text-shadow: 0 0 8px rgba(255, 107, 107, 0.8);
}

@keyframes float-up {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px); }
}

.zone.deck-hit {
  animation: deck-flash 0.6s ease-out;
}

@keyframes deck-flash {
  0% { box-shadow: 0 0 0 rgba(255, 107, 107, 0); }
  30% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.6); border-color: #ff6b6b; }
  100% { box-shadow: 0 0 0 rgba(255, 107, 107, 0); }
}

.btn-end-step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Hand tray removed: awaiting cards now use board slots */

/* Quality badge (text label) */
.hand-quality-badge,
.preview-quality-badge,
.modal-quality-badge {
  display: inline-block;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
}

.hand-quality-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  font-size: 0.5rem;
  margin-left: 0;
}

.hand-quality-badge.bronze,
.preview-quality-badge.bronze,
.modal-quality-badge.bronze {
  background: rgba(139, 105, 20, 0.6);
  color: #ffd699;
  border: 1px solid rgba(139, 105, 20, 0.4);
}

.hand-quality-badge.silver,
.preview-quality-badge.silver,
.modal-quality-badge.silver {
  background: rgba(90, 90, 110, 0.6);
  color: #d4d4e0;
  border: 1px solid rgba(90, 90, 110, 0.4);
}

.hand-quality-badge.gold,
.preview-quality-badge.gold,
.modal-quality-badge.gold {
  background: rgba(139, 112, 20, 0.6);
  color: #ffe066;
  border: 1px solid rgba(201, 168, 76, 0.5);
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.3);
}

/* Hover Preview Panel */
.hover-preview {
  display: none;
  position: fixed;
  right: calc(50% - 610px);
  top: 45%;
  transform: translateY(-50%);
  width: auto;
  /* Above the victory overlay (200) so reward hovers preview too */
  z-index: 240;
  pointer-events: none;
  animation: preview-fade 0.15s ease-out;
}

.hover-preview.active {
  display: block;
}

@keyframes preview-fade {
  0% { opacity: 0; transform: translateY(-50%) scale(0.95); }
  100% { opacity: 1; transform: translateY(-50%) scale(1); }
}

.hover-preview .preview-portrait-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.hover-preview .preview-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
}

.hover-preview .preview-portrait {
  position: absolute;
  inset: 8px 16px;
  background-size: cover;
  background-position: center top;
  border-radius: 6px;
  border: 1px solid rgba(160, 130, 60, 0.2);
}

.hover-preview .preview-cost {
  position: absolute;
  top: 12px;
  left: 20px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.95);
  color: #1a1a0e;
  font-size: 0.9rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border: 1px solid rgba(255, 220, 100, 0.5);
}

.hover-preview .preview-body {
  padding: 0.75rem 1rem 1rem;
}

.hover-preview .preview-name {
  font-size: 1rem;
  font-weight: 700;
  color: #c9a84c;
  margin-bottom: 2px;
}

.hover-preview .preview-meta {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.hover-preview .preview-stats-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.hover-preview .preview-stat {
  flex: 1;
  text-align: center;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

.hover-preview .preview-stat span {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.hover-preview .preview-stat label {
  display: block;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
}

.hover-preview .preview-stat.atk span { color: #ff8787; }
.hover-preview .preview-stat.sta span { color: #74c0fc; }
.hover-preview .preview-stat.cost span { color: #c9a84c; }

.hover-preview .preview-abilities {
  font-size: 0.7rem;
  color: #aaa;
  line-height: 1.5;
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.hover-preview .preview-abilities b {
  color: #ddd;
}

/* (turn ref removed) */

/* Tablet responsive board */
/* (.mini-name / .mini-cost scale via container units; no overrides needed) */
@media (max-width: 768px) {
  .bottom-bar {
    padding: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .deck-area .zone {
    width: 50px;
    height: 70px;
  }

  .die {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .ap-pip {
    width: 18px;
    height: 18px;
  }

  .combat-log {
    margin: 0.5rem;
  }
}

/* Mobile phone responsive board */
@media (max-width: 600px) {
  .board {
    border-radius: 10px;
  }

  /* Bottom bar stacks vertically */
  .bottom-bar {
    padding: 0.5rem;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .action-bar {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
  }

  .deck-area {
    justify-content: center;
  }

  .deck-area .zone {
    width: 45px;
    height: 62px;
  }

  .die {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .ap-pip {
    width: 16px;
    height: 16px;
  }

  .turn-info {
    text-align: center;
  }

  .btn-end-step {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
  }

  .combat-log {
    margin: 0.5rem 0;
    overflow: hidden;
  }

  .combat-log .log-entries {
    max-height: 150px;
    font-size: 0.7rem;
  }

  /* Card modal adjustments */
  .card-modal {
    width: 95vw;
    max-height: 90vh;
  }

  .card-modal-portrait-wrap {
    height: 180px;
  }

  .hover-preview {
    display: none !important;
  }
}

/* Treasure card styles */
.treasure-card {
  cursor: pointer;
}
.treasure-card:hover {
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.6);
}

/* TOS card sizing now unified in style.css */

/* Modal action buttons below TOS card */
.card-modal-tos-actions {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1e1a0f, #1a2518);
}

.preview-desc {
  font-size: 0.75rem;
  color: #ccc;
  line-height: 1.4;
  padding: 4px 0;
  font-style: italic;
}

.mini-treasure-type {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d4a855;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 4;
}

/* #2 deploy slot picker: highlight empty front-row slots awaiting a tap, and
   mark the armed standby card. */
.board .zone.deploy-target {
  cursor: pointer;
  outline: 2px dashed #6cf;
  outline-offset: -2px;
  background: rgba(102, 204, 255, 0.18);
  animation: deployPulse 1s ease-in-out infinite;
}
@keyframes deployPulse {
  0%, 100% { background: rgba(102, 204, 255, 0.12); }
  50%      { background: rgba(102, 204, 255, 0.30); }
}
.deploy-armed {
  outline: 2px solid #6cf;
  outline-offset: -2px;
  box-shadow: 0 0 10px rgba(102, 204, 255, 0.7);
}
