:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, sans-serif; background: #080b12; color: #f4f7fb; }
* { box-sizing: border-box; } body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 18% 0, #202945 0, #0c101a 38%, #070910 100%); } button, select { font: inherit; } button { cursor: pointer; } button:disabled { cursor: not-allowed; opacity: .38; }
.shell { width: min(1240px, calc(100% - 28px)); margin: auto; padding: 22px 0 40px; }.topbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }.eyebrow { margin: 0 0 4px; color: #91a0bd; font: 700 .72rem/1.2 ui-monospace, monospace; letter-spacing: .16em; }h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.04em; }h2 { margin: 0; font-size: 1.2rem; }
.primary, .secondary { min-height: 42px; border-radius: 8px; padding: 0 17px; color: #f5f7fb; border: 1px solid #35405a; }.primary { background: #4c78e8; border-color: #6590ff; font-weight: 750; }.secondary { background: #171d2a; }.secondary:hover { background: #222a3b; }.wide { width: 100%; }
.mode-select, .setup, .game-over { max-width: 760px; margin: 70px auto; padding: 30px; background: #111722ed; border: 1px solid #30394d; border-radius: 14px; box-shadow: 0 24px 80px #0009; }.setup > div:first-child p:last-child { color: #aab4c8; line-height: 1.55; }.setup-mode { margin: 18px 0 -8px; color: #75a7ff; font-weight: 800; }.mode-select h2 { font-size: clamp(1.45rem, 4vw, 2rem); }.mode-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }.mode-card { min-height: 120px; display: grid; align-content: center; gap: 8px; padding: 20px; text-align: left; }.mode-card strong { font-size: 1rem; letter-spacing: .04em; }.mode-card span { color: #b6c1d4; font-size: .88rem; line-height: 1.45; }.class-pickers { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 20px; margin: 28px 0; }.class-pickers label { display: grid; gap: 8px; color: #aeb8ca; font-size: .85rem; font-weight: 700; }.class-pickers span { padding-bottom: 12px; color: #69768e; font-weight: 800; }.class-pickers select { min-height: 48px; border: 1px solid #3a4660; border-radius: 8px; padding: 0 12px; color: #fff; background: #1b2231; }.hidden { display: none !important; }
.game { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }.play-column { min-width: 0; }.status-strip { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 10px; background: #111722; border: 1px solid #2c3549; border-radius: 9px; }.status-strip div { padding: 10px 14px; border-right: 1px solid #2c3549; }.status-strip div:last-child { border: 0; }.status-strip span { display: block; color: #8997b0; font-size: .65rem; font-weight: 800; letter-spacing: .1em; }.status-strip strong { display: block; margin-top: 3px; font-size: .95rem; }.status-strip strong[data-player="A"] { color: #ff896c; }.status-strip strong[data-player="B"] { color: #75a7ff; }
.board { --columns: 9; display: grid; grid-template-columns: repeat(var(--columns), 1fr); width: 100%; aspect-ratio: 1; overflow: hidden; background: #05070b; border: 1px solid #35405a; border-radius: 10px; box-shadow: 0 20px 65px #0009; touch-action: manipulation; }.cell { position: relative; min-width: 0; min-height: 0; padding: 0; border: 0; border-right: 1px solid #ffffff14; border-bottom: 1px solid #ffffff14; }.territory-A { background: #613020; }.territory-B { background: #173664; }.territory-neutral { background: #252b36; }.cell:hover { filter: brightness(1.12); }.cell:disabled { opacity: 1; cursor: default; }.cell.legal::after { content: ""; position: absolute; width: 22%; aspect-ratio: 1; left: 39%; top: 39%; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px #ffffff22; z-index: 3; }.cell.target { outline: 3px solid #ffd65c; outline-offset: -4px; filter: brightness(1.25); }.cell.target::after { content: "×"; position: absolute; right: 5px; top: 0; z-index: 4; color: #ffd65c; font-size: 1.25rem; font-weight: 900; }
.unit { position: absolute; inset: 10%; z-index: 2; display: grid; place-content: center; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 5px 14px #0009; }.unit.player-A { background: #ed5f3a; }.unit.player-B { background: #347cf2; }.unit strong { font-size: clamp(.65rem, 1.7vw, 1.05rem); text-align: center; line-height: 1; }.unit small { margin-top: 3px; font-size: clamp(.48rem, .9vw, .62rem); font-weight: 700; text-align: center; }.unit.exhausted { opacity: .42; filter: saturate(.3); border-style: dashed; transform: scale(.87); }.unit.selected { outline: 4px solid #fff; outline-offset: 3px; }.message { min-height: 48px; display: flex; align-items: center; margin-top: 10px; padding: 0 14px; color: #cbd4e4; background: #111722; border: 1px solid #293248; border-radius: 8px; font-size: .9rem; }
.sidebar { display: grid; gap: 12px; }.sidebar > section { padding: 16px; background: #111722e8; border: 1px solid #293248; border-radius: 10px; }.sidebar h2 { color: #9ca9c0; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }.muted { margin-top: 12px; color: #8491a9; font-size: .88rem; }.unit-card { margin-top: 12px; }.unit-card > div:first-child { display: flex; justify-content: space-between; gap: 10px; }.unit-card span { color: #9ba8be; font-size: .75rem; }.statline { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; padding: 10px 0; border-block: 1px solid #ffffff12; }.statline span { display: grid; gap: 2px; }.statline b { color: #fff; font-size: .95rem; }.unit-card p { margin: 9px 0 0; color: #adb7c9; font-size: .78rem; }.actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }.action { min-height: 36px; padding: 0 11px; color: #dfe6f2; background: #20283a; border: 1px solid #3b4964; border-radius: 7px; font-size: .8rem; }.action.active, .shop-item.active { color: #fff; background: #385fb9; border-color: #77a0ff; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }.section-heading span { color: #ffd36b; font-size: .78rem; font-weight: 750; }.shop { display: grid; gap: 7px; }.shop-item { display: flex; justify-content: space-between; align-items: center; min-height: 51px; padding: 8px 10px; text-align: left; color: #e7ebf3; background: #1a2130; border: 1px solid #303b51; border-radius: 7px; }.shop-item span { display: grid; gap: 3px; }.shop-item small { color: #8896ae; font-size: .68rem; }.shop-item > b { display: grid; place-items: center; width: 27px; aspect-ratio: 1; color: #151921; background: #ffd36b; border-radius: 50%; font-size: .8rem; }.scores { display: grid; gap: 10px; margin-top: 12px; }.scores div { display: flex; align-items: center; gap: 8px; color: #b3bdcf; font-size: .85rem; }.scores strong { margin-left: auto; color: #fff; font: 700 1rem ui-monospace, monospace; }.swatch { width: 12px; height: 12px; border-radius: 3px; }.swatch.a { background: #ed5f3a; }.swatch.b { background: #347cf2; }.swatch.n { background: #687386; }
.phase-control { min-height: 52px; font-weight: 800; }.end-turn { border-color: #ffb84d; color: #ffd794; background: #2a2117; }.bot-banner { display: flex; align-items: center; gap: 9px; min-height: 44px; margin-bottom: 8px; padding: 0 13px; color: #dce8ff; background: #14213b; border: 1px solid #315ea8; border-radius: 8px; font-weight: 800; }.thinking-dot { width: 10px; height: 10px; background: #75a7ff; border-radius: 50%; box-shadow: 0 0 0 0 #75a7ff88; animation: thinking 1.2s infinite; }.bot-log { display: grid; gap: 7px; }.bot-log div { color: #b8c4d7; font-size: .78rem; }.input-locked .board { box-shadow: 0 20px 65px #0009, 0 0 0 2px #315ea866; }.game-over { position: fixed; z-index: 20; inset: 50% auto auto 50%; width: min(520px, calc(100% - 28px)); margin: 0; transform: translate(-50%, -50%); text-align: center; }.game-over h2 { font-size: 2rem; }.game-over p:not(.eyebrow) { color: #aeb8ca; }.game-over::before { content: ""; position: fixed; z-index: -1; inset: -100vh -100vw; background: #05070bd9; }@keyframes thinking { 70% { box-shadow: 0 0 0 8px #75a7ff00; } 100% { box-shadow: 0 0 0 0 #75a7ff00; } }
@media (max-width: 900px) { .game { grid-template-columns: 1fr; }.sidebar { grid-template-columns: 1fr 1fr; }.sidebar > button { grid-column: 1 / -1; }.selection-panel { min-height: 180px; } }
@media (max-width: 600px) { body { min-width: 0; overflow-x: hidden; }.shell { width: 100%; padding: 10px 8px 28px; }.topbar { align-items: center; margin-bottom: 10px; }.topbar .eyebrow { display: none; }.topbar h1 { font-size: 1.45rem; }.mode-select, .setup { margin: 24px auto; padding: 20px 16px; }.mode-buttons { grid-template-columns: 1fr; }.mode-card { min-height: 92px; }.game { gap: 9px; }.play-column { display: flex; flex-direction: column; }.status-strip { order: 0; grid-template-columns: repeat(4, 1fr); position: sticky; top: 0; z-index: 10; margin-bottom: 7px; }.status-strip div { min-width: 0; padding: 7px 6px; border-bottom: 1px solid #2c3549; }.status-strip div:nth-child(4n) { border-right: 0; }.status-strip span { font-size: .5rem; letter-spacing: .04em; }.status-strip strong { overflow: hidden; font-size: .72rem; white-space: nowrap; text-overflow: ellipsis; }.turn-status { grid-column: span 2; }.objective-strip { order: 3; }.bot-banner { order: 1; }.board { order: 2; border-radius: 7px; }.message { order: 4; min-height: 42px; margin-top: 7px; padding: 7px 10px; font-size: .8rem; }.sidebar { grid-template-columns: 1fr; }.sidebar > section { padding: 14px; }.sidebar > button { grid-column: auto; }.class-pickers { grid-template-columns: 1fr; gap: 10px; }.class-pickers span { padding: 0; text-align: center; }.unit { inset: 7%; }.unit strong { font-size: clamp(.56rem, 2.7vw, .82rem); }.unit small { display: none; }.topbar .secondary { min-height: 44px; padding: 0 11px; font-size: .78rem; }.shop-item { min-height: 58px; }.action { min-height: 44px; }.phase-control { min-height: 56px; position: sticky; bottom: 8px; z-index: 8; }.objective-card small:last-child { display: none; } }

/* Player identity is derived from the engine's currentPlayer state. */
.game { --active: #347cf2; --active-soft: #173664; }
.game[data-player="B"] { --active: #ed5f3a; --active-soft: #613020; }
.territory-A { background: #173664; }
.territory-B { background: #613020; }
.unit.player-A { background: #347cf2; }
.unit.player-B { background: #ed5f3a; }
.status-strip strong[data-player="A"] { color: #75a7ff; }
.status-strip strong[data-player="B"] { color: #ff896c; }
.sidebar > section { padding: 18px; border-color: var(--active); border-top-width: 4px; }
.sidebar h2 { color: #f2f5fa; font-size: 1rem; letter-spacing: .02em; text-transform: none; }
.context-title { display: grid; gap: 5px; margin-bottom: 16px; }
.context-title > strong { color: var(--active); font-size: 1.1rem; }
.context-title > span { color: #9ba8be; font-size: .8rem; }
.context-panel .shop { margin-bottom: 16px; }
.muted { margin: 16px 0; padding: 20px 0; border-block: 1px solid #ffffff12; }
.unit-card { margin: 14px 0; }
.actions { margin: 12px 0 16px; }
.action.active, .shop-item.active { background: var(--active-soft); border-color: var(--active); }
.shop-item { min-height: 56px; }
.shop-item > b { color: #fff; background: var(--active); }
.context-panel .primary { background: var(--active); border-color: var(--active); }
.turn-status strong { font-size: .84rem; }
.status-strip { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.objective-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.objective-pickers label { display: grid; gap: 7px; color: #aeb8ca; font-size: .82rem; font-weight: 700; }
.objective-pickers select { min-height: 84px; padding: 8px; color: #fff; background: #1b2231; border: 1px solid #3a4660; border-radius: 8px; white-space: normal; }
.objective-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.objective-card { display: grid; gap: 5px; padding: 12px; background: #111722; border: 1px solid #293248; border-left: 4px solid #347cf2; border-radius: 8px; }
.objective-card.player-B { border-left-color: #ed5f3a; }
.objective-card > div { display: flex; justify-content: space-between; gap: 10px; }
.objective-card > div strong { font-size: .75rem; }
.objective-card > div span { color: #ffd36b; font-size: .72rem; font-weight: 800; }
.objective-card > b { font-size: .88rem; }
.objective-card small { color: #929fb5; font-size: .72rem; line-height: 1.35; }
.objective-card.completed { background: #14251d; border-color: #39865c; }
.cell.threatened { box-shadow: inset 0 0 0 3px #ffd36b80; }
.cell.threatened::before { content: ""; position: absolute; inset: 40%; z-index: 3; border: 1px solid #ffd36b; transform: rotate(45deg); }
.cell.blocked-target { outline: 3px dashed #ff8d72; outline-offset: -5px; filter: saturate(.55) brightness(.82); }
.cell.blocked-target::after { content: "BLOCKED"; position: absolute; z-index: 5; left: 50%; bottom: 4px; transform: translateX(-50%); padding: 2px 4px; color: #fff; background: #7d2d25e6; border-radius: 3px; font-size: clamp(.42rem, .7vw, .58rem); font-weight: 900; letter-spacing: .04em; }
.token-action { border-color: #d5a738; color: #ffd978; }
.draggable, .unit { touch-action: none; user-select: none; -webkit-user-select: none; }
.shop-item.draggable:not(:disabled) { cursor: grab; }
.shop-item.draggable:not(:disabled):active, .unit:active { cursor: grabbing; }
.drag-ghost { position: fixed !important; z-index: 100; width: 150px; max-width: 34vw; margin: 0; pointer-events: none; opacity: .9; transform: translate(-50%, -58%) rotate(-2deg) scale(.94); box-shadow: 0 16px 35px #000b; }
.unit.drag-ghost { width: 64px; height: 64px; inset: auto; }
.cell.legal { box-shadow: inset 0 0 0 3px #71e6a7; filter: brightness(1.13); }
.cell.legal::after { background: #8ff0b8; box-shadow: 0 0 0 5px #71e6a733, 0 0 18px #71e6a7aa; }
.cell.drag-over { box-shadow: inset 0 0 0 5px #fff, inset 0 0 24px #71e6a7cc; filter: brightness(1.35); }
.cell.drag-origin { box-shadow: inset 0 0 0 3px #ffffffb8; }
.cell.drag-origin .unit { opacity: .28; }
.control-hint, .board-controls { color: #c4cddd; font-size: .82rem; line-height: 1.55; }
.control-hint { margin: -4px 0 13px; }
.board-controls { display: grid; gap: 3px; padding: 11px 12px; background: #0d121c; border: 1px solid #283248; border-radius: 7px; }
.board-controls b { color: #fff; }
.how-to { padding: 0 !important; overflow: hidden; border-top-width: 1px !important; }
.how-to summary { padding: 14px 16px; color: #d7deeb; cursor: pointer; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.how-to > div { padding: 0 16px 14px; color: #98a5bb; font-size: .78rem; line-height: 1.5; }
.how-to b { color: #dce4f1; }.how-to p { margin: 3px 0 10px; }
@media (max-width: 700px) { .objective-pickers, .objective-strip { grid-template-columns: 1fr; }.status-strip { grid-template-columns: repeat(2, 1fr); } }
.cell.in-mend-range:not(.target) { outline: 1px dashed #78d9bf; outline-offset: -3px; }
.mode-select input { max-width: 100%; box-sizing: border-box; }
#invite-link { width: 100%; }
