:root {
    color-scheme: dark;
    --bg: #080707;
    --bg-deep: #040404;
    --panel: #14110f;
    --panel-strong: #201a16;
    --panel-bone: #2b241d;
    --text: #efe6d2;
    --muted: #b7a994;
    --line: #4c3729;
    --line-strong: #805733;
    --accent: #c7842d;
    --accent-strong: #f0b45a;
    --accent-cold: #9db7c4;
    --blood: #8e1e1e;
    --blood-bright: #d05245;
    --success: #6fa36d;
    --warning: #c9a24b;
    --shadow: rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% -10%, rgba(199, 132, 45, 0.21), transparent 28rem),
        radial-gradient(circle at 86% 8%, rgba(142, 30, 30, 0.25), transparent 28rem),
        linear-gradient(180deg, #11100f 0%, var(--bg) 42%, var(--bg-deep) 100%);
    color: var(--text);
    font-family: Georgia, "Times New Roman", ui-serif, serif;
}

.background-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.19;
    background-image:
        linear-gradient(rgba(240, 180, 90, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 180, 90, 0.12) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at top, black, transparent 80%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.025)),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0, rgba(255,255,255,0.018) 1px, transparent 1px, transparent 5px);
    mix-blend-mode: screen;
    opacity: 0.45;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem clamp(1rem, 4vw, 3rem);
    border-bottom: 1px solid var(--line-strong);
    background:
        linear-gradient(180deg, rgba(42, 29, 21, 0.94), rgba(12, 10, 9, 0.92)),
        var(--panel);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent-strong);
    text-decoration: none;
    min-width: fit-content;
}

.brand:hover,
nav a:hover {
    color: #ffe1a6;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: radial-gradient(circle, #30251b, #120f0c);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.28), 0 0 24px rgba(199, 132, 45, 0.18);
}

.brand-text {
    display: grid;
    line-height: 1.05;
}

.brand-text strong {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.16em;
    font-weight: 900;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

nav {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: end;
}

nav a,
.button {
    color: var(--text);
    text-decoration: none;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

nav a {
    padding: 0.48rem 0.7rem;
    border: 1px solid transparent;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.78rem;
}

nav a:hover {
    border-color: rgba(240, 180, 90, 0.28);
    background: rgba(199, 132, 45, 0.08);
}

.page-shell {
    position: relative;
    width: min(1560px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
    z-index: 1;
}

.footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--muted);
    padding: 1.4rem clamp(1rem, 4vw, 3rem);
    border-top: 1px solid var(--line);
    background: rgba(5, 4, 4, 0.72);
    font-size: 0.9rem;
}

.panel {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 230, 186, 0.055), rgba(255, 230, 186, 0.015)),
        linear-gradient(135deg, rgba(142, 30, 30, 0.07), transparent 38%),
        var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1.25rem;
    box-shadow: 0 20px 54px var(--shadow);
}

.gothic-panel::before,
.gothic-panel::after,
.archive-table::before,
.archive-table::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    border-color: var(--accent);
    opacity: 0.75;
    pointer-events: none;
}

.gothic-panel::before,
.archive-table::before {
    top: 0.55rem;
    left: 0.55rem;
    border-top: 1px solid;
    border-left: 1px solid;
}

.gothic-panel::after,
.archive-table::after {
    right: 0.55rem;
    bottom: 0.55rem;
    border-right: 1px solid;
    border-bottom: 1px solid;
}

.hero {
    padding: clamp(1.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    overflow: hidden;
}

.hero::after {
    content: "X";
    position: absolute;
    right: clamp(1rem, 5vw, 4rem);
    bottom: -1.5rem;
    color: rgba(240, 180, 90, 0.055);
    font-size: clamp(7rem, 17vw, 18rem);
    line-height: 1;
    font-weight: 900;
    font-family: ui-sans-serif, system-ui, sans-serif;
    pointer-events: none;
}

.hero h1,
.page-header h1 {
    margin: 0.25rem 0 0.75rem;
    font-size: clamp(2.15rem, 4.5vw, 4.9rem);
    line-height: 0.95;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    text-shadow: 0 2px 0 #000, 0 0 28px rgba(199, 132, 45, 0.12);
}

h1,
h2,
legend {
    font-family: Georgia, "Times New Roman", ui-serif, serif;
}

h2 {
    margin: 0 0 1rem;
    color: #f4d49a;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.hero p,
.page-subtitle {
    max-width: 790px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.55;
}

.eyebrow {
    margin: 0;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 800;
    font-size: 0.76rem;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    padding: 0.68rem 1rem;
    border-radius: 2px;
    border: 1px solid var(--line-strong);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.06)),
        var(--panel-strong);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}

.button:hover {
    border-color: var(--accent-strong);
    box-shadow: 0 0 26px rgba(199, 132, 45, 0.15), inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}

.button.primary {
    background:
        linear-gradient(180deg, #e0a451, #a76624),
        var(--accent);
    border-color: #efbc74;
    color: #180e07;
}

.button.ghost {
    background: rgba(6, 6, 6, 0.35);
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.command-strip {
    align-items: stretch;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.servo-card {
    background:
        linear-gradient(90deg, rgba(240, 180, 90, 0.11), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,0.045), transparent),
        var(--panel-strong);
}

.metric-value {
    font-size: clamp(2rem, 3vw, 3.45rem);
    font-weight: 900;
    color: var(--accent-strong);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1;
}

.metric-label,
.muted {
    color: var(--muted);
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.table-panel {
    overflow-x: auto;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
}

.score-table th,
.score-table td {
    padding: 0.95rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid rgba(128, 87, 51, 0.45);
    vertical-align: top;
}

.score-table th {
    color: #e4c58b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: rgba(0, 0, 0, 0.16);
}

.score-table tbody tr:hover {
    background: rgba(199, 132, 45, 0.055);
}

.score-table.compact th,
.score-table.compact td {
    padding: 0.65rem;
}

.date-cell {
    white-space: nowrap;
    color: #f0d5a6;
}

.stacked-line,
.score-line {
    min-height: 1.55rem;
    margin-bottom: 0.25rem;
}

.score-line {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.score-line strong {
    min-width: 2.2rem;
    color: #fff2cf;
    font-family: ui-sans-serif, system-ui, sans-serif;
}

.notes {
    max-width: 30rem;
    color: var(--muted);
    line-height: 1.45;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.48rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--muted);
    font-size: 0.72rem;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.format-tag {
    color: #f4d49a;
    border-color: rgba(240, 180, 90, 0.42);
    background: rgba(199, 132, 45, 0.08);
}

.outcome-tag {
    font-weight: 850;
}

.outcome-victory {
    color: #dff1c5;
    border-color: rgba(111, 163, 109, 0.65);
    background: rgba(111, 163, 109, 0.14);
}

.outcome-defeat {
    color: #ffc0b7;
    border-color: rgba(208, 82, 69, 0.62);
    background: rgba(142, 30, 30, 0.18);
}

.outcome-draw {
    color: #ffe2a6;
    border-color: rgba(201, 162, 75, 0.58);
    background: rgba(201, 162, 75, 0.11);
}

.outcome-undetermined {
    color: var(--accent-cold);
}

.form-panel {
    display: grid;
    gap: 1rem;
}

fieldset {
    border: 1px solid rgba(128, 87, 51, 0.7);
    border-radius: 2px;
    padding: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent),
        rgba(0, 0, 0, 0.14);
}

.commander-card {
    border-top-color: rgba(240, 180, 90, 0.8);
}

.enemy-card {
    border-top-color: rgba(208, 82, 69, 0.82);
}

legend {
    padding: 0 0.4rem;
    color: var(--accent-strong);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

label {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.9rem;
}

label span:first-child {
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

input,
textarea {
    width: 100%;
    border: 1px solid rgba(128, 87, 51, 0.72);
    border-radius: 2px;
    padding: 0.72rem 0.85rem;
    background: #080706;
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 10px rgba(0, 0, 0, 0.45);
}

input::placeholder,
textarea::placeholder {
    color: #776b5d;
}

input:focus,
textarea:focus {
    border-color: var(--accent-strong);
    outline: 2px solid rgba(240, 180, 90, 0.18);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.validation-summary,
.validation-message {
    color: #ffb1a8;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.empty-state {
    text-align: center;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.error-panel {
    max-width: 860px;
}

@media (max-width: 860px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    nav {
        justify-content: flex-start;
    }

    .two-columns,
    .three-columns,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        align-items: start;
        flex-direction: column;
    }

    .hero h1,
    .page-header h1 {
        font-size: clamp(2rem, 13vw, 3.2rem);
    }
}

.actions-cell {
    white-space: nowrap;
}

.button.small {
    min-height: 2rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.7rem;
}

.faction-line {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2rem;
    margin-bottom: 0.35rem;
}

.compact-faction-line {
    margin-bottom: 0;
}

.faction-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(240, 180, 90, 0.45);
    border-radius: 2px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.22)),
        #17120f;
    color: #ffe1a6;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 0 #000;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 18px rgba(199, 132, 45, 0.08);
}

.faction-space-marines,
.faction-grey-knights,
.faction-imperium {
    border-color: rgba(101, 144, 215, 0.72);
    background: linear-gradient(180deg, rgba(94, 128, 194, 0.48), rgba(13, 21, 39, 0.92));
}

.faction-blood-angels,
.faction-world-eaters,
.faction-chaos {
    border-color: rgba(208, 82, 69, 0.84);
    background: linear-gradient(180deg, rgba(145, 28, 24, 0.62), rgba(36, 7, 6, 0.95));
}

.faction-dark-angels,
.faction-militarum,
.faction-orks,
.faction-death-guard,
.faction-tyranids,
.faction-votann {
    border-color: rgba(111, 163, 109, 0.7);
    background: linear-gradient(180deg, rgba(70, 116, 66, 0.52), rgba(11, 28, 13, 0.94));
}

.faction-black-templars,
.faction-necrons {
    border-color: rgba(196, 203, 190, 0.64);
    background: linear-gradient(180deg, rgba(66, 70, 66, 0.52), rgba(8, 9, 8, 0.96));
}

.faction-sororitas,
.faction-custodes,
.faction-imperial-knights {
    border-color: rgba(240, 180, 90, 0.84);
    background: linear-gradient(180deg, rgba(189, 134, 45, 0.58), rgba(45, 28, 8, 0.95));
}

.faction-mechanicus,
.faction-thousand-sons,
.faction-genestealer {
    border-color: rgba(177, 84, 177, 0.72);
    background: linear-gradient(180deg, rgba(121, 51, 129, 0.58), rgba(28, 10, 35, 0.95));
}

.faction-aeldari,
.faction-drukhari,
.faction-tau,
.faction-emperors-children {
    border-color: rgba(157, 183, 196, 0.72);
    background: linear-gradient(180deg, rgba(68, 103, 120, 0.54), rgba(8, 24, 32, 0.95));
}

.faction-unknown {
    border-color: rgba(183, 169, 148, 0.48);
    background: linear-gradient(180deg, rgba(183, 169, 148, 0.22), rgba(16, 14, 12, 0.95));
}

select {
    width: 100%;
    border: 1px solid rgba(128, 87, 51, 0.72);
    border-radius: 2px;
    padding: 0.72rem 0.85rem;
    background: #080706;
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 10px rgba(0, 0, 0, 0.45);
}

select:focus {
    border-color: var(--accent-strong);
    outline: 2px solid rgba(240, 180, 90, 0.18);
}

.battle-report-grid {
    display: grid;
    gap: 1rem;
}

.battle-report {
    overflow: hidden;
}

.battle-report-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.battle-report-header h2 {
    margin-bottom: 0;
}

.battle-report-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.duel-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.combatant-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid rgba(128, 87, 51, 0.55);
    background:
        linear-gradient(120deg, rgba(240, 180, 90, 0.08), transparent 42%),
        rgba(0, 0, 0, 0.22);
}

.combatant-card.outcome-victory {
    border-color: rgba(111, 163, 109, 0.62);
}

.combatant-card.outcome-defeat {
    border-color: rgba(208, 82, 69, 0.50);
}

.combatant-card.outcome-draw {
    border-color: rgba(201, 162, 75, 0.58);
}

.faction-emblem-frame {
    display: inline-grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    padding: 0.35rem;
    border: 1px solid rgba(240, 180, 90, 0.45);
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(240, 180, 90, 0.16), transparent 64%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.25)),
        #0b0807;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 28px rgba(199, 132, 45, 0.11);
}

