/* ==========================================================================
   FALESC — Sunset Riso Deco
   Tokens, scene, chrome and screen styles. No external assets or imports.
   ========================================================================== */

@font-face {
    font-family: 'Fraunces';
    src: url('../assets/fonts/fraunces-variable-latin.woff2') format('woff2');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Jost';
    src: url('../assets/fonts/jost-variable-latin.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Space Mono';
    src: url('../assets/fonts/space-mono-400-latin.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Space Mono';
    src: url('../assets/fonts/space-mono-700-latin.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #211225;
    --ink-soft: #4b2a48;
    --plum: #3a163c;
    --plum-deep: #1c0d24;
    --wine: #7d2148;
    --rose: #c73d61;
    --coral: #ff6b5e;
    --coral-deep: #e34f57;
    --bubblegum: #ff4f9a;
    --peach: #ffa07a;
    --sun: #ffd36e;
    --paper: #fff2d8;
    --paper-warm: #f3d9ae;
    --cream: #fff8ea;
    --mint: #59e3c2;
    --mint-soft: #a8f5dc;
    --cyan: #36c6d9;
    --lavender: #c9b6ff;

    --display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --ui: 'Jost', 'Trebuchet MS', sans-serif;
    --mono: 'Space Mono', 'Courier New', monospace;

    --shadow-hard: 5px 5px 0 var(--ink);
    --shadow-soft: 10px 12px 0 rgba(28, 13, 36, 0.34);
    --border: 2px solid var(--ink);
    --radius: 3px;

    --pad: clamp(16px, 2vw, 28px);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--plum-deep);
}

body {
    color: var(--ink);
    font-family: var(--ui);
    font-weight: 400;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    border-radius: 0;
}

::selection {
    background: var(--bubblegum);
    color: var(--cream);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Renderer canvas sits over the illustrated sea and under every DOM screen. */
body > canvas {
    position: fixed !important;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100vw !important;
    height: 100vh !important;
    touch-action: none;
}

/* ==========================================================================
   The Glass Sea — a warm nebula void
   ========================================================================== */

.world-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--plum-deep);
}

.scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    filter:
        saturate(calc(1 - var(--tide-progress, 0) * 0.18))
        brightness(calc(1 - var(--tide-progress, 0) * 0.12));
    transition: filter 1.8s ease;
}

.scene__stars {
    animation: star-twinkle 18s ease-in-out infinite alternate;
}

.scene__stars--bright {
    animation: star-twinkle 11s ease-in-out infinite alternate-reverse;
}

.scene__aurora {
    animation: aurora-drift 90s linear infinite alternate;
}

.scene__planet {
    animation: planet-drift 120s ease-in-out infinite alternate;
}

.scene__shards {
    animation: shard-drift 70s ease-in-out infinite alternate;
}

.scene__shards--distant {
    animation: shard-drift 100s ease-in-out infinite alternate-reverse;
}

.world-backdrop__grain {
    position: absolute;
    inset: -50%;
    pointer-events: none;
    opacity: 0.13;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    mix-blend-mode: soft-light;
}

.world-backdrop__vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: calc(0.86 + var(--tide-progress, 0) * 0.22);
    background:
        radial-gradient(ellipse at 62% 48%, transparent 30%, rgba(28, 13, 36, 0.34) 78%, rgba(20, 10, 29, 0.76) 100%),
        linear-gradient(180deg, rgba(20, 10, 29, 0.4) 0%, transparent 20%, transparent 80%, rgba(20, 10, 29, 0.5) 100%);
}

@keyframes star-twinkle {
    from { opacity: 0.72; }
    to { opacity: 1; }
}

@keyframes aurora-drift {
    from { transform: translateX(-18px) translateY(4px); }
    to { transform: translateX(26px) translateY(-6px); }
}

@keyframes planet-drift {
    from { transform: translate(-4px, 3px); }
    to { transform: translate(8px, -5px); }
}

@keyframes shard-drift {
    from { transform: translate(0, 0); }
    to { transform: translate(12px, -8px); }
}

/* ==========================================================================
   Shared type and chrome
   ========================================================================== */

.screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.kicker {
    margin: 0;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    width: 26px;
    height: 2px;
    background: currentColor;
}

.display {
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 100;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 0.92;
}

.paper {
    position: relative;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    color: var(--ink);
}

.paper--dark {
    background: var(--plum);
    border-color: var(--ink);
    color: var(--cream);
}

.diamond-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
}

.diamond-rule::before,
.diamond-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.35;
}

.diamond-rule span {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    --btn-bg: var(--paper);
    --btn-fg: var(--ink);
    --btn-shadow: var(--ink);

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 22px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--btn-shadow);
    font-family: var(--ui);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-align: center;
    cursor: pointer;
    transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
    user-select: none;
}

.btn:hover:not(:disabled) {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 var(--btn-shadow);
    background: color-mix(in srgb, var(--btn-bg) 92%, var(--cream));
}

.btn:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--btn-shadow);
}

.btn:focus-visible {
    outline: 3px solid var(--wine);
    outline-offset: 3px;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    filter: saturate(0.5);
    box-shadow: 4px 4px 0 rgba(33, 18, 37, 0.45);
}

.btn--primary {
    --btn-bg: var(--coral);
    --btn-fg: var(--ink);
}

.btn--magenta {
    --btn-bg: var(--bubblegum);
    --btn-fg: var(--ink);
}

.btn--mint {
    --btn-bg: var(--mint);
    --btn-fg: var(--ink);
}

.btn--ink {
    --btn-bg: var(--ink);
    --btn-fg: var(--cream);
    --btn-shadow: var(--wine);
}

.btn--paper {
    --btn-bg: var(--paper);
    --btn-fg: var(--ink);
}

.btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--cream);
    --btn-shadow: transparent;
    border-color: currentColor;
    box-shadow: none;
    min-height: 42px;
    padding: 8px 14px;
}

.btn--ghost:hover:not(:disabled) {
    background: rgba(255, 248, 234, 0.12);
    box-shadow: none;
    transform: none;
}

.btn--small {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 13px;
    box-shadow: 3px 3px 0 var(--btn-shadow);
}

.btn--wide {
    width: 100%;
}

.btn__arrow {
    font-family: var(--mono);
    font-size: 16px;
    line-height: 1;
    transition: transform 160ms var(--ease);
}

.btn:hover .btn__arrow {
    transform: translateX(3px);
}

/* ==========================================================================
   Menu
   ========================================================================== */

.screen--menu {
    display: none;
    align-items: center;
    padding: clamp(24px, 6vw, 88px);
    background:
        linear-gradient(90deg, rgba(28, 13, 36, 0.76) 0%, rgba(28, 13, 36, 0.34) 42%, transparent 68%),
        linear-gradient(0deg, rgba(28, 13, 36, 0.5) 0%, transparent 42%);
}

.screen--menu::after {
    /* a restrained deco corner, drawn in CSS */
    content: '';
    position: absolute;
    right: clamp(20px, 4vw, 56px);
    top: clamp(20px, 4vw, 56px);
    width: clamp(68px, 8vw, 110px);
    height: clamp(68px, 8vw, 110px);
    border-top: 2px solid rgba(255, 248, 234, 0.55);
    border-right: 2px solid rgba(255, 248, 234, 0.55);
    pointer-events: none;
}

.menu__inner {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    margin-top: 8vh;
}

.menu__eyebrow {
    color: var(--peach);
    margin-bottom: 18px;
}

.menu__eyebrow::before {
    background: var(--coral);
}

.menu__title {
    margin: 0;
    color: var(--cream);
    font-family: var(--display);
    font-variation-settings: 'SOFT' 70, 'WONK' 1, 'opsz' 144;
    font-size: clamp(84px, 14vw, 196px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 0.78;
    text-shadow:
        5px 5px 0 var(--wine),
        9px 9px 0 rgba(28, 13, 36, 0.55);
}

.menu__title .prism {
    display: inline-block;
    color: var(--mint);
    transform: translateY(-0.06em) rotate(-8deg);
    text-shadow:
        5px 5px 0 var(--wine),
        9px 9px 0 rgba(28, 13, 36, 0.55);
}

.menu__tagline {
    max-width: 470px;
    margin: 26px 0 32px;
    color: var(--cream);
    font-family: var(--display);
    font-variation-settings: 'SOFT' 80, 'WONK' 1, 'opsz' 32;
    font-size: clamp(19px, 2.1vw, 27px);
    font-weight: 450;
    line-height: 1.28;
    text-shadow: 0 2px 18px rgba(28, 13, 36, 0.5);
}

.menu__tagline em {
    color: var(--mint-soft);
    font-style: italic;
}

.menu__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.menu__meta {
    position: absolute;
    right: clamp(24px, 5vw, 70px);
    bottom: clamp(24px, 4vw, 52px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    color: rgba(255, 248, 234, 0.7);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-align: right;
    z-index: 2;
}

.menu__version {
    color: var(--coral);
}

.menu__aside {
    position: absolute;
    right: clamp(24px, 5vw, 72px);
    top: 18vh;
    width: min(230px, 20vw);
    padding: 18px 18px 16px;
    transform: rotate(1.6deg);
    z-index: 2;
}

.menu__aside p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

.menu__aside .kicker {
    color: var(--wine);
}

.menu__aside-stamp {
    position: absolute;
    right: -12px;
    top: -16px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    background: var(--mint);
    border: var(--border);
    border-radius: 50%;
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 700;
    transform: rotate(-10deg);
}

/* ==========================================================================
   Lobby
   ========================================================================== */

.screen--lobby {
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 56px);
    overflow-y: auto;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 20%, rgba(28, 13, 36, 0.36) 100%);
}

.lobby__wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(300px, 0.94fr);
    width: min(1080px, 100%);
    max-height: none;
    gap: clamp(18px, 3vw, 34px);
    align-items: stretch;
}

.lobby__sheet {
    padding: clamp(20px, 2.4vw, 34px);
    overflow: auto;
}

