:root {
  --bg: #0f1218;
  --panel: #171c24;
  --panel-2: #202735;
  --text: #f3f5f7;
  --muted: #9ea8b7;
  --line: #303948;
  --accent: #f1c75b;
  --danger: #e15d64;
  --ok: #77c98f;
  --tile: #2a3240;
  --tile-back: #1c2230;
  --shadow: 0 16px 40px rgba(0,0,0,.34);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top, #1a2030 0, var(--bg) 42rem); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer; color: var(--text); background: var(--panel-2); transition: transform .12s ease, filter .12s ease, opacity .12s ease; }
button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
button:disabled { opacity: .42; cursor: not-allowed; }
button.primary { background: var(--accent); color: #1b1a14; font-weight: 800; }
button.secondary { background: #2b3444; }
button.danger { background: var(--danger); color: white; }
button.ghost { background: transparent; border: 1px solid var(--line); }
button.big { width: 100%; padding: 14px 18px; margin-top: 12px; }
button.small { padding: 6px 9px; font-size: 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .17em; }
h1,h2,h3,p { margin-top: 0; }
.topbar { max-width: 1320px; margin: 0 auto; padding: 20px 24px 8px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.topbar h1 { margin: 4px 0 0; font-size: clamp(28px, 4vw, 42px); }
.top-actions { display: flex; gap: 8px; }
.view { max-width: 1320px; margin: 0 auto; padding: 18px 24px 36px; }
.setup-view { display: grid; min-height: calc(100vh - 100px); place-items: start center; padding-top: 7vh; }
.panel { background: rgba(23,28,36,.94); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.setup-card { width: min(620px, 100%); padding: 24px; }
.field { display: grid; gap: 8px; margin: 18px 0; }
.field span { font-size: 13px; font-weight: 800; color: var(--muted); }
select, input[type="text"] { width: 100%; background: #0f141d; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.player-setup-rows { display: grid; gap: 10px; }
.player-setup-row { display: grid; grid-template-columns: minmax(180px,1fr) 130px 115px; gap: 10px; }
.status-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.status-strip > div { background: rgba(23,28,36,.9); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; }
.status-strip .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.arena { position: relative; min-height: 850px; display: grid; place-items: center; }
.board-wrap { width: min(760px, 70vw); z-index: 2; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.turn-prompt { font-weight: 850; font-size: 18px; }
.board-actions { display: flex; gap: 8px; }
.board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; background: #0c1016; padding: 9px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.cell { position: relative; aspect-ratio: 1; min-width: 0; border-radius: 12px; border: 1px solid #3a4557; background: var(--tile); display: grid; place-items: center; overflow: hidden; user-select: none; }
.cell.clickable { cursor: pointer; outline: 2px solid rgba(241,199,91,.7); outline-offset: -3px; }
.cell.clickable:hover { filter: brightness(1.18); }
.cell.void { background: repeating-linear-gradient(135deg,#090c11 0 8px,#121722 8px 16px); border-color: #242b36; }
.cell .coord { position: absolute; top: 5px; left: 6px; color: rgba(255,255,255,.35); font-size: 9px; }
.tile-face { text-align: center; padding: 6px; width: 100%; }
.tile-icon { font-size: clamp(18px, 3vw, 32px); line-height: 1; margin-bottom: 4px; }
.tile-name { font-weight: 900; font-size: clamp(9px, 1.35vw, 13px); line-height: 1.05; }
.tile-back { width: 70%; height: 70%; border-radius: 11px; border: 2px solid #586278; background: linear-gradient(135deg,#222a39,#111722); display: grid; place-items: center; font-weight: 950; font-size: 22px; color: #7d899d; }
.tile-blank { background: #2d3440; }
.tile-event { background: #2f6f50; }
.tile-chest { background: #7c5b2e; }
.tile-weapon { background: #7b3339; }
.tile-shield { background: #315a7d; }
.tile-magic { background: #5b3f81; }
.pawn-stack { position: absolute; right: 4px; bottom: 4px; display: flex; flex-wrap: wrap-reverse; gap: 2px; max-width: 70%; justify-content: flex-end; }
.pawn { width: 16px; height: 16px; border-radius: 50%; border: 2px solid white; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.move-controls { margin-top: 12px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.move-help { text-align: center; min-height: 24px; padding-top: 8px; font-size: 13px; }
.player-ring { position: absolute; inset: 0; pointer-events: none; }
.player-panel { position: absolute; width: 215px; background: rgba(23,28,36,.96); border: 2px solid var(--line); border-radius: 16px; padding: 12px; pointer-events: auto; box-shadow: 0 10px 28px rgba(0,0,0,.25); transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.player-panel.active { border-color: var(--player-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--player-color) 35%, transparent), 0 12px 34px rgba(0,0,0,.4); transform: scale(1.03); }
.player-panel.dead { opacity: .55; filter: grayscale(.35); }
.player-panel.absent { opacity: .72; border-style: dashed; }
.player-panel.slot-0 { top: 8px; left: 2%; }
.player-panel.slot-1 { top: 8px; right: 2%; }
.player-panel.slot-2 { right: 0; top: 50%; transform: translateY(-50%); }
.player-panel.slot-2.active { transform: translateY(-50%) scale(1.03); }
.player-panel.slot-3 { right: 2%; bottom: 8px; }
.player-panel.slot-4 { left: 2%; bottom: 8px; }
.player-panel.slot-5 { left: 0; top: 50%; transform: translateY(-50%); }
.player-panel.slot-5.active { transform: translateY(-50%) scale(1.03); }
.player-head { display: flex; align-items: center; gap: 9px; }
.player-token { width: 22px; height: 22px; border-radius: 50%; border: 2px solid white; background: var(--player-color); flex: 0 0 auto; }
.player-name { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-health { margin-left: auto; font-weight: 900; }
.public-hand { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.card-stack { min-height: 54px; border-radius: 9px; background: repeating-linear-gradient(135deg,#111722 0 6px,#202938 6px 12px); border: 1px solid #49556a; padding: 8px; display: grid; place-items: center; text-align: center; }
.card-stack strong { display: block; font-size: 18px; }
.card-stack span { font-size: 10px; color: #c3cad4; text-transform: uppercase; letter-spacing: .07em; }
.status-mini { margin-top: 7px; font-size: 11px; color: var(--muted); min-height: 16px; }
.log-panel { margin-top: 16px; padding: 14px 16px; }
.log-head { display: flex; justify-content: space-between; align-items: center; }
.log-head h3 { margin: 0; }
.game-log { max-height: 210px; overflow: auto; margin-top: 10px; display: grid; gap: 5px; font-size: 13px; }
.log-line { padding-bottom: 5px; border-bottom: 1px solid rgba(255,255,255,.05); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(5,8,12,.82); display: grid; place-items: center; padding: 18px; z-index: 50; backdrop-filter: blur(6px); }
.modal { width: min(720px, 100%); max-height: 90vh; overflow: auto; background: #171d27; border: 1px solid #3a4557; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.55); padding: 22px; }
.modal h2 { margin-bottom: 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 9px; margin-top: 14px; }
.choice { text-align: left; min-height: 72px; border: 1px solid var(--line); background: #202836; }
.choice strong, .choice span { display: block; }
.choice span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.choice.selected { outline: 2px solid var(--accent); }
.hand-section { margin-top: 16px; }
.hand-section h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.hand-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 8px; }
.hand-card { border: 1px solid var(--line); border-radius: 12px; background: #222a38; padding: 11px; min-height: 80px; }
.card-title { font-weight: 900; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 5px; }
.pass-screen { text-align: center; padding: 24px 8px; }
.pass-screen .token-big { width: 72px; height: 72px; margin: 10px auto 16px; border-radius: 50%; border: 4px solid white; background: var(--pass-color); }
.reveal-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-top: 16px; }
.reveal-card { border-radius: 14px; border: 1px solid var(--line); padding: 14px; background: #222a38; }
.vs { display: grid; place-items: center; font-weight: 950; color: var(--accent); }
.toast { color: var(--accent); font-weight: 800; }
.rules-list { display: grid; gap: 8px; font-size: 14px; }
.death-strip { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.death-chip { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; font-size: 11px; }

@media (max-width: 1000px) {
  .arena { min-height: 0; display: block; }
  .board-wrap { width: min(760px, 100%); margin: 0 auto; }
  .player-ring { position: static; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
  .player-panel, .player-panel.slot-0, .player-panel.slot-1, .player-panel.slot-2, .player-panel.slot-3, .player-panel.slot-4, .player-panel.slot-5 { position: static; width: auto; transform: none; }
  .player-panel.slot-2.active, .player-panel.slot-5.active { transform: scale(1.02); }
}
@media (max-width: 640px) {
  .topbar, .view { padding-left: 12px; padding-right: 12px; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-direction: column; }
  .status-strip { grid-template-columns: repeat(2,1fr); }
  .board { gap: 4px; padding: 5px; border-radius: 12px; }
  .cell { border-radius: 8px; }
  .tile-name { font-size: 8px; }
  .tile-icon { font-size: 20px; }
  .player-ring { grid-template-columns: 1fr; }
  .player-setup-row { grid-template-columns: 1fr; }
  .board-head { align-items: flex-start; flex-direction: column; }
  .reveal-row { grid-template-columns: 1fr; }
  .vs { min-height: 20px; }
}

/* --- Physical card artwork integration --- */
.board {
  gap: 10px;
  padding: 10px 15px 15px 10px;
  overflow: visible;
}
.cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  display: block;
  overflow: visible;
  user-select: none;
}
.cell .coord { display: none !important; }
.cell.void {
  overflow: hidden;
  background: repeating-linear-gradient(135deg,#090c11 0 8px,#121722 8px 16px);
  border: 1px solid #242b36;
}
.tile-layer {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  pointer-events: none;
  background: #4e4e4e;
}
.tile-layer img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.tile-under {
  z-index: 0;
  transform: translate(5px, 5px);
  box-shadow: 0 3px 8px rgba(0,0,0,.38);
}
.tile-top {
  z-index: 1;
  box-shadow: 0 2px 7px rgba(0,0,0,.38);
}
.cell.clickable { cursor: pointer; outline: none; }
.cell.clickable .tile-top {
  box-shadow: 0 0 0 3px rgba(241,199,91,.78), 0 2px 8px rgba(0,0,0,.45);
}
.cell.clickable:hover .tile-top { filter: brightness(1.08); }
.cell.selected-cell .tile-top {
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px rgba(241,199,91,.92), 0 3px 10px rgba(0,0,0,.5);
}
.tile-face, .tile-icon, .tile-name, .tile-back { display: none !important; }
.pawn-stack { z-index: 5; right: 3px; bottom: 3px; }

.public-hand { align-items: stretch; }
.card-stack.public-card-stack {
  position: relative;
  min-height: 70px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.public-card-stack > img {
  height: 68px;
  width: auto;
  max-width: 68%;
  object-fit: cover;
  border-radius: 5px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 2px 7px rgba(0,0,0,.42);
}
.public-card-count {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 40px;
  padding: 4px 6px;
  border-radius: 9px;
  background: rgba(10,13,18,.9);
  border: 1px solid #566174;
  text-align: center;
  box-shadow: 0 2px 7px rgba(0,0,0,.35);
}
.public-card-count strong { display: block; font-size: 16px; line-height: 1; }
.public-card-count span { display: block; margin-top: 2px; font-size: 8px; color: #c3cad4; text-transform: uppercase; letter-spacing: .06em; }

.hand-grid { grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 12px; }
.hand-card.art-hand-card {
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}
.hand-card-art {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  background: #111722;
}
.art-hand-card .card-title { margin-top: 2px; }

.choice.choice-with-art {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px;
}
.choice-art {
  flex: 0 0 auto;
  width: 62px;
  height: 86px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,.35);
  background: #121722;
}
.choice-copy { min-width: 0; flex: 1; }
.choice-copy strong, .choice-copy span { display: block; }
.choice.selected { box-shadow: inset 0 0 0 2px var(--accent); }

.card-notice {
  display: grid;
  grid-template-columns: minmax(150px, 270px) 1fr;
  gap: 20px;
  align-items: center;
}
.notice-card-art {
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  background: #111722;
}
.card-notice-copy h2 { margin-top: 5px; }

.combat-art-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}
.combat-card-art {
  width: min(110px, 46%);
  max-height: 155px;
  object-fit: contain;
  border-radius: 7px;
  background: #111722;
  box-shadow: 0 3px 9px rgba(0,0,0,.32);
}
.peek-card { text-align: center; }
.peek-tile-art {
  width: min(150px,100%);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin: 0 auto 8px;
}

@media (max-width: 640px) {
  .board { gap: 7px; padding: 6px 11px 11px 6px; }
  .tile-under { transform: translate(4px,4px); }
  .card-notice { grid-template-columns: 1fr; text-align: center; }
  .notice-card-art { width: min(270px,75vw); margin: 0 auto; }
  .choice.choice-with-art { flex-direction: column; }
  .choice-art { width: 100%; height: 140px; object-fit: contain; }
}


/* --- v15 interaction polish --- */
.board-wrap { position: relative; }

/* A two-card stack keeps its existing offset. A lone tile is shifted by half
   that amount so the visible single card is centered against the full stack footprint. */
.cell:not(.has-under-tile):not(.void) .tile-top {
  transform: translate(2.5px, 2.5px);
}

/* Adjacent void spaces become the voluntary-enter target during movement. */
.cell.void.clickable {
  cursor: pointer;
  outline: 2px solid rgba(225,93,100,.9);
  outline-offset: -3px;
}
.cell.void.clickable:hover {
  filter: brightness(1.28);
}

/* Card names stay centered and resize by line instead of breaking words. */
.choice-copy,
.card-title {
  min-width: 0;
  max-width: 100%;
}
.choice-copy > span,
.rule-card strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.adaptive-card-title {
  --adaptive-title-size: 16px;
  --adaptive-title-min: 8px;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 900;
  line-height: 1.04;
  overflow: hidden;
}
.adaptive-title-line {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  text-align: center;
}
.choice-copy .adaptive-card-title { margin-bottom: 4px; }
.art-hand-card .adaptive-card-title {
  --adaptive-title-size: 17px;
  --adaptive-title-min: 9px;
  margin-top: 2px;
}

/* Health gain/loss feedback. */
.player-health { position: relative; }
.health-pop {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  font-weight: 950;
  font-size: 22px;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
  animation: healthFloat .7s ease-out forwards;
}
.health-pop.gain { color: #8fe0a5; }
.health-pop.loss { color: #ff858c; }
.player-health.health-pulse-gain { animation: healthPulseGain .55s ease; }
.player-health.health-pulse-loss { animation: healthPulseLoss .55s ease; }
@keyframes healthFloat {
  0% { opacity: 0; transform: translate(-50%,8px) scale(.85); }
  20% { opacity: 1; transform: translate(-50%,0) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%,-28px) scale(1); }
}
@keyframes healthPulseGain {
  0%,100% { transform: scale(1); }
  45% { transform: scale(1.22); color: #8fe0a5; }
}
@keyframes healthPulseLoss {
  0%,100% { transform: scale(1); }
  45% { transform: scale(1.22); color: #ff858c; }
}

/* Dice feedback for Random Potion and coordinate decay. */
.board-flash {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 35;
  transform: translate(-50%,-50%) scale(.8);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(10,13,18,.94);
  border: 1px solid #59657a;
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
  transition: opacity .16s ease, transform .16s ease;
}
.board-flash.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.flash-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.die-face {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f5f5f2;
  color: #16181d;
  border: 2px solid #b9bdc3;
  font-weight: 950;
  font-size: 24px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
}
.die-times { color: var(--accent); font-weight: 950; font-size: 18px; }

/* Tile removal/lock poof. */
.cell.tile-poof .tile-top,
.cell.tile-poof .tile-under {
  animation: tilePoof .48s ease-in forwards;
}
.tile-poof-marker {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  font-size: clamp(24px,4vw,42px);
  pointer-events: none;
  animation: poofMarker .48s ease-out forwards;
}
.tile-poof-marker.lock-poof { font-size: clamp(22px,3.5vw,36px); }
@keyframes tilePoof {
  0% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
  65% { opacity: .35; transform: scale(.72) rotate(4deg); filter: blur(1px); }
  100% { opacity: 0; transform: scale(.28) rotate(-7deg); filter: blur(4px); }
}
@keyframes poofMarker {
  0% { opacity: 0; transform: scale(.4); }
  35% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.65); }
}

/* Peeker: fold away the public top card, briefly show the hidden card, then restore. */
.tile-top {
  transition: transform .22s ease, opacity .22s ease;
  transform-origin: center;
  backface-visibility: hidden;
}
.cell.has-under-tile .tile-top.peek-hide { transform: rotateY(90deg); opacity: .2; }
.cell:not(.has-under-tile):not(.void) .tile-top.peek-hide { transform: translate(2.5px,2.5px) rotateY(90deg); opacity: .2; }
.peek-temporary {
  position: absolute;
  inset: 0;
  z-index: 12;
  overflow: hidden;
  border-radius: 10px;
  transform: rotateY(-90deg);
  opacity: .2;
  transition: transform .22s ease, opacity .22s ease;
  backface-visibility: hidden;
  background: #4e4e4e;
  pointer-events: none;
}
.peek-temporary.show { transform: rotateY(0); opacity: 1; }
.peek-temporary.single-peek { transform: translate(2.5px,2.5px) rotateY(-90deg); }
.peek-temporary.single-peek.show { transform: translate(2.5px,2.5px) rotateY(0); }
.peek-temporary-art { width: 100%; height: 100%; display: block; object-fit: cover; }

/* Full rules page. */
.full-rules { line-height: 1.5; }
.full-rules h3 {
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--accent);
}
.full-rules p { color: #d8dde6; }
.rule-card-grid { display: grid; gap: 10px; }
.rule-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #202836;
  padding: 12px 14px;
}
.rule-card p { margin: 5px 0 0; color: #c7ced9; font-size: 13px; }
.rules-table-wrap { overflow-x: auto; }
.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rules-table th,
.rules-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.rules-table th { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }

@media (max-width: 640px) {
  .cell:not(.has-under-tile):not(.void) .tile-top { transform: translate(2px,2px); }
  .cell:not(.has-under-tile):not(.void) .tile-top.peek-hide { transform: translate(2px,2px) rotateY(90deg); }
  .peek-temporary.single-peek { transform: translate(2px,2px) rotateY(-90deg); }
  .peek-temporary.single-peek.show { transform: translate(2px,2px) rotateY(0); }
  .board-flash { padding: 9px 12px; gap: 7px; }
  .die-face { width: 40px; height: 40px; font-size: 20px; }
}


/* Preserve the stack offsets during the poof animation. */
.cell.tile-poof .tile-top { animation: tilePoofTop .48s ease-in forwards; }
.cell.tile-poof .tile-under { animation: none; }
.cell.void.tile-poof { animation: voidPoof .48s ease-in-out; }
@keyframes tilePoofTop {
  0% { opacity: 1; transform: translate(var(--poof-x,0px),var(--poof-y,0px)) scale(1) rotate(0); filter: blur(0); }
  65% { opacity: .35; transform: translate(var(--poof-x,0px),var(--poof-y,0px)) scale(.72) rotate(4deg); filter: blur(1px); }
  100% { opacity: 0; transform: translate(var(--poof-x,0px),var(--poof-y,0px)) scale(.28) rotate(-7deg); filter: blur(4px); }
}
@keyframes tilePoofUnder {
  0% { opacity: 1; transform: translate(5px,5px) scale(1) rotate(0); filter: blur(0); }
  65% { opacity: .35; transform: translate(5px,5px) scale(.72) rotate(-4deg); filter: blur(1px); }
  100% { opacity: 0; transform: translate(5px,5px) scale(.28) rotate(7deg); filter: blur(4px); }
}
@keyframes voidPoof {
  0%,100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.65); transform: scale(.94); }
}
.cell:not(.has-under-tile):not(.void) .tile-top {
  --poof-x: 2.5px;
  --poof-y: 2.5px;
}
@media (max-width: 640px) {
  .cell:not(.has-under-tile):not(.void) .tile-top {
    --poof-x: 2px;
    --poof-y: 2px;
  }
  @keyframes tilePoofUnder {
    0% { opacity: 1; transform: translate(4px,4px) scale(1) rotate(0); filter: blur(0); }
    65% { opacity: .35; transform: translate(4px,4px) scale(.72) rotate(-4deg); filter: blur(1px); }
    100% { opacity: 0; transform: translate(4px,4px) scale(.28) rotate(7deg); filter: blur(4px); }
  }
}

.player-setup-row input:disabled { opacity:.78; color:#cbd3df; cursor:not-allowed; }
.player-panel .status-mini { line-height:1.35; }

/* Readable public feedback for automatic bot actions. */
.bot-action-flash {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 45;
  width: min(500px, calc(100vw - 32px));
  transform: translate(-50%,-50%) scale(.92);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15,19,27,.97);
  border: 1px solid #66738a;
  box-shadow: 0 20px 55px rgba(0,0,0,.62);
  transition: opacity .16s ease, transform .16s ease;
}
.bot-action-flash.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.bot-action-art {
  width: 72px;
  max-height: 102px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 8px;
}
.bot-action-copy { min-width: 0; display: grid; gap: 4px; }
.bot-action-copy strong { font-size: 20px; line-height: 1.1; }
.bot-action-copy > span:last-child { color: var(--muted); line-height: 1.35; }
.bot-action-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.combat-effects {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #3a4557;
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  line-height: 1.45;
}
.combat-effects strong { display: block; margin-bottom: 5px; }
.combat-result { font-size: 17px; line-height: 1.45; }

@media (max-width: 600px) {
  .bot-action-flash { padding: 11px 12px; gap: 10px; }
  .bot-action-art { width: 58px; max-height: 84px; }
  .bot-action-copy strong { font-size: 17px; }
  .bot-action-copy > span:last-child { font-size: 12px; }
}