.small-emblem {
    width: 2.55rem;
    height: 2.55rem;
    padding: 0.22rem;
}

.faction-emblem {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
}

.combatant-details {
    min-width: 0;
}

.combatant-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.combatant-topline strong {
    color: #fff1d0;
    font-size: 1.1rem;
}

.faction-name {
    margin: 0.1rem 0 0.2rem;
    color: #f2cf91;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.82rem;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.combatant-details p {
    margin-top: 0;
    margin-bottom: 0.2rem;
}

.combatant-meta {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.55rem;
    color: var(--muted);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.88rem;
}

.combatant-meta strong {
    color: #ffe4aa;
}

.text-link {
    color: var(--accent-strong);
    text-decoration: none;
    border-bottom: 1px solid rgba(240, 180, 90, 0.38);
}

.text-link:hover {
    color: #ffe1a6;
    border-bottom-color: #ffe1a6;
}

.battle-notes {
    margin: 1rem 0 0;
    padding: 0.85rem 1rem;
    border-left: 2px solid rgba(240, 180, 90, 0.55);
    background: rgba(0, 0, 0, 0.18);
    color: var(--muted);
    line-height: 1.45;
}

.icon-ledger {
    margin-top: 1rem;
}

.faction-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.8rem;
}

.faction-gallery-item {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    padding: 0.85rem;
    border: 1px solid rgba(128, 87, 51, 0.45);
    background: rgba(0, 0, 0, 0.16);
    color: var(--muted);
    text-align: center;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.help-grid {
    align-items: stretch;
}

.help-card p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.55;
}

@media (max-width: 980px) {
    .duel-strip {
        grid-template-columns: 1fr;
    }

    .battle-report-header {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .combatant-card {
        grid-template-columns: 1fr;
    }

    .faction-emblem-frame {
        width: 3.8rem;
        height: 3.8rem;
    }
}

/* Symmetric battle report layout */
.matchup-board {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) minmax(6.5rem, 8rem) minmax(4.5rem, 5.5rem) minmax(6.5rem, 8rem) minmax(18rem, 1fr);
    gap: clamp(0.65rem, 1.2vw, 1rem);
    align-items: stretch;
    min-height: 18rem;
}

.matchup-data,
.matchup-icon-slot,
.versus-core {
    position: relative;
    border: 1px solid rgba(128, 87, 51, 0.55);
    background:
        linear-gradient(180deg, rgba(255, 230, 186, 0.045), rgba(255, 230, 186, 0.01)),
        rgba(0, 0, 0, 0.22);
}

.matchup-data {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    min-width: 0;
}

.matchup-data-left {
    border-left: 2px solid rgba(240, 180, 90, 0.72);
    text-align: left;
}

.matchup-data-right {
    border-right: 2px solid rgba(208, 82, 69, 0.62);
    text-align: right;
}

.matchup-data-right .combatant-topline,
.matchup-data-right .combatant-meta,
.matchup-data-right .roster-facts {
    justify-content: flex-end;
}

.matchup-data-right .roster-unit-list {
    direction: rtl;
    padding-left: 0;
    padding-right: 1.2rem;
}

.matchup-data.outcome-victory {
    border-color: rgba(111, 163, 109, 0.62);
}

.matchup-data.outcome-defeat {
    border-color: rgba(208, 82, 69, 0.50);
}

.matchup-data.outcome-draw {
    border-color: rgba(201, 162, 75, 0.58);
}

.score-banner {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0.45rem 0 0.55rem;
    color: #ffe4aa;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.matchup-data-right .score-banner {
    justify-content: flex-end;
}

.score-banner span {
    font-size: clamp(2.4rem, 4.5vw, 4.4rem);
    line-height: 0.86;
    font-weight: 950;
    letter-spacing: -0.05em;
    text-shadow: 0 2px 0 #000, 0 0 30px rgba(240, 180, 90, 0.15);
}

.score-banner small {
    color: var(--muted);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.matchup-icon-slot {
    display: grid;
    place-items: center;
    padding: clamp(0.6rem, 1.5vw, 1.2rem);
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(240, 180, 90, 0.18), transparent 58%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.48)),
        #0b0807;
    box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.55), 0 0 28px rgba(199, 132, 45, 0.08);
}

.matchup-icon-left {
    border-right: 0;
    clip-path: polygon(0 0, 86% 0, 100% 50%, 86% 100%, 0 100%);
}

.matchup-icon-right {
    border-left: 0;
    clip-path: polygon(14% 0, 100% 0, 100% 100%, 14% 100%, 0 50%);
}

.matchup-emblem {
    width: min(100%, 6.5rem);
    height: auto;
    max-height: 8rem;
    filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.9));
}

.versus-core {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.45rem;
    min-width: 0;
    border-color: rgba(240, 180, 90, 0.7);
    background:
        radial-gradient(circle at center, rgba(142, 30, 30, 0.28), transparent 62%),
        radial-gradient(circle at center, rgba(240, 180, 90, 0.17), transparent 48%),
        #0a0706;
    text-align: center;
}

.versus-core::before,
.versus-core::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 1px;
    height: 31%;
    background: linear-gradient(180deg, transparent, rgba(240, 180, 90, 0.62), transparent);
}

.versus-core::before {
    top: 0;
}

.versus-core::after {
    bottom: 0;
}

.versus-core span {
    color: #ffe1a6;
    font-size: clamp(1.85rem, 3vw, 3rem);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.07em;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-shadow: 0 2px 0 #000, 0 0 24px rgba(208, 82, 69, 0.18);
}

