/* Bataille / War — a face-off board scoped under .bt-root. Same green-baize feel
   as the Réussites family (per-game texture allowed, ARCHITECTURE.md §6) but its
   own single-column duel layout: computer on top, player below, a fat reveal
   button underneath. Reuses the shared card SVGs via cardNode. */

.bt-root {
  --felt: #1b6b49; --felt-hi: #2a7f5b; --gold: #d8b65c;
  --line: rgba(253, 252, 247, 0.22);
  --cw: clamp(74px, 26vw, 128px);
  --ch: calc(var(--cw) * 1.45);
  --r: calc(var(--cw) * 0.05);
  position: relative;
  padding: clamp(14px, 4vw, 30px) clamp(10px, 3vw, 22px);
  border-radius: var(--radius-md);
  background: var(--felt);
  background-image: radial-gradient(ellipse 78% 64% at 50% 40%, var(--felt-hi), var(--felt) 74%);
  color: #eaf3ed; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(20, 17, 14, 0.25), var(--shadow-sm);
}
@media (prefers-color-scheme: dark) { .bt-root { --felt: #144d36; --felt-hi: #1d6046; } }
.bt-root.mode-dark { --felt: #144d36; --felt-hi: #1d6046; }

.bt-board {
  max-width: calc(var(--cw) * 3.4);
  margin: 0 auto; display: flex; flex-direction: column; align-items: center;
  gap: clamp(10px, 2.6vw, 20px);
}

/* one row = face-down pile + label + the just-revealed card */
.bt-row {
  display: grid; grid-template-columns: var(--cw) 1fr var(--cw);
  align-items: center; gap: clamp(8px, 2.4vw, 18px); width: 100%;
}
.bt-comp { direction: rtl; }
.bt-comp > * { direction: ltr; }
.bt-label {
  text-align: center; font-size: clamp(0.78rem, 3.4vw, 0.98rem);
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(253, 252, 247, 0.72);
}

.bt-pile { position: relative; width: var(--cw); height: var(--ch); }
.bt-pile .card { position: absolute; inset: 0; width: var(--cw); height: var(--ch); border-radius: var(--r); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28); }
.bt-pile.empty .card { opacity: 0; }
.bt-pile.empty { box-shadow: inset 0 0 0 1.5px var(--line); border-radius: var(--r); }
.bt-count {
  position: absolute; inset-inline-end: -6px; inset-block-start: -8px; z-index: 3;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--gold); color: #2a1e05; font-weight: 700; font-size: 0.82rem;
  display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.bt-slot { position: relative; width: var(--cw); height: var(--ch); justify-self: center; }
.bt-slot::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--r);
  border: 1.5px dashed var(--line);
}
.bt-slot .card { position: absolute; inset: 0; width: var(--cw); height: var(--ch); border-radius: var(--r); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
.bt-slot.win .card { outline: 3px solid var(--gold); outline-offset: 2px; }
.bt-slot.war .card { outline: 3px solid #e8604a; outline-offset: 2px; }

.bt-root .cf { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; object-fit: fill; z-index: 2; }

.bt-mid { text-align: center; min-height: 2.6em; display: grid; gap: 4px; place-items: center; }
.bt-msg { font-size: clamp(0.98rem, 4vw, 1.24rem); font-weight: 700; min-height: 1.3em; }
.bt-pot { font-size: clamp(0.76rem, 3vw, 0.9rem); color: rgba(253, 252, 247, 0.66); }
.bt-potn { color: var(--gold); font-weight: 700; }
.bt-potl { text-transform: uppercase; letter-spacing: 0.05em; }

.bt-actions { display: flex; gap: 12px; width: 100%; max-width: calc(var(--cw) * 3.4); }
.bt-btn {
  flex: 1; padding: clamp(11px, 2.6vw, 15px); border-radius: var(--radius-sm, 10px);
  border: 1px solid rgba(20, 17, 14, 0.2); cursor: pointer;
  font-size: clamp(0.92rem, 3.6vw, 1.05rem); font-weight: 700; letter-spacing: 0.02em;
  transition: transform 0.08s ease, filter 0.12s ease;
}
.bt-btn:active { transform: translateY(1px); }
.bt-next { flex: 2; background: var(--gold); color: #2a1e05; }
.bt-next:hover { filter: brightness(1.05); }
.bt-auto { background: rgba(0, 0, 0, 0.22); color: #eaf3ed; border-color: var(--line); }
.bt-auto:hover { filter: brightness(1.12); }
.bt-auto.on { background: rgba(216, 182, 92, 0.24); border-color: rgba(216, 182, 92, 0.5); }
.bt-btn:disabled { opacity: 0.42; cursor: default; }
.bt-btn:disabled:active { transform: none; }

.bt-over .bt-msg { color: var(--gold); }

@media (prefers-reduced-motion: reduce) { .bt-btn { transition: none; } }
.bt-root.no-motion .bt-btn { transition: none; }
