/* Aftergrid: repaired brutalism, cyan infrastructure and amber human light. */
:root {
    --bg: #081019;
    --bg-grid: #101b25;
    --panel: #111d27;
    --panel-2: #172733;
    --line: #243c4d;
    --line-strong: #31596e;
    --text: #d7e3e8;
    --muted: #8399a5;
    --cyan: #42d7e8;
    --cyan-dim: #19798b;
    --amber: #ffb454;
    --ok: #3ddc97;
    --error: #ff645f;
    --alloy: #b9c6d3;
    --silicon: #7fd8ff;
    --energy: #ffc547;
    --green: #78a66a;
    --shadow: rgba(0, 0, 0, .52);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 50% -20%, rgba(66, 215, 232, .08), transparent 42%),
        linear-gradient(var(--bg-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
    background-size: 32px 32px;
    font: 14px/1.5 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }

/* ---- icons */
.icon {
    width: 18px;
    height: 18px;
    flex: none;
    vertical-align: -4px;
    color: var(--cyan);
}
.icon.big { width: 30px; height: 30px; }
.icon-r-alloy { color: var(--alloy); }
.icon-r-silicon { color: var(--silicon); }
.icon-r-energy { color: var(--energy); }
.icon-r-depot { color: #9fb3c4; }
.icon-r-pop { color: var(--ok); }
[class*="icon-u-"] { color: var(--amber); }
.with-icon { display: flex; align-items: center; gap: 8px; }
h1.with-icon { gap: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- header */
.top {
    background: linear-gradient(180deg, #0f1924, #0b131c);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 1px 0 rgba(63, 208, 255, .15);
}
.top-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.logo .icon { width: 27px; height: 27px; color: var(--cyan); filter: drop-shadow(0 0 8px rgba(66, 215, 232, .35)); }
.logo:hover { text-decoration: none; color: var(--cyan); }
.menu { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.menu a {
    color: var(--text);
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 13px;
    letter-spacing: .03em;
}
.menu a:hover { border-color: var(--line-strong); background: var(--panel-2); text-decoration: none; }
.season-link { display: inline-flex; align-items: center; gap: 5px; }
.season-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 7px currentColor; }
.season-dot.phase-1 { color: var(--green); background: var(--green); }
.season-dot.phase-2 { color: var(--cyan); }
.season-dot.phase-3 { color: var(--amber); background: var(--amber); }
.season-dot.phase-4 { color: var(--error); background: var(--error); }
.logout { display: flex; align-items: center; gap: 10px; margin: 0; }
.player { font-size: 12px; color: var(--muted); }
button.link { background: none; border: 0; color: var(--cyan); cursor: pointer; padding: 0; font: inherit; font-size: 12px; }
button.link:hover { color: #fff; background: none; }

/* ---- district bar */
.district-bar {
    max-width: 1000px;
    margin: 12px auto 0;
    padding: 8px 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: linear-gradient(100deg, rgba(17, 29, 39, .98), rgba(12, 24, 33, .94));
    border: 1px solid var(--line);
    border-left: 3px solid var(--cyan);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}
.district-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.district-name select { max-width: 100%; }
.protection-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; color: var(--ok); background: rgba(61, 220, 151, .08); border: 1px solid rgba(61, 220, 151, .35); font: 10px Consolas, monospace; }
.protection-badge .icon { width: 14px; height: 14px; color: var(--ok); }
.coords { color: var(--muted); font-weight: 400; font-family: Consolas, monospace; font-size: 12px; }
.resources { display: flex; flex-wrap: wrap; gap: 7px; font-family: Consolas, "Courier New", monospace; }
.res { display: inline-flex; align-items: center; gap: 5px; }
.res b { font-weight: 600; }
.res b.full { color: var(--error); }
.resources > .res {
    min-height: 38px;
    padding: 4px 8px;
    background: rgba(4, 13, 20, .46);
    border: 1px solid rgba(49, 89, 110, .62);
    border-radius: 4px;
}
.resources > .res:hover, .resources > .res:focus { border-color: currentColor; background: rgba(8, 22, 31, .9); }

/* ---- page & panels */
.page { max-width: 1000px; margin: 0 auto; padding: 12px 16px 40px; }

.box {
    position: relative;
    background: rgba(18, 28, 39, .94);
    border: 1px solid var(--line);
    padding: 14px 16px;
    margin-bottom: 12px;
}
.box::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 14px;
    height: 14px;
    border-top: 2px solid var(--cyan);
    border-left: 2px solid var(--cyan);
    pointer-events: none;
}
.box.narrow { max-width: 440px; margin: 40px auto; }
.box h1, .box h2 { margin: 0 0 10px; color: #fff; font-weight: 600; letter-spacing: .04em; }
.box h1 { font-size: 22px; }
.box h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--cyan);
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
    margin-top: 14px;
}
.box h2:first-child { margin-top: 0; }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.columns .box { margin-bottom: 0; }

/* ---- tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th {
    text-align: left;
    background: var(--panel-2);
    color: var(--muted);
    padding: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}
table.list td { padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
table.list tr:hover td { background: rgba(63, 208, 255, .04); }
table.list th.num, td.num { text-align: right; white-space: nowrap; font-family: Consolas, "Courier New", monospace; }
td.short { color: var(--error); }
.buildings form { margin: 0; }
form.inline { display: inline; margin: 0; }

.muted { color: var(--muted); font-size: 12px; }

/* ---- forms */
.form { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
    padding: 7px 9px;
    border: 1px solid var(--line-strong);
    background: #0c141d;
    color: var(--text);
    font: inherit;
    border-radius: 2px;
}
input:focus, select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(63, 208, 255, .2); }
input.count { width: 74px; padding: 4px 6px; text-align: right; }
.max-link { font-size: 11px; }

button {
    background: linear-gradient(180deg, #1b7fa3, var(--cyan-dim));
    color: #fff;
    border: 1px solid var(--cyan);
    padding: 6px 14px;
    font: inherit;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    border-radius: 2px;
}
button:hover { background: var(--cyan); color: #04121a; }
button.small {
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 400;
    background: transparent;
    border-color: var(--line-strong);
    color: var(--muted);
}
button.small:hover { border-color: var(--error); color: var(--error); background: transparent; }
p.actions { text-align: right; margin: 12px 0 0; }

/* ---- messages */
.flash { padding: 9px 12px; margin-bottom: 10px; border: 1px solid; border-left-width: 3px; background: var(--panel); }
.flash-ok { border-color: var(--ok); color: var(--ok); }
.flash-error { border-color: var(--error); color: var(--error); }
ul.errors { color: var(--error); padding-left: 18px; }

/* ---- guided reconstruction */
.tutorial-card {
    position: relative;
    margin-bottom: 12px;
    overflow: hidden;
    background: linear-gradient(110deg, rgba(20, 37, 47, .98), rgba(10, 23, 31, .96));
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--amber);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}
.tutorial-card.ready { border-left-color: var(--ok); }
.tutorial-card.complete { border-left-color: var(--cyan); }
.tutorial-progress { height: 3px; background: #071019; }
.tutorial-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--cyan)); box-shadow: 0 0 8px rgba(66, 215, 232, .5); }
.tutorial-main { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto auto; align-items: center; gap: 18px; padding: 13px 16px; }
.tutorial-index {
    display: grid;
    place-items: center;
    min-width: 48px;
    min-height: 48px;
    color: var(--amber);
    border: 1px solid currentColor;
    font: 700 13px Consolas, monospace;
    transform: rotate(45deg);
}
.tutorial-index > * { transform: rotate(-45deg); }
.tutorial-index .icon { width: 25px; height: 25px; }
.tutorial-copy h2 { margin: 2px 0 1px; padding: 0; border: 0; color: #fff; font-size: 17px; letter-spacing: .02em; text-transform: none; }
.tutorial-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.tutorial-reward { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 10px; font: 12px Consolas, monospace; }
.tutorial-reward .muted { grid-column: 1 / -1; font: 10px "Segoe UI", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.tutorial-reward > span:not(.muted) { display: flex; align-items: center; gap: 3px; }
.tutorial-reward .icon { width: 15px; height: 15px; }
.tutorial-action form { margin: 0; }
form.tutorial-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }

@media (max-width: 760px) {
    .tutorial-main { grid-template-columns: auto 1fr; gap: 12px; }
    .tutorial-reward, .tutorial-action { grid-column: 2; }
    .tutorial-reward { justify-content: start; }
}

/* ---- guest landing */
.guest-page .top {
    position: relative;
    z-index: 3;
    background: rgba(7, 14, 21, .9);
    backdrop-filter: blur(12px);
}
.guest-page .top-inner { max-width: 1240px; }
.guest-page .page {
    max-width: none;
    min-height: calc(100vh - 58px);
    padding: 0;
}
.login-hero {
    position: relative;
    min-height: calc(100vh - 58px);
    padding: clamp(48px, 8vw, 110px) max(24px, calc((100vw - 1200px) / 2));
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 430px);
    align-items: center;
    gap: clamp(36px, 7vw, 90px);
    isolation: isolate;
    background-image:
        linear-gradient(90deg, rgba(5, 12, 18, .94) 0%, rgba(5, 12, 18, .76) 42%, rgba(5, 12, 18, .28) 73%, rgba(5, 12, 18, .52) 100%),
        linear-gradient(0deg, rgba(5, 12, 18, .88), transparent 46%),
        var(--hero-image);
    background-position: center;
    background-size: cover;
}
.login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(66, 215, 232, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(66, 215, 232, .035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(90deg, #000, transparent 72%);
}
.login-story { max-width: 650px; text-shadow: 0 2px 24px #02070b; }
.eyebrow {
    display: inline-block;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.login-story h1 {
    margin: 16px 0 18px;
    color: #f3f8fa;
    font-size: clamp(40px, 5vw, 68px);
    line-height: 1.02;
    letter-spacing: -.035em;
    text-transform: uppercase;
}
.login-story h1 span { color: #9db5c0; }
.login-story > p { max-width: 600px; color: #c4d2d8; font-size: 17px; line-height: 1.7; }
.login-features { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.login-features span {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    color: #dce8ec;
    background: rgba(9, 22, 30, .7);
    border: 1px solid rgba(66, 215, 232, .22);
    font-size: 12px;
    letter-spacing: .04em;
    backdrop-filter: blur(8px);
}
.login-features .icon { color: var(--amber); }
.login-card {
    position: relative;
    padding: 28px;
    background: linear-gradient(155deg, rgba(19, 34, 44, .97), rgba(8, 18, 26, .95));
    border: 1px solid rgba(66, 215, 232, .34);
    border-top: 3px solid var(--cyan);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .56), inset 0 1px rgba(255, 255, 255, .025);
    backdrop-filter: blur(18px);
}
.login-card::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 42px;
    height: 42px;
    border-right: 2px solid var(--amber);
    border-bottom: 2px solid var(--amber);
    pointer-events: none;
}
.login-card-head { display: flex; align-items: center; gap: 14px; }
.login-card-head .brand-large { width: 46px; height: 46px; color: var(--cyan); }
.login-card h2 { margin: 3px 0 0; color: #fff; font-size: 23px; letter-spacing: .025em; }
.login-card .form { margin: 24px 0 17px; }
.login-card input { min-height: 43px; background: rgba(2, 10, 16, .72); }
.login-card button { min-height: 43px; text-transform: uppercase; letter-spacing: .09em; }
.login-register { margin: 0; text-align: center; color: var(--muted); }
.world-status {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 24px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.world-status span:first-child { color: var(--ok); }
.world-status i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

@media (max-width: 820px) {
    .login-hero {
        grid-template-columns: 1fr;
        align-content: center;
        background-image:
            linear-gradient(180deg, rgba(5, 12, 18, .68), rgba(5, 12, 18, .94) 58%, rgba(5, 12, 18, .98)),
            var(--hero-image);
        background-position: 67% center;
    }
    .login-story { max-width: 570px; }
    .login-card { width: 100%; max-width: 470px; }
}

@media (max-width: 520px) {
    .guest-page .top-inner { justify-content: center; }
    .login-hero { padding: 38px 16px 46px; gap: 28px; }
    .login-story h1 { font-size: 36px; }
    .login-story > p { font-size: 15px; }
    .login-features { display: none; }
    .login-card { padding: 22px 18px; }
    .world-status { flex-direction: column; }
}

/* ---- city map */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; align-items: start; }
.map-layout .box { margin-bottom: 0; }
.map-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.box h2.map-title { display: flex; align-items: center; gap: 8px; border: 0; margin: 0; padding: 0; }
.map-goto { display: flex; align-items: center; gap: 6px; margin: 0; }
.map-goto input { width: 72px; padding: 4px 6px; text-align: right; }
button.small-solid { padding: 4px 10px; font-size: 12px; }

.map-frame {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 22px;
    grid-template-rows: 22px auto 22px;
    gap: 4px;
}
.map-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    background: var(--panel-2);
    border: 1px solid var(--line);
    font-size: 11px;
    text-decoration: none;
}
.map-nav:hover { background: var(--cyan-dim); color: #fff; text-decoration: none; }
.nav-n { grid-column: 2; grid-row: 1; }
.nav-w { grid-column: 1; grid-row: 2; }
.nav-e { grid-column: 3; grid-row: 2; }
.nav-s { grid-column: 2; grid-row: 3; }
.map-grid {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: 26px repeat(var(--size), minmax(0, 1fr));
    background: #0a1017;
    border: 1px solid var(--line-strong);
}
.axis {
    display: flex;
    align-items: center;
    justify-content: center;
    font: 10px Consolas, monospace;
    color: var(--muted);
    background: var(--panel-2);
    overflow: hidden;
}
.axis-x { height: 18px; }
.cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(34, 56, 76, .55);
    border-bottom: 1px solid rgba(34, 56, 76, .55);
    padding: 0;
    margin: 0;
    min-width: 0;
}
.cell .icon { width: 62%; height: 62%; }
.t-park { background: rgba(61, 220, 151, .06); }
.t-park .icon { color: rgba(61, 220, 151, .45); }
.t-water { background: rgba(63, 160, 255, .12); }
.t-water .icon { color: rgba(63, 160, 255, .45); }
.t-ruins .icon { color: rgba(127, 149, 168, .45); }
button.cell {
    background: transparent;
    border-top: 0;
    border-left: 0;
    border-radius: 0;
    cursor: pointer;
    font: inherit;
}
button.cell.rel-own { background: rgba(63, 208, 255, .16); }
button.cell.rel-own .icon { color: var(--cyan); }
button.cell.rel-player { background: rgba(255, 181, 71, .12); }
button.cell.rel-player .icon { color: var(--amber); }
button.cell.rel-tribe { background: rgba(70, 214, 140, .14); }
button.cell.rel-tribe .icon { color: var(--ok); }
button.cell.rel-ally { background: rgba(80, 168, 255, .15); }
button.cell.rel-ally .icon { color: #62b4ff; }
button.cell.rel-nap { background: rgba(181, 124, 255, .14); }
button.cell.rel-nap .icon { color: #bd8cff; }
button.cell.rel-enemy { background: rgba(255, 100, 95, .16); }
button.cell.rel-enemy .icon { color: var(--error); }
button.cell.rel-abandoned { background: rgba(127, 149, 168, .12); }
button.cell.rel-abandoned .icon { color: var(--muted); }
button.cell.objective { box-shadow: inset 0 0 0 1px var(--amber), 0 0 10px rgba(255, 180, 84, .22); }
button.cell.objective .icon { filter: drop-shadow(0 0 4px currentColor); }
button.cell:hover { background: rgba(63, 208, 255, .3); }
button.cell.current { box-shadow: inset 0 0 0 2px var(--cyan); }
button.cell.selected { box-shadow: inset 0 0 0 2px #fff; }

.map-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12px; }
.legend { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); margin-right: 10px; }
.dot { width: 10px; height: 10px; display: inline-block; border-radius: 2px; }
.dot.rel-own { background: var(--cyan); }
.dot.rel-player { background: var(--amber); }
.dot.rel-abandoned { background: var(--muted); }
.dot.rel-tribe { background: var(--ok); }
.dot.rel-ally { background: #62b4ff; }
.dot.rel-nap { background: #bd8cff; }
.dot.rel-enemy { background: var(--error); }
.map-sizes { display: inline-flex; gap: 10px; }
.map-sizes a.active { color: #fff; font-weight: 600; }
.info-name { margin: 0 0 8px; font-size: 16px; color: #fff; }
a.coords { color: var(--muted); }
a.coords:hover { color: var(--cyan); }

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

/* ---- season */
.season-hero { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 24px; background: linear-gradient(115deg, rgba(20, 43, 51, .98), rgba(10, 18, 26, .96)); border-top: 2px solid var(--cyan); }
.season-hero h1 { margin: 5px 0 8px; font-size: 30px; text-transform: uppercase; }
.season-hero p { max-width: 660px; margin: 0; color: var(--muted); }
.season-countdown { min-width: 210px; padding-left: 22px; border-left: 1px solid var(--line-strong); text-align: right; }
.season-countdown span, .season-countdown small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.season-countdown strong { display: block; margin: 4px 0; color: var(--amber); font: 700 23px Consolas, monospace; }
.season-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.season-phase { position: relative; display: flex; gap: 10px; padding: 13px; background: rgba(13, 25, 33, .9); border: 1px solid var(--line); opacity: .62; }
.season-phase.past { opacity: .78; border-color: rgba(61, 220, 151, .35); }
.season-phase.active { opacity: 1; border-color: var(--cyan); box-shadow: inset 0 0 24px rgba(66, 215, 232, .07); }
.phase-number { display: grid; place-items: center; flex: none; width: 28px; height: 28px; color: var(--muted); border: 1px solid currentColor; font: 700 12px Consolas, monospace; transform: rotate(45deg); }
.season-phase.active .phase-number { color: var(--cyan); }
.season-phase.past .phase-number { color: var(--ok); }
.season-phase h2 { margin: 0; color: #fff; font-size: 13px; }
.season-phase p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.season-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 12px; }
.objective-list { display: grid; gap: 7px; }
.objective-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; background: rgba(5, 15, 22, .52); border: 1px solid var(--line); }
.objective-card.controlled { border-color: rgba(66, 215, 232, .4); }
.objective-card h3, .objective-card p { margin: 0; }
.objective-card h3 { color: #fff; font-size: 14px; }
.objective-card p { margin-top: 3px; font-size: 11px; }
.objective-card > strong { color: var(--amber); font: 700 14px Consolas, monospace; }
.objective-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--cyan); border: 1px solid currentColor; transform: rotate(45deg); }
.objective-icon .icon { transform: rotate(-45deg); }

/* ---- player profile and permanent badges */
.profile-head { display: flex; align-items: center; gap: 18px; padding: 22px; }
.profile-head h1 { margin: 2px 0 0; font-size: 28px; }
.profile-head p { margin: 2px 0 0; }
.profile-head > .button-link { margin-left: auto; }
.profile-emblem, .achievement-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 56px;
    height: 56px;
    color: var(--cyan);
    background: rgba(66, 215, 232, .06);
    border: 1px solid currentColor;
    transform: rotate(45deg);
}
.profile-emblem .icon, .achievement-icon .icon { transform: rotate(-45deg); }
.profile-grid { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); gap: 12px; }
.profile-stats dl { margin: 0; }
.profile-stats dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.profile-stats dt { color: var(--muted); }
.profile-stats dd { margin: 0; color: #fff; font-family: Consolas, monospace; }
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 9px; }
.achievement-card { display: flex; align-items: center; gap: 16px; padding: 14px; background: rgba(5, 15, 22, .5); border: 1px solid var(--line); }
.achievement-icon { width: 44px; height: 44px; color: var(--amber); }
.achievement-icon .icon { width: 24px; height: 24px; }
.achievement-card h3, .achievement-card p { margin: 0; }
.achievement-card h3 { color: #fff; font-size: 14px; }
.achievement-card p { margin: 3px 0; color: var(--muted); font-size: 11px; }
.achievement-card span { color: var(--amber); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }

@media (max-width: 850px) {
    .season-timeline { grid-template-columns: repeat(2, 1fr); }
    .season-columns { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .season-hero { align-items: flex-start; flex-direction: column; }
    .season-countdown { width: 100%; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); text-align: left; }
    .season-timeline { grid-template-columns: 1fr; }
}

/* ---- district in 2.5D (overview) */
.district-box {
    padding: 6px;
    overflow: hidden;
    background-image:
        linear-gradient(rgba(5, 13, 20, .68), rgba(5, 13, 20, .9)),
        url("images/aftergrid-district-concept.webp");
    background-position: center 42%;
    background-size: cover;
    box-shadow: 0 20px 55px rgba(0, 0, 0, .38);
}
.district-view {
    display: block;
    width: 100%;
    height: auto;
    background: radial-gradient(ellipse at 50% 65%, rgba(34, 70, 85, .28), rgba(3, 9, 14, .76) 72%);
}
.dv-ground { fill: #101d26; fill-opacity: .96; stroke: #396173; stroke-width: 2; }
.dv-ground-texture { fill: url(#dv-concrete); opacity: .32; }
.dv-concrete-line { stroke: #7b9aa4; stroke-width: .7; opacity: .18; }
.dv-edge { fill: #070e14; stroke: #263d4c; stroke-width: 2; }
.dv-road { fill: #17252d; stroke: #29404d; stroke-width: .6; }
.dv-road-mark { stroke: #6f8790; stroke-width: 2; stroke-dasharray: 13 15; opacity: .38; }
.dv-ruin polygon { fill: #111a20; stroke: #40505a; stroke-width: 1; opacity: .78; }
.dv-tree line { stroke: #4a3a27; stroke-width: 3; }
.dv-tree circle { fill: var(--green); stroke: #adc69b; stroke-width: 1.2; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .7)); }
.dv-shield polygon { fill: none; stroke: var(--cyan); stroke-width: 5; filter: drop-shadow(0 0 8px rgba(63, 208, 255, .9)); }
.dv-shield line { stroke: var(--cyan); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(63, 208, 255, .9)); }
.cat-civic { color: var(--cyan); }
.cat-military { color: var(--amber); }
.cat-alloy { color: var(--alloy); }
.cat-silicon { color: var(--silicon); }
.cat-energy { color: var(--energy); }
.dv-pad { fill: #13222b; fill-opacity: .82; stroke: currentColor; stroke-opacity: .2; stroke-width: 1.5; }
.dv-plot { cursor: pointer; }
.dv-building-sprite {
    pointer-events: none;
    filter: drop-shadow(0 9px 8px rgba(0, 0, 0, .62));
    transition: filter .16s ease;
}
.dv-plot:hover .dv-building-sprite,
.dv-plot.selected .dv-building-sprite {
    filter: brightness(1.12) drop-shadow(0 0 9px currentColor) drop-shadow(0 9px 8px rgba(0, 0, 0, .62));
}
.dv-face-top { fill: currentColor; fill-opacity: .38; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.dv-face-left { fill: #17242b; stroke: currentColor; stroke-opacity: .72; stroke-width: 1.5; stroke-linejoin: round; }
.dv-face-right { fill: #0b1318; stroke: currentColor; stroke-opacity: .72; stroke-width: 1.5; stroke-linejoin: round; }
.dv-floor { stroke: #ffcf7b; stroke-opacity: .62; stroke-width: 2.2; stroke-dasharray: 5 9; filter: drop-shadow(0 0 2px rgba(255, 180, 84, .42)); }
.dv-plot.tier-3 .dv-face-top { filter: drop-shadow(0 0 7px currentColor); }
.dv-plot:hover .dv-face-top { fill-opacity: .7; }
.dv-plot:hover .dv-face-left { fill-opacity: .35; }
.dv-foundation { fill: none; stroke: currentColor; stroke-opacity: .4; stroke-width: 2; stroke-dasharray: 8 7; }
.dv-plot:hover .dv-foundation { stroke-opacity: .9; }
.dv-icon { color: #f2f7f8; opacity: .78; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .8)); }
.dv-plot.tier-0 .dv-icon { color: currentColor; opacity: .4; }
.dv-detail-box polygon { stroke: currentColor; stroke-width: 1.3; }
.dv-detail-box .detail-top { fill: currentColor; fill-opacity: .62; }
.dv-detail-box .detail-left { fill: #1b2a30; }
.dv-detail-box .detail-right { fill: #0c151a; }
.dv-detail-line { stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.dv-detail-circle { fill: #0c1720; stroke: currentColor; stroke-width: 2; }
.dv-detail-polygon { stroke: currentColor; stroke-width: 1.2; }
.dv-detail-line.antenna { stroke-width: 2; }
.dv-detail-circle.signal, .dv-detail-circle.shield-emitter, .dv-detail-circle.energy-core {
    fill: var(--cyan);
    stroke: #e5fbff;
    filter: url(#dv-glow);
}
.dv-detail-line.chimney { stroke: #728088; stroke-width: 6; }
.dv-detail-circle.chimney-cap { fill: #1b2529; stroke: #a1aeb2; }
.dv-detail-line.pipe { stroke: #9b7652; stroke-width: 5; }
.dv-detail-line.yard { stroke: #d5a756; stroke-width: 2; stroke-dasharray: 8 5; }
.dv-detail-line.hangar-ridge, .dv-detail-line.gantry { stroke: #b3c3c9; stroke-width: 4; }
.dv-detail-circle.council-dome, .dv-detail-circle.lab-dome { fill: #365765; fill-opacity: .9; stroke: #a6e9ef; }
.dv-detail-line.lab-link { stroke: var(--cyan); stroke-width: 2; stroke-dasharray: 4 4; }
.dv-detail-circle.platform-ring { fill: none; stroke: #ffe0a8; stroke-width: 4; }
.dv-detail-line.platform-cross { stroke: #ffe0a8; stroke-width: 3; }
.dv-detail-line.market-strip { stroke: #ffc86e; stroke-width: 2; }
.dv-detail-line.energy-spoke { stroke: var(--cyan); stroke-width: 3; opacity: .8; }
.dv-detail-polygon.garden { fill: var(--green); fill-opacity: .88; stroke: #b8d49d; }
.dv-detail-line.bunker-slit { stroke: var(--amber); stroke-width: 3; }
.dv-detail-line.shield-pylon { stroke: #89eef7; stroke-width: 6; filter: url(#dv-glow); }
.dv-scaffold {
    fill: none;
    stroke: var(--ok);
    stroke-width: 4;
    stroke-dasharray: 10 8;
    animation: dv-scaffold 1.2s linear infinite;
    filter: drop-shadow(0 0 5px rgba(61, 220, 151, .7));
}
.dv-plot.queued .dv-building-sprite {
    animation: dv-sprite-upgrade 1.2s ease-in-out infinite alternate;
}
.type-bunker .dv-face-top, .type-bunker .dv-face-left, .type-bunker .dv-face-right { fill-opacity: .72; }
.type-habitat .dv-face-top { fill: #6f8f6a; }
.type-factory .dv-face-top, .type-alloy .dv-face-top { fill: #8d694d; }
.type-energy .dv-face-top { fill: #8e7b3e; }
.dv-overlay { pointer-events: none; }
.dv-label { fill: #eef6f7; font: 700 15px "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: .02em; text-anchor: middle; paint-order: stroke; stroke: #061018; stroke-width: 6px; }
.dv-overlay .tier-0 .dv-label { display: none; }
.dv-badge circle { fill: #0b1118; stroke: currentColor; stroke-width: 2.5; }
.dv-badge text { fill: #fff; font: 700 17px Consolas, monospace; text-anchor: middle; }
.dv-build circle { fill: #0b1118; stroke: var(--ok); stroke-width: 4; stroke-dasharray: 22 66; transform-box: fill-box; transform-origin: center; animation: dv-spin 1.6s linear infinite; }
.dv-build text { fill: var(--ok); font: 700 13px Consolas, monospace; paint-order: stroke; stroke: #0b1118; stroke-width: 4px; }
@keyframes dv-spin { to { transform: rotate(360deg); } }
@keyframes dv-scaffold { to { stroke-dashoffset: -36; } }
@keyframes dv-sprite-upgrade {
    from { filter: brightness(1.02) drop-shadow(0 0 3px rgba(61, 220, 151, .55)) drop-shadow(0 9px 8px rgba(0, 0, 0, .62)); }
    to { filter: brightness(1.14) drop-shadow(0 0 10px rgba(61, 220, 151, .95)) drop-shadow(0 9px 8px rgba(0, 0, 0, .62)); }
}
@media (prefers-reduced-motion: reduce) {
    .dv-build circle { animation: none; stroke-dasharray: none; }
    .dv-scaffold { animation: none; }
    .dv-plot.queued .dv-building-sprite {
        animation: none;
        filter: brightness(1.1) drop-shadow(0 0 7px rgba(61, 220, 151, .85)) drop-shadow(0 9px 8px rgba(0, 0, 0, .62));
    }
}

/* ---- clickable plots and the build panel */
.dv-hit { fill: transparent; pointer-events: all; }
.dv-plot:hover .dv-hit { fill: currentColor; fill-opacity: .07; stroke: currentColor; stroke-opacity: .55; stroke-width: 2; }
.dv-plot.selected .dv-hit { fill: currentColor; fill-opacity: .12; stroke: currentColor; stroke-opacity: 1; stroke-width: 3; }
.district-box { position: relative; }
.dv-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 300px;
    background: rgba(11, 17, 24, .97);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--cyan);
    padding: 14px 16px;
    box-shadow: 0 10px 30px var(--shadow);
    z-index: 2;
}
.dv-panel h3 { margin: 0 24px 2px 0; font-size: 17px; color: #fff; }
.dv-panel h2 { margin-top: 10px; }
.dv-panel p { margin: 6px 0; }
.dv-desc { font-size: 12px; color: var(--muted); }
.dv-cost { display: flex; flex-wrap: wrap; gap: 8px 14px; font-family: Consolas, "Courier New", monospace; margin: 8px 0; }
.dv-status { color: var(--amber); font-size: 12px; }
.dv-panel form { margin: 10px 0 4px; }
.dv-panel form button { width: 100%; }
.dv-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 20px;
    padding: 2px 6px;
    cursor: pointer;
}
.dv-close:hover { color: #fff; background: none; }
button[disabled], button[disabled]:hover {
    opacity: .45;
    cursor: not-allowed;
    background: linear-gradient(180deg, #1b7fa3, var(--cyan-dim));
    color: #fff;
}

/* ---- tooltips (hover on desktop, tap/focus on touch screens) */
.tip { position: relative; display: inline-flex; align-items: center; gap: 5px; outline: none; cursor: help; }
.tip-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    font: italic 700 10px Georgia, serif;
    color: var(--muted);
}
.tip:hover .tip-mark, .tip:focus .tip-mark { border-color: var(--cyan); color: var(--cyan); }
.tip-box {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 20;
    width: 290px;
    padding: 10px 12px;
    background: rgba(11, 17, 24, .98);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--cyan);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text);
    white-space: normal;
    cursor: default;
}
.tip:hover .tip-box, .tip:focus .tip-box, .tip:focus-within .tip-box { display: flex; flex-direction: column; gap: 5px; }
.tip-title { color: #fff; font-size: 13px; }
.tip-desc { color: var(--muted); }
.tip-effect { color: var(--cyan); font-family: Consolas, "Courier New", monospace; }
.tip-effect.next { color: var(--ok); }

/* ---- resource bar: name and production under each amount */
.resources .res { align-items: center; gap: 6px; }
.resources .res .icon { width: 20px; height: 20px; }
.res-text { display: flex; flex-direction: column; line-height: 1.15; }
.res-text small { font: 10px "Segoe UI", Roboto, Arial, sans-serif; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.res-text .rate { color: var(--ok); }
.resources .tip-box { left: auto; right: 0; }
.tip-effect.warn { color: var(--error); }

/* ---- laboratory */
.levels { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.pip { width: 8px; height: 8px; border: 1px solid var(--line-strong); transform: rotate(45deg); }
.pip.on { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 6px rgba(255, 181, 71, .6); }
.research .up { color: var(--ok); font-size: 11px; }

[hidden] { display: none !important; }

/* ---- war: platform, movements, reports */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--error); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.attack-alert { color: #fff; background: var(--error); padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; animation: alert-pulse 1.4s ease-in-out infinite; }
.attack-alert:hover { color: #fff; text-decoration: none; }
@keyframes alert-pulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .attack-alert { animation: none; } }
.danger-text { color: var(--error); }
.ok-text { color: var(--ok); }
button.danger { background: linear-gradient(180deg, #c0392b, #8e2a20); border-color: var(--error); }
button.danger:hover { background: var(--error); color: #fff; }
.send-target { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin: 8px 0 12px; }
.send-target label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.coords-input { display: inline-flex; align-items: center; gap: 6px; }
.coords-input input { width: 80px; text-align: right; }
.send-preview { font-family: Consolas, "Courier New", monospace; }
.send-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 12px; }
.send-actions label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.send-actions .buttons { display: flex; gap: 8px; }
.units-inline { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.unit-chip { display: inline-flex; align-items: center; gap: 3px; font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.unit-chip .icon { width: 15px; height: 15px; }
.loot { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; margin-left: 8px; font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.loot .icon { width: 14px; height: 14px; }
tr.mv-attack td:first-child { border-left: 3px solid var(--error); }
tr.mv-support td:first-child { border-left: 3px solid var(--ok); }
tr.mv-return td:first-child { border-left: 3px solid var(--cyan); }
.reports tr.unread a { font-weight: 700; color: #fff; }
.rep-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.rep-good .rep-dot { background: var(--ok); }
.rep-bad .rep-dot { background: var(--error); }
.battle-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 10px 0; }
.battle-head > div { display: flex; flex-direction: column; gap: 2px; }
.battle-head > div:last-child { text-align: right; }
.battle-head .vs { font-size: 26px; color: var(--amber); }
.battle-result { font-size: 16px; font-weight: 700; padding: 8px 12px; border-left: 3px solid; }
.battle-result.att-won { border-color: var(--amber); color: var(--amber); }
.battle-result.def-won { border-color: var(--cyan); color: var(--cyan); }
.battle-meta { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
td.lost { color: var(--error); }
a.button-link { display: inline-block; padding: 5px 12px; border: 1px solid var(--cyan); color: #fff; background: var(--cyan-dim); font-weight: 600; font-size: 13px; }
a.button-link:hover { background: var(--cyan); color: #04121a; text-decoration: none; }

/* ---- player messages */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 6px 12px; color: var(--muted); border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; font-size: 13px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: #fff; border-color: var(--line); background: var(--panel-2); }
p.errors { color: var(--error); margin: 0; }
textarea {
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    background: #0c141d;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    text-transform: none;
    letter-spacing: normal;
    border-radius: 2px;
    resize: vertical;
    min-height: 90px;
}
textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(63, 208, 255, .2); }
.form input[type=text] { text-transform: none; letter-spacing: normal; font-size: 14px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.threads th.check, .threads td.check { width: 28px; }
.threads tr.unread a { font-weight: 700; color: #fff; }
.new-dot { background: var(--cyan); }
.bulk-actions { display: flex; gap: 8px; margin-top: 10px; }
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.pager a { padding: 2px 9px; border: 1px solid var(--line); font-size: 12px; }
.pager a.active { border-color: var(--cyan); color: #fff; }
.thread-members { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg { border: 1px solid var(--line); border-left: 3px solid var(--line-strong); background: var(--panel-2); padding: 10px 12px; width: fit-content; min-width: min(100%, 320px); max-width: 85%; }
.msg.mine { border-left-color: var(--cyan-dim); margin-left: auto; }
.msg.new { border-left-color: var(--cyan); }
.msg header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.msg header time { margin-left: auto; }
.msg-body { overflow-wrap: anywhere; line-height: 1.5; }
.new-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #04121a; background: var(--cyan); padding: 0 5px; border-radius: 2px; }
.thread-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.info-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- tribes and ranking */
.tribe-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.tribe-head h1 { margin-bottom: 4px; }
.tribe-tag { color: var(--cyan); font-family: Consolas, "Courier New", monospace; font-size: .8em; }
.tribe-stats { display: flex; gap: 18px; margin: 0; }
.tribe-stats div { display: flex; flex-direction: column; align-items: flex-end; }
.tribe-stats dt { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tribe-stats dd { margin: 0; font-family: Consolas, "Courier New", monospace; font-size: 16px; color: #fff; }
.tribe-text { background: var(--panel-2); border: 1px solid var(--line); padding: 10px 12px; line-height: 1.5; overflow-wrap: anywhere; }
.edit-box { margin-top: 8px; }
.edit-box summary { cursor: pointer; color: var(--cyan); font-size: 13px; }
.leave-form { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.narrow-form { max-width: 420px; }
.check-line { flex-direction: row !important; align-items: center; gap: 8px !important; text-transform: none !important; letter-spacing: normal !important; font-size: 14px !important; color: var(--text) !important; }
fieldset.rights { border: 1px solid var(--line); padding: 8px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-chip { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 0 5px; border-radius: 2px; margin-left: 4px; }
.rank-chip.founder { background: var(--amber); color: #1a1205; }
.rank-chip.leader { border: 1px solid var(--cyan); color: var(--cyan); }
.activity { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.activity-green { background: var(--ok); }
.activity-yellow { background: var(--amber); }
.activity-red { background: var(--error); }
.right-flag { display: inline-block; width: 18px; text-align: center; font-size: 11px; color: var(--muted); opacity: .35; }
.right-flag.on { color: var(--cyan); opacity: 1; font-weight: 700; }
.legend-line { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
table.list tr.me td { background: rgba(63, 208, 255, .08); }
.nowrap { white-space: nowrap; }
table.events td:first-child { width: 1%; padding-right: 14px; }
.diplomacy-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 10px 0; }
.diplomacy-form label { display: flex; flex-direction: column; gap: 4px; min-width: 190px; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.diplomacy-rules { margin: 4px 0 14px; padding-left: 18px; color: var(--muted); font-size: 13px; }
.diplomacy-rules li { padding: 2px 0; }
.diplomacy-rules strong { color: var(--text); }
form.inline.operation-cancel { display: block; margin-top: 14px; }
.diplomacy-list { display: grid; gap: 6px; }
.diplomacy-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 11px; background: rgba(6, 16, 23, .48); border: 1px solid var(--line); border-left: 3px solid var(--muted); }
.diplomacy-row.type-ally { border-left-color: #62b4ff; }
.diplomacy-row.type-nap { border-left-color: #bd8cff; }
.diplomacy-row.type-enemy { border-left-color: var(--error); }
.diplomacy-row.pending { border-left-color: var(--amber); }

/* ---- exchange */
.market-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.market-head h1 { margin-bottom: 4px; }
.carriers { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.carriers b { color: #fff; font-family: Consolas, "Courier New", monospace; }
.carriers .icon { color: var(--cyan); }
.trade-res { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 10px 0; }
.res-input { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.res-input .with-icon { min-width: 84px; }
.offer-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 8px 0; }
.offer-line label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.res-pick { display: inline-flex; gap: 6px; }
.offer-arrow { font-size: 20px; color: var(--cyan); padding-bottom: 6px; }
input.count.tiny { width: 56px; }
.offer-tools { display: inline-flex !important; gap: 4px; align-items: center; }
.market-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.market-filter label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
tr.trade-back td { color: var(--muted); }

@media (max-width: 600px) {
    body { font-size: 13px; }
    .menu { flex-basis: 100%; order: 3; gap: 2px; }
    .menu a { padding: 4px 7px; white-space: nowrap; }
    .page, .top-inner, .district-bar { padding-left: 8px; padding-right: 8px; }
    .box { padding: 12px 8px; overflow-x: auto; }
    .resources { gap: 10px; font-size: 12px; }
    table.list td, table.list th { padding: 5px 3px; }
    table.buildings { font-size: 12px; }
    table.buildings th:nth-child(5), table.buildings td:nth-child(5) { display: none; }
    table.buildings button { padding: 4px 6px; }
    .with-icon { gap: 5px; }
    .map-grid { grid-template-columns: 20px repeat(var(--size), minmax(0, 1fr)); }
    .axis { font-size: 8px; }
    .map-goto input { width: 58px; }
    .dv-label { display: none; }
    .dv-badge circle { r: 24px; }
    .dv-badge text { font-size: 24px; }
    .district-box { padding: 4px; }
    .tip-box { position: fixed; left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; }
    .dv-panel { position: relative; top: auto; right: auto; width: auto; margin-top: 6px; box-shadow: none; }
    .msg { max-width: 100%; }
    .other-offers th:nth-child(5), .other-offers td:nth-child(5) { display: none; }
    .other-offers td:nth-child(4) .muted { display: none; }
    .own-offers th:nth-child(4), .own-offers td:nth-child(4) { display: none; }
    .tribe-stats { gap: 12px; }
    .tribe-members th:nth-child(4), .tribe-members td:nth-child(4) { display: none; }
    .tribes-ranking th:nth-child(5), .tribes-ranking td:nth-child(5), .tribes-ranking th:nth-child(6), .tribes-ranking td:nth-child(6) { display: none; }
    .players-ranking th:nth-child(5), .players-ranking td:nth-child(5) { display: none; }
}

/* ---- relics: the colour of a relic is its rarity */
.rarity-common { --rarity: var(--alloy); }
.rarity-rare { --rarity: var(--cyan); }
.rarity-legendary { --rarity: var(--amber); }
.relic-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.relic-name .icon { flex: none; width: 18px; height: 18px; color: var(--rarity); }
.relic-name a { color: #fff; }
.relic-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.rarity-chip { display: inline-block; padding: 0 5px; border: 1px solid var(--rarity); border-radius: 2px; color: var(--rarity); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.relic-status { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 12px 14px; background: rgba(5, 15, 22, .5); border: 1px solid var(--line); }
.relic-status > div { display: flex; flex-direction: column; gap: 2px; }
.relic-status b { color: #fff; font-family: Consolas, monospace; font-size: 18px; }
.relic-list td { vertical-align: top; }
.relic-send { display: inline-block; margin-left: 6px; text-align: left; }
.relic-send summary { display: inline; color: var(--cyan); font-size: 12px; cursor: pointer; }
.relic-send form { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.relic-send select { max-width: 180px; }
.relic-send .coords-input input { width: 70px; }
.relic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 9px; margin-bottom: 12px; }
.relic-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: rgba(5, 15, 22, .5); border: 1px solid var(--line); border-left: 3px solid var(--rarity); }
.relic-card > .muted { font-size: 11px; }
.relic-head { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.relic-head h1 { margin: 2px 0; }
.relic-head .relic-meta { margin: 0; }
.relic-emblem { display: grid; place-items: center; flex: none; width: 56px; height: 56px; color: var(--rarity); background: rgba(255, 255, 255, .03); border: 1px solid currentColor; transform: rotate(45deg); }
.relic-emblem .icon { transform: rotate(-45deg); }
.relic-facts { margin: 0 0 16px; }
.relic-facts > div { display: flex; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.relic-facts dt { flex: 0 0 110px; color: var(--muted); }
.relic-facts dd { margin: 0; min-width: 0; }
.relic-chronicle { margin: 0; padding-left: 20px; }
.relic-chronicle li { padding: 6px 0; border-bottom: 1px solid rgba(36, 60, 77, .5); }
.relic-chronicle time { display: block; color: var(--muted); font-family: Consolas, monospace; font-size: 11px; }
.relic-notes { margin: 0 0 8px; padding: 0; list-style: none; }
.relic-notes li { padding: 3px 0; }
.relic-notes .icon { color: var(--amber); }
.relic-line .icon { color: var(--rarity); }
button.cell { position: relative; }
.cell.district.ruin { background: rgba(255, 180, 84, .07); }
.cell.district.ruin .icon { color: rgba(255, 180, 84, .8); }
.legend-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 2px; }
.legend-icon .icon { width: 13px; height: 13px; }
.legend-ruin { background: rgba(255, 180, 84, .12); }
.legend-ruin .icon { color: rgba(255, 180, 84, .8); }
.legend-rubble .icon { color: rgba(127, 149, 168, .55); }
.legend-core { box-shadow: inset 0 0 0 1px var(--amber); }
.legend-core .icon { color: var(--energy); }
.legend-relic { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: var(--amber); box-shadow: 0 0 6px var(--amber); transform: rotate(45deg); }
.relic-marker { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; background: var(--amber); box-shadow: 0 0 6px var(--amber); transform: rotate(45deg); }

@media (max-width: 560px) {
    .relic-head { gap: 12px; }
    .relic-emblem { width: 44px; height: 44px; }
    .relic-facts > div { flex-direction: column; gap: 2px; }
    .relic-facts dt { flex: none; }
    .relic-list td.num { white-space: normal; }
}
.tutorial-relic { grid-column: 1 / -1; color: var(--amber); }

/* ---- expeditions */
.expedition-steps { display: flex; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; counter-reset: step; }
.expedition-steps li { flex: 1; padding: 6px 10px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.expedition-steps li.current { border-color: var(--cyan); color: var(--cyan); }
.expedition-steps li.done { border-color: var(--line-strong); color: var(--text); background: rgba(66, 215, 232, .06); }
.expedition-status { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 10px 0; padding: 10px 12px; background: rgba(5, 15, 22, .5); border: 1px solid var(--line); }
.expedition-status > div { display: flex; flex-direction: column; gap: 3px; }
.expedition-decision { margin: 12px 0; padding: 12px; border: 1px solid var(--amber); background: rgba(255, 180, 84, .05); }
.expedition-decision p { margin: 0 0 8px; }
.expedition-decision form { display: flex; flex-wrap: wrap; gap: 8px; }
.expedition-log { margin: 0; padding-left: 20px; }
.expedition-log li { padding: 6px 0; border-bottom: 1px solid rgba(36, 60, 77, .5); }
.expedition-log li.fail > b { color: var(--error); }
.expedition-log li.ok > b { color: var(--ok); }
.expedition-log p { margin: 3px 0; }
.with-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 3px 0; }
.expedition-templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; margin-bottom: 12px; }
.expedition-card { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(5, 15, 22, .5); cursor: pointer; }
.expedition-card:has(input:checked) { border-color: var(--cyan); background: rgba(66, 215, 232, .06); }
.expedition-card-body { display: flex; flex-direction: column; gap: 3px; }
.expedition-card-body .muted { font-size: 12px; }
.expedition-facts { color: var(--amber); font-size: 11px; }
.expedition-squad { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 8px; }
.cell.district.echo { background: rgba(255, 100, 95, .12); }
.cell.district.echo .icon { color: rgba(255, 120, 110, .9); }
.legend-echo { background: rgba(255, 120, 110, .9); }

@media (max-width: 560px) {
    .expedition-steps li { padding: 5px 6px; font-size: 10px; letter-spacing: .02em; }
}

/* ---- unit tooltips: the chips in reports show the tooltip without the (i) mark */
.units-inline .unit-tip { gap: 0; }
.units-inline .unit-tip .tip-mark { display: none; }
.unit-tip .tip-box { min-width: 260px; }

/* ---- the Ecoul on the map: threat, outposts, convoys, patrols */
.threat { display: flex; flex-direction: column; gap: 8px; }
.threat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.threat-value { font-family: Consolas, monospace; font-size: 18px; }
.threat-0 { color: var(--ok); } .threat-1 { color: var(--amber); } .threat-2 { color: #ff8a5c; } .threat-3, .threat-4 { color: var(--error); }
.threat-bar { position: relative; height: 10px; background: rgba(5, 15, 22, .7); border: 1px solid var(--line); }
.threat-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--amber) 50%, var(--error)); }
.threat-bar i { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.threat-chip { padding: 2px 8px; border: 1px solid currentColor; font-size: 12px; white-space: nowrap; }
.threat-chip:hover { text-decoration: none; }
.director-rules { margin: 0 0 10px; padding-left: 18px; }
.director-rules li { padding: 3px 0; }
.jam-badge { padding: 2px 8px; border: 1px solid var(--error); color: var(--error); font-size: 12px; }
.cell.district.ecoul-outpost { background: rgba(255, 100, 95, .18); }
.cell.district.ecoul-convoy { background: rgba(255, 180, 84, .16); }
.cell.district.ecoul-fortress { background: rgba(255, 100, 95, .34); box-shadow: inset 0 0 0 1px rgba(255, 100, 95, .7); }
.fortress-bar { height: 8px; margin: 6px 0 4px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.fortress-bar span { display: block; height: 100%; background: var(--error); }
.project-bar span { background: var(--ok); }
.cell.exile-convoy { background: rgba(189, 140, 255, .18); }
.cell.exile-convoy .icon { color: #bd8cff; }
.cell.exile-convoy.current { box-shadow: inset 0 0 0 2px #bd8cff; }
.dot.exile-dot { background: #bd8cff; }
.war-score { display: flex; justify-content: center; align-items: baseline; gap: 18px; margin: 10px 0; font-size: 18px; }
.war-score b { font-size: 24px; color: var(--text); }
.war-objectives td:first-child { width: 28px; }
.box.war.state-active { border-left: 3px solid var(--error); }
.box.war.state-declared { border-left: 3px solid var(--amber); }
.cell.district.ecoul-convoy .icon { color: var(--amber); }
@media (max-width: 560px) {
    .col-defense { display: none; }
}
.objective-disrupted { grid-column: 1 / -1; font-size: 12px; }

/* ---- the Recuperatorii */
.cell.district.scav-camp { background: rgba(61, 220, 151, .14); }
.cell.district.scav-camp .icon { color: var(--ok); }
.legend-scav { background: var(--ok); }
.cell.district.guard-column { background: rgba(232, 193, 90, .2); box-shadow: inset 0 0 0 1px rgba(232, 193, 90, .75); }
.cell.district.guard-column .icon { color: #e8c15a; }
.legend-guard { background: #e8c15a; }
.cell.district.black-garden { background: rgba(120, 60, 150, .26); box-shadow: inset 0 0 0 1px rgba(160, 90, 200, .7); }
.cell.district.black-garden .icon { color: #c08ae0; }
.legend-garden { background: #9a5fc4; }
.map-grid .cell.route-road { box-shadow: inset 0 0 0 999px rgba(201, 174, 130, .16); background-image: linear-gradient(rgba(201, 174, 130, .55), rgba(201, 174, 130, .55)); background-size: 100% 3px; background-position: center; background-repeat: no-repeat; }
.map-grid .cell.route-bridge { box-shadow: inset 0 0 0 999px rgba(150, 160, 170, .2); background-image: repeating-linear-gradient(90deg, rgba(190, 200, 210, .7) 0 3px, transparent 3px 6px); background-size: 100% 40%; background-position: center; background-repeat: no-repeat; }
.map-grid .cell.route-tunnel { box-shadow: inset 0 0 0 2px rgba(170, 140, 255, .7); background-image: radial-gradient(circle, rgba(20, 16, 30, .95) 0 26%, rgba(170, 140, 255, .35) 28% 36%, transparent 38%); }
.map-grid .cell.route-building { outline: 1px dashed rgba(255, 197, 71, .8); outline-offset: -3px; }
.map-grid .cell.route-destroyed { background-image: linear-gradient(45deg, transparent 46%, rgba(255, 100, 95, .7) 46% 54%, transparent 54%); }
.legend-line.route-road { background: rgba(201, 174, 130, .9); }
.legend-line.route-bridge { background: repeating-linear-gradient(90deg, rgba(190, 200, 210, .9) 0 3px, transparent 3px 6px); }
.dot.route-tunnel { background: rgba(170, 140, 255, .9); }
.box.guard.state-siege { border-left: 3px solid var(--error); }
.box.guard.state-marching { border-left: 3px solid #e8c15a; }
.scav-standing { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 10px 12px; background: rgba(5, 15, 22, .5); border: 1px solid var(--line); }
.scav-standing > div { display: flex; flex-direction: column; gap: 2px; }
.scav-standing b { color: #fff; font-family: Consolas, monospace; font-size: 16px; }
.scav-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.scav-forms form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.scav-log { margin: 0; padding-left: 18px; }
.scav-log li { padding: 3px 0; }

/* ---- the Living Network: corridors, relays, contaminated zones */
.map-grid .cell.corridor-on { background-image: radial-gradient(circle, rgba(255, 197, 71, .75) 0 13%, rgba(255, 197, 71, .18) 15% 34%, transparent 38%); }
.map-grid .cell.corridor-off { background-image: radial-gradient(circle, rgba(131, 153, 165, .55) 0 11%, transparent 14%); }
.map-grid .cell.zone-announced { background-image: repeating-linear-gradient(135deg, rgba(255, 180, 84, .28) 0 3px, transparent 3px 8px); }
.map-grid .cell.zone-active { background-image: repeating-linear-gradient(135deg, rgba(176, 214, 72, .38) 0 4px, rgba(176, 214, 72, .12) 4px 8px); }
.map-grid .cell.zone-trace { background-image: radial-gradient(circle at 40% 60%, rgba(96, 86, 64, .5), rgba(60, 54, 44, .22) 70%); }
.cell.district.relay { box-shadow: inset 0 0 0 1px rgba(255, 197, 71, .55); }
.cell.district.relay .icon { filter: drop-shadow(0 0 3px rgba(255, 197, 71, .7)); }
.cell.district.relay.rel-abandoned .icon { color: var(--energy); }
.dot.legend-relay { background: var(--energy); }
.dot.zone-active { background: rgba(176, 214, 72, .8); }
.dot.zone-trace { background: rgba(110, 98, 74, .9); }
.legend-line { display: inline-block; width: 16px; height: 4px; border-radius: 2px; }
.legend-line.corridor-on { background: var(--energy); }
.legend-line.corridor-off { background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 6px); }
.grid-chip { color: var(--energy); }
.grid-rules { margin: 0 0 10px; padding-left: 18px; }
.grid-rules li { padding: 3px 0; }
.corridor-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.corridor-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: rgba(5, 15, 22, .52); border: 1px solid var(--line); border-left: 3px solid var(--energy); }
.corridor-card.state-reserve { border-left-color: var(--amber); }
.corridor-card.state-cut { border-left-color: var(--error); }
.corridor-card h3 { margin: 0; color: #fff; font-size: 15px; }
.corridor-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; }
.corridor-state { font-size: 12px; padding: 1px 8px; border: 1px solid currentColor; white-space: nowrap; }
.corridor-state.state-connected { color: var(--ok); }
.corridor-state.state-reserve { color: var(--amber); }
.corridor-state.state-cut { color: var(--error); }
.corridor-output { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); }
.corridor-output b { color: var(--text); font-family: Consolas, monospace; }
.relay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 8px 0; border-top: 1px solid rgba(36, 60, 77, .6); }
.relay-row .muted { font-size: 12px; }
.integrity-bar { grid-column: 1 / -1; height: 6px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.integrity-bar span { display: block; height: 100%; background: var(--energy); }
.integrity-bar.low span { background: var(--error); }
.relay-row form { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.relay-row select { max-width: 100%; }
.relay-pass { font-size: 12px; }
.zone-badge { padding: 2px 8px; border: 1px solid rgba(176, 214, 72, .9); color: rgb(196, 230, 96); font-size: 12px; }
.zone-list td form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.warn-text { color: var(--amber); }

/* ---- population, morale and refugees */
.civic-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
@media (max-width: 720px) { .civic-head { grid-template-columns: minmax(0, 1fr); } }
.civic-gauge { display: flex; flex-direction: column; gap: 6px; }
.civic-value { font: 700 40px/1 Consolas, monospace; }
.civic-0 { color: var(--error); } .civic-1 { color: #ff8a5c; } .civic-2 { color: var(--amber); } .civic-3 { color: var(--ok); }
.civic-bar { position: relative; height: 10px; background: rgba(5, 15, 22, .7); border: 1px solid var(--line); }
.civic-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--error), var(--amber) 50%, var(--ok)); }
.civic-bar.shelter span { background: var(--cyan); }
.civic-bar i { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.civic-factors td:first-child { width: 80%; }
.civic-effects { margin-top: 12px; }
.civic-chip { padding: 2px 8px; border: 1px solid currentColor; font-size: 12px; white-space: nowrap; }
.civic-chip:hover { text-decoration: none; }
.refugee-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.refugee-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: rgba(5, 15, 22, .52); border: 1px solid var(--line); border-left: 3px solid var(--cyan); }
.refugee-card h3 { margin: 0; color: #fff; font-size: 15px; }
.refugee-card p { margin: 0; }
.refugee-card form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.refugee-card select { max-width: 100%; }

/* ---- constitution, votes, treasury of a coalition */
.constitution-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin: 12px 0; }
@media (max-width: 720px) { .constitution-head { grid-template-columns: minmax(0, 1fr); } }
.constitution-head h2 { margin: 2px 0 6px; }
.constitution-people { padding: 10px 12px; background: rgba(5, 15, 22, .52); border: 1px solid var(--line); }
.constitution-people p { margin: 4px 0; }
.constitution-models { margin: 8px 0; font-size: 12px; }
.constitution-models p { margin: 3px 0; }
.constitution-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 8px 14px; margin: 10px 0; }
.vote-items td:last-child label { margin-left: 8px; }
.vote-closed { padding: 8px 0; border-top: 1px solid rgba(36, 60, 77, .6); }
.vote-closed h3 { margin: 0 0 4px; font-size: 14px; }
.vote-closed ul { margin: 0; padding-left: 18px; }
.vote-result-passed b, .vote-result-elected b { color: var(--ok); }
.vote-result-failed b { color: var(--muted); }
.vote-result-error b { color: var(--amber); }
.treasury-balance { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 12px 0; padding: 10px 12px; background: rgba(5, 15, 22, .5); border: 1px solid var(--line); }
.treasury-balance > div { display: flex; align-items: center; gap: 6px; }
.treasury-balance b { color: #fff; font-family: Consolas, monospace; font-size: 16px; }
.war-objectives input, .war-objectives select { width: 100%; max-width: 100%; }
@media (max-width: 640px) {
    .war-objectives, .war-objectives tbody, .war-objectives tr, .war-objectives td { display: block; width: 100%; }
    .war-objectives tr:first-child { display: none; }
    .war-objectives tr { padding: 6px 0; border-bottom: 1px solid var(--line); }
    .war-objectives td { border: 0; padding: 2px 0; }
}

/* ---- doctrines and contracts */
.doctrine-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.doctrine-card h2 { margin-top: 0; }
.doctrine-card.current { border-color: var(--ok); }
.doctrine-card.next { border-color: var(--amber); }
.doctrine-effects { margin: 8px 0; padding-left: 18px; }
.doctrine-effects li { padding: 2px 0; }
.doctrine-chip { color: var(--cyan); }
.contract-form fieldset { border: 1px solid var(--line); padding: 8px 10px; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.contract-form fieldset[hidden] { display: none; }
.contract-list td { vertical-align: top; }
.contract-list select { max-width: 160px; }
@media (max-width: 640px) {
    .contract-list, .contract-list tbody, .contract-list tr, .contract-list td { display: block; width: 100%; }
    .contract-list tr:first-child { display: none; }
    .contract-list tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
    .contract-list td { border: 0; padding: 2px 0; text-align: left; }
}

/* ---- the chronicle of the season, monuments */
.chronicle-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.chronicle-filters input { width: 110px; }
.chronicle-day { margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
.chronicle-list { list-style: none; margin: 0; padding: 0; }
.chronicle-entry { display: grid; grid-template-columns: 46px 40px minmax(0, 1fr); gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid rgba(36, 60, 77, .6); }
.chronicle-entry p { margin: 3px 0 0; font-size: 13px; }
.chronicle-entry.importance-3 b { color: #fff; }
.chronicle-entry.importance-1 b { font-weight: 500; }
.chronicle-time { color: var(--muted); font: 12px Consolas, monospace; }
.chronicle-stars { color: var(--amber); font-size: 12px; white-space: nowrap; }
.chronicle-kind { font-size: 11px; margin-left: 6px; }
.chronicle-links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 12px; }
.map-grid .cell.monument { background: rgba(255, 180, 84, .1); }
.map-grid .cell.monument .icon { color: var(--amber); }
.map-grid .cell.wreck { background: rgba(110, 98, 74, .35); }
.map-grid .cell.wreck .icon { color: #b8a27a; }
.dot.legend-monument { background: var(--amber); }
@media (max-width: 560px) { .chronicle-entry { grid-template-columns: 40px minmax(0, 1fr); } .chronicle-stars { display: none; } }

/* ---- the story of the season */
.story-current { padding: 12px; margin-bottom: 12px; background: rgba(5, 15, 22, .52); border: 1px solid var(--line); border-left: 3px solid var(--amber); }
.story-current h3 { margin: 4px 0 6px; color: #fff; }
.story-history { margin: 0 0 12px; padding-left: 18px; font-size: 13px; }
.story-history li.current { color: #fff; }
.story-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 10px; margin-bottom: 10px; }
.story-branch { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: rgba(5, 15, 22, .52); border: 1px solid var(--line); cursor: pointer; }
.story-branch.eligible { border-color: var(--ok); }
.story-branch:has(input:checked) { box-shadow: inset 0 0 0 1px var(--cyan); }
.story-branch-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.story-condition { font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.story-effects { font-size: 12px; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.map-grid .cell.ambush { box-shadow: inset 0 0 0 2px rgba(255, 100, 95, .85); background-image: radial-gradient(circle, rgba(255, 100, 95, .8) 0 14%, transparent 17%); }
.dot.legend-ambush { background: rgba(255, 100, 95, .9); }
.intel-exact { color: var(--ok); }
.intel-approx { color: var(--amber); }
.intel-stale { color: var(--muted); }
.route-form label { display: inline-flex; align-items: center; gap: 4px; }
.route-form input[type=number] { width: 72px; }
.reputation-good { color: var(--ok); }
.reputation-neutral { color: var(--muted); }
.reputation-bad { color: var(--error); }
.calendar td:first-child { width: 150px; }
.calendar-assault td:last-child, .calendar-guard td:last-child { color: var(--amber); }
.calendar-war td:last-child { color: var(--error); }
.forum-topics tr.unread td:first-child { border-left: 3px solid var(--cyan, #3fd6e0); }
.forum-posts { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.forum-post { border: 1px solid var(--line); padding: 10px 12px; background: rgba(255, 255, 255, .02); }
.forum-post header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.forum-body { overflow-wrap: anywhere; }
.mentor-card { margin: 10px 0; }
.mentor-districts { margin: 4px 0 8px 18px; }
.tutorial-mentor { margin: 0 0 8px; }

/* Registration: the friend in a dangerous sector */
.error-text { color: var(--error); }
.friend-note { margin: -6px 0 0; }
.friend-risk { border: 1px solid var(--error); background: rgba(255, 100, 95, .08); padding: 10px 12px; }

/* Recuperatorii: what the camp looks for, and the trade calculation */
.scav-need { display: inline-block; margin: 2px 8px 2px 0; padding: 1px 6px; border: 1px solid var(--line); }
.scav-need-caută { border-color: var(--ok); color: var(--ok); }
.scav-need-are-din-belșug { border-color: var(--amber); color: var(--amber); }
.scav-preview { color: var(--cyan); font-size: 13px; margin: 8px 0 0; }

/* Bug reports: a small "!" in the corner, a dialog with the page's reports and the form */
.bug-corner { position: fixed; right: 10px; bottom: 10px; z-index: 60; }
.bug-button { position: relative; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); font: 700 13px/22px "Segoe UI", sans-serif; text-transform: none; letter-spacing: 0; opacity: .5; cursor: pointer; box-shadow: none; }
.bug-button:hover, .bug-button:focus-visible { opacity: 1; color: var(--amber); border-color: var(--amber); }
.bug-count { position: absolute; top: -7px; right: -9px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--amber); color: #111; font: 700 10px/16px "Segoe UI", sans-serif; text-align: center; }
.bug-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 18px 20px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); }
.bug-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.bug-dialog h2 { margin: 0 28px 10px 0; font-size: 17px; }
.bug-dialog h3 { margin: 16px 0 4px; font-size: 14px; }
.bug-close-form { position: absolute; top: 8px; right: 10px; margin: 0; }
.bug-close { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; padding: 2px 6px; cursor: pointer; box-shadow: none; }
.bug-close:hover { color: var(--text); }
.bug-list { margin: 0 0 6px; padding-left: 18px; }
.bug-list li { margin: 3px 0; }
.bug-form textarea { font: inherit; text-transform: none; letter-spacing: normal; }

/* Build queue in a narrow box (District page): two lines per building */
.queue-compact { list-style: none; margin: 0 0 10px; padding: 0; }
.queue-compact li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.queue-compact .queue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 13px; }
.queue-compact .queue-meta form { margin-left: auto; }
.queue-time { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.queue-time .icon { width: 14px; height: 14px; color: var(--cyan); }
.queue-time.muted .icon { color: var(--muted); }
