body.login-page {
    background: #64753b url(/build/images/login-landscape.654b0f5e.webp) center / cover no-repeat;
    color: #3b210d;
    font-family: Georgia, "Times New Roman", serif;
}

.login-scene {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(22rem, 34vw, 36rem);
    align-items: center;
    gap: 5vw;
    padding: clamp(1.25rem, 3.5vh, 3rem) 4vw;
}

.login-branding {
    position: relative;
    isolation: isolate;
    align-self: start;
    text-align: center;
    color: #fff2ce;
}
.login-branding::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 12% 2% -12%;
    background: radial-gradient(ellipse, #202816ba 0%, #25331c70 43%, transparent 72%);
}
.login-wordmark {
    width: min(32vw, 34rem);
    height: auto;
    display: block;
    margin: auto;
    filter: drop-shadow(0 2px 3px #24180d);
}
.login-branding p {
    margin: .25em 0 0;
    font-size: clamp(1.35rem, 2.45vw, 2.65rem);
    font-style: italic;
    line-height: 1.2;
    text-shadow: 0 2px 3px #251b09, 0 0 8px #30341c, 0 0 16px #30341c;
}
.login-branding p::after {
    content: "";
    display: block;
    width: 5.5em;
    height: 3px;
    margin: .35em auto 0;
    border-radius: 50%;
    background: linear-gradient(90deg, transparent, #e6a738 25%, #ffe498, #e6a738 75%, transparent);
}

.login-card {
    position: relative;
    isolation: isolate;
    justify-self: center;
    width: min(100%, clamp(21rem, 28vw, 24rem));
    min-width: 0;
    padding: 4.3rem clamp(2.1rem, 2.8vw, 2.75rem) 2.65rem;
    filter: drop-shadow(0 6px 7px #31200daa);
}
/* Keep the form readable while the illustrated frame is loading. */
.login-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 15% 8% 6%;
    background: #f4dfb0;
    border-radius: .4rem;
}
.login-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: url(/build/images/login-parchment.229767cd.webp) center / 100% 100% no-repeat;
    pointer-events: none;
}
.login-card h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
    text-align: center;
    color: #3b210d;
}
.login-divider {
    display: flex;
    gap: .25rem;
    align-items: center;
    margin: .55rem 5% .85rem;
    color: #995a19;
}
.login-divider::before, .login-divider::after {
    content: "";
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, currentColor);
}
.login-divider::after { transform: rotate(180deg); }
.login-divider span {
    width: .65rem;
    height: .65rem;
    border: 2px solid currentColor;
    transform: rotate(45deg);
}
.login-card form, .login-field { display: grid; }
.login-card form { gap: .65rem; }
.login-field { gap: .25rem; }
.login-field label {
    font-size: 1rem;
    font-weight: bold;
}
.login-field input {
    width: 100%;
    min-width: 0;
    min-height: 2.5rem;
    padding: .5em .7em;
    font: 1rem/1.3 system-ui, sans-serif;
}
.login-remember {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: .55rem;
    min-height: 1.75rem;
    font-size: .9rem;
    line-height: 1.35;
    cursor: pointer;
}
.login-remember input {
    appearance: none;
    display: grid;
    place-content: center;
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    border: 1px solid #896631;
    border-radius: 4px;
    background: #fff7de;
    box-shadow: inset 0 1px 2px #79562738;
    cursor: inherit;
}
.login-remember:hover input { border-color: #4f582d; }
.login-remember input:checked {
    border-color: #344b21;
    background: #486333;
    box-shadow: inset 0 0 0 1px #dec18880;
}
.login-remember input:checked::after {
    content: "";
    width: .3rem;
    height: .55rem;
    border: solid #fff6dd;
    border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg);
}
@media (forced-colors: active) {
    .login-remember input { appearance: auto; }
    .login-remember input:checked::after { content: none; }
}
.login-submit {
    width: 100%;
    min-height: 2.75rem;
    padding: .35em .5em;
    border: 2px ridge #d49e43;
    border-radius: 8px;
    color: #fff1cc;
    background: linear-gradient(#536d27, #314b19 50%, #263f14);
    box-shadow: inset 0 0 0 1px #22320d, 0 2px 0 1px #714011, 0 4px 7px #52321150;
    font: bold 1.25rem/1.15 Georgia, serif;
    text-shadow: 0 2px 2px #23330e;
    cursor: pointer;
}
.login-submit:hover { background: linear-gradient(#627f33, #35551d); }
.login-submit:active { transform: translateY(1px); }
.login-card :is(input[type="checkbox"], button):focus-visible { outline: 3px solid #315d47; outline-offset: 2px; }
.login-error {
    margin: 0;
    border-inline-start: 3px solid #953823;
    padding: .4em .65em;
    color: #762b1d;
    background: #ffe7d0;
    font: 600 .95rem/1.4 system-ui, sans-serif;
}

@media (max-width: 48rem) {
    body.login-page { background-position: 32% center; }
    .login-scene {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: clamp(1rem, 4vh, 2rem);
        padding: 1.25rem .75rem max(1.25rem, env(safe-area-inset-bottom));
    }
    .login-branding { align-self: center; }
    .login-wordmark { width: min(54vw, 15rem); }
    .login-card {
        width: min(100%, 21.5rem);
        padding: 4rem min(9vw, 2.15rem) 2.4rem;
    }
}

@media (pointer: coarse) {
    .login-field input, .login-remember { min-height: 2.75rem; }
}

.login-secondary {
    justify-self: center;
    color: #35551d;
    font-weight: 700;
    text-underline-offset: .2em;
}

.login-success {
    margin: 0;
    padding: .5rem .75rem;
    border-radius: .45rem;
    background: #e8efd9;
    color: #2f4d24;
}

.login-legal,
.legal-document nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
    margin-top: .75rem;
}

.login-card :is(.login-legal, .login-remember) a,
.legal-document a {
    color: #35551d;
    text-decoration: underline;
}

.login-submit:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.legal-scene {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    padding-block: 2rem;
}

.legal-document {
    width: min(48rem, 100%);
    padding: clamp(1.25rem, 4vw, 2.5rem);
    border: 1px solid #896631;
    border-radius: .75rem;
    background: #f4dfb0;
    line-height: 1.55;
}

.legal-document::before,
.legal-document::after {
    content: none;
}

.legal-document h2 {
    margin: 1.15rem 0 .35rem;
    font-size: 1.2rem;
}

.legal-document p {
    margin: .35rem 0 .75rem;
}

.legal-dialog {
    box-sizing: border-box;
    width: min(46rem, calc(100% - 2rem));
    max-height: 85dvh;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #896631;
    border-radius: .75rem;
    background: #f4dfb0;
    color: #3b210d;
    cursor: auto;
}

.legal-dialog[open] {
    display: flex;
    flex-direction: column;
}

.legal-dialog::backdrop {
    background: #18170f99;
}

.legal-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #89663155;
}

.legal-dialog-header h2 {
    margin: 0;
    font-size: clamp(1.05rem, 3vw, 1.4rem);
}

.legal-dialog-body {
    min-height: 0;
    padding: 1rem 1.25rem;
    overflow: auto;
    overscroll-behavior: contain;
    line-height: 1.55;
}

.legal-dialog-body h2 {
    margin: 1rem 0 .35rem;
    font-size: 1.15rem;
}

.legal-dialog-body p {
    margin: 0 0 .65rem;
}

.legal-confirmation {
    cursor: auto;
}

.legal-dialog-trigger {
    display: inline;
}

.registration-card {
    padding-top: 5.25rem;
    padding-bottom: 2.85rem;
}

.registration-card::before {
    inset: 3.75rem 7% 1.65rem;
}

.registration-card::after {
    background: none;
    border-image: url(/build/images/login-parchment.229767cd.webp)
        16% 9% 9% fill / 4.75rem 1.65rem 2rem stretch;
}

/* Global styling for the village and account screens. */
:root {
    color-scheme: light;
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
    color: #23322c;
    background: #cfe58c;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --ink: #23322c;
    --muted: #718078;
    --line: #e1e7de;
    --forest: #275b44;
    --forest-dark: #1c4634;
    --paper: #fff;
}

* { box-sizing: border-box; }

:where(input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea) {
    min-width: 0;
    max-width: 100%;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid #a68b53;
    border-radius: 5px;
    background: #fff3d4;
    box-shadow: inset 0 1px 2px #8e6e372d;
    color: #3c301c;
    font: inherit;
}
:where(input[type="number"]) { font-variant-numeric: tabular-nums; }
:is(input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea):focus {
    border-color: #42613a;
    outline: 1px solid #42613a;
    outline-offset: 0;
}
:where(input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea):disabled {
    background-color: #e9e2cf;
    color: #676353;
    opacity: 1;
    cursor: not-allowed;
}

@media (forced-colors: none) {
    :where(select:not([multiple]):not([size]), select[size="1"]:not([multiple])) {
        appearance: none;
        padding-inline-end: 2.5rem;
        background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27%3E%3Cpath d=%27m4 6 4 4 4-4%27 fill=%27none%27 stroke=%27%233c301c%27 stroke-width=%271.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.8rem center;
        background-size: 1rem;
    }
}


body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: #cfe58c url(/build/images/game-landscape.19d615e9.webp) center / cover fixed no-repeat;
}

a { color: inherit; }

.account-bar {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 max(24px, calc((100vw - 1180px) / 2));
    background: #203b31;
    color: #fff;
}

.account-bar .account-menu { position: relative; margin-left: auto; }
.account-name { color: #d3e2d7; font-size: .9rem; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; color: inherit; text-decoration: none; }
.brand-wordmark { display: block; width: auto; height: 54px; }

.account-menu > summary, .account-help-link {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: #f1e7ce;
    cursor: pointer;
}
.account-help-link { font: 700 1.15rem/1 Georgia, serif; text-decoration: none; }
.account-menu > summary { list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary::marker { content: ""; }
.account-menu > summary:hover, .account-menu[open] > summary, .account-help-link:is(:hover, [aria-current]) {
    color: #fff9e5;
    background: #ffffff1a;
}
.account-menu-trigger:focus-visible { outline: 3px solid #e8ad4c; outline-offset: 3px; }
.account-menu-icon { display: block; width: 24px; height: 24px; }
.account-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 20;
    width: min(230px, calc(100vw - 32px));
    display: grid;
    gap: 4px;
    padding: 12px;
    color: #203b28;
}
.account-menu-panel .account-name {
    padding: 4px 8px 10px;
    border-bottom: 1px solid #b38b5380;
    color: inherit;
    font: 700 1.05rem/1.3 Georgia, serif;
    overflow-wrap: anywhere;
}
.account-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: 6px;
    padding: 8px;
    color: inherit;
    font-size: .9rem;
    font-weight: 650;
    text-decoration: none;
}
.account-menu-link::after {
    width: 6px;
    height: 6px;
    border: solid #987640;
    border-width: 1.5px 1.5px 0 0;
    transform: rotate(45deg);
    content: "";
}
.account-menu-link:is(:hover, [aria-current]) { background: #88995124; }
.account-menu-panel form { margin: 3px 0 0; padding-top: 8px; border-top: 1px solid #b38b5380; }
.account-menu-panel .button { width: 100%; }

.game-shell { width: min(1180px, calc(100% - 40px)); margin: 34px auto 80px; }
.game-shell.village-shell { margin-top: 16px; }
.village-heading, .section-heading, .card-title-row { display: flex; align-items: center; }
.village-heading { justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.village-heading h1, .section-heading h2, .welcome-panel h1 { margin: 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.village-heading h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.village-meta { margin: 8px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: #718279; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 14px;
    font: inherit;
    font-size: .86rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease, border-color .15s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #e8ad4c; outline-offset: 3px; }
.button-primary { background: var(--forest); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--forest-dark); }
.button-secondary { border-color: #b7d0bc; background: #edf5ed; color: var(--forest-dark); }
.button-secondary:hover:not(:disabled) { background: #e1eee2; }
.button-danger { border-color: #e0aaa1; background: #fff0ed; color: #8a3026; }
.button-danger:hover:not(:disabled) { background: #fce3de; }
.button-quiet { border-color: #ffffff3b; background: #ffffff12; color: inherit; }
.button-quiet:hover:not(:disabled) { background: #ffffff22; }
.button:disabled { cursor: not-allowed; opacity: .48; }

.resource-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.resource-card { min-width: 0; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: var(--paper); box-shadow: 0 3px 12px #203b3108; }
.resource-symbol { width: 30px; height: 30px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #eff3ee; }
.resource-symbol img { width: 24px; height: 24px; display: block; object-fit: contain; }
.resource-clay .resource-symbol { background: #f5eee7; color: #a76e3f; }
.resource-iron .resource-symbol { background: #edf0f3; color: #596a78; }
.resource-crop .resource-symbol { background: #f5f2e7; color: #a98735; }
.resource-details { min-width: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 8px; }
.resource-details h2 { grid-column: 1; grid-row: 1; margin: 0; color: #64746b; font-size: .68rem; font-weight: 700; }
.resource-details strong { grid-column: 2; grid-row: 1 / 3; display: block; font-size: .9rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.resource-details .resource-capacity { color: #8a968e; font-size: .74rem; font-weight: 500; }
.resource-details small { grid-column: 1; grid-row: 2; display: grid; gap: 1px; margin-top: 2px; color: var(--muted); font-size: .63rem; white-space: nowrap; }
.resource-details .resource-consumption { display: block; }

.section-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; padding: 0; }
.section-nav a { border-radius: 6px; padding: 6px 9px; color: #53675c; font-size: .77rem; font-weight: 700; text-decoration: none; }
.section-nav a:hover { background: #e4ebe2; color: var(--forest-dark); }
.section-nav-switch { display: inline-flex; gap: 2px; border: 1px solid #dfe5dc; border-radius: 9px; padding: 3px; background: #f7f9f4; }
.section-nav .section-nav-switch a[aria-current="page"] { background: var(--forest); color: #fff; }
.section-nav .section-nav-switch a[aria-current="page"]:hover { background: var(--forest-dark); color: #fff; }
.section-nav > a { color: #718078; font-size: .73rem; font-weight: 600; }
.panel { margin: 0 0 20px; border: 1px solid var(--line); border-radius: 15px; padding: 24px; background: var(--paper); box-shadow: 0 5px 22px #203b3108; scroll-margin-top: 20px; }
.section-heading { justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
.future-building-section { margin-top: 24px; border-top: 1px solid #e3e9e2; padding-top: 20px; }
.future-building-section .section-heading { margin-bottom: 8px; }
.future-building-section .section-count { margin-inline-start: auto; }
.future-building-section .section-heading h3 { margin: 0; color: #293a31; font-size: clamp(1.15rem, 2.4vw, 1.4rem); }
.future-building-card .building-illustration img { filter: grayscale(1) opacity(.72); }
.future-building-card .card-title-row h4 { margin: 0; color: #293a31; line-height: 1.3; }
.future-building-card .card-title-row p { margin: 4px 0 0; color: #8a6c45; font-size: .77rem; font-weight: 700; }
.section-count { border-radius: 100px; padding: 6px 10px; background: #f0f4ef; color: #62766a; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.section-intro { max-width: 650px; margin: -4px 0 18px; color: var(--muted); font-size: .9rem; line-height: 1.55; }

.village-board-wrap { padding: 5px 0 10px; }
.village-board {
    position: relative;
    container-type: inline-size;
    width: min(100%, 1000px);
    aspect-ratio: 3 / 2;
    margin: 0 auto;
}
.village-board-art, .village-wall-scenery { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.village-board-art, .village-wall-scenery { filter: url(/build/images/village-terrain-edge.613a8877.svg#feather); }
.village-square-decor { position: absolute; z-index: 2; top: 44%; left: 50%; width: 24%; height: auto; transform: translate(-50%, -50%); pointer-events: none; }
.village-scenery-decor { position: absolute; z-index: 2; width: 13%; height: auto; transform: translate(-50%, -50%); pointer-events: none; }
.village-pond-decor { left: 16%; top: 50%; width: 20%; }
.village-grove-decor { left: 85%; top: 50%; width: 19%; }
.village-palisade-art { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; pointer-events: none; }
.village-palisade-art-back { clip-path: inset(0 0 50%); }
.village-wall-scenery {
    z-index: 2;
    mask: url(/build/images/village-wall-scenery-mask.9ff21bed.svg) center / 100% 100% no-repeat;
}
.village-palisade-art-front { z-index: 7; clip-path: inset(50% 0 0); }
.village-palisade { position: absolute; inset: 0; z-index: 4; display: block; cursor: pointer; pointer-events: none; }
/* Keep both wall layers and the hit path aligned as the wall moves outward. */
.village-palisade-art, .village-palisade {
    scale: 1.10;
    transform-origin: 50% 73%;
}
.village-palisade-hit-area { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.village-palisade-hit-path { fill: transparent; fill-rule: evenodd; pointer-events: fill; transition: fill .15s ease; }
.village-palisade:focus-visible .village-palisade-hit-path { fill: rgb(255 255 255 / 15%); }
.village-slot {
    position: absolute;
    z-index: 5;
    top: var(--site-y);
    left: var(--site-x);
    width: 10.5%;
    height: 9.6%;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: transparent;
    color: #33463b;
    text-decoration: none;
    transform: translate(-50%, -50%);
    transition: filter .15s ease;
}
.village-slot:focus-visible { filter: brightness(1.08); }
.village-slot-special { z-index: 6; width: 16%; height: 13.2%; }
.slot-mark {
    position: absolute;
    z-index: 1;
    width: clamp(35px, 10cqw, 72px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    translate: 0 -1.1cqw;
    border-radius: 50%;
    pointer-events: none;
}
.slot-mark img { width: 100%; height: 100%; display: block; object-fit: contain; transform: scale(2.5); }
.village-slot:not([data-building="main_building"]):not([data-building="rally_point"]) .slot-mark:not(.slot-mark-anchored) img { transform: scale(1.8); }
.slot-mark.slot-mark-anchored {
    top: 50%;
    left: 50%;
    width: var(--sprite-width);
    height: auto;
    translate: calc(-1 * var(--base-x)) calc(-1 * var(--base-y));
}
.village-slot .slot-mark.slot-mark-anchored img { transform: none; }
.village-slot:not(.village-slot-under-construction) .slot-mark-anchored img {
    filter: url(/build/images/building-ground-edge.647de8d4.svg#soften-ground-edge);
}
.village-slot[data-building="main_building"]:not(.village-slot-under-construction) .slot-mark-anchored img {
    filter: url(/build/images/building-ground-edge.647de8d4.svg#soften-ground-edge) url(/build/images/main-building-green-filter.9ecbb9f7.svg#mute-green);
}
.slot-level {
    position: absolute;
    left: 76%;
    top: 70%;
    translate: -50% -50%;
    pointer-events: none;
    z-index: 2;
    min-width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border: 1px solid #65553c;
    border-radius: 50%;
    padding: 0 3px;
    background: #fff4d6;
    color: #4a4333;
    font-size: .57rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 1px 3px #203b3138;
}
.village-slot-empty .slot-mark {
    opacity: .65;
    transition: opacity .15s ease, scale .15s ease;
    width: clamp(10px, 2.9cqw, 21px);
    border: 1px solid #86815b;
    border-radius: 50%;
    background: #fff4d6;
    color: #61744a;
    font-size: 1rem;
    line-height: 1;
}

.village-slot-empty:hover .slot-mark, .village-slot-empty:focus-visible .slot-mark { opacity: 1; scale: 1.1; }

.management-grid, .unit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.unit-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; }
.village-army-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.management-card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; }
.building-feature-card { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr); align-items: center; gap: clamp(18px, 3vw, 34px); padding: clamp(18px, 3vw, 30px); }
.building-illustration { width: 100%; max-width: 360px; aspect-ratio: 1; display: grid; place-items: center; margin: 0 auto; border-radius: 14px; background: radial-gradient(ellipse at center, #f0f4e8 0%, #fff 72%); }
.unit-row .unit-illustration { max-width: 224px; }
.building-illustration img { width: 100%; height: 100%; display: block; object-fit: contain; }
.building-card-content { min-width: 0; }
.building-feature-heading { align-items: center; margin-bottom: 12px; }
.building-feature-heading h3, .building-feature-heading h4 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
.building-feature-card .card-description { min-height: 0; margin: 12px 0 16px; font-size: .9rem; }
.hero-artwork { display: flex; align-items: center; justify-content: center; gap: 16px; width: min(100%, 320px); min-height: 220px; margin: 16px auto; padding: 12px; border-radius: 14px; background: radial-gradient(ellipse at center, #f0f4e8 0%, #fff 72%); }
.hero-artwork-portrait { width: auto; max-width: calc(100% - 80px); height: 210px; display: block; object-fit: contain; }
.building-feature-card .compact-facts { gap: 12px; margin: 0; }
.building-feature-card .compact-facts > div { grid-template-columns: minmax(100px, .6fr) minmax(0, 1.4fr); font-size: .82rem; }
.field-card { border-top: 3px solid #9a7757; }
.field-wood { border-top-color: #6f9c68; }
.field-clay { border-top-color: #c2824e; }
.field-iron { border-top-color: #718494; }
.field-crop { border-top-color: #b89a45; }
.field-detail-page { margin-bottom: 20px; border: 0; }
.field-detail-page .section-heading { align-items: flex-start; }
.field-detail-feature { padding: 0; }
.field-board-wrap { padding: 5px 0 10px; }
#resource-fields,
#village-center {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}
.field-board {
    position: relative;
    width: min(100%, 840px);
    aspect-ratio: 21 / 19;
    margin: 0 auto;
}
.field-board-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    object-fit: cover;
}
.resource-field-tile {
    position: absolute;
    z-index: 2;
    top: var(--field-y);
    left: var(--field-x);
    width: clamp(72px, 17%, 144px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    color: #33463b;
    text-decoration: none;
    transform: translate(-50%, -50%);
    transition: filter .15s ease;
}
.resource-field-tile:focus-visible { filter: brightness(1.08); }
.resource-field-tile-selected { filter: drop-shadow(0 2px 3px #203b3170) brightness(1.08); }
.resource-field-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
.resource-field-level {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid #d5dccf;
    border-radius: 999px;
    padding: 0 4px;
    background: #fff;
    color: #1b241f;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 1px 3px #14271e66;
    transform: translate(-50%, -50%);
}
.field-board-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    max-width: 70%;
    margin: 0;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff8e7e8;
    color: #536247;
    text-align: center;
    transform: translate(-50%, -50%);
}
.resource-field-level.field-level-upgrading {
    width: max-content;
    padding-inline: 6px;
    border-color: #8a652a;
    background: #ffe4a4;
    color: #4d3616;
    font-weight: 700;
}
.field-detail-page .field-output {
    margin-block: 12px;
    border-block: 1px solid #b38b5355;
    padding-block: 10px;
}
.field-output dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; }
.field-output strong { color: #35592f; }
.field-board-village {
    position: absolute;
    top: 45.5729%;
    left: 50%;
    z-index: 3;
    width: clamp(80px, 30%, 250px);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 0;
    padding: 0;
    background: transparent;
    color: #354e32;
    text-align: center;
    text-decoration: none;
    transform: translate(-50%, -50%);
    transition: filter .15s ease;
}
.field-board-village img { width: 100%; height: auto; display: block; filter: drop-shadow(0 3px 3px #203b3138); }
.field-board-village strong {
    margin-top: -1px;
    border: 1px solid #d3c28f;
    border-radius: 999px;
    padding: 2px 8px;
    background: #fff5d9e8;
    font-size: clamp(.62rem, 1.2vw, .8rem);
    line-height: 1.2;
}
.field-board-village:focus-visible {
    filter: brightness(1.06);
}
.field-detail { margin: 0 0 18px; }
.field-detail .eyebrow { margin-bottom: 4px; }
.card-title-row { align-items: flex-start; gap: 10px; }
.card-title-row h3 { margin: 0; color: #293a31; font-size: .95rem; line-height: 1.3; }
.card-title-row p { margin: 4px 0 0; color: var(--muted); font-size: .77rem; line-height: 1.45; }
.field-number, .unit-symbol { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 10px; background: #f1f2eb; color: #6b745d; font-size: .78rem; font-weight: 800; }
.unit-symbol { background: #eaf1ea; color: var(--forest); font-size: 1rem; }
.unit-symbol { background: #f3ece7; color: #8f5b39; }
.unit-symbol-image { display: block; object-fit: contain; background: transparent; }
.unit-illustration .unit-fallback-symbol { width: 76px; height: 76px; border-radius: 20px; font-size: 2rem; }
.unit-list-label { display: inline-flex; align-items: center; gap: 5px; }
.unit-list-icon { width: 16px; height: 16px; display: block; flex: 0 0 auto; object-fit: contain; }
.unit-character { height: 180px; display: grid; place-items: center; margin: 12px 0; overflow: hidden; border-radius: 12px; background: radial-gradient(ellipse at center, #f0f4e8 0%, #fff 72%); }
.unit-character img { width: auto; max-width: 100%; height: 100%; display: block; object-fit: contain; }
.card-description { min-height: 38px; margin: 13px 0; color: #69786f; font-size: .8rem; line-height: 1.5; }
.compact-facts { display: grid; gap: 9px; margin: 14px 0; }
.compact-facts > div { display: grid; grid-template-columns: minmax(70px, .7fr) 1.3fr; gap: 8px; align-items: start; font-size: .75rem; line-height: 1.45; }
.compact-facts dt { color: #829087; }
.compact-facts dd { margin: 0; color: #37473e; font-weight: 600; }
.resource-cost-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; vertical-align: middle; }
.resource-cost-item img { width: 18px; height: 18px; display: block; object-fit: contain; }
.building-cost-list { display: flex; flex-wrap: wrap; gap: 8px; }
.building-cost-item { display: flex; align-items: center; gap: 7px; min-width: 82px; border: 1px solid #e3e9e2; border-radius: 9px; padding: 6px 8px; background: #f8faf6; }
.building-cost-item img { width: 24px; height: 24px; display: block; flex: 0 0 auto; object-fit: contain; }
.building-cost-values { display: grid; gap: 1px; }
.building-cost-values strong { color: #37473e; font-size: .8rem; }
.building-cost-item.has-shortage { border-color: #e4b7a7; background: #fff6f2; }
.building-cost-shortage { color: #a34231; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.management-card form:not(.training-form) { margin-top: 14px; }
.management-card form .button { width: 100%; }
.muted-message { margin: 15px 0 0; color: var(--muted); font-size: .8rem; }
.cost-line { margin: 0 0 12px; color: #69786f; font-size: .76rem; line-height: 1.5; }
.training-form { margin-top: 13px; border-top: 1px solid #edf0eb; padding-top: 12px; }
.training-form label { display: block; margin-bottom: 6px; color: #65756b; font-size: .75rem; font-weight: 700; }
.training-controls { display: flex; gap: 7px; }
.training-controls input { width: 76px; min-height: 42px; }
.training-controls .button { flex: 1; }
.blocked-message { margin: 10px 0 0; color: #a4613d; font-size: .75rem; line-height: 1.45; }

.empty-state { margin: 0; border-radius: 10px; padding: 17px; background: #f5f7f3; color: #6b7b71; font-size: .9rem; }
.queue-list { display: grid; gap: 9px; }
.queue-item { display: grid; grid-template-columns: minmax(95px, .65fr) minmax(130px, 1fr) minmax(170px, 1.2fr); gap: 13px; align-items: center; border: 1px solid #e7ece5; border-radius: 9px; padding: 12px 14px; font-size: .82rem; }
.queue-item strong { color: #314238; }
.queue-item > span:last-child { color: var(--muted); text-align: right; }
.queue-type { color: #74857a; font-size: .76rem; }
.countdown { color: #314238; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

.notice { border: 1px solid; border-radius: 9px; margin: 0 0 12px; padding: 12px 15px; font-size: .88rem; line-height: 1.5; }
.notice:is(.notice-success, .notice-warning) {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border-color: var(--notice-border);
    margin-block-start: 6px;
    border-radius: 6px;
    padding: 8px 11px;
    background: linear-gradient(180deg, var(--notice-top), var(--notice-bottom));
    box-shadow: inset 0 0 0 1px #fff7e350;
    color: var(--notice-ink);
}
.notice-success {
    --notice-accent: #4d6949;
    --notice-border: #9ca780;
    --notice-top: #eef0d8;
    --notice-bottom: #dce3c3;
    --notice-ink: #35442e;
}
.notice-warning {
    --notice-accent: #935027;
    --notice-border: #c49b73;
    --notice-top: #f8ead5;
    --notice-bottom: #f1d8b8;
    --notice-ink: #583a28;
}
.notice-icon {
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--notice-accent);
    color: #fff6de;
    font: 700 .77rem/1 system-ui, sans-serif;
}
.welcome-panel { max-width: 620px; margin: 13vh auto; border: 1px solid var(--line); border-radius: 16px; padding: clamp(26px, 6vw, 48px); background: white; box-shadow: 0 10px 38px #203b3110; }
.welcome-panel h1 { font-size: clamp(2rem, 7vw, 2.8rem); }
.welcome-panel > p:not(.eyebrow) { margin: 12px 0 23px; color: var(--muted); line-height: 1.6; }
.settings-panel { max-width: 720px; }
.settings-panel > p, .delete-confirmation > p { margin: 0 0 20px; color: var(--muted); line-height: 1.6; }
.settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.settings-actions form { margin: 0; }

@media (max-width: 900px) {
    .management-grid, .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .resource-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .queue-item { grid-template-columns: minmax(90px, .7fr) 1fr; }
    .queue-item > span:last-child { grid-column: 2; text-align: left; }
}

@media (max-width: 700px) {
    .building-feature-card { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .building-illustration { max-width: 280px; }
    .unit-row .unit-illustration { max-width: 176px; }
}

@media (max-width: 560px) {
    .account-bar { min-height: 58px; gap: 12px; padding: 0 16px; }
    .account-menu > summary, .account-help-link { width: 38px; height: 38px; }
    .account-menu-panel .button { min-height: 36px; padding: 7px 10px; font-size: .75rem; }
    .game-shell { width: calc(100% - 24px); margin-top: 23px; }
    .game-shell.village-shell { margin-top: 12px; }
    .village-heading { align-items: flex-start; flex-direction: column; }
    .village-heading > .button { align-self: flex-end; }
    .resource-strip { gap: 6px; }
    .resource-card { gap: 7px; padding: 8px; }
    .resource-symbol { width: 26px; height: 26px; border-radius: 8px; }
    .resource-symbol img { width: 21px; height: 21px; }
    .resource-details { grid-template-columns: minmax(0, 1fr); }
    .resource-details h2 { grid-column: 1; grid-row: 1; font-size: .62rem; }
    .resource-details strong { grid-column: 1; grid-row: 2; font-size: .76rem; text-align: left; }
    .resource-details .resource-capacity { font-size: .64rem; }
    .resource-details small { grid-column: 1; grid-row: 3; margin-top: 1px; font-size: .57rem; }
    .section-nav { gap: 3px; margin-bottom: 14px; }
    .section-nav a { padding: 6px 8px; font-size: .72rem; }
    .section-nav > a { font-size: .68rem; }
    .panel { padding: 17px 14px; }
    .field-detail-page .section-heading { align-items: stretch; flex-direction: column; }
    .field-detail-page .section-heading .button { align-self: flex-start; }
    .village-board { width: 100%; }
    .slot-level { min-width: 15px; height: 15px; font-size: .56rem; }
    .field-board { border-radius: 17px; }
    .slot-mark { width: 28px; height: 28px; }
    .village-slot-empty .slot-mark { width: clamp(10px, 3.48cqw, 13px); height: auto; }
    .resource-field-tile { width: clamp(44px, 16%, 88px); }
    .resource-field-level { min-width: 20px; height: 20px; font-size: .65rem; }
    .management-grid, .unit-grid { grid-template-columns: minmax(0, 1fr); }
    .queue-item { grid-template-columns: 1fr; gap: 4px; }
    .queue-item > span:last-child { grid-column: auto; }
}

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

/* Game interface: shared parchment surfaces and live resource indicators. */
body.resource-landscape { background: #b6cf72; }
body.resource-landscape > main {
    background: #b6cf72 url(/build/images/resource-landscape-extended.912bd2ae.webp) center top / cover scroll no-repeat;
}
.account-bar { background: #142e21; border-bottom: 2px solid #866b3b; }
.game-shell.village-shell { width: min(1600px, calc(100% - 40px)); }
.resource-strip { gap: 8px; }
.resource-card { background: #183628; border-color: #465d3e; color: #fff9df; box-shadow: 0 3px 12px #10261b35; }
.resource-symbol, .resource-clay .resource-symbol, .resource-iron .resource-symbol, .resource-crop .resource-symbol { background: transparent; }
.resource-details { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
.resource-details h2 { grid-column: 1; grid-row: 1; color: #f4e6bf; }
.resource-details strong { grid-column: 2; grid-row: 1; color: #fff8e3; }
.resource-details .resource-capacity { color: #c8d2bb; }
.resource-progress { grid-column: 1 / -1; grid-row: auto; width: 100%; height: 7px; border: 0; border-radius: 8px; overflow: hidden; appearance: none; background: #435545; }
.resource-progress::-webkit-progress-bar { background: #435545; border-radius: 8px; }
.resource-progress::-webkit-progress-value { background: #78a53f; border-radius: 8px; }
.resource-progress::-moz-progress-bar { background: #78a53f; border-radius: 8px; }
.resource-progress[data-status="low"]::-webkit-progress-value { background: #df5145; }
.resource-progress[data-status="low"]::-moz-progress-bar { background: #df5145; }
.resource-progress[data-status="high"]::-webkit-progress-value { background: #e99a31; }
.resource-progress[data-status="high"]::-moz-progress-bar { background: #e99a31; }
.resource-details small { grid-column: 1 / -1; grid-row: auto; display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 0; color: #c4d5aa; }
.section-nav { margin-bottom: 10px; }
.section-nav-switch { background: #efe2c1; border-color: #a89162; box-shadow: 0 2px 8px #382c1630; }
.section-nav a { color: #304630; font-size: .85rem; }
.panel, .detail-card {
    background: #f5e8c9;
    border: 1px solid #aa9061;
    border-radius: 12px;
    box-shadow: inset 0 0 0 3px #fff4d6, 0 4px 12px #41361f40;
}
.panel { color: #263b2b; }
.section-heading h2, .village-summary h2 { color: #203b28; font-family: Georgia, serif; }
.management-card { background: #fbf3e1; border-color: #dbc9a6; }
.empty-state { background: #eee3c8; color: #65715b; }
.section-count { background: #e8dec2; color: #506548; }
.queue-item { border-color: #d9c8a3; background: #faf1dc; }
.section-nav .section-nav-switch a[aria-current="page"] { background: #315d3e; }
.village-panel, #resource-fields { background: transparent; border: 0; box-shadow: none; padding: 0; }
.village-summary h2 { margin: 0 0 10px; font-size: 1.4rem; }
.detail-card { display: flex; flex-direction: column; margin-bottom: 24px; padding: clamp(18px, 2vw, 28px); }
.hero-summary { display: flex; align-items: center; gap: 14px; min-height: 115px; }
.hero-summary img { width: 76px; height: 76px; object-fit: contain; border-radius: 9px; }
.hero-summary h2 { margin: 0; color: #203b28; font: bold 1.4rem Georgia, serif; }
.detail-card > .panel { border: 0; border-radius: 0; padding: 0; box-shadow: none; background: transparent; margin: 0; }
.detail-card > .panel + .panel { border-top: 1px solid #cbb68e; padding-top: 22px; margin-top: 22px; }
.detail-card .management-card, .field-detail-page .building-feature-card { background: transparent; }
.detail-card .building-illustration, .field-detail-page .building-illustration, .detail-card .unit-character { background: transparent; }
.detail-card .building-feature-card { border: 0; padding: 12px 0; }
.detail-card .unit-row + .unit-row { border-top: 1px solid #d4c19d; }
.field-detail-page { border: 1px solid #aa9061; }
.button-secondary { background: #f8efd8; border-color: #c6b184; color: #2e4830; }
@media (min-width: 1150px) {
    .game-overview { display: grid; grid-template-columns: minmax(175px, 220px) minmax(0, 1fr) minmax(205px, 240px); gap: 14px; align-items: start; }
    .game-overview > .overview-left { grid-column: 1; grid-row: 2; }
    .game-overview > .village-panel, .game-overview > #resource-fields, .game-overview > .detail-card { grid-column: 2; grid-row: 2; }
    .game-overview > .overview-right { grid-column: 3; grid-row: 2; }
    .overview-side { display: grid; gap: 14px; }
    .overview-side > .panel { margin: 0; }
    .game-overview > .panel { margin-bottom: 0; }
    .game-overview .village-army-grid { grid-template-columns: 1fr; }
    .game-overview .queue-item { grid-template-columns: 1fr; gap: 4px; }
    .game-overview .queue-item > span:last-child { text-align: left; }
    .game-overview .village-board { width: 100%; }
}
@media (max-width: 1149px) {
    .game-overview { display: flex; flex-direction: column; }
    .game-overview > [data-controller="resource-stock"], .game-overview > .section-nav,
    .game-overview > .village-panel, .game-overview > #resource-fields, .game-overview .overview-side > .panel { width: 100%; }
    .game-overview > [data-controller="resource-stock"] { order: 1; }
    .game-overview > .section-nav { order: 2; }
    .game-overview > .village-panel, .game-overview > #resource-fields, .game-overview > .detail-card { order: 3; }
    .game-overview > .overview-side { display: contents; }
    .game-overview #village-army { order: 4; }
    .game-overview #queues { order: 5; }
    .village-summary, .hero-summary { display: none; }
}
@media (max-width: 560px) {
    .game-shell.village-shell { width: calc(100% - 24px); }
    .detail-card { padding: 16px; }
    .field-detail-page .section-heading { flex-direction: row; }
    .field-detail-page .section-heading .button { align-self: flex-start; }
}

/* Compact building details keep the complete training workflow together. */
.detail-card { width: min(100%, 1320px); margin-inline: auto; }
.detail-card .section-heading { margin-bottom: 10px; }
.detail-card .unit-list { gap: 0; }
.detail-card .unit-row .compact-facts { gap: 5px; }
.detail-card .unit-row .training-form { margin-top: 8px; padding-top: 8px; }
.detail-card .unit-row .blocked-message { margin-top: 5px; }
.detail-card .unit-row .building-feature-heading { margin-bottom: 6px; }
@media (min-width: 701px) {
    .detail-card :is(#buildings, #field-detail-page) .building-feature-card { grid-template-columns: minmax(150px, 240px) minmax(0, 1fr); gap: 24px; }
    .detail-card :is(#buildings, #field-detail-page) .building-illustration { max-width: 220px; }
    .detail-card #army .unit-row { grid-template-columns: minmax(105px, 150px) minmax(0, 1fr); gap: 22px; padding: 12px 0; }
    .detail-card #army .unit-illustration { width: 100%; max-width: 140px; height: 180px; aspect-ratio: auto; }
    .detail-card .building-card-content .button-primary { max-width: 360px; }
    .detail-card .training-controls { max-width: 440px; }
}

/* One shared navigation and resource header on all game screens. */
.account-bar { display: flex; gap: 16px; padding: 8px max(20px, calc((100vw - 1600px) / 2)); }
.account-bar .section-nav { flex: 0 0 auto; margin: 0; }
.account-bar .section-nav-switch { background: transparent; border: 0; box-shadow: none; }
.account-bar .section-nav a { color: #f1e7ce; padding: 9px 12px; }
.account-bar .section-nav a:hover { color: #fff; background: #ffffff1a; }
.account-bar .section-nav .section-nav-switch a[aria-current="page"] { background: linear-gradient(#577b38, #34592e); color: #fff9e5; box-shadow: inset 0 0 0 1px #bdab6380, inset 0 2px #d2d6a229, 0 1px 3px #0c1c14; }
.account-bar > [data-controller="resource-stock"] { flex: 1 1 0; min-width: 0; }
.account-bar .resource-strip { margin: 0; gap: 4px; }
.account-bar .resource-card { padding: 4px 8px; border-color: transparent; background: transparent; box-shadow: none; }
.account-bar .account-menu { flex: 0 0 auto; margin-left: 0; }
.account-bar .resource-symbol { width: 28px; height: 28px; }
.resource-quantity {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1px 6px;
}
.account-bar .resource-details h2 { font-size: .68rem; }
.account-bar .resource-details strong { font-size: .78rem; }
.account-bar .resource-details .resource-capacity { font-size: .7rem; }
.account-bar .resource-details small { font-size: .63rem; }
.account-bar .notice { position: absolute; top: 100%; right: 20px; z-index: 30; color: #304630; background: #f8efd8; }
.account-bar { position: relative; z-index: 10; }
@media (max-width: 1150px) {
    .account-bar { flex-wrap: wrap; }
    .account-bar > [data-controller="resource-stock"] { flex: 1 0 100%; order: 3; }
    .account-bar .account-menu { margin-left: auto; }
    .account-bar .resource-card { border: 1px solid #465d3e; background: #183628; }
}
@media (max-width: 560px) {
    .account-bar { gap: 8px; padding: 8px 12px; }
    .account-bar .section-nav a { font-size: .75rem; padding: 8px; }
    .account-bar .resource-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .account-bar .resource-card { padding: 7px; }
}

/* Illustrated village setting and restrained Celtic interface details. */
body:is(.village-landscape, .resource-landscape) {
    display: flex;
    flex-direction: column;
}
body:is(.village-landscape, .resource-landscape) > main {
    flex: 1;
    display: flow-root;
}
body.village-landscape {
    background: #a8c65e;
}
body.village-landscape > main {
    background: #a8c65e url(/build/images/village-landscape.a06b2d94.webp) center top / cover scroll no-repeat;
}
.account-bar {
    min-height: 72px;
    background: linear-gradient(180deg, #172e20 0%, #10261b 100%);
    border-bottom: 2px solid #a07c3b;
    box-shadow: 0 3px 10px #20351f55;
}
.account-bar .section-nav-switch { gap: 4px; }
.account-bar .section-nav a { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; }
.nav-icon, .side-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon { color: #dfbd79; }
.account-bar .resource-card + .resource-card { border-left: 1px solid #d2bf8530; border-radius: 0; }
.account-bar .resource-symbol { width: 32px; height: 32px; }
.account-bar .resource-symbol img { width: 28px; height: 28px; }
.account-bar .resource-progress { height: 6px; }
.panel:not(.village-panel):not(#resource-fields), .detail-card, .account-menu-panel {
    border: 1px solid #a78854;
    border-radius: 12px;
    background-color: #f6e8c9;
    background-image: linear-gradient(115deg, #fff6dd91, #fff1ce6b 60%, #eac18c45), url(/build/images/parchment-grain.1b27c5a6.webp);
    background-size: auto, 174px 174px;
    box-shadow: inset 0 0 0 3px #fff3d4, inset 0 0 0 4px #cdb489, 0 4px 11px #30260f50;
}
.overview-side > .panel { padding: 17px 18px; }
.side-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-title h2, .village-summary .side-title h2 { margin: 0; font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.15; }
.side-icon { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 2px solid #c29d57; border-radius: 9px; background: linear-gradient(#426c3c, #285135); color: #f4db9b; box-shadow: inset 0 0 0 1px #ede0b755; }
.overview-side .section-heading { align-items: center; margin-bottom: 12px; }
.overview-side .section-heading > div { min-width: 0; }
.overview-side .eyebrow { margin-bottom: 3px; font-size: .55rem; letter-spacing: .08em; }
.overview-side .management-card { padding: 10px 12px; border-color: #d4bd94; background: #fff8e892; }
.overview-side .empty-state { padding: 11px 12px; background: #e8d9b9a3; font-size: .8rem; }
.overview-side .queue-item { padding: 10px; border-color: #ddc9a4; background: #fff8e892; }
.hero-summary { gap: 12px; }
.hero-summary img { width: 76px; height: 76px; padding: 2px; border: 1px solid #bda477; background: #e9ddbd; }
.detail-card .building-cost-item, .field-detail-page .building-cost-item { border-color: #ddc9a5; background: #fff9eaaa; }
.detail-card .building-cost-item.has-shortage, .field-detail-page .building-cost-item.has-shortage { border-color: #bd7663; background: #fff0e5; }
.detail-card .unit-row + .unit-row { border-radius: 0; }
@media (max-width: 1150px) {
    .account-bar .resource-card + .resource-card { border: 1px solid #465d3e; border-radius: 10px; }
}
@media (max-width: 560px) {
    .account-bar { min-height: 58px; }
    .brand-wordmark { height: 44px; }
    .nav-icon { width: 17px; height: 17px; }
    .account-bar .section-nav a { gap: 4px; }
}

/* The training detail is a single card with internal separators. */
.detail-card > .panel:not(.village-panel):not(#resource-fields) {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.detail-card > .panel + .panel:not(.village-panel):not(#resource-fields) { border-top: 1px solid #cbb68e; }

@container building-detail (min-width: 940px) {
    .detail-card .unit-row-content {
        display: grid;
        grid-template-columns: minmax(120px, .6fr) minmax(270px, 1.4fr) minmax(220px, .9fr);
        column-gap: 22px;
        align-items: start;
    }
    .detail-card .unit-row-content > .card-title-row { grid-column: 1; grid-row: 1 / span 3; }
    .detail-card .unit-row-content > .compact-facts { grid-column: 2; grid-row: 1 / span 3; }
    .detail-card .unit-row-content > .cost-line { grid-column: 2; grid-row: 4; margin: 8px 0 0; }
    .detail-card .unit-row-content > form:not(.training-form) { grid-column: 3; grid-row: 1; margin: 0; }
    .detail-card .unit-row-content > .training-form { grid-column: 3; grid-row: 2; margin: 0; padding: 0; border: 0; }
    .detail-card .unit-row-content > .blocked-message { grid-column: 3; grid-row: 3; }
    .detail-card .unit-row-content .compact-facts > div { grid-template-columns: minmax(100px, .8fr) minmax(0, 1.4fr); }
}

.unit-training-cost dd, .unit-research-cost {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 10px;
}

@container building-detail (max-width: 40rem) {
    .detail-card #army .unit-row {
        grid-template-columns: 76px minmax(0, 1fr);
        align-items: start;
        gap: 10px 14px;
        margin-block: 10px;
        padding: 12px;
        border: 1px solid #d4c19d;
        border-radius: 9px;
        background: #fff8e861;
    }
    .detail-card #army .unit-illustration {
        grid-column: 1;
        grid-row: 1;
        height: 96px;
        aspect-ratio: auto;
        grid-template-rows: minmax(0, 1fr);
    }
    .detail-card #army .unit-illustration img { min-height: 0; }
    .unit-row-content { display: contents; }
    .unit-row-content > * { grid-column: 1 / -1; min-width: 0; }
    .detail-card .unit-row-content > .building-feature-heading {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        margin: 0;
    }
    .detail-card .unit-row-content .compact-facts > div {
        grid-template-columns: minmax(80px, .7fr) minmax(0, 1.3fr);
    }
    .detail-card .unit-row-content .compact-facts > .unit-training-cost {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        margin-block: 4px;
        padding: 8px;
        border-radius: 6px;
        background: #e9d8b15c;
    }
    .unit-row-content .unit-training-cost .resource-cost-item { font-weight: 650; }
    .unit-row-content > .unit-research-cost { margin: 0; }
    .unit-row-content .compact-facts dd { overflow-wrap: anywhere; }
    .detail-card .unit-row-content .training-form { margin-top: 0; }
    .detail-card .unit-row-content .training-controls { max-width: none; }
}

.panel-disclosure > summary { cursor: pointer; list-style: none; }
.panel-disclosure > summary::-webkit-details-marker { display: none; }
.panel-disclosure > summary::marker { content: ""; }
.panel-disclosure > summary::after { content: "⌃"; flex: 0 0 auto; color: #3c5c36; font-size: 1rem; font-weight: 700; }
.panel-disclosure:not([open]) > summary { margin-bottom: 0; }
.panel-disclosure:not([open]) > summary::after { content: "⌄"; }
.panel-disclosure > summary:focus-visible { outline: 3px solid #947138; outline-offset: 4px; border-radius: 3px; }

/* Planned destinations are visible but cannot be mistaken for active links. */
.account-bar .section-nav { gap: 4px; }
.future-nav { display: inline-flex; align-items: center; gap: 2px; }
.future-nav-item { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 6px; padding: 9px 8px; color: #dfd8c1; background: transparent; font-family: inherit; font-weight: 700; font-size: .82rem; white-space: nowrap; cursor: default; }
.future-nav-item .nav-icon { color: #c4ad7c; }
.future-nav-item small { padding: 3px 5px; border-radius: 9px; background: #ffffff1c; color: #ddd8c8; font-size: .57rem; font-weight: 600; }
.village-list {
    display: grid;
    gap: 2px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}
.village-list-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    min-height: 38px;
    padding: 5px 9px;
    border-radius: 5px;
    color: #34402c;
    font-size: .86rem;
    text-decoration: none;
}
button.village-list-row { width: 100%; border: 0; background: transparent; text-align: start; cursor: pointer; }
button.village-list-row:hover { background: #88995124; }
.village-list-row > span { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.village-list-row .village-capital-marker { color: #876326; }
.village-list-row small { margin-left: auto; color: #566044; font-size: .74rem; }
.village-list-row[aria-current] { background: #88995124; }
.village-list-row[aria-current]::before {
    content: "";
    width: 9px;
    height: 5px;
    border: solid #53703a;
    border-width: 0 0 2px 2px;
    transform: translateY(-1px) rotate(-45deg);
}
.village-list a:hover { background: #88995138; }
.village-name-dialog {
    width: min(25rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    border: 1px solid #a78854;
    border-radius: 12px;
    padding: 22px;
    background: #f4e6c6 url(/build/images/parchment-grain.1b27c5a6.webp) center / 174px;
    box-shadow: inset 0 0 0 3px #fff3d4, inset 0 0 0 4px #cdb489, 0 8px 36px #23281959;
    color: #293925;
}
.village-name-dialog::backdrop { background: #14251985; }
.village-name-dialog h2 { margin: 0 0 16px; font: bold 1.4rem/1.2 Georgia, serif; }
.village-name-dialog label { display: block; margin-bottom: 5px; font-weight: 600; font-size: .85rem; }
.village-name-dialog input[type="text"] { width: 100%; }
.village-name-error { margin: 8px 0 0; color: #842f20; font-size: .85rem; }
.village-name-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; margin-top: 18px; }
.alliance-settings-dialog { width: min(36rem, calc(100% - 2rem)); }
.alliance-settings-dialog textarea { width: 100%; resize: vertical; }
@media (pointer: coarse) {
    .village-list-row { min-height: 44px; }
}
@media (min-width: 1151px) {
    .account-bar { gap: clamp(6px, .8vw, 16px); }
    .account-bar .section-nav {
        padding-inline: clamp(6px, .8vw, 16px);
        border-inline: 1px solid #d2bf8540;
    }
    .account-bar .resource-card { gap: 5px; padding-inline: clamp(3px, .45vw, 9px); }
    .account-bar .resource-details { column-gap: 4px; }
}
@media (min-width: 1151px) and (max-width: 1380px) {
    .account-bar .section-nav a, .future-nav-item { padding-inline: 7px; }
    .account-bar .resource-symbol { flex-basis: 24px; width: 24px; }
    .account-bar .resource-symbol img { width: 24px; height: 24px; }
    .future-nav-item {
        display: grid;
        grid-template-columns: auto auto;
        align-items: center;
        gap: 1px 5px;
        text-align: left;
    }
    .future-nav-item .nav-icon { grid-row: 1 / span 2; }
    .future-nav-item small { justify-self: start; padding: 0 4px; }
    .account-bar .resource-rates { column-gap: 4px; }
}
@media (max-width: 700px) {
    .future-nav-item small { display: none; }
    .future-nav-item { gap: 4px; padding: 8px 5px; font-size: .75rem; }
    .future-nav-item .nav-icon { width: 17px; height: 17px; }
    .account-bar .section-nav { gap: 0; }
}
@media (max-width: 1149px) {
    .game-overview .village-summary { display: block; order: 4; }
    .game-overview .hero-summary { display: flex; order: 5; }
    .game-overview #village-army { order: 6; }
    .game-overview #queues { order: 7; }
    .game-overview #journeys { order: 8; }
}

@media (max-width: 700px) {
    .account-bar .account-menu { order: 1; margin-left: auto; }
    .account-bar .section-nav { order: 2; flex: 1 0 100%; }
    .account-bar > [data-controller="resource-stock"] { order: 3; }
}

.queue-progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 6px; overflow: hidden; appearance: none; background: #dfd0ac; }
.queue-progress::-webkit-progress-bar { background: #dfd0ac; border-radius: 6px; }
.queue-progress::-webkit-progress-value { background: #618b46; border-radius: 6px; }
.queue-progress::-moz-progress-bar { background: #618b46; border-radius: 6px; }

/* Keep the village in the valley, below the horizon of its backdrop. */
body.village-landscape #village-center { margin-top: calc(100px + clamp(36px, 9vh, 100px)); }
@media (min-width: 1150px) {
    body.village-landscape #village-center { margin-top: calc(100px + clamp(85px, 13vh, 140px)); }
}

/* Final typography and controls for the parchment interface. */
:root {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    --ink: #20372a;
    --muted: #5f6f5d;
    --forest: #315f40;
    --forest-dark: #244a32;
}
.section-heading h2, .side-title h2, .hero-summary h2,
.detail-card .card-title-row h3, .field-detail-page .card-title-row h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    letter-spacing: -.015em;
}
.detail-card .card-title-row h3, .field-detail-page .card-title-row h3 {
    font-size: clamp(1.08rem, 1.5vw, 1.35rem);
    line-height: 1.2;
}
.detail-card .card-title-row p, .field-detail-page .card-title-row p {
    color: #65765b;
    font-size: .8rem;
    font-weight: 600;
}
.card-description, .cost-line, .muted-message, .queue-type, .compact-facts dt {
    color: #5a6a56;
}
.detail-card .compact-facts > div, .field-detail-page .compact-facts > div { font-size: .86rem; line-height: 1.45; }
.detail-card .compact-facts dd, .field-detail-page .compact-facts dd { color: #283b2d; }
.button {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 9px 16px;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.button:hover:not(:disabled) { transform: none; }
.button-primary {
    border-color: #244a32;
    background: linear-gradient(180deg, #426e48, #2b593c);
    color: #fff9e9;
    box-shadow: inset 0 1px #ffffff32, 0 1px 2px #342b1c2e;
}
.button-primary:hover:not(:disabled) { border-color: #1c3e2a; background: linear-gradient(180deg, #4e7b50, #315e3f); }
.button-primary:active:not(:disabled) { background: #244a32; box-shadow: inset 0 2px 4px #132d1b55; }
.button-secondary {
    border-color: #b79b6b;
    background: linear-gradient(180deg, #fff9e9, #efe0bd);
    color: #2a4830;
    box-shadow: inset 0 1px #ffffffb3, 0 1px 2px #342b1c20;
}
.button-secondary:hover:not(:disabled) { border-color: #967848; background: linear-gradient(180deg, #fffdf1, #e9d7ae); }
.button-secondary:active:not(:disabled) { background: #e8d5af; box-shadow: inset 0 2px 3px #7d67422e; }
.button:disabled { opacity: 1; cursor: not-allowed; box-shadow: none; }
.button-primary:disabled { border-color: #9ba995; background: #c5d0bd; color: #405646; }
.button-secondary:disabled { border-color: #cfc4a9; background: #e9e2cf; color: #7c8572; }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
.panel-disclosure > summary:focus-visible {
    outline: 3px solid #b5812e;
    outline-offset: 3px;
}
.detail-close {
    display: inline-grid;
    place-items: center;
    flex: none;
    inline-size: 36px;
    block-size: 36px;
    margin-inline-start: auto;
    padding: 0;
    border: 1px solid #a68b53;
    border-radius: 7px;
    background: linear-gradient(#f8edcd, #e6ca8f);
    box-shadow: inset 0 0 0 2px #fff4d6, 0 1px 2px #41361f35;
    color: #4e3c24;
    font: 700 1.45rem/1 system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
}
.detail-close:hover { background: linear-gradient(#fff4d6, #efd298); border-color: #836637; }
.detail-close:active { background: #e6ca8f; box-shadow: inset 0 1px 3px #7d674250; }
.detail-close:focus-visible { outline: 3px solid #b5812e; outline-offset: 3px; }
@media (pointer: coarse) {
    .detail-close { inline-size: 44px; block-size: 44px; }
}

.section-count { border: 1px solid #d9c8a4; background: #ecdfc2; color: #506249; }
.building-cost-values strong, .countdown { color: #263e2c; font-variant-numeric: tabular-nums; }
.overview-side .queue-item { line-height: 1.35; }
@media (max-width: 560px) {
    .detail-card .compact-facts > div, .field-detail-page .compact-facts > div { font-size: .82rem; }
    .button { min-height: 42px; }
}

/* Overview panels share one illustrated paper surface and ruled rows. */
@media (min-width: 1150px) {
    .game-overview { grid-template-columns: clamp(220px, 19vw, 296px) minmax(0, 1fr) clamp(220px, 19vw, 296px); }
    .game-overview > .overview-side { margin-top: clamp(24px, 6vh, 70px); }
}
.overview-side { gap: 12px; }
.overview-side > .panel { padding: 8px 12px 11px; }
.overview-side .section-heading, .overview-side .side-title { gap: 8px; }
.overview-side .side-title h2, .overview-side .hero-summary h2 {
    margin: 0;
    color: #2c321e;
    font: bold 1.22rem/1.15 Georgia, "Times New Roman", serif;
}
.overview-side .side-icon {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border-color: #c39a55;
    background: linear-gradient(145deg, #6c793f, #394f2c 85%);
    color: #ffdf9b;
}
.overview-side .panel-disclosure > .section-heading,
.overview-side .village-summary .side-title {
    margin: 0 0 6px;
    border-bottom: 1px solid #b38b5380;
    padding: 0 0 6px;
    min-height: 36px;
}
.overview-side .panel-disclosure:not([open]) > .section-heading { margin: 0; border: 0; padding: 0; }
.overview-side .panel-disclosure > summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-inline: 3px;
    border: solid #526139;
    border-width: 2px 2px 0 0;
    transform: translateY(2px) rotate(-45deg);
}
.overview-side .panel-disclosure:not([open]) > summary::after { transform: translateY(-2px) rotate(135deg); }
.overview-side .section-count { margin-left: auto; padding: 2px 6px; font-size: .67rem; }
.overview-side > .village-summary { padding: 6px 8px 9px; }
.overview-side .village-summary .side-title { min-height: 36px; padding: 0 3px 0 0; margin: 0; }
.village-summary .side-icon img { display: block; width: 30px; height: 30px; object-fit: contain; }
.village-settings {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border-radius: 4px;
    color: #485637;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    font: 1.3rem/1 system-ui, sans-serif;
    text-decoration: none;
}
.village-settings:hover { background: #b59c6622; color: #2d462b; }
.army-units { margin: 0; }
.army-units > div, .army-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 3px;
    font-size: .85rem;
}
.army-units .unit-list-icon { width: 20px; height: 20px; }
.army-units dd, .army-subtotal { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.army-subtotal { padding-top: 8px; border-top: 1px solid #b38b5366; }
.army-roster-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.army-roster-table { width: max-content; min-width: 100%; border: 1px solid #b38b5380; border-collapse: collapse; text-align: center; }
.army-roster-table caption { caption-side: top; }
.army-roster-table caption, .section-heading h2.army-roster-caption {
    padding-bottom: 6px;
    color: #64583f;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 650;
    letter-spacing: normal;
    text-align: start;
}
.army-roster-table th, .army-roster-table td { min-width: 38px; padding: 5px 7px; border: 1px solid #b38b5380; }
.army-roster-table thead th {
    background: #e4cf9b80;
    border-bottom-color: #ae905a;
    color: #526047;
    font-weight: 600;
}
.army-roster-table th[title] { cursor: help; }
.army-roster-table .army-roster-unit-icon { display: block; width: 24px; height: 24px; margin: auto; object-fit: contain; }
.army-roster-table td { font-weight: 650; font-variant-numeric: tabular-nums; }
.overview-side .hero-summary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 112px;
    gap: 10px;
    padding: 8px 13px 5px 5px;
}
.overview-side .hero-summary img {
    align-self: end;
    display: block;
    width: min(48%, 134px);
    height: 102px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    object-fit: contain;
    object-position: center bottom;
}
.hero-summary h2 { flex: 1; padding-bottom: 5px; border-bottom: 1px solid #b38b5375; }
.overview-side .queue-list { gap: 0; }
.overview-side .queue-item {
    position: relative;
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr);
    gap: 2px 9px;
    align-items: center;
    border: 0;
    border-radius: 0;
    padding: 8px 1px;
    background: transparent;
}
.queue-art { grid-column: 1; grid-row: 1 / span 4; width: 45px; height: 52px; object-fit: contain; }
.overview-side .queue-item > :not(.queue-art) { grid-column: 2; }
.overview-side .queue-item strong { font-size: .88rem; line-height: 1.2; }
.overview-side .queue-item small { color: #594e39; }
.overview-side .queue-progress { height: 6px; margin-top: 3px; }
.overview-side .queue-item time { text-align: end; font-size: .72rem; }
.overview-side .queue-item + .queue-item { border-top: 1px solid #b38b5366; }
.queue-detail-link { color: inherit; text-decoration: underline; text-decoration-color: #88724a80; text-underline-offset: 3px; }
.queue-detail-link::after { content: ""; position: absolute; inset: 0; }
.overview-side .queue-item:has(.queue-detail-link:is(:hover, :focus-visible)) { background: #88995124; }
.detail-card .detail-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
}
.detail-section-title .side-icon { flex-basis: 30px; width: 30px; height: 30px; border-radius: 6px; }
.detail-section-title .side-icon svg { width: 19px; height: 19px; }
.detail-card #army, .detail-card #unit-training-queue { margin-top: 12px; padding-top: 12px; }
.overview-side .empty-state { margin: 0; padding: 8px 3px; background: transparent; font-size: .8rem; line-height: 1.45; }
.detail-card .building-feature-heading p {
    display: inline-block;
    border: 1px solid #c6a879;
    border-radius: 5px;
    padding: 2px 8px;
    background: #f2dfb6;
    color: #524124;
}
.detail-card .building-feature-heading h3 { font-size: clamp(1.25rem, 1.65vw, 1.65rem); }
.detail-card .section-heading, .field-detail-page > .section-heading {
    padding-bottom: 9px;
    border-bottom: 1px solid #b38b5380;
}

.detail-card { container: building-detail / inline-size; }
.research-table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: start; }
.research-table > :is(thead, tbody) > tr > :is(th, td) { padding: 8px; text-align: start; vertical-align: middle; }
.research-table > thead > tr > th, .research-label { color: #64583f; font-size: .75rem; font-weight: 600; }
.research-table > thead { border-bottom: 1px solid #b38b5380; background: #ae8c4520; }
.research-table > thead > tr > th:nth-child(1) { width: 26%; }
.research-table > thead > tr > th:nth-child(2) { width: 23%; }
.research-table > thead > tr > th:nth-child(3) { width: 19%; }
.research-table > thead > tr > th:nth-child(4) { width: 13%; }
.research-table > tbody > tr + tr { border-top: 1px solid #b38b5359; }
.research-table > tbody > tr > td { font-size: .85rem; line-height: 1.4; }
.research-unit { display: flex; align-items: center; gap: 10px; }
.research-unit .unit-stats-image-trigger img { width: 64px; height: 78px; object-fit: contain; flex: none; }
.research-unit h3 { margin: 0; color: #293a31; font: bold 1.1rem/1.15 Georgia, serif; }
.research-costs { display: grid; grid-template-columns: repeat(2, max-content); gap: 5px 12px; }
.research-costs, .research-time { font-variant-numeric: tabular-nums; }
.research-costs .resource-cost-item { font-weight: 650; }
.training-cost-shortage { color: #a32321; }
button:disabled > .training-confirm-ready, button:enabled > .training-confirm-blocked { display: none; }
:not(.training-cost-shortage) + .training-shortage-label { display: none; }
.research-action .button { width: 100%; padding-inline: 8px; }
.research-complete { color: #395d35; font-weight: 650; }
.research-progress { display: grid; gap: 5px; color: #395d35; }
.research-progress time { color: #514b39; font-size: .78rem; font-variant-numeric: tabular-nums; }
.research-label { display: none; }
@container building-detail (max-width: 46rem) {
    .research-table, .research-table > tbody { display: block; }
    .research-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .research-table > tbody > tr {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(100px, .8fr);
        grid-template-areas: "unit requirements time" "price price action";
        gap: 8px 16px;
        align-items: center;
        padding: 12px 0;
    }
    .research-table > :is(thead, tbody) > tr > :is(th, td) { padding: 0; }
    .research-table > tbody > tr > th { grid-area: unit; }
    .research-requirements { grid-area: requirements; }
    .research-price { grid-area: price; }
    .research-time { grid-area: time; }
    .research-action { grid-area: action; }
    .research-unit .unit-stats-image-trigger img { width: 52px; height: 60px; }
    .research-label { display: block; margin-bottom: 2px; }
    .research-costs { display: flex; flex-wrap: wrap; gap: 4px 12px; }
}
@container building-detail (max-width: 30rem) {
    .research-table > tbody > tr {
        grid-template-columns: minmax(0, 1fr) minmax(74px, auto);
        grid-template-areas: "unit time" "requirements requirements" "price price" "action action";
    }
}
@container building-detail (min-width: 940px) {
    .detail-card :is(#buildings, #field-detail-page) .building-card { grid-template-columns: 170px minmax(0, 1fr); }
    .detail-card :is(#buildings, #field-detail-page) .building-card > .building-illustration { max-width: 170px; }
    .building-card .building-card-content {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 6px 14px;
        border-inline-start: 1px solid #b38b534d;
        padding-inline-start: 20px;
    }
    .building-card .building-card-content > * { grid-column: 1 / -1; }
    .building-card .building-feature-heading > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
    .building-card .building-feature-heading, .building-card .card-description, .building-card .building-facts { margin: 0; }
    .building-card .building-facts:has(.building-cost-fact) {
        grid-column: 1;
        grid-template-columns: minmax(110px, 1fr) minmax(175px, 1.5fr) minmax(90px, .7fr);
        margin-top: 10px;
    }
    .building-card .building-facts:has(.building-cost-fact) > div { display: block; }
    .field-detail-feature .building-facts:has(.building-cost-fact) { grid-template-columns: minmax(175px, 1.5fr) minmax(90px, .7fr); }
    .building-card .building-facts:has(.building-cost-fact) dt { margin-bottom: 5px; font-size: .75rem; }
    .building-card .building-cost-list { gap: 4px; }
    .building-card .building-cost-item { min-width: 0; gap: 4px; padding: 3px 6px; }
    .building-card .building-cost-item img { width: 18px; height: 18px; }
    .building-card .building-card-content > form { grid-column: 2; margin: 0; }
    .detail-card #army .unit-illustration { height: 145px; grid-template-rows: minmax(0, 1fr); }
    .detail-card #army .unit-illustration img { min-height: 0; }
    .detail-card .unit-row-content > .compact-facts { margin: 0; padding-inline-start: 14px; border-inline-start: 1px solid #b38b534d; }
}

@media (max-width: 700px) {
    .detail-card #buildings .building-card, .field-detail-feature {
        grid-template-columns: minmax(75px, .48fr) minmax(0, 1fr);
        gap: 6px 12px;
    }
    .detail-card #buildings .building-card > .building-illustration, .field-detail-feature > .building-illustration {
        grid-column: 1;
        grid-row: 1 / span 2;
    }
    :is(.building-card, .field-detail-feature) > .building-card-content { display: contents; }
    :is(.building-card, .field-detail-feature) > .building-card-content > * { grid-column: 1 / -1; }
    :is(.building-card, .field-detail-feature) > .building-card-content > :is(.building-feature-heading, .card-description) {
        grid-column: 2;
        margin: 0;
    }
    :is(.building-card, .field-detail-feature) .building-feature-heading { align-self: end; }
    :is(.building-card, .field-detail-feature) .card-description { align-self: start; }
}

/* Fade the grass around the map while retaining trees, rocks and water. */
.field-board-art {
    -webkit-mask-image:
        linear-gradient(to bottom, #000 0 43%, transparent 47%),
        radial-gradient(ellipse 5% 7% at 98% 50%, #000 0 55%, transparent 100%),
        radial-gradient(ellipse 6% 7% at 5% 65%, #000 0 55%, transparent 100%),
        radial-gradient(ellipse 50% 49% at 50% 50%, #000 88%, transparent 99%),
        radial-gradient(ellipse 19% 19% at 24% 14%, #000 0 65%, transparent 100%),
        radial-gradient(ellipse 24% 24% at 78% 23%, #000 0 70%, transparent 100%),
        radial-gradient(ellipse 18% 14% at 53% 83%, #000 0 70%, transparent 100%),
        radial-gradient(ellipse 9% 11% at 9% 32%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 9% 10% at 7% 43%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 11% 12% at 8% 55%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 12% 10% at 76% 83%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 11% 10% at 92% 53%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 23% 21% at 14% 72%, #000 0 70%, transparent 100%),
        radial-gradient(ellipse 10% 11% at 98% 50%, #000 0 72%, transparent 100%),
        radial-gradient(ellipse 49% 47% at 50% 50%, #000 62%, transparent 100%);
    mask-image:
        linear-gradient(to bottom, #000 0 43%, transparent 47%),
        radial-gradient(ellipse 5% 7% at 98% 50%, #000 0 55%, transparent 100%),
        radial-gradient(ellipse 6% 7% at 5% 65%, #000 0 55%, transparent 100%),
        radial-gradient(ellipse 50% 49% at 50% 50%, #000 88%, transparent 99%),
        radial-gradient(ellipse 19% 19% at 24% 14%, #000 0 65%, transparent 100%),
        radial-gradient(ellipse 24% 24% at 78% 23%, #000 0 70%, transparent 100%),
        radial-gradient(ellipse 18% 14% at 53% 83%, #000 0 70%, transparent 100%),
        radial-gradient(ellipse 9% 11% at 9% 32%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 9% 10% at 7% 43%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 11% 12% at 8% 55%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 12% 10% at 76% 83%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 11% 10% at 92% 53%, #000 0 80%, transparent 100%),
        radial-gradient(ellipse 23% 21% at 14% 72%, #000 0 70%, transparent 100%),
        radial-gradient(ellipse 10% 11% at 98% 50%, #000 0 72%, transparent 100%),
        radial-gradient(ellipse 49% 47% at 50% 50%, #000 62%, transparent 100%);
    mask-composite: add, add, add, intersect, add, add, add, add, add, add, add, add, add, add, add;
}

.training-table .research-unit small { display: block; margin-top: 4px; font-weight: 400; }
.training-table .training-form { margin: 0; padding: 0; border: 0; }
.training-table .training-controls input { width: 3.75rem; }
.training-table .training-controls { flex-wrap: wrap; }
.training-table .training-controls .button { width: auto; }
@container building-detail (max-width: 46rem) {
    .training-table > tbody > tr {
        grid-template-areas: "unit requirements time" "price price price" "action action action";
    }
}
@container building-detail (max-width: 30rem) {
    .training-table > tbody > tr {
        grid-template-areas: "unit time" "requirements requirements" "price price" "action action";
    }
}

.unit-research-details { display: grid; gap: 5px; }

#army .unit-unavailable { color: #595951; background: #d3d1c44d; }
#army .unit-unavailable h3, #army .unit-unavailable .blocked-message { color: inherit; }
#army .unit-unavailable img:not(.unit-stats-artwork) { filter: grayscale(1); }

.hero-detail {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px clamp(16px, 3vw, 36px);
}
.hero-detail .hero-artwork-portrait {
    width: min(100%, clamp(14rem, 26vw, 20rem));
    max-width: 100%;
    height: auto;
}
.hero-progress-details { flex: 1 1 18rem; min-width: 0; }
.stat-summary-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #b38b5380;
}
.stat-summary-table th, .stat-summary-table td {
    padding: 8px clamp(8px, 1.5vw, 14px);
    border-bottom: 1px solid #b38b5355;
}
.stat-summary-table th {
    width: 45%;
    background: #e4cf9b66;
    font-weight: 650;
    text-align: start;
}
.stat-summary-table td { text-align: end; font-variant-numeric: tabular-nums; }
.hero-experience-total { display: block; font-weight: 700; }
.hero-statistics progress { display: block; width: 100%; margin-top: 5px; }
:is(.hero-oasis-slots, .expansion-slots) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
:is(.hero-oasis-slot, .expansion-slot) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid #cbb68e;
    border-radius: 8px;
    background: #fff8e861;
}
:is(.hero-oasis-slot-content, .expansion-slot-content) { display: grid; gap: 4px; }
:is(.hero-oasis-slot-icon, .expansion-slot-icon) { display: grid; justify-items: center; gap: 3px; color: #52664a; }
:is(.hero-oasis-slot-icon, .expansion-slot-icon) :is(img, svg) { display: block; width: 66px; height: 66px; }
:is(.hero-oasis-slot-icon, .expansion-slot-icon) svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:is(.hero-oasis-slot, .expansion-slot).is-locked :is(.hero-oasis-slot-icon, .expansion-slot-icon) { color: inherit; }
:is(.hero-oasis-slot, .expansion-slot).is-locked { color: #595951; background: #d3d1c44d; }

.building-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
}
.building-heading-level {
    padding: 3px 8px;
    border-radius: 6px;
    background: #e9d8b15c;
    color: #514b39;
    font-size: .82rem;
}

.hero-summary-content { flex: 1; min-width: 0; padding-block: 4px; }
.hero-summary-link { color: inherit; text-decoration: none; }
button.hero-summary-link { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.hero-summary-link::after { content: ""; position: absolute; inset: 0; }
.hero-summary-link:hover { text-decoration: underline; }
.hero-summary-link:focus-visible::after { outline: 2px solid #315d3e; outline-offset: -3px; border-radius: 8px; }
.hero-summary-level { margin: 4px 0; font-size: .79rem; }
.hero-point-badge { display: inline-grid; place-items: center; vertical-align: middle; width: 1.15em; height: 1.15em; border-radius: 50%; background: #315d3e; color: #fff; font-weight: 700; line-height: 1; }


.unit-training-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.unit-stats-trigger, .unit-stats-info {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.unit-stats-trigger:not(.unit-stats-image-trigger):hover { text-decoration: underline; text-underline-offset: 3px; }
.unit-stats-image-trigger { display: grid; place-items: center; flex: none; }
.unit-character .unit-stats-image-trigger { height: 100%; max-height: 180px; }
.unit-stats-info {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #315d3e;
    font: 700 1rem/1 system-ui;
}
.unit-stats-info:is(:hover, :focus-visible) { background: #e6d6ad; }
.unit-stats-dialog { width: min(41rem, calc(100% - 2rem)); overflow: auto; }
.unit-stats-content { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 24px; }
.unit-stats-artwork {
    width: min(100%, 12rem);
    height: auto;
    max-height: 19rem;
    object-fit: contain;
}
.unit-stats-table { flex: 1 1 16rem; width: auto; min-width: 0; }

.storage-fill { display: grid; gap: 8px; margin-block: 12px; }
.storage-fill h3 { margin: 0; font-size: .9rem; }
.storage-fill-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-bottom: 4px; font-size: .82rem; }
.storage-fill-label strong { font-variant-numeric: tabular-nums; }
.storage-fill .resource-progress { background: #dfd0ac; }
.storage-fill .resource-progress::-webkit-progress-bar { background: #dfd0ac; }

@media (max-width: 700px) {
    .field-detail-feature > .building-illustration { grid-row: 1; }
    .field-detail-feature > .building-card-content > .card-description { align-self: center; }
}

.construction-progress {
    display: grid;
    gap: 6px;
    margin-block: 8px;
    padding: 10px 12px;
    border: 1px solid #cbb68e;
    border-radius: 8px;
    background: #e9d8b15c;
    font-size: .82rem;
}

.marketplace-preview {
    display: grid;
    gap: 8px;
    min-inline-size: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid #cbb68e;
    border-radius: 8px;
    background: #e9d8b15c;
}
.marketplace-preview :is(input:not([type="hidden"]), select) { width: 100%; }
.marketplace-preview .button { justify-self: start; }
.marketplace-load, .marketplace-load-warning { margin: 0; font-size: .85rem; }
.marketplace-load-warning { color: #842f20; }
.marketplace-load-warning:empty { margin-top: -8px; }
.marketplace-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
    gap: 8px;
}
.marketplace-destination { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.marketplace-field-label { display: block; margin-bottom: 4px; font-size: .85rem; font-weight: 650; }
.marketplace-destination-or { padding-bottom: 8px; color: #5d6652; font-size: .85rem; font-style: italic; }
.marketplace-own-destination { flex: 1 1 12rem; max-width: 20rem; }
.coordinate-input {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding-inline: 8px;
    border: 1px solid #a68b53;
    border-radius: 5px;
    background: #fff3d4;
    box-shadow: inset 0 1px 2px #8e6e372d;
    font-weight: 700;
}
.coordinate-input:focus-within { border-color: #42613a; outline: 1px solid #42613a; outline-offset: 0; }
.marketplace-preview .coordinate-input input {
    width: 4rem;
    padding-inline: 2px;
    border: 0;
    outline: 0;
    background: none;
    box-shadow: none;
    text-align: center;
    appearance: textfield;
}
.coordinate-input input::-webkit-inner-spin-button { appearance: none; }
.marketplace-amounts { display: grid; gap: 6px; }
.marketplace-amount { display: flex; align-items: center; gap: 8px; }
.marketplace-amount label { display: flex; }
.marketplace-amount img { width: 24px; height: 24px; object-fit: contain; }
.marketplace-preview .marketplace-amount input { width: 7rem; }
.marketplace-amount .button { min-width: 3.5rem; font-variant-numeric: tabular-nums; }
.marketplace-review-dialog { width: min(28rem, calc(100% - 2rem)); }
.marketplace-review-dialog .research-costs { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px 10px; }
.marketplace-options > div { padding: 10px 12px; border: 1px solid #cbb68e; border-radius: 8px; }
.marketplace-options h3 { margin: 0; font-size: .95rem; }
.marketplace-options p { margin: 4px 0 0; }

.account-settings-form { display: grid; max-width: 28rem; gap: 7px; }
.account-settings-form label { margin-top: 6px; font-size: .85rem; font-weight: 650; }
.account-settings-form input:not([type="hidden"]) { width: 100%; }
.account-settings-form .button { justify-self: start; margin-top: 6px; }
.account-settings-form textarea { width: 100%; resize: vertical; }
.player-message-form { max-width: 40rem; }
.player-profile-summary { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 24px; }
.player-profile-illustration { display: block; width: min(100%, 20rem); max-height: 21rem; object-fit: contain; object-position: left top; border-radius: 8px; }
.player-profile-details { flex: 1 1 18rem; min-width: 0; }
.player-profile-details > .compact-facts { margin-top: 0; }
.player-profile + .player-profile { margin-top: 16px; }
.player-profile-text, .settings-panel > .player-profile-text { margin: 14px 0 0; color: inherit; line-height: 1.6; overflow-wrap: anywhere; }
.player-village-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.player-village-table :is(th, td) { padding: 6px 8px; border-bottom: 1px solid #b38b5366; text-align: start; }
.player-village-table :is(th, td):last-child { text-align: end; font-variant-numeric: tabular-nums; }
.player-village-table small { color: var(--muted); font-weight: 400; }
.inbox-message-from { margin: 0 0 8px; color: #5f573f; font-size: .85rem; }

.settings-heading {
    text-shadow: 0 1px 2px #fff4d6, 0 0 8px #fff4d6;
}
.settings-heading :is(.eyebrow, .village-meta) { color: #283b2d; }

body.world-map-page { display: flex; flex-direction: column; background: #243624; }
.world-map-page > main { display: flex; flex: 1; min-height: 0; }
.world-map {
    position: relative;
    flex: 1;
    min-height: 380px;
    overflow: hidden;
    isolation: isolate;
    background: #354631;
}
.world-map-grid {
    --tile-side: max(32px, 5.33vw, 3.33vh);
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    grid-template: repeat(var(--map-diameter), var(--tile-side)) / repeat(var(--map-diameter), var(--tile-side));
    transform: translate(calc(-50% + var(--drag-x, 0px)), calc(-50% + var(--drag-y, 0px)));
}
.world-map-grid { touch-action: pinch-zoom; user-select: none; }
.world-map-dragging, .world-map-dragging .world-tile { cursor: grabbing; }
.world-tile {
    position: relative;
    overflow: hidden;
    background-color: #6da94e;
    background-image: linear-gradient(#6da94e80, #6da94e80), url(/build/images/village-grass.d944bb64.webp);
    background-repeat: no-repeat;
    background-size: 100% 100%, 800% 800%;
    background-position: center, calc(var(--grass-x) * 100% / 7) calc(var(--grass-y) * 100% / 7);
    box-shadow: inset -1px -1px rgb(38 59 38 / 14%);
}
.world-tile img {
    position: absolute;
    inset: 50% auto auto 50%;
    width: var(--sprite-size, 100%);
    height: var(--sprite-size, 100%);
    max-width: none;
    object-fit: contain;
    transform: translate(-50%, -50%);
}
.world-sprite-village { --sprite-size: 112%; }
.world-sprite-oasis { --sprite-size: 124%; }
.world-sprite-oasis-combined { --sprite-size: 116%; }
.world-tile-own { outline: 2px solid #f7d683; outline-offset: -3px; }
.world-map-controls, .world-map-pan {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px;
}
.world-map-controls {
    top: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid #8e6e37;
    border-radius: 9px;
    background: linear-gradient(180deg, #f8edcd, #e6ca8f);
    box-shadow: inset 0 0 0 2px #f7e9be, 0 2px 6px #2c311b65;
    color: #3c301c;
    font: 700 1rem Georgia, serif;
}
.world-map-controls form, .world-map-controls label {
    display: flex;
    align-items: center;
    gap: 7px;
}
.world-map-controls form { gap: 10px; }
.world-map-controls input {
    width: 3.2rem;
    padding: 4px;
    appearance: textfield;
    text-align: center;
}
.world-map-controls input::-webkit-inner-spin-button,
.world-map-controls input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.world-map-controls .button {
    min-height: 36px;
    padding: 5px 10px;
    border-color: #5a6036;
    background: linear-gradient(#365632, #213b23);
    color: #fff2ce;
    font: inherit;
    white-space: nowrap;
}
.world-map-controls .button:focus-visible { outline: 2px solid #375930; outline-offset: 2px; }
.world-map-controls form:has(+ .world-map-home) { padding-inline-end: 12px; border-inline-end: 1px solid #aa8d55; }
@media (max-width: 420px) {
    .world-map-controls { gap: 7px; padding: 7px 8px; }
    .world-map-controls form { flex-wrap: wrap; gap: 7px; }
    .world-map-controls form:has(+ .world-map-home) { padding: 0; border: 0; }
    .world-map-controls label { gap: 4px; }
    .world-map-controls input { width: 2.65rem; }
    .world-map-controls :is(input, .button) { min-height: 44px; }
}
.world-map-pan .button { padding: 6px 9px; }
.world-map-pan { right: 10px; bottom: 10px; }

.world-tile:focus-visible { z-index: 1; outline: 2px solid #fff4cf; outline-offset: -2px; }
.world-tile-detail { max-width: 640px; margin: 0 auto; }
.world-expedition-detail { max-width: 960px; }
.world-tile-detail header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.world-tile-detail dl { max-width: 360px; }
.world-tile-detail dl div { display: flex; justify-content: space-between; padding: 6px 0; }
.world-tile-detail dd { margin: 0; font-weight: 700; }
.world-oasis-summary { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr); align-items: center; gap: 16px; }
.world-oasis-summary dt { margin-inline-end: 8px; }
.world-oasis-summary dd { white-space: nowrap; }
.world-oasis-illustration { display: block; width: 100%; height: auto; object-fit: contain; }
@media (max-width: 430px) {
    .world-oasis-summary { grid-template-columns: minmax(0, 100px) minmax(0, 1fr); gap: 10px; }
}

.world-tile-dialog {
    box-sizing: border-box;
    width: min(640px, calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    overflow: auto;
    overscroll-behavior: contain;
}
.world-tile-dialog:has(> .world-expedition-detail) { width: min(960px, calc(100% - 24px)); }
.world-tile-dialog::backdrop { background: #14251985; }
.world-tile-dialog .world-tile-detail { margin: 0; }

.world-field-preview {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    max-width: 360px;
    padding: 8px;
    border-radius: 8px;
    background: #a4ad7b url(/build/images/grass-soft.4e57e135.webp) center / cover;
}
.world-field-preview-plot { display: block; width: 100%; height: auto; }

.world-valley-illustration { display: block; width: min(100%, 420px); height: auto; margin: 0 auto; }

.world-map-notices {
    position: absolute;
    bottom: 10px;
    left: 10px;
    margin: 0;
    max-width: min(320px, calc(100% - 115px));
    max-height: 45%;
    overflow: auto;
}
.world-map-notices p { margin-bottom: 6px; }
.world-journey-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.world-journey {
    display: grid;
    grid-template-columns: 20px 16px minmax(0, 1fr);
    align-items: start;
    gap: 5px;
    padding: 6px 3px;
    font-size: .85rem;
}
.world-journey-roster { grid-column: 3; min-width: 0; }
.world-journey-progress { grid-column: 1 / -1; }
.world-journey-progress::-webkit-progress-value {
    background: repeating-linear-gradient(-45deg, #618b46 0 8px, #7da25f 8px 16px) 0 0 / 22.63px 100%;
    animation: world-journey-progress 1s linear infinite;
}
.world-journey-progress::-moz-progress-bar {
    background: repeating-linear-gradient(-45deg, #618b46 0 8px, #7da25f 8px 16px) 0 0 / 22.63px 100%;
    animation: world-journey-progress 1s linear infinite;
}
.world-journey-incoming .world-journey-progress::-webkit-progress-value { background-color: #8c3d2c; background-image: repeating-linear-gradient(-45deg, #a8663a 0 8px, #c08a55 8px 16px); }
.world-journey-incoming .world-journey-progress::-moz-progress-bar { background-color: #8c3d2c; background-image: repeating-linear-gradient(-45deg, #a8663a 0 8px, #c08a55 8px 16px); }
@keyframes world-journey-progress { to { background-position-x: 22.63px; } }
@media (prefers-reduced-motion: reduce) {
    .world-journey-progress::-webkit-progress-value { animation: none; }
    .world-journey-progress::-moz-progress-bar { animation: none; }
}
.marketplace-journeys { margin-top: 14px; padding: 10px 12px; border: 1px solid #cbb68e; border-radius: 8px; background: #e9d8b15c; }
.marketplace-journeys h3 { margin: 0 0 4px; font-size: .95rem; }
#rally-point-journeys .world-journey { scroll-margin-top: calc(var(--game-header-height, 70px) + 12px); }
.world-journey + .world-journey { border-top: 1px solid #b38b5366; }
.world-journey-icon, .world-journey-direction {
    display: grid;
    place-items: center;
    height: 20px;
    color: #4a5c3a;
}
.world-journey[data-journey-type="assault"] .world-journey-icon { color: #8c3d2c; }
.world-journey-icon svg, .world-journey-direction svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.world-journey-icon svg { width: 18px; height: 18px; }
.world-journey[data-journey-type="raid"] .world-journey-icon svg { fill: #805426; stroke: none; }
.world-journey-info { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.world-journey-info time { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.world-journey-info a { font-size: .75rem; overflow-wrap: anywhere; }
.world-journey-direction svg { width: 13px; height: 13px; }
.world-journey-returning .world-journey-direction { color: #335742; }
.world-journey-incoming .world-journey-direction { color: #8c3d2c; }

.game-inbox-badge {
    min-width: 1.4em;
    padding: 2px 4px;
    border-radius: 999px;
    background: #e7c371;
    color: #233323;
    font-size: .75rem;
    text-align: center;
}
.game-overview > .inbox-panel { grid-area: 2 / 2; order: 3; width: 100%; max-width: none; }
.inbox-panel { max-width: 740px; margin-inline: auto; }
.inbox-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 12px; }
.inbox-list { margin: 0; padding: 0; list-style: none; }
.inbox-selection-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.inbox-selection-actions label, .inbox-delete { display: inline-flex; align-items: center; gap: 8px; }
.inbox-selection-actions label { cursor: pointer; }
.inbox-delete svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.inbox-message { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; border-top: 1px solid #b38b5380; }
.inbox-message-select { width: 1rem; height: 1rem; margin: 0 0 0 4px; accent-color: #375930; cursor: pointer; }
.inbox-message-heading { display: block; padding: 11px 4px; text-decoration: none; }
.inbox-message-heading:hover { background: #e7d8b860; }
.inbox-message-heading:focus-visible { outline: 2px solid #375930; outline-offset: -2px; }
.inbox-message-sender, .inbox-message time { color: #5f573f; font-size: .82rem; }
.inbox-message time { text-align: end; }
@media (max-width: 600px) {
  .inbox-message { grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 8px; padding-block: 8px; }
  .inbox-message-heading { grid-column: 2 / -1; padding: 2px 0; }
  .inbox-message-sender { grid-column: 2; }
}
.inbox-message-title { overflow-wrap: anywhere; }
.inbox-message.is-unread .inbox-message-title { font-weight: 750; }
.inbox-detail-date { color: #5f573f; font-size: .85rem; }

.oasis-expedition-units { margin-block: 10px; }
.oasis-expedition-units input[type="number"] { width: 3.5rem; padding-inline: 4px; text-align: center; }
.expedition-available {
    padding: 2px 5px;
    border: 0;
    background: transparent;
    color: var(--forest-dark);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.expedition-available:hover { background: #88995124; }
.expedition-available:focus-visible { outline: 2px solid var(--forest); border-radius: 3px; }
.oasis-expedition-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.inbox-report-table { margin-block: 12px; }

.hero-point-form { margin-block: 12px; padding-top: 10px; border-top: 1px solid #b38b534d; }
.hero-point-form h3 { margin: 0 0 8px; }
.hero-point-controls { display: grid; justify-items: end; gap: 3px; }
.hero-point-stepper { display: flex; gap: 4px; }
.hero-point-controls [data-point-count] { min-width: 3ch; text-align: center; white-space: nowrap; }
.hero-point-controls .button { min-width: 22px; min-height: 22px; padding: 0; font-size: .75rem; line-height: 1; }
@media (pointer: coarse) {
    .hero-point-controls .button { min-width: 28px; min-height: 28px; }
}
.hero-point-form > .button { margin-top: 8px; }

.building-demolition-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.world-support-form, .world-support-stationed { display: grid; gap: 8px; margin-block: 12px; }
.world-support-form label { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 20rem; }
.world-support-form input[type="number"] { width: 5rem; }
.world-support-form > .button { justify-self: start; }

.world-village-summary {
    display: grid;
    grid-template-columns: minmax(0, 55%) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin-block: 12px;
}
.world-village-illustration { display: block; width: 100%; height: auto; }
.world-village-facts { margin: 0; min-width: 0; }
.world-village-facts div { gap: 8px; }
.world-village-facts dd { text-align: end; overflow-wrap: anywhere; }
.world-village-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
@media (max-width: 480px) {
    .world-village-summary { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .world-village-illustration { width: min(100%, 275px); margin-inline: auto; }
}

.building-detail-actions { display: flex; flex: none; gap: 6px; margin-inline-start: auto; }
.building-detail-actions .detail-close { margin-inline-start: 0; }
.building-help-trigger { font: 700 1.15rem/1 Georgia, serif; }
.building-help-dialog { width: min(32rem, calc(100% - 2rem)); }
.building-help-illustration {
    display: block;
    width: min(100%, 27rem);
    max-height: min(24rem, 45dvh);
    margin: 0 auto 16px;
    object-fit: contain;
}
.building-help-dialog p { line-height: 1.55; }


.army-support { margin-top: 10px; padding-top: 8px; border-top: 1px solid #b38b534d; }
.army-support h3 { margin: 0 0 5px; font-size: .85rem; }

.account-page-content {
    display: grid;
    gap: 14px;
    min-width: 0;
    width: 100%;
    max-width: 58rem;
    margin-inline: auto;
}
.game-overview > .account-page-content { grid-area: 2 / 2; order: 3; }
.account-page-content > .panel { margin: 0; max-width: none; }
.account-page-content .section-heading {
    padding-bottom: 9px;
    border-bottom: 1px solid #b38b5380;
}
.account-page-content h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.account-page-content .section-heading h2 { font-size: 1.25rem; }
.account-page-content :is(h1, h2)[id] { scroll-margin-top: 6rem; }
.account-settings-links { display: flex; flex-wrap: wrap; gap: 8px; }
.account-page-content .player-profile-illustration { width: min(100%, clamp(13rem, 26vw, 20rem)); }
.account-page-content .player-profile-details { flex-basis: 15rem; }

.account-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; margin-inline-start: auto; }
.account-controls .account-menu { margin-inline-start: 0; }
@media (max-width: 700px) {
    .account-bar .account-controls { order: 1; }
    .account-bar .account-controls .account-menu { margin-left: 0; }
}

.help-category { border-bottom: 1px solid #b38b5380; }
.help-category > summary {
    padding: 12px 8px;
    border-radius: 6px;
    color: #203b28;
    font: 700 1.06rem/1.35 Georgia, serif;
    cursor: pointer;
}
.help-category > summary:hover, .help-category[open] > summary { background: #88995124; }
.help-category > summary:focus-visible { outline: 2px solid #315d3e; outline-offset: -2px; }
.help-category-content {
    display: grid;
    grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
    gap: 16px;
    padding: 16px 8px;
}
.help-category-content > img { width: 100%; max-height: 240px; object-fit: contain; }
.help-category-content dl, .help-category-content dd { margin: 0; }
.help-category-content dt { font-weight: 700; }
.help-category-content dd { line-height: 1.5; }
.help-category-content dd + dt { margin-top: 12px; }
@media (max-width: 560px) {
    .help-category-content { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .help-category-content > img { width: min(100%, 220px); justify-self: center; }
}

.help-category > summary small { margin-inline-start: 6px; color: #66583d; font: 600 .8rem/1.3 system-ui; }
.help-tribe-entries { padding: 2px 8px 12px; }
.help-catalog-group > summary, .help-catalog-entry > summary { cursor: pointer; padding: 7px 8px; }
.help-catalog-group > summary { font-weight: 700; }
.help-catalog-entry { margin-inline-start: clamp(4px, 2vw, 14px); border-bottom: 1px solid #b38b5340; }
.help-catalog-entry > summary:hover, .help-catalog-entry[open] > summary { background: #8899511a; }
.help-entry-body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; padding: 12px 8px; }
.help-entry-artwork {
    width: min(100%, clamp(10rem, 26vw, 17rem));
    max-height: 20rem;
    object-fit: contain;
    object-position: center top;
}
.help-entry-placeholder {
    display: grid;
    place-items: center;
    min-height: 10rem;
    padding: 12px;
    border: 1px dashed #aa9061;
    border-radius: 8px;
    color: #66583d;
    text-align: center;
}
.help-entry-details { flex: 1 1 17rem; min-width: 0; overflow-wrap: anywhere; }
.help-entry-details > p { margin: 0 0 8px; }
.help-entry-cost { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; }

