:root {
    --bg: #101318;
    --surface: #181d24;
    --surface-strong: #222934;
    --panel: #141920;
    --border: #303947;
    --text: #eef2f6;
    --muted: #9aa7b7;
    --accent: #f4d35e;
    --action: #4aa3df;
    --danger: #e66b62;
    --ok: #72d08a;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);

    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

html,
body,
#game {
    font-size: 16px;
    width: 100%;
    min-width: 1024px;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    font-size: 16px;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    background: var(--surface-strong);
    cursor: pointer;
}

button:hover:not(:disabled) {
    border-color: var(--accent);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.menu-screen {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(180deg, rgba(74, 163, 223, 0.14), rgba(16, 19, 24, 0) 340px),
    var(--bg);
}

.menu-panel {
    width: min(420px, 100%);
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(20, 25, 32, 0.94);
    box-shadow: var(--shadow);
}

.menu-logo {
    width: min(320px, 100%);
    justify-self: center;
    object-fit: contain;
}

.menu-actions,
.menu-options {
    display: grid;
    gap: 10px;
}

.menu-primary {
    min-height: 46px;
    border-color: rgba(244, 211, 94, 0.55);
    color: #151515;
    background: var(--accent);
    font-weight: 800;
}

.danger-action {
    border-color: rgba(230, 107, 98, 0.55);
}

.danger-action:hover:not(:disabled) {
    border-color: var(--danger);
}

.menu-options {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.game-shell {
    height: 100svh;
    background: linear-gradient(180deg, rgba(74, 163, 223, 0.12), rgba(16, 19, 24, 0) 260px),
    var(--bg);
}

.workspace {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 450px;
}

.game-canvas {
    height: 100%;
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
    background: #171b20;
}

.game-canvas::-webkit-scrollbar {
    display: none;
}

.game-canvas-scroll-surface {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

.game-canvas canvas {
    position: sticky;
    top: 0;
    left: 0;
    display: block;
    max-width: none;
    max-height: none;
}

.panel-section {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
}

.text-right {
    text-align: right;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.section-heading strong {
    color: var(--accent);
}

.outcome-banner {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
}

.outcome-banner.player-victory {
    border-color: rgba(114, 208, 138, 0.5);
    color: var(--ok);
    background: rgba(114, 208, 138, 0.12);
}

.outcome-banner.enemy-victory {
    border-color: rgba(230, 107, 98, 0.55);
    color: var(--danger);
    background: rgba(230, 107, 98, 0.12);
}

.save-status,
.muted {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.force-list {
    display: grid;
    gap: 8px;
}

.unit-button {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    text-align: left;
}

.unit-button.selected {
    border-color: var(--accent);
}

.unit-button span,
.unit-button small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unit-button small {
    color: var(--muted);
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    color: var(--text);
}

.toggle-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.player-marker {
    background: #64b5f6;
}

.enemy-marker {
    background: #f0625d;
}