.versus-core small {
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.roster-digest {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(128, 87, 51, 0.45);
}

.roster-digest .eyebrow {
    margin-bottom: 0.45rem;
    font-size: 0.68rem;
}

.roster-name {
    margin: 0 0 0.35rem;
    color: #f5d9a4;
    font-weight: 800;
}

.roster-facts {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: 0.25rem 0 0.45rem;
}

.roster-facts span {
    display: inline-flex;
    padding: 0.18rem 0.45rem;
    border: 1px solid rgba(240, 180, 90, 0.36);
    color: var(--muted);
    background: rgba(199, 132, 45, 0.07);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.055em;
}

.roster-unit-list {
    margin: 0.45rem 0 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.38;
}

.roster-unit-list li::marker {
    color: var(--accent-strong);
}

textarea[spellcheck="false"] {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    line-height: 1.4;
}

@media (max-width: 1180px) {
    .matchup-board {
        grid-template-columns: minmax(0, 1fr) minmax(4.8rem, 6rem) minmax(3.8rem, 4.6rem) minmax(4.8rem, 6rem) minmax(0, 1fr);
    }

    .matchup-emblem {
        width: min(100%, 5.2rem);
    }
}

@media (max-width: 860px) {
    .matchup-board {
        grid-template-columns: 1fr 4.3rem 4.3rem 1fr;
        grid-template-areas:
            "icon-left versus versus icon-right"
            "data-left data-left data-right data-right";
    }

    .matchup-data-left {
        grid-area: data-left;
    }

    .matchup-data-right {
        grid-area: data-right;
    }

    .matchup-icon-left {
        grid-area: icon-left;
    }

    .matchup-icon-right {
        grid-area: icon-right;
    }

    .versus-core {
        grid-area: versus;
        min-height: 5rem;
    }
}

@media (max-width: 620px) {
    .matchup-board {
        grid-template-columns: 1fr;
        grid-template-areas:
            "icon-left"
            "data-left"
            "versus"
            "icon-right"
            "data-right";
    }

    .matchup-data-right,
    .matchup-data-left {
        text-align: left;
    }

    .matchup-data-right .combatant-topline,
    .matchup-data-right .combatant-meta,
    .matchup-data-right .roster-facts,
    .matchup-data-right .score-banner {
        justify-content: flex-start;
    }

    .matchup-data-right .roster-unit-list {
        direction: ltr;
        padding-left: 1.1rem;
        padding-right: 0;
    }

    .matchup-icon-left,
    .matchup-icon-right {
        clip-path: none;
        min-height: 6rem;
    }
}

/* WTC-Compact roster and revised symmetric report layout */
.matchup-board {
    grid-template-columns: minmax(20rem, 1fr) minmax(8.5rem, 11rem) minmax(4.4rem, 5.2rem) minmax(8.5rem, 11rem) minmax(20rem, 1fr);
    min-height: 20rem;
}

.matchup-data-left {
    text-align: right;
    border-left-width: 1px;
    border-right: 2px solid rgba(111, 163, 109, 0.48);
}

.matchup-data-right {
    text-align: left;
    border-right-width: 1px;
    border-left: 2px solid rgba(208, 82, 69, 0.48);
}

.matchup-data-left .combatant-topline,
.matchup-data-left .combatant-meta,
.matchup-data-left .roster-facts,
.matchup-data-left .score-banner {
    justify-content: flex-end;
}

.matchup-data-right .combatant-topline,
.matchup-data-right .combatant-meta,
.matchup-data-right .roster-facts,
.matchup-data-right .score-banner {
    justify-content: flex-start;
}

.matchup-data-left .combatant-topline {
    flex-direction: row;
}

.matchup-data-right .combatant-topline {
    flex-direction: row;
}

.matchup-emblem {
    width: min(100%, 9.2rem);
    max-height: 11.2rem;
}

.matchup-icon-slot {
    padding: clamp(0.75rem, 1.7vw, 1.35rem);
}

.versus-core small {
    display: none;
}

.roster-digest-compact {
    margin-top: auto;
}

.leader-fact {
    border-color: rgba(240, 180, 90, 0.62) !important;
    color: #ffe1a6 !important;
    background: rgba(240, 180, 90, 0.12) !important;
}

.battle-roster-details {
    margin-top: 1rem;
    border: 1px solid rgba(128, 87, 51, 0.55);
    background: rgba(0, 0, 0, 0.18);
}

.battle-roster-details summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    cursor: pointer;
    list-style: none;
    padding: 0.78rem 1rem;
    color: #f5d9a4;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.78rem;
    font-weight: 900;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    border-bottom: 1px solid transparent;
}

.battle-roster-details summary::-webkit-details-marker {
    display: none;
}

.battle-roster-details[open] summary {
    border-bottom-color: rgba(128, 87, 51, 0.55);
}

.chevron {
    display: inline-block;
    width: 0.58rem;
    height: 0.58rem;
    border-right: 2px solid var(--accent-strong);
    border-bottom: 2px solid var(--accent-strong);
    transform: rotate(45deg) translateY(-0.12rem);
    transition: transform 160ms ease;
}

.battle-roster-details[open] .chevron {
    transform: rotate(225deg) translate(-0.05rem, -0.1rem);
}

.roster-compare {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.roster-panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(128, 87, 51, 0.44);
    background:
        linear-gradient(180deg, rgba(255, 230, 186, 0.035), rgba(255, 230, 186, 0.01)),
        rgba(0, 0, 0, 0.22);
}

.roster-panel-left {
    border-right-color: rgba(111, 163, 109, 0.46);
}

.roster-panel-right {
    border-left-color: rgba(208, 82, 69, 0.46);
}

.roster-panel h3 {
    margin: 0 0 0.75rem;
    color: #ffe1a6;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.roster-facts-expanded {
    margin-bottom: 0.85rem;
}

.warlord-line,
.secondary-line {
    margin: 0.55rem 0;
    color: var(--muted);
    line-height: 1.42;
}

.warlord-line strong,
.secondary-line strong {
    color: #f5d9a4;
}

.leader-rune,
.enhancement-rune {
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    flex: 0 0 auto;
    margin-right: 0.35rem;
    border: 1px solid rgba(240, 180, 90, 0.62);
    border-radius: 50%;
    color: #ffe1a6;
    background: radial-gradient(circle, rgba(240, 180, 90, 0.22), rgba(0, 0, 0, 0.35));
    box-shadow: 0 0 18px rgba(240, 180, 90, 0.12);
    font-size: 0.78rem;
    line-height: 1;
}

.enhancement-rune {
    color: #cfe7ff;
    border-color: rgba(157, 183, 196, 0.58);
    background: radial-gradient(circle, rgba(157, 183, 196, 0.18), rgba(0, 0, 0, 0.35));
}

.enhancement-list {
    margin: 0.55rem 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
}

.enhancement-list li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.35rem 0;
}

.roster-unit-list-expanded {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.9rem;
    padding: 0;
    list-style: none;
}

.roster-unit-list-expanded > li {
    padding: 0.72rem;
    border: 1px solid rgba(128, 87, 51, 0.38);
    background: rgba(5, 4, 4, 0.38);
}

.roster-unit-warlord {
    border-color: rgba(240, 180, 90, 0.62) !important;
    background:
        linear-gradient(90deg, rgba(240, 180, 90, 0.10), transparent 58%),
        rgba(5, 4, 4, 0.45) !important;
}

.roster-unit-enhancement {
    border-color: rgba(157, 183, 196, 0.42) !important;
}

.unit-mainline {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    color: #f5d9a4;
}

.unit-mainline strong {
    color: #ffe1a6;
}

.unit-quantity,
.unit-points {
    display: inline-flex;
    padding: 0.12rem 0.4rem;
    border: 1px solid rgba(240, 180, 90, 0.32);
    color: var(--muted);
    background: rgba(199, 132, 45, 0.06);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.055em;
}

.unit-detail-list {
    margin: 0.45rem 0 0 2rem;
    padding-left: 1rem;
    color: var(--muted);
    line-height: 1.38;
}

.unit-detail-list li::marker {
    color: var(--accent-strong);
}

@media (max-width: 1180px) {
    .matchup-board {
        grid-template-columns: minmax(0, 1fr) minmax(6.2rem, 8rem) minmax(3.8rem, 4.6rem) minmax(6.2rem, 8rem) minmax(0, 1fr);
    }

    .matchup-emblem {
        width: min(100%, 7rem);
        max-height: 8.6rem;
    }
}

@media (max-width: 860px) {
    .matchup-data-left,
    .matchup-data-right {
        text-align: left;
    }

    .matchup-data-left .combatant-topline,
    .matchup-data-left .combatant-meta,
    .matchup-data-left .roster-facts,
    .matchup-data-left .score-banner,
    .matchup-data-right .combatant-topline,
    .matchup-data-right .combatant-meta,
    .matchup-data-right .roster-facts,
    .matchup-data-right .score-banner {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .roster-compare {
        grid-template-columns: 1fr;
    }
}



/* Final vector-gothic report presentation: no portrait frames, no central PNG pillar */
.battle-report {
    padding: clamp(0.9rem, 1.45vw, 1.35rem);
    background:
        radial-gradient(ellipse at 50% 20%, rgba(212, 150, 68, 0.13), transparent 42%),
        radial-gradient(circle at 18% 44%, rgba(111, 163, 109, 0.08), transparent 21rem),
        radial-gradient(circle at 82% 44%, rgba(142, 30, 30, 0.11), transparent 21rem),
        linear-gradient(180deg, rgba(255, 230, 186, 0.035), rgba(255, 230, 186, 0.008)),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 4px),
        var(--panel);
    border-color: rgba(140, 94, 49, 0.68);
}

