:root {
    --wg-red: #ff4d4f;
    --wg-gold: #f4bd50;
    --wg-cyan: #69d8ee;
    --wg-ink: #07090d;
    --wg-panel: rgba(16, 20, 27, 0.94);
    --wg-panel-soft: rgba(22, 27, 36, 0.9);
    --wg-line: rgba(255, 255, 255, 0.11);
    --wg-line-strong: rgba(255, 255, 255, 0.2);
    --wg-copy: #e8ebf1;
    --wg-muted: #aab2c0;
}

body.war-bg { display: flex; flex-direction: column; }

.brand-page {
    flex: 1 0 auto;
    width: 100%;
    padding: clamp(24px, 4vw, 58px) 18px clamp(64px, 8vw, 104px);
    color: var(--wg-copy);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.brand-shell { width: min(1180px, 100%); margin: 0 auto; }

.command-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: end;
    padding: clamp(28px, 5vw, 64px);
    border: 1px solid var(--wg-line-strong);
    border-top: 3px solid var(--wg-red);
    border-radius: 18px;
    background: linear-gradient(115deg, rgba(13, 16, 22, 0.98), rgba(13, 16, 22, 0.93) 58%, rgba(29, 13, 16, 0.9));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.04);
}

.command-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: linear-gradient(rgba(255,255,255,.026) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.026) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(90deg, #000, rgba(0,0,0,.65) 65%, transparent);
}

.command-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 420px;
    height: 420px;
    right: -150px;
    top: -190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,77,79,.24), transparent 68%);
}

