:root {
  --bg: #14110d;
  --panel: #211b13;
  --panel2: #2c2418;
  --ink: #efe6d2;
  --muted: #9c9079;
  --gold: #e8b84b;
  --melee: #d98b5f;
  --ranged: #6fb6d9;
  --win: #7bd97b;
  --lose: #d96f6f;
  --accent: #b5803a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: linear-gradient(180deg, #2c2418, #1b160f);
  border-bottom: 1px solid #3a2f1e;
}
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 14px 0 6px; }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }
main { max-width: 1000px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--panel); border: 1px solid #3a2f1e; border-radius: 10px; padding: 14px; }
.hidden { display: none; }
.scene-bar { display: flex; align-items: center; gap: 12px; }
.scene-label {
  font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 6px; background: var(--panel2); color: var(--gold);
}
.spacer { flex: 1; }
.econ { display: flex; gap: 14px; font-variant-numeric: tabular-nums; }
.econ b { color: var(--gold); }
.seed input { width: 70px; background: #1b160f; color: var(--ink); border: 1px solid #3a2f1e; border-radius: 6px; padding: 4px; }
button {
  background: var(--panel2); color: var(--ink); border: 1px solid #4a3c26;
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--gold); color: #1b160f; font-weight: 700; }
.shop-head { display: flex; align-items: center; justify-content: space-between; }
.shop-actions { display: flex; gap: 8px; }
.offers { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.board { display: flex; flex-wrap: wrap; gap: 8px; min-height: 56px; }
.card {
  background: var(--panel2); border: 1px solid #4a3c26; border-radius: 8px;
  padding: 8px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; min-height: 86px;
}
.card.empty { opacity: .35; align-items: center; justify-content: center; }
.card .name { font-weight: 700; }
.card .cost { color: var(--gold); }
.card.melee { border-left: 3px solid var(--melee); }
.card.ranged { border-left: 3px solid var(--ranged); }
.card .tag { font-size: 10px; color: var(--muted); }
.card button { margin-top: auto; padding: 3px 6px; font-size: 11px; }
.board .card { width: 110px; }
.combat-log { max-height: 220px; overflow-y: auto; font-family: ui-monospace, monospace; font-size: 12px; }
.row { display: flex; gap: 8px; padding: 1px 0; }
.row .t { color: var(--muted); width: 48px; text-align: right; }
.row .persp { color: var(--ranged); }
.row .opp { color: var(--melee); }
.kind-shock_tick, .kind-burn_tick, .kind-bleed_tick, .kind-poison_tick { color: var(--gold); }
.history { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.history .h { display: flex; gap: 10px; padding: 4px 8px; border-radius: 6px; background: var(--panel2); }
.history .win { color: var(--win); }
.history .lose { color: var(--lose); }
textarea {
  width: 100%; background: #1b160f; color: var(--ink); border: 1px solid #3a2f1e;
  border-radius: 6px; padding: 8px; font-family: ui-monospace, monospace; font-size: 12px; resize: vertical;
}
.tourney-actions { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.tourney-results .h .wr { color: var(--gold); font-variant-numeric: tabular-nums; }
.bar { display: inline-block; height: 8px; background: var(--accent); border-radius: 4px; vertical-align: middle; }
code { background: var(--panel2); padding: 1px 4px; border-radius: 3px; }
footer { text-align: center; padding: 16px; }