.battle-report::before {
    content: "";
    position: absolute;
    inset: 0.55rem;
    pointer-events: none;
    border: 1px solid rgba(225, 168, 91, 0.22);
    clip-path: polygon(
        0 1rem, 1rem 1rem, 1rem 0,
        calc(100% - 1rem) 0, calc(100% - 1rem) 1rem, 100% 1rem,
        100% calc(100% - 1rem), calc(100% - 1rem) calc(100% - 1rem), calc(100% - 1rem) 100%,
        1rem 100%, 1rem calc(100% - 1rem), 0 calc(100% - 1rem)
    );
}

.battle-report-header {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(16rem, 1.25fr) minmax(10rem, 1fr);
    gap: 1rem;
    align-items: center;
    margin-bottom: clamp(0.75rem, 1vw, 1rem);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(128, 87, 51, 0.62);
}

.report-title-center {
    text-align: center;
}

.report-title-center h2,
.battle-report-header h2 {
    margin: 0;
    color: #f4d49a;
    font-size: clamp(1.6rem, 2.7vw, 3.1rem);
    line-height: 0.92;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 0 2px 0 #000, 0 0 24px rgba(240, 180, 90, 0.18);
}

.report-title-center p {
    margin: 0.4rem 0 0;
    color: #d7b77d;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.report-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #f4d49a;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.report-brand-mark,
.report-aquila {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid rgba(204, 143, 68, 0.42);
    border-radius: 50%;
    color: rgba(244, 212, 154, 0.88);
    background: radial-gradient(circle, rgba(212, 150, 68, 0.14), rgba(0,0,0,0.52));
}

.report-brand strong {
    display: block;
    font-size: 1.05rem;
}

.report-brand span {
    display: block;
    font-size: 0.58rem;
}

.battle-report-actions {
    justify-content: flex-end;
}

.matchup-board {
    grid-template-columns:
        minmax(13rem, 0.9fr)
        minmax(10rem, 0.82fr)
        minmax(5.4rem, 0.36fr)
        minmax(10rem, 0.82fr)
        minmax(13rem, 0.9fr);
    gap: clamp(0.6rem, 1.2vw, 1.15rem);
    min-height: clamp(16rem, 23vw, 24rem);
    align-items: center;
    position: relative;
}

.matchup-board::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 6%;
    bottom: 6%;
    width: 1px;
    transform: translateX(-50%);
    background: linear-gradient(transparent, rgba(212,150,68,0.45), rgba(142,30,30,0.42), rgba(212,150,68,0.45), transparent);
    box-shadow: 0 0 22px rgba(142, 30, 30, 0.32);
    pointer-events: none;
}

.matchup-data {
    min-height: clamp(14rem, 20vw, 21rem);
    justify-content: center;
    padding: clamp(0.9rem, 1.35vw, 1.35rem);
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 230, 186, 0.055), rgba(255, 230, 186, 0.010)),
        radial-gradient(circle at top, rgba(240, 180, 90, 0.075), transparent 12rem),
        rgba(7, 6, 5, 0.68);
    box-shadow:
        inset 0 0 0 1px rgba(255, 222, 160, 0.04),
        inset 0 0 45px rgba(0, 0, 0, 0.64),
        0 18px 40px rgba(0, 0, 0, 0.28);
}

.matchup-data-left {
    border: 1px solid rgba(111, 163, 109, 0.58);
    background:
        linear-gradient(90deg, rgba(111, 163, 109, 0.10), transparent 58%),
        linear-gradient(180deg, rgba(255, 230, 186, 0.045), transparent),
        rgba(7, 8, 6, 0.74);
}

.matchup-data-right {
    border: 1px solid rgba(208, 82, 69, 0.58);
    background:
        linear-gradient(270deg, rgba(142, 30, 30, 0.13), transparent 58%),
        linear-gradient(180deg, rgba(255, 230, 186, 0.045), transparent),
        rgba(9, 6, 6, 0.74);
}

.matchup-data::before,
.matchup-data::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.matchup-data::before {
    inset: 0.46rem;
    border: 1px solid rgba(240, 180, 90, 0.20);
    clip-path: polygon(
        0 0.9rem, 0.9rem 0.9rem, 0.9rem 0,
        calc(100% - 0.9rem) 0, calc(100% - 0.9rem) 0.9rem, 100% 0.9rem,
        100% calc(100% - 0.9rem), calc(100% - 0.9rem) calc(100% - 0.9rem), calc(100% - 0.9rem) 100%,
        0.9rem 100%, 0.9rem calc(100% - 0.9rem), 0 calc(100% - 0.9rem)
    );
}

.matchup-data::after {
    left: 50%;
    bottom: 0.42rem;
    width: 1.2rem;
    height: 1.2rem;
    transform: translateX(-50%) rotate(45deg);
    border: 1px solid rgba(240, 180, 90, 0.32);
    background: radial-gradient(circle, rgba(240, 180, 90, 0.16), rgba(0,0,0,0.38));
}

.combatant-topline,
.matchup-data-left .combatant-topline,
.matchup-data-right .combatant-topline,
.matchup-data-right .combatant-topline-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    margin-bottom: clamp(0.6rem, 1vw, 0.9rem);
    text-align: center;
}

.combatant-topline strong {
    color: #fff1d0;
    font-size: clamp(1.3rem, 1.8vw, 2.25rem);
    line-height: 1;
    text-shadow: 0 2px 0 #000, 0 0 24px rgba(240, 180, 90, 0.13);
}

.outcome-tag {
    min-width: 5.9rem;
    justify-content: center;
    border-width: 1px;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.28), 0 0 18px rgba(0,0,0,0.16);
}

.score-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 0.1rem auto clamp(0.55rem, 0.85vw, 0.8rem);
}

.score-banner span {
    display: block;
    width: 100%;
    text-align: center;
    font-family: Georgia, "Times New Roman", ui-serif, serif;
    font-size: clamp(3.6rem, 5.6vw, 6.5rem);
    line-height: 0.86;
    letter-spacing: -0.055em;
    color: #f4dfb5;
    text-shadow: 0 3px 0 #000, 0 0 32px rgba(240, 180, 90, 0.16);
}

.score-banner small {
    display: none;
}

.matchup-data .faction-name {
    margin-top: 0.35rem;
    font-size: clamp(0.74rem, 0.9vw, 0.96rem);
    letter-spacing: 0.13em;
    color: #f4d49a;
    text-align: center;
}

.matchup-data .muted {
    font-size: clamp(0.78rem, 0.86vw, 0.94rem);
    color: #d0bda2;
    text-align: center;
}

.matchup-data .combatant-meta,
.matchup-data .roster-facts {
    justify-content: center;
    text-align: center;
}

.roster-digest-compact {
    margin-top: clamp(0.65rem, 1.05vw, 0.95rem);
    padding-top: 0.65rem;
    border-top: 1px solid rgba(128, 87, 51, 0.50);
    text-align: center;
}

.matchup-icon-slot {
    min-height: clamp(11rem, 17vw, 18rem);
    padding: clamp(0.35rem, 0.75vw, 0.85rem);
    border: 0;
    overflow: visible;
    background:
        repeating-radial-gradient(ellipse at center, rgba(212,150,68,0.34) 0 1px, transparent 1px 17px),
        radial-gradient(ellipse at center, transparent 0 47%, rgba(212,150,68,0.16) 48%, transparent 50%, rgba(212,150,68,0.08) 52%, transparent 58%),
        linear-gradient(90deg, transparent, rgba(212,150,68,0.10), transparent);
    box-shadow: none;
}

.matchup-icon-slot::before,
.matchup-icon-slot::after {
    content: "";
    position: absolute;
    pointer-events: none;
    inset: 7% 5%;
    border: 1px solid rgba(225, 168, 91, 0.38);
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.45),
        0 0 28px rgba(212,150,68,0.10);
}

.matchup-icon-slot::after {
    inset: 15% 15%;
    border-color: rgba(225, 168, 91, 0.18);
    box-shadow: none;
}

.matchup-emblem {
    width: min(78%, clamp(7rem, 10vw, 11.5rem));
    max-height: clamp(8.5rem, 13.5vw, 15rem);
    z-index: 1;
    filter:
        drop-shadow(0 8px 8px rgba(0, 0, 0, 0.95))
        drop-shadow(0 0 28px rgba(240, 180, 90, 0.20));
}

.versus-core {
    min-width: 0;
    min-height: clamp(11rem, 17vw, 18rem);
    border: 1px solid rgba(128, 87, 51, 0.78);
    border-left-color: rgba(240, 180, 90, 0.45);
    border-right-color: rgba(240, 180, 90, 0.45);
    background:
        linear-gradient(90deg, transparent, rgba(240, 180, 90, 0.12), transparent),
        radial-gradient(circle at center, rgba(142, 30, 30, 0.42), transparent 55%),
        linear-gradient(180deg, rgba(24, 18, 15, 0.95), rgba(74, 22, 18, 0.38) 48%, rgba(18, 13, 11, 0.97)),
        #090706;
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.65),
        inset 0 0 50px rgba(0,0,0,0.62),
        0 0 36px rgba(142, 30, 30, 0.16);
}