.lobby__title {
    margin: 6px 0 8px;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 72;
    font-size: clamp(38px, 5vw, 62px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.lobby__lede {
    max-width: 38ch;
    margin: 0 0 16px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.5;
}

.lobby__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field__label {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.field__hint {
    color: var(--ink-soft);
    font-size: 12px;
}

.seed-row {
    display: flex;
    gap: 8px;
}

.input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--cream);
    border: var(--border);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 14px;
    box-shadow: inset 2px 2px 0 rgba(33, 18, 37, 0.12);
}

.input:focus-visible {
    outline: 3px solid var(--wine);
    outline-offset: 2px;
}

.input::placeholder {
    color: rgba(75, 42, 72, 0.55);
}

.size-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
    margin: 0;
    border: 0;
}

.size-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 84px;
    padding: 10px 12px;
    background: var(--cream);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 150ms var(--ease), background 150ms var(--ease), box-shadow 150ms var(--ease);
}

.size-card:hover {
    transform: translateY(-2px);
    box-shadow: 2px 2px 0 var(--ink);
}

.size-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.size-card__glyph {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 26px;
}

.size-card__glyph i {
    display: block;
    width: 11px;
    height: 11px;
    background: var(--paper-warm);
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    transform: scale(var(--s, 1));
}

.size-card__glyph i:nth-child(2) { --s: 1.35; background: var(--mint-soft); }
.size-card__glyph i:nth-child(3) { --s: 0.8; background: var(--peach); }

.size-card__name {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.size-card__meta {
    color: var(--ink-soft);
    font-size: 11px;
}

.size-card:has(input:checked) {
    background: var(--mint-soft);
    box-shadow: 3px 3px 0 var(--ink);
    transform: translate(-1px, -1px);
}

.size-card:has(input:focus-visible) {
    outline: 3px solid var(--wine);
    outline-offset: 2px;
}

.lobby__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.lobby__chart {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(20px, 3vw, 32px);
    overflow: hidden;
    background:
        linear-gradient(160deg, rgba(89, 227, 194, 0.12), transparent 45%),
        var(--plum);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    color: var(--cream);
}

.lobby__chart::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255, 242, 216, 0.2);
    pointer-events: none;
}

.lobby__chart-head {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    z-index: 1;
}

.lobby__chart-head .kicker {
    color: var(--mint);
}

.chart-badge {
    padding: 4px 8px;
    border: 1px solid rgba(255, 242, 216, 0.45);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
}

.chart-illustration {
    position: relative;
    flex: 1;
    min-height: 220px;
    margin: 16px -6px;
}

.chart-illustration svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.chart-compass {
    position: absolute;
    right: 2px;
    bottom: 2px;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    color: var(--paper);
    border: 1px solid rgba(255, 242, 216, 0.45);
    border-radius: 50%;
    font-family: var(--mono);
    font-size: 9px;
}

.chart-compass::before,
.chart-compass::after {
    content: '';
    position: absolute;
    background: rgba(255, 242, 216, 0.45);
}

.chart-compass::before {
    width: 1px;
    height: 100%;
}

.chart-compass::after {
    width: 100%;
    height: 1px;
}

.chart-readout {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 242, 216, 0.22);
    z-index: 1;
}

.chart-readout dt {
    color: rgba(255, 242, 216, 0.56);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.chart-readout dd {
    margin: 2px 0 0;
    font-family: var(--display);
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
}

.lobby__back {
    position: absolute;
    top: clamp(16px, 3vw, 30px);
    left: clamp(16px, 3vw, 30px);
    z-index: 3;
}

/* ==========================================================================
   In-game HUD
   ========================================================================== */

.screen--hud {
    display: none;
    pointer-events: none;
    z-index: 100;
}

.screen--hud .hud__top,
.screen--hud .hud__bottom,
.screen--hud .objective-card,
.screen--hud .hud__hint {
    pointer-events: auto;
}

.hud__top {
    position: absolute;
    top: 16px;
    left: 18px;
    right: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    z-index: 5;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px 9px 10px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    transform: rotate(-0.7deg);
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 36px;
    background: var(--plum);
    color: var(--mint);
    font-family: var(--display);
    font-size: 20px;
    line-height: 1;
    clip-path: polygon(50% 0, 100% 26%, 100% 74%, 50% 100%, 0 74%, 0 26%);
}

.brand__name {
    display: block;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 65, 'WONK' 1, 'opsz' 48;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 0.9;
}

.brand__sub {
    display: block;
    margin-top: 3px;
    color: var(--wine);
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.tide-card {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 8px 15px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    transform: rotate(0.6deg);
}

.tide-card .kicker {
    color: var(--wine);
}

.tide-card__day {
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 48;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

.tide-card__limit {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 10px;
}

.resources {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.resource {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 108px;
    padding: 8px 12px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
}

.resource__icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: var(--plum);
}

.resource__icon svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.resource__value {
    font-family: var(--display);
    font-variation-settings: 'SOFT' 55, 'WONK' 1, 'opsz' 48;
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
}

.resource__meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.resource__label {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.resource__income {
    color: var(--wine);
    font-family: var(--mono);
    font-size: 9px;
}

.hud__menu {
    display: grid;
    place-items: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    background: var(--ink);
    color: var(--cream);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.hud__menu:hover {
    background: var(--wine);
}

.hud__menu:focus-visible {
    outline: 3px solid var(--wine);
    outline-offset: 3px;
}

.objective-card {
    position: absolute;
    top: 100px;
    left: 18px;
    width: min(342px, calc(100vw - 36px));
    padding: 12px 14px 11px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    z-index: 3;
}

.objective-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.objective-card__head .kicker {
    color: var(--wine);
}

.objective-card__days {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.objective-card__name {
    margin: 6px 0 8px;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 48;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.05;
}

.objective-card__track {
    position: relative;
    height: 7px;
    background: rgba(33, 18, 37, 0.14);
    border: 1px solid rgba(33, 18, 37, 0.35);
    overflow: hidden;
}

.objective-card__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--coral), var(--bubblegum) 55%, var(--mint));
    transition: width 500ms var(--ease);
}

.objective-card__foot {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 6px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
}

.hud__hint {
    position: absolute;
    left: 50%;
    bottom: 246px;
    transform: translateX(-50%) rotate(-0.3deg);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(520px, calc(100vw - 48px));
    padding: 9px 14px;
    background: var(--mint-soft);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: 3px 3px 0 var(--ink);
    color: var(--ink);
    font-size: 13px;
    z-index: 4;
    transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}

.hud__hint::before {
    content: '✳';
    font-size: 16px;
    line-height: 1;
}

.hud__hint.is-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
    pointer-events: none;
}

.hud__bottom {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    z-index: 3;
}

/* Minimap chart (canvas is created by Minimap.js, wrapper by CSS) */
.chart {
    flex: none;
    padding: 8px 8px 7px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    transform: rotate(-0.5deg);
    pointer-events: auto;
}

.chart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    padding: 0 2px;
}

.chart__head .kicker {
    color: var(--wine);
}

.chart__seed {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.06em;
}

#minimap {
    display: block;
    width: 176px;
    height: 176px;
    background: var(--plum);
    border: 1.5px solid var(--ink);
    border-radius: 1px;
}

/* Build dock */
.build-dock {
    width: min(1040px, calc(100vw - 240px));
    padding: 11px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    pointer-events: auto;
}

.build-dock__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 1px 1px 8px;
}

.build-dock__head .kicker {
    color: var(--wine);
}

.build-dock__note {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.blueprints {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 7px;
}

.blueprint {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 104px;
    padding: 8px 8px 7px;
    background: var(--cream);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 2px 2px 0 rgba(33, 18, 37, 0.35);
    text-align: left;
    cursor: pointer;
    transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), background 140ms var(--ease);
}

.blueprint:hover:not(:disabled) {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink);
    background: var(--paper);
}

.blueprint:focus-visible {
    outline: 3px solid var(--wine);
    outline-offset: 2px;
}

.blueprint[aria-pressed='true'] {
    background: var(--mint-soft);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink);
}

.blueprint[aria-pressed='true']::after {
    content: 'ARMED';
    position: absolute;
    right: -1px;
    top: 7px;
    padding: 2px 4px;
    background: var(--ink);
    color: var(--cream);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.08em;
}

.blueprint:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: saturate(0.45);
    box-shadow: 2px 2px 0 rgba(33, 18, 37, 0.2);
}

.blueprint__icon {
    display: block;
    width: 34px;
    height: 30px;
    margin-bottom: 1px;
}

.blueprint__name {
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 32;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
}

.blueprint__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 7px;
    margin-top: auto;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8.5px;
    line-height: 1.35;
}

.blueprint__cost {
    color: var(--wine);
    font-weight: 700;
}

.blueprint--goal {
    background: linear-gradient(155deg, var(--lavender), var(--paper) 72%);
}

.blueprint--goal .blueprint__name {
    color: var(--wine);
}

.build-dock__foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.build-dock__foot .btn {
    flex: 1;
}

