:root {
  --bg: #1b2a1a; --bg2: #24361f; --panel: #2b2418; --panel2: #3a3022; --line: #5a4a30; --text: #f3ead6; --muted: #b8a98a;
  --accent: #ffc742; --blue: #3f8ae6; --red: #e0503f; --blue-l: #8cc4ff; --red-l: #ff9a8a;
  --paper: #f5e8c8; --paper2: #e9d8b0; --ink: #2b1d0e; --paper-edge: #8a6b3a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { background: radial-gradient(ellipse at top, #2e4a28 0%, var(--bg) 60%); }
#app { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
h1 { font-size: 26px; margin: 0; letter-spacing: .02em; }
h2 { font-size: 20px; margin: 0 0 8px; }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
.btn { border: 2px solid var(--line); background: var(--panel2); color: var(--text); border-radius: 12px; padding: 10px 16px; font-weight: 600; box-shadow: 0 3px 0 #1a1409; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #1a1409; }
.btn.primary { background: linear-gradient(#ffd766, #f0a81c); color: #2b1d0e; border-color: #b57a10; }
.btn:disabled, .btn.primary:disabled { opacity: .4; cursor: default; transform: none; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.tiny { padding: 3px 8px; font-size: 12px; border-radius: 8px; box-shadow: none; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- main menu (D-051) */
#menu { padding: 24px 16px 32px; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.menu-head { text-align: center; margin-bottom: 6px; }
.menu-head h1 { font-size: 34px; letter-spacing: .04em; }
#menu h3 { text-align: center; margin: 14px 0 10px; }
/* D-055: the win conditions are an informative list, not buttons — flat rows, a dotted divider, no frames or raised backgrounds */
.win-list { display: flex; flex-direction: column; cursor: default; user-select: none; }
.win { display: flex; gap: 14px; align-items: center; padding: 10px 2px; border-top: 1px dotted var(--line); }
.win:first-child { border-top: 0; }
/* iteration2 (D-076): two win conditions with a big OR between them */
.win-or { text-align: center; font-size: 30px; font-weight: 900; letter-spacing: .12em; color: var(--accent); margin: 2px 0; text-shadow: 0 2px 0 #1a1409; }
.win-or + .win { border-top: 0; }
.win-pic { position: relative; flex: 0 0 120px; width: 120px; height: 108px; border-radius: 10px; overflow: hidden; background: #2e4a28; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.win-pic canvas { display: block; }
.win-badge { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 800; background: rgba(20,16,10,.85); color: var(--accent); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.win-text { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.35; }
.win-text b { font-size: 15px; color: var(--accent); }
.win-text span { color: var(--muted); }
.menu-actions { display: flex; flex-direction: column; gap: 10px; margin: 22px auto 0; width: 100%; max-width: 320px; }
.btn.big { padding: 14px 20px; font-size: 18px; border-radius: 14px; }
.menu-links { text-align: center; margin-top: 18px; }
/* D-070: army presets on the main menu — three selectable cards above Play */
.preset-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 auto; width: 100%; max-width: 420px; }
.preset-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 10px 6px 9px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.preset-btn b { font-size: 14px; }
.preset-btn span { font-size: 11px; line-height: 1.3; color: var(--muted); }
.preset-btn .preset-icon { color: var(--accent); }
.preset-btn .preset-icon svg { width: 30px; height: 30px; display: block; }
.preset-btn:hover { border-color: #8a7240; }
.preset-btn.on { border-color: var(--accent); background: #3d3216; box-shadow: 0 0 0 1px var(--accent) inset; }
.preset-custom { grid-column: 1 / -1; text-align: center; margin: 2px 0 0; }
.chip.on { border-color: var(--accent); background: #3d3216; }

/* ---------- setup */
#setup { padding: 20px 16px 32px; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.setup-grid { display: flex; flex-direction: column; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.field label { font-size: 13px; color: var(--muted); }
select, input[type=text] { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.radio { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.chip:hover { border-color: var(--accent); }
.builder-label { margin: 10px 0 6px; font-size: 14px; }
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pick { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 10px; cursor: pointer; min-height: 74px; }
.pick.on { border-color: var(--accent); background: #3d3216; }
.pick.adv .pick-type::after { content: " · advanced"; color: var(--accent); }
.pick.field .pick-type::after { content: " · field"; color: #8fd0a0; } /* D-068 */
.pick-icon { float: right; margin: -2px -2px 0 6px; color: var(--accent); }
.pick-icon svg { width: 28px; height: 28px; display: block; }
.pick-name { font-weight: 700; font-size: 14px; }
.pick-type { font-size: 11px; color: var(--muted); }
.pick-text { font-size: 12px; color: var(--muted); margin-top: 3px; }
.setup-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.docs-link { margin-top: 18px; }

/* ---------- game (D-035: the board gets every pixel not needed by the HUD strip and the hand) */
#game { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: 0; gap: 0; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px; padding: 3px 4px; height: 36px; background: rgba(20,16,10,.85); border-bottom: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.hud-side { display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 8px; opacity: .7; overflow: hidden; }
.hud-side.active { opacity: 1; background: rgba(255,255,255,.08); box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset; }
.hud-side.p2 { justify-content: flex-end; }
.hud-name { font-weight: 800; }
.hud-side.p1 .hud-name { color: var(--blue-l); }
.hud-side.p2 .hud-name { color: var(--red-l); }
.hud-stats { color: var(--muted); }
.hud-stats b { color: var(--text); }
.hud-stats b.hud-terr { font-size: 21px; font-weight: 900; line-height: 1; vertical-align: -2px; } /* iteration2: the territory count is the score — make it read at a glance */
.hud-side.p1 b.hud-terr { color: var(--blue-l); }
.hud-side.p2 b.hud-terr { color: var(--red-l); }
.hud-center { display: flex; align-items: center; gap: 4px; font-weight: 800; }
@media (max-width: 430px) { .hud { font-size: 11px; } .hud-pct { display: none; } .hud-side { padding: 2px 4px; gap: 4px; } }
#board-wrap { flex: 1 1 auto; min-height: 200px; position: relative; overflow: hidden; }
#board { display: block; touch-action: none; }
.zoom-bar { position: absolute; right: 6px; bottom: 6px; display: flex; flex-direction: column; gap: 4px; z-index: 2; } /* D-083: camera buttons */
.zoom-bar .btn { width: 32px; height: 32px; padding: 0; font-size: 18px; font-weight: 900; background: rgba(20,16,10,.7); }

/* ---------- hand with piles (D-037) */
#hand-area { position: relative; background: linear-gradient(#2b2418, #1f1a10); border-top: 2px solid var(--line); padding: 4px 6px 2px; transition: box-shadow .15s; }
#hand-area.drop-cancel { box-shadow: inset 0 0 0 2px rgba(255,199,66,.6); }
#hand-row { display: grid; grid-template-columns: 52px 1fr 52px; gap: 6px; align-items: end; }
.pile-col { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pile-count { font-size: 13px; font-weight: 800; height: 16px; line-height: 16px; }
.pile-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; height: 12px; line-height: 12px; }
.pile { width: 46px; height: 64px; border-radius: 7px; border: 2px solid var(--paper-edge); background: linear-gradient(var(--paper), var(--paper2)); display: flex; align-items: center; justify-content: center; position: relative; }
.pile.deck { background: repeating-linear-gradient(45deg, #6b3a2a 0 4px, #5a2f22 4px 8px); border-color: #c99a5b; box-shadow: 2px 2px 0 #3a1f16, 4px 4px 0 #2a1610; }
.pile.deck.empty { background: transparent; box-shadow: none; border-style: dashed; }
.pile.discard { opacity: .85; }
.pile.discard.empty { background: transparent; border-style: dashed; }
.pile-face { color: var(--ink); width: 30px; height: 30px; }
.pile-face svg { width: 30px; height: 30px; display: block; }
.pile-face.back { width: 100%; height: 100%; border-radius: 5px; background: repeating-linear-gradient(45deg, #6b3a2a 0 4px, #5a2f22 4px 8px); }
.pile.shuffle { animation: shuffle .5s; }
@keyframes shuffle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg) translateY(-3px); } 75% { transform: rotate(6deg) translateY(-3px); } }
#hand-frame { border: 3px solid #0e0b06; border-radius: 12px; padding: 4px; background: rgba(0,0,0,.35); }
#hand { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; touch-action: none; }
.slot { min-width: 0; height: 96px; border-radius: 9px; border: 2px dashed #4a3d28; display: flex; }
.slot > * { flex: 1 1 auto; }
.card { position: relative; min-width: 0; border-radius: 9px; border: 2px solid var(--paper-edge); background: linear-gradient(var(--paper), var(--paper2)); color: var(--ink); box-shadow: 0 3px 0 #5a4222, 0 4px 8px rgba(0,0,0,.35); cursor: grab; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; align-items: center; overflow: hidden; margin: -2px; transition: transform .12s, opacity .12s; }
.card:active { cursor: grabbing; }
.card.k-move { border-color: #3a6fb8; } .card.k-move .card-name { background: #2f5ea3; }
.card.k-combat { border-color: #b8433a; } .card.k-combat .card-name { background: #a3352c; }
.card.k-reinf { border-color: #c9931b; } .card.k-reinf .card-name { background: #b57f10; }
.card.k-def { border-color: #4b8a4a; } .card.k-def .card-name { background: #3d7a3c; }
.card.k-terr { border-color: #7a5aa8; } .card.k-terr .card-name { background: #66489a; }
.card.k-util { border-color: #6b5a3a; } .card.k-util .card-name { background: #5a4a30; }
.card.k-summon { border-color: #2f8f86; } .card.k-summon .card-name { background: #23766e; } /* D-068: summons */
.card-icon { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; color: var(--ink); width: 100%; }
.card-icon svg { width: 44px; height: 44px; display: block; }
.card-name { width: 100%; text-align: center; font-weight: 800; font-size: 10px; line-height: 1.1; color: #fff; padding: 4px 2px; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
/* D-061: three tiers. Outpost cards: bronze double frame. Citadel card: gold frame with ornament corners and a badge. */
.card.tier-outpost { border-color: #b07a3a; box-shadow: inset 0 0 0 2px #f1dcb0, inset 0 0 0 3px #b07a3a, 0 3px 0 #5a4222, 0 4px 8px rgba(0,0,0,.35); }
.card.tier-outpost .card-name { box-shadow: inset 0 2px 0 rgba(255,255,255,.25); }
.card.tier-citadel { border-color: #d9a516; background: linear-gradient(#fff6dc, #f3dfae); box-shadow: inset 0 0 0 2px #fff2c2, inset 0 0 0 3px #d9a516, 0 3px 0 #5a4222, 0 4px 12px rgba(255,200,60,.45); }
.card.tier-citadel::before, .card.tier-citadel::after { content: ''; position: absolute; left: 4px; right: 4px; height: 8px; pointer-events: none;
  background: radial-gradient(circle at 4px 4px, #d9a516 2px, transparent 2.5px) 0 0 / 8px 8px repeat-x; opacity: .9; }
.card.tier-citadel::before { top: 5px; } .card.tier-citadel::after { bottom: 21px; }
.card.tier-citadel .card-name { background: linear-gradient(#e0ab1a, #b8860b) !important; color: #2b1d05; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.card-poi { position: absolute; top: 2px; right: 3px; font-size: 7px; font-weight: 800; letter-spacing: .04em; color: #2b1d05; background: linear-gradient(#ffe38a, #d9a516); border-radius: 6px; padding: 1px 4px; border: 1px solid #8a6208; }
.card.disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.card.hidden-card { visibility: hidden; }
.card.incoming { visibility: hidden; }
.card.lifted { opacity: .3; transform: scale(.94); }
.card.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.btn.end-turn { margin: -2px; border-radius: 9px; padding: 4px; font-size: 12px; line-height: 1.15; background: repeating-linear-gradient(135deg, #b8433a 0 6px, #a3352c 6px 12px); color: #fff; border-color: #ffd766; box-shadow: 0 3px 0 #5a1a14, 0 0 12px rgba(255,215,102,.45); }
.fly-card { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; border-radius: 8px; border: 2px solid var(--paper-edge); background: linear-gradient(var(--paper), var(--paper2)); color: var(--ink); display: flex; flex-direction: column; align-items: center; overflow: hidden; box-shadow: 0 8px 18px rgba(0,0,0,.5); }
.fly-card .card-icon svg { width: 36px; height: 36px; }
.fly-card .card-name { font-size: 9px; padding: 3px 2px; background: #5a4a30; }
.fly-card.k-move .card-name { background: #2f5ea3; } .fly-card.k-combat .card-name { background: #a3352c; } .fly-card.k-reinf .card-name { background: #b57f10; } .fly-card.k-def .card-name { background: #3d7a3c; } .fly-card.k-terr .card-name { background: #66489a; } .fly-card.k-summon .card-name { background: #23766e; }
.fly-card.k-summon .card-name { background: #23766e; } .fly-card.k-util .card-name { background: #5a4a30; }
.fly-card.stack { border-color: #c99a5b; }
#status-row { display: flex; align-items: center; justify-content: center; gap: 8px; height: 22px; overflow: hidden; }
.btn.end-fb { background: repeating-linear-gradient(135deg, #b8433a 0 6px, #a3352c 6px 12px); color: #fff; border-color: #ffd766; padding: 1px 10px; }
#status-line { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* description of the dragged card: a translucent panel over the hand zone itself (the card is under the finger anyway) */
#card-desc { position: absolute; left: 6px; right: 6px; bottom: 24px; min-height: calc(100% - 28px); z-index: 5; display: flex; flex-direction: column; justify-content: center; background: rgba(20,16,10,.82); border: 2px solid var(--paper-edge); border-radius: 12px; padding: 8px 14px; font-size: 14px; line-height: 1.35; pointer-events: none; backdrop-filter: blur(2px); }
#card-desc { padding: 6px 12px 4px; justify-content: space-between; }
#card-desc .desc-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
#card-desc b { display: block; color: var(--accent); margin-bottom: 2px; }
#card-desc .desc-forecast { margin-top: 5px; padding: 4px 8px; border-radius: 8px; background: rgba(255,90,60,.16); border: 1px solid rgba(255,138,118,.5); color: #ffd9cf; font-size: 12.5px; line-height: 1.3; }
#card-desc .desc-forecast b { display: inline; color: #ff8a76; margin: 0; }
#card-desc .desc-cancel { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(255,199,66,.45); font-size: 12px; color: var(--muted); transition: color .15s; }
#card-desc .desc-cancel-ic { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid currentColor; font-size: 13px; }
/* tap control scheme (D-048): cards are buttons; the description panel is tappable and cancels the selection */
body.ctl-tap #card-desc { pointer-events: auto; cursor: pointer; border-color: var(--accent); }
body.ctl-tap #card-desc .desc-cancel { color: var(--accent); }
body.ctl-tap #card-desc:active { background: rgba(40,30,15,.92); }
body.ctl-tap .card { cursor: pointer; }
.card.selected { transform: translateY(-6px) scale(1.04); box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(0,0,0,.5), 0 0 18px rgba(255,215,102,.6); z-index: 2; }
/* glowing cursor FX while a card is dragged (D-036) */
#drag-fx { position: fixed; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; pointer-events: none; z-index: 50; background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(255,215,102,.75) 30%, rgba(255,215,102,0) 70%); box-shadow: 0 0 24px 8px rgba(255,215,102,.55); animation: fxpulse .9s ease-in-out infinite; }
#drag-fx.p1 { background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(140,196,255,.8) 30%, rgba(140,196,255,0) 70%); box-shadow: 0 0 24px 8px rgba(140,196,255,.55); }
#drag-fx.p2 { background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(255,154,138,.8) 30%, rgba(255,154,138,0) 70%); box-shadow: 0 0 24px 8px rgba(255,154,138,.55); }
#drag-fx.ok { animation-duration: .45s; }
@keyframes fxpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
#log { font-size: 12px; color: var(--muted); padding: 2px 8px; }
#log summary { cursor: pointer; }
#log-lines { max-height: 120px; overflow: auto; padding: 4px 0; }
.log-line { padding: 1px 0; border-bottom: 1px dashed #3a3022; }

/* ---------- overlay */
#overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 20px; max-width: 420px; width: 100%; max-height: 90vh; overflow: auto; text-align: center; }
.panel .help { text-align: left; }
.panel .intro { text-align: left; }
.intro h2 { text-align: center; margin-bottom: 14px; }
.intro-item { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; font-size: 14px; line-height: 1.4; }
.intro-ic { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(var(--paper), var(--paper2)); border: 2px solid var(--paper-edge); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.intro-ic svg { width: 32px; height: 32px; display: block; }
.intro-skip { justify-content: center; color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.intro .btn { display: block; margin: 0 auto; }
.panel h2.w1 { color: var(--blue-l); }
.panel h2.w2 { color: var(--red-l); }
.pick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 96px)); gap: 8px; justify-content: center; margin: 12px 0; }
.pick-row .card { height: 100px; margin: 0; }
table.score { width: 100%; border-collapse: collapse; margin: 10px 0; }
table.score td, table.score th { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; }
table.score td:first-child, table.score th:first-child { text-align: left; color: var(--muted); }
.c1 { color: var(--blue-l); } .c2 { color: var(--red-l); }

@media (min-width: 720px) {
  #app { max-width: 960px; }
  .setup-grid { flex-direction: row; align-items: flex-start; }
  .setup-col { flex: 1; }
  .setup-col.builders { flex: 2; }
  .pick-grid { grid-template-columns: repeat(3, 1fr); }
  #game { max-width: 480px; margin: 0 auto; }
}

/* ---- D-085 (V4 "Overlord"): cards, the camp */
.card.k-sortie { border-color: #8a5a2a; } .card.k-sortie .card-name { background: #7a4a1c; }
/* D-088: whose card it is reads at a glance — a header strip on every card: the Overlord's in gold with a crown on a dark
   iron card, a minion card in its type's colour with the type's emblem and name */
.card-type { flex: 0 0 auto; width: 100%; height: 17px; display: flex; align-items: center; justify-content: center; gap: 3px; background: var(--tc, #c9b48a); color: #2b1d0e; font-size: 8.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1.5px solid rgba(43,29,14,.65); white-space: nowrap; overflow: hidden; }
.card-type svg { width: 12px; height: 12px; flex: 0 0 auto; }
.card-type b { font-size: 12px; line-height: 1; }
.card-type.hero { background: linear-gradient(#ffe38a, #d9a516); color: #2b1d05; border-bottom-color: #7a5608; }
.card.tier-hero { border-color: #d9a516 !important; background: radial-gradient(circle at 50% 40%, #4a4352, #1c1920 75%); color: #ffe9a8; box-shadow: inset 0 0 0 1.5px #7a5608, 0 3px 0 #3a2a10, 0 0 10px rgba(255,200,60,.35), 0 4px 8px rgba(0,0,0,.35); }
.card.tier-hero .card-icon { color: #ffd766; }
.card.tier-hero .card-name { background: linear-gradient(#e0ab1a, #a87a08) !important; color: #1c1206; text-shadow: 0 1px 0 rgba(255,255,255,.3); }
.card .card-icon svg { width: 40px; height: 40px; }
.card-away { position: absolute; left: 0; right: 0; top: 38%; background: rgba(20,12,6,.85); color: #ffe9a8; font-size: 10px; font-weight: 800; text-align: center; padding: 2px 0; text-transform: uppercase; letter-spacing: .04em; }
.camp-hero { margin: 8px 0 2px; }
.camp-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.camp-title b { font-size: 15px; color: var(--accent); }
.camp-title span { font-size: 13px; color: var(--text); }
.camp-title em { font-style: normal; color: var(--muted); } .camp-title em.bad { color: #ff8a76; font-weight: 800; }
select.lvl { padding: 3px 6px; font-size: 12px; margin-left: auto; }
.camp-types { display: grid; grid-template-columns: 1fr; gap: 8px; }
.camp-type { border: 1px solid var(--line); border-left: 5px solid var(--tc); border-radius: 10px; background: var(--panel); padding: 8px 10px; opacity: .8; }
.camp-type.on { opacity: 1; border-color: var(--tc); background: #342a1a; }
.camp-type-head { display: flex; align-items: center; gap: 8px; }
.camp-type-head b { font-size: 15px; }
.camp-type-head select.lvl { margin-left: auto; }
.camp-emblem { width: 26px; height: 26px; border-radius: 50%; background: var(--tc); color: #2b1d0e; display: inline-flex; align-items: center; justify-content: center; }
.camp-emblem svg { width: 18px; height: 18px; }
.camp-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0 3px; font-size: 13px; font-weight: 700; }
.camp-trait { font-size: 12px; color: var(--muted); }
.camp-count { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 13px; }
.camp-count b { min-width: 22px; text-align: center; font-size: 16px; }
.camp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pick.small { min-height: 0; padding: 6px 7px; }
.pick.small .pick-icon svg { width: 22px; height: 22px; }
.pick.small .pick-name { font-size: 12px; } .pick.small .pick-name em { font-style: normal; color: var(--accent); font-size: 11px; }
.pick.small .pick-text { font-size: 11px; }
.pick.locked { opacity: .45; cursor: not-allowed; }
@media (max-width: 520px) { .camp-cards { grid-template-columns: 1fr; } }

/* ---- D-097: coins — the economy line under the territory count, card prices, the burn slot */
.hud-col { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.hud-side.p2 .hud-col { align-items: flex-end; }
.card-cost { position: absolute; top: 19px; right: 2px; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 9px; background: linear-gradient(#ffe38a, #d9a516); border: 1.5px solid #7a5608; color: #2b1d05; font-size: 11px; font-weight: 900; line-height: 15px; text-align: center; z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.card.poor .card-cost { background: linear-gradient(#ff9a8a, #c0392b); border-color: #6b1a12; color: #fff; }
#hand-frame { display: flex; gap: 5px; align-items: stretch; }
#hand-frame #hand { flex: 1 1 auto; min-width: 0; }
/* D-099: the end-turn button stands right of the hand (where the burn slot was); cards are burnt on the discard pile;
   the coins sit in the card panel */
.btn.end-slot { flex: 0 0 52px; margin: 0; border-radius: 9px; padding: 4px; font-size: 12px; line-height: 1.15; font-weight: 900; }
.btn.end-slot:disabled { opacity: .35; cursor: default; filter: grayscale(.6); }
.btn.end-slot:not(:disabled) { box-shadow: 0 0 0 2px rgba(255,215,102,.7), 0 0 12px rgba(255,200,60,.45); }
.burn-col { position: relative; }
.burn-col .pile-label { color: #ffb37a; }
.burn-col .burn-gain { position: absolute; left: 0; right: 0; top: 38px; text-align: center; font-size: 13px; font-weight: 900; color: #ffd766; text-shadow: 0 1px 2px #000; pointer-events: none; }
.burn-col.hot .pile { background: rgba(255,120,40,.45); border-color: #ffb347; box-shadow: 0 0 0 2px #ffb347, 0 0 14px rgba(255,140,60,.7); transform: scale(1.06); }
.burn-col.armed .pile { box-shadow: 0 0 0 2px rgba(255,179,71,.85); }
/* D-100: the coins and the land track above the hand — coins, income a turn, the hexes still to take (in the player's
   colour) and the +1 they give; captured hexes fall out from the left, a full track pays its +1 into the income */
#eco-track { display: flex; align-items: center; justify-content: center; gap: 10px; height: 34px; margin: 0 0 3px; overflow: hidden; white-space: nowrap; }
#eco-track b { color: #ffd766; font-size: 24px; font-weight: 900; line-height: 1; }
#eco-track .coin-ic { font-size: 21px; margin-left: 2px; }
#eco-track .eco-unit { color: var(--muted); font-size: 12px; margin-left: 2px; }
#eco-track .eco-inc b.bump { animation: ecoBump .5s; }
@keyframes ecoBump { 0% { transform: scale(1); } 40% { transform: scale(1.6); color: #fff; } 100% { transform: scale(1); } }
#eco-run { display: inline-flex; align-items: center; gap: 3px; padding: 3px 6px; border-radius: 12px; background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
#eco-run.slide-in { animation: ecoSlide .45s ease-out; }
@keyframes ecoSlide { from { transform: translateX(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
#eco-hexes { display: inline-flex; align-items: center; gap: 3px; }
.eco-hex { width: 17px; height: 15px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); transition: width .25s, opacity .25s, transform .25s, margin .25s; flex: 0 0 auto; }
.eco-hex.p1 { background: linear-gradient(#8cc4ff, #3f8ae6); } .eco-hex.p2 { background: linear-gradient(#ff9a8a, #e0503f); }
.eco-hex.gone { width: 0; opacity: 0; transform: scale(.3); margin-right: -3px; }
.eco-hex.pop { animation: hexIn .3s ease-out both; }
@keyframes hexIn { from { transform: scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
#eco-plus { margin-left: 4px; padding: 1px 7px; border-radius: 10px; background: linear-gradient(#ffe38a, #d9a516); color: #2b1d05; font-size: 15px; font-weight: 900; transition: transform .35s ease-in, opacity .35s; }
#eco-plus.flying { opacity: .2; }