.versus-core::before,
.versus-core::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.versus-core::before {
    inset: 0.42rem;
    border: 1px solid rgba(225,168,91,0.30);
    clip-path: polygon(50% 0, 100% 13%, 100% 87%, 50% 100%, 0 87%, 0 13%);
    background:
        radial-gradient(circle at 50% 14%, rgba(225,168,91,0.18), transparent 0.45rem),
        radial-gradient(circle at 50% 86%, rgba(225,168,91,0.13), transparent 0.45rem);
}

.versus-core::after {
    top: 50%;
    left: 50%;
    width: 1.8rem;
    height: 1.8rem;
    transform: translate(-50%, -50%) rotate(45deg);
    border: 1px solid rgba(225,168,91,0.32);
    background: rgba(7, 5, 4, 0.74);
}

.versus-core span {
    position: relative;
    z-index: 2;
    font-family: Georgia, "Times New Roman", ui-serif, serif;
    font-size: clamp(1.9rem, 3vw, 3.4rem);
    color: #f4d49a;
    text-shadow: 0 2px 0 #000, 0 0 24px rgba(240,180,90,0.22);
}

.battle-roster-details {
    margin-top: 0.75rem;
    border-color: rgba(128, 87, 51, 0.68);
    background: linear-gradient(180deg, rgba(255,230,186,0.035), rgba(0,0,0,0.20));
}

.battle-roster-details summary {
    min-height: 2.9rem;
    font-family: Georgia, "Times New Roman", ui-serif, serif;
    font-size: clamp(0.82rem, 0.98vw, 1.05rem);
    letter-spacing: 0.18em;
    color: #f2d6a4;
}

@media (max-width: 1180px) {
    .matchup-board {
        grid-template-columns:
            minmax(11rem, 1fr)
            minmax(8.8rem, 9.8rem)
            minmax(4.6rem, 5.6rem)
            minmax(8.8rem, 9.8rem)
            minmax(11rem, 1fr);
        min-height: 17rem;
    }

    .score-banner span {
        font-size: clamp(3rem, 4.8vw, 5rem);
    }

    .matchup-emblem {
        width: min(74%, 8.9rem);
        max-height: 11.5rem;
    }

    .matchup-icon-slot,
    .versus-core {
        min-height: 14.5rem;
    }
}

@media (max-width: 860px) {
    .battle-report-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .report-brand,
    .battle-report-actions {
        justify-content: center;
    }

    .matchup-board {
        grid-template-columns: 1fr 5rem 5rem 1fr;
        grid-template-areas:
            "icon-left versus versus icon-right"
            "data-left data-left data-right data-right";
        min-height: auto;
    }

    .matchup-data {
        min-height: 15rem;
    }

    .matchup-icon-slot,
    .versus-core {
        min-height: 9.5rem;
    }
}

@media (max-width: 620px) {
    .matchup-board {
        grid-template-columns: 1fr;
        grid-template-areas:
            "data-left"
            "icon-left"
            "versus"
            "icon-right"
            "data-right";
    }

    .versus-core {
        min-height: 5.5rem;
    }
}

/* Patch: compact report height and simplified faction icon presentation */
.battle-report {
    padding: clamp(0.75rem, 1.15vw, 1.05rem) !important;
}

.battle-report-header {
    margin-bottom: clamp(0.55rem, 0.8vw, 0.8rem) !important;
    padding-bottom: 0.55rem !important;
}

.report-title-center h2,
.battle-report-header h2 {
    font-size: clamp(1.35rem, 2.25vw, 2.55rem) !important;
}

.report-title-center p {
    margin-top: 0.25rem !important;
    font-size: 0.68rem !important;
}

.matchup-board {
    grid-template-columns:
        minmax(12.5rem, 0.95fr)
        minmax(10.5rem, 0.72fr)
        minmax(4.6rem, 0.30fr)
        minmax(10.5rem, 0.72fr)
        minmax(12.5rem, 0.95fr) !important;
    gap: clamp(0.55rem, 1vw, 1rem) !important;
    min-height: clamp(12.8rem, 18.4vw, 19.2rem) !important;
}

.matchup-data {
    min-height: clamp(11.7rem, 16vw, 17.2rem) !important;
    padding: clamp(0.7rem, 1vw, 1rem) !important;
}

.combatant-topline,
.matchup-data-left .combatant-topline,
.matchup-data-right .combatant-topline,
.matchup-data-right .combatant-topline-right {
    margin-bottom: clamp(0.45rem, 0.75vw, 0.7rem) !important;
    gap: 0.32rem !important;
}

.combatant-topline strong {
    font-size: clamp(1.1rem, 1.55vw, 1.9rem) !important;
}

.score-banner {
    margin-bottom: clamp(0.42rem, 0.65vw, 0.65rem) !important;
}

.score-banner span {
    font-size: clamp(3.1rem, 4.7vw, 5.55rem) !important;
}

.matchup-data .faction-name {
    margin-top: 0.25rem !important;
    font-size: clamp(0.68rem, 0.8vw, 0.88rem) !important;
}

.matchup-data .muted {
    font-size: clamp(0.72rem, 0.78vw, 0.86rem) !important;
}

.roster-digest-compact {
    margin-top: clamp(0.45rem, 0.75vw, 0.75rem) !important;
    padding-top: 0.5rem !important;
}

.matchup-icon-slot {
    min-height: clamp(9.5rem, 14.5vw, 15.5rem) !important;
    padding: clamp(0.35rem, 0.65vw, 0.75rem) !important;
    border: 1px solid rgba(180, 118, 54, 0.22) !important;
    background:
        radial-gradient(circle at center, rgba(240, 180, 90, 0.18), rgba(240, 180, 90, 0.055) 34%, rgba(0, 0, 0, 0.18) 62%, transparent 78%),
        linear-gradient(180deg, rgba(255, 230, 186, 0.035), rgba(0, 0, 0, 0.12)) !important;
    box-shadow:
        inset 0 0 36px rgba(0,0,0,0.48),
        0 0 24px rgba(212,150,68,0.08) !important;
}

.matchup-icon-slot::before,
.matchup-icon-slot::after {
    display: none !important;
    content: none !important;
}

.matchup-emblem {
    width: min(88%, clamp(8.2rem, 11.8vw, 13.1rem)) !important;
    max-height: clamp(9.4rem, 14.9vw, 16.2rem) !important;
    filter:
        drop-shadow(0 8px 8px rgba(0, 0, 0, 0.95))
        drop-shadow(0 0 30px rgba(240, 180, 90, 0.23)) !important;
}

.versus-core {
    min-height: clamp(9.5rem, 14.5vw, 15.5rem) !important;
}

.versus-core span {
    font-size: clamp(1.65rem, 2.6vw, 3rem) !important;
}

.battle-roster-details {
    margin-top: 0.55rem !important;
}

.battle-roster-details summary {
    min-height: 2.55rem !important;
    font-size: clamp(0.74rem, 0.9vw, 0.95rem) !important;
}

@media (max-width: 1180px) {
    .matchup-board {
        grid-template-columns:
            minmax(10.5rem, 1fr)
            minmax(8.5rem, 9.6rem)
            minmax(4.1rem, 5rem)
            minmax(8.5rem, 9.6rem)
            minmax(10.5rem, 1fr) !important;
        min-height: 14.8rem !important;
    }

    .matchup-icon-slot,
    .versus-core {
        min-height: 12.4rem !important;
    }

    .matchup-emblem {
        width: min(90%, 9.8rem) !important;
        max-height: 12.6rem !important;
    }
}

/* Patch: final cleanup - remove VS artifact, center WTC help, hide player-panel point duplicate */
.versus-core::after {
    display: none !important;
    content: none !important;
}

.wtc-help-mini {
    margin: 0.35rem auto 0;
    max-width: 26rem;
    color: #bda98d;
    font-size: clamp(0.72rem, 0.78vw, 0.88rem);
    line-height: 1.35;
    text-align: center;
}

.wtc-help-mini strong {
    color: #f2d6a4;
    font-weight: 700;
}

/* Patch: remove remaining decorative artifacts from report header and VS block */
.battle-report::before {
    display: none !important;
    content: none !important;
}

.report-brand-mark,
.report-aquila {
    display: none !important;
}

.versus-core::before,
.versus-core::after {
    display: none !important;
    content: none !important;
}

.versus-core {
    overflow: hidden !important;
}

.report-brand {
    gap: 0 !important;
}

/* Patch: remove the lower diamond ornament that overlaps compact army data badges */
.matchup-data::after {
    display: none !important;
    content: none !important;
}

/* Patch: deployment/mission report metadata and safe lower diamond ornament */
.report-meta-secondary {
    margin-top: 0.25rem !important;
    color: #bda36e !important;
    font-size: clamp(0.62rem, 0.72vw, 0.8rem) !important;
    letter-spacing: 0.14em !important;
}

