:root {
    color-scheme: dark;
    --night: #0c110d;
    --coal: #111812;
    --stone: #192019;
    --stone-raised: #222a21;
    --stone-deep: #111712;
    --line: #3b4437;
    --line-soft: rgba(196, 207, 175, .15);
    --ivory: #eee5d3;
    --ivory-dim: #cfc3ad;
    --muted: #afa590;
    --muted-low: #898273;
    --red: #873034;
    --red-bright: #a33d40;
    --red-shadow: #542326;
    --steel: #454d48;
    --steel-light: #c4c8b9;
    --gold: #d9b66a;
    --success: #a1b68c;
    --paper: #d8c9a6;
    --paper-dark: #c7b58c;
    --paper-ink: #352d22;
    --shadow: 0 24px 55px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--night); }

body {
    min-width: 320px;
    margin: 0;
    color: var(--ivory);
    background:
        linear-gradient(180deg, rgba(12, 17, 13, .58) 0%, rgba(9, 13, 10, .77) 78%, rgba(9, 13, 10, .86) 100%),
        url('/images/Dusk%20over%20the%20forest%20frontier-1.png') center 43% / cover fixed,
        radial-gradient(ellipse at 50% -15%, rgba(117, 49, 40, .12), transparent 54rem),
        linear-gradient(180deg, #171815 0%, var(--night) 100%);
    font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
}

body::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: .12;
    background-image:
        repeating-linear-gradient(0deg, transparent 0 4px, rgba(231, 220, 193, .035) 5px, transparent 6px),
        repeating-linear-gradient(90deg, transparent 0 17px, rgba(231, 220, 193, .025) 18px, transparent 19px);
}

a { color: inherit; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #e2bd78;
    outline-offset: 3px;
}

.world-frame {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-topbar {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 78px;
    padding: 11px max(28px, calc((100vw - 1440px) / 2));
    display: grid;
    grid-template-columns: minmax(205px, 1fr) auto minmax(205px, 1fr);
    align-items: center;
    gap: 25px;
    background: linear-gradient(180deg, rgba(27, 36, 27, .97), rgba(15, 22, 16, .98)), url('/images/Dusk%20over%20the%20forest%20frontier-1.png') center 29% / cover;
    border-bottom: 1px solid #464238;
    box-shadow: 0 5px 23px rgba(0, 0, 0, .3), inset 0 -1px rgba(255, 255, 255, .025);
}

.game-topbar-public { display: flex; justify-content: space-between; gap: 24px; }
.game-topbar-public .brand { flex: 0 1 260px; }
.game-topbar-public .utility-nav { flex: 0 0 auto; margin-left: auto; }

.game-topbar::after {
    position: absolute;
    right: 0;
    bottom: -2px;
    left: 0;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(206, 169, 100, .37), transparent);
}

.brand {
    width: fit-content;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ivory);
    text-decoration: none;
}

.brand-logo { display: block; width: min(100%, 240px); height: auto; max-height: 80px; object-fit: contain; }

.resource-hud {
    min-width: min(455px, 44vw);
    display: grid;
    grid-template-columns: repeat(3, minmax(112px, 1fr));
    border: 1px solid #454239;
    background: rgba(14, 15, 13, .53);
    box-shadow: inset 0 1px rgba(255, 255, 255, .035), 0 4px 12px rgba(0, 0, 0, .18);
}