.build-dock__cost {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Compact HUD */
@media (max-width: 1100px) {
    .build-dock { width: min(560px, calc(100vw - 240px)); }
    .blueprint { min-height: 96px; }
    .blueprint__name { font-size: 13.5px; }
    .resource { min-width: 94px; }
}

@media (max-width: 860px) {
    .hud__top { flex-wrap: nowrap; }
    .objective-card { top: 72px; }
    .objective-card__name { font-size: 17px; }
    .hud__bottom { flex-direction: column; align-items: stretch; gap: 10px; }
    .build-dock { width: 100%; order: 2; }
    .chart-slot { order: 1; align-self: flex-start; width: fit-content; }
    .chart { order: 1; align-self: flex-start; width: fit-content; }
    #minimap { width: 128px; height: 128px; }
    .hud__hint { top: 168px; bottom: auto; }
    .menu__aside { display: none; }
    .lobby__wrap { grid-template-columns: 1fr; overflow: auto; }
    .lobby__chart { min-height: 300px; }
}

@media (max-width: 620px) {
    .hud__top { top: 10px; left: 10px; right: 10px; gap: 8px; }
    .brand { padding: 6px 9px 6px 7px; }
    .brand__name { font-size: 18px; }
    .brand__sub { display: none; }
    .brand__mark { width: 25px; height: 28px; font-size: 16px; }
    .tide-card { padding: 6px 9px; flex: none; white-space: nowrap; }
    .tide-card__day { font-size: 18px; }
    .tide-card .kicker { display: none; }
    .resource { min-width: 0; padding: 6px 9px; }
    .resource__value { font-size: 19px; }
    .resource__meta { display: none; }
    .resource__icon { width: 20px; height: 20px; }
    .hud__menu { width: 38px; min-height: 38px; }
    .objective-card { top: 72px; left: 10px; padding: 8px 10px; }
    .chart__seed { display: none; }
    .objective-card__name { font-size: 15px; margin: 3px 0 5px; }
    .objective-card__foot { display: flex; gap: 8px; font-size: 9px; }
    .hud__bottom { left: 10px; right: 10px; bottom: 10px; }
    .blueprints {
        display: flex;
        gap: 7px;
        overflow-x: auto;
        padding-bottom: 3px;
        -webkit-overflow-scrolling: touch;
    }

    .blueprint {
        flex: 0 0 46%;
    }
    .blueprint { min-height: 82px; }
    .hud__hint { top: 262px; bottom: auto; font-size: 12px; }
    .screen--menu { padding: 22px; align-items: flex-end; }
    .menu__title { font-size: clamp(52px, 17.5vw, 92px); letter-spacing: -0.045em; }
    .menu__tagline { margin: 18px 0 22px; font-size: 18px; }
    .menu__actions { gap: 10px; }
    .menu__actions .btn { padding: 11px 16px; font-size: 14px; min-height: 44px; }
    .menu__meta { display: none; }
    .screen--lobby { padding: 0; align-items: stretch; }
    .lobby__wrap { gap: 0; width: 100%; }
    .lobby__sheet { border-left: 0; border-right: 0; box-shadow: none; min-height: 100%; }
    .lobby__chart { display: none; }
}

/* ==========================================================================
   Build dialog
   ========================================================================== */

.modal-scrim {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(ellipse at 50% 48%, rgba(255, 79, 154, 0.12), transparent 55%),
        rgba(28, 13, 36, 0.68);
}

.modal-scrim.is-open {
    display: flex;
}

.modal {
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 22px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: 10px 12px 0 rgba(28, 13, 36, 0.55);
}

.modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.modal__title {
    margin: 4px 0 0;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 65, 'WONK' 1, 'opsz' 60;
    font-size: 32px;
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.025em;
}

.modal__close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    background: transparent;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.modal__close:hover {
    background: var(--coral);
}

.modal__close:focus-visible {
    outline: 3px solid var(--wine);
    outline-offset: 2px;
}

.blueprint-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 18px;
    padding: 11px 12px;
    background: var(--cream);
    border: 1.5px solid var(--ink);
}

.blueprint-summary__icon {
    width: 48px;
    height: 42px;
    flex: none;
}

.blueprint-summary__body {
    min-width: 0;
}

.blueprint-summary__name {
    display: block;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 32;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.05;
}

.blueprint-summary__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 12px;
    margin-top: 3px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.02em;
}

.blueprint-summary__stats strong {
    color: var(--wine);
}

.modal__blurb {
    margin: 0 0 18px;
    color: var(--ink-soft);
    font-size: 13.5px;
    line-height: 1.5;
}

.modal__label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.modal__input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--cream);
    border: 1.5px solid var(--ink);
    color: var(--ink);
    font-family: var(--ui);
    font-size: 15px;
    box-shadow: inset 2px 2px 0 rgba(33, 18, 37, 0.1);
}

.modal__input:focus-visible {
    outline: 3px solid var(--wine);
    outline-offset: 2px;
}

.modal__error {
    min-height: 18px;
    margin-top: 5px;
    color: var(--coral-deep);
    font-family: var(--mono);
    font-size: 10px;
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.modal__actions .btn {
    min-height: 44px;
    padding: 9px 17px;
    font-size: 14px;
}

/* ==========================================================================
   Interstitial
   ========================================================================== */

.screen--interstitial {
    display: none;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 50% 48%, transparent 18%, rgba(28, 13, 36, 0.55) 100%),
        rgba(28, 13, 36, 0.4);
    z-index: 500;
}

.tide-panel {
    position: relative;
    width: min(560px, calc(100vw - 36px));
    padding: 32px 34px 28px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: 12px 14px 0 rgba(28, 13, 36, 0.5);
    text-align: center;
    overflow: hidden;
    transform: rotate(-0.6deg);
}

.tide-panel::before,
.tide-panel::after {
    content: '';
    position: absolute;
    left: -5%;
    right: -5%;
    height: 18px;
    background:
        radial-gradient(circle at 10px -2px, transparent 12px, var(--mint) 13px, var(--mint) 15px, transparent 16px) 0 0 / 22px 20px repeat-x;
    opacity: 0.55;
}

.tide-panel::before { top: 6px; }
.tide-panel::after { bottom: 6px; transform: rotate(180deg); }

.tide-panel .kicker {
    color: var(--wine);
}

.tide-panel__title {
    margin: 10px 0 8px;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 75, 'WONK' 1, 'opsz' 72;
    font-size: clamp(38px, 6vw, 56px);
    font-weight: 700;
    line-height: 0.94;
    letter-spacing: -0.03em;
}

.tide-panel__copy {
    max-width: 38ch;
    margin: 0 auto 18px;
    color: var(--ink-soft);
    font-size: 14px;
}

.tide-panel__progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.tide-panel__progress i {
    width: 26px;
    height: 4px;
    background: rgba(33, 18, 37, 0.18);
    animation: tide-pulse 1.6s ease-in-out infinite;
}

.tide-panel__progress i:nth-child(2) { animation-delay: 0.18s; }
.tide-panel__progress i:nth-child(3) { animation-delay: 0.36s; background: var(--coral); }

.tide-summary {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(33, 18, 37, 0.2);
}

.tide-summary div {
    text-align: center;
}

.tide-summary dt {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.tide-summary dd {
    margin: 2px 0 0;
    font-family: var(--display);
    font-size: 23px;
    font-weight: 700;
    line-height: 1;
}

@keyframes tide-pulse {
    0%, 100% { transform: scaleX(0.65); opacity: 0.5; }
    50% { transform: scaleX(1); opacity: 1; }
}

/* ==========================================================================
   End screen
   ========================================================================== */

.screen--end {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(28, 13, 36, 0.15), rgba(28, 13, 36, 0.62)),
        linear-gradient(0deg, rgba(28, 13, 36, 0.55), transparent 50%);
}

.end__sheet {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
    width: min(900px, 100%);
    overflow: hidden;
}

.end__main {
    padding: clamp(26px, 4vw, 46px);
}

.end__title {
    margin: 8px 0 12px;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 96;
    font-size: clamp(44px, 6vw, 72px);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.035em;
}

.end__copy {
    max-width: 40ch;
    margin: 0 0 24px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.5;
}

.end__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.end__aside {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(20px, 3vw, 32px);
    background:
        linear-gradient(165deg, rgba(89, 227, 194, 0.14), transparent 50%),
        var(--plum);
    color: var(--cream);
    border-left: var(--border);
}

.end__aside .kicker {
    color: var(--mint);
}

.end__stats {
    display: grid;
    gap: 14px;
    margin: 20px 0;
}

.end__stat dt {
    color: rgba(255, 242, 216, 0.55);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.end__stat dd {
    margin: 2px 0 0;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 48;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.end__medal {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    color: var(--plum);
    background: var(--sun);
    border: 2px solid var(--ink);
    border-radius: 50%;
    font-family: var(--display);
    font-size: 30px;
    transform: rotate(-8deg);
}

.end--victory .end__medal {
    background: var(--mint);
}

.end--defeat .end__medal {
    background: var(--peach);
}

@media (max-width: 760px) {
    .end__sheet { grid-template-columns: 1fr; }
    .end__aside { border-left: 0; border-top: var(--border); }
    .end__stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .end__medal { display: none; }
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */

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

/* ==========================================================================
   Charter menu and small HUD details
   ========================================================================== */

.charter-menu {
    position: absolute;
    top: 54px;
    right: 0;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 218px;
    padding: 12px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    z-index: 6;
}

.charter-menu[hidden] {
    display: none;
}

.charter-menu .kicker {
    color: var(--wine);
    margin-bottom: 2px;
}

.charter-menu__abandon {
    color: var(--coral-deep) !important;
    justify-content: flex-start;
}

.chart-slot {
    flex: none;
    pointer-events: auto;
}

body.has-modal > canvas {
    pointer-events: none;
}

.screen--hud.is-out-of-actions .blueprints {
    opacity: 0.7;
}

/* The end screen sits over a frozen world; push it back so the record reads. */
.screen--end {
    backdrop-filter: blur(3px) brightness(0.72) saturate(0.85);
}

/* Transient, non-blocking feedback under the resource chip. */
.hud-toast {
    position: absolute;
    top: 72px;
    right: 18px;
    max-width: min(320px, calc(100vw - 36px));
    padding: 9px 13px;
    background: var(--ink);
    color: var(--cream);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 4px 4px 0 rgba(255, 242, 216, 0.24);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.02em;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 220ms var(--ease), transform 220ms var(--ease);
    z-index: 5;
}

.hud-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hud-toast[data-tone='sun'] {
    background: var(--sun);
    color: var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
}

@media (max-width: 620px) {
    .hud-toast {
        top: 62px;
        right: 10px;
        left: 10px;
        max-width: none;
        text-align: center;
    }
}

#minimap {
    cursor: pointer;
}

.btn--danger {
    --btn-bg: var(--coral);
    --btn-fg: var(--ink);
    --btn-shadow: var(--ink);
}

.modal__note {
    margin: -6px 0 10px;
    padding: 9px 11px;
    background: var(--cream);
    border-left: 3px solid var(--coral);
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.5;
}

/* ==========================================================================
   Refined loop — First Light HUD, bulletin, playback, report and cards
   ========================================================================== */

.resource--compact {
    min-width: 86px;
}

.blueprint__need {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

.objective-card__track--flourishing {
    height: 5px;
    margin-top: 7px;
}

.objective-card__fill--mint {
    background: linear-gradient(90deg, var(--mint), var(--cyan));
}

.objective-card__goal {
    margin: 7px 0 0;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.35;
}

.screen--hud.is-goals-met .objective-card {
    background: linear-gradient(155deg, var(--mint-soft), var(--paper) 70%);
}

.screen--hud.is-goals-met .objective-card__name {
    color: var(--wine);
}

/* Morning bulletin ------------------------------------------------------- */

.bulletin {
    width: min(700px, calc(100vw - 32px));
    padding: 22px 24px 20px;
}

.bulletin__stamp {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 2px solid var(--wine);
    color: var(--wine);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    transform: rotate(4deg);
}

.bulletin__items {
    display: grid;
    gap: 0;
    margin: 14px 0 16px;
    border-top: 1.5px solid rgba(33, 18, 37, 0.35);
}

.bulletin__item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1.5px solid rgba(33, 18, 37, 0.26);
}

.bulletin__number {
    color: var(--coral);
    font-family: var(--display);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.bulletin__item h4 {
    margin: 2px 0 4px;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 32;
    font-size: 19px;
    line-height: 1.1;
}

.bulletin__item p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.45;
}

.bulletin__item .kicker {
    color: var(--wine);
}

.bulletin__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 4px;
}

.bulletin__note {
    margin: 0;
    max-width: 34ch;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    line-height: 1.5;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Day playback ---------------------------------------------------------- */

.screen--day {
    display: none;
    pointer-events: none;
    z-index: 200;
}

.screen--day > * {
    pointer-events: auto;
}

.day-strip {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 18px;
    width: min(860px, calc(100vw - 36px));
    padding: 10px 12px 10px 16px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    transform-origin: top center;
}

.day-strip__now {
    display: flex;
    align-items: baseline;
    gap: 10px;
    white-space: nowrap;
}

.day-strip__now .kicker {
    color: var(--wine);
}

.day-strip__now strong {
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 48;
    font-size: 22px;
    line-height: 1;
}

.day-strip__phase {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.day-strip__track {
    flex: 1;
    height: 7px;
    background: rgba(33, 18, 37, 0.16);
    border: 1px solid rgba(33, 18, 37, 0.3);
    overflow: hidden;
}

.day-strip__track i {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--coral), var(--bubblegum) 45%, var(--mint));
    transition: width 120ms linear;
}

.day-strip__controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.day-strip__controls .btn {
    min-width: 44px;
}

.day-strip__controls .btn.is-active {
    background: var(--ink);
    color: var(--cream);
}

/* Evening report -------------------------------------------------------- */

.screen--report {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    background: rgba(28, 13, 36, 0.58);
    z-index: 1100;
}

.report__sheet {
    width: min(1040px, calc(100vw - 36px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 26px 30px 22px;
}

.report__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--ink);
}

.report__title {
    margin: 4px 0 0;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 62, 'WONK' 1, 'opsz' 72;
    font-size: clamp(28px, 4.2vw, 46px);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.02em;
}

.report__edition {
    color: var(--wine);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.report__numbers {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    margin: 16px 0 18px;
    border: 1.5px solid rgba(33, 18, 37, 0.38);
}

.report__numbers > div {
    padding: 9px 10px;
    border-right: 1px solid rgba(33, 18, 37, 0.25);
}

.report__numbers > div:last-child {
    border-right: 0;
}

.report__numbers .kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--wine);
}