.matchup-data {
    overflow: visible !important;
}

.matchup-data::after {
    display: block !important;
    content: "" !important;
    left: 50% !important;
    bottom: -0.55rem !important;
    width: 0.95rem !important;
    height: 0.95rem !important;
    transform: translateX(-50%) rotate(45deg) !important;
    border: 1px solid rgba(240, 180, 90, 0.32) !important;
    background: radial-gradient(circle, rgba(240, 180, 90, 0.14), rgba(0,0,0,0.46)) !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

.roster-digest-compact,
.roster-facts {
    position: relative;
    z-index: 2;
}

/* Stats placeholder */
.stats-placeholder {
    max-width: 78rem;
}

.stats-placeholder > p:not(.eyebrow) {
    max-width: 72rem;
    color: #d0bda2;
    line-height: 1.65;
}

.stats-placeholder-grid {
    margin-top: 1.35rem;
}

.placeholder-directive {
    position: relative;
    padding: 1rem;
    border: 1px solid rgba(128, 87, 51, 0.56);
    background:
        linear-gradient(180deg, rgba(255, 230, 186, 0.045), rgba(255, 230, 186, 0.010)),
        rgba(7, 6, 5, 0.46);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.42);
}

.placeholder-directive::before {
    content: "";
    position: absolute;
    inset: 0.45rem;
    border: 1px solid rgba(240, 180, 90, 0.16);
    pointer-events: none;
}

.directive-number {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(240, 180, 90, 0.42);
    color: #f4d49a;
    background: radial-gradient(circle, rgba(240, 180, 90, 0.15), rgba(0, 0, 0, 0.44));
    font-family: Georgia, "Times New Roman", ui-serif, serif;
    font-weight: 700;
}

.placeholder-directive h3 {
    margin: 0 0 0.5rem;
    color: #f4d49a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
}

.placeholder-directive p {
    margin: 0;
    color: #c6b397;
    line-height: 1.5;
}

/* Affiliation / sous-faction support */
.sub-faction-field[hidden] {
    display: none !important;
}

.sub-faction-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.sub-faction-mini-icon {
    width: 1.15rem;
    height: 1.15rem;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
    opacity: 0.95;
}

.matchup-data-left .sub-faction-line,
.matchup-data-right .sub-faction-line {
    justify-content: center;
}

/* Round matchup faction medallions */
.matchup-icon-slot {
    align-self: center;
    justify-self: center;
    display: inline-grid;
    place-items: center;
    width: clamp(7rem, 10vw, 9.5rem);
    height: clamp(7rem, 10vw, 9.5rem);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    padding: clamp(0.45rem, 0.75vw, 0.7rem);
    overflow: visible;
    border: 1px solid rgba(240, 180, 90, 0.52);
    background:
        radial-gradient(circle at 50% 45%, rgba(240, 180, 90, 0.16), transparent 58%),
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.20) 62%, transparent 72%);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.70),
        inset 0 0 28px rgba(240, 180, 90, 0.07),
        0 0 34px rgba(199, 132, 45, 0.10);
}

.matchup-icon-slot::before {
    content: "";
    position: absolute;
    inset: 0.32rem;
    border-radius: 50%;
    border: 1px solid rgba(240, 180, 90, 0.22);
    pointer-events: none;
}

.matchup-icon-slot::after {
    content: "";
    position: absolute;
    inset: -0.34rem;
    border-radius: 50%;
    border: 1px solid rgba(128, 87, 51, 0.26);
    pointer-events: none;
}

.matchup-emblem {
    position: relative;
    z-index: 1;
    width: 88%;
    height: 88%;
    object-fit: contain;
    object-position: center;
}

/* Strict circular faction medallions - no oval/stretch */
.matchup-board {
    grid-template-columns: minmax(18rem, 1fr) minmax(9.75rem, 10.75rem) minmax(4.5rem, 5.5rem) minmax(9.75rem, 10.75rem) minmax(18rem, 1fr);
    align-items: center;
}

.matchup-icon-slot,
.matchup-icon-left,
.matchup-icon-right {
    box-sizing: border-box;
    inline-size: clamp(9rem, 8.5vw, 10.5rem) !important;
    block-size: clamp(9rem, 8.5vw, 10.5rem) !important;
    min-inline-size: clamp(9rem, 8.5vw, 10.5rem) !important;
    min-block-size: clamp(9rem, 8.5vw, 10.5rem) !important;
    max-inline-size: clamp(9rem, 8.5vw, 10.5rem) !important;
    max-block-size: clamp(9rem, 8.5vw, 10.5rem) !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 999px !important;
    clip-path: none !important;
    overflow: visible !important;
    padding: clamp(0.25rem, 0.45vw, 0.45rem) !important;
    align-self: center !important;
    justify-self: center !important;
}

.matchup-emblem {
    inline-size: 118% !important;
    block-size: 118% !important;
    max-inline-size: none !important;
    max-block-size: none !important;
    object-fit: contain;
}

/* XL faction medallions - larger icon fill */
.matchup-board {
    grid-template-columns: minmax(18rem, 1fr) minmax(12.5rem, 13.25rem) minmax(4.5rem, 5.5rem) minmax(12.5rem, 13.25rem) minmax(18rem, 1fr);
}

.matchup-icon-slot,
.matchup-icon-left,
.matchup-icon-right {
    inline-size: clamp(12rem, 10.8vw, 13.25rem) !important;
    block-size: clamp(12rem, 10.8vw, 13.25rem) !important;
    min-inline-size: clamp(12rem, 10.8vw, 13.25rem) !important;
    min-block-size: clamp(12rem, 10.8vw, 13.25rem) !important;
    max-inline-size: clamp(12rem, 10.8vw, 13.25rem) !important;
    max-block-size: clamp(12rem, 10.8vw, 13.25rem) !important;
    padding: clamp(0.05rem, 0.2vw, 0.2rem) !important;
}

.matchup-emblem {
    inline-size: 145% !important;
    block-size: 145% !important;
    max-inline-size: none !important;
    max-block-size: none !important;
}

/* Stats three-level proposal */
.four-columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-level {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.stats-level-heading {
    padding: 0.35rem 0 0.15rem;
}

.stats-level-heading h2 {
    margin: 0.15rem 0 0;
    color: #f5e3bf;
    font-size: clamp(1.45rem, 2.4vw, 2.35rem);
    letter-spacing: 0.02em;
}

.stats-overview {
    margin-bottom: 0;
}

.stats-table td strong {
    color: #fff0c9;
}

.recent-form-grid,
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.75rem;
}

.recent-form-card,
.stats-badge-card {
    position: relative;
    display: grid;
    gap: 0.45rem;
    padding: 0.9rem;
    border: 1px solid rgba(128, 87, 51, 0.58);
    background:
        linear-gradient(180deg, rgba(255, 230, 186, 0.045), rgba(255, 230, 186, 0.012)),
        rgba(0, 0, 0, 0.22);
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.38);
}

.recent-form-card::before,
.stats-badge-card::before {
    content: "";
    position: absolute;
    inset: 0.42rem;
    border: 1px solid rgba(240, 180, 90, 0.13);
    pointer-events: none;
}

.recent-form-card strong,
.stats-badge-card strong {
    color: #ffe3a6;
    font-size: 1.02rem;
}

.form-sequence {
    display: inline-flex;
    width: fit-content;
    padding: 0.2rem 0.45rem;
    border: 1px solid rgba(240, 180, 90, 0.45);
    color: #f5d38f;
    background: rgba(199, 132, 45, 0.08);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 850;
    letter-spacing: 0.18em;
}

.stats-badge-card span,
.stats-badge-card small {
    color: #d0bda2;
}

