:root {
    color-scheme: dark;
    --bg: #0b1018;
    --surface: #121a26;
    --surface-2: #182231;
    --line: rgba(190, 207, 224, 0.14);
    --line-strong: rgba(215, 175, 99, 0.42);
    --text: #e9eef4;
    --muted: #91a0b2;
    --gold: #d7af63;
    --green: #6cc69b;
    --red: #e47f77;
    --radius: 16px;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; color: var(--text); background: radial-gradient(circle at 12% 0, rgba(49, 68, 91, .32), transparent 32rem), var(--bg); }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), a { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.8rem); font-weight: 500; }
h2 { margin-bottom: 8px; font-size: 1.3rem; }
h3 { margin-bottom: 5px; }
p { color: var(--muted); line-height: 1.55; }
a { color: inherit; text-decoration: none; }

.battle-shell { width: min(1400px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 60px; }
.battle-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18, 26, 38, .84); backdrop-filter: blur(16px); }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold); font-family: Georgia, serif; }
.brand small, .brand strong { display: block; }
.brand small, .eyebrow, .unit-category { color: var(--gold); font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.quiet-link { color: var(--muted); font-size: .88rem; }

.home-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, .85fr); gap: 20px; }
.hero-card, .join-card, .active-card, .panel, .locked-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(24, 34, 49, .96), rgba(15, 22, 32, .96)); box-shadow: var(--shadow); }
.hero-card { min-height: 380px; padding: clamp(28px, 5vw, 68px); background: radial-gradient(circle at 80% 0, rgba(215, 175, 99, .12), transparent 42%), linear-gradient(145deg, #192435, #0f1620); }
.hero-card p { max-width: 680px; font-size: 1.05rem; }
.join-card { padding: 30px; }
.active-card { grid-column: 1 / -1; padding: 28px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; max-width: 700px; margin-top: 36px; }
.inline-form label { flex: 1; }
.inline-form .hidden-battle-choice { display: flex; flex: 0 1 220px; gap: 10px; align-items: center; min-height: 44px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .12); }
.hidden-battle-choice input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--gold); }
.hidden-battle-choice span { margin: 0; }
.hidden-battle-choice small { display: block; margin-top: 2px; color: var(--muted); font-size: .66rem; font-weight: 500; }
.join-form { display: grid; gap: 12px; margin-top: 28px; }
label > span { display: block; margin-bottom: 7px; color: #b9c4d0; font-size: .76rem; font-weight: 700; letter-spacing: .04em; }
input, textarea, select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #0e151f; padding: 10px 12px; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(215, 175, 99, .1); }
.join-form input { text-align: center; font-size: 1.2rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
button, .button-link { min-height: 44px; border: 0; border-radius: 10px; padding: 10px 17px; font-weight: 750; transition: transform .16s, border-color .16s, background .16s; }
button:not(:disabled):hover, .button-link:hover { transform: translateY(-1px); }
.primary { color: #17130c; background: var(--gold); }
.secondary { border: 1px solid var(--line); background: #202b3b; }
.compact { min-height: 36px; padding: 7px 11px; font-size: .78rem; }
.large { min-width: 220px; }
.icon-button { width: 40px; min-height: 40px; padding: 0; border: 1px solid var(--line); background: transparent; font-size: 1.2rem; }
.section-title, .workspace-title, .army-title, .source-heading, .panel-title, .form-footer, .start-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.battle-list { display: grid; gap: 8px; margin-top: 20px; }
.battle-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); }
.battle-row:hover { border-color: var(--line-strong); }
.battle-row-link { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 18px; min-width: 0; }
.hidden-battle-row { border-color: rgba(215, 175, 99, .28); background: rgba(215, 175, 99, .035); }
.hidden-badge { display: inline-block; margin-left: 8px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 7px; color: var(--gold); font-size: .61rem; font-style: normal; font-weight: 700; text-transform: uppercase; }
.delete-battle-button { min-height: 34px; border: 1px solid rgba(228, 127, 119, .3); padding: 6px 10px; color: var(--red); background: rgba(228, 127, 119, .06); font-size: .72rem; }
.battle-row strong, .battle-row small { display: block; }
.battle-row small { margin-top: 5px; color: var(--muted); font-size: .75rem; }
.row-meta { color: var(--gold); text-align: right; font-size: .78rem; }
.retention-note { margin: 18px 0 0; font-size: .78rem; }
.empty-state { display: grid; gap: 5px; place-items: center; padding: 32px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }

.workspace-title { margin: 34px 4px 24px; }
.workspace-title h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.code-chip { min-height: 0; margin-left: 7px; border: 1px solid var(--line-strong); padding: 4px 8px; color: var(--gold); background: transparent; font-family: ui-monospace, monospace; font-size: .68rem; letter-spacing: .12em; }
.battle-tabs { position: sticky; z-index: 5; top: 8px; display: flex; gap: 6px; margin-bottom: 20px; padding: 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: rgba(11, 16, 24, .9); backdrop-filter: blur(18px); }
.battle-tabs button { flex: 1; min-width: max-content; color: var(--muted); background: transparent; }
.battle-tabs button.active { color: var(--text); background: var(--surface-2); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.intro { max-width: 760px; margin: 38px 4px 24px; }
.intro h2 { margin-top: 7px; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.panel { padding: 24px; }
.panel-title { justify-content: flex-start; margin-bottom: 22px; }
.panel-title p, .army-title p { margin: 0; }
.import-form button { margin-top: 14px; }
.army-letter { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold); font-family: Georgia, serif; font-size: 1.2rem; }
.army-section { margin: 34px 0 48px; }
.army-title { justify-content: flex-start; margin-bottom: 16px; }
.army-title h2 { margin: 0; }
.config-list { display: grid; gap: 16px; }
.source-form { box-shadow: none; }
.source-heading h3 { margin-top: 5px; font-size: 1.22rem; }
.model-badge { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--muted); font-size: .72rem; }
.form-grid { display: grid; gap: 12px; }
.scale-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; }
.stats-grid { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
.check-label { display: flex; align-items: center; gap: 9px; min-height: 66px; padding-top: 20px; }
.check-label input { width: 18px; min-height: 18px; accent-color: var(--gold); }
.check-label span { margin: 0; }
.subsection { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.subsection h4 { color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.option-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.option-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.option-line > span { margin: 0; }
.option-line small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.option-line input { width: 76px; min-height: 38px; }
.form-footer { margin-top: 20px; }
.validation { color: var(--muted); font-size: .78rem; }
.validation.valid { color: var(--green); }
.validation.invalid, .error-text { color: var(--red); }

.regiment-layout { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: 18px; }
.source-pool, .regiment-column { display: grid; align-content: start; gap: 10px; }
.source-pool > h3, .regiment-column > h3 { color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.pool-source, .regiment-card, .empty-regiment { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface); }
.pool-source[draggable="true"] { cursor: grab; }
.pool-source.depleted { opacity: .52; }
.pool-source .source-heading { align-items: flex-start; }
.pool-source .source-heading h3 { font-size: 1rem; }
.pool-source .model-badge { display: none; }
.pool-source p { margin: 10px 0; font-size: .78rem; }
.capacity-note { display: block; margin: 5px 0 11px; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.regiment-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.regiment-main { flex: 1; min-width: 0; }
.regiment-card p { margin: 0; font-size: .78rem; }
.stepper { display: flex; align-items: center; gap: 7px; }
.stepper button { width: 36px; min-height: 36px; padding: 0; border: 1px solid var(--line); background: var(--surface-2); }
.stepper .stepper-bound { width: auto; min-width: 44px; padding: 0 8px; color: var(--gold); font-size: .68rem; text-transform: uppercase; }
.stepper strong { min-width: 28px; text-align: center; }
.stepper .delete { margin-left: 8px; color: var(--red); }
.attached-agents { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.attached-agents > small { width: 100%; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; }
.agent-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid rgba(215, 175, 99, .32); border-radius: 999px; padding: 5px 8px; color: var(--gold); background: rgba(215, 175, 99, .07); font-size: .72rem; }
.agent-chip button { width: 20px; min-height: 20px; padding: 0; color: var(--red); background: transparent; }

.confirmation-modal { width: min(480px, calc(100% - 28px)); border: 1px solid var(--line-strong); border-radius: 16px; padding: 0; color: var(--text); background: #111a26; box-shadow: 0 30px 100px rgba(0, 0, 0, .7); }
.confirmation-modal::backdrop { background: rgba(3, 7, 12, .78); backdrop-filter: blur(4px); }
.confirmation-card { padding: 28px; }
.confirmation-card h2 { margin-top: 8px; font-family: Georgia, serif; font-size: 1.65rem; }
.confirmation-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.danger { border: 1px solid rgba(228, 127, 119, .38); color: #fff; background: #9f403c; }
.integrated-agent { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 10px 16px; align-items: center; margin-top: 10px; padding: 11px; border: 1px solid rgba(215, 175, 99, .28); border-radius: 10px; background: rgba(215, 175, 99, .055); }
.integrated-agent > div:first-child small, .agent-health > small { display: block; color: var(--muted); font-size: .59rem; letter-spacing: .07em; text-transform: uppercase; }
.integrated-agent > div:first-child strong { display: block; margin-top: 3px; color: var(--gold); font-size: .82rem; }
.integrated-agent.agent-defeated { border-color: rgba(198, 69, 69, .45); background: rgba(198, 69, 69, .08); }
.integrated-agent.agent-defeated > div:first-child strong, .integrated-agent.agent-defeated .agent-health strong { color: var(--red); }
.agent-health { text-align: center; }
.agent-health .counter-control { margin-top: 4px; }
.agent-health .counter-control strong { min-width: 58px; }
.agent-moral { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 90px; align-items: center; gap: 10px; }
.agent-moral > span { color: var(--muted); font-size: .62rem; letter-spacing: .07em; text-transform: uppercase; }
.agent-moral input { min-height: 32px; padding: 4px 7px; color: var(--gold); text-align: center; font-weight: 800; }
.agent-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; }
.agent-actions .secondary { flex: 1 1 145px; }
.agent-actions .secondary:disabled { opacity: .48; cursor: not-allowed; }
.join-actions select { flex: 2 1 190px; min-height: 34px; }
.ability-titles span.agent-ability { border-color: rgba(215, 175, 99, .38); color: var(--gold); }
.ability-titles span.agent-ability b { font-size: .62rem; letter-spacing: .05em; text-transform: uppercase; }
.agent-drop-zone { margin-top: 12px; border: 1px dashed var(--line); border-radius: 9px; padding: 9px; color: var(--muted); font-size: .72rem; }
.agent-drop-zone.drag-over { border-color: var(--gold); background: rgba(215, 175, 99, .08); }
.agent-picker { display: flex; gap: 6px; margin-top: 7px; }
.agent-picker select { min-height: 34px; padding: 5px 8px; font-size: .72rem; }
.empty-regiment { display: grid; min-height: 100px; place-items: center; align-content: center; border-style: dashed; color: var(--muted); text-align: center; transition: border-color .15s, background .15s; }
.empty-regiment span { margin-top: 5px; font-size: .75rem; }
.empty-regiment.drag-over { border-color: var(--gold); background: rgba(215, 175, 99, .08); }
.start-bar { position: sticky; bottom: 12px; z-index: 4; padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(18, 26, 38, .95); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.start-bar strong, .start-bar span { display: block; }
.start-bar span { margin-top: 4px; color: var(--muted); font-size: .75rem; }

.locked-card { display: grid; max-width: 780px; margin: 70px auto; place-items: center; padding: clamp(30px, 6vw, 70px); text-align: center; }
.lock-glyph { margin-bottom: 14px; color: var(--gold); font-size: 3rem; }
.locked-card p { max-width: 560px; }
.battle-regiments { display: grid; gap: 10px; }
.battle-setup { max-width: 980px; margin: 0 auto; }
.rule-card { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: clamp(24px, 4vw, 42px); background: linear-gradient(145deg, rgba(33, 42, 55, .98), rgba(16, 23, 34, .98)); box-shadow: var(--shadow); }
.rule-card h3, .rule-card h2 { margin-top: 8px; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.rule-card p:last-child { margin-bottom: 0; }
.rule-number, .rail-title, .phase-kicker { color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.role-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.role-card { display: flex; gap: 14px; align-items: center; min-height: 96px; border: 1px solid var(--line); padding: 18px; text-align: left; background: var(--surface); }
.role-card:hover { border-color: var(--gold); }
.role-card small, .role-card strong, .role-card em { display: block; }
.role-card small { color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.role-card strong { margin: 3px 0; }
.role-card em { color: var(--muted); font-size: .72rem; font-style: normal; }
.role-summary { display: flex; gap: 10px; margin: 38px 0 18px; }
.role-summary > span { min-width: 150px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.role-summary small, .role-summary strong { display: block; }
.role-summary small { color: var(--muted); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
.role-summary strong { margin-top: 3px; }
.magic-question { text-align: center; }
.magic-question p { max-width: 680px; margin-right: auto; margin-left: auto; }
.question-actions { display: flex; justify-content: center; gap: 9px; margin-top: 24px; }
.battle-dashboard { display: grid; gap: 18px; }
.round-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 26px 4px 2px; }
.round-header h2 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 2.5rem; font-weight: 500; }
.compact-summary { margin: 0; }
.phase-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
.phase-rail, .current-phase, .history-panel, .forces-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.phase-rail { display: grid; align-content: start; gap: 7px; padding: 20px; }
.rail-title { margin-bottom: 8px; }
.phase-marker { display: flex; gap: 10px; align-items: center; border-radius: 9px; padding: 10px; color: var(--muted); }
.phase-marker > span { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: .7rem; }
.phase-marker strong { font-size: .8rem; }
.phase-marker.complete { color: var(--green); }
.phase-marker.complete > span { border-color: rgba(108, 198, 155, .4); }
.phase-marker.active { color: var(--text); background: var(--surface-2); }
.phase-marker.active > span { border-color: var(--gold); color: var(--gold); }
.phase-marker.debug-selectable { width: 100%; min-height: 0; border: 1px solid transparent; background-color: transparent; text-align: left; }
.phase-marker.debug-selectable:hover { border-color: var(--line-strong); background: rgba(215, 175, 99, .07); }
.phase-marker.debug-selectable.active { background: var(--surface-2); }
.debug-separator { height: 1px; margin: 10px 0 5px; background: var(--line); }
.debug-phase-toggle { min-height: 36px; border: 1px solid var(--line); color: var(--muted); background: transparent; font-size: .75rem; }
.debug-phase-toggle.active { border-color: var(--gold); color: var(--gold); background: rgba(215, 175, 99, .08); }
.debug-hint { color: var(--muted); font-size: .64rem; line-height: 1.4; }
.current-phase { padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); }
.current-phase h2 { margin: 8px 0 20px; font-family: Georgia, serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 500; }
.acting-camp { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line-strong); border-radius: 11px; padding: 12px; background: rgba(215, 175, 99, .06); }
.acting-camp small, .acting-camp strong { display: block; }
.acting-camp small { color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.acting-camp.neutral { color: var(--gold); }
.phase-rule { margin: 22px 0; color: var(--muted); line-height: 1.55; }
.phase-rule p { color: var(--text); }
.phase-rule ul { margin: 10px 0; padding-left: 20px; }
.phase-rule li + li { margin-top: 7px; }
.advance-slider { --advance-progress: 0%; --advance-offset: 4px; --advance-fill: 58px; position: relative; height: 62px; margin-top: 38px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 13px; background: #0c131c; box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); user-select: none; }
.advance-slider-fill { position: absolute; inset: 0 auto 0 0; width: var(--advance-fill); background: linear-gradient(90deg, rgba(215,175,99,.34), rgba(215,175,99,.1)); }
.advance-slider-label { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 58px; color: #c8d0da; font-size: .78rem; font-weight: 750; letter-spacing: .025em; pointer-events: none; }
.advance-handle { position: absolute; z-index: 2; top: 4px; left: var(--advance-offset); display: grid; width: 54px; min-height: 52px; place-items: center; padding: 0; color: #17130c; background: var(--gold); box-shadow: 0 5px 16px rgba(0,0,0,.3); font-size: 1.35rem; touch-action: none; }
.advance-slider.dragging { border-color: var(--gold); }
.advance-slider.resetting .advance-handle, .advance-slider.resetting .advance-slider-fill { transition: left .24s ease, width .24s ease; }
.advance-slider.confirmed { border-color: var(--green); }
.advance-slider.confirmed .advance-slider-fill { background: rgba(108,198,155,.28); }
.advance-slider.confirmed .advance-handle { background: var(--green); }
.shooting-assistant { margin: 22px 0; border: 1px solid var(--line-strong); border-radius: 14px; padding: 20px; background: linear-gradient(145deg, rgba(37, 46, 59, .92), rgba(13, 20, 29, .96)); }
.shooting-assistant h3 { margin: 6px 0; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.shooting-assistant h3 span { color: var(--gold); }
.shooting-assistant p { margin-bottom: 0; }
.duel-assistant { border-color: rgba(212, 175, 55, .55); box-shadow: 0 18px 45px rgba(0, 0, 0, .22), inset 0 1px rgba(255, 255, 255, .04); }
.duel-type-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; }
.resolution-effects { display: grid; gap: .55rem; margin: 1rem 0; padding: 1rem; border: 1px solid rgba(212, 175, 55, .22); border-radius: 12px; background: rgba(10, 14, 18, .45); }
.resolution-effects h4 { margin: 0 0 .25rem; }
.resolution-effects > div { padding: .65rem .75rem; border-left: 3px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .025); }
.resolution-effects > .selected-effect { border-left-color: var(--gold); }
.resolution-effects strong, .resolution-effects p { display: block; margin: 0; }
.resolution-effects p { margin-top: .2rem; color: var(--muted); font-size: .88rem; }
.agent-damage-field { border-color: rgba(212, 175, 55, .28) !important; }
.confrontation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.shooting-result .confrontation-heading h3 small { color: var(--gold); font-size: .68em; font-weight: 700; white-space: nowrap; }
.shooting-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 20px; }
.effective-equipment { color: var(--gold); font-weight: 750; }
.effective-equipment-note { margin: 0 0 12px; color: var(--muted); font-size: .75rem; }
.effective-equipment-note strong { color: var(--gold); }
.range-field { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #0e151f; }
.range-field > span { margin-bottom: 5px; }
.range-field input { min-height: 24px; padding: 0; border: 0; accent-color: var(--gold); box-shadow: none; }
.live-modifier { display: inline-block; margin-left: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; color: var(--muted); background: rgba(255,255,255,.035); font-size: .68rem; font-style: normal; letter-spacing: 0; }
.live-modifier.positive { border-color: rgba(108, 198, 155, .34); color: var(--green); background: rgba(108, 198, 155, .08); }
.live-modifier.negative { border-color: rgba(228, 127, 119, .34); color: var(--red); background: rgba(228, 127, 119, .08); }
.live-modifier.neutral { color: var(--muted); }
.shooting-options { margin-top: 20px; }
.shooting-options h4 { color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.shooting-options label { display: flex; gap: 10px; align-items: flex-start; margin-top: 7px; border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: rgba(255,255,255,.02); }
.shooting-options input { flex: 0 0 auto; width: 18px; min-height: 18px; accent-color: var(--gold); }
.shooting-options label > span { margin: 0; }
.shooting-options strong, .shooting-options small { display: block; }
.shooting-options small { margin-top: 3px; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.shooting-reminders { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 15px; }
.shooting-reminders summary { cursor: pointer; color: var(--gold); font-size: .78rem; font-weight: 750; }
.shooting-reminders > div { margin-top: 10px; border-left: 2px solid var(--line-strong); padding-left: 10px; }
.shooting-reminders > div strong > span { margin-right: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 5px; color: var(--muted); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; }
.shooting-reminders p { margin: 3px 0 0; font-size: .72rem; }
.confrontation-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.attack-summary { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 11px 13px; border: 1px solid rgba(215, 175, 99, .3); border-radius: 10px; background: rgba(215, 175, 99, .06); }
.attack-summary > span { flex: 0 0 auto; text-align: center; }
.attack-summary small, .attack-summary strong { display: block; }
.attack-summary small { color: var(--muted); font-size: .61rem; letter-spacing: .06em; text-transform: uppercase; }
.attack-summary strong { margin-top: 2px; color: var(--gold); font-size: 1.35rem; }
.attack-summary p { margin: 0; color: var(--muted); font-size: .73rem; }
.attack-summary.dual { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.difficulty-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 7px; margin: 18px 0; }
.difficulty-breakdown span { border: 1px solid var(--line); border-radius: 9px; padding: 9px; text-align: center; background: rgba(255,255,255,.02); }
.difficulty-breakdown small, .difficulty-breakdown strong { display: block; }
.difficulty-breakdown small { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.difficulty-breakdown strong { margin-top: 4px; }
.critical-note { border-radius: 9px; padding: 11px; color: var(--muted); background: rgba(215,175,99,.06); font-size: .72rem; }
.loss-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 18px; }
.loss-grid small { display: block; margin-top: 5px; color: var(--muted); font-size: .68rem; }
.history-panel, .forces-panel { padding: 16px 18px; }
.history-panel summary, .forces-panel summary { cursor: pointer; font-weight: 750; }
.history-panel > div { display: grid; gap: 5px; margin-top: 12px; color: var(--muted); font-size: .75rem; }
.forces-panel > .two-columns { margin-top: 16px; }
.tactical-forces { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.tactical-heading { margin: 0 4px 20px; }
.tactical-heading h2 { margin: 6px 0; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.tactical-heading p { margin-bottom: 0; }
.tactical-armies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.tactical-army { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: rgba(18, 26, 38, .62); }
.tactical-army.current-army { border-color: var(--line-strong); box-shadow: 0 0 0 1px rgba(215, 175, 99, .08); }
.tactical-list { display: grid; gap: 11px; }
.tactical-regiment { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; padding: 16px; background: linear-gradient(145deg, rgba(24, 34, 49, .96), rgba(15, 22, 32, .96)); transition: border-color .18s, transform .18s, opacity .18s; }
.tactical-regiment.phase-relevant { border-color: rgba(215, 175, 99, .38); }
.tactical-regiment.active-side-regiment { border-color: var(--gold); background: linear-gradient(145deg, rgba(54, 46, 31, .7), rgba(21, 27, 36, .98)); box-shadow: 0 12px 34px rgba(0, 0, 0, .2); }
.tactical-regiment.active-side-regiment::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--gold); content: ""; }
.tactical-regiment.out-of-action { opacity: .56; filter: saturate(.5); }
.tactical-regiment.zero-morale { border-color: rgba(228, 127, 119, .9); background: linear-gradient(145deg, rgba(74, 28, 31, .88), rgba(28, 17, 21, .98)); box-shadow: 0 0 0 1px rgba(228, 127, 119, .18), 0 12px 34px rgba(0, 0, 0, .22); }
.tactical-regiment.destroyed-regiment { border-color: #080a0d; opacity: .72; background: linear-gradient(145deg, #080a0d, #020304); box-shadow: inset 0 0 0 1px rgba(255,255,255,.035); filter: grayscale(1); }
.death-icon { margin-right: 7px; color: #d9dde2; font-size: 1.15em; }
.tactical-regiment.shoot-selectable { cursor: crosshair; border-color: rgba(108, 198, 155, .55); }
.tactical-regiment.shoot-selectable:hover { transform: translateY(-2px); border-color: var(--green); }
.tactical-regiment.shoot-source { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(215, 175, 99, .28); }
.tactical-regiment.shoot-target { border-color: var(--red); box-shadow: inset 0 0 0 1px rgba(228, 127, 119, .28); }
.tactical-regiment > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tactical-regiment h3 { margin: 4px 0 0; font-size: 1.06rem; }
.tactical-regiment header p { margin: 4px 0 0; font-size: .7rem; }
.relevance-badge { flex: 0 0 auto; border: 1px solid rgba(215, 175, 99, .35); border-radius: 999px; padding: 5px 8px; color: var(--gold); background: rgba(215, 175, 99, .08); font-size: .62rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.model-counters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.model-counter { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 9px; background: rgba(7, 11, 17, .24); text-align: center; }
.model-counter > small { display: block; margin-bottom: 5px; color: var(--muted); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; }
.model-counter.alive strong { display: block; color: var(--green); font-size: 1.35rem; }
.model-counter.alive span { color: var(--muted); font-size: .64rem; }
.model-counter.fleeing .counter-control strong { color: var(--gold); }
.counter-control { display: flex; align-items: center; justify-content: center; gap: 5px; }
.counter-control button { width: 28px; min-height: 28px; padding: 0; border: 1px solid var(--line); background: var(--surface-2); }
.counter-control strong { min-width: 22px; font-size: 1.05rem; }
.tactical-profile { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.tactical-profile > span { min-width: 0; border-radius: 7px; padding: 7px; background: rgba(255, 255, 255, .025); text-align: center; }
.tactical-profile small, .tactical-profile strong { display: block; }
.tactical-profile small { color: var(--muted); font-size: .57rem; letter-spacing: .06em; text-transform: uppercase; }
.tactical-profile strong { margin-top: 3px; font-size: .8rem; }
.tactical-profile .moral-stat input { min-height: 29px; margin-top: 3px; padding: 3px 5px; border-radius: 6px; color: var(--gold); text-align: center; font-size: .8rem; font-weight: 800; }
.tactical-regiment.zero-morale .moral-stat input { border-color: var(--red); color: #ffd4d0; background: rgba(60, 10, 14, .72); }
.armor-stat strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ability-titles { margin-top: 11px; }
.ability-titles > small { color: var(--muted); font-size: .6rem; letter-spacing: .06em; text-transform: uppercase; }
.ability-titles > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.ability-titles span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 7px; color: #bcc7d3; background: rgba(255,255,255,.02); font-size: .63rem; }
.ability-titles em { display: block; margin-top: 4px; color: var(--muted); font-size: .68rem; font-style: normal; }
.progress-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 28px; }
.progress-list span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: var(--muted); font-size: .72rem; }
.progress-list span.done { border-color: rgba(108, 198, 155, .4); color: var(--green); }
.flash { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: 420px; border: 1px solid rgba(108, 198, 155, .4); border-radius: 11px; padding: 13px 16px; background: #15271f; box-shadow: var(--shadow); }
.flash.error { border-color: rgba(228, 127, 119, .45); background: #2c191b; }
.busy { cursor: progress; }
.muted { color: var(--muted); }

@media (max-width: 900px) {
    .home-layout, .two-columns, .regiment-layout, .tactical-armies { grid-template-columns: 1fr; }
    .scale-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .phase-layout { grid-template-columns: 1fr; }
    .phase-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rail-title, .debug-separator, .debug-phase-toggle, .debug-hint { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .battle-shell { width: min(100% - 18px, 1400px); padding-top: 9px; }
    .battle-header { padding: 10px 12px; }
    .quiet-link { display: none; }
    .hero-card, .join-card, .active-card, .panel { padding: 20px; }
    .inline-form, .workspace-title, .start-bar, .regiment-card { align-items: stretch; flex-direction: column; }
    .battle-row { align-items: flex-start; flex-direction: column; }
    .battle-row-link { width: 100%; align-items: flex-start; flex-direction: column; }
    .row-meta { text-align: left; }
    .option-list, .scale-grid, .stats-grid { grid-template-columns: 1fr; }
    .role-choice { grid-template-columns: 1fr; }
    .round-header, .question-actions { align-items: stretch; flex-direction: column; }
    .role-summary { width: 100%; }
    .role-summary > span { flex: 1; min-width: 0; }
    .phase-rail { grid-template-columns: 1fr 1fr; }
    .tactical-army { padding: 12px; }
    .tactical-profile { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stepper { justify-content: flex-end; }
    .inline-form .hidden-battle-choice { flex-basis: auto; }
    .start-bar { display: flex; }
    .large { width: 100%; }
    .shooting-fields, .loss-grid { grid-template-columns: 1fr; }
    .confrontation-heading, .confrontation-actions { align-items: stretch; flex-direction: column; }
    .duel-type-choice { grid-template-columns: 1fr; }
}

@media print {
    body { color: #111; background: #fff; }
    .battle-header, .battle-tabs, .flash, button, .advance-slider, .empty-regiment, .source-pool, .start-bar { display: none !important; }
    .battle-shell { width: 100%; padding: 0; }
    .tab-panel { display: none !important; }
    #panel-battle.active { display: block !important; }
    .panel, .regiment-card { color: #111; border-color: #bbb; background: #fff; box-shadow: none; }
    p, .muted { color: #444; }
}