.report__numbers strong {
    font-family: var(--display);
    font-size: 22px;
    line-height: 1;
}

.report__columns {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
}

.report__columns h2 {
    margin: 16px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(33, 18, 37, 0.3);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.report__columns h2:first-child {
    margin-top: 0;
}

.report__needs {
    display: grid;
    gap: 5px;
}

.report__need {
    display: grid;
    grid-template-columns: 76px 1fr 34px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.report__need-track {
    height: 6px;
    background: rgba(33, 18, 37, 0.14);
    border: 1px solid rgba(33, 18, 37, 0.25);
}

.report__need-track i {
    display: block;
    height: 100%;
}

.report__need strong {
    font-family: var(--mono);
    font-size: 10px;
    text-align: right;
}

.report__list {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.report__list li {
    padding: 5px 0;
    border-bottom: 1px dotted rgba(33, 18, 37, 0.28);
    font-size: 12px;
    line-height: 1.4;
}

.report__list--services li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 10px;
}

.report__quotes blockquote {
    margin: 0 0 9px;
    padding: 10px 12px;
    background: var(--cream);
    border-left: 4px solid var(--bubblegum);
    font-family: var(--display);
    font-size: 15px;
    line-height: 1.3;
}

.report__quotes cite {
    display: block;
    margin-top: 5px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    font-style: normal;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.report__quiet {
    color: var(--ink-soft);
    font-size: 12px;
}

.report__warning {
    margin: 0 0 12px;
    padding: 8px 12px;
    background: rgba(255, 107, 94, 0.18);
    border: 1.5px solid var(--coral);
    font-size: 12px;
}

.report__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 2px solid var(--ink);
}

.report__foot p {
    margin: 0;
    max-width: 58ch;
    color: var(--ink-soft);
    font-size: 13px;
}

/* Resident card --------------------------------------------------------- */

.resident-card {
    width: min(760px, calc(100vw - 32px));
    padding: 22px 24px 18px;
}

.resident-card__traits {
    margin: 6px 0 14px;
    color: var(--wine);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.resident-card__body {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 22px;
    margin-bottom: 14px;
}

.resident-card__needs {
    display: grid;
    gap: 7px;
    align-content: start;
}

.need-row {
    display: grid;
    grid-template-columns: 24px 74px 1fr 30px;
    align-items: center;
    gap: 7px;
}

.need-row.is-urgent .need-row__label {
    color: var(--wine);
    font-weight: 700;
}

.need-row__icon {
    width: 20px;
    height: 20px;
    display: block;
}

.need-row__icon svg {
    width: 100%;
    height: 100%;
}

.need-row__label {
    font-size: 12px;
}

.need-row__track {
    height: 7px;
    background: rgba(33, 18, 37, 0.14);
    border: 1px solid rgba(33, 18, 37, 0.28);
}

.need-row__track i {
    display: block;
    height: 100%;
}

.need-row__value {
    font-family: var(--mono);
    font-size: 10px;
    text-align: right;
}

.resident-card__meta {
    display: grid;
    gap: 9px;
    align-content: start;
    padding-left: 18px;
    border-left: 1px solid rgba(33, 18, 37, 0.28);
}

.resident-card__meta p {
    margin: 0;
    line-height: 1.3;
}

.resident-card__meta .kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--wine);
}

.resident-card__meta strong {
    font-family: var(--display);
    font-size: 15px;
}

.resident-card__blurb {
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.45;
}

.resident-card__why {
    margin: 0 0 14px;
    padding: 12px 14px;
    background: var(--cream);
    border: 1.5px solid var(--ink);
    border-left: 5px solid var(--mint);
}

.resident-card__why .kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--wine);
}

.resident-card__why p {
    margin: 0;
    font-family: var(--display);
    font-size: 17px;
    line-height: 1.3;
}

.resident-card__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(33, 18, 37, 0.28);
}

.resident-card__count {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 10px;
}

/* Service facts --------------------------------------------------------- */

.service-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin: 12px 0 14px;
    padding: 11px 13px;
    background: var(--cream);
    border: 1.5px solid rgba(33, 18, 37, 0.35);
}

.service-facts div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.service-facts dt {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.service-facts dd {
    margin: 0;
    font-size: 11px;
    text-align: right;
}

@media (max-width: 860px) {
    .day-strip {
        flex-wrap: wrap;
        gap: 8px;
    }
    .day-strip__track { order: 4; width: 100%; flex-basis: 100%; }
    .hud__hint { top: 218px; bottom: auto; }
    .report__numbers { grid-template-columns: repeat(3, 1fr); }
    .report__columns { grid-template-columns: 1fr; gap: 10px; }
    .report__foot { flex-direction: column; align-items: flex-start; }
    .resident-card__body { grid-template-columns: 1fr; }
    .resident-card__meta { padding-left: 0; border-left: 0; border-top: 1px solid rgba(33, 18, 37, 0.28); padding-top: 10px; }
}

@media (max-width: 620px) {
    .bulletin { padding: 16px; }
    .bulletin__foot { flex-direction: column; align-items: flex-start; }
    .report__sheet { padding: 18px 16px; }
    .service-facts { grid-template-columns: 1fr; }
    .need-row { grid-template-columns: 22px 64px 1fr 26px; }
}

/* Compact phone HUD: brand + day on one row, resources on the next. */
@media (max-width: 620px) {
    .hud__top {
        flex-wrap: wrap;
        align-items: stretch;
        gap: 7px;
    }

    .brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .tide-card {
        flex: none;
    }

    .resources {
        order: 3;
        flex: 1 0 100%;
        justify-content: space-between;
        gap: 5px;
    }

    .resource {
        flex: 1 1 0;
        min-width: 0;
        padding: 5px 6px;
        gap: 4px;
    }

    .resource__value {
        font-size: 17px;
    }

    .resource__icon {
        width: 18px;
        height: 18px;
    }

    .hud__menu {
        flex: none;
        width: 44px;
        min-height: 44px;
    }

    .objective-card {
        top: 124px;
    }

    .hud__hint {
        top: 250px;
        bottom: auto;
    }

    .build-dock__head {
        flex-wrap: wrap;
        gap: 3px 8px;
    }

    .build-dock__note {
        font-size: 8px;
    }

    .build-dock__foot {
        flex-wrap: wrap;
    }

    .build-dock__cost {
        white-space: normal;
    }
}

.end__quote {
    margin: 18px 0 0;
    padding: 12px 14px;
    background: var(--cream);
    border-left: 5px solid var(--bubblegum);
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 32;
    font-size: 16px;
    line-height: 1.35;
}

.charter-menu__confirm {
    display: grid;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(33, 18, 37, 0.3);
}

.charter-menu__confirm[hidden] {
    display: none;
}

.charter-menu__confirm p {
    margin: 0 0 2px;
    color: var(--wine);
    font-family: var(--mono);
    font-size: 9px;
    line-height: 1.45;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.report__loss {
    color: var(--wine);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 400;
}

.hud__hint-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    background: transparent;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.hud__hint-close:hover,
.hud__hint-close:focus-visible {
    background: var(--ink);
    color: var(--cream);
}

#minimap:focus-visible {
    outline: 3px solid var(--wine);
    outline-offset: 3px;
}

/* Contest standings ------------------------------------------------------ */

.screen--hud.is-contest .objective-card {
    display: none;
}

.standings-card {
    position: absolute;
    top: 100px;
    left: 18px;
    width: min(360px, calc(100vw - 36px));
    padding: 12px 14px 10px;
    background: var(--paper);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard);
    z-index: 3;
    pointer-events: auto;
    transform: rotate(-0.35deg);
}

