/* THE TWO EDITIONS' COLOURS: Christianity — warm dark brown, gold, parchment; Hannibal vs Rome — dark navy, gold. */
.bt { --bt-bg: #1b1510; --bt-panel: #272016; --bt-btn: #32291b; --bt-line: #4f4027; --bt-gold: #c9a227; --bt-gold-hi: #f2c35e; --bt-dim: #8c7a58; }
.bt.ed-romanwar { --bt-bg: #0d1520; --bt-panel: #15202f; --bt-btn: #1d2b3e; --bt-line: #33475f; --bt-gold: #d9ad3f; --bt-gold-hi: #f0c040; --bt-dim: #6f7f96; }
/* THE BATTLE PLAYER (battle_engine.js) — used by /duel-rules and /battle. */
    .bt-g { color: #1e8e3e; } .bt-r { color: #c62828; }
/* (the rules' table) */
.bt-scale { border-collapse: collapse; margin: 6px 0 4px; font-size: 13px; }
.bt-scale th, .bt-scale td { border: 1px solid #e0d1a4; padding: 3px 9px; text-align: center; } .bt-scale th { font-weight: 600; background: #f3e6c2; }
.bt { background: var(--bt-bg); color: #eee; border-radius: 12px; padding: 12px; margin: 10px 0 4px; user-select: none; }
.bt-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.bt-tabs button, .bt-ctl button { background: var(--bt-btn); color: #eee; border: 1px solid var(--bt-line); border-radius: 7px; padding: 6px 11px; font: inherit; font-size: 14px; cursor: pointer; }
.bt-tabs button.on { background: var(--bt-gold); border-color: var(--bt-gold-hi); }
.bt-field { display: grid; grid-template-columns: 1fr 150px 1fr; gap: 10px; align-items: start; }
.bt-side { background: var(--bt-panel); border-radius: 10px; padding: 8px; min-height: 260px; transition: box-shadow .4s; }
.bt-side.bt-won { box-shadow: 0 0 0 3px #ffd54f, 0 0 22px #ffd54f88; } .bt-side.bt-lost { opacity: .78; }
.bt-side[data-side=evil] .bt-label { color: #ff8a80; } .bt-side[data-side=good] .bt-label { color: #8fd3ff; }
.bt-label { font-weight: 700; font-size: 14px; margin-bottom: 6px; text-align: center; }
.bt-main { display: flex; gap: 10px; align-items: center; justify-content: center; }
.bt-main img { width: 118px; border-radius: 7px; box-shadow: 0 3px 10px #000a; cursor: zoom-in; }
.bt-stats { display: flex; flex-direction: column; gap: 6px; font-weight: 800; }
.bt-stat { min-width: 56px; padding: 4px 8px; border-radius: 8px; font-size: 20px; text-align: center; transition: transform .25s; }
.bt-stat small { display: block; font-size: 10px; font-weight: 600; opacity: .85; }
.bt-stat.g { background: #1e8e3e; } .bt-stat.r { background: #b71c1c; }
.bt-stat.bump { transform: scale(1.28); } .bt-stat.hit { outline: 3px solid #ffd54f; }
.bt-ctr { font-size: 11px; text-align: center; color: #ffcc80; min-height: 14px; }
.bt-pool { display: flex; flex-wrap: wrap; gap: 6px 8px; justify-content: center; margin-top: 10px; }
.bt-src { position: relative; width: 52px; height: 72px; transition: transform .5s, opacity .5s; }
.bt-src img { width: 52px; height: 72px; object-fit: cover; border-radius: 4px; }
.bt-src.rot { transform: rotate(90deg) scale(.86); opacity: .75; margin: 0 12px; }
.bt-src .pw { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); background: #000c; font-size: 10px; padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.bt-src.rot .pw { display: none; }
.bt-pop { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 15px; padding: 1px 6px; border-radius: 6px; white-space: nowrap; animation: btpop 1.4s ease-out forwards; pointer-events: none; z-index: 2; }
.bt-pop { background: var(--bt-gold); }
@keyframes btpop { 0% { opacity: 0; top: 10px; } 20% { opacity: 1; top: -18px; } 80% { opacity: 1; } 100% { opacity: 0; top: -34px; } }
.bt-mid { display: flex; align-items: center; justify-content: center; min-height: 260px; }
.bt-clash { text-align: center; font-size: 13px; line-height: 1.35; }
.bt-clash .eq { display: block; margin: 6px 0; padding: 6px; border-radius: 8px; background: var(--bt-btn); font-size: 15px; font-weight: 700; }
.bt-clash .eq.best { background: #ffd54f; color: #222; }
.bt-clash .vs { font-size: 34px; }
.bt-scl { display: flex; align-items: stretch; gap: 6px; margin: 12px 0 0; flex-wrap: wrap; }
.bt-scl-h { align-self: center; font-weight: 700; font-size: 13px; margin-right: 4px; }
.bt-band { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 74px; padding: 4px 8px; border-radius: 8px;
           background: var(--bt-btn); border: 2px solid var(--bt-line); transition: all .35s; }
.bt-band small { font-size: 11px; opacity: .8; white-space: nowrap; } .bt-band b { font-size: 18px; }
.bt-band.on { background: #ffd54f; color: #222; border-color: #fff3c4; transform: translateY(-3px); box-shadow: 0 4px 14px #ffd54f66; }
.bt-scl-note { align-self: center; font-size: 13px; color: #ffd54f; margin-left: 4px; }
.bt.full .bt-band { min-width: 11vh; padding: .8vh 1vw; } .bt.full .bt-band small { font-size: 1.4vh; } .bt.full .bt-band b { font-size: 3vh; }
.bt.full .bt-scl-h, .bt.full .bt-scl-note { font-size: 1.9vh; }
.bt-say { margin: 12px 4px 8px; min-height: 44px; font-size: 15.5px; line-height: 1.4; }
.bt-say b.e { color: #ff8a80; } .bt-say b.gd { color: #8fd3ff; }
.bt-ctl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bt-ctl .bt-play { min-width: 92px; background: var(--bt-gold); border-color: var(--bt-gold-hi); }
.bt-dots { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.bt-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--bt-line); cursor: pointer; } .bt-dots i.on { background: #ffd54f; } .bt-dots i.past { background: var(--bt-dim); }
.bt-winbtn { margin-left: auto; }
/* FULL SCREEN: the table fills the screen, the cards and numbers grown to match. */
.bt:fullscreen { border-radius: 0; padding: 2.2vh 3vw; display: flex; flex-direction: column; overflow: auto; }
.bt:-webkit-full-screen { border-radius: 0; padding: 2.2vh 3vw; display: flex; flex-direction: column; overflow: auto; }
.bt.pseudo { position: fixed; inset: 0; z-index: 9000; margin: 0; border-radius: 0; padding: 2.2vh 3vw; display: flex; flex-direction: column; overflow: auto; }
.bt.full .bt-field { flex: 1; grid-template-columns: 1fr 22vw 1fr; gap: 2vw; }
.bt.full .bt-side { min-height: 0; padding: 1.6vh 1vw; }
.bt.full .bt-label { font-size: 2.4vh; }
.bt.full .bt-main img { width: auto; height: 38vh; }
.bt.full .bt-stat { font-size: 4.4vh; min-width: 9vh; } .bt.full .bt-stat small { font-size: 1.4vh; }
.bt.full .bt-ctr { font-size: 1.7vh; }
.bt.full .bt-src, .bt.full .bt-src img { width: 9vh; height: 12.5vh; } .bt.full .bt-src .pw { font-size: 1.3vh; }
.bt.full .bt-src.rot { margin: 0 2.2vh; }
.bt.full .bt-pop { font-size: 2.6vh; }
.bt.full .bt-mid { min-height: 0; } .bt.full .bt-clash { font-size: 2vh; } .bt.full .bt-clash .eq { font-size: 2.6vh; } .bt.full .bt-clash .vs { font-size: 7vh; }
.bt.full .bt-say { font-size: 2.5vh; min-height: 7vh; }
.bt.full .bt-tabs button, .bt.full .bt-ctl button { font-size: 1.9vh; padding: .8vh 1.2vw; }
@media (max-width: 720px) { .bt-field { grid-template-columns: 1fr; } .bt-mid { min-height: 0; } }
.bt-print { display: none; }
@media print {
  .bt { display: none; }
  .bt-print { display: block; }
  .bt-print h4 { margin: 12px 0 4px; font-size: 14px; break-after: avoid; }
  .bt-print .bt-pcards { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 6px; break-inside: avoid; }
  .bt-print .bt-pcards figure { margin: 0; text-align: center; font-size: 11px; width: 92px; }
  .bt-print .bt-pcards img { width: 92px; border-radius: 5px; filter: grayscale(1) contrast(.9) brightness(1.15); }
  .bt-print ol { margin: 2px 0 8px; padding-left: 22px; font-size: 12.5px; } .bt-print li { margin: 1px 0; break-inside: avoid; }
  .bt-print .ex { break-inside: avoid-page; }
}

.bt-pooln { text-align: center; font-size: 13px; color: #ffd54f; min-height: 16px; margin-top: 6px; }
.bt-coin { width: 52px; height: 72px; border-radius: 6px; background: radial-gradient(circle at 40% 35%, #ffe082, #c99a2e); color: #3a2a00; font-weight: 800; font-size: 13px;
           display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.bt-src.rot .bt-coin { opacity: .6; }
.bt-cardwrap { position: relative; }
.bt-cardwrap.gone img { filter: grayscale(1) brightness(.5); }
.bt-gone { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); background: #b71c1c; color: #fff; font-weight: 800; padding: 3px 10px; border-radius: 6px; font-size: 15px; }
.bt-hurt { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: #000d; color: #ffab91; font-weight: 800; font-size: 13px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; animation: btpop2 .6s ease-out; }
@keyframes btpop2 { 0% { transform: translateX(-50%) scale(.4); } 100% { transform: translateX(-50%) scale(1); } }
.bt-rw { margin-top: 6px; font-size: 13px; }
.bt-band b { font-size: 16px; }
.bt.full .bt-pooln { font-size: 2vh; } .bt.full .bt-coin { width: 9vh; height: 12.5vh; font-size: 2vh; } .bt.full .bt-hurt, .bt.full .bt-gone { font-size: 2.2vh; } .bt.full .bt-rw { font-size: 1.9vh; }

/* THE FIGHT'S EFFECTS (battle_engine.js fx) */
.bt-side { position: relative; overflow: visible; }
.bt-cardwrap { transition: transform .2s; }
.fx-glow { animation: fxglow .8s ease-out; }
@keyframes fxglow { 0% { filter: drop-shadow(0 0 0 #ffd54f); } 40% { filter: drop-shadow(0 0 18px #ffd54f); } 100% { filter: drop-shadow(0 0 0 #ffd54f); } }
.fx-lunge-r { animation: fxlungeR .8s cubic-bezier(.3,.0,.2,1); z-index: 5; }
.fx-lunge-l { animation: fxlungeL .8s cubic-bezier(.3,.0,.2,1); z-index: 5; }
@keyframes fxlungeR { 0% { transform: none; } 25% { transform: translateX(-14px) rotate(-3deg); } 45% { transform: translateX(90px) rotate(6deg) scale(1.08); } 100% { transform: none; } }
@keyframes fxlungeL { 0% { transform: none; } 25% { transform: translateX(14px) rotate(3deg); } 45% { transform: translateX(-90px) rotate(-6deg) scale(1.08); } 100% { transform: none; } }
.fx-shake { animation: fxshake .6s; }
@keyframes fxshake { 0%,100% { transform: none; } 15% { transform: translateX(-9px) rotate(-2deg); } 30% { transform: translateX(8px) rotate(2deg); } 45% { transform: translateX(-6px); } 60% { transform: translateX(5px); } 75% { transform: translateX(-2px); } }
.fx-quake { animation: fxquake .45s; }
@keyframes fxquake { 0%,100% { transform: none; } 20% { transform: translate(3px,-2px); } 40% { transform: translate(-3px,2px); } 60% { transform: translate(2px,1px); } 80% { transform: translate(-1px,-1px); } }
.bt-mid { position: relative; }
.bt-slash { position: absolute; left: 50%; top: 45%; width: 260px; height: 10px; margin-left: -130px; border-radius: 10px; pointer-events: none; z-index: 6;
  background: linear-gradient(90deg, transparent, #fff 40%, #ffd54f 60%, transparent); box-shadow: 0 0 22px #ffd54f, 0 0 40px #ff8a80; animation: fxslash .7s ease-out forwards; }
.bt-slash.lr { transform: rotate(-28deg); } .bt-slash.rl { transform: rotate(28deg); }
@keyframes fxslash { 0% { opacity: 0; clip-path: inset(0 100% 0 0); } 30% { opacity: 1; clip-path: inset(0 0 0 0); } 100% { opacity: 0; clip-path: inset(0 0 0 100%); } }
.bt-float { position: absolute; top: 30%; font-weight: 900; font-size: 26px; pointer-events: none; z-index: 7; white-space: nowrap; transform: translateX(-50%);
  text-shadow: 0 2px 0 #000, 0 0 12px #000; animation: fxfloat 1.5s ease-out forwards; }
.bt-float.hit { color: #ffd54f; } .bt-float.weak { color: #ff8a80; font-size: 20px; }
@keyframes fxfloat { 0% { opacity: 0; margin-top: 20px; transform: translateX(-50%) scale(.5); } 20% { opacity: 1; transform: translateX(-50%) scale(1.25); } 100% { opacity: 0; margin-top: -70px; transform: translateX(-50%) scale(1); } }
.bt-spark { position: absolute; left: 50%; top: 45%; width: 7px; height: 7px; border-radius: 50%; background: #ffd54f; box-shadow: 0 0 8px #ff9800; pointer-events: none; z-index: 6;
  animation: fxspark .8s ease-out forwards; }
.bt-spark.big { width: 10px; height: 10px; background: #bbb; box-shadow: 0 0 6px #fff; border-radius: 2px; }
@keyframes fxspark { 0% { transform: translate(0,0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.2) rotate(200deg); opacity: 0; } }
.fx-win { animation: fxwin 1.4s ease-out; }
@keyframes fxwin { 0% { box-shadow: 0 0 0 3px #ffd54f, 0 0 0 #ffd54f; } 30% { box-shadow: 0 0 0 6px #ffd54f, 0 0 60px #ffd54f; } 100% { box-shadow: 0 0 0 3px #ffd54f, 0 0 22px #ffd54f88; } }
.bt-conf { position: absolute; top: -8px; width: 8px; height: 13px; border-radius: 2px; pointer-events: none; z-index: 8; animation: fxconf 1.8s ease-in forwards; }
@keyframes fxconf { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), 330px) rotate(var(--rot)); opacity: 0; } }
.fx-shatter { animation: fxshatter 1.3s ease-out; }
@keyframes fxshatter { 0% { transform: none; filter: none; } 20% { transform: scale(1.1) rotate(-4deg); filter: brightness(2); } 45% { transform: scale(.95) rotate(5deg); filter: brightness(.8) grayscale(.5); }
  100% { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .fx-lunge-r, .fx-lunge-l, .fx-shake, .fx-quake, .fx-shatter { animation: none; } .bt-conf, .bt-spark { display: none; } }

.bt-tabs button.on, .bt-ctl .bt-play { color: #1a1408; font-weight: 700; }
.bt .bt-pop { color: #1a1408; }