.stats-badge-card small {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (max-width: 980px) {
    .four-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .four-columns {
        grid-template-columns: 1fr;
    }
}

/* Raise matchup faction icons above army composition toggle */
.matchup-board {
    align-items: center !important;
    padding-bottom: clamp(0.85rem, 1.4vw, 1.35rem);
}

.matchup-icon-slot,
.matchup-icon-left,
.matchup-icon-right {
    transform: translateY(clamp(-2.25rem, -2.2vw, -1.45rem)) !important;
    z-index: 3;
}

.matchup-emblem {
    transform: translateY(-0.2rem);
}

.battle-roster-details {
    position: relative;
    z-index: 5;
    margin-top: clamp(0.75rem, 1vw, 1.1rem);
}

.battle-roster-details > summary {
    position: relative;
    z-index: 6;
}


/* Patch: remove circular backdrop around matchup faction icons */
.matchup-icon-slot,
.matchup-icon-left,
.matchup-icon-right {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

.matchup-icon-slot::before,
.matchup-icon-slot::after,
.matchup-icon-left::before,
.matchup-icon-left::after,
.matchup-icon-right::before,
.matchup-icon-right::after {
    content: none !important;
    display: none !important;
}

.matchup-emblem {
    inline-size: 132% !important;
    block-size: 132% !important;
    max-inline-size: none !important;
    max-block-size: none !important;
    filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 10px rgba(199, 132, 45, 0.14));
}

@media (max-width: 1200px) {
    .matchup-emblem {
        inline-size: 120% !important;
        block-size: 120% !important;
    }
}


/* Patch: delete report danger zone */
.danger-zone {
    margin-top: 1rem;
    border-color: rgba(208, 82, 69, 0.62);
    background:
        linear-gradient(135deg, rgba(142, 30, 30, 0.16), transparent 44%),
        linear-gradient(180deg, rgba(255, 230, 186, 0.035), rgba(255, 230, 186, 0.01)),
        var(--panel);
}

.danger-zone h2 {
    color: #ffc0b7;
}

.danger-zone-copy {
    max-width: 58rem;
    color: var(--muted);
    line-height: 1.5;
}

.delete-report-form {
    display: grid;
    gap: 0.85rem;
    max-width: 34rem;
}

.button.danger {
    border-color: rgba(208, 82, 69, 0.78);
    background:
        linear-gradient(180deg, rgba(208, 82, 69, 0.32), rgba(90, 18, 18, 0.82)),
        #2a0d0d;
    color: #ffd8d2;
}

.button.danger:hover {
    border-color: #ff9b8e;
    box-shadow: 0 0 26px rgba(208, 82, 69, 0.22), inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}


/* Patch: administration page and soft-delete controls */
.admin-login-panel,
.admin-section {
    margin-bottom: 1rem;
}

.admin-login-form {
    display: grid;
    gap: 1rem;
    max-width: 32rem;
}

.admin-actions {
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.admin-table td {
    vertical-align: middle;
}

.button.small {
    min-height: 2.15rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.74rem;
}


.admin-password-form {
    display: grid;
    gap: 0.85rem;
    max-width: 34rem;
}


/* Patch: expandable admin action details */
.admin-log-details summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    color: #f4d49a;
    list-style: none;
}

.admin-log-details summary::-webkit-details-marker {
    display: none;
}

.admin-log-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border: 1px solid rgba(240, 180, 90, 0.38);
    color: var(--accent-strong);
    transition: transform 0.15s ease;
}

.admin-log-details[open] .admin-log-chevron {
    transform: rotate(90deg);
}

.admin-log-details pre {
    margin: 0.65rem 0 0;
    white-space: pre-wrap;
    color: var(--muted);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    border-left: 2px solid rgba(240, 180, 90, 0.28);
    padding-left: 0.8rem;
}


/* Patch: admin tabs */
.admin-tabs {
    display: grid;
    gap: 1rem;
}

.admin-tab-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(128, 87, 51, 0.55);
    padding-bottom: 0.65rem;
}

.admin-tab-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.45rem;
    padding: 0.55rem 0.85rem;
    margin: 0;
    border: 1px solid rgba(128, 87, 51, 0.72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.10)),
        rgba(6, 6, 6, 0.35);
    color: var(--muted);
    cursor: pointer;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.admin-tab-label:hover {
    border-color: var(--accent-strong);
    color: #ffe1a6;
}

.admin-tab-panel {
    display: none;
    margin-bottom: 0;
}

#admin-tab-history:checked ~ .admin-tab-list label[for="admin-tab-history"],
#admin-tab-restore:checked ~ .admin-tab-list label[for="admin-tab-restore"],
#admin-tab-password:checked ~ .admin-tab-list label[for="admin-tab-password"] {
    border-color: #efbc74;
    color: #180e07;
    background:
        linear-gradient(180deg, #e0a451, #a76624),
        var(--accent);
}

#admin-tab-history:checked ~ .admin-tab-panel-history,
#admin-tab-restore:checked ~ .admin-tab-panel-restore,
#admin-tab-password:checked ~ .admin-tab-panel-password {
    display: block;
}


/* Patch: help page tabs and translated game terms */
.help-shell {
    display: grid;
    gap: 1rem;
}

.help-tab-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.help-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(128, 87, 51, 0.55);
    padding-bottom: 0.65rem;
}

.help-tab-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.45rem;
    padding: 0.55rem 0.85rem;
    margin: 0;
    border: 1px solid rgba(128, 87, 51, 0.72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.10)),
        rgba(6, 6, 6, 0.35);
    color: var(--muted);
    cursor: pointer;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.help-tab-label:hover {
    border-color: var(--accent-strong);
    color: #ffe1a6;
}

.help-tab-panel {
    display: none;
}

#help-tab-flow:checked ~ .help-tab-list label[for="help-tab-flow"],
#help-tab-phases:checked ~ .help-tab-list label[for="help-tab-phases"],
#help-tab-rules:checked ~ .help-tab-list label[for="help-tab-rules"],
#help-tab-tools:checked ~ .help-tab-list label[for="help-tab-tools"],
#help-tab-factions:checked ~ .help-tab-list label[for="help-tab-factions"] {
    border-color: #efbc74;
    color: #180e07;
    background:
        linear-gradient(180deg, #e0a451, #a76624),
        var(--accent);
}

#help-tab-flow:checked ~ .help-tab-panel-flow,
#help-tab-phases:checked ~ .help-tab-panel-phases,
#help-tab-rules:checked ~ .help-tab-panel-rules,
#help-tab-tools:checked ~ .help-tab-panel-tools,
#help-tab-factions:checked ~ .help-tab-panel-factions {
    display: block;
}

.help-section {
    display: grid;
    gap: 1rem;
}

.help-grid,
.help-step-grid {
    display: grid;
    gap: 1rem;
}

.help-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.help-grid.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.help-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.help-card {
    border: 1px solid rgba(128, 87, 51, 0.55);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent),
        rgba(0, 0, 0, 0.16);
    padding: 1rem;
    border-radius: 2px;
}

.help-card h3 {
    margin: 0 0 0.7rem;
    color: #f4d49a;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.help-card p,
.help-card li {
    color: var(--muted);
    line-height: 1.5;
}

.help-card ul {
    margin: 0;
    padding-left: 1.1rem;
}

.help-note {
    border-left: 2px solid rgba(240, 180, 90, 0.45);
    padding: 0.75rem 0.9rem;
    background: rgba(199, 132, 45, 0.08);
    color: var(--muted);
}

.game-term {
    position: relative;
    display: inline-block;
    color: #ffe1a6;
    border-bottom: 1px dotted rgba(240, 180, 90, 0.72);
    cursor: help;
    outline: none;
}

.game-term::after {
    content: attr(data-en);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.45rem);
    transform: translateX(-50%) translateY(0.2rem);
    min-width: max-content;
    max-width: 18rem;
    padding: 0.42rem 0.58rem;
    border: 1px solid rgba(240, 180, 90, 0.72);
    background:
        linear-gradient(180deg, rgba(42, 29, 21, 0.98), rgba(12, 10, 9, 0.98)),
        var(--panel);
    color: #ffe1a6;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    white-space: normal;
    text-align: center;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}

.game-term::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.15rem);
    transform: translateX(-50%);
    border: 0.32rem solid transparent;
    border-top-color: rgba(240, 180, 90, 0.72);
    opacity: 0;
    pointer-events: none;
    z-index: 21;
}

.game-term:hover::after,
.game-term:focus::after,
.game-term:hover::before,
.game-term:focus::before {
    opacity: 1;
}

@media (max-width: 980px) {
    .help-grid.two-columns,
    .help-grid.three-columns,
    .help-step-grid {
        grid-template-columns: 1fr;
    }
}


/* Patch: help guided assistant */
.help-tab-panel-flow .help-step-grid,
.help-tab-panel-phases .help-grid.two-columns {
    grid-template-columns: 1fr;
}

#help-tab-guided:checked ~ .help-tab-list label[for="help-tab-guided"] {
    border-color: #efbc74;
    color: #180e07;
    background:
        linear-gradient(180deg, #e0a451, #a76624),
        var(--accent);
}

#help-tab-guided:checked ~ .help-tab-panel-guided {
    display: block;
}

.guided-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
    gap: 1rem;
    align-items: start;
}

.guided-main,
.guided-rules-panel {
    min-width: 0;
}

