:root{font-family:system-ui;color:#e9e8dc;background:#19221e;line-height:1.5;--paper:#f2eddf;--ink:#26362f;--green:#377668;--red:#a85443}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;border:1px solid #718577;background:#25382e;color:#edeade;border-radius:5px;padding:9px 12px;font-size:13px}button:disabled{opacity:.4;cursor:default}button:hover:not(:disabled){background:#3b5645}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #e2b85e;outline-offset:3px}.primary{background:#dfb76b;color:#1b2922;border-color:#dfb76b}.primary:hover:not(:disabled){background:#f1cc84}header{display:flex;align-items:center;justify-content:space-between;padding:18px 32px;border-bottom:1px solid #526052;gap:16px}header a{color:#e8d9b7;font-size:14px}header strong{font:600 15px Georgia,serif;letter-spacing:2px}header span{font-size:12px;color:#b7c0b6}main{max-width:1500px;margin:auto;padding:28px 32px 64px}.battle-top{display:flex;justify-content:space-between;align-items:center;gap:24px}.eyebrow{font-size:11px;letter-spacing:3px;color:#c2b180}h1{font:600 38px Georgia,serif;margin:6px 0}h2{font:600 22px Georgia,serif;margin:24px 0 12px}.battle-top p{margin:4px 0 22px;font-size:14px;color:#bdc5b9}.toolbar{display:flex;gap:8px;flex-wrap:wrap}#status{border:1px solid #697963;background:#26372b;border-radius:5px;padding:12px;margin-bottom:16px;font-weight:600}.arena-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px}.arena{min-width:0;background:#e2dfce;color:var(--ink);border-radius:8px;border:1px solid #9caa8e;overflow:hidden}.initiative{padding:12px;display:flex;gap:8px;flex-wrap:wrap;background:#cbcbb5}.initiative button{padding:5px 8px}.initiative .current{outline:2px solid #e2b85e}.map-wrap{padding:14px;background:radial-gradient(ellipse at center,#d7d5b9,#b2ba96)}#map{display:block;width:100%;touch-action:manipulation}.hex{stroke:#7b896b;stroke-width:1;cursor:pointer;fill:#c5caa7}.hex:hover{stroke:#d7a640;stroke-width:3}.hex.reachable{fill:#d5d5ab;stroke:#c69530;stroke-width:2}.hex.wall{fill:#647264}.hex.forest{fill:#7d9c69}.hex.rough{fill:#b2a782}.hex-label{font-size:8px;fill:#616c51;pointer-events:none}.unit-token{cursor:grab}.unit-token circle{stroke:#eee9d8;stroke-width:2}.unit-token.active circle{stroke:#ebba5b;stroke-width:4}.unit-token.selected circle{stroke:#19221e;stroke-width:4}.unit-token.broken{opacity:.45}.unit-token text{fill:white;font-weight:700;font-size:11px;pointer-events:none}.unit-token .health-track{stroke:#29342b;stroke-width:4}.unit-token .health-fill{stroke:#e9c171;stroke-width:4}.legend{display:flex;gap:12px;flex-wrap:wrap;padding:12px;font-size:11px;border-top:1px solid #9daa88}.legend span:first-child{color:#286b72}.legend span:nth-child(2){color:#a34832}.help{font-size:12px;margin:0;padding:0 12px 12px}#terrain-controls{padding:0 12px 16px}label{font-size:12px;display:block}select,input{background:#f6f1e5;color:#273329;border:1px solid #9ca28f;border-radius:3px;padding:7px;max-width:100%}aside{background:var(--paper);color:var(--ink);border-radius:7px;padding:18px}aside h2{margin:0 0 6px}aside h3{font-size:14px;border-bottom:1px solid #babdaa;padding-bottom:7px}.unit-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}.unit-stats div{border:1px solid #b5bba5;text-align:center;padding:6px}.unit-stats small{font-size:10px;display:block}.unit-stats strong{font:600 22px Georgia,serif}aside label{margin:12px 0}aside select{display:block;width:100%;margin-top:5px}aside button{margin:4px 3px 4px 0}.actions-grid{display:grid;grid-template-columns:1fr 1fr}.actions-grid button{font-size:12px}.turn-buttons{border-top:1px solid #bfc3ae;margin-top:18px;padding-top:10px}.turn-buttons button{width:100%}.lower{display:grid;grid-template-columns:1fr 1fr;gap:24px}.roster{display:grid;grid-template-columns:1fr 1fr;gap:10px}.roster button{padding:12px;text-align:left}.roster strong{display:block}.roster small{font-size:11px;color:#c8cdbd}.battle-log{height:310px;overflow:auto;border:1px solid #53644d;background:#142017;border-radius:5px;padding:12px;font:12px/1.65 monospace}.battle-log p{margin:0;padding:7px 0;border-bottom:1px solid #30422f}.rulebook{margin-top:30px;border:1px solid #67735c;border-radius:6px;padding:18px;font-size:13px}.rulebook summary{cursor:pointer;font-weight:700}.rulebook a{color:#e4c57c}.settings{display:flex;gap:20px;flex-wrap:wrap;margin:18px 0}.settings input{width:65px}.rulebook p{max-width:1000px}#battle-toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#e8cc8b;color:#202b20;padding:12px 20px;border-radius:5px;max-width:90vw;display:none;z-index:5}#battle-toast.visible{display:block}[hidden]{display:none!important}@media(max-width:1000px){.arena-layout{grid-template-columns:1fr}.lower{grid-template-columns:1fr}aside .actions-grid{grid-template-columns:repeat(4,1fr)}header span{display:none}}@media(max-width:650px){main{padding:18px 12px}header{padding:14px;flex-wrap:wrap}header strong{font-size:12px}.battle-top{display:block}.toolbar{margin-bottom:14px}.roster{grid-template-columns:1fr 1fr}aside .actions-grid{grid-template-columns:1fr 1fr}.map-wrap{padding:4px}.legend{font-size:10px}}
[hidden]{display:none!important}
/* Tactical workspace */
:root{background:#101b22;color:#e6edf0;--paper:#192b35;--ink:#e5edf0;--green:#55bea9;--red:#dc7874;font-family:system-ui,-apple-system,"Segoe UI",sans-serif}header{padding:14px 24px;background:#0c161c;border-color:#2a404c}header strong{font-family:inherit;letter-spacing:1px}main{max-width:1680px;padding:20px 24px 40px}h1{font:650 27px/1.2 inherit;margin:0 0 8px}.map-tag{font-size:13px;font-weight:400;color:#8fa8b6;margin-left:12px}.battle-top p{font-size:14px;margin:0;color:#94adba}.battle-top{margin-bottom:16px}.toolbar button{font-size:14px;padding:9px 12px}.primary{background:#f0c56b;color:#16252c;border-color:#f0c56b}.flow-step{color:#d4e2e8;font-size:15px;margin:0 0 10px}#status{background:#203944;border:1px solid #385c69;padding:10px 14px;margin-bottom:14px}.arena-layout{grid-template-columns:minmax(0,1fr) 330px;gap:16px}.arena{background:#152722;border-color:#3a5550;border-radius:10px;color:#dce8df}.initiative{background:#14242c;padding:10px;gap:6px}.initiative button{font-size:14px;background:#233a46;border-color:#375363;padding:7px 11px}.initiative .current{background:#e4be67;color:#132630;outline:0;border-color:#f4d991}.map-wrap{padding:18px 6px;background:#32442a;overflow:hidden;box-shadow:inset 0 0 50px #16281b}#map{image-rendering:pixelated;min-height:340px}.hex{fill:unset;stroke:#233622;stroke-opacity:.4;stroke-width:1;transition:stroke .15s}.hex:hover{stroke:#fce4a1;stroke-width:3;stroke-opacity:1}.hex.reachable{fill:unset;stroke:#8eefd0;stroke-width:2;stroke-opacity:.8}.move-dot{fill:#a0ffd8;stroke:#134435;stroke-width:2}.hex-label{fill:#ecedce;opacity:.55;font-size:8px;paint-order:stroke;stroke:#283a22;stroke-width:2}.unit-token circle{stroke:transparent;stroke-width:2}.unit-token.selected circle{stroke:#fff0b2;stroke-width:3;stroke-dasharray:4 3}.unit-token.active circle{stroke:#ffd15d;stroke-width:3}.unit-token.targeted circle{stroke:#ff9490;stroke-width:3;stroke-dasharray:3 2}.unit-token text{font:600 10px system-ui;paint-order:stroke;stroke:#12251c;stroke-width:3;fill:#fff}.unit-token .health-track{stroke:#10241a;stroke-width:5}.unit-token .health-fill{stroke:#93e7b1;stroke-width:3}.unit-token.broken{opacity:.4}.legend{font-size:13px;border-color:#3e5140;padding:12px 16px;color:#d4dfc3}.legend span:first-child{color:#85d0ec}.legend span:nth-child(2){color:#ffa09c}.help{font-size:14px;line-height:1.5;color:#b1c3cb;padding:0 0 12px}#map-help{padding:0 16px 12px;color:#c5d7bd}#terrain-controls{padding:0 16px 16px}label{font-size:14px}select,input{background:#11232d;color:#ecf3f5;border-color:#405b68;border-radius:5px}aside{background:#192b35;border:1px solid #35505e;padding:18px;align-self:start}aside h2{font:650 24px system-ui;margin:0}aside h3{font-size:15px;border-color:#3a515e}.fighter-heading{display:flex;align-items:center;gap:12px;margin-bottom:12px}.portrait{width:62px;height:66px;background:#2b443e;border:1px solid #466456;border-radius:6px}.portrait svg,.roster-portrait svg{width:100%;height:100%;image-rendering:pixelated}.team-label{font-size:12px;letter-spacing:1px;color:#8faebc}.unit-stats{gap:6px;margin:12px 0}.unit-stats div{border-color:#3c5460;background:#13242d;border-radius:4px}.unit-stats small{font-size:11px;color:#a4b9c4}.unit-stats strong{font:650 21px system-ui}.action-budget{display:flex;gap:8px;margin-top:12px}.action-budget span{padding:5px 8px;border:1px solid #537264;border-radius:4px;font-size:13px}.action-budget .available{color:#a4e7ca;background:#23483e}.action-budget .spent{color:#82949f;border-color:#354955}.actions-grid{gap:6px}.actions-grid button{margin:0;text-align:left;font-size:14px;padding:10px;background:#2d4653;border-color:#466371;min-height:59px}.actions-grid button small{display:block;color:#bfd4df;font-size:12px;margin-top:3px}.actions-grid button:disabled{opacity:.45}.turn-buttons{border-color:#3b5663}.turn-buttons button{font-size:14px;margin:6px 0;padding:11px}.lower{grid-template-columns:1fr 1fr;gap:20px}.lower h2{font:600 20px system-ui;margin:22px 0 12px}.roster{grid-template-columns:repeat(3,1fr);gap:8px}.roster button{background:#1a303a;border-color:#34525f;font-size:14px;padding:10px}.roster-portrait{float:left;width:46px;height:54px;margin-right:8px}.roster small{font-size:12px;color:#a9bec9}.battle-log{background:#101e27;border-color:#334d5b;font-size:13px;height:220px}.rulebook{border-color:#34505d;font-size:14px}.rulebook summary{font-size:15px}button:hover:not(:disabled){background:#3a5866}.primary:hover:not(:disabled){background:#ffe09a}.settings{gap:16px}@media(max-width:1050px){.arena-layout{grid-template-columns:minmax(0,1fr) 300px}.roster{grid-template-columns:1fr 1fr}aside .actions-grid{grid-template-columns:1fr 1fr}}@media(max-width:820px){main{padding:16px 12px}.arena-layout{grid-template-columns:1fr}.battle-top{display:block}.toolbar{margin:14px 0 0}.lower{grid-template-columns:1fr}.map-wrap{padding:8px 0}#map{min-height:0}aside .actions-grid{grid-template-columns:repeat(3,1fr)}header strong{font-size:12px}.map-tag{display:none}}@media(max-width:460px){aside .actions-grid{grid-template-columns:1fr 1fr}.roster{grid-template-columns:1fr}.initiative button{font-size:12px}.legend{font-size:12px}header{padding:12px}.flow-step{font-size:14px}}
[hidden]{display:none!important}h1{font-family:system-ui;font-size:25px;font-weight:650}header{padding:10px 24px}main{padding-top:14px}.battle-top{margin-bottom:12px}.flow-step{margin-bottom:8px}.arena-layout aside{max-height:calc(100vh - 210px);overflow:auto;position:sticky;top:12px}.map-wrap{padding:12px 6px}.unit-stats{margin:10px 0}.unit-stats div{padding:4px}.fighter-heading{margin-bottom:8px}aside label{margin:8px 0}.turn-buttons{margin-top:12px}@media(max-width:820px){.arena-layout aside{max-height:none;position:static}}
.fighter-details{margin-top:12px;font-size:14px}.fighter-details summary{cursor:pointer;color:#bed4df;padding:8px 0;border-bottom:1px solid #3a515e}.fighter-details .action-budget{display:none}aside .action-budget{margin-top:0}.actions-grid button{min-height:52px;padding:8px}.actions-grid{gap:5px}aside h3{margin:14px 0 10px}.fighter-details>small{display:block;margin-top:10px}.arena-layout aside{max-height:calc(100vh - 180px)}
.unit-sprite{transform-box:view-box;pointer-events:none}.unit-sprite.lying{transform:translateY(10px) rotate(80deg) scale(.8)}.unit-sprite.falling{animation:fall-to-ground .42s ease-out both}@keyframes fall-to-ground{0%{transform:translateY(0) rotate(0) scale(1)}65%{transform:translateY(12px) rotate(88deg) scale(.8)}100%{transform:translateY(10px) rotate(80deg) scale(.8)}}@media(prefers-reduced-motion:reduce){.unit-sprite.falling{animation:none}}

.setup-panel{background:#192b35;border:1px solid #35505e;border-radius:9px;padding:16px;margin-bottom:16px}.setup-panel h2{font-size:18px;margin:0 0 12px}.map-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.map-choice{display:flex;align-items:center;gap:14px;text-align:left;background:#14272d;border:1px solid #3a535e;border-radius:7px;padding:10px;color:#e5edf0}.map-choice.chosen{border:2px solid #efca76;background:#2c3b36}.map-choice svg{width:104px;height:72px;flex:none;border-radius:4px;background:#32442a}.map-choice strong,.map-choice small{display:block}.map-choice small{color:#aebfbc;font-size:12px;margin-top:5px}.squad-picker{margin-top:14px}.squad-picker summary{cursor:pointer;color:#eac777;font-weight:600}.character-choices{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.pick-card{display:flex;align-items:center;gap:8px;background:#12262e;border:1px solid #344f5b;border-radius:6px;padding:9px}.pick-card svg{width:44px;height:58px;flex:none}.pick-card strong,.pick-card small{display:block}.pick-card small{font-size:12px;color:#acc1cb}.pick-card select{margin-top:7px;width:100%;font-size:13px}.pick-card>div{flex:1;min-width:0}.mishap-panel{background:#422d36;border:1px solid #bd7a83;border-radius:7px;padding:16px;margin-bottom:16px}.mishap-panel h2{font-size:18px;margin:0}.mishap-panel textarea{display:block;min-height:75px;width:100%;box-sizing:border-box;background:#17232c;color:#edf2f4;border:1px solid #75838b;padding:10px;margin-top:6px;font:inherit}.mishap-panel select{max-width:350px}.mishap-panel button{margin-top:10px}#magic-panel{border-top:1px solid #557079;margin-top:18px;padding-top:4px}#magic-panel input[type=number]{width:70px;padding:8px}#magic-panel input[type=checkbox]{width:auto}#magic-panel .help{font-size:13px;padding-bottom:0}#cast-spell{width:100%;margin-top:10px;background:#6a466d;border-color:#ac83ac;color:#fff}#cast-spell:disabled{opacity:.45}@media(max-width:1150px){.character-choices{grid-template-columns:repeat(3,1fr)}.map-choice{display:block}.map-choice svg{width:100%;height:70px}}@media(max-width:650px){.character-choices{grid-template-columns:repeat(2,1fr)}.map-choice{padding:7px}.map-choice strong{font-size:13px}.map-choice small{display:none}.map-choices{gap:5px}}@media(max-width:380px){.character-choices{grid-template-columns:1fr}}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.map-choice{display:grid;grid-template-columns:minmax(0,1fr) 104px;gap:6px 10px}.map-choice strong,.map-choice small{grid-column:1}.map-choice svg{grid-column:2;grid-row:1 / 3}@media(max-width:1150px){.map-choice{display:block}.map-choice svg{margin-top:7px}}

/* Keep the standalone battle workspace in the same world as the shared table. */
:root { color-scheme: dark; --paper: #1b2921; --ink: #eee9db; --green: #a9c69b; --red: #e49b88; background: #111b16; color: var(--ink); }
html { scrollbar-gutter: stable; }
body { background: radial-gradient(ellipse at top left, #253b2955, transparent 70%), #111b16; }
header { background: #17251e; border-color: #8b78504d; color: #e4c98e; min-height: 64px; }
header a { color: #dfc48b; text-underline-offset: 3px; }
main { padding-bottom: 40px; }
h1, aside h2, .lower h2 { font-family: Georgia, serif; }
.battle-top p, .map-tag, .team-label, .help, .roster small { color: #afbfab; }
button, select, input { border-radius: 6px; }
button:not(.hex) { transition: background-color .12s, border-color .12s; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #f1d698; outline-offset: 3px; }
button:hover:not(:disabled) { background: #3a503b; border-color: #bca16b; }
.toolbar button, .turn-buttons button { min-height: 42px; }
.primary { background: #c3a76d; border-color: #dac08a; color: #152119; }
.primary:hover:not(:disabled) { background: #dfc48b; }
#status { background: #22372b; border-color: #617153; border-radius: 7px; color: #e8e3d2; }
.flow-step { color: #e1d6b7; }
aside { background: #1b2921; border-color: #415740; border-radius: 9px; }
aside h3, .fighter-details summary, .turn-buttons { border-color: #42563f; }
.fighter-details summary { color: #ddc78e; }
.initiative { background: #15241b; padding: 12px; }
.initiative button { background: #293d2d; border-color: #526448; color: #e6e3d4; }
.initiative .current { background: #d6b97b; border-color: #ebd49c; color: #152119; }
select, input { background: #132119; border-color: #53674c; color: #eee9db; min-width: 0; min-height: 40px; }
.unit-stats div { background: #14221a; border-color: #465b41; }
.unit-stats small { color: #b2c0a9; }
.actions-grid button { background: #2b3e2d; border-color: #516345; }
.actions-grid button small { color: #c5cfb8; }
.action-budget .available { color: #c5e4bc; background: #2c4630; border-color: #66805a; }
.action-budget .spent { color: #b0b7a7; border-color: #4c5a43; }
.roster button { background: #1c3022; border-color: #435d40; }
.battle-log { background: #111e16; border-color: #3e543d; border-radius: 7px; }
.rulebook { border-color: #526348; border-radius: 7px; }
.setup-panel { background: #1b2921; border-color: #415740; }
.map-choice, .pick-card { background: #172b1e; border-color: #435d40; color: #eee9db; }
.map-choice.chosen { background: #30412d; border-color: #d6b97b; }
.pick-card small, .map-choice small { color: #b2c0a9; }
.squad-picker summary { color: #ddc78e; }
.mishap-panel { background: #3b2926; border-color: #b47e6c; }
.mishap-panel textarea { background: #18231a; border-color: #67745a; color: #eee9db; }
#magic-panel { border-color: #526348; }
.lower > *, .arena-layout > * { min-width: 0; }
@media (max-width: 650px) {
  .toolbar { gap: 7px; }
  .toolbar button { flex: 1 1 105px; font-size: 13px; }
  .battle-top h1 { font-size: 24px; }
  aside { padding: 14px; }
  .initiative { flex-wrap: wrap; }
  .pick-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 4px 6px; align-content: start; }
  .pick-card > div { display: contents; }
  .pick-card svg { width: 36px; height: 50px; grid-column: 1; grid-row: 1 / 3; }
  .pick-card strong, .pick-card small { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
  .pick-card select { grid-column: 1 / -1; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { button, .hex { transition: none; } }

#sandbox-preparation{margin:16px 0}#sandbox-preparation summary{cursor:pointer;padding:12px}#sandbox-preparation .turn-buttons{display:none}#table{margin-top:24px}#journal-panel{margin-top:24px}#table input[type=checkbox]{display:inline-block;width:auto}#table .combat-grid button{border-radius:2px}body{font-family:system-ui,sans-serif}

.pick-portrait{width:64px;height:72px;object-fit:contain;flex:none}
.map-choices{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}
@media(max-width:650px){.map-choices{grid-template-columns:repeat(2,minmax(0,1fr))}.pick-portrait{width:45px;height:60px}}

/* Match the shared campaign typography, including forms and combat controls. */
body{font:15px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
button,input,select,textarea{font-family:inherit}