.standings-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.standings-card__head .kicker {
    color: var(--wine);
}

.standings-card__goal {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.standings-card__title {
    margin: 4px 0 8px;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 40;
    font-size: 21px;
    line-height: 1;
}

.standings-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.standings-row {
    display: grid;
    grid-template-columns: 16px 10px 1fr auto;
    grid-template-areas:
        'rank dot name hearts'
        '. . visits visits';
    align-items: center;
    gap: 2px 7px;
    padding: 5px 6px;
    border-top: 1px solid rgba(33, 18, 37, 0.2);
    font-size: 12px;
}

.standings-row__rank {
    grid-area: rank;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
}

.standings-row__dot {
    grid-area: dot;
    width: 9px;
    height: 9px;
    border: 1px solid var(--ink);
    border-radius: 50%;
}

.standings-row__name {
    grid-area: name;
    font-weight: 600;
}

.standings-row__hearts {
    grid-area: hearts;
    font-family: var(--display);
    font-size: 15px;
}

.standings-row__visits {
    grid-area: visits;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.standings-row.is-player {
    background: var(--mint-soft);
    border-left: 3px solid var(--wine);
}

@media (max-width: 620px) {
    .standings-card {
        top: 124px;
        left: 10px;
        padding: 9px 11px;
    }
    .standings-card__title { font-size: 18px; }
}

.standings-card__flows {
    margin: 0 0 8px;
    min-height: 28px;
    padding: 5px 9px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.standings-card__flows:hover,
.standings-card__flows:focus-visible {
    background: var(--mint-soft);
}

.standings-card__flows.is-on {
    background: var(--ink);
    color: var(--cream);
}

@media (max-width: 620px) {
    .screen--hud.is-contest .hud__hint {
        display: none;
    }

    .screen--hud.is-contest .chart-slot {
        display: none;
    }
}

/* Confluence vote -------------------------------------------------------- */

.screen--confluence {
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 3vw, 42px);
    background:
        radial-gradient(ellipse at 50% 40%, transparent 25%, rgba(28, 13, 36, 0.55) 100%);
    z-index: 40;
}

.confluence__sheet {
    width: min(1080px, 100%);
    max-height: 100%;
    overflow: auto;
    padding: clamp(20px, 3vw, 38px);
}

.confluence__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ink);
}

.confluence__title {
    margin: 5px 0 8px;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 72;
    font-size: clamp(34px, 4.5vw, 60px);
    line-height: 0.94;
    letter-spacing: -0.035em;
}

.confluence__lede {
    max-width: 58ch;
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.5;
}

.confluence__commons {
    flex: none;
    min-width: 160px;
    padding: 10px 12px;
    background: var(--mint-soft);
    border: var(--border);
    border-radius: var(--radius);
    display: grid;
    gap: 2px;
}

.confluence__commons strong {
    font-family: var(--display);
    font-size: 34px;
    line-height: 1;
}