.resource-item {
    min-width: 0;
    min-height: 49px;
    padding: 7px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-item + .resource-item { border-left: 1px solid var(--line); }

.resource-glyph {
    width: 25px;
    height: 25px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid currentColor;
    transform: rotate(45deg);
    font: 600 9px/1 Georgia, serif;
}

.resource-glyph span { transform: rotate(-45deg); }
.gold-glyph { color: var(--gold); }
.land-glyph { color: #abb1a3; }
.civ-glyph { color: #c08874; }

.resource-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.resource-label {
    color: #a9a08f;
    font-size: 9px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.resource-copy strong {
    overflow: hidden;
    color: #eee3cd;
    font: 600 14px/1.35 Georgia, "Palatino Linotype", serif;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
}

.turn-next { color: #c7bdab; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.server-clock { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.server-clock-copy { display: flex; align-items: baseline; gap: 8px; color: #a79e8d; font-size: 8px; letter-spacing: .08em; white-space: nowrap; }
.server-clock-copy time { color: #e5d8be; font: 600 11px/1.2 Georgia, serif; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.attack-status { margin: 0; padding: 10px 12px; color: #eee2cb; background: rgba(9, 13, 10, .55); border: 1px solid rgba(207, 177, 111, .3); font-size: 12px; font-variant-numeric: tabular-nums; }
.attack-status:empty { display: none; }
.attack-feedback { margin: 0; padding: 10px 12px; color: #d9e5c4; background: rgba(46, 65, 42, .55); border: 1px solid rgba(161, 182, 140, .4); font-size: 12px; }
.attack-feedback a { margin-left: 5px; color: #f0d18d; }
.button:disabled { cursor: not-allowed; opacity: .55; filter: grayscale(.35); }

.utility-nav {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 21px;
}

.utility-nav > a:not(.button) {
    color: #d1c7b5;
    font-size: 12px;
    text-decoration: none;
}

.utility-nav > a:not(.button):hover { color: #fff4df; }

.realm-status {
    display: inline-flex;
    align-items: center;
    color: #bdb4a3;
    font: 600 9px/1 system-ui, sans-serif;
    letter-spacing: .16em;
    white-space: nowrap;
}

.status-flame {
    width: 7px;
    height: 7px;
    margin-right: 9px;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #ae4b45;
    box-shadow: 0 0 0 3px rgba(174, 75, 69, .15), 0 0 12px rgba(174, 75, 69, .55);
}

.game-frame {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px 28px 48px;
    display: grid;
    grid-template-columns: 242px minmax(0, 1fr);
    align-items: start;
    gap: 22px;
    flex: 1;
}

.player-rail {
    position: sticky;
    top: 20px;
    min-width: 0;
    padding: 17px 14px 12px;
    background:
        linear-gradient(145deg, rgba(37, 48, 37, .96), rgba(17, 24, 18, .98) 55%),
        var(--stone);
    border: 1px solid #454238;
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .04);
}

.player-identity {
    padding: 7px 7px 18px;
    display: grid;
    grid-template-columns: 47px minmax(0, 1fr);
    align-items: center;
    gap: 0 11px;
    border-bottom: 1px solid var(--line-soft);
}

.player-portrait {
    width: 47px;
    height: 52px;
    grid-row: span 2;
    display: grid;
    place-items: center;
    color: #e8ddc9;
    background: linear-gradient(145deg, #61594a, #393831);
    border: 1px solid #8a7960;
    clip-path: polygon(50% 0, 96% 12%, 90% 75%, 50% 100%, 10% 75%, 4% 12%);
    font: 600 20px/1 Georgia, "Palatino Linotype", serif;
}

.player-name-block { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rail-kicker,.nav-section-label { color: #9f9787; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.player-name-block strong { overflow: hidden; color: #f1e7d5; font: 600 15px/1.35 Georgia, "Palatino Linotype", serif; text-overflow: ellipsis; }

.player-record {
    grid-column: 2;
    margin-top: 4px;
    display: flex;
    gap: 13px;
    color: #a79e8d;
    font-size: 9px;
}

.player-record strong { color: #e0d4bf; font: 600 10px Georgia, serif; }

.side-navigation { padding: 17px 0 20px; }
.side-navigation .nav-section-label,.rail-footer .nav-section-label { margin: 0 8px 9px; display: block; }
.nav-group { margin: 0 0 5px; }
.nav-group > summary.nav-section-label { min-height: 40px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; color: #c8bda9; cursor: pointer; list-style: none; border: 1px solid transparent; border-radius: 2px; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::marker { content: ""; }
.nav-group > summary:hover { color: #fff1d9; background: rgba(255,255,255,.035); }
.nav-group > summary:focus-visible { outline: 2px solid #d8b77b; outline-offset: 2px; }
.nav-group[open] > summary { color: #e7dcc8; border-color: rgba(164, 73, 70, .22); }
.nav-chevron { color: #a99a7b; font-size: 15px; transition: transform .16s ease; }
.nav-group[open] .nav-chevron { transform: rotate(180deg); }
.nav-group .side-link { margin-top: 1px; }
.language-switch { display: inline-flex; align-items: center; gap: 4px; color: #8c8578; }
.language-switch button { padding: 5px 6px; color: #cfc4b1; background: transparent; border: 1px solid transparent; border-radius: 2px; font: 700 10px/1 system-ui, sans-serif; cursor: pointer; }
.language-switch button:hover,.language-switch button[aria-current="true"] { color: #f2dfb9; border-color: rgba(213, 179, 115, .45); }
.language-switch button:focus-visible { outline: 2px solid #d8b77b; outline-offset: 2px; }

.side-link {
    position: relative;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #c0b6a3;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: 11px;
    text-align: left;
    text-decoration: none;
    transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.side-link:hover { color: #fff1d9; background: rgba(255, 255, 255, .035); }
.side-link.is-active { color: #f0e5d2; background: linear-gradient(90deg, rgba(135, 48, 52, .27), rgba(135, 48, 52, .04)); border-color: rgba(164, 73, 70, .3); }
.side-link.is-active::before { position: absolute; top: 6px; bottom: 6px; left: -1px; width: 2px; content: ""; background: #aa4b48; }
.side-icon { width: 18px; flex: 0 0 auto; color: #aa9a7d; font: 17px/1 Georgia, serif; text-align: center; }
.is-active .side-icon { color: #d28271; }
.crossed-blades { font-size: 14px; }
.profile-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.profile-settings-grid .section-card { margin: 0; }
.profile-avatar-card { grid-column: 1 / -1; }
.avatar-choice-set { min-width: 0; margin: 10px 0 0; padding: 0; border: 0; }
.avatar-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.avatar-choice { min-width: 0; min-height: 120px; margin: 0 !important; padding: 12px 8px; align-items: center; justify-content: center; gap: 8px !important; color: #d9cdb6 !important; background: rgba(15, 17, 15, .55); border: 1px solid rgba(201, 179, 132, .2); cursor: pointer; text-align: center; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.avatar-choice:hover { background: rgba(65, 55, 39, .36); border-color: rgba(213, 183, 118, .55); }
.avatar-choice:focus-within { outline: 2px solid #e4c681; outline-offset: 2px; }
.avatar-choice.is-selected { color: #f2dfad !important; background: rgba(111, 81, 39, .22); border-color: #b99353; box-shadow: inset 0 0 0 1px rgba(212, 177, 103, .23); }
.avatar-choice input[type="radio"] { width: 18px; min-height: 18px; margin: 0; accent-color: #d2ae66; cursor: pointer; }
.avatar-choice > span:last-child { color: inherit; font: 600 14px/1.3 Georgia, "Palatino Linotype", serif; }
.profile-status { padding: 5px 9px; color: #c9c0ad; border: 1px solid rgba(201, 179, 132, .28); font-size: 12px; white-space: nowrap; }
.profile-status.is-verified { color: #b9d8aa; border-color: rgba(115, 157, 92, .55); background: rgba(67, 99, 48, .18); }
.profile-status.is-unverified { color: #e6ca8b; border-color: rgba(179, 139, 66, .55); background: rgba(119, 88, 37, .16); }
.profile-email-address { margin: 8px 0; color: #f0e2c9; font-size: 17px; overflow-wrap: anywhere; }
.email-confirm-card { width: min(680px, 100%); margin: 0 auto; }

.rail-footer { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.rail-record { margin: 0 8px 11px; display: flex; justify-content: space-between; color: #9e9686; font-size: 10px; }
.rail-record strong { color: #ddd2bd; font: 600 11px Georgia, serif; }
.rail-logout { margin: 0; }
.logout-link { color: #aa9e8b; cursor: pointer; font-family: inherit; }
.logout-link:hover { color: #e5c5ba; background: rgba(135, 48, 52, .13); }

.game-content { min-width: 0; }
.public-content { width: min(1180px, 100%); margin: 0 auto; padding: 26px 28px 34px; display: flex; flex-direction: column; justify-content: center; flex: 1; }
.world-footer {
    width: min(1440px, 100%);
    margin: auto auto 0;
    padding: 15px 28px 19px;
    display: flex;
    justify-content: space-between;
    color: #898273;
    border-top: 1px solid rgba(222, 208, 178, .1);
    font-size: 9px;
    letter-spacing: .04em;
}

.world-footer span:last-child { font: 500 9px/1.6 system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.world-footer i { padding: 0 5px; color: #a74945; font-style: normal; }

.panel {
    position: relative;
    background:
        linear-gradient(145deg, rgba(213, 223, 190, .035), transparent 37%),
        linear-gradient(180deg, #202a20, #151d16);
    border: 1px solid #46513f;
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .035);
}

.panel::before {
    position: absolute;
    inset: 5px;
    pointer-events: none;
    content: "";
    border: 1px solid rgba(225, 213, 186, .035);
}

.eyebrow {
    margin: 0 0 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #bd9f80;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .2em;
    line-height: 1.4;
    text-transform: uppercase;
}

.eyebrow-rule { width: 20px; height: 1px; display: inline-block; background: #a34440; }

h1,h2,h3 { font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif; font-weight: 500; }

.hero {
    min-height: 450px;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(300px, .98fr);
    overflow: hidden;
}

.hero-copy { position: relative; z-index: 1; padding: 55px 46px 34px; align-self: center; }
.hero h1,.auth-lore h1 { margin: 0 0 18px; color: #f0e6d3; font-size: clamp(38px, 4.8vw, 60px); line-height: 1.02; letter-spacing: -.035em; }
.hero h1 em,.auth-lore h1 em { color: #bd7a67; font-style: normal; }
.lede { max-width: 470px; margin: 0; color: #c0b5a1; font-size: 14px; line-height: 1.85; }
.hero-actions { margin-top: 28px; display: flex; align-items: center; flex-wrap: wrap; gap: 18px 25px; }
.hero-caption { margin-top: 40px; color: #9c9381; font-size: 8px; font-weight: 650; letter-spacing: .16em; }
.hero-caption i { padding: 0 7px; color: #a55049; font-style: normal; }

.hero-art {
    position: relative;
    min-height: 450px;
    overflow: hidden;
    isolation: isolate;
    background: #172018;
    border-left: 1px solid rgba(221, 202, 164, .13);
}

.hero-forest { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 57% center; filter: brightness(.76) saturate(.88); }

.hero-art::before,.hero-art::after { position: absolute; z-index: 1; inset: 0; pointer-events: none; content: ""; }
.hero-art::before { opacity: .13; background: repeating-linear-gradient(114deg, transparent 0 17px, rgba(240, 225, 195, .13) 18px, transparent 19px 41px); mix-blend-mode: screen; }
.hero-art::after { background: linear-gradient(90deg, rgba(26, 27, 24, .22), transparent 28%, rgba(11, 12, 11, .36)), linear-gradient(0deg, rgba(12, 13, 12, .62), transparent 36%); }
.art-coordinate { position: absolute; z-index: 1; right: 24px; bottom: 20px; left: 24px; display: flex; justify-content: space-between; color: #c0b39c; font-size: 8px; font-weight: 650; letter-spacing: .16em; }
.art-coordinate b { color: #e0d0b5; font-weight: 500; }
.art-coordinate i { color: #a7514a; font-style: normal; }
.art-vignette { position: absolute; z-index: 2; inset: 0; box-shadow: inset 0 0 90px rgba(7, 8, 7, .35); pointer-events: none; }

.feature-grid { margin-top: 17px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature { min-height: 151px; padding: 20px 22px; box-shadow: none; }
.feature-index { color: #b59a79; font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.feature-index i { padding: 0 4px; color: #97514a; font-style: normal; }
.feature h2 { margin: 12px 0 6px; color: #e9dfcd; font-size: 18px; letter-spacing: -.02em; }
.feature p { margin: 0; color: #b1a793; font-size: 11px; line-height: 1.8; }

.realm-map { position: relative; isolation: isolate; width: 100%; aspect-ratio: 2 / 1; margin: 0 0 20px; overflow: hidden; background: #111811; border: 1px solid rgba(209, 181, 119, .48); box-shadow: 0 16px 35px rgba(0, 0, 0, .38); }
.realm-map-image { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 55%; filter: brightness(.82) saturate(.9); }
.realm-map::before { position: absolute; z-index: 1; inset: 0; content: ""; pointer-events: none; background: linear-gradient(90deg, rgba(9, 14, 10, .34), transparent 54%), linear-gradient(0deg, rgba(8, 13, 9, .72), transparent 42%); }
.realm-map-frame { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.map-caption { position: absolute; z-index: 3; left: 7.5%; bottom: 10%; min-width: min(330px, 55%); padding: 10px 15px; display: flex; flex-direction: column; gap: 2px; color: #eee5d3; background: rgba(12, 18, 13, .9); border: 1px solid rgba(207, 177, 111, .48); box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.map-caption .eyebrow { margin: 0; color: #d0bb88; font-size: 8px; }
.map-caption strong { font: 500 18px/1.4 Georgia, serif; }
.map-caption > span { color: #c7c3af; font-size: 10px; }
.map-caption i { padding: 0 5px; color: var(--gold); font-style: normal; }

.button {
    min-height: 43px;
    padding: 11px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #f5eddd;
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.button span { font-size: 16px; font-weight: 400; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #1d1b13; background: linear-gradient(180deg, #d9b96e, #a98543); border-color: #e4cb8e; box-shadow: inset 0 1px rgba(255, 249, 215, .3), 0 4px 12px rgba(0, 0, 0, .25); }
.button-primary:hover { color: #15150f; background: linear-gradient(180deg, #ebca79, #bc9750); border-color: #f0d99c; }
.button-steel { background: linear-gradient(180deg, #505552, #353a38); border-color: #68706a; box-shadow: inset 0 1px rgba(255, 255, 255, .08); }
.button-steel:hover { background: linear-gradient(180deg, #626864, #414744); border-color: #8b9187; }
.button-small { min-height: 36px; padding: 9px 13px; font-size: 10px; }
.button-wide { width: 100%; margin-top: 9px; }
.text-link { color: #d1bda1; font-size: 10px; font-weight: 650; text-decoration: none; }
.text-link:hover { color: #fff0d7; }
.text-link span { margin-left: 5px; color: #b76b5c; }

.auth-layout { width: min(1020px, 100%); min-height: 0; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, 430px); align-items: center; gap: clamp(28px, 6vw, 72px); }
.auth-login-layout { min-height: 0; }
.hero-statistics { position: absolute; z-index: 2; inset: 20px; padding: 20px 22px; color: #f5eddd; background: rgba(19, 20, 18, .9); border: 1px solid rgba(214, 199, 164, .35); box-shadow: 0 12px 34px rgba(0, 0, 0, .35); backdrop-filter: blur(5px); }
.hero-statistics-heading { margin-bottom: 9px; }
.hero-statistics-heading .eyebrow { margin-bottom: 5px; }
.hero-statistics-heading h2 { margin: 0; color: #eee4d2; font: 500 clamp(17px, 1.8vw, 22px)/1.3 Georgia, "Palatino Linotype", serif; }
.hero-statistics-note { margin: 0 0 6px; color: #aaa18f; font-size: 10px; line-height: 1.4; }
.hero-stat-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
.hero-stat-row { min-width: 0; min-height: 39px; padding: 7px 2px; display: flex; align-items: center; justify-content: space-between; gap: 9px; border-bottom: 1px solid rgba(214, 199, 164, .15); }
.hero-stat-row dt { min-width: 0; display: inline-flex; align-items: center; gap: 7px; color: #c9c0ad; font-size: 11px; }
.hero-stat-row .game-icon { width: 17px; height: 17px; flex: 0 0 auto; color: #c5a77d; }
.hero-stat-row:nth-child(3n + 1) .game-icon { color: #8fb68a; }
.hero-stat-row:nth-child(3n) .game-icon { color: #c88d77; }
.hero-stat-row dd { margin: 0; color: #f0e2c9; font: 600 17px/1.2 Georgia, "Palatino Linotype", serif; font-variant-numeric: tabular-nums; }
.auth-lore { position: relative; min-height: 0; padding: 24px 0; align-self: center; }
.auth-lore h1 { margin-bottom: 16px; font-size: clamp(38px, 4.4vw, 55px); }
.auth-lore > p:not(.eyebrow) { max-width: 370px; color: #b9af9c; font-size: 13px; line-height: 1.85; }
.lore-seal { position: absolute; right: 6%; bottom: -3px; width: 120px; height: 137px; display: grid; place-items: center; opacity: .52; color: #c19a6e; border: 1px solid rgba(193, 154, 110, .45); clip-path: polygon(50% 0, 96% 13%, 90% 72%, 50% 100%, 10% 72%, 4% 13%); }
.lore-seal::before,.lore-seal::after { position: absolute; content: ""; border: 1px solid rgba(193, 154, 110, .42); clip-path: polygon(50% 0, 96% 13%, 90% 72%, 50% 100%, 10% 72%, 4% 13%); }
.lore-seal::before { inset: 8px; }
.lore-seal::after { inset: 17px; }
.lore-seal span { z-index: 1; font: 500 25px Georgia, serif; letter-spacing: .1em; }
.lore-seal i { position: absolute; width: 59px; height: 1px; background: #c19a6e; transform: rotate(-40deg); }

.form-card { padding: 24px 28px 20px; }
.form-heading { margin-bottom: 17px; }
.form-heading .eyebrow { margin-bottom: 7px; }
.form-heading h2,.section-card h2 { margin: 0 0 5px; color: #eee4d2; font-size: 23px; line-height: 1.2; letter-spacing: -.02em; }
.form-heading > p:last-child { margin: 0; color: #aaa18f; font-size: 11px; }
.form-card label,.form-stack label,.inline-form label { margin: 11px 0; display: flex; flex-direction: column; gap: 6px; color: #d5cbb8; font-size: 10px; font-weight: 650; }
.form-card input,.form-stack input,.inline-form input,.form-stack select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    color: #f0e6d4;
    background: #171815;
    border: 1px solid #4c4940;
    border-radius: 1px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .22);
    font-size: 12px;
}
.form-card input:focus,.form-stack input:focus,.inline-form input:focus,.form-stack select:focus { border-color: #b58168; outline: 2px solid rgba(190, 133, 103, .28); outline-offset: 1px; }
.form-card input::placeholder,.form-stack input::placeholder { color: #8c8578; }
.form-card small,.form-stack small { color: #a79c88; font-size: 9px; font-weight: 450; }
.form-card .check-label { flex-direction: row; align-items: center; gap: 9px; cursor: pointer; }
.check-label input { width: 15px; min-height: 15px; margin: 0; accent-color: #a24b45; }
.form-footnote { margin: 18px 0 0; color: #aca28e; font-size: 10px; text-align: center; }
.form-footnote a { color: #d2a984; text-decoration: underline; text-decoration-color: rgba(210, 169, 132, .45); text-underline-offset: 3px; }
.form-footnote a:hover { color: #ffe2bd; }

.notice { margin: 0 0 17px; padding: 12px 15px; display: flex; align-items: flex-start; gap: 11px; border: 1px solid #545045; background: #272821; color: #e6dac4; font-size: 11px; }
.notice-mark { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 750; }
.notice-success { color: #d2dfc2; border-color: #586b4e; background: linear-gradient(90deg, rgba(79, 105, 61, .3), rgba(34, 38, 30, .95)); }
.notice-error { color: #f0cbc0; border-color: #794343; background: linear-gradient(90deg, rgba(120, 45, 45, .35), rgba(40, 30, 28, .96)); }
.notice-warning { color: #f0d7a4; border-color: #76603a; background: linear-gradient(90deg, rgba(119, 88, 37, .3), rgba(40, 36, 27, .96)); }
.notice strong { color: #f2e4ce; }
.notice ul { margin: 4px 0 0; padding-left: 16px; color: #d7b8aa; }

.page-heading { margin: 1px 0 22px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 0 0 5px; color: #efe5d3; font-size: clamp(29px, 3vw, 39px); line-height: 1.13; letter-spacing: -.03em; }
.page-heading .eyebrow { margin-bottom: 8px; }
.page-subtitle { margin: 0; color: #aaa18f; font-size: 11px; }
.page-subtitle i { color: #a64d46; font-style: normal; }
.rank-chip { padding: 8px 11px; display: inline-flex; align-items: center; color: #c9bca7; background: rgba(44, 43, 37, .75); border: 1px solid #524c3e; font-size: 8px; font-weight: 650; letter-spacing: .15em; white-space: nowrap; }
.rank-chip .status-flame { margin-right: 8px; }

.stat-grid { margin-bottom: 15px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.stat-card { position: relative; min-width: 0; padding: 13px 16px; overflow: hidden; background: linear-gradient(110deg, #242520, #1d1e1a); border: 1px solid #423f36; }
.stat-card::before { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; content: ""; background: linear-gradient(180deg, #aa4a45, transparent); }
.stat-label,.stat-card small { display: block; color: #aaa18f; font-size: 9px; }
.stat-card strong { margin: 1px 0; display: block; overflow: hidden; color: #eee2cd; font: 500 23px/1.3 Georgia, "Palatino Linotype", serif; font-variant-numeric: tabular-nums; text-overflow: ellipsis; }
.stat-card small { color: #968e7e; font-size: 9px; }
.stat-card small i { color: #a94f48; font-style: normal; }

.dashboard-grid { margin-bottom: 15px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; }
.section-card { min-width: 0; padding: 19px 21px; }
.section-title { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-title .eyebrow { margin: 0 0 4px; }
.section-title h2 { margin: 0; font-size: 21px; }
.sigil { width: 36px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; color: #c38d70; background: rgba(116, 50, 47, .16); border: 1px solid rgba(169, 83, 74, .45); clip-path: polygon(50% 0, 96% 13%, 90% 72%, 50% 100%, 10% 72%, 4% 13%); font: 16px Georgia, serif; }
.sigil-small { width: 32px; height: 35px; color: #c4b18d; background: rgba(179, 148, 99, .08); border-color: rgba(181, 151, 104, .4); }
.troop-list { border-top: 1px solid var(--line-soft); }
.troop-row { min-height: 49px; padding: 7px 1px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(214, 199, 164, .1); }
.unit-icon { width: 29px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; color: #d2b991; background: linear-gradient(145deg, #37352e, #252621); border: 1px solid #5b5444; clip-path: polygon(50% 0, 94% 13%, 89% 75%, 50% 100%, 11% 75%, 6% 13%); font: 500 11px Georgia, serif; }
.unit-name { min-width: 0; flex: 1; color: #ded3c0; font-size: 11px; font-weight: 650; }
.unit-name small { margin-top: 1px; display: block; color: #9e9585; font-size: 9px; font-weight: 450; }
.unit-name i { color: #a94f48; font-style: normal; }
.troop-row > strong { color: #f0e4d0; font: 600 13px Georgia, serif; font-variant-numeric: tabular-nums; }
.muted-copy { margin: -3px 0 12px; color: #aaa18f; font-size: 10px; }
.zone-list { margin-top: 13px; border-top: 1px solid var(--line-soft); }
.zone-row { min-height: 39px; padding: 8px 1px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #c9beac; border-bottom: 1px solid rgba(214, 199, 164, .1); font-size: 10px; }
.zone-row strong { color: #ede2ce; font: 600 12px Georgia, serif; font-variant-numeric: tabular-nums; }
.inline-form { margin-top: 15px; }
.form-note { margin: 0 0 9px; color: #a99f8d; font-size: 9px; }
.recruit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 11px; }
.inline-form label { margin: 7px 0; font-size: 9px; }
.inline-form input { min-height: 36px; padding: 7px 9px; }
.inline-form .button { margin-top: 7px; }
.zone-inputs { display: grid; grid-template-columns: 1fr; }
.recent-card { padding-top: 17px; padding-bottom: 15px; }
.recent-card .section-title { margin-bottom: 9px; }
.report-row { min-height: 41px; padding: 8px 1px; display: flex; align-items: center; gap: 10px; color: #d9cfbd; border-bottom: 1px solid rgba(214, 199, 164, .1); font-size: 10px; text-decoration: none; }
.report-row:last-child { border-bottom: 0; }
.report-row > span:nth-child(2) { min-width: 0; flex: 1; }
.report-row:hover > span:nth-child(2) { color: #fff0d6; text-decoration: underline; text-decoration-color: #95514a; text-underline-offset: 3px; }
.report-row strong,.report-row small { color: #aaa08e; font-size: 8px; font-weight: 650; letter-spacing: .08em; white-space: nowrap; }
.report-row strong { color: #cdb38b; }
.report-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #a5524c; box-shadow: 0 0 0 3px rgba(165, 82, 76, .15); }
.report-dot.win { background: #91a782; box-shadow: 0 0 0 3px rgba(145, 167, 130, .14); }
.report-dot.draw { background: #b89b63; box-shadow: 0 0 0 3px rgba(184, 155, 99, .14); }

/* Authenticated resource and combat header */
.player-status-hud { min-width: 0; gap: 10px; }
.player-status-hud .combat-hud { order: 0; flex: 0 0 252px; min-width: 252px; padding: 9px 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.player-status-hud .combat-stat { min-width: 0; padding: 3px 8px; display: grid; justify-items: center; align-content: center; gap: 3px; text-align: center; }
.player-status-hud .combat-stat + .combat-stat { border-left: 1px solid rgba(213, 195, 157, .22); }
.combat-stat-heading { min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.combat-stat-heading .game-icon { width: 17px; height: 17px; flex: 0 0 auto; color: #d3bd85; }
.player-status-hud .combat-stat-heading > span { color: #c9b987; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.player-status-hud .combat-stat > strong { max-width: 100%; color: #fff0cc; font: 700 clamp(18px, 1.6vw, 22px)/1.15 Georgia, serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-status-hud .resource-hud { order: 1; min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.resource-item { min-width: 0; padding: 6px 9px; gap: 7px; }
.resource-hud .resource-item + .resource-item { border-top: 0; border-left: 1px solid var(--line); }
.game-icon { width: 22px; height: 22px; display: block; flex: 0 0 auto; }
.resource-hud .game-icon-gold { color: var(--gold); }
.resource-hud .game-icon-turns { color: #bdc4ae; }
.resource-hud .game-icon-population { color: #d0a18c; }
.resource-hud .game-icon-army { color: #c9c0a8; }
.resource-copy { min-width: 0; }
.resource-label { color: #c1b8a5; font-size: 10px; line-height: 1.2; }
.resource-copy > strong { overflow: visible; color: #fff0d2; font-size: 15px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.resource-detail { display: block; max-width: 100%; overflow: hidden; color: #a9a18f; font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.resource-detail .compact-number { color: #d8ccb5; }
.compact-number { white-space: nowrap; }

@media (max-width: 1000px) {
    .player-status-hud .combat-hud { flex-basis: 228px; min-width: 228px; padding-right: 5px; padding-left: 5px; }
    .player-status-hud .resource-item { padding-right: 5px; padding-left: 5px; gap: 5px; }
    .player-status-hud .resource-hud .game-icon { width: 19px; height: 19px; }
}

/* Field Ledger: separate building and action pages */
.action-link-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action-link-card { min-width: 0; min-height: 170px; padding: 17px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: #e8dfcd; background: linear-gradient(145deg, rgba(34, 39, 31, .95), rgba(17, 21, 17, .96)); border: 1px solid rgba(205, 185, 139, .28); text-decoration: none; transition: border-color .16s ease, background-color .16s ease; }
.action-link-card:hover { border-color: rgba(227, 198, 133, .74); background-color: rgba(54, 51, 38, .9); }
.action-link-card .eyebrow { margin: 0; color: #d6bd83; }
.action-link-card > strong { color: #f1e8d6; font: 600 20px/1.3 Georgia, "Palatino Linotype", serif; }
.action-link-card > span:not(.eyebrow) { color: #c1b8a6; font-size: 15px; line-height: 1.5; }
.action-link-card > b { margin-top: auto; color: #ecd294; font-size: 14px; }
.action-page-grid { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(0, 1.28fr); align-items: start; gap: 15px; }
.action-summary-panel { padding: 20px; }
.action-summary-panel .eyebrow { margin: 0 0 12px; }
.action-resource-list { margin: 0; }
.action-resource-list > div { min-height: 43px; padding: 9px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.action-resource-list dt { color: #c5bba8; }
.action-resource-list dd { margin: 0; color: #f0e5cf; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.action-form-panel { min-width: 0; }
.action-form { margin-top: 15px; }
.action-form .button { min-width: 220px; }
.action-explanation { margin: 7px 0 15px; color: #c4bba9; font-size: 15px; line-height: 1.6; }
.action-cost-card { margin: 13px 0; padding: 13px 15px; background: rgba(10, 15, 11, .5); border: 1px solid rgba(203, 194, 164, .2); }
.action-cost-card .paper-row:first-child { border-top: 0; }
.action-cost-card .paper-row:last-child { border-bottom: 0; }
.action-form .form-note { margin-top: 8px; }
.skill-choice-summary { margin: 12px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.skill-choice-summary article { min-width: 0; padding: 11px 12px; background: rgba(10, 15, 11, .5); border: 1px solid rgba(203, 194, 164, .2); }
.skill-choice-summary h3 { margin: 0; color: #f0e7d5; font: 600 16px/1.35 Georgia, serif; }
.skill-choice-summary p { margin: 6px 0; color: #c4bba9; font-size: 14px; }
.skill-choice-summary strong,.skill-choice-summary small { display: block; color: #e6d3a1; font-size: 13px; }
.skill-choice-summary small { margin-top: 4px; color: #b9af9c; }
.duel-target-action { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.duel-target-action .form-note { margin: 0; }
.inbox-list { display: grid; gap: 12px; }
.inbox-entry { padding: 18px 20px; }
.inbox-preview { max-width: 80ch; }
.inbox-detail { max-width: 860px; margin: 0 auto; }
.inbox-full-message { min-height: 80px; margin: 18px 0; font-size: 16px; line-height: 1.75; }
.mark-read-form { margin-top: 22px; padding-top: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; border-top: 1px solid var(--line-soft); }
.mark-read-form .form-note { margin: 0; }
.message-compose-panel { max-width: 850px; margin: 0 auto; }
.message-compose-panel textarea { width: 100%; min-height: 170px; padding: 11px 12px; color: #f0e6d4; background: #171815; border: 1px solid #4c4940; border-radius: 2px; font: inherit; line-height: 1.5; resize: vertical; }
.message-compose-panel textarea:focus-visible { border-color: #b58168; outline: 2px solid rgba(190, 133, 103, .28); outline-offset: 1px; }
.field-error { margin: 3px 0; color: #ffc3b5; font-size: 14px; }
.season-status-card,.season-confirm-card { margin-bottom: 15px; }
.season-create-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.season-create-cta h2 { margin: 0 0 4px; color: var(--ivory); font: 500 23px/1.3 Georgia, serif; }
.season-create-cta .muted-copy { margin: 0; max-width: 70ch; }
.season-confirm-card { max-width: 850px; margin-right: auto; margin-left: auto; }

@media (max-width: 820px) {
    .action-page-grid { grid-template-columns: minmax(0, 1fr); }
    .action-summary-panel { order: -1; }
    .action-form-panel { order: 0; }
}

@media (max-width: 620px) {
    .action-link-grid { grid-template-columns: minmax(0, 1fr); }
    .action-link-card { min-height: 140px; }
    .action-page-grid { gap: 10px; }
    .action-summary-panel,.action-form-panel { padding: 15px; }
    .action-form .button { width: 100%; min-width: 0; }
    .skill-choice-summary { grid-template-columns: minmax(0, 1fr); }
    .duel-target-action { align-items: stretch; flex-direction: column; }
    .duel-target-action { width: 100%; padding-left: 48px; }
    .inbox-entry { padding: 14px; }
    .inbox-entry-header { align-items: flex-start; flex-direction: column; }
    .inbox-entry time { text-align: left; }
    .inbox-entry-footer { align-items: flex-start; flex-wrap: wrap; }
    .mark-read-form { align-items: stretch; flex-direction: column; }
    .mark-read-form .button { width: 100%; }
    .season-create-cta { align-items: stretch; flex-direction: column; }
    .season-create-cta .button { width: 100%; }
}

@media (max-width: 820px) {
    .player-status-hud { grid-column: 1 / -1; grid-row: 2; }
    .player-status-hud .combat-hud { flex-basis: 228px; }
    .player-status-hud .resource-hud { flex: 1 1 430px; }
}

@media (max-width: 620px) {
    .player-status-hud { flex-wrap: wrap; gap: 8px; }
    .player-status-hud .combat-hud { flex: 1 1 100%; width: 100%; min-width: 0; min-height: 74px; }
    .player-status-hud .combat-stat { flex-direction: column; padding: 4px 8px; }
    .player-status-hud .combat-stat-heading { flex-direction: row; }
    .player-status-hud .combat-stat > strong { font-size: 20px; }
    .player-status-hud .resource-hud { flex: 1 1 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .player-status-hud .resource-hud .resource-item:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; }
    .player-status-hud .resource-hud .resource-item:nth-child(2) { border-left: 1px solid var(--line); }
    .player-status-hud .resource-item { min-height: 55px; padding: 7px 9px; gap: 8px; }
    .player-status-hud .resource-hud .game-icon { width: 21px; height: 21px; }
    .player-status-hud .resource-label { font-size: 10px; }
    .player-status-hud .resource-copy > strong { font-size: 15px; }
}
.empty-state { padding: 13px 1px; color: #a99f8d; font-size: 10px; }
.empty-state-strong { min-height: 155px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.empty-state-strong strong { color: #e5dac6; font: 500 17px Georgia, serif; }
.empty-state-strong p { max-width: 360px; margin: 4px 0 0; color: #a99f8d; font-size: 10px; }
.empty-glyph { margin-bottom: 8px; color: #b08162; font-size: 20px; }

.battle-layout { grid-template-columns: minmax(0, 1.22fr) minmax(250px, .78fr); }
.form-stack { margin-top: 9px; }
.form-stack label { margin: 9px 0; }
.form-stack .recruit-grid { margin: 12px 0; }
.form-stack .recruit-grid label small { color: #a89c87; }
.form-stack .notice { margin: 12px 0; }
.form-stack select option { color: #eee5d3; background: #1b1c19; }
.battle-rules { margin: 15px 0; padding: 11px 12px; display: flex; gap: 10px; background: rgba(95, 76, 53, .16); border: 1px solid rgba(153, 125, 87, .32); }
.battle-rules p { margin: 0; color: #c0b49f; font-size: 9px; line-height: 1.75; }
.battle-rules strong { margin-right: 5px; color: #e2caa7; }
.rules-mark { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; color: #d9b886; border: 1px solid rgba(217, 184, 134, .5); border-radius: 50%; font: 600 9px Georgia, serif; }
.field-notes { margin: 4px 0 0; padding: 4px 0 0 17px; color: #c0b5a2; font-size: 10px; line-height: 1.9; }
.field-notes li { padding: 4px 0 6px 3px; border-bottom: 1px solid rgba(214, 199, 164, .09); }
.field-notes li:last-child { border-bottom: 0; }

.report-heading { margin-bottom: 20px; }
.report-score-grid { margin-bottom: 15px; display: grid; grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); align-items: center; gap: 11px; }
.report-heading h1 { margin-bottom: 5px; }
.report-heading--win h1,.report-heading--win .report-result-message { color: #94d49c; }
.report-heading--loss h1,.report-heading--loss .report-result-message { color: #f19c8d; }
.report-heading--draw h1,.report-heading--draw .report-result-message { color: #d6c39a; }
.report-result-message { margin: 4px 0 8px; font-size: 17px; font-weight: 700; }
.versus { display: grid; place-items: center; color: #bd8b69; font: 600 10px Georgia, serif; letter-spacing: .14em; }
.parchment { color: var(--paper-ink); background: linear-gradient(145deg, #e2d4b5, var(--paper) 48%, #d1c09a); border: 1px solid #aa9874; box-shadow: 0 12px 28px rgba(0, 0, 0, .23), inset 0 0 0 4px rgba(91, 68, 40, .07), inset 0 0 24px rgba(99, 75, 42, .08); }
.parchment::before { inset: 6px; border: 1px solid rgba(95, 71, 42, .18); }
.score-card { min-height: 111px; padding: 17px 20px; }
.score-card--winner { border-color: #76aa70; box-shadow: 0 0 0 2px rgba(76, 145, 79, .3), 0 12px 28px rgba(0, 0, 0, .23), inset 0 0 24px rgba(62, 128, 59, .13); }
.score-card--loser { border-color: #bc7769; box-shadow: 0 0 0 2px rgba(168, 69, 57, .25), 0 12px 28px rgba(0, 0, 0, .23), inset 0 0 24px rgba(156, 54, 47, .12); }
.score-card--draw { border-color: #aa9874; }
.score-card-player { margin: 0 0 9px; color: #30291f; font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.score-card > span { display: block; color: #655844; font-size: 8px; font-weight: 750; letter-spacing: .17em; }
.score-card strong { margin: 1px 0; display: block; color: #30291f; font: 500 32px/1.2 Georgia, serif; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.score-card small { color: #6f604c; font-size: 10px; }
.report-damage-budget { margin: -4px 0 15px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #e6d8bc; background: linear-gradient(115deg, rgba(40, 43, 35, .96), rgba(25, 28, 24, .96)); border: 1px solid rgba(196, 163, 102, .48); font-size: 13px; }
.report-damage-budget strong { color: #f0d28e; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-damage-budget--missing { justify-content: flex-start; color: #b6ab98; border-color: rgba(166, 151, 126, .3); }
.report-details { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.report-participant-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.report-participant--attacker { border-top: 3px solid #9d8058; }
.report-participant--defender { border-top: 3px solid #747d88; }
.report-commit-note { margin: 14px 0 0; text-align: center; }
.report-paper { min-height: 230px; padding: 19px 22px; }
.paper-heading { position: relative; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(68, 53, 35, .24); }
.paper-heading .eyebrow { margin-bottom: 5px; color: #765b42; font-size: 8px; }
.paper-heading h2 { margin: 0; color: #372e22; font-size: 20px; }
.paper-row { min-height: 34px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; color: #504330; border-bottom: 1px solid rgba(68, 53, 35, .14); font-size: 9px; }
.paper-row strong { color: #342b20; font: 650 10px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.paper-row small { color: #795d43; font-size: 9px; }
.xp-breakdown { margin: -2px 0 8px 8px; padding-left: 10px; display: grid; gap: 4px; border-left: 2px solid rgba(129, 103, 64, .35); }
.xp-breakdown > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: #705f47; font-size: 12px; }
.xp-breakdown strong { color: #604e35; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.outcome-paper .paper-row { grid-template-columns: minmax(0, 1fr) auto; }
.paper-note { margin: 13px 0 0; color: #695740; font-size: 9px; }
.paper-seal { position: absolute; right: 18px; bottom: 15px; width: 37px; height: 37px; display: grid; place-items: center; color: rgba(113, 46, 39, .63); border: 1px solid rgba(113, 46, 39, .43); border-radius: 50%; font: 600 8px Georgia, serif; transform: rotate(-12deg); }

.treasury-deposit-form { margin-top: 18px; padding-top: 15px; border-top: 1px solid rgba(214, 199, 164, .18); }
.treasury-deposit-form > label { margin: 0 0 4px; display: block; color: #e7d8ba; font-size: 15px; font-weight: 700; }
.treasury-deposit-form .form-note { margin-bottom: 10px; }
.treasury-deposit-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.treasury-deposit-controls input { width: 100%; min-width: 0; min-height: 46px; padding: 9px 11px; color: #f0e6d4; background: #171815; border: 1px solid #65583e; border-radius: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }
.treasury-deposit-controls .button { min-height: 46px; }
.treasury-deposit-form input:focus-visible { border-color: #e4c681; outline: 2px solid rgba(228, 198, 129, .45); outline-offset: 2px; }

.ranking-table { padding-top: 12px; padding-bottom: 12px; }
.ranking-head,.ranking-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 95px 130px; align-items: center; gap: 12px; padding: 12px 10px; }
.ranking-head { color: #a99d88; border-bottom: 1px solid var(--line); font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.ranking-row { color: #d9ceba; border-bottom: 1px solid rgba(214, 199, 164, .1); font-size: 11px; }
.ranking-row:last-of-type { border-bottom: 0; }
.ranking-row > span:not(.rank-number) { color: #c4b9a6; font-variant-numeric: tabular-nums; }
.ranking-row strong { font-weight: 650; }
.ranking-row strong small { margin-left: 7px; color: #c28a70; font-size: 8px; letter-spacing: .1em; }
.rank-number { color: #bd9570; font: 500 12px Georgia, serif; }

.inbox-nav-count { min-width: 18px; height: 18px; margin-left: auto; padding: 0 5px; display: inline-grid; place-items: center; color: #fff0df; background: #743b38; border: 1px solid rgba(221, 157, 132, .35); border-radius: 10px; font-size: 9px; font-variant-numeric: tabular-nums; }
.inbox-heading { margin-bottom: 17px; }
.inbox-filters { margin: 0 0 15px; display: flex; flex-wrap: wrap; gap: 7px; }
.inbox-bulk-action { margin: 0 0 13px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(30, 31, 26, .8); border: 1px solid var(--line-soft); }
.inbox-bulk-action p { margin: 0; color: #bcb19e; font-size: 13px; }
.inbox-bulk-action form { margin: 0; }
.inbox-filter { min-height: 35px; padding: 8px 12px; color: #bcb19e; background: rgba(23, 25, 21, .82); border: 1px solid var(--line-soft); font-size: 10px; text-decoration: none; }
.inbox-filter:hover,.inbox-filter:focus-visible { color: #f1e6d2; border-color: #8e7258; }
.inbox-filter.is-active { color: #f1e5d1; background: rgba(117, 54, 49, .27); border-color: rgba(177, 93, 77, .58); }
.inbox-layout { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); align-items: start; gap: 15px; }
.compose-card { position: sticky; top: 14px; }
.compose-card textarea { min-height: 128px; resize: vertical; }
.field-hint { margin-left: 5px; color: #8f887a; font-size: 9px; }
.inbox-list { min-width: 0; display: grid; gap: 10px; }
.inbox-entry { min-width: 0; padding: 15px 17px 11px; }
.inbox-entry.is-unread { border-color: rgba(170, 102, 77, .64); box-shadow: inset 2px 0 #a65b4b, 0 10px 22px rgba(0, 0, 0, .2); }
.inbox-entry-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.inbox-entry-title { min-width: 0; }
.inbox-kind { color: #ba9670; font-size: 8px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.inbox-entry h2 { margin: 4px 0 0; color: #eee3d1; font: 500 16px/1.35 Georgia, "Palatino Linotype", serif; overflow-wrap: anywhere; }
.inbox-entry time { flex: 0 0 auto; color: #928a7b; font-size: 9px; text-align: right; }
.inbox-body { margin: 12px 0; color: #c6bcaa; font-size: 11px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-entry .button-small { min-height: 31px; margin-bottom: 5px; font-size: 9px; }
.inbox-entry-footer { min-height: 28px; padding-top: 8px; display: flex; align-items: center; gap: 12px; border-top: 1px solid rgba(214, 199, 164, .1); }
.inbox-entry-footer > a,.text-button,.read-label,.unread-pip { color: #b9a991; font-size: 9px; }
.inbox-entry-footer > a { text-decoration-color: rgba(185, 169, 145, .4); text-underline-offset: 3px; }
.inbox-entry-footer form { margin: 0 0 0 auto; }
.text-button { padding: 4px 0; background: none; border: 0; color: #e0c29d; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-button:hover { color: #fff0d9; }
.unread-pip { color: #e4b08f; }
.read-label { margin-left: auto; color: #8f9581; }
.inbox-empty { padding: 25px 20px; }
.inbox-empty strong { color: #e5dac6; font: 500 17px Georgia, serif; }
.inbox-empty p { margin-bottom: 0; }
.inbox-pagination { padding: 9px 2px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #a99f8d; font-size: 9px; }
.inbox-pagination a { color: #d2bc9a; text-decoration: none; }
.inbox-pagination a:hover { color: #fff0d9; text-decoration: underline; text-underline-offset: 3px; }
.inbox-pagination [aria-disabled="true"] { color: #6f6b61; }
.scout-score-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scout-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1000px) {
    .game-topbar { padding-right: 22px; padding-left: 22px; grid-template-columns: minmax(170px, 1fr) auto minmax(130px, 1fr); gap: 14px; }
    .resource-hud { min-width: 405px; }
    .resource-item { padding-right: 9px; padding-left: 9px; }
    .game-frame { padding-right: 20px; padding-left: 20px; grid-template-columns: 210px minmax(0, 1fr); gap: 15px; }
    .player-rail { padding-right: 10px; padding-left: 10px; }
    .section-card { padding-right: 16px; padding-left: 16px; }
    .dashboard-grid { gap: 11px; }
    .battle-layout { grid-template-columns: minmax(0, 1.1fr) minmax(220px, .9fr); }
}

@media (max-width: 820px) {
    .game-topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; }
    .resource-hud { min-width: 0; grid-column: 1 / -1; grid-row: 2; }
    .utility-nav { grid-column: 2; grid-row: 1; }
    .game-frame { grid-template-columns: minmax(0, 1fr); padding-top: 18px; }
    .player-rail { position: static; display: grid; grid-template-columns: minmax(180px, .75fr) minmax(0, 1.25fr); align-items: center; gap: 9px 15px; padding: 10px 12px; }
    .player-identity { padding: 3px 5px; border: 0; }
    .player-record { display: none; }
    .side-navigation { padding: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
    .side-navigation .nav-section-label { width: 100%; margin: 0 7px 2px; }
    .nav-group { min-width: 130px; flex: 1 1 auto; }
    .nav-group > summary.nav-section-label { width: 100%; min-height: 38px; margin: 0; }
    .nav-group .side-link { width: 100%; }
    .side-link { width: auto; min-height: 36px; padding: 6px 8px; gap: 6px; font-size: 10px; }
    .side-icon { width: 15px; font-size: 14px; }
    .rail-footer { grid-column: 1 / -1; padding-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
    .rail-footer .nav-section-label { margin: 0; }
    .rail-record { margin: 0 auto 0 0; gap: 12px; }
    .rail-logout .side-link { min-height: 30px; }
    .public-content { padding-top: 30px; }
}

@media (max-width: 620px) {
    .game-topbar { min-height: 0; padding: 10px 14px 11px; gap: 10px 12px; }
    .brand { gap: 8px; }
    .brand-logo { width: min(170px, 100%); max-height: none; }
    .game-topbar-public { flex-wrap: wrap; gap: 8px 12px; }
    .game-topbar-public .brand { flex: 0 1 170px; }
    .game-topbar-public .utility-nav { margin-left: auto; }
    .utility-nav { gap: 12px; }
    .realm-status { font-size: 8px; letter-spacing: .1em; }
    .resource-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .resource-item:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; }
    .resource-item { min-height: 45px; padding: 5px 7px; gap: 8px; }
    .resource-glyph { width: 21px; height: 21px; font-size: 8px; }
    .resource-label { font-size: 8px; }
    .resource-copy strong { font-size: 12px; }
    .game-frame { padding: 13px 12px 35px; gap: 12px; }
    .player-rail { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 9px; }
    .player-portrait { width: 36px; height: 40px; font-size: 16px; }
    .player-identity { grid-template-columns: 36px minmax(0, 1fr); gap: 0 8px; }
    .player-name-block strong { font-size: 12px; }
    .rail-kicker { font-size: 8px; }
    .side-navigation { grid-column: 1 / -1; gap: 2px; }
    .side-navigation .nav-section-label { display: flex; }
    .nav-group { min-width: 0; flex: 1 1 46%; }
    .nav-group > summary.nav-section-label { min-height: 38px; padding: 6px 8px; font-size: 11px; }
    .side-link { min-height: 33px; padding: 5px 7px; font-size: 9px; }
    .rail-footer { grid-column: 1 / -1; }
    .rail-footer > .nav-section-label { display: none; }
    .rail-record { font-size: 9px; }
    .public-content { display: block; padding: 18px 12px 38px; }
    .profile-settings-grid { grid-template-columns: minmax(0, 1fr); }
    .hero { grid-template-columns: minmax(0, 1fr); }
    .hero-copy { padding: 31px 22px 22px; }
    .hero h1,.auth-lore h1 { font-size: clamp(35px, 10vw, 45px); }
    .lede { font-size: 12px; }
    .hero-actions { align-items: flex-start; flex-direction: column; gap: 14px; }
    .hero-caption { margin-top: 25px; font-size: 7px; }
    .hero-art { min-height: 390px; border-top: 1px solid rgba(221, 202, 164, .13); border-left: 0; }
    .hero-statistics { inset: 12px; padding: 14px; }
    .hero-statistics-note { font-size: 9px; }
    .hero-stat-list { grid-template-columns: minmax(0, 1fr); }
    .hero-stat-row { min-height: 34px; }
    .hero-stat-row dt { font-size: 10px; }
    .hero-stat-row dd { font-size: 15px; }
    .realm-map { margin-bottom: 15px; }
    .map-caption { left: 7%; bottom: 11%; min-width: 0; max-width: 72%; padding: 7px 10px; }
    .map-caption strong { font-size: 14px; }
    .map-caption > span { font-size: 8px; }
    .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
    .feature { min-height: 0; padding: 15px 17px; }
    .feature h2 { margin: 7px 0 4px; font-size: 16px; }
    .feature p { font-size: 10px; }
    .auth-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .auth-lore { min-height: 0; padding: 14px 4px 9px; }
    .auth-lore h1 { margin-bottom: 8px; }
    .auth-lore > p:not(.eyebrow) { max-width: 430px; margin: 0; font-size: 11px; }
    .lore-seal { display: none; }
    .form-card { padding: 21px 18px 19px; }
    .form-heading { margin-bottom: 17px; }
    .form-heading h2 { font-size: 21px; }
    .page-heading { margin-bottom: 15px; align-items: flex-start; flex-direction: column; gap: 10px; }
    .page-heading h1 { font-size: 30px; }
    .rank-chip { font-size: 7px; }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .stat-card { padding: 10px 8px; }
    .stat-label,.stat-card small { font-size: 8px; }
    .stat-card strong { font-size: 18px; }
    .dashboard-grid,.battle-layout,.report-details { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .section-card { padding: 16px 14px; }
    .section-title h2 { font-size: 19px; }
    .unit-name { font-size: 10px; }
    .unit-name small { font-size: 8px; }
    .inline-form .button { width: 100%; }
    .report-row { gap: 7px; font-size: 9px; }
    .report-row small { display: none; }
    .report-score-grid { grid-template-columns: minmax(0, 1fr) 27px minmax(0, 1fr); gap: 5px; }
    .report-damage-budget { align-items: flex-start; flex-direction: column; gap: 4px; }
    .report-damage-budget strong { white-space: normal; }
    .score-card { min-height: 93px; padding: 13px 10px; }
    .score-card-player { font-size: 14px; }
    .score-card strong { font-size: 24px; }
    .score-card > span { font-size: 7px; }
    .score-card small { font-size: 8px; }
    .versus { font-size: 8px; }
    .report-paper { min-height: 0; padding: 17px 16px; }
    .report-participant-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .treasury-deposit-controls { grid-template-columns: minmax(0, 1fr); }
    .treasury-deposit-controls .button { width: 100%; }
    .ranking-head,.ranking-row { grid-template-columns: 34px minmax(0, 1fr) 58px 75px; gap: 6px; padding: 10px 4px; }
    .ranking-head { font-size: 7px; }
    .ranking-row { font-size: 9px; }
    .ranking-row strong { overflow-wrap: anywhere; }
    .world-footer { padding: 13px 14px 16px; gap: 8px; flex-direction: column; font-size: 8px; }
    .inbox-layout,.scout-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .compose-card { position: static; }
    .inbox-entry { padding: 13px 12px 9px; }
    .inbox-entry-header { flex-direction: column; gap: 5px; }
    .inbox-entry time { text-align: left; }
    .scout-score-grid { grid-template-columns: minmax(0, 1fr); }
    body { background-attachment: scroll; }
}

@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* M4 castle dashboard */
.dashboard-heading { margin-bottom: 15px; }
.dashboard-quicklinks { margin: 0 0 15px; padding: 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; background: linear-gradient(120deg, rgba(32, 42, 32, .95), rgba(17, 23, 17, .96)); border: 1px solid #45463b; }
.dashboard-quicklinks a { min-width: 0; min-height: 43px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; color: #ded4c0; background: rgba(255, 255, 255, .025); border: 1px solid transparent; font-size: 10px; font-weight: 650; text-decoration: none; }
.dashboard-quicklinks a:hover { color: #fff0d7; background: rgba(205, 171, 101, .08); border-color: rgba(205, 171, 101, .36); }
.dashboard-quicklinks a > span { color: #d0ae68; font-size: 16px; }
.dashboard-quicklinks b { margin-left: auto; color: #bcae93; font-size: 8px; font-weight: 500; white-space: nowrap; }
.castle-overview { margin-bottom: 15px; padding: 18px; overflow: hidden; background: linear-gradient(145deg, rgba(39, 48, 37, .97), rgba(19, 25, 19, .98)); border-color: rgba(185, 164, 117, .38); }
.castle-overview-heading { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.castle-overview-heading .eyebrow { margin: 0 0 2px; color: #cdb783; font-size: 8px; letter-spacing: .15em; text-transform: uppercase; }
.castle-overview-heading h2 { margin: 0; color: #f0e5cf; font: 500 23px/1.2 Georgia, "Palatino Linotype", serif; }
.building-state { width: fit-content; padding: 4px 7px; display: inline-flex; align-items: center; gap: 5px; color: #d8d0b8; background: rgba(18, 25, 18, .82); border: 1px solid #595645; font-size: 8px; font-weight: 650; letter-spacing: .04em; line-height: 1.3; }
.building-state-active { color: #d4e0c0; border-color: rgba(134, 166, 110, .55); }
.building-state-available { color: #f0d493; border-color: rgba(206, 171, 101, .56); }
.building-state-locked { color: #e0b7aa; border-color: rgba(169, 91, 76, .52); }
.castle-map { position: relative; isolation: isolate; min-height: 300px; margin: 0; overflow: hidden; aspect-ratio: 16 / 8.3; background: #26351d; border: 1px solid rgba(211, 187, 127, .48); box-shadow: inset 0 0 48px rgba(5, 9, 6, .25), 0 10px 28px rgba(0, 0, 0, .28); }
.castle-map-terrain { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 52%; }
.castle-map-shade { position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(10, 15, 10, .02) 30%, rgba(8, 13, 9, .48) 100%), linear-gradient(90deg, rgba(8, 13, 9, .12), transparent 26% 74%, rgba(8, 13, 9, .12)); }
.map-building { position: absolute; z-index: 2; width: 20%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: end; color: #f1e8d4; text-decoration: none; transform: translateZ(0); transition: filter .15s ease, transform .15s ease; }
.map-building img { width: 100%; height: auto; max-height: 34%; object-fit: contain; filter: drop-shadow(0 9px 7px rgba(0, 0, 0, .56)); }
.map-building:hover { z-index: 4; filter: brightness(1.12); transform: translateY(-3px); }
.map-building:focus-visible { z-index: 4; outline-offset: 2px; }
.map-building-castle { top: 7%; left: 40%; width: 20%; }
.map-building-barracks { top: 43%; left: 15%; width: 22%; }
.map-building-mine { top: 43%; right: 14%; width: 22%; }
.map-building-label { min-width: max-content; margin-top: -5px; padding: 4px 9px; display: flex; flex-direction: column; align-items: center; color: #f3ead9; background: rgba(14, 20, 14, .91); border: 1px solid rgba(206, 181, 118, .62); box-shadow: 0 4px 12px rgba(0, 0, 0, .32); text-align: center; }
.map-building-label strong { font: 600 11px/1.3 Georgia, serif; }
.map-building-label small { color: #cbd1ba; font-size: 8px; line-height: 1.4; }
.castle-map-caption { position: absolute; z-index: 3; right: 10px; bottom: 9px; max-width: 53%; padding: 5px 8px; color: #e4ddcd; background: rgba(12, 17, 12, .82); border: 1px solid rgba(212, 190, 139, .28); font-size: 8px; text-align: right; }
.building-directory { margin-top: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.building-directory-card { min-width: 0; padding: 11px 13px; background: linear-gradient(135deg, rgba(37, 43, 34, .96), rgba(25, 30, 24, .96)); border: 1px solid rgba(207, 198, 169, .18); }
.building-directory-card h3 { margin: 7px 0 2px; color: #eee4d2; font: 500 17px/1.25 Georgia, serif; }
.building-directory-card p { min-height: 33px; margin: 0 0 7px; color: #b7b09d; font-size: 9px; line-height: 1.55; }
.building-directory-card > a { color: #e1c58e; font-size: 9px; font-weight: 650; text-decoration: none; }
.building-directory-card > a:hover { color: #fff0d4; text-decoration: underline; text-underline-offset: 3px; }
.dashboard-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.building-upgrade-note { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.building-upgrade-note .form-note { margin-top: 7px; }
.dashboard-inbox-link { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
    .dashboard-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dashboard-quicklinks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .castle-overview { padding: 12px; }
    .castle-map { min-height: 260px; aspect-ratio: 1.12; }
    .castle-map-terrain { object-position: center; }
    .map-building img { max-height: 30%; }
    .map-building-castle { top: 7%; left: 35%; width: 30%; }
    .map-building-barracks { top: 41%; left: 5%; width: 31%; }
    .map-building-mine { top: 41%; right: 5%; width: 31%; }
    .map-building-label { padding: 3px 6px; }
    .map-building-label strong { font-size: 10px; }
    .map-building-label small { font-size: 7px; }
    .castle-map-caption { right: 6px; bottom: 6px; max-width: 70%; font-size: 7px; }
    .building-directory { grid-template-columns: minmax(0, 1fr); }
    .building-directory-card p { min-height: 0; }
    .dashboard-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-quicklinks { padding: 6px; gap: 4px; }
    .dashboard-quicklinks a { min-height: 40px; padding: 7px; gap: 6px; font-size: 9px; }
    .dashboard-quicklinks b { font-size: 7px; }
}

/* M5 hero progression and skill allocation */
.hero-progression-panel { margin: 0 0 15px; padding: 17px 20px; background: linear-gradient(115deg, rgba(42, 45, 35, .98), rgba(20, 27, 20, .98)); border: 1px solid rgba(202, 174, 111, .38); box-shadow: inset 0 1px rgba(255, 255, 255, .035), 0 10px 24px rgba(0, 0, 0, .2); }
.hero-progression-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero-progression-top .eyebrow { margin: 0 0 2px; color: #cdb783; font-size: 8px; letter-spacing: .15em; text-transform: uppercase; }
.hero-progression-top h2 { margin: 0; color: #f1e7d3; font: 500 23px/1.25 Georgia, "Palatino Linotype", serif; }
.hero-progression-top h2 span { color: #aaa18f; font: 500 12px/1.2 system-ui, sans-serif; }
.hero-points { padding: 7px 11px; display: flex; align-items: center; gap: 11px; color: #c8bea8; background: rgba(12, 17, 12, .72); border: 1px solid rgba(207, 177, 111, .34); font-size: 9px; }
.hero-points strong { color: #f0d18c; font: 600 18px/1 Georgia, serif; font-variant-numeric: tabular-nums; }
.hero-xp-copy { margin: 11px 0 6px; color: #c4bba7; font-size: 10px; }
.hero-xp-copy strong { color: #f0e5d0; font-variant-numeric: tabular-nums; }
.hero-xp-track { width: 100%; height: 10px; display: block; overflow: hidden; appearance: none; background: #111710; border: 1px solid #505341; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .46); }
.hero-xp-track::-webkit-progress-bar { background: #111710; }
.hero-xp-track::-webkit-progress-value { background: linear-gradient(90deg, #8c713f, #dbbd73); box-shadow: 0 0 12px rgba(219, 189, 115, .33); }
.hero-xp-track::-moz-progress-bar { background: linear-gradient(90deg, #8c713f, #dbbd73); box-shadow: 0 0 12px rgba(219, 189, 115, .33); }
.hero-progression-note { margin: 8px 0 0; color: #a9a18f; font-size: 9px; }
.hero-skills-panel { margin-bottom: 15px; padding: 19px 21px; }
.dashboard-single-grid { grid-template-columns: minmax(0, 1fr); }
.hero-skills-intro { max-width: 760px; margin: -5px 0 13px; color: #bcb29f; font-size: 10px; }
.hero-skill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.hero-skill-card { min-width: 0; padding: 12px; background: linear-gradient(145deg, rgba(43, 46, 38, .95), rgba(25, 30, 24, .97)); border: 1px solid rgba(201, 190, 155, .19); }
.hero-skill-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.hero-skill-card-heading h3 { margin: 0; color: #eee3ce; font: 500 17px/1.25 Georgia, serif; }
.hero-skill-card-heading > strong { color: #e3c887; font: 600 14px/1 Georgia, serif; white-space: nowrap; }
.hero-skill-card-heading small { color: #a9a08d; font: 500 8px/1 system-ui, sans-serif; }
.hero-skill-card > p { min-height: 31px; margin: 7px 0; color: #bcb39f; font-size: 9px; line-height: 1.5; }
.hero-skill-bonus { color: #d8c18c; font-size: 9px; font-weight: 700; }
.hero-skill-result { margin-top: 9px; padding-top: 7px; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line-soft); }
.hero-skill-result span { color: #9e9685; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.hero-skill-result strong { color: #eee4d3; font: 600 11px/1.35 Georgia, serif; }
.skill-allocation-form { margin-top: 13px; padding-top: 12px; display: grid; grid-template-columns: minmax(170px, 1fr) minmax(110px, .6fr) minmax(240px, 1.5fr); align-items: end; gap: 11px; border-top: 1px solid var(--line-soft); }
.skill-allocation-form label { min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; color: #d7cdb9; font-size: 9px; font-weight: 650; }
.skill-allocation-form input,.skill-allocation-form select { width: 100%; min-height: 39px; padding: 8px 10px; color: #f0e6d4; background: #171815; border: 1px solid #4c4940; border-radius: 1px; font-size: 11px; }
.skill-allocation-action { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.skill-allocation-action p { margin: 0; color: #a99f8d; font-size: 8px; line-height: 1.45; }
.skill-allocation-action .button { min-width: 160px; flex: 0 0 auto; }
.skill-allocation-action .button:disabled { opacity: .52; }

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

@media (max-width: 620px) {
    .hero-progression-panel { padding: 14px; }
    .hero-progression-top h2 { font-size: 20px; }
    .hero-points { padding: 6px 8px; gap: 7px; font-size: 8px; }
    .hero-skill-grid { grid-template-columns: minmax(0, 1fr); }
    .hero-skill-card > p { min-height: 0; }
    .skill-allocation-form { grid-template-columns: minmax(0, 1fr) minmax(0, .7fr); }
    .skill-allocation-action { grid-column: 1 / -1; align-items: stretch; flex-direction: column; }
    .skill-allocation-action .button { width: 100%; }
}

/* Player-first game dashboard */
html { scroll-behavior: smooth; }
body { font-size: 16px; }
.game-topbar { gap: 18px; }
.resource-label { font-size: 14px; }
.resource-copy strong { font-size: 17px; }
.turn-next { font-size: 12px; }
.server-clock-copy > span { font-size: 11px; }
.server-clock time { font-size: 16px; }
.rail-kicker,.nav-section-label { font-size: 11px; letter-spacing: .1em; }
.player-name-block strong { font-size: 16px; }
.player-record,.rail-record { font-size: 13px; }
.player-record strong,.rail-record strong { font-size: 13px; }
.side-navigation .nav-section-label { margin-top: 10px; }
.nav-subsection-label { padding-top: 9px; border-top: 1px solid var(--line-soft); }
.side-link { min-height: 44px; font-size: 14px; gap: 9px; }
.side-link-nested { padding-left: 16px; }
.side-icon { width: 20px; font-size: 18px; }
.world-footer,.world-footer span:last-child { font-size: 12px; }
.eyebrow { font-size: 11px; letter-spacing: .12em; }
.page-subtitle { font-size: 16px; line-height: 1.5; }
.rank-chip { padding: 9px 12px; font-size: 12px; letter-spacing: .08em; }
.button { min-height: 48px; padding: 12px 17px; font-size: 15px; }
.button-small { min-height: 42px; font-size: 14px; }
.button-ready { color: #102114; background: linear-gradient(180deg, #bad6a0, #80a66d); border-color: #c8e2ac; box-shadow: inset 0 1px rgba(255, 255, 255, .35), 0 4px 12px rgba(0, 0, 0, .25); }
.button-ready:hover { color: #0c1b10; background: linear-gradient(180deg, #cde5b5, #91b77e); border-color: #d8edc4; }
.button-conditional,.button-conditional:disabled { color: #e0d1ae; background: #39362d; border-color: #756b50; box-shadow: none; cursor: not-allowed; opacity: 1; filter: none; }
.button-danger { color: #fff0e8; background: #713b35; border-color: #a35a4f; }
.button-danger:hover { background: #8a473f; border-color: #c67868; }
.status-pill { display: inline-flex; align-items: center; padding: 7px 11px; border: 1px solid #756b50; border-radius: 999px; color: #edcf8b; background: rgba(45, 40, 28, .72); font-size: 12px; font-weight: 700; white-space: nowrap; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.summary-grid > div { padding: 12px; border: 1px solid rgba(200, 178, 126, .22); border-radius: 7px; background: rgba(13, 16, 13, .45); }
.summary-grid dt { color: #b9af9c; font-size: 12px; }
.summary-grid dd { margin: 5px 0 0; color: #f1e7d4; font-weight: 700; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.table-scroll { overflow-x: auto; }
.table-scroll table { width: 100%; border-collapse: collapse; }
.table-scroll th,.table-scroll td { padding: 10px 12px; border-bottom: 1px solid rgba(200, 178, 126, .18); text-align: left; }
.table-scroll th { color: #d9c38e; }
.season-form > label,.season-time-field > label { margin: 8px 0; display: flex; flex-direction: column; gap: 6px; color: #d5cbb8; font-size: 14px; font-weight: 650; }
.season-form input,.season-form select { width: 100%; min-width: 0; min-height: 46px; padding: 9px 11px; color: #f0e6d4; background: #171815; border: 1px solid #4c4940; border-radius: 2px; font-size: 16px; }
.season-form input:focus-visible,.season-form select:focus-visible { border-color: #b58168; }
.season-time-field { min-width: 0; grid-column: 1 / -1; }
.season-time-help { margin: 3px 0; color: #b9af9c; font-size: 14px; line-height: 1.5; }
.season-time-preview { min-height: 28px; display: block; color: #edcf8b; font-size: 15px; font-weight: 650; }
.season-actions { grid-column: 1 / -1; }
.season-time-field noscript label { margin: 12px 0 6px; display: flex; flex-direction: column; gap: 6px; color: #d5cbb8; font-size: 14px; font-weight: 650; }
@media (max-width: 560px) {
    .form-actions { align-items: stretch; flex-direction: column; }
    .form-actions .button { width: 100%; }
    .season-form { grid-template-columns: minmax(0, 1fr); }
    .season-time-field,.season-actions { grid-column: auto; }
}
.button:disabled { transform: none; }
.text-link,.form-note,.muted-copy,.empty-state,.notice { font-size: 14px; }
.form-card label,.form-stack label,.inline-form label,.skill-allocation-form label { font-size: 14px; }
.form-card input,.form-stack input,.inline-form input,.form-stack select,.skill-allocation-form input,.skill-allocation-form select { min-height: 46px; font-size: 16px; }
.form-card small,.form-stack small,.unit-name small { font-size: 13px; }
.form-heading > p:last-child,.auth-lore > p:not(.eyebrow),.form-footnote { font-size: 15px; }
.feature p,.lede,.map-caption > span { font-size: 15px; }
.stat-grid { gap: 12px; }
.stat-label,.stat-card small { font-size: 13px; }
.stat-card { padding: 15px 16px; }
.stat-card strong { font-size: 26px; }
.section-card { padding: 21px; }
.section-title h2,.form-heading h2 { font-size: 23px; }
.unit-name { font-size: 15px; }
.report-row,.inbox-entry,.inbox-body,.inbox-entry time,.ranking-row,.ranking-head { font-size: 14px; }
.report-row small,.inbox-entry-header,.ranking-head { font-size: 12px; }
.dashboard-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-quicklinks { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 9px; gap: 8px; }
.dashboard-quicklinks a { min-height: 48px; padding: 9px 11px; font-size: 14px; }
.dashboard-quicklinks b { font-size: 12px; }
.castle-overview-heading h2 { font-size: 25px; }
.building-state { padding: 5px 8px; font-size: 12px; letter-spacing: 0; }
.building-directory-card { padding: 14px; }
.building-directory-card h3 { font-size: 19px; }
.building-directory-card p { min-height: 0; font-size: 14px; }
.building-directory-card > a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; }
.map-building-label { padding: 6px 10px; }
.map-building-label strong { font-size: 14px; }
.map-building-label small { font-size: 12px; }
.castle-map-caption { font-size: 12px; }
.hero-progression-top .eyebrow,.hero-points,.hero-xp-copy,.hero-progression-note,.hero-skills-intro { font-size: 14px; }
.hero-points strong { font-size: 21px; }
.hero-skill-card > p,.hero-skill-bonus,.hero-skill-result span { font-size: 13px; }
.hero-skill-card-heading small { font-size: 12px; }
.hero-skill-result strong { font-size: 14px; }
.skill-allocation-action p { font-size: 13px; }
.readiness-panel { margin: 0 0 14px; padding: 20px 22px; background: linear-gradient(115deg, rgba(37, 47, 36, .98), rgba(17, 24, 18, .98)); border: 1px solid rgba(174, 190, 147, .45); box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .04); }
.readiness-heading { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.readiness-heading .eyebrow { margin: 0 0 3px; color: #c6bd96; }
.readiness-heading h2 { margin: 0; color: #f1e9d9; font: 500 26px/1.2 Georgia, "Palatino Linotype", serif; }
.readiness-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.readiness-stat { min-width: 0; min-height: 126px; padding: 15px 17px; display: flex; align-items: center; gap: 17px; background: rgba(8, 13, 9, .55); border: 1px solid rgba(222, 213, 183, .22); }
.readiness-attack { border-left: 4px solid #ae6250; }
.readiness-defence { border-left: 4px solid #819a78; }
.readiness-icon { width: 45px; height: 45px; flex: 0 0 auto; display: grid; place-items: center; color: #e5c47c; background: rgba(205, 171, 101, .1); border: 1px solid rgba(205, 171, 101, .4); border-radius: 50%; }
.readiness-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.readiness-stat h3 { margin: 0; color: #d4cbb6; font-size: 16px; font-weight: 650; }
.readiness-stat strong { display: block; color: #fff0cd; font: 600 clamp(34px, 4vw, 48px)/1.1 Georgia, "Palatino Linotype", serif; font-variant-numeric: tabular-nums; }
.readiness-stat p { margin: 4px 0 0; color: #c0b8a4; font-size: 13px; }
.readiness-note { margin: 12px 0 0; color: #bdb5a1; font-size: 14px; }
.upgrade-plan { margin-top: 14px; padding: 15px; background: rgba(10, 15, 11, .5); border: 1px solid rgba(203, 194, 164, .2); }
.upgrade-plan-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.upgrade-plan-heading .eyebrow { margin: 0 0 3px; }
.upgrade-plan-heading h3,.upgrade-plan-heading h4 { margin: 0; color: #f0e7d5; font: 500 19px/1.3 Georgia, "Palatino Linotype", serif; }
.upgrade-plan-heading h4 { font-size: 17px; }
.upgrade-benefit,.upgrade-prerequisite,.upgrade-ready-copy,.upgrade-requirements { margin: 10px 0; color: #d0c7b4; font-size: 14px; line-height: 1.55; }
.upgrade-benefit strong { color: #e6d3a1; }
.upgrade-prerequisite a,.upgrade-requirements a { color: #f0d08c; font-weight: 650; text-underline-offset: 3px; }
.upgrade-costs { margin: 10px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.upgrade-costs > div { min-width: 0; padding: 9px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; background: rgba(242, 229, 199, .045); border: 1px solid rgba(202, 190, 159, .14); }
.upgrade-costs span { color: #beb5a1; font-size: 13px; }
.upgrade-costs strong { color: #f1e4c6; font-size: 16px; font-variant-numeric: tabular-nums; }
.upgrade-costs small { grid-column: 1 / -1; color: #a9a18f; font-size: 12px; }
.upgrade-requirements { padding-left: 20px; color: #f0d493; }
.upgrade-requirements li + li { margin-top: 3px; }
.upgrade-ready-copy { color: #c9dbba; }
.operation-subheading { margin: 22px 0 4px; color: #efe4cf; font: 500 19px/1.3 Georgia, "Palatino Linotype", serif; }
.armour-upgrade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
section[id],figure[id] { scroll-margin-top: 18px; }

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

@media (max-width: 820px) {
    .player-rail { align-items: start; }
    .side-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 3px; }
    .side-navigation .nav-section-label { grid-column: 1 / -1; width: auto; margin: 5px 6px; }
    .side-link { width: 100%; min-height: 44px; padding: 7px 8px; font-size: 14px; }
    .dashboard-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .game-frame { padding: 12px 12px 30px; }
    .side-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .side-navigation .nav-section-label { display: block; }
    .side-link { min-height: 44px; padding: 7px; font-size: 14px; }
    .side-icon { width: 17px; font-size: 16px; }
    .page-subtitle { font-size: 15px; }
    .dashboard-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-label,.stat-card small { font-size: 12px; }
    .stat-card strong { font-size: 23px; }
    .dashboard-quicklinks { grid-template-columns: minmax(0, 1fr); }
    .dashboard-quicklinks a { min-height: 46px; font-size: 14px; }
    .readiness-panel { padding: 16px 13px; }
    .readiness-heading { align-items: stretch; flex-direction: column; }
    .readiness-heading .button { width: 100%; }
    .readiness-values { grid-template-columns: minmax(0, 1fr); }
    .readiness-stat { min-height: 100px; }
    .readiness-stat strong { font-size: 38px; }
    .castle-map { min-height: 260px; }
    .map-building-label { min-width: 0; }
    .map-building-label strong { font-size: 13px; }
    .map-building-label small { font-size: 11px; }
    .castle-map-caption { max-width: 78%; font-size: 11px; }
    .building-state { font-size: 11px; }
    .section-card { padding: 15px; }
    .upgrade-plan { padding: 12px; }
    .upgrade-plan-heading { align-items: flex-start; }
    .upgrade-plan-heading h3 { font-size: 17px; }
    .armour-upgrade-grid { grid-template-columns: minmax(0, 1fr); }
    .upgrade-costs > div { padding: 8px; }
    .upgrade-costs span,.upgrade-costs small { font-size: 12px; }
    .button-ready,.button-conditional { width: 100%; }
}

@media (max-width: 370px) {
    .player-rail { grid-template-columns: minmax(0, 1fr); }
    .player-identity { grid-template-columns: 36px minmax(0, 1fr); }
    .side-navigation { grid-column: 1; }
    .rail-footer { grid-column: 1; }
    .dashboard-stat-grid { grid-template-columns: minmax(0, 1fr); }
    .upgrade-costs { grid-template-columns: minmax(0, 1fr); }
}

/* Player-focused, separate game pages */
.player-status-hud { min-width: 0; display: flex; align-items: stretch; gap: 8px; }
.player-status-hud .resource-hud { min-width: 0; flex: 1 1 auto; }
.combat-hud { min-width: 166px; padding: 5px 9px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; background: linear-gradient(145deg, rgba(41, 45, 37, .95), rgba(19, 23, 19, .98)); border: 1px solid rgba(212, 184, 126, .48); box-shadow: inset 0 1px rgba(255,255,255,.05), 0 3px 10px rgba(0,0,0,.22); }
.combat-hud > div { min-width: 0; padding: 3px 8px; display: flex; flex-direction: column; gap: 1px; }
.combat-hud > div + div { border-left: 1px solid rgba(213, 195, 157, .22); }
.combat-hud span { color: #c9b987; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.combat-hud strong { color: #fff0cc; font: 700 19px/1.15 Georgia, serif; font-variant-numeric: tabular-nums; }
.shared-player-avatar { width: 46px; height: 50px; flex: 0 0 auto; display: inline-grid; place-items: center; color: #9a8c68; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.shared-player-avatar img { width: 100%; height: 100%; display: block; object-fit: contain; image-rendering: pixelated; }
.shared-player-avatar-small { width: 30px; height: 34px; }
.shared-player-avatar-profile { width: 54px; height: 58px; filter: none; }
.player-record { grid-column: 2; flex-wrap: wrap; gap: 3px 10px; font-size: 13px; }
.player-record strong { font-size: 13px; }
.dashboard-shortcuts { margin: 15px 0; }
.dashboard-shortcuts h2 { margin: 2px 0 5px; color: var(--ivory); font: 500 20px/1.35 Georgia, serif; }
.dashboard-shortcuts .button { margin-top: 10px; }
.building-detail { max-width: 940px; margin: 0 auto 15px; padding: 22px; }
.building-detail .zone-row { font-size: 15px; }
.building-detail .form-note,.building-detail .upgrade-benefit,.building-detail .upgrade-requirements,.building-detail .upgrade-ready-copy { font-size: 15px; }
.building-detail .upgrade-plan { margin-top: 18px; padding: 18px; }
.building-back-link { margin: 16px 0; font-size: 16px; }
.building-back-link a,.text-link { color: #e8ce91; text-underline-offset: 3px; }
.duel-panel { padding: 20px; }
.duel-sort-form { margin: 12px 0 16px; display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; }
.duel-sort-form label { display: flex; flex-direction: column; gap: 4px; color: #e2d6c0; font-size: 15px; }
.duel-sort-form select,.duel-attack-form select { min-height: 42px; padding: 7px 10px; color: var(--ivory); background: #151a15; border: 1px solid #555344; }
.duel-sort-form > span { color: #b8ae9c; font-size: 14px; }
.duel-opponent { min-width: 0; padding: 14px 4px; display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line-soft); }
.duel-opponent-copy { min-width: 0; flex: 1; }
.duel-opponent-copy h3 { margin: 0; color: #f3e8d3; font: 600 19px/1.3 Georgia, serif; overflow-wrap: anywhere; }
.duel-opponent-copy p { margin: 3px 0 0; color: #c0b7a6; font-size: 15px; }
.duel-opponent-copy .duel-allowance { color: #e6d39f; font-size: 14px; }
.duel-attack-form { display: flex; align-items: end; gap: 8px; }
.duel-attack-form label { display: flex; flex-direction: column; gap: 3px; color: #c8beac; font-size: 12px; }
.duel-attack-form .button { min-height: 42px; }
.battle-rules { margin-top: 14px; padding: 13px 16px; display: flex; gap: 10px; color: #d4c8b3; background: rgba(43, 44, 35, .8); border: 1px solid rgba(207, 177, 111, .25); font-size: 15px; }
.battle-rules p { margin: 0; }
.ranking-head,.ranking-row { grid-template-columns: 64px minmax(150px, 1fr) 120px 100px; }
.ranking-player { min-width: 0; display: flex; align-items: center; gap: 10px; }
.ranking-player strong { overflow-wrap: anywhere; }
.ranking-row > span { font-size: 15px; }
.ranking-row .shared-player-avatar { width: 30px; }
.reports-pagination { margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.game-content { font-size: 16px; }
.page-subtitle,.muted-copy { font-size: 16px; }
.duel-opponent-copy p { font-size: 16px; }
.duel-opponent-copy .duel-allowance { font-size: 14px; }

@media (max-width: 1200px) {
    .game-topbar { grid-template-columns: minmax(160px, auto) minmax(0, 1fr) minmax(135px, auto); gap: 10px; }
    .player-status-hud { gap: 6px; }
}

@media (max-width: 1000px) {
    .game-topbar { grid-template-columns: minmax(145px, .8fr) minmax(0, 1.8fr) auto; gap: 12px; }
    .player-status-hud { gap: 6px; }
    .combat-hud { min-width: 146px; padding-right: 3px; padding-left: 3px; }
}
@media (max-width: 820px) {
    .game-topbar { grid-template-columns: minmax(0, 1fr) auto; }
    .player-status-hud { grid-column: 1 / -1; grid-row: 2; }
    .utility-nav { grid-column: 2; grid-row: 1; }
    .player-record { display: flex; }
}
@media (max-width: 620px) {
    .player-status-hud { flex-wrap: wrap; }
    .player-status-hud .resource-hud { flex-basis: 100%; }
    .combat-hud { min-width: 0; width: 100%; min-height: 50px; }
    .combat-hud > div { align-items: center; flex-direction: row; justify-content: center; gap: 8px; }
    .combat-hud strong { font-size: 17px; }
    .player-identity { grid-template-columns: 38px minmax(0, 1fr); }
    .shared-player-avatar { width: 38px; height: 43px; }
    .player-record { grid-column: 1 / -1; margin-top: 5px; justify-content: space-between; gap: 4px 8px; font-size: 12px; }
    .player-record strong { font-size: 12px; }
    .duel-opponent { align-items: flex-start; flex-wrap: wrap; gap: 7px 10px; }
    .duel-opponent-copy { flex-basis: calc(100% - 55px); }
    .duel-attack-form { width: 100%; padding-left: 48px; }
    .duel-attack-form label { flex: 1; }
    .duel-attack-form select { width: 100%; }
    .duel-attack-form .button { min-width: 130px; }
    .ranking-head,.ranking-row { grid-template-columns: 40px minmax(100px, 1fr) 78px 62px; gap: 5px; }
    .ranking-row > span { font-size: 13px; }
    .ranking-player { gap: 5px; }
    .ranking-player .shared-player-avatar { width: 22px; height: 25px; }
    .building-detail { padding: 15px; }
    .building-detail .upgrade-plan { padding: 12px; }
    .duel-sort-form > span { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .shared-player-avatar { filter: none; }
    .avatar-choice { transition: none; }
}

/* Readable values in the new action and dispatch screens */
.action-cost-card .paper-row { min-height: 38px; grid-template-columns: minmax(0, 1fr) auto; font-size: 14px; line-height: 1.45; }
.action-cost-card .paper-row strong { font-size: 15px; }
.inbox-entry-footer > a,.inbox-entry-footer .read-label,.inbox-entry-footer .unread-pip { font-size: 14px; }
.inbox-entry-footer .button-small { min-height: 44px; }
.skill-choice-summary h3 { font-size: 16px; }
.skill-choice-summary p { font-size: 14px; }
.skill-choice-summary strong,.skill-choice-summary small { font-size: 14px; }
.js-preview { display: none; }
.has-game-action-js .js-preview { display: block; }

/* Compact, label-free player HUD. */
.player-status-hud { align-items: center; gap: clamp(12px, 1.5vw, 22px); }
.player-status-hud .combat-hud {
    min-width: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.2vw, 17px);
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.player-status-hud .combat-stat {
    min-width: 0;
    padding: 2px 1px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    text-align: left;
}
.player-status-hud .combat-stat + .combat-stat { border: 0; }
.player-status-hud .combat-stat .game-icon { width: 20px; height: 20px; color: #d7c28d; }
.player-status-hud .combat-stat > strong { color: #fff0cc; font: 700 16px/1.15 Georgia, serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-status-hud .resource-hud {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.3vw, 18px);
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.player-status-hud .resource-item {
    min-height: 0;
    padding: 2px 1px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
}
.player-status-hud .resource-hud .resource-item + .resource-item { border: 0; }
.player-status-hud .resource-item .game-icon { width: 19px; height: 19px; }
.player-status-hud .resource-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.player-status-hud .resource-copy > strong { overflow: visible; color: #fff0d2; font-size: 15px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-status-hud .resource-label,.player-status-hud .resource-detail { display: none; }
.player-status-hud .turn-next { color: #bcb29f; font-size: 10px; line-height: 1.1; }
.player-status-hud .game-icon-gold { color: var(--gold); }
.player-status-hud .game-icon-turns { color: #bdc4ae; }
.player-status-hud .game-icon-population { color: #d0a18c; }
.hud-chip { position: relative; cursor: help; }
.hud-chip:focus-visible { outline: 2px solid #e4c681; outline-offset: 4px; border-radius: 2px; }
.hud-chip::after {
    position: absolute;
    z-index: 1000;
    left: 50%;
    bottom: calc(100% + 8px);
    padding: 6px 9px;
    color: #fff1d8;
    background: #181a16;
    border: 1px solid rgba(218, 189, 127, .72);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .48);
    content: attr(data-tooltip);
    font: 600 12px/1.2 system-ui, sans-serif;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity .12s ease, transform .12s ease;
}
.hud-chip:hover::after,.hud-chip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
    .player-status-hud { gap: 12px; }
    .player-status-hud .combat-hud,.player-status-hud .resource-hud { gap: 10px; }
}
@media (max-width: 820px) {
    .player-status-hud { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; justify-content: center; }
    .player-status-hud .combat-hud,.player-status-hud .resource-hud { flex: 0 1 auto; width: auto; min-width: 0; }
}
@media (max-width: 620px) {
    .player-status-hud { gap: 9px 15px; }
    .player-status-hud .combat-hud,.player-status-hud .resource-hud { min-height: 0; flex-basis: auto; width: auto; gap: 11px; }
    .player-status-hud .combat-stat { min-height: 0; padding: 2px 1px; flex-direction: row; }
    .player-status-hud .combat-stat .game-icon,.player-status-hud .resource-item .game-icon { width: 18px; height: 18px; }
    .player-status-hud .combat-stat > strong,.player-status-hud .resource-copy > strong { font-size: 13px; }
    .player-status-hud .resource-item { min-height: 0; padding: 2px 1px; gap: 5px; }
    .player-status-hud .turn-next { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .hud-chip::after { transition: none; }
}

/* Player rail and resource strip */
.game-topbar-game { grid-template-columns: minmax(0, 1fr) auto; }
.resource-bar {
    position: relative;
    z-index: 1;
    width: 100%;
    color: var(--ivory);
    background: linear-gradient(180deg, rgba(28, 34, 25, .98), rgba(19, 25, 19, .98));
    border-bottom: 1px solid rgba(206, 169, 100, .32);
    box-shadow: 0 4px 13px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .025);
}
.resource-bar-inner {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 0 max(28px, calc((100vw - 1440px) / 2));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}
.resource-stat {
    min-width: 0;
    min-height: 68px;
    padding: 10px clamp(16px, 3vw, 34px);
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    border-right: 1px solid rgba(214, 199, 164, .13);
}
.resource-stat:last-child { border-right: 0; }
.resource-stat > .game-icon { width: 26px; height: 26px; color: #d4c28c; }
.resource-stat:nth-child(2) > .game-icon { color: var(--gold); }
.resource-stat:nth-child(3) > .game-icon { color: #bdc4ae; }
.resource-stat:nth-child(4) > .game-icon { color: #d0a18c; }
.resource-stat-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.resource-stat-main { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.resource-stat-name { color: #c9bd9f; font-size: 14px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.resource-stat-main > strong { color: #fff0d2; font: 600 22px/1.2 Georgia, "Palatino Linotype", serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.resource-stat .turn-next { color: #bcb29f; font-size: 12px; line-height: 1.2; }
.resource-stat:focus-visible { outline: 2px solid #e4c681; outline-offset: -3px; }

.player-identity {
    padding: 8px 5px 15px;
    grid-template-columns: 45px minmax(0, 1fr);
    align-items: start;
    gap: 0 10px;
}
.player-identity > .shared-player-avatar { grid-column: 1; grid-row: 1; align-self: start; margin-top: 2px; }
.player-name-block { min-width: 0; grid-column: 2; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.player-name-block > strong { color: #f1e7d5; font: 600 15px/1.3 Georgia, "Palatino Linotype", serif; overflow-wrap: anywhere; }
.player-level { color: #d4c5a6; font-size: 13px; font-weight: 700; }
.player-level-progress { min-width: 0; margin: -1px 0 2px; display: grid; gap: 5px; }
.player-level-progress-copy { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; color: #c9bd9f; font-size: 10px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.player-level-progress-copy > :first-child { color: #f0dfb8; font-weight: 700; }
.player-level-progress-copy > :last-child { color: #b7ad99; }
.player-level-progress-copy .player-level-progress-status { color: #e6ca78; font-weight: 800; letter-spacing: .12em; }
.player-level-progress-track { width: 100%; height: 8px; display: block; appearance: none; overflow: hidden; background: linear-gradient(90deg, #121710, #20271b); border: 1px solid rgba(198, 169, 99, .42); border-radius: 999px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .65), 0 1px rgba(255, 255, 255, .035); }
.player-level-progress-track::-webkit-progress-bar { background: linear-gradient(90deg, #121710, #20271b); }
.player-level-progress-track::-webkit-progress-value { background: linear-gradient(90deg, #8b6931 0%, #c8a653 58%, #f0d98a 100%); border-radius: inherit; box-shadow: 0 0 9px rgba(226, 190, 103, .43); }
.player-level-progress-track::-moz-progress-bar { background: linear-gradient(90deg, #8b6931 0%, #c8a653 58%, #f0d98a 100%); border-radius: inherit; box-shadow: 0 0 9px rgba(226, 190, 103, .43); }
.player-identity .player-record {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    color: #c9beac;
    font-size: 13px;
    white-space: nowrap;
}
.record-wins { color: #9dcc94; }
.record-losses { color: #e18a83; }
.record-wins strong,.record-losses strong { color: inherit; font: 700 13px/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.record-divider { color: #817968; }
.player-combat-ratings { margin-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.player-combat-stat {
    min-width: 0;
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    color: #cec3ad;
    font-size: 12px;
    line-height: 1.3;
}
.player-combat-stat .game-icon { width: 16px; height: 16px; color: #d6c58f; }
.player-combat-stat > strong { color: #f2e6cf; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 1000px) {
    .game-topbar-game { grid-template-columns: minmax(0, 1fr) auto; }
    .resource-bar-inner { padding-right: 22px; padding-left: 22px; }
    .resource-stat { padding-right: 16px; padding-left: 16px; }
}
@media (max-width: 820px) {
    .game-topbar-game { grid-template-columns: minmax(0, 1fr) auto; }
    .resource-bar-inner { padding-right: 20px; padding-left: 20px; }
    .resource-stat { min-height: 62px; }
    .player-rail { align-items: start; }
    .player-identity { min-width: 0; padding: 5px 4px 12px; }
}
@media (max-width: 620px) {
    .resource-bar-inner { padding: 0 10px; }
    .resource-stat { min-height: 60px; padding: 7px 7px; grid-template-columns: 21px minmax(0, 1fr); gap: 6px; }
    .resource-stat > .game-icon { width: 20px; height: 20px; }
    .resource-stat-name { display: none; }
    .resource-stat-main { justify-content: flex-start; }
    .resource-stat-main > strong { font-size: 18px; }
    .resource-stat .turn-next { font-size: 9px; }
    .player-rail { grid-template-columns: minmax(0, 1fr); }
    .player-identity { grid-template-columns: 40px minmax(0, 1fr); padding: 5px 4px 12px; }
    .player-identity > .shared-player-avatar { width: 38px; height: 43px; }
    .player-identity .player-record { justify-content: flex-start; }
    .player-combat-stat { max-width: 245px; }
}
@media (max-width: 370px) {
    .resource-bar-inner { padding-right: 5px; padding-left: 5px; }
    .resource-stat { padding-right: 4px; padding-left: 4px; grid-template-columns: 18px minmax(0, 1fr); gap: 4px; }
    .resource-stat > .game-icon { width: 18px; height: 18px; }
    .resource-stat-main > strong { font-size: 16px; }
    .resource-stat .turn-next { font-size: 8px; }
}

/* Combat ratings lead the resource strip; honours stay with player identity. */
.resource-bar-inner { grid-template-columns: minmax(285px, 1.4fr) repeat(3, minmax(0, 1fr)); }
.resource-combat-hud {
    min-width: 0;
    padding: 5px 9px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    background: linear-gradient(145deg, rgba(49, 43, 32, .96), rgba(25, 29, 23, .97));
    border-right: 1px solid rgba(214, 199, 164, .2);
    box-shadow: inset 0 1px rgba(255,255,255,.045);
}
.resource-combat-stat { min-width: 0; padding: 5px 10px; display: flex; align-items: center; gap: 10px; }
.resource-combat-stat + .resource-combat-stat { border-left: 1px solid rgba(214, 199, 164, .17); }
.resource-combat-stat > .game-icon { width: 35px; height: 35px; flex: 0 0 auto; stroke-width: 1.55; }
.resource-combat-attack > .game-icon { color: #e39469; filter: drop-shadow(0 0 5px rgba(227, 148, 105, .22)); }
.resource-combat-defence > .game-icon { color: #a9c2ce; filter: drop-shadow(0 0 5px rgba(169, 194, 206, .2)); }
.resource-combat-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.resource-combat-copy .resource-stat-name { color: #d7c9a9; font-size: 12px; }
.resource-combat-copy > strong { color: #fff0d2; font: 700 29px/1 Georgia, "Palatino Linotype", serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.resource-combat-attack .resource-combat-copy > strong { color: #ffe1c9; }
.resource-combat-defence .resource-combat-copy > strong { color: #e2f0f4; }
.player-honours { margin-top: 1px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.player-honour { min-width: 0; display: inline-flex; align-items: center; gap: 4px; color: #d2c6af; font-size: 11px; line-height: 1.2; white-space: nowrap; }
.player-honour .game-icon { width: 14px; height: 14px; stroke-width: 1.8; }
.player-honour strong { color: #f1e7d5; font-size: 12px; font-variant-numeric: tabular-nums; }
.player-medals .game-icon { color: #cfb56b; }
.player-credits { color: #dfc274; }
.player-credits .game-icon,.player-credits strong { color: #edc95f; }
.player-credits strong { text-shadow: 0 0 9px rgba(237, 201, 95, .28); }

@media (max-width: 1000px) {
    .resource-bar-inner { grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(0, 1fr)); }
    .resource-combat-stat { padding-right: 7px; padding-left: 7px; gap: 7px; }
    .resource-combat-stat > .game-icon { width: 31px; height: 31px; }
    .resource-combat-copy > strong { font-size: 25px; }
}
@media (max-width: 820px) {
    .resource-bar-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .resource-combat-hud { grid-column: 1 / -1; min-height: 74px; border-right: 0; border-bottom: 1px solid rgba(214, 199, 164, .16); }
    .resource-combat-stat { justify-content: center; gap: 12px; }
    .resource-combat-stat > .game-icon { width: 36px; height: 36px; }
    .resource-combat-copy .resource-stat-name { font-size: 13px; }
    .resource-combat-copy > strong { font-size: 29px; }
    .resource-stat { border-right: 1px solid rgba(214, 199, 164, .13); }
    .resource-stat:nth-child(4) { border-right: 0; }
}
@media (max-width: 620px) {
    .resource-bar-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .resource-combat-hud { min-height: 68px; padding: 3px 6px; }
    .resource-combat-stat { gap: 7px; padding: 4px 5px; }
    .resource-combat-stat > .game-icon { width: 30px; height: 30px; }
    .resource-combat-copy .resource-stat-name { font-size: 11px; letter-spacing: .035em; }
    .resource-combat-copy > strong { font-size: 24px; }
    .resource-stat-name { display: none; }
    .player-honours { gap: 5px 10px; }
}
@media (max-width: 370px) {
    .resource-combat-stat { gap: 5px; padding-right: 2px; padding-left: 2px; }
    .resource-combat-stat > .game-icon { width: 26px; height: 26px; }
    .resource-combat-copy .resource-stat-name { font-size: 10px; }
    .resource-combat-copy > strong { font-size: 21px; }
}

/* Castle unlock markers: lock text remains visible on both the map and directory. */
.castle-map .map-building-forge { top: 12%; left: 9%; width: 20%; }
.castle-map .map-building-forge img { max-height: 27%; }
.castle-map .map-building-treasury { top: 12%; right: 9%; width: 18%; min-height: 26%; }
.castle-map .map-building-treasury .map-building-label { margin-top: 5px; }
.castle-map .map-treasury-sigil { width: 58%; min-height: 74px; display: grid; place-items: center; color: #f2d17b; background: linear-gradient(145deg, rgba(104, 77, 32, .94), rgba(39, 31, 19, .97)); border: 2px solid rgba(244, 210, 125, .82); box-shadow: inset 0 0 0 4px rgba(19, 19, 14, .45), 0 9px 14px rgba(0, 0, 0, .48); font: 700 51px/1 Georgia, serif; text-shadow: 0 2px 5px #000; }
.castle-map .map-building-locked { cursor: default; filter: saturate(.62); }
.castle-map .map-building-locked:hover { filter: saturate(.72); transform: none; }
.castle-map .map-building-locked img { filter: grayscale(.72) brightness(.64) drop-shadow(0 9px 7px rgba(0, 0, 0, .56)); }
.castle-map .map-lock-mark { position: absolute; top: 21%; left: 50%; z-index: 2; width: 34px; height: 31px; display: grid; place-items: center; transform: translateX(-50%); color: #fff3d4; background: rgba(22, 24, 19, .92); border: 1px solid rgba(244, 210, 125, .85); border-radius: 7px 7px 4px 4px; box-shadow: 0 3px 9px rgba(0, 0, 0, .5); font: 700 21px/1 system-ui, sans-serif; }
.castle-map .map-building-locked .map-lock-mark::before { content: ""; position: absolute; top: -13px; left: 8px; width: 14px; height: 13px; border: 3px solid #fff3d4; border-bottom: 0; border-radius: 10px 10px 0 0; }
.castle-overview .building-directory { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.building-state-locked { color: #edd29b; background: rgba(74, 55, 27, .44); border-color: rgba(225, 190, 112, .38); }
.building-directory-card-locked { border-style: dashed; border-color: rgba(225, 190, 112, .35); }
.building-locked-note { color: #aaa28f; font-size: 12px; }
.sigil-treasury { color: #f2d17b; }

@media (max-width: 620px) {
    .castle-map .map-building-forge { top: 22%; left: 2%; width: 30%; }
    .castle-map .map-building-treasury { top: 22%; right: 2%; width: 27%; }
    .castle-map .map-treasury-sigil { min-height: 53px; font-size: 39px; }
    .castle-map .map-lock-mark { top: 15%; transform: translateX(-50%) scale(.85); }
}

@media (max-width: 370px) {
    .castle-map .map-building-forge { left: 0; width: 33%; }
    .castle-map .map-building-treasury { right: 0; width: 30%; }
    .castle-map .map-building-label small { max-width: 108px; white-space: normal; }
}

/* Small-screen layout and touch targets */
@media (max-width: 820px) {
    .game-frame { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .player-rail { position: static; top: auto; }
    .game-content,.game-content > * { min-width: 0; max-width: 100%; }
    .report-participant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .table-scroll { max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 620px) {
    html,body { overflow-x: clip; }
    .game-topbar-game,.game-topbar-public {
        min-height: 0;
        padding: 9px 12px;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
    }
    .game-topbar .brand { min-width: 0; }
    .game-topbar .brand-logo { width: min(52vw, 178px); max-height: 58px; }
    .utility-nav,.game-topbar-game .utility-nav,.game-topbar-public .utility-nav {
        width: 100%;
        grid-column: 1;
        grid-row: auto;
        justify-self: stretch;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 7px 12px;
    }
    .server-clock { min-width: 0; flex: 1 1 100%; align-items: flex-start; gap: 3px; }
    .server-clock-copy { max-width: 100%; flex-wrap: wrap; gap: 3px 8px; white-space: normal; }
    .server-clock-copy > span { overflow-wrap: anywhere; }
    .language-switch button { min-width: 40px; min-height: 40px; }

    .resource-bar-inner { padding-right: 8px; padding-left: 8px; }
    .resource-combat-stat { justify-content: center; gap: 6px; padding-right: 3px; padding-left: 3px; }
    .resource-combat-stat > .game-icon { width: 27px; height: 27px; }
    .resource-combat-copy .resource-stat-name { display: block; }
    .resource-combat-copy .resource-stat-name { font-size: 10px; }
    .resource-combat-copy > strong { font-size: clamp(17px, 5vw, 22px); }
    .resource-stat { min-width: 0; padding: 6px 4px; grid-template-columns: 19px minmax(0, 1fr); gap: 4px; }
    .resource-stat > .game-icon { width: 18px; height: 18px; }
    .resource-stat-name { display: block; font-size: 9px; letter-spacing: 0; }
    .resource-stat-main { align-items: flex-start; flex-direction: column; gap: 0; }
    .resource-stat-main > strong { font-size: clamp(14px, 4vw, 17px); }
    .resource-stat .turn-next { font-size: 9px; white-space: normal; }

    .game-frame { padding: 10px 10px calc(24px + env(safe-area-inset-bottom)); gap: 10px; }
    .player-rail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 9px; }
    .player-identity { grid-template-columns: 40px minmax(0, 1fr); padding: 4px 2px 10px; }
    .player-name-block { min-width: 0; }
    .player-name-block > strong { overflow-wrap: anywhere; }
    .player-level-progress-copy { font-size: 11px; }
    .player-honours { gap: 7px 12px; }
    .side-navigation { padding: 7px 0; display: block; }
    .side-navigation .nav-group {
        margin: 0;
        padding: 3px 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px 5px;
        border-bottom: 1px solid var(--line-soft);
    }
    .side-navigation .nav-group > summary.nav-section-label {
        grid-column: 1 / -1;
        min-height: 46px;
        margin: 0;
        padding: 9px 10px;
        font-size: 13px;
        letter-spacing: .06em;
    }
    .side-navigation .nav-group > .side-link { min-width: 0; min-height: 46px; margin: 0; padding: 7px 8px; gap: 7px; font-size: 13px; }
    .side-navigation .side-link > span:last-of-type { min-width: 0; overflow-wrap: anywhere; }
    .side-navigation .side-icon { width: 18px; flex: 0 0 18px; }
    .rail-footer { padding-top: 9px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 6px; }
    .rail-footer > .nav-section-label,.rail-record { grid-column: 1 / -1; }
    .rail-footer > .nav-section-label { margin: 0 5px 3px; }
    .rail-record { margin: 0 5px 4px; }
    .rail-footer > .side-link,.rail-logout .side-link { min-height: 46px; margin: 0; padding: 7px 8px; font-size: 13px; }
    .rail-logout { min-width: 0; }

    .public-content { padding: 14px 10px 28px; }
    .hero { min-height: 0; grid-template-columns: minmax(0, 1fr); }
    .hero-copy { padding: 27px 20px; }
    .hero h1,.auth-lore h1 { font-size: clamp(34px, 10vw, 48px); }
    .hero-art { min-height: 320px; border-top: 1px solid rgba(221, 202, 164, .13); border-left: 0; }
    .hero-statistics { inset: 10px; padding: 13px; }
    .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
    .feature { min-height: 0; padding: 15px; }
    .auth-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .auth-lore { padding: 18px 4px; }
    .form-card { padding: 19px 16px; }

    .game-content .page-heading { align-items: stretch; gap: 10px; }
    .page-heading > .button { width: 100%; }
    .page-heading h1 { font-size: clamp(27px, 8vw, 34px); overflow-wrap: anywhere; }
    .page-subtitle { overflow-wrap: anywhere; }
    .section-card,.duel-panel,.building-detail { padding: 15px; }
    .dashboard-grid,.profile-settings-grid,.battle-layout,.action-page-grid,.inbox-layout,.report-participant-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-grid,.profile-settings-grid { gap: 10px; }
    .report-score-grid { grid-template-columns: minmax(0, 1fr); gap: 7px; }
    .report-score-grid .versus { min-height: 25px; }
    .score-card { min-height: 0; padding: 14px; }
    .score-card strong { font-size: 28px; }
    .report-damage-budget { align-items: flex-start; flex-direction: column; padding: 10px 12px; }
    .report-damage-budget strong { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
    .report-paper { min-height: 0; padding: 15px; }
    .paper-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; font-size: 13px; }
    .paper-row strong { text-align: right; overflow-wrap: anywhere; }
    .xp-breakdown > div { gap: 8px; font-size: 12px; }
    .xp-breakdown strong { white-space: normal; text-align: right; }
    .report-heading .button { width: 100%; }

    .duel-sort-form { align-items: stretch; flex-direction: column; }
    .duel-sort-form label,.duel-sort-form select { width: 100%; }
    .duel-opponent { align-items: flex-start; }
    .duel-attack-form { align-items: stretch; flex-direction: column; padding-left: 0; }
    .duel-attack-form .button { width: 100%; }
    .duel-target-action { padding-left: 0; }
    .ranking-head,.ranking-row { grid-template-columns: 30px minmax(0, 1fr) 74px 48px; gap: 4px; padding: 9px 0; }
    .ranking-head { font-size: 10px; letter-spacing: .04em; }
    .ranking-row > span { min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
    .ranking-player { gap: 4px; }
    .ranking-player .shared-player-avatar { width: 22px; height: 25px; }
    .ranking-player strong { font-size: 12px; }

    .form-actions,.treasury-deposit-controls { align-items: stretch; grid-template-columns: minmax(0, 1fr); flex-direction: column; }
    .form-actions .button,.treasury-deposit-controls .button,.action-form .button { width: 100%; min-width: 0; }
    .season-create-cta { align-items: stretch; }
    .season-create-cta .button { width: 100%; }
    .table-scroll table { min-width: 620px; }
    .table-scroll:focus-visible { outline: 2px solid #e2bd78; outline-offset: 3px; }
    .world-footer { padding: 13px 12px calc(16px + env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 5px 12px; }
}

@media (max-width: 370px) {
    .game-topbar-game,.game-topbar-public { padding-right: 9px; padding-left: 9px; }
    .resource-bar-inner { padding-right: 5px; padding-left: 5px; }
    .resource-combat-stat > .game-icon { width: 23px; height: 23px; }
    .resource-combat-copy .resource-stat-name { font-size: 9px; }
    .resource-combat-copy > strong { font-size: 17px; }
    .resource-stat { grid-template-columns: 16px minmax(0, 1fr); gap: 3px; padding-right: 2px; padding-left: 2px; }
    .resource-stat > .game-icon { width: 16px; height: 16px; }
    .resource-stat-main > strong { font-size: 13px; }
    .side-navigation .nav-group { grid-template-columns: minmax(0, 1fr); }
    .side-navigation .nav-group > summary.nav-section-label { grid-column: 1; }
    .dashboard-stat-grid { grid-template-columns: minmax(0, 1fr); }
    .ranking-head,.ranking-row { grid-template-columns: 26px minmax(0, 1fr) 64px 44px; gap: 3px; }
}