.command-kicker, .section-kicker, .data-label {
    color: var(--wg-red);
    font-family: "Courier New", monospace;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.command-title {
    max-width: 800px;
    margin: 10px 0 14px;
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: clamp(2.2rem, 6vw, 4.65rem);
    font-weight: 700;
    line-height: .98;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.command-lead {
    max-width: 720px;
    margin: 0;
    color: #c8ced9;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.7;
}

.command-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.command-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 18px;
    border: 1px solid var(--wg-line-strong);
    border-radius: 8px;
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.command-action:hover, .command-action:focus-visible {
    color: #fff;
    border-color: rgba(255,255,255,.5);
    background: rgba(255,255,255,.08);
    transform: translateY(-1px);
}

.command-action--primary {
    border-color: var(--wg-red);
    background: linear-gradient(135deg, #d9363e, #b9272e);
    box-shadow: 0 8px 24px rgba(185,39,46,.28);
}

.command-action--primary:hover, .command-action--primary:focus-visible {
    border-color: #ff7476;
    background: linear-gradient(135deg, #ec4650, #c92c35);
}

.command-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-self: stretch; }

.command-metric {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 108px;
    padding: 18px;
    border: 1px solid var(--wg-line);
    border-radius: 12px;
    background: rgba(4,6,10,.58);
}

.command-metric strong { display: block; color: #fff; font-family: "Courier New", monospace; font-size: clamp(1.3rem, 3vw, 2rem); line-height: 1; }
.command-metric span { margin-top: 8px; color: var(--wg-muted); font-size: .73rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }

.brand-jump-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.brand-jump-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--wg-line);
    border-radius: 999px;
    background: rgba(7,9,13,.78);
    color: #cbd1dc;
    font-family: "Courier New", monospace;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-decoration: none;
    text-transform: uppercase;
}
.brand-jump-nav a:hover, .brand-jump-nav a:focus-visible { border-color: var(--wg-red); color: #fff; }

.manual-layout { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 24px; margin-top: 28px; align-items: start; }
.manual-nav {
    position: sticky;
    top: 88px;
    overflow: hidden;
    border: 1px solid var(--wg-line);
    border-radius: 14px;
    background: rgba(10,13,18,.92);
    box-shadow: 0 18px 42px rgba(0,0,0,.24);
}
.manual-nav__title { margin: 0; padding: 17px 18px; border-bottom: 1px solid var(--wg-line); color: var(--wg-red); font-family: "Courier New", monospace; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.manual-nav ol { margin: 0; padding: 8px; list-style: none; counter-reset: manual; }
.manual-nav li { counter-increment: manual; }
.manual-nav a { display: grid; grid-template-columns: 28px 1fr; gap: 7px; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: 8px; color: #aeb6c4; font-size: .86rem; font-weight: 600; text-decoration: none; }
.manual-nav a::before { content: counter(manual, decimal-leading-zero); color: var(--wg-red); font-family: "Courier New", monospace; font-size: .69rem; }
.manual-nav a:hover, .manual-nav a:focus-visible { background: rgba(255,255,255,.06); color: #fff; }
.manual-content { display: grid; gap: 18px; min-width: 0; }

.guide-section, .leaderboard-panel {
    scroll-margin-top: 92px;
    overflow: hidden;
    border: 1px solid var(--wg-line);
    border-radius: 15px;
    background: var(--wg-panel);
    box-shadow: 0 18px 46px rgba(0,0,0,.25);
}
.guide-section__header, .leaderboard-panel__header { padding: 22px clamp(20px,4vw,34px) 18px; border-bottom: 1px solid var(--wg-line); background: linear-gradient(90deg, rgba(255,77,79,.08), transparent 62%); }
.guide-section__header h2, .leaderboard-panel__header h2 { margin: 4px 0 0; color: #fff; font-family: "Courier New", monospace; font-size: clamp(1.35rem,3vw,2rem); font-weight: 700; letter-spacing: -.025em; }
.guide-section__body, .leaderboard-panel__body { padding: clamp(20px,4vw,34px); }
.guide-section p, .guide-section li { color: #c5cbd6; line-height: 1.72; }
.guide-section strong { color: #fff; }

.quick-steps { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: quickstep; }
.quick-steps li { counter-increment: quickstep; position: relative; min-height: 112px; padding: 18px 18px 18px 60px; border: 1px solid var(--wg-line); border-radius: 11px; background: var(--wg-panel-soft); }
.quick-steps li::before { content: counter(quickstep, decimal-leading-zero); position: absolute; top: 18px; left: 18px; color: var(--wg-red); font-family: "Courier New", monospace; font-size: .85rem; font-weight: 700; }
.quick-steps strong { display: block; margin-bottom: 4px; }

.data-grid, .unit-grid, .structure-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.data-card, .unit-card, .structure-card { position: relative; min-width: 0; padding: 18px; border: 1px solid var(--wg-line); border-radius: 11px; background: var(--wg-panel-soft); }
.accent-land { --card-accent: #c7a27a; }
.accent-sea { --card-accent: #4aa8df; }
.accent-mountain { --card-accent: #9a7965; }
.accent-intel { --card-accent: #69d8ee; }
.accent-infantry { --card-accent: #e8ebf1; }
.accent-airborne { --card-accent: #d5aa7e; }
.accent-armor { --card-accent: #aab2c0; }
.accent-air { --card-accent: #69d8ee; }
.accent-naval { --card-accent: #4aa8df; }
.accent-airfield { --card-accent: #f4bd50; }
.accent-defense { --card-accent: #ff4d4f; }
.accent-bunker { --card-accent: #aab2c0; }
.accent-artillery { --card-accent: #e99c50; }
.accent-yard { --card-accent: #4aa8df; }
.data-card::before, .unit-card::before, .structure-card::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 2px 2px 0; background: var(--card-accent, var(--wg-red)); }
.data-card h3, .unit-card h3, .structure-card h3 { margin: 4px 0 8px; color: #fff; font-family: "Courier New", monospace; font-size: 1.05rem; font-weight: 700; }
.data-card p, .unit-card p, .structure-card p { margin: 0; font-size: .93rem; }
.unit-card__top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.unit-code { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex: 0 0 48px; border: 1px solid var(--card-accent, var(--wg-red)); border-radius: 9px; background: rgba(0,0,0,.25); color: var(--card-accent, var(--wg-red)); font-family: "Courier New", monospace; font-size: .72rem; font-weight: 700; }
.unit-stats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.unit-stat { padding: 5px 8px; border: 1px solid var(--wg-line); border-radius: 999px; color: #d7dce4; font-family: "Courier New", monospace; font-size: .69rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.guide-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.guide-list li { position: relative; padding: 12px 14px 12px 38px; border: 1px solid rgba(255,255,255,.075); border-radius: 9px; background: rgba(255,255,255,.025); }
.guide-list li::before { content: "+"; position: absolute; left: 14px; top: 12px; color: var(--wg-red); font-family: "Courier New", monospace; font-weight: 700; }
.intel-callout { margin-top: 18px; padding: 17px 18px; border: 1px solid rgba(105,216,238,.25); border-left: 4px solid var(--wg-cyan); border-radius: 9px; background: rgba(105,216,238,.055); color: #cad9de; }
.intel-callout strong { display: block; margin-bottom: 4px; color: var(--wg-cyan); font-family: "Courier New", monospace; font-size: .75rem; letter-spacing: .11em; text-transform: uppercase; }
.manual-cta { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: clamp(24px,5vw,42px); border: 1px solid rgba(255,77,79,.35); border-radius: 15px; background: linear-gradient(120deg, rgba(80,20,25,.76), rgba(13,16,22,.96)); }
.manual-cta h2 { margin: 0 0 7px; color: #fff; font-family: "Courier New", monospace; font-size: clamp(1.3rem,3vw,1.85rem); }
.manual-cta p { margin: 0; color: #bcc3cf; }

/* Leaderboard */
.leaderboard-page .command-hero { margin-bottom: 16px; }
.lb-container { max-width: none !important; margin: 24px 0 0 !important; padding: 0 !important; }
.leaderboard-section { scroll-margin-top: 90px; margin-top: 30px; }
.leaderboard-section__heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.leaderboard-section__heading h2 { margin: 4px 0 0; color: #fff; font-family: "Courier New", monospace; font-size: clamp(1.35rem,3vw,2rem); font-weight: 700; }
.leaderboard-section__heading p { max-width: 480px; margin: 0; color: var(--wg-muted); font-size: .9rem; text-align: right; }
.leaderboard-page .card { overflow: hidden; border: 1px solid var(--wg-line) !important; border-radius: 14px; background: var(--wg-panel) !important; box-shadow: 0 18px 44px rgba(0,0,0,.24); color: var(--wg-copy); }
.leaderboard-page .card-header { padding: 16px 20px; border-color: var(--wg-line) !important; background: linear-gradient(90deg, rgba(255,77,79,.075), rgba(255,255,255,.018)); color: #fff; font-family: "Courier New", monospace; font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.leaderboard-page .card-header .text-muted { color: #9fa8b7 !important; }
.leaderboard-page .card-body { padding: 20px; }
.leaderboard-page .alert { border: 1px solid var(--wg-line); border-left: 4px solid var(--wg-gold); border-radius: 11px; background: rgba(244,189,80,.075); color: #dce0e7; }
.lb-meta-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.lb-meta-item { min-height: 82px; padding: 14px; border: 1px solid var(--wg-line); border-radius: 10px; background: rgba(7,9,13,.6); }
.lb-meta-item .label { display: block; margin-bottom: 7px; color: #8993a3; font-family: "Courier New", monospace; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lb-meta-item .value { color: #f2f4f8; font-weight: 700; overflow-wrap: anywhere; }

.leaderboard-page .table { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(255,255,255,.025); --bs-table-color: #dce0e7; --bs-table-striped-color: #dce0e7; --bs-table-border-color: rgba(255,255,255,.08); margin: 0; color: #dce0e7; }
.leaderboard-page .table > :not(caption) > * > * { padding: 14px 16px; }
.leaderboard-page .table thead th { border-bottom-color: rgba(255,255,255,.18); color: #9fa8b7; font-family: "Courier New", monospace; font-size: .69rem; letter-spacing: .06em; text-transform: uppercase; }
.leaderboard-page .table tbody tr { transition: background .16s ease; }
.leaderboard-page .table tbody tr:hover { background: rgba(255,255,255,.045); }
.leaderboard-page .table .text-muted { color: #abb3c0 !important; }
.leaderboard-page .table .text-warning { color: var(--wg-gold) !important; }
.rank-1 { color: #ffd664 !important; font-weight: 800; }
.rank-2 { color: #d8e0ea !important; font-weight: 800; }
.rank-3 { color: #e9a56c !important; font-weight: 800; }

.lb-desktop-table { display: block; }
.lb-mobile-list { display: none; }
.lb-mobile-item { margin-bottom: 9px; padding: 14px; border: 1px solid var(--wg-line); border-radius: 10px; background: rgba(7,9,13,.62); }
.lb-mobile-head, .lb-mobile-single { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lb-mobile-head { margin-bottom: 10px; }
.lb-mobile-rank { min-width: 28px; font-family: "Courier New", monospace; font-weight: 800; }
.lb-mobile-name { overflow: hidden; color: #fff; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.lb-mobile-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.lb-mobile-stat { color: #9fa8b7; font-size: .8rem; }
.lb-mobile-stat .v { margin-left: 4px; color: #fff; font-weight: 700; }
.lb-mobile-stat--forces { grid-column: 1 / -1; }
.lb-mobile-single { color: #d5dae3; }
.lb-mobile-single .v { color: var(--wg-gold); font-weight: 800; }
.min-w-0 { min-width: 0; }

/* The Gazette deliberately uses a light newspaper surface. Keep these rules
   more specific than the shared dark card theme above so the background and
   ink can never become an unreadable dark-on-dark combination. */
.leaderboard-page .card.news-shell {
    border-color: #ad8244 !important;
    background:
        linear-gradient(rgba(91, 58, 20, .035), rgba(91, 58, 20, .035)),
        radial-gradient(circle at 18% 8%, #fffbed 0, #f1dfb8 52%, #d4b477 100%) !important;
    box-shadow: 0 18px 44px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.38);
    color: #20160c !important;
}
.leaderboard-page .news-shell .news-paper { color: #20160c; font-family: Georgia, "Times New Roman", serif; }
.leaderboard-page .news-shell .news-kicker { color: #603a0d; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.leaderboard-page .news-shell .news-headline { margin: 7px 0; color: #17100a; font-size: clamp(1.35rem,3vw,2rem); font-weight: 800; line-height: 1.12; overflow-wrap: anywhere; }
.leaderboard-page .news-shell .news-dek { color: #493016; font-size: 1rem; line-height: 1.55; }
.leaderboard-page .news-shell .news-body { color: #24170b; font-size: 1rem; line-height: 1.68; overflow-wrap: anywhere; }
.leaderboard-page .news-shell .news-body p { margin: 0 0 11px; }
.leaderboard-page .news-shell .news-body strong,
.leaderboard-page .news-shell .news-body b { color: #130c06; }
.leaderboard-page .news-shell .news-meta { color: #60421e; font-size: .77rem; }
.leaderboard-page .news-shell .news-archive { margin-top: 15px; padding-top: 13px; border-top: 1px dashed rgba(80,55,20,.42); }
.leaderboard-page .news-shell .news-links { display: flex; flex-wrap: wrap; gap: 8px; }
.leaderboard-page .news-shell .news-links a { padding: 7px 10px; border: 1px solid rgba(30,61,98,.38); border-radius: 999px; background: rgba(255,255,255,.4); color: #1d4778; font-size: .77rem; font-weight: 700; text-decoration: none; }
.leaderboard-page .news-shell .news-links a:hover,
.leaderboard-page .news-shell .news-links a:focus-visible { outline: none; border-color: #173960; background: rgba(255,255,255,.72); color: #102f53; }

@media (max-width: 900px) {
    .command-hero { grid-template-columns: 1fr; align-items: start; }
    .command-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .command-metric { min-height: 90px; padding: 13px; }
    .command-metric strong { font-size: 1.35rem; }
    .manual-layout { grid-template-columns: 1fr; }
    .manual-nav { position: static; }
    .manual-nav ol { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 768px) {
    .brand-page { padding: 14px 10px 60px; }
    .command-hero { padding: 24px 18px; border-radius: 13px; }
    .command-title { font-size: clamp(2rem,12vw,3.2rem); }
    .command-lead { font-size: .98rem; line-height: 1.6; }
    .command-actions { display: grid; grid-template-columns: 1fr; }
    .command-action { width: 100%; }
    .command-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .brand-jump-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .brand-jump-nav a { justify-content: center; text-align: center; }
    .manual-nav ol { grid-template-columns: 1fr; }
    .guide-section__header, .guide-section__body { padding: 19px 17px; }
    .quick-steps, .data-grid, .unit-grid, .structure-grid { grid-template-columns: 1fr; }
    .manual-cta { align-items: stretch; flex-direction: column; }
    .leaderboard-section { margin-top: 24px; }
    .leaderboard-section__heading { align-items: start; flex-direction: column; gap: 5px; }
    .leaderboard-section__heading p { text-align: left; }
    .leaderboard-page .card-header { padding: 13px 14px !important; font-size: .76rem; }
    .leaderboard-page .card-body { padding: 13px 14px !important; }
    .lb-meta-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .lb-meta-item { min-height: 74px; padding: 12px; }
    .lb-desktop-table { display: none; }
    .lb-mobile-list { display: block; }
}

@media (max-width: 420px) {
    .command-metric { min-height: 82px; }
    .command-metric strong { font-size: 1.18rem; }
    .command-metric span { font-size: .65rem; }
    .brand-jump-nav, .lb-meta-grid { grid-template-columns: 1fr; }
    .lb-mobile-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .command-action, .leaderboard-page .table tbody tr { transition: none; }
}