.confluence__commons small {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.confluence__columns {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(20px, 4vw, 52px);
    padding-top: 18px;
}

.confluence__columns h2 {
    margin: 0 0 10px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.confluence__columns h2:not(:first-child) {
    margin-top: 20px;
}

.confluence-standings,
.confluence-result__counts,
.confluence-votes {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.confluence-standing {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 2px 8px;
    padding: 7px 8px;
    border-top: 1px solid rgba(33, 18, 37, 0.22);
}

.confluence-standing.is-player {
    background: var(--mint-soft);
    border-left: 3px solid var(--wine);
}

.confluence-standing__dot {
    width: 9px;
    height: 9px;
    border: 1px solid var(--ink);
    border-radius: 50%;
}

.confluence-standing strong {
    font-family: var(--display);
    font-size: 17px;
}

.confluence-standing small {
    grid-column: 2 / 4;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.confluence__note {
    margin: 16px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.5;
}

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

.pledge-card {
    position: relative;
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1.5px solid rgba(33, 18, 37, 0.4);
    border-radius: var(--radius);
    background: rgba(255, 242, 216, 0.35);
    cursor: pointer;
}

.pledge-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pledge-card__kicker {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pledge-card strong {
    font-family: var(--display);
    font-size: 17px;
    line-height: 1.05;
}

.pledge-card__copy {
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.35;
}

.pledge-card.is-selected {
    background: var(--mint-soft);
    border-color: var(--ink);
    box-shadow: var(--shadow-hard);
    transform: translate(-1px, -1px);
}

.pledge-card:focus-within {
    outline: 3px solid var(--wine);
    outline-offset: 2px;
}

.confluence__vote {
    margin-top: 14px;
    width: 100%;
}

.confluence-result__counts {
    margin-bottom: 16px;
}

.confluence-result__count {
    display: grid;
    grid-template-columns: 10px 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-top: 1px solid rgba(33, 18, 37, 0.22);
}

.confluence-result__count.is-player {
    background: var(--mint-soft);
    border-left: 3px solid var(--wine);
}

.confluence-result__count strong {
    font-family: var(--display);
    font-size: 24px;
    line-height: 1;
}

.confluence-result__count small {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
}

.confluence-votes {
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.confluence-vote {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    padding: 6px 7px;
    border-top: 1px solid rgba(33, 18, 37, 0.18);
    font-size: 12px;
}

.confluence-vote span {
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
}

.confluence-vote small {
    grid-column: 1 / 3;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.35;
}

@media (max-width: 720px) {
    .screen--confluence { padding: 0; align-items: stretch; }
    .confluence__sheet { max-height: 100%; border-radius: 0; }
    .confluence__head { flex-direction: column; gap: 10px; }
    .confluence__commons { width: 100%; }
    .confluence__columns { grid-template-columns: 1fr; gap: 18px; }
    .confluence__title { font-size: 38px; }
    .pledge-grid { grid-template-columns: 1fr; }
    .confluence-votes { max-height: none; }
}

/* Campaign --------------------------------------------------------------- */

.standings-card__campaign {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    align-items: center;
    margin: 0 0 8px;
    padding: 7px 8px;
    background: rgba(255, 211, 110, 0.35);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
}

.standings-card__campaign .kicker {
    grid-column: 1 / 3;
    color: var(--wine);
}

.standings-card__campaign strong {
    font-family: var(--display);
    font-size: 16px;
    line-height: 1.05;
}

.standings-card__campaign button {
    min-height: 26px;
    padding: 5px 8px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.standings-card__campaign button:hover,
.standings-card__campaign button:focus-visible {
    background: var(--ink);
    color: var(--cream);
}

.campaign-modal {
    width: min(720px, calc(100vw - 32px));
}

.campaign-modal__label {
    margin: 16px 0 7px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.campaign-rivals {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.campaign-rivals li {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-top: 1px solid rgba(33, 18, 37, 0.2);
    font-size: 12px;
}

.campaign-rivals__dot {
    width: 9px;
    height: 9px;
    border: 1px solid var(--ink);
    border-radius: 50%;
}

.campaign-rivals strong {
    font-family: var(--display);
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 620px) {
    .campaign-modal .pledge-grid {
        grid-template-columns: 1fr;
    }
}

.standings-card__campaign-event {
    grid-column: 1 / 3;
    color: var(--wine);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.campaign-events {
    display: grid;
    gap: 5px;
    max-height: 170px;
    overflow-y: auto;
    margin: 0;
    padding: 0 4px 0 0;
    list-style: none;
}

.campaign-events li {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 2px 9px;
    padding: 7px 8px;
    background: rgba(255, 211, 110, 0.22);
    border: 1px solid rgba(33, 18, 37, 0.3);
    border-radius: var(--radius);
}

.campaign-events span {
    grid-row: 1 / 3;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.campaign-events strong {
    font-family: var(--display);
    font-size: 15px;
    line-height: 1.05;
}

.campaign-events small {
    color: var(--ink-soft);
    font-size: 10px;
    line-height: 1.3;
}

/* Stewardship ------------------------------------------------------------ */

.screen--stewardship {
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 3vw, 42px);
    background:
        radial-gradient(ellipse at 50% 42%, transparent 24%, rgba(28, 13, 36, 0.58) 100%);
    z-index: 42;
}

.stewardship__sheet {
    width: min(1040px, 100%);
    max-height: 100%;
    overflow: auto;
    padding: clamp(20px, 3vw, 38px);
}

.stewardship__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ink);
}

.stewardship__title {
    margin: 5px 0 8px;
    font-family: var(--display);
    font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 72;
    font-size: clamp(34px, 4.5vw, 58px);
    line-height: 0.94;
    letter-spacing: -0.035em;
}

.stewardship__lede {
    max-width: 56ch;
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.5;
}

.stewardship__score {
    flex: none;
    min-width: 190px;
    padding: 10px 12px;
    background: var(--mint-soft);
    border: var(--border);
    border-radius: var(--radius);
}

.stewardship__score ul {
    display: flex;
    gap: 10px;
    margin: 5px 0;
    padding: 0;
    list-style: none;
}

.stewardship__score li {
    display: grid;
    gap: 1px;
    font-size: 11px;
}

.stewardship__score li span {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stewardship__score li strong {
    font-family: var(--display);
    font-size: 22px;
    line-height: 1;
}

.stewardship__score small {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stewardship__label {
    margin: 20px 0 10px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

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

.stewardship-card {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 13px;
    border: 1.5px solid rgba(33, 18, 37, 0.4);
    border-radius: var(--radius);
    background: rgba(255, 242, 216, 0.35);
    cursor: pointer;
}

.stewardship-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.stewardship-card__kicker {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stewardship-card strong {
    font-family: var(--display);
    font-size: 21px;
    line-height: 1;
}

.stewardship-card__copy {
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.4;
}

.stewardship-card.is-selected {
    background: var(--mint-soft);
    border-color: var(--ink);
    box-shadow: var(--shadow-hard);
    transform: translate(-1px, -1px);
}

.stewardship-card:focus-within {
    outline: 3px solid var(--wine);
    outline-offset: 2px;
}

.stewardship__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(33, 18, 37, 0.28);
}

.stewardship__note {
    max-width: 52ch;
    margin: 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .screen--stewardship { padding: 0; align-items: stretch; }
    .stewardship__sheet { max-height: 100%; border-radius: 0; }
    .stewardship__head { flex-direction: column; gap: 10px; }
    .stewardship__score { width: 100%; }
    .stewardship-grid { grid-template-columns: 1fr; }
    .stewardship__foot { flex-direction: column; align-items: stretch; }
    .stewardship__title { font-size: 38px; }
}

/* Shared Commons --------------------------------------------------------- */

.standings-card__commons {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    align-items: center;
    margin: 0 0 8px;
    padding: 7px 8px;
    background: rgba(201, 182, 255, 0.28);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
}

.standings-card__commons .kicker {
    grid-column: 1 / 3;
    color: var(--wine);
}

.standings-card__commons strong {
    font-family: var(--display);
    font-size: 15px;
    line-height: 1.05;
}

.standings-card__commons button {
    padding: 3px 7px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.standings-card__commons button:hover,
.standings-card__commons button:focus-visible {
    background: var(--ink);
    color: var(--cream);
}

.commons-modal {
    width: min(560px, calc(100vw - 32px));
}

.commons-progress {
    display: grid;
    gap: 5px;
    margin: 14px 0 4px;
}

.commons-progress__track {
    height: 12px;
    padding: 2px;
    background: var(--paper-deep);
    border: 1.5px solid var(--ink);
    border-radius: 999px;
}

.commons-progress__track i {
    display: block;
    height: 100%;
    background: var(--lavender);
    border-radius: 999px;
    transition: width 180ms ease;
}

.commons-progress strong {
    font-family: var(--display);
    font-size: 18px;
    text-align: right;
}

.commons-contributors {
    display: grid;
    gap: 4px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.commons-contributors li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-top: 1px solid rgba(33, 18, 37, 0.2);
    font-size: 12px;
}

.commons-contributors strong {
    font-family: var(--display);
    font-size: 16px;
}

.modal__note {
    margin: 12px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.45;
}

/* Visitor invitations ---------------------------------------------------- */

.btn--tiny {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 9px;
    line-height: 1.1;
    white-space: nowrap;
}

.report__visitors {
    display: grid;
    gap: 4px;
}

.report__visitor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border-top: 1px solid rgba(33, 18, 37, 0.18);
}

.report__visitor strong {
    display: block;
    font-family: var(--display);
    font-size: 15px;
    line-height: 1.1;
}

.report__visitor small {
    display: block;
    margin-top: 1px;
    color: var(--ink-soft);
    font-size: 10px;
}

.report__visitor-note {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Commons Assembly ------------------------------------------------------- */

.commons-assembly-copy {
    margin: 14px 0 10px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.45;
}

.commons-policies {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 14px;
}

.commons-policy {
    display: grid;
    gap: 3px;
    padding: 10px;
    text-align: left;
    background: var(--paper-deep);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
}

.commons-policy:hover,
.commons-policy:focus-visible {
    background: var(--paper);
    transform: translateY(-1px);
}

.commons-policy .kicker {
    color: var(--wine);
    font-size: 8px;
}

.commons-policy strong {
    font-family: var(--display);
    font-size: 18px;
    line-height: 1.05;
}

.commons-policy > span:last-child {
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.35;
}

.commons-policy-chosen {
    display: grid;
    gap: 3px;
    margin: 14px 0;
    padding: 12px;
    background: rgba(201, 182, 255, 0.3);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
}

.commons-policy-chosen strong {
    font-family: var(--display);
    font-size: 21px;
}

.commons-policy-chosen span {
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 620px) {
    .commons-policies {
        grid-template-columns: 1fr;
    }
}

.commons-policy__action {
    margin-top: 3px;
    color: var(--wine);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.commons-finalists {
    display: grid;
    gap: 6px;
    margin: 10px 0 14px;
    padding: 0;
    list-style: none;
}

.commons-finalists li {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    background: var(--paper-deep);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
}

.commons-finalists strong {
    font-family: var(--display);
    font-size: 18px;
    line-height: 1.05;
}

.commons-finalists li > span:last-child {
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.35;
}

/* Retrofit modules ------------------------------------------------------- */

.retrofit-modal {
    width: min(620px, calc(100vw - 32px));
}

.retrofit-options {
    display: grid;
    gap: 7px;
    margin: 12px 0;
}

.retrofit-option {
    display: grid;
    gap: 2px;
    padding: 9px 11px;
    text-align: left;
    background: var(--paper-deep);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
}

.retrofit-option:hover,
.retrofit-option:focus-visible {
    background: var(--paper);
    transform: translateX(2px);
}

.retrofit-option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.retrofit-option strong {
    font-family: var(--display);
    font-size: 19px;
    line-height: 1.05;
}

.retrofit-option > span:nth-child(3) {
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.35;
}

.retrofit-option__stats {
    color: var(--wine);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.commons-petition {
    margin: 0 0 10px;
    padding: 9px 11px;
    background: rgba(255, 211, 110, 0.24);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 1.4;
}

.commons-petition strong {
    font-family: var(--display);
    font-size: 16px;
}

/* Visitor card ----------------------------------------------------------- */

.report__visitor-name {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    font-family: var(--display);
    font-size: 15px;
    line-height: 1.1;
    cursor: pointer;
}

.report__visitor-name:hover,
.report__visitor-name:focus-visible {
    color: var(--wine);
    text-decoration: underline;
}

.visitor-card {
    width: min(560px, calc(100vw - 32px));
}

.visitor-card__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.visitor-card__facts > div {
    display: grid;
    gap: 2px;
    padding: 8px;
    background: var(--paper-deep);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
}

.visitor-card__facts strong {
    font-family: var(--display);
    font-size: 22px;
}

.visitor-card__needs {
    display: grid;
    gap: 4px;
    margin: 6px 0 12px;
}

.visitor-card__need {
    display: grid;
    grid-template-columns: 76px 1fr 28px;
    align-items: center;
    gap: 7px;
    font-size: 11px;
}

.visitor-card__track {
    height: 8px;
    padding: 1px;
    background: var(--paper-deep);
    border: 1px solid rgba(33, 18, 37, 0.4);
    border-radius: 999px;
}

.visitor-card__track i {
    display: block;
    height: 100%;
    border-radius: 999px;
}

/* Service hours ---------------------------------------------------------- */

.service-hours {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.service-policy-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.service-policy-row .service-hours {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    font-size: 8.5px;
}

.service-policy-row .service-hours select {
    min-width: 0;
    width: 100%;
    padding: 4px 5px;
    font-size: 11px;
}

.service-hours select {
    min-width: 150px;
    padding: 5px 7px;
    background: var(--paper-deep);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: var(--body);
    font-size: 12px;
    text-transform: none;
}

.commons-purse {
    margin: 8px 0 0;
    padding: 7px 9px;
    background: var(--paper-deep);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.5;
}

.commons-purse strong {
    color: var(--ink);
}

/* Building finishes ------------------------------------------------------ */

.finish-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 4px 0 12px;
}

.finish-option {
    display: grid;
    gap: 2px;
    padding: 8px;
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper-deep);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.finish-option strong {
    font-family: var(--display);
    font-size: 15px;
}

.finish-option span {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.finish-option.is-selected {
    background: var(--mint);
    box-shadow: var(--shadow-sm);
    transform: translate(-1px, -1px);
}

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

/* The paper almanac ------------------------------------------------------- */
.field-guide {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 36px);
}

.field-guide__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    margin: 18px 0;
}

.field-guide__body section {
    padding-top: 10px;
    border-top: 1.5px solid rgba(33, 18, 37, 0.25);
}

.field-guide__body h4 {
    margin: 0 0 6px;
    font-family: var(--display);
    font-size: 17px;
    font-weight: 700;
    color: var(--wine);
}

.field-guide__body p {
    margin: 0 0 5px;
    font-size: 12.5px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .field-guide__body { grid-template-columns: 1fr; }
}

/* Resident identity and visit log ----------------------------------------- */
.resident-card__identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.resident-card__avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    color: var(--ink);
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    box-shadow: 2px 2px 0 rgba(33, 18, 37, 0.35);
}

.resident-card__history {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1.5px solid rgba(33, 18, 37, 0.25);
}

.resident-card__history ol {
    display: grid;
    gap: 4px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.resident-card__history li {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 1px 8px;
    padding: 5px 6px;
    background: rgba(255, 211, 110, 0.18);
    border: 1px solid rgba(33, 18, 37, 0.18);
    border-radius: var(--radius);
}

.resident-card__history li span {
    grid-row: 1 / 3;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.resident-card__history li strong {
    font-family: var(--display);
    font-size: 13px;
    line-height: 1.1;
}

.resident-card__history li small {
    color: var(--ink-soft);
    font-size: 9.5px;
    line-height: 1.3;
}

/* Departure archive ------------------------------------------------------- */
.departure-archive__list {
    display: grid;
    gap: 7px;
    margin: 14px 0;
    padding: 0;
    list-style: none;
}

.departure-archive__list li {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: start;
    gap: 10px;
    padding: 9px;
    background: rgba(255, 211, 110, 0.2);
    border: 1.5px solid rgba(33, 18, 37, 0.3);
    border-radius: var(--radius);
}

.departure-archive__avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--lavender);
    font-family: var(--display);
    font-size: 16px;
    font-weight: 700;
}

.departure-archive__list strong {
    display: block;
    font-family: var(--display);
    font-size: 17px;
    line-height: 1.1;
}

.departure-archive__list li > div span,
.departure-archive__list li > div small {
    display: block;
    color: var(--ink-soft);
    font-size: 10px;
    line-height: 1.35;
}

.departure-archive__list .departure-archive__avatar {
    display: grid;
    place-items: center;
    color: var(--ink);
    font-family: var(--display);
    font-size: 16px;
    font-weight: 700;
}

/* Menu legacy ------------------------------------------------------------- */
.menu__legacy {
    display: grid;
    gap: 4px;
    max-width: 460px;
    margin-top: 18px;
    padding: 10px 12px;
    background: rgba(255, 243, 216, 0.08);
    border: 1.5px solid rgba(255, 243, 216, 0.35);
    border-radius: var(--radius);
    color: var(--paper);
}

.menu__legacy[hidden] {
    display: none;
}

.menu__legacy .kicker {
    color: var(--mint);
}

.menu__legacy strong {
    font-family: var(--display);
    font-size: 18px;
    line-height: 1.05;
}

.menu__legacy span {
    color: rgba(255, 243, 216, 0.72);
    font-size: 12px;
    line-height: 1.35;
}

.menu__legacy-clear {
    justify-self: start;
    margin-top: 4px;
    padding: 2px 0;
    background: none;
    border: 0;
    color: var(--coral);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.menu__legacy-clear:hover {
    text-decoration: underline;
}

/* Charter archive --------------------------------------------------------- */
.charter-archive {
    width: min(640px, calc(100vw - 32px));
}

.charter-archive__list {
    display: grid;
    gap: 7px;
    margin: 14px 0;
    padding: 0;
    list-style: none;
}

.charter-archive__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    background: rgba(255, 211, 110, 0.16);
    border: 1.5px solid rgba(33, 18, 37, 0.3);
    border-left: 5px solid var(--mint);
    border-radius: var(--radius);
}

.charter-archive__row--defeat {
    border-left-color: var(--coral);
}

.charter-archive__row--abandon {
    border-left-color: var(--ink-soft);
}

.charter-archive__row strong {
    display: block;
    font-family: var(--display);
    font-size: 17px;
    line-height: 1.1;
}

.charter-archive__row span {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.charter-archive__stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 8px;
    text-align: right;
}

/* Need survey ------------------------------------------------------------- */
.need-survey__rows {
    display: grid;
    gap: 7px;
    margin: 14px 0;
}

.need-survey__row {
    display: grid;
    grid-template-columns: 100px 1fr 32px;
    grid-template-areas:
        'name track value'
        'name meta meta';
    align-items: center;
    gap: 3px 9px;
    padding: 7px 8px;
    background: rgba(255, 211, 110, 0.18);
    border: 1.5px solid rgba(33, 18, 37, 0.25);
    border-radius: var(--radius);
}

.need-survey__name {
    grid-area: name;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--display);
    font-size: 15px;
    font-weight: 700;
}

.need-survey__name i {
    width: 10px;
    height: 10px;
    border: 1px solid var(--ink);
    border-radius: 50%;
}

.need-survey__track {
    grid-area: track;
    height: 8px;
    overflow: hidden;
    background: var(--paper-deep);
    border: 1px solid var(--ink);
    border-radius: 99px;
}

.need-survey__track i {
    display: block;
    height: 100%;
}

.need-survey__row strong {
    grid-area: value;
    font-family: var(--display);
    font-size: 17px;
    text-align: right;
}

.need-survey__meta {
    grid-area: meta;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Charter ledger ---------------------------------------------------------- */
.charter-ledger {
    width: min(620px, calc(100vw - 32px));
}

.charter-ledger__spark {
    display: block;
    width: 100%;
    height: 64px;
    margin: 12px 0 8px;
    overflow: visible;
}

.charter-ledger__spark polyline {
    fill: none;
    stroke: var(--coral);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.charter-ledger__spark line {
    stroke: rgba(33, 18, 37, 0.3);
    stroke-width: 1;
}

.charter-ledger__table-wrap {
    overflow-x: auto;
    margin: 8px 0 14px;
}

.charter-ledger__table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 10px;
}

.charter-ledger__table th,
.charter-ledger__table td {
    padding: 5px 6px;
    text-align: right;
    border-bottom: 1px solid rgba(33, 18, 37, 0.18);
}

.charter-ledger__table th:first-child,
.charter-ledger__table td:first-child {
    text-align: left;
}

.charter-ledger__table th {
    color: var(--ink-soft);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.charter-ledger__table td.is-positive {
    color: #1c7a60;
}

.charter-ledger__table td.is-negative {
    color: var(--wine);
}

/* Reduced motion ---------------------------------------------------------- */
html.is-reduced-motion *,
html.is-reduced-motion *::before,
html.is-reduced-motion *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

/* Rival dossier ----------------------------------------------------------- */
.rival-dossier {
    width: min(560px, calc(100vw - 32px));
}

.rival-dossier__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 14px 0;
    background: rgba(33, 18, 37, 0.2);
    border: 1.5px solid rgba(33, 18, 37, 0.35);
}

.rival-dossier__stats div {
    padding: 7px 8px;
    background: var(--paper);
}

.rival-dossier__stats dt {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rival-dossier__stats dd {
    margin: 2px 0 0;
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
}

.rival-dossier__plan {
    padding: 8px 10px;
    background: rgba(255, 211, 110, 0.22);
    border: 1.5px solid rgba(33, 18, 37, 0.25);
    border-radius: var(--radius);
    font-size: 12px;
}

.rival-dossier__services {
    display: grid;
    gap: 5px;
    margin: 6px 0 14px;
    padding: 0;
    list-style: none;
}

.rival-dossier__services li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(33, 18, 37, 0.18);
}

.rival-dossier__services strong {
    font-family: var(--display);
    font-size: 15px;
}

.rival-dossier__services span {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
}

.standings-row[data-chapter-id] {
    cursor: pointer;
}

.standings-row[data-chapter-id]:hover,
.standings-row[data-chapter-id]:focus-visible {
    background: rgba(255, 211, 110, 0.2);
    outline: 3px solid var(--wine);
    outline-offset: 2px;
}

/* Care watch -------------------------------------------------------------- */
.care-watch {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 5px 7px;
    background: rgba(255, 79, 154, 0.12);
    border: 1.5px solid var(--coral);
    border-radius: var(--radius);
    color: var(--wine);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.03em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
}

.care-watch:hover,
.care-watch:focus-visible {
    background: rgba(255, 79, 154, 0.22);
}

.care-watch[hidden] {
    display: none;
}

/* Need survey care list --------------------------------------------------- */
.need-survey__watch {
    margin: 12px 0;
    padding: 9px 10px;
    background: rgba(255, 79, 154, 0.1);
    border: 1.5px solid var(--coral);
    border-radius: var(--radius);
}

.need-survey__watch ul {
    display: grid;
    gap: 5px;
    margin: 7px 0 0;
    padding: 0;
    list-style: none;
}

.need-survey__watch li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid rgba(33, 18, 37, 0.16);
}

.need-survey__watch li:last-child {
    border-bottom: 0;
}

.need-survey__watch button {
    padding: 3px 0;
    background: none;
    border: 0;
    color: var(--wine);
    font-family: var(--display);
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.need-survey__watch button:hover,
.need-survey__watch button:focus-visible {
    text-decoration: underline;
}

.need-survey__watch li span {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    text-transform: uppercase;
}

/* Visitor identity and visits --------------------------------------------- */
.visitor-card__identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.visitor-card__avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--lavender);
    color: var(--ink);
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    box-shadow: 2px 2px 0 rgba(33, 18, 37, 0.35);
}

.visitor-card__history {
    display: grid;
    gap: 4px;
    margin: 10px 0;
    padding-top: 8px;
    border-top: 1.5px solid rgba(33, 18, 37, 0.22);
}

.visitor-card__history p {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 1px 8px;
    margin: 0;
    padding: 5px 7px;
    background: rgba(255, 211, 110, 0.16);
    border: 1px solid rgba(33, 18, 37, 0.18);
    border-radius: var(--radius);
}

.visitor-card__history span {
    grid-row: 1 / 3;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    text-transform: uppercase;
}

.visitor-card__history strong {
    font-family: var(--display);
    font-size: 13px;
}

.visitor-card__history small {
    color: var(--ink-soft);
    font-size: 9.5px;
}

/* Service room manifest --------------------------------------------------- */
.service-rooms {
    margin: 10px 0 0;
    padding-top: 8px;
    border-top: 1.5px solid rgba(33, 18, 37, 0.22);
}

.service-rooms ul {
    display: grid;
    gap: 4px;
    margin: 5px 0 0;
    padding: 0;
    list-style: none;
}

.service-rooms li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 6px;
    background: rgba(255, 211, 110, 0.16);
    border: 1px solid rgba(33, 18, 37, 0.2);
    border-radius: var(--radius);
}

.service-rooms strong {
    font-family: var(--display);
    font-size: 14px;
}

.service-rooms span,
.service-rooms p {
    margin: 0;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
}

/* Charter journal --------------------------------------------------------- */
.charter-journal {
    width: min(620px, calc(100vw - 32px));
}

.charter-journal__list {
    display: grid;
    gap: 5px;
    max-height: 460px;
    overflow-y: auto;
    margin: 14px 0;
    padding: 0 4px 0 0;
    list-style: none;
}

.charter-journal__entry {
    display: grid;
    grid-template-columns: 46px 64px 1fr;
    align-items: baseline;
    gap: 2px 8px;
    padding: 6px 8px;
    background: rgba(255, 211, 110, 0.16);
    border-left: 4px solid var(--mint);
    border-radius: var(--radius);
}

.charter-journal__entry--build { border-left-color: var(--coral); }
.charter-journal__entry--commons { border-left-color: var(--sun); }
.charter-journal__entry--campaign { border-left-color: var(--wine); }
.charter-journal__entry--visitor { border-left-color: var(--lavender); }

.charter-journal__entry span,
.charter-journal__entry small {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.charter-journal__entry strong {
    font-family: var(--display);
    font-size: 14px;
    line-height: 1.2;
}

/* Milestones -------------------------------------------------------------- */
.milestones {
    width: min(560px, calc(100vw - 32px));
}

.milestones__list {
    display: grid;
    gap: 5px;
    max-height: 420px;
    overflow-y: auto;
    margin: 14px 0;
    padding: 0 4px 0 0;
    padding: 0;
    list-style: none;
}

.milestones__list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(33, 18, 37, 0.18);
    color: var(--ink-soft);
}

.milestones__list li span {
    width: 18px;
    flex: 0 0 18px;
    font-family: var(--mono);
    font-size: 13px;
}

.milestones__list li strong {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 600;
}

.milestones__list li.is-done {
    color: var(--ink);
}

.milestones__list li.is-done span {
    color: #1c7a60;
}

/* Earned milestones ------------------------------------------------------- */
.milestones__list li.is-earned span {
    color: var(--wine);
}

.milestones__list li small {
    margin-left: auto;
    color: var(--wine);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Resident roster --------------------------------------------------------- */
.resident-roster {
    width: min(600px, calc(100vw - 32px));
}

.resident-roster__list {
    display: grid;
    gap: 5px;
    max-height: 430px;
    overflow-y: auto;
    margin: 12px 0;
    padding: 0 4px 0 0;
    list-style: none;
}

.resident-roster__row button {
    display: grid;
    grid-template-columns: 32px 1fr 130px 44px;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    background: rgba(255, 211, 110, 0.16);
    border: 1.5px solid rgba(33, 18, 37, 0.22);
    border-radius: var(--radius);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.resident-roster__row.is-at-risk button {
    background: rgba(255, 79, 154, 0.12);
    border-color: var(--coral);
}

.resident-roster__row button:hover,
.resident-roster__row button:focus-visible {
    background: rgba(255, 211, 110, 0.3);
}

.resident-roster__avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    background: var(--lavender);
    font-family: var(--display);
    font-size: 13px;
    font-weight: 700;
}

.resident-roster__name {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 700;
}

.resident-roster__name small {
    display: block;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 400;
    text-transform: uppercase;
}

.resident-roster__need {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    text-align: right;
    text-transform: uppercase;
}

.resident-roster__need strong,
.resident-roster__well {
    color: var(--ink);
    font-family: var(--display);
    font-size: 17px;
}

.resident-roster__trial {
    display: block;
    padding: 6px 8px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
}

/* Daily request ----------------------------------------------------------- */
.daily-request {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 5px 7px;
    background: rgba(255, 211, 110, 0.22);
    border: 1.5px solid rgba(33, 18, 37, 0.35);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.02em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
}

.daily-request:hover,
.daily-request:focus-visible {
    background: rgba(255, 211, 110, 0.4);
}

.daily-request[hidden] {
    display: none;
}

/* Grid summary ------------------------------------------------------------ */
.grid-summary {
    width: min(720px, calc(100vw - 32px));
}

.grid-summary__body {
    display: grid;
    gap: 14px;
    max-height: 460px;
    overflow-y: auto;
    margin: 12px 0;
}

.grid-summary__body h4 {
    margin: 0 0 5px;
    font-family: var(--display);
    font-size: 16px;
    color: var(--wine);
}

.grid-summary__table {
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 9px;
}

.grid-summary__table th {
    width: 18px;
    color: var(--ink-soft);
    font-weight: 400;
    text-align: right;
    padding-right: 4px;
}

.grid-summary__table td {
    width: 26px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(33, 18, 37, 0.25);
    background: rgba(255, 211, 110, 0.18);
    text-align: center;
}

.grid-summary__table td.is-occupied {
    background: rgba(89, 227, 194, 0.35);
    font-weight: 700;
}

.grid-summary__table thead th {
    width: 26px;
    text-align: center;
    padding-bottom: 3px;
}

.service-card .modal__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.service-card .modal__actions .btn {
    width: 100%;
}

/* High contrast ----------------------------------------------------------- */
html.is-high-contrast {
    --ink: #07030a;
    --ink-soft: #2a0e2c;
    --paper: #fffdf2;
    --paper-warm: #fff8e4;
    --paper-deep: #f2e3c4;
    --border: 2px solid var(--ink);
}

html.is-high-contrast .paper,
html.is-high-contrast .modal,
html.is-high-contrast .objective-card,
html.is-high-contrast .standings-card,
html.is-high-contrast .charter-menu,
html.is-high-contrast .build-dock {
    border-width: 2px;
}

.hint[hidden] {
    display: none;
}

html.is-high-contrast :focus-visible {
    outline-color: var(--ink);
    outline-width: 3px;
    box-shadow: 0 0 0 2px var(--paper);
}

/* Service regulars -------------------------------------------------------- */
.service-regulars {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    padding: 8px 10px;
    border: 1px solid rgba(33, 18, 37, 0.28);
    border-radius: var(--radius);
    background: rgba(89, 227, 194, 0.12);
}

.service-regulars .kicker {
    width: 100%;
    color: var(--wine);
}

.service-regulars__person {
    min-height: 30px;
    padding: 5px 10px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 9px;
    cursor: pointer;
}

.service-regulars__person:hover,
.service-regulars__person:focus-visible {
    background: var(--mint);
}

/* Service interior -------------------------------------------------------- */
.service-interior {
    display: grid;
    gap: 3px;
    margin: 10px 0 0;
    padding: 8px 10px;
    border: 1px solid rgba(33, 18, 37, 0.28);
    border-radius: var(--radius);
    background: rgba(255, 211, 110, 0.14);
}

.service-interior .kicker {
    color: var(--wine);
    margin-bottom: 2px;
}

.service-interior__floor {
    display: grid;
    grid-template-columns: 78px 1fr auto;
    gap: 6px;
    align-items: baseline;
    padding: 3px 0;
    border-top: 1px dashed rgba(33, 18, 37, 0.18);
    font-family: var(--mono);
    font-size: 9px;
}

.service-interior__floor:first-of-type {
    border-top: 0;
}

.service-interior__floor span {
    white-space: nowrap;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.service-interior__floor strong {
    font-family: var(--display);
    font-size: 13px;
    font-weight: 600;
}

.service-interior__floor small {
    color: var(--ink-soft);
    font-size: 8px;
}

/* Photo mode -------------------------------------------------------------- */
.photo-exit {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 60;
    transform: translateX(-50%);
    min-height: 44px;
    padding: 8px 16px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

body.is-photo-mode .hud__top,
body.is-photo-mode .objective-card,
body.is-photo-mode .chart,
body.is-photo-mode .hud__bottom,
body.is-photo-mode .hud__hint,
body.is-photo-mode .standings-card,
body.is-photo-mode .care-watch {
    display: none !important;
}

.blueprint__count {
    position: absolute;
    top: 28px;
    right: 6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: var(--mint);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}

.blueprint__count[hidden] {
    display: none;
}

.service-card__title-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.service-card__rename {
    padding: 2px 6px;
    border: 1px solid rgba(33, 18, 37, 0.35);
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.service-rename {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    margin: 6px 0 10px;
}

.service-rename[hidden] {
    display: none;
}

.blueprint__count.is-worn {
    background: var(--coral);
    color: var(--paper);
}

/* Service roster ---------------------------------------------------------- */
.service-roster {
    width: min(620px, calc(100vw - 32px));
}

.service-roster__list {
    display: grid;
    gap: 6px;
    max-height: 430px;
    overflow-y: auto;
    margin: 10px 0;
}

.service-roster__row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 4px 12px;
    align-items: baseline;
    width: 100%;
    padding: 9px 11px;
    border: 1.5px solid rgba(33, 18, 37, 0.35);
    border-radius: var(--radius);
    background: var(--paper-warm);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.service-roster__row:hover,
.service-roster__row:focus-visible {
    background: var(--mint);
}

.service-roster__name {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 600;
}

.service-roster__meta,
.service-roster__numbers {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--ink-soft);
}

.service-roster__wear {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    padding: 3px 6px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 9px;
    white-space: nowrap;
}

.service-roster__wear.is-worn {
    background: var(--coral);
    color: var(--paper);
}

.report__warning--action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.report__warning--action .btn {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 8px;
    box-shadow: 2px 2px 0 var(--btn-shadow);
}

.end__motto {
    margin: -2px 0 10px;
    font-family: var(--display);
    font-size: 17px;
    font-style: italic;
    line-height: 1.15;
    color: var(--wine);
}

.end__motto[hidden] {
    display: none;
}

.service-roster__repair {
    grid-column: 1 / -1;
    justify-self: start;
    min-height: 26px;
    padding: 3px 9px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: var(--mint);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.charter-archive__motto {
    display: block;
    margin: 1px 0 2px;
    font-family: var(--display);
    font-size: 13px;
    color: var(--wine);
}

.charter-archive__best {
    margin: 0 0 10px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--wine);
    letter-spacing: 0.02em;
}

.charter-archive__best strong {
    color: var(--ink);
}

.objective-card__motto {
    margin: 1px 0 5px;
    font-family: var(--display);
    font-size: 14px;
    font-style: italic;
    line-height: 1.1;
    color: var(--wine);
}

.objective-card__motto[hidden] {
    display: none;
}

.service-interior {
    width: min(660px, calc(100vw - 40px));
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.service-interior__rooms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
}

.interior-room {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border: 2px solid var(--ink);
    border-radius: 3px;
    background: var(--mint);
    box-shadow: var(--shadow-hard);
}

.interior-room strong {
    font-family: var(--display);
    font-size: 20px;
}

.interior-room span:last-child {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--wine);
}

.service-interior__label {
    margin: 4px 0 6px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.service-interior__people {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.service-interior__people li {
    display: grid;
    gap: 1px;
    padding: 6px 9px;
    border: 1.5px solid var(--ink);
    border-radius: 2px;
    background: var(--paper);
}

.service-interior__people li strong {
    font-size: 13px;
}

.service-interior__people li span {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--ink-soft);
}

.service-interior__empty {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-soft);
    border-style: dashed !important;
}

.service-interior {
    background: var(--paper);
    color: var(--ink);
    border: 3px solid var(--ink);
    box-shadow: var(--shadow-hard);
    padding: 24px 28px;
}

.interior-room__people {
    font-family: var(--body) !important;
    font-size: 11px !important;
    line-height: 1.25;
    color: var(--ink) !important;
    border-top: 1px solid rgba(33, 18, 37, 0.25);
    padding-top: 4px;
}

.interior-room__move {
    padding: 0 3px;
    border: 1px solid var(--ink);
    border-radius: 2px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-size: 10px;
    line-height: 1.1;
    cursor: pointer;
}

.interior-room__move:disabled {
    opacity: 0.25;
    cursor: default;
}

.charter-archive__filters {
    display: flex;
    gap: 6px;
    margin: 0 0 10px;
}

.charter-archive__sort-label {
    margin-left: 10px;
    align-self: center;
    color: var(--ink-soft);
}

.service-interior__staff {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.service-interior__staff select {
    min-width: 180px;
    padding: 6px 8px;
    border: 2px solid var(--ink);
    border-radius: 2px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
}

.charter-archive__drift {
    margin: 0 0 8px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
}

.menu__drift {
    margin: 0 0 16px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--cream);
    opacity: 0.75;
}