.guided-progress {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.guided-step {
    display: none;
}

.guided-step.is-active {
    display: grid;
    gap: 1rem;
}

.guided-step h3,
.guided-rules-panel h3 {
    margin: 0;
    color: #f4d49a;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.guided-checklist,
.strength-table-wrap,
.guided-warning {
    border: 1px solid rgba(128, 87, 51, 0.55);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent),
        rgba(0, 0, 0, 0.16);
    padding: 1rem;
    border-radius: 2px;
}

.guided-checklist h4,
.strength-table-wrap h4 {
    margin: 0 0 0.65rem;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.82rem;
}

.guided-checklist ul {
    margin: 0;
    padding-left: 1.1rem;
}

.guided-checklist li,
.guided-step p,
.guided-warning,
.guided-rules-panel p {
    color: var(--muted);
    line-height: 1.52;
}

.guided-warning {
    border-color: rgba(201, 162, 75, 0.55);
    background: rgba(201, 162, 75, 0.08);
}

.rules-link {
    display: inline;
    padding: 0;
    border: 0;
    border-bottom: 1px dotted rgba(240, 180, 90, 0.82);
    background: transparent;
    color: #ffe1a6;
    cursor: pointer;
    font: inherit;
}

.rules-link:hover,
.rules-link:focus {
    color: #fff0c2;
    outline: none;
    border-bottom-style: solid;
}

.guided-controls {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

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

.guided-rules-panel {
    position: sticky;
    top: 5.5rem;
    border: 1px solid rgba(240, 180, 90, 0.36);
    background:
        linear-gradient(180deg, rgba(240, 180, 90, 0.07), transparent),
        rgba(0, 0, 0, 0.24);
    padding: 1rem;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.30);
}

.strength-table {
    width: 100%;
    border-collapse: collapse;
}

.strength-table th,
.strength-table td {
    padding: 0.62rem 0.7rem;
    border-bottom: 1px solid rgba(128, 87, 51, 0.45);
    text-align: left;
}

.strength-table th {
    color: #e4c58b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (max-width: 1100px) {
    .guided-layout {
        grid-template-columns: 1fr;
    }

    .guided-rules-panel {
        position: static;
    }
}


/* Patch: guided rules detail improvements */
.guided-controls-right {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.guided-rules-panel strong {
    color: #f4d49a;
}

.guided-rules-panel .muted {
    color: var(--muted);
}

.rules-link .game-term {
    pointer-events: auto;
}

.rules-link .game-term::after {
    bottom: calc(100% + 0.62rem);
}

.guided-rules-panel p + p {
    margin-top: 0.65rem;
}


/* Patch: help guided cleanup */
.guided-rule-bank {
    display: none !important;
}

.guided-controls [hidden],
.guided-controls-right [hidden],
.button[hidden] {
    display: none !important;
}

.is-hidden {
    display: none !important;
}


/* Patch: in-progress battle reports */
.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    border: 1px solid rgba(128, 87, 51, 0.55);
    background: rgba(199, 132, 45, 0.08);
    padding: 0.9rem;
}

.checkbox-card input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
    accent-color: var(--accent-strong);
}

.checkbox-card strong {
    display: block;
    color: #f4d49a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.checkbox-card small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    line-height: 1.45;
}

.in-progress-tag {
    margin-left: 0.4rem;
    border-color: rgba(201, 162, 75, 0.75);
    color: #f4d49a;
    background: rgba(201, 162, 75, 0.12);
}

/* Patch: AI battle narrative */
.battle-narrative-panel {
    margin-top: 1.5rem;
}

.narrative-action-form {
    margin: 1rem 0;
}

.battle-narrative-output {
    margin-top: 1.2rem;
    border: 1px solid rgba(128, 87, 51, 0.55);
    background: rgba(0, 0, 0, 0.18);
    padding: 1rem;
}

.battle-narrative-output h3 {
    margin-top: 0;
    color: #f4d49a;
}

.narrative-text p {
    line-height: 1.7;
    margin: 0 0 1rem;
}

.generation-placeholder {
    display: grid;
    gap: 0.35rem;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid rgba(201, 162, 75, 0.65);
    background: rgba(201, 162, 75, 0.09);
    color: #f4d49a;
}

.generation-placeholder span {
    color: var(--muted);
}

/* Team report compact matchup grid */
.team-matchup-table {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(4.2rem, 5.4rem) minmax(0, 1fr);
    gap: 0.65rem;
    align-items: stretch;
}

.team-matchup-cell {
    min-width: 0;
    border: 1px solid rgba(128, 87, 51, 0.55);
    background:
        linear-gradient(120deg, rgba(240, 180, 90, 0.07), transparent 45%),
        rgba(0, 0, 0, 0.22);
}

.team-matchup-left {
    border-left: 2px solid rgba(240, 180, 90, 0.72);
}

.team-matchup-right {
    border-right: 2px solid rgba(208, 82, 69, 0.62);
}

.team-matchup-cell.outcome-victory {
    border-color: rgba(111, 163, 109, 0.62);
}

.team-matchup-cell.outcome-defeat {
    border-color: rgba(208, 82, 69, 0.50);
}

.team-matchup-cell.outcome-draw {
    border-color: rgba(201, 162, 75, 0.58);
}

.team-matchup-header {
    padding: 0.95rem 1rem;
}

.team-header-main {
    display: grid;
    gap: 1rem;
    align-items: center;
}

.team-header-left {
    grid-template-columns: minmax(0, 1fr) auto;
}

.team-header-right {
    grid-template-columns: auto minmax(0, 1fr);
    text-align: right;
}

.team-header-right .team-title-line {
    justify-content: flex-end;
}

.team-title-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.team-title-line strong {
    color: #fff1d0;
    font-size: clamp(1.35rem, 2vw, 1.95rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.team-score-badge {
    display: grid;
    place-items: center;
    min-width: 4.8rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(240, 180, 90, 0.42);
    background:
        radial-gradient(circle at center, rgba(240, 180, 90, 0.14), transparent 64%),
        rgba(0, 0, 0, 0.22);
}

.team-score-badge strong {
    color: #ffe1a6;
    font-size: clamp(2.2rem, 3.3vw, 3rem);
    line-height: 0.88;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 950;
    letter-spacing: -0.06em;
    text-shadow: 0 2px 0 #000, 0 0 24px rgba(240, 180, 90, 0.12);
}

.team-score-badge span {
    color: var(--muted);
    font-size: 0.66rem;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.team-matchup-vs {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 100%;
    border: 1px solid rgba(240, 180, 90, 0.62);
    background:
        radial-gradient(circle at center, rgba(142, 30, 30, 0.30), transparent 62%),
        radial-gradient(circle at center, rgba(240, 180, 90, 0.16), transparent 48%),
        #0a0706;
    text-align: center;
}

.team-matchup-vs span {
    color: #ffe1a6;
    font-size: clamp(1.25rem, 2.1vw, 2rem);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.07em;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-shadow: 0 2px 0 #000, 0 0 24px rgba(208, 82, 69, 0.18);
}

.team-matchup-vs-header span {
    font-size: clamp(1.75rem, 2.7vw, 2.8rem);
}

.team-player-cell {
    padding: 0;
}

.team-player-card {
    display: grid;
    gap: 1.2rem;
    align-items: center;
    min-height: 100%;
    padding: 1.05rem 1.2rem;
}

.team-player-card-left {
    grid-template-columns: minmax(0, 1fr) 8.5rem;
}

.team-player-card-right {
    grid-template-columns: 8.5rem minmax(0, 1fr);
    text-align: right;
}

.team-player-details {
    min-width: 0;
}

.team-player-card-right .combatant-topline,
.team-player-card-right .roster-facts {
    justify-content: flex-end;
}

.team-player-card .faction-emblem-frame {
    width: 7.6rem;
    height: 7.6rem;
    justify-self: center;
}

.team-empty-slot {
    display: grid;
    place-items: center;
    min-height: 8rem;
    margin: 0;
    padding: 1rem;
    color: var(--muted);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.14);
}

.roster-participant-block + .roster-participant-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(128, 87, 51, 0.45);
}

@media (max-width: 980px) {
    .team-matchup-table {
        grid-template-columns: 1fr;
    }

    .team-matchup-vs {
        min-height: 4rem;
    }

    .team-header-left,
    .team-header-right,
    .team-player-card-left,
    .team-player-card-right {
        grid-template-columns: auto minmax(0, 1fr);
        text-align: left;
    }

    .team-header-right .team-title-line,
    .team-player-card-right .combatant-topline,
    .team-player-card-right .roster-facts {
        justify-content: flex-start;
    }

    .team-score-badge {
        min-width: 4.2rem;
    }
}

/* Public faction catalogue */
.faction-public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.faction-public-card {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.faction-public-icon {
    display: grid;
    place-items: center;
    min-height: 5.4rem;
    border: 1px solid rgba(240, 180, 90, 0.38);
    background:
        radial-gradient(circle at center, rgba(240, 180, 90, 0.16), transparent 64%),
        rgba(0, 0, 0, 0.22);
}

.faction-public-icon .matchup-emblem {
    width: 4.4rem;
    max-height: 4.4rem;
}

.faction-public-body {
    min-width: 0;
}

.faction-public-body h2 {
    margin-bottom: 0.45rem;
    font-size: 1.1rem;
}

.faction-public-detachments {
    margin-top: 0.85rem;
}

@media (max-width: 560px) {
    .faction-public-card {
        grid-template-columns: 1fr;
    }
}

/* Team player card cleanup */
.team-player-card .team-player-details {
    display: grid;
    align-content: center;
}

.team-player-card .faction-emblem {
    filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.9));
}

.team-player-card .combatant-topline strong {
    font-size: clamp(1.55rem, 2.25vw, 2.25rem);
}

@media (max-width: 980px) {
    .team-player-card-left,
    .team-player-card-right {
        grid-template-columns: 6.5rem minmax(0, 1fr);
    }

    .team-player-card .faction-emblem-frame {
        width: 6rem;
        height: 6rem;
    }
}

@media (max-width: 560px) {
    .team-player-card-left,
    .team-player-card-right {
        grid-template-columns: 1fr;
    }

    .team-player-card .faction-emblem-frame {
        width: 7rem;
        height: 7rem;
    }
}