/* AlgoWars — baseline M2 styling.
   Polish pass lands in M6 alongside the cylindrical pan + zoom work. */

html, body {
    margin: 0;
    padding: 0;
    background: #090908;
    color: #e6e6e6;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 4.25rem;
    padding: 0.55rem 1.5rem;
    background: rgba(5, 5, 4, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 4.5rem;
    text-decoration: none;
}

.brand-lockup img {
    display: block;
    width: 4.2rem;
    height: 3.2rem;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(212, 167, 106, 0.35));
}

.sound-control {
    display: grid;
    justify-items: center;
    gap: 0.32rem;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
}

.board-control-frame {
    position: relative;
}

.map-audio-control {
    position: absolute;
    bottom: 0.72rem;
    z-index: 66;
    display: grid;
    min-width: 11.25rem;
    min-height: 3.35rem;
    align-content: center;
    padding: 0.48rem 0.64rem;
    border: 1px solid rgba(244, 211, 94, 0.22);
    border-radius: 6px;
    background: rgba(5, 8, 10, 0.82);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(10px);
}

.map-audio-control--sound {
    left: clamp(13.5rem, 18vw, 18.35rem);
    width: 12.35rem;
}

.map-audio-control--spotlight {
    right: clamp(13.5rem, 18vw, 18.35rem);
    width: 12.35rem;
    justify-items: center;
}

.sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    min-height: 2rem;
    padding: 0.32rem 0.62rem;
    border: 1px solid rgba(244, 211, 94, 0.34);
    border-radius: 999px;
    background: rgba(244, 211, 94, 0.1);
    color: #f4d35e;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}

.sound-toggle:hover {
    background: rgba(244, 211, 94, 0.18);
    border-color: rgba(244, 211, 94, 0.56);
    color: #ffe28a;
}

.sound-toggle.is-muted {
    border-color: rgba(185, 193, 204, 0.26);
    background: rgba(185, 193, 204, 0.08);
    color: #b9c1cc;
}

.sound-toggle__icon {
    display: inline-grid;
    place-items: center;
    min-width: 2rem;
    min-height: 1.25rem;
    padding: 0 0.24rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    color: inherit;
    font-size: 0.62rem;
    font-weight: 950;
}

.sound-now-playing {
    width: 100%;
    max-width: 100%;
    min-height: 1rem;
    color: #f4d35e;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    line-height: 1;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.volume-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 2.25rem;
    align-items: center;
    gap: 0.36rem;
    width: 100%;
    color: rgba(244, 211, 94, 0.78);
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.volume-control input[type="range"] {
    width: 100%;
    accent-color: #f4d35e;
}

.volume-control strong {
    color: #f4d35e;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.app-header .status {
    font-size: 0.95rem;
    color: #b9c1cc;
}

.app-header .status strong {
    color: #f4d35e;
    text-transform: capitalize;
}

.app-header .winner {
    color: #a5ff8a;
    font-weight: bold;
}

.app-header .error {
    color: #ff7a7a;
    font-weight: 500;
}

.app-header .wallet-slot {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}

.app-header .awar-balance {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.6rem;
    background: rgba(58, 130, 95, 0.18);
    border: 1px solid rgba(120, 200, 160, 0.35);
    border-radius: 4px;
    font-size: 0.85rem;
    color: #d4e8d6;
    font-variant-numeric: tabular-nums;
}

.app-header .awar-balance__amount { font-weight: 600; }
.app-header .awar-balance__link {
    color: #9cd5b1;
    text-decoration: none;
    font-size: 0.8rem;
    border-left: 1px solid rgba(120, 200, 160, 0.35);
    padding-left: 0.5rem;
}
.app-header .awar-balance__link:hover { color: #fff; }

.app-header .player-tag {
    color: #b9c1cc;
    font-variant-numeric: tabular-nums;
}

.app-header .player-tag strong {
    color: #a5ff8a;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.03em;
}

.app-header .auth-badge {
    background: rgba(165, 255, 138, 0.14);
    color: #a5ff8a;
    border: 1px solid rgba(165, 255, 138, 0.34);
    border-radius: 999px;
    padding: 0.05rem 0.55rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: help;
}

.app-header .auth-badge--joined {
    background: rgba(244, 211, 94, 0.18);
    color: #f4d35e;
    border-color: rgba(244, 211, 94, 0.38);
}

.wallet-btn {
    background: #f4d35e;
    color: #1a1c22;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease-out, transform 0.15s ease-out;
}

.wallet-btn:hover:not(:disabled) {
    background: #ffe28a;
}

.wallet-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.wallet-btn--link {
    background: transparent;
    color: #b9c1cc;
    padding: 0.25rem 0.4rem;
    text-decoration: underline;
    font-weight: 400;
}

.wallet-btn--link:hover:not(:disabled) {
    background: transparent;
    color: #ffe28a;
}

.casualty-chip {
    position: relative;
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    min-width: 10.5rem;
    min-height: 4rem;
    padding: 0.45rem 0.75rem 0.45rem 0.45rem;
    border: 1px solid rgba(185, 193, 204, 0.26);
    border-radius: 8px;
    background: rgba(18, 22, 28, 0.92);
    color: #e6e6e6;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease-out, background 0.15s ease-out, transform 0.15s ease-out;
}

.casualty-chip:hover:not(:disabled) {
    border-color: rgba(244, 211, 94, 0.62);
    background: rgba(32, 38, 48, 0.96);
    transform: translateY(-1px);
}

.casualty-chip--selected {
    border-color: rgba(255, 122, 122, 0.86);
    background: rgba(78, 28, 30, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255, 122, 122, 0.18);
}

.casualty-chip--disabled {
    opacity: 0.58;
    cursor: default;
}

/* Damaged state for HP > 1 units that took a hit but weren't destroyed
   (battleship, aircraft carrier in 2E). Visual cue: amber glow + DMG badge
   so players see "one more hit kills this" without re-reading rules. */
.casualty-chip--damaged {
    border-color: rgba(255, 178, 102, 0.78);
    box-shadow: inset 0 0 0 1px rgba(255, 178, 102, 0.18),
                0 0 8px rgba(255, 178, 102, 0.18);
}

.casualty-chip__damage {
    position: absolute;
    top: 0.32rem;
    right: 0.32rem;
    padding: 0.05rem 0.32rem;
    border-radius: 999px;
    background: rgba(255, 122, 51, 0.92);
    color: #1a1209;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.casualty-chip__img {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.42));
}

.casualty-chip__fallback {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 6px;
    background: rgba(244, 211, 94, 0.12);
    color: #f4d35e;
    font-size: 0.75rem;
    font-weight: 850;
}

.casualty-chip__meta {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.casualty-chip__name {
    overflow: hidden;
    color: #f3f5f8;
    font-size: 0.9rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.casualty-chip__owner {
    overflow: hidden;
    color: #b9c1cc;
    font-size: 0.72rem;
    font-weight: 750;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.casualty-chip__count {
    position: absolute;
    top: 0.35rem;
    right: 0.4rem;
    min-width: 1.35rem;
    padding: 0.1rem 0.32rem;
    border-radius: 999px;
    background: rgba(244, 211, 94, 0.16);
    color: #ffe28a;
    font-size: 0.7rem;
    font-weight: 900;
    text-align: center;
}

/* Pera's connect modal ships at z-index:10; lift above any Blazor overlay. */
.pera-wallet-modal,
.pera-wallet-connect-modal {
    z-index: 10000 !important;
}

.signin-gate {
    max-width: 640px;
    margin: 4rem auto;
    padding: 2rem 2.25rem;
    background: rgba(30, 35, 42, 0.72);
    border: 1px solid rgba(170, 185, 201, 0.16);
    border-radius: 14px;
    text-align: center;
}

.signin-gate h2 {
    margin: 0 0 0.75rem;
    color: #f4d35e;
    font-size: 1.35rem;
}

.signin-gate p {
    margin: 0;
    color: #b9c1cc;
    line-height: 1.55;
}

.signin-gate p + p,
.signin-gate p + button,
.signin-gate button + p {
    margin-top: 1rem;
}

.signin-gate__meta {
    font-size: 0.88rem;
    color: #8a96a4;
}

.signin-gate__meta code {
    color: #cfd7e1;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
}

.signin-gate__error {
    color: #ff9b9b;
    font-size: 0.9rem;
}

.wallet-btn--primary {
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    background: #00dbe9;
    color: #051013;
}

.wallet-btn--primary:hover:not(:disabled) {
    background: #7ef4ff;
}

.lobby-shell {
    position: relative;
    min-height: calc(100vh - 4.25rem);
    padding: clamp(1.25rem, 3vw, 3rem);
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.24) 42%, rgba(0, 0, 0, 0.82)),
        linear-gradient(90deg, rgba(212, 167, 106, 0.12), transparent 42%, transparent 58%, rgba(0, 219, 233, 0.12)),
        url("../img/lobby_bg.png") center / cover no-repeat;
}

.lobby-shell::before,
.lobby-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.lobby-shell::before {
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 219, 233, 0.035) 50%);
    background-size: 100% 4px;
    opacity: 0.7;
}

.lobby-shell::after {
    background:
        radial-gradient(circle at 18% 12%, rgba(212, 167, 106, 0.18), transparent 26%),
        radial-gradient(circle at 82% 20%, rgba(0, 219, 233, 0.14), transparent 30%);
    mix-blend-mode: screen;
    opacity: 0.65;
}

.lobby-shell--loading {
    display: grid;
    place-items: center;
}

.lobby-boot {
    position: relative;
    z-index: 1;
    width: min(22rem, 86vw);
    display: grid;
    justify-items: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(0, 20, 25, 0.68);
    border: 1px solid rgba(0, 219, 233, 0.34);
    backdrop-filter: blur(14px);
    box-shadow:
        inset 0 0 24px rgba(0, 219, 233, 0.06),
        0 0 28px rgba(0, 219, 233, 0.12);
}

.lobby-boot img {
    width: 8rem;
    height: 6.8rem;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(212, 167, 106, 0.36));
}

.lobby-hero,
.lobby-grid,
.lobby__error {
    position: relative;
    z-index: 1;
}

.lobby-hero {
    max-width: 1440px;
    margin: 0 auto 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1.5rem;
    padding-left: 1.25rem;
    border-left: 2px solid rgba(212, 167, 106, 0.55);
}

.lobby-kicker {
    margin: 0 0 0.45rem;
    color: rgba(229, 226, 225, 0.62);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.lobby-hero h2 {
    margin: 0;
    color: #d4a76a;
    font-size: clamp(2.5rem, 6vw, 5.25rem);
    font-style: italic;
    font-weight: 950;
    line-height: 0.95;
    text-transform: uppercase;
    text-shadow: 0 0 26px rgba(212, 167, 106, 0.22);
}

.lobby-brief {
    max-width: 44rem;
    margin: 0.85rem 0 0;
    color: rgba(229, 226, 225, 0.78);
    font-size: 0.95rem;
    line-height: 1.6;
}

.lobby-era-readout {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: rgba(229, 226, 225, 0.62);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.lobby-era-readout span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.era-pip,
.status-led {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    display: inline-block;
}

.era-pip--gold {
    background: #d4a76a;
    box-shadow: 0 0 12px rgba(212, 167, 106, 0.75);
}

.era-pip--cyan,
.status-led--live {
    background: #00dbe9;
    box-shadow: 0 0 12px rgba(0, 219, 233, 0.75);
}

.lobby-grid {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(19rem, 0.85fr);
    gap: 2rem;
    align-items: start;
}

.lobby-main,
.lobby-side {
    display: grid;
    gap: 1.5rem;
}

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

.lobby-panel {
    position: relative;
    padding: 1.35rem;
    border-radius: 2px;
    overflow: hidden;
}

.lobby-panel--sim,
.lobby-panel--access {
    background: rgba(0, 20, 25, 0.68);
    border: 1px solid rgba(0, 219, 233, 0.34);
    box-shadow:
        inset 0 0 24px rgba(0, 219, 233, 0.06),
        0 0 26px rgba(0, 219, 233, 0.08);
    backdrop-filter: blur(14px);
}

.lobby-panel--orders,
.lobby-panel--create {
    background: rgba(28, 23, 18, 0.84);
    border: 1px solid rgba(212, 167, 106, 0.24);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(8px);
}

.lobby-panel--orders {
    border-style: dashed;
    min-height: 15rem;
}

.lobby-panel__heading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.lobby-panel__heading--stack {
    align-items: flex-start;
}

.lobby-panel__heading h3 {
    margin: 0;
    color: #e5e2e1;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.lobby-panel__heading p {
    margin: 0.35rem 0 0;
    color: rgba(229, 226, 225, 0.68);
    font-size: 0.82rem;
    line-height: 1.45;
}

.panel-icon {
    display: inline-grid;
    place-items: center;
    width: 1.65rem;
    height: 1.25rem;
    color: #d4a76a;
    border: 1px solid rgba(212, 167, 106, 0.34);
    background: rgba(212, 167, 106, 0.08);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.58rem;
    font-weight: 900;
}

.panel-icon--large {
    width: 2.55rem;
    height: 2.55rem;
    font-size: 0.8rem;
}

.panel-icon--round {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    color: #00dbe9;
    border-color: rgba(0, 219, 233, 0.34);
    background: rgba(0, 219, 233, 0.08);
}

.operation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    padding: 0.65rem 0;
}

.operation-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.operation-title-row strong {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 900;
}

.hud-chip {
    padding: 0.18rem 0.42rem;
    border-radius: 2px;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hud-chip--cyan {
    color: #7ef4ff;
    background: rgba(0, 219, 233, 0.14);
    border: 1px solid rgba(0, 219, 233, 0.36);
}

.operation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1.1rem;
    margin-top: 0.6rem;
    color: rgba(229, 226, 225, 0.7);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.operation-meta b {
    color: rgba(0, 219, 233, 0.66);
}

.command-btn {
    min-height: 2.6rem;
    padding: 0.65rem 1rem;
    border-radius: 2px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        filter 0.16s ease-out,
        transform 0.16s ease-out,
        background 0.16s ease-out;
}

.command-btn:hover:not(:disabled) {
    filter: brightness(1.12);
}

.command-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.command-btn:disabled {
    cursor: default;
    opacity: 0.55;
}

.command-btn--cyan {
    background: #00dbe9;
    color: #021113;
    box-shadow: 0 0 18px rgba(0, 219, 233, 0.34);
}

.command-btn--gold {
    width: 100%;
    background: #d4a76a;
    color: #1b1206;
    box-shadow: 0 0 18px rgba(212, 167, 106, 0.3);
}

.command-btn--header {
    width: auto;
    min-height: 2.05rem;
    padding: 0.42rem 0.8rem;
    font-size: 0.68rem;
}

.command-btn--ghost {
    color: #e5e2e1;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.13);
}

.command-btn--ghost:hover:not(:disabled) {
    color: #021113;
    background: #00dbe9;
    border-color: #00dbe9;
}

.empty-signal {
    min-height: 8.5rem;
    display: grid;
    place-items: center;
    color: rgba(212, 167, 106, 0.46);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-align: center;
    text-transform: uppercase;
    border: 1px dashed rgba(212, 167, 106, 0.18);
}

.lobby__error {
    color: #ff9b9b;
    background: rgba(58, 31, 31, 0.6);
    border: 1px solid rgba(106, 41, 41, 0.6);
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.lobby__section {
    background: rgba(30, 35, 42, 0.72);
    border: 1px solid rgba(170, 185, 201, 0.16);
    border-radius: 12px;
    padding: 1.1rem 1.4rem;
}

.lobby__section--mine {
    border-color: rgba(244, 211, 94, 0.4);
}

.lobby__section h2 {
    margin: 0 0 0.5rem;
    color: #f4d35e;
    font-size: 1.1rem;
}

.lobby__hint {
    margin: 0 0 0.8rem;
    color: #8a96a4;
    font-size: 0.88rem;
    line-height: 1.45;
}

.lobby__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.lobby__game-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    border-radius: 0;
}

.lobby__game-row:last-child {
    border-bottom: 0;
}

.lobby__game-id code {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #cfd7e1;
    font-size: 0.85rem;
}

.lobby__game-status {
    flex: 1;
    color: rgba(229, 226, 225, 0.72);
    font-size: 0.82rem;
}

.lobby__paste {
    display: flex;
    gap: 0.5rem;
}

.lobby__paste input {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.75rem;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(0, 219, 233, 0.22);
    border-radius: 2px;
    color: #7ef4ff;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
}

.lobby__paste input:focus {
    outline: none;
    border-color: rgba(0, 219, 233, 0.72);
    box-shadow: 0 0 0 1px rgba(0, 219, 233, 0.18);
}

.lobby-sync {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(229, 226, 225, 0.46);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.lobby-sync > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.lobby-sync strong {
    color: rgba(0, 219, 233, 0.72);
}

.sync-bars {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr 0.5fr 1fr;
    gap: 0.25rem;
}

.sync-bars i {
    height: 0.25rem;
    background: rgba(255, 255, 255, 0.12);
}

.sync-bars i:nth-child(1),
.sync-bars i:nth-child(2) {
    background: rgba(212, 167, 106, 0.52);
}

.sync-bars i:nth-child(3),
.sync-bars i:nth-child(4) {
    background: rgba(0, 219, 233, 0.54);
}

.pledge-screen {
    min-height: calc(100vh - 4.25rem);
    display: grid;
    align-items: center;
    justify-items: center;
    padding: clamp(1.25rem, 4vw, 4rem);
    background:
        linear-gradient(90deg, rgba(10, 8, 5, 0.72), rgba(10, 8, 5, 0.48) 50%, rgba(10, 8, 5, 0.72)),
        radial-gradient(circle at 50% 42%, rgba(212, 167, 106, 0.2), transparent 34%),
        url("../img/pledge_bg.png") center / cover no-repeat;
    position: relative;
    overflow: hidden;
}

.pledge-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to bottom, transparent 50%, rgba(212, 167, 106, 0.035) 50%),
        radial-gradient(circle at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.4) 100%);
    background-size: 100% 5px, auto;
}

.pledge-poster {
    position: relative;
    z-index: 1;
    width: min(47rem, 94vw);
    justify-self: center;
    padding: clamp(1.4rem, 4vw, 3rem);
    background:
        linear-gradient(180deg, rgba(54, 38, 24, 0.92), rgba(28, 21, 15, 0.9)),
        repeating-linear-gradient(135deg, rgba(255, 239, 196, 0.035) 0 2px, transparent 2px 7px);
    border: 2px solid rgba(212, 167, 106, 0.58);
    box-shadow:
        inset 0 0 42px rgba(0, 0, 0, 0.46),
        0 28px 70px rgba(0, 0, 0, 0.45);
}

.pledge-poster::before,
.pledge-poster::after {
    content: "";
    position: absolute;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: rgba(212, 167, 106, 0.42);
}

.pledge-poster::before {
    top: 1rem;
}

.pledge-poster::after {
    bottom: 1rem;
}

.pledge-poster__stamp {
    width: fit-content;
    margin-bottom: 1.4rem;
    padding: 0.35rem 0.55rem;
    color: #261900;
    background: #d4a76a;
    border: 1px solid rgba(255, 223, 180, 0.7);
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transform: rotate(-1.2deg);
    box-shadow: 0 0 20px rgba(212, 167, 106, 0.2);
}

.pledge-kicker {
    margin: 0 0 0.45rem;
    color: rgba(255, 223, 180, 0.68);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.pledge-poster h2 {
    max-width: 11ch;
    margin: 0 0 1.35rem;
    color: #ffe2aa;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 7vw, 5.6rem);
    font-style: italic;
    font-weight: 950;
    line-height: 0.9;
    text-transform: uppercase;
    text-shadow:
        0 2px 0 rgba(36, 20, 8, 0.78),
        0 0 24px rgba(212, 167, 106, 0.18);
}

.pledge-copy {
    max-width: 40rem;
    display: grid;
    gap: 0.65rem;
    color: rgba(255, 246, 220, 0.86);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.55;
}

.pledge-copy p {
    margin: 0;
}

.pledge-copy strong {
    color: #ffe2aa;
}

.pledge-footnote {
    color: #ffcf8a;
    font-size: 0.8rem;
    line-height: 1.45;
}

.pledge-ledger {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 1.65rem 0;
    padding-top: 1rem;
    border-top: 1px dashed rgba(212, 167, 106, 0.36);
}

.pledge-ledger span {
    display: grid;
    gap: 0.15rem;
    color: rgba(255, 246, 220, 0.56);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.pledge-ledger strong {
    min-width: 0;
    overflow: hidden;
    color: #fff6dc;
    font-size: 0.78rem;
    text-overflow: ellipsis;
}

.pledge-bundles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin: -0.7rem 0 1rem;
}

.pledge-bundles > span {
    color: rgba(255, 246, 220, 0.62);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pledge-bundle {
    display: inline-flex;
    gap: 0.35rem;
    align-items: baseline;
    min-height: 2.1rem;
    padding: 0.34rem 0.62rem;
    border: 1px solid rgba(255, 246, 220, 0.18);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.28);
    color: #fff6dc;
    font-size: 0.82rem;
    font-weight: 950;
    cursor: pointer;
}

.pledge-bundle small {
    color: rgba(255, 246, 220, 0.58);
    font-size: 0.66rem;
    font-weight: 850;
}

.pledge-bundle--selected {
    border-color: rgba(244, 211, 94, 0.74);
    background: rgba(244, 211, 94, 0.14);
    color: #f4d35e;
}

.pledge-button {
    width: min(24rem, 100%);
    min-height: 3.5rem;
    padding: 0.85rem 1.2rem;
    color: #211404;
    background: #d4a76a;
    border: 2px solid #ffdfb4;
    border-radius: 2px;
    box-shadow:
        0 0 28px rgba(212, 167, 106, 0.28),
        inset 0 -3px 0 rgba(78, 50, 10, 0.28);
    font-size: 0.95rem;
    font-weight: 950;
    letter-spacing: 0.12em;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-transform: uppercase;
    cursor: pointer;
}

.pledge-button:hover:not(:disabled) {
    filter: brightness(1.08);
}

.pledge-button:disabled {
    cursor: default;
    opacity: 0.62;
}

.pledge-supply {
    margin: 1rem 0 0;
    color: rgba(255, 246, 220, 0.62);
    font-size: 0.86rem;
}

.pledge-supply a {
    color: #7ef4ff;
}

.pledge-error {
    margin: 0.8rem 0 0;
    color: #ffb4ab;
    font-weight: 800;
}

.pledge-success,
.pledge-hint {
    margin: 0.8rem 0 0;
    padding: 0.6rem 0.7rem;
    border-radius: 4px;
    font-size: 0.84rem;
    line-height: 1.4;
}

.pledge-success {
    border: 1px solid rgba(165, 255, 138, 0.3);
    background: rgba(47, 85, 47, 0.48);
    color: #d7ffd0;
}

.pledge-hint {
    border: 1px solid rgba(255, 207, 138, 0.32);
    background: rgba(76, 51, 18, 0.45);
    color: #ffe2b8;
}

.landing-screen {
    min-height: calc(100vh - 4.25rem);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(19rem, 0.9fr);
    gap: clamp(1.25rem, 4vw, 3rem);
    align-items: center;
    padding: clamp(1.25rem, 4vw, 4rem);
    background:
        linear-gradient(90deg, rgba(5, 5, 4, 0.9), rgba(5, 5, 4, 0.58) 48%, rgba(5, 5, 4, 0.82)),
        linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.76)),
        url("../img/landing_bg.png") center / cover no-repeat;
    position: relative;
    overflow: hidden;
}

.landing-screen::before,
.landing-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.landing-screen::before {
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 219, 233, 0.028) 50%);
    background-size: 100% 4px;
}

.landing-screen::after {
    background:
        radial-gradient(circle at 22% 16%, rgba(212, 167, 106, 0.22), transparent 30%),
        radial-gradient(circle at 78% 36%, rgba(0, 219, 233, 0.14), transparent 32%);
    opacity: 0.8;
}

.landing-hero,
.landing-briefing {
    position: relative;
    z-index: 1;
}

.landing-hero {
    max-width: 48rem;
    padding-left: 1.25rem;
    border-left: 2px solid rgba(212, 167, 106, 0.58);
}

.landing-hero__banner {
    display: block;
    width: min(34rem, 92vw);
    height: auto;
    max-height: 13.5rem;
    object-fit: contain;
    object-position: left center;
    margin: 0 0 1.1rem -0.35rem;
    filter:
        drop-shadow(0 0 16px rgba(212, 167, 106, 0.34))
        drop-shadow(0 0 26px rgba(0, 219, 233, 0.08));
}

.landing-kicker {
    margin: 0 0 0.55rem;
    color: rgba(126, 244, 255, 0.78);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.landing-hero h2 {
    max-width: 10ch;
    margin: 0;
    color: #d4a76a;
    font-size: clamp(3rem, 7vw, 6rem);
    font-style: italic;
    font-weight: 950;
    line-height: 0.88;
    text-transform: uppercase;
    text-shadow:
        0 2px 0 rgba(32, 18, 7, 0.76),
        0 0 28px rgba(212, 167, 106, 0.22);
}

.landing-lede {
    max-width: 42rem;
    margin: 1.25rem 0 0;
    color: rgba(229, 226, 225, 0.82);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.65;
}

.landing-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.6rem;
}

.landing-actions .command-btn {
    width: auto;
    min-width: 13.5rem;
}

.landing-actions span {
    max-width: 20rem;
    color: rgba(229, 226, 225, 0.62);
    font-size: 0.86rem;
    line-height: 1.45;
}

.landing-pera-help {
    max-width: 42rem;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    background: rgba(0, 20, 25, 0.66);
    border: 1px solid rgba(0, 219, 233, 0.26);
    box-shadow: inset 0 0 24px rgba(0, 219, 233, 0.05);
    backdrop-filter: blur(12px);
}

.landing-pera-help__heading {
    display: grid;
    gap: 0.2rem;
    margin-bottom: 0.55rem;
}

.landing-pera-help__heading span {
    color: rgba(126, 244, 255, 0.78);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.landing-pera-help h3 {
    margin: 0;
    color: #fff6dc;
    font-size: 1rem;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.landing-pera-help p {
    margin: 0;
    color: rgba(229, 226, 225, 0.74);
    font-size: 0.9rem;
    line-height: 1.55;
}

.landing-pera-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.landing-pera-links a,
.landing-pera-help__note a {
    color: #7ef4ff;
    font-weight: 800;
    text-decoration: none;
}

.landing-pera-links a {
    display: inline-flex;
    align-items: center;
    min-height: 2.15rem;
    padding: 0.44rem 0.72rem;
    border: 1px solid rgba(126, 244, 255, 0.3);
    background: rgba(126, 244, 255, 0.08);
    color: #d6fbff;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.landing-pera-links a:first-child {
    border-color: rgba(212, 167, 106, 0.42);
    background: rgba(212, 167, 106, 0.14);
    color: #ffe0a6;
}

.landing-pera-links a:hover,
.landing-pera-help__note a:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.42);
}

.landing-pera-help__note {
    margin-top: 0.75rem !important;
    color: rgba(229, 226, 225, 0.62) !important;
    font-size: 0.82rem !important;
}

.landing-briefing {
    display: grid;
    gap: 0.85rem;
}

.landing-briefing__card {
    padding: 1.2rem;
    background: rgba(0, 20, 25, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.28);
}

.landing-briefing__card--gold {
    background: rgba(31, 24, 17, 0.82);
    border-color: rgba(212, 167, 106, 0.28);
}

.landing-briefing__card--cyan {
    border-color: rgba(0, 219, 233, 0.32);
    box-shadow:
        inset 0 0 24px rgba(0, 219, 233, 0.06),
        0 0 24px rgba(0, 219, 233, 0.08);
}

.landing-briefing__card span {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 1.35rem;
    margin-bottom: 0.75rem;
    color: #261900;
    background: #d4a76a;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.68rem;
    font-weight: 950;
}

.landing-briefing__card--cyan span {
    color: #002022;
    background: #00dbe9;
}

.landing-briefing__card h3 {
    margin: 0 0 0.4rem;
    color: #fff6dc;
    font-size: 0.92rem;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.landing-briefing__card p {
    margin: 0;
    color: rgba(229, 226, 225, 0.74);
    font-size: 0.9rem;
    line-height: 1.55;
}

/* Blazor's default error banner. Hidden until Blazor toggles display=block
   on an unhandled exception. The default .NET template ships this rule —
   reproducing it here because it got lost somewhere in setup. */
#blazor-error-ui {
    background: #3a1f1f;
    border-top: 1px solid #6a2929;
    color: #ff9b9b;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
#blazor-error-ui .reload {
    color: #ffe28a;
}

.board-wrapper {
    min-height: calc(100vh - 4.25rem);
    display: grid;
    grid-template-columns: minmax(13.5rem, 18rem) minmax(0, 1fr) minmax(13.5rem, 18rem);
    align-items: start;
    gap: 0;
    padding: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(4, 5, 5, 0.42) 42%, rgba(0, 0, 0, 0.86)),
        radial-gradient(circle at 18% 10%, rgba(212, 167, 106, 0.18), transparent 26%),
        radial-gradient(circle at 80% 18%, rgba(0, 219, 233, 0.1), transparent 30%),
        url("../img/lobby_bg.png") center / cover no-repeat;
}

.board-shell {
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 1px solid rgba(212, 167, 106, 0.24);
    border-top: 0;
    border-radius: 0;
    overflow: hidden;
    background: rgba(10, 12, 13, 0.9);
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.58),
        inset 0 1px 0 rgba(255, 238, 192, 0.08);
    backdrop-filter: blur(10px);
}

.board-player-rail {
    position: sticky;
    top: 4.25rem;
    z-index: 8;
    display: grid;
    align-content: start;
    gap: 0.72rem;
    min-width: 0;
    min-height: calc(100vh - 4.25rem);
    padding: 10.7rem 0 1rem;
    pointer-events: none;
}

.board-player-rail--allies {
    padding-left: 1rem;
    padding-right: 0.35rem;
}

.board-player-rail--axis {
    padding-left: 0.35rem;
    padding-right: 1rem;
}

/* Per-side victory-city meter. Sits at the top of each rail, above the nation
   portraits. The fill width is driven by --vc-progress (0–100), set inline by
   the Razor component each render. Allies = blue, Axis = red. */
.board-vc-meter {
    --vc-progress: 0;
    --vc-accent: 200, 220, 240;
    --vc-accent-strong: 132, 198, 255;
    display: grid;
    gap: 0.32rem;
    margin: 0 0 0.65rem;
    padding: 0.45rem 0.65rem 0.5rem;
    color: #f4ead7;
    background: linear-gradient(180deg, rgba(8, 12, 18, 0.92), rgba(4, 7, 12, 0.92));
    border: 1px solid rgba(var(--vc-accent), 0.45);
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 6px 14px rgba(0, 0, 0, 0.42);
    pointer-events: auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.board-vc-meter--allies {
    --vc-accent: 86, 160, 220;          /* blue rim */
    --vc-accent-strong: 132, 198, 255;  /* fill highlight */
}

.board-vc-meter--axis {
    --vc-accent: 200, 80, 70;           /* red rim */
    --vc-accent-strong: 245, 132, 110;  /* fill highlight */
}

.board-vc-meter__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    color: rgba(244, 234, 215, 0.78);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.board-vc-meter__count {
    color: rgba(244, 234, 215, 0.86);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
}

.board-vc-meter__count strong {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0;
}

.board-vc-meter__title {
    color: rgba(var(--vc-accent-strong), 0.92);
}

.board-vc-meter__track {
    position: relative;
    height: 0.55rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(var(--vc-accent), 0.32);
    overflow: hidden;
}

.board-vc-meter__fill {
    position: absolute;
    inset: 0;
    width: calc(var(--vc-progress, 0) * 1%);
    background: linear-gradient(
        90deg,
        rgba(var(--vc-accent), 0.85),
        rgba(var(--vc-accent-strong), 0.95)
    );
    box-shadow: 0 0 10px rgba(var(--vc-accent-strong), 0.45);
    transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.board-vc-meter.is-victorious {
    border-color: rgba(var(--vc-accent-strong), 0.92);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 18px rgba(var(--vc-accent-strong), 0.55);
}

.board-vc-meter.is-victorious .board-vc-meter__fill {
    background: linear-gradient(
        90deg,
        rgba(var(--vc-accent-strong), 1),
        #fff5cc
    );
}

.board-command-banner {
    display: grid;
    grid-template-columns: minmax(8.5rem, auto) minmax(0, 1fr);
    align-items: center;
    gap: 0.85rem;
    padding: 0.78rem 0.9rem;
    background:
        linear-gradient(90deg, rgba(29, 21, 14, 0.92), rgba(11, 18, 23, 0.9)),
        linear-gradient(180deg, rgba(212, 167, 106, 0.1), transparent);
    border-bottom: 1px solid rgba(212, 167, 106, 0.22);
}

.board-command-banner__title {
    display: grid;
    gap: 0.12rem;
    color: rgba(244, 234, 215, 0.65);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.board-command-banner__title strong {
    color: #d4a76a;
    font-size: 0.86rem;
    letter-spacing: 0.08em;
}

.board-nation-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(7.1rem, 1fr));
    gap: 0.48rem;
}

.board-nation-ipc {
    display: grid;
    grid-template-columns: minmax(5.15rem, 5.8rem) minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: 0.58rem;
    min-width: 0;
    min-height: 6.65rem;
    padding: 0.58rem 0.66rem;
    color: #f4ead7;
    background: #070a0c;
    border: 1px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: border-color 0.14s ease-out, background 0.14s ease-out, box-shadow 0.14s ease-out;
    pointer-events: auto;
}

.board-player-rail--axis .board-nation-ipc {
    grid-template-columns: minmax(0, 1fr) minmax(5.15rem, 5.8rem);
    border-radius: 6px 0 0 6px;
}

.board-nation-ipc.is-current {
    opacity: 1;
    filter: none;
    background:
        linear-gradient(180deg, rgba(212, 167, 106, 0.22), rgba(7, 10, 12, 0.56)),
        #070a0c;
    border-color: rgba(255, 223, 157, 0.56);
    box-shadow:
        inset 0 0 0 1px rgba(255, 240, 203, 0.12),
        0 0 16px rgba(212, 167, 106, 0.18);
}

.board-nation-portrait-slot {
    position: relative;
    width: 100%;
    height: 5.45rem;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(7, 10, 12, 0.82);
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
}

.board-nation-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    opacity: 1;
    transition: opacity 0.14s ease-out, filter 0.14s ease-out;
}

.board-nation-portrait-slot.has-livekit-video .board-nation-portrait {
    opacity: 0;
}

.board-nation-ipc.is-dimmed .board-nation-portrait {
    opacity: 0.42;
    filter:
        grayscale(0.38)
        saturate(0.68)
}

.board-nation-ipc.is-dimmed .board-nation-portrait-slot.has-livekit-video .board-nation-portrait {
    opacity: 0;
}

.board-player-rail--axis .board-nation-portrait {
    order: 2;
}

.board-player-rail--axis .board-nation-portrait-slot {
    order: 2;
}

.board-nation-video-action {
    position: absolute;
    top: 0.28rem;
    right: 0.28rem;
    z-index: 3;
    min-width: 2.8rem;
    min-height: 1.45rem;
    padding: 0.16rem 0.38rem;
    border-radius: 4px;
    font: 900 0.72rem/1 "Segoe UI", system-ui, sans-serif;
    cursor: pointer;
}

.board-nation-video-action--join {
    color: #fff7df;
    background: rgba(8, 10, 12, 0.82);
    border: 1px solid rgba(255, 228, 164, 0.68);
}

.board-nation-video-action--leave {
    color: #ffd6d6;
    background: rgba(94, 18, 18, 0.86);
    border: 1px solid rgba(255, 111, 111, 0.72);
}

.board-nation-video-action:hover:not(:disabled),
.board-nation-video-action:focus:not(:disabled) {
    outline: none;
    filter: brightness(1.12);
}

.board-nation-video-action:disabled {
    opacity: 0.58;
    cursor: progress;
}

.board-nation-video-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.18rem;
    margin-top: 0.2rem;
}

.board-nation-video-controls button {
    flex: 1 1 auto;
    min-width: 3.2rem;
    padding: 0.18rem 0.28rem;
    color: rgba(232, 225, 204, 0.92);
    background: rgba(15, 28, 44, 0.82);
    border: 1px solid rgba(56, 80, 110, 0.86);
    border-radius: 3px;
    font: 800 0.54rem/1 "Segoe UI", system-ui, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
}

.board-nation-video-controls button.is-active {
    color: #1a1208;
    background: #f0c35c;
    border-color: #6e4d20;
}

.board-nation-video-controls button:disabled {
    opacity: 0.55;
    cursor: progress;
}

.board-nation-video-error {
    margin-top: 0.18rem;
    color: #ffd3d3;
    font-size: 0.56rem;
    font-weight: 750;
    line-height: 1.1;
}

.board-nation-chat-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.18rem;
    margin-top: 0.22rem;
}

.board-nation-chat-controls button {
    min-width: 0;
    padding: 0.2rem 0.28rem;
    color: rgba(232, 225, 204, 0.9);
    background: rgba(18, 24, 29, 0.82);
    border: 1px solid rgba(154, 179, 207, 0.34);
    border-radius: 3px;
    font: 850 0.55rem/1 "Segoe UI", system-ui, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
}

.board-nation-chat-controls button.is-active {
    color: #071014;
    background: #9fdce0;
    border-color: rgba(159, 220, 224, 0.92);
}

.board-nation-chat-controls span {
    display: grid;
    min-width: 1.2rem;
    height: 1.2rem;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: #38506e;
    font-size: 0.62rem;
    font-weight: 900;
}

.board-nation-ipc__details {
    display: grid;
    align-content: center;
    gap: 0.16rem;
    min-width: 0;
}

.board-player-rail--axis .board-nation-ipc__details {
    justify-items: end;
    text-align: right;
}

.board-nation-ipc span {
    max-width: 100%;
    color: rgba(244, 234, 215, 0.74);
    font-size: 0.64rem;
    font-weight: 900;
    line-height: 1.08;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.board-nation-ipc.is-current span {
    color: #fff1cf;
}

.board-nation-ipc strong {
    color: #ffe4a4;
    font-size: 0.9rem;
    font-weight: 950;
    line-height: 1.05;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.board-nation-ipc.is-current strong {
    color: #ffd986;
}

.board-nation-owner {
    display: block;
    max-width: 100%;
    color: rgba(174, 221, 224, 0.82);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.58rem;
    font-weight: 850;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-nation-edit-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
    padding: 0;
    width: 0.95rem;
    height: 0.95rem;
    line-height: 1;
    font-size: 0.62rem;
    color: rgba(174, 221, 224, 0.82);
    background: transparent;
    border: 1px solid rgba(174, 221, 224, 0.35);
    border-radius: 2px;
    cursor: pointer;
}

.board-nation-edit-name:hover,
.board-nation-edit-name:focus {
    color: rgba(255, 228, 164, 0.95);
    border-color: rgba(255, 228, 164, 0.75);
    outline: none;
}

.board-nation-name-form {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    max-width: 100%;
    margin-top: 0.12rem;
}

.board-nation-name-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.16rem 0.3rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.62rem;
    color: rgba(231, 245, 255, 0.95);
    background: rgba(10, 22, 38, 0.8);
    border: 1px solid rgba(255, 228, 164, 0.55);
    border-radius: 2px;
}

.board-nation-name-input:focus {
    outline: none;
    border-color: rgba(255, 228, 164, 0.95);
    box-shadow: 0 0 0 1px rgba(255, 228, 164, 0.4);
}

.board-nation-name-actions {
    display: flex;
    gap: 0.22rem;
}

.board-nation-name-save,
.board-nation-name-cancel {
    flex: 1 1 auto;
    padding: 0.12rem 0.32rem;
    font-family: inherit;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 2px;
    cursor: pointer;
}

.board-nation-name-save {
    color: rgba(10, 22, 38, 0.95);
    background: rgba(255, 228, 164, 0.92);
    border: 1px solid rgba(255, 228, 164, 0.95);
}

.board-nation-name-save:hover:not(:disabled),
.board-nation-name-save:focus:not(:disabled) {
    background: rgba(255, 240, 196, 1);
    outline: none;
}

.board-nation-name-cancel {
    color: rgba(231, 245, 255, 0.85);
    background: rgba(10, 22, 38, 0.55);
    border: 1px solid rgba(174, 221, 224, 0.5);
}

.board-nation-name-cancel:hover:not(:disabled),
.board-nation-name-cancel:focus:not(:disabled) {
    border-color: rgba(174, 221, 224, 0.9);
    outline: none;
}

.board-nation-name-save:disabled,
.board-nation-name-cancel:disabled,
.board-nation-name-input:disabled {
    opacity: 0.55;
    cursor: progress;
}

.board-nation-name-error {
    color: rgba(255, 173, 173, 0.95);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 1.1;
}

.board-nation-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.18rem;
    min-height: 1.08rem;
}

.board-nation-ipc .board-nation-techs img {
    width: 1.08rem;
    height: 1.08rem;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(255, 228, 164, 0.42);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.board-phase-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    padding: 0.52rem 1.05rem 0.62rem;
    background:
        linear-gradient(180deg, rgba(12, 17, 20, 0.96), rgba(7, 11, 14, 0.94)),
        linear-gradient(90deg, rgba(212, 167, 106, 0.08), transparent 28%, transparent 72%, rgba(108, 117, 123, 0.08));
    border-bottom: 1px solid rgba(244, 234, 215, 0.1);
}

.board-phase-timeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(6.45rem, 1fr));
    align-items: start;
    gap: 0.62rem;
    isolation: isolate;
}

.board-phase-timeline::before {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    top: 1.62rem;
    height: 2px;
    background: linear-gradient(90deg, rgba(204, 162, 99, 0.18), rgba(244, 234, 215, 0.46), rgba(108, 117, 123, 0.24));
    box-shadow: 0 0 8px rgba(212, 167, 106, 0.14);
    z-index: 0;
    pointer-events: none;
}

.board-phase-step {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    gap: 0.24rem;
    min-width: 0;
    opacity: 0.44;
    filter: grayscale(0.45) saturate(0.65);
    transition: opacity 0.14s ease-out, filter 0.14s ease-out, transform 0.14s ease-out;
}

.board-phase-step::before {
    content: "";
    position: absolute;
    top: -0.05rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #070a0c;
    z-index: 1;
    pointer-events: none;
}

.board-phase-step.is-current {
    opacity: 1;
    filter: none;
    transform: translateY(-1px);
}

.board-phase-step img {
    position: relative;
    z-index: 2;
    width: 3.25rem;
    height: 3.25rem;
    object-fit: contain;
    border-radius: 50%;
    background: #070a0c;
    box-shadow:
        0 0 0 1px rgba(244, 234, 215, 0.12),
        0 3px 8px rgba(0, 0, 0, 0.45);
}

.board-phase-step.is-current img {
    box-shadow:
        0 0 0 2px rgba(212, 167, 106, 0.78),
        0 0 16px rgba(212, 167, 106, 0.34),
        0 4px 10px rgba(0, 0, 0, 0.48);
}

.board-phase-step span {
    position: relative;
    z-index: 2;
    max-width: 100%;
    color: rgba(244, 234, 215, 0.72);
    font-size: 0.76rem;
    font-weight: 950;
    line-height: 1.05;
    overflow-wrap: anywhere;
    text-align: center;
    text-transform: uppercase;
}

.board-phase-step.is-current span {
    color: #ffe4a4;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.board-phase-actions {
    position: absolute;
    z-index: 3;
    top: 1.58rem;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
}

.board-phase-action {
    min-width: 3.05rem;
    min-height: 1.18rem;
    padding: 0.12rem 0.4rem;
    border: 1px solid rgba(255, 228, 164, 0.42);
    border-radius: 3px;
    background: rgba(7, 10, 12, 0.86);
    color: rgba(255, 228, 164, 0.88);
    font-size: 0.64rem;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.36);
}

.board-phase-action:not(:disabled) {
    cursor: pointer;
}

.board-phase-action:not(:disabled):hover {
    background: rgba(212, 167, 106, 0.92);
    color: #17110a;
}

.board-phase-action:disabled {
    opacity: 0.38;
    cursor: default;
}

.board-phase-back {
    position: absolute;
    top: 1.62rem;
    z-index: 4;
    min-width: 4.4rem;
    transform: translate(-50%, -50%);
    background: rgba(28, 18, 12, 0.94);
    border-color: rgba(255, 228, 164, 0.62);
}

.board-phase-back--tech-purchase {
    left: 20%;
}

.board-phase-back--purchase-combat {
    left: 40%;
}

.board-phase-separator {
    width: 1px;
    height: 2.85rem;
    background: linear-gradient(180deg, transparent, rgba(244, 234, 215, 0.34), transparent);
}

.board-previous-phase {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    min-height: 2.85rem;
    padding: 0.22rem 0.45rem;
    border: 1px solid rgba(204, 162, 99, 0.26);
    border-radius: 6px;
    background: rgba(7, 10, 12, 0.5);
    color: rgba(244, 234, 215, 0.76);
    font: 950 0.58rem/1.08 "Segoe UI", system-ui, sans-serif;
    text-align: left;
    text-transform: uppercase;
}

.board-previous-phase img {
    width: 2.15rem;
    height: 2.15rem;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.48));
}

.board-previous-phase:disabled {
    cursor: default;
    opacity: 0.58;
    filter: grayscale(0.22);
}

.board-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.11rem 0.9rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(244, 234, 215, 0.72);
    background:
        linear-gradient(180deg, rgba(15, 22, 28, 0.92), rgba(9, 14, 18, 0.92));
    border-top: 1px solid rgba(244, 234, 215, 0.1);
}

.board-host {
    position: relative;
    height: min(calc(100vh - 9.8rem), 980px);
    min-height: 38rem;
    touch-action: none;
}

@media (max-width: 1200px) {
    .board-wrapper {
        grid-template-columns: minmax(10.5rem, 12rem) minmax(0, 1fr) minmax(10.5rem, 12rem);
    }

    .map-audio-control--sound {
        left: 12.35rem;
    }

    .map-audio-control--spotlight {
        right: 12.35rem;
    }

    .board-player-rail {
        padding-top: 10.2rem;
    }

    .board-nation-ipc,
    .board-player-rail--axis .board-nation-ipc {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .board-player-rail--axis .board-nation-portrait {
        order: 0;
    }

    .board-player-rail--axis .board-nation-portrait-slot {
        order: 0;
    }
}

@media (max-width: 900px) {
    .map-audio-control {
        bottom: 0.6rem;
        min-width: 0;
    }

    .map-audio-control--sound {
        left: 0.6rem;
        right: auto;
        width: min(58vw, 13rem);
    }

    .map-audio-control--spotlight {
        right: 0.6rem;
        left: auto;
    }

    .volume-control {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .volume-control strong {
        text-align: left;
    }

    .board-wrapper {
        display: block;
    }

    .board-player-rail {
        position: static;
        display: flex;
        gap: 0.5rem;
        min-height: 0;
        padding: 0.5rem;
        overflow-x: auto;
    }

    .board-nation-ipc,
    .board-player-rail--axis .board-nation-ipc {
        flex: 0 0 11rem;
        grid-template-columns: 4.25rem minmax(0, 1fr);
        border-radius: 6px;
    }

    .board-player-rail--axis .board-nation-portrait {
        order: 0;
    }

    .board-player-rail--axis .board-nation-ipc__details {
        justify-items: start;
        text-align: left;
    }

    .board-phase-timeline {
        grid-template-columns: repeat(5, minmax(4.8rem, 1fr));
        gap: 0.35rem;
    }

    .board-phase-step span {
        font-size: 0.62rem;
    }

    .board-host {
        min-height: 28rem;
    }
}

/* ---- Mobile (phone) layout ---------------------------------------------
   Activated at <=932px wide in landscape (or <=500px tall regardless of
   width, to catch foldables). The desktop 3-column shell collapses into a
   single full-bleed map with a fixed bottom action bar; nation rails morph
   into bottom sheets toggled from the action bar; battle console docks at
   the bottom; territory readout moves to the top-right corner.

   In portrait phones a separate overlay tells the user to rotate.

   Mobile-only elements (.mobile-action-bar, .mobile-sheet-backdrop,
   .mobile-rotate-overlay) are hidden by default so desktop is unaffected. */
.mobile-action-bar,
.mobile-sheet-backdrop,
.mobile-rotate-overlay {
    display: none;
}

@media (max-width: 932px) and (orientation: landscape),
       (max-height: 500px) {
    .app-header {
        position: sticky;
        min-height: 2.5rem;
        padding: 0.25rem 0.6rem;
        gap: 0.5rem;
        font-size: 0.78rem;
    }

    .brand-lockup {
        min-width: 1.8rem;
    }

    .brand-lockup img {
        width: 1.8rem;
        height: 1.6rem;
    }

    .app-header .status {
        font-size: 0.68rem;
        line-height: 1.1;
    }

    .app-header .awar-balance {
        font-size: 0.68rem;
        padding: 0.2rem 0.4rem;
    }

    .app-header .player-tag {
        font-size: 0.62rem;
    }

    .app-header .auth-badge {
        display: none;
    }

    .board-wrapper {
        display: block;
        min-height: calc(100dvh - 2.5rem);
        padding: 0;
    }

    .board-shell {
        border: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .board-host {
        height: calc(100dvh - 2.5rem - 3rem - max(env(safe-area-inset-bottom), 0px));
        min-height: 0;
    }

    .board-phase-strip,
    .board-toolbar,
    .map-audio-control {
        display: none;
    }

    /* Rails morph into bottom sheets. Default: offscreen. Toggling adds the
       mobile-sheet-side-allies/axis class on the wrapper to slide the
       matching rail up; the other side stays hidden. */
    .board-player-rail {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 70;
        display: grid;
        grid-template-columns: 1fr;
        align-content: start;
        gap: 0.55rem;
        margin: 0;
        padding: 0.7rem 0.7rem calc(3.2rem + max(env(safe-area-inset-bottom), 0.4rem));
        min-height: 0;
        max-height: 60dvh;
        overflow-y: auto;
        overflow-x: hidden;
        background: rgba(8, 10, 12, 0.96);
        border-top: 1px solid rgba(212, 167, 106, 0.42);
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.65);
        transform: translateY(100%);
        transition: transform 0.22s ease-out;
        pointer-events: auto;
    }

    .board-wrapper.mobile-sheet-side-allies .board-player-rail--allies,
    .board-wrapper.mobile-sheet-side-axis .board-player-rail--axis {
        transform: translateY(0);
    }

    .board-nation-ipc,
    .board-player-rail--axis .board-nation-ipc {
        grid-template-columns: 4.25rem minmax(0, 1fr);
        border-radius: 8px;
        min-height: 0;
        padding: 0.45rem 0.55rem;
    }

    .board-player-rail--axis .board-nation-ipc__details {
        justify-items: start;
        text-align: left;
    }

    .board-player-rail--axis .board-nation-portrait {
        order: 0;
    }

    .mobile-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(2, 4, 6, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease-out;
    }

    .board-wrapper.mobile-sheet-open .mobile-sheet-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-action-bar {
        display: grid;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 75;
        grid-template-columns: minmax(4.5rem, auto) minmax(0, 1fr) minmax(4.5rem, auto);
        align-items: center;
        gap: 0.5rem;
        padding: 0.32rem 0.55rem max(env(safe-area-inset-bottom), 0.32rem);
        min-height: 3rem;
        background: rgba(5, 8, 10, 0.94);
        border-top: 1px solid rgba(212, 167, 106, 0.32);
        backdrop-filter: blur(10px);
        color: #f4ead7;
        font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    }

    .mobile-action-bar__nations {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 4.5rem;
        min-height: 2.2rem;
        padding: 0.3rem 0.7rem;
        border: 1px solid rgba(212, 167, 106, 0.42);
        border-radius: 999px;
        background: rgba(20, 14, 8, 0.7);
        color: #fff1c2;
        font-size: 0.78rem;
        font-weight: 850;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        cursor: pointer;
        transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }

    .mobile-action-bar__nations.is-open {
        background: rgba(244, 211, 94, 0.22);
        border-color: rgba(244, 211, 94, 0.7);
        color: #ffe28a;
    }

    .mobile-action-bar__nations--axis {
        justify-self: end;
    }

    .mobile-action-bar__phase {
        position: relative;
        display: grid;
        grid-template-columns: repeat(5, auto);
        justify-content: center;
        align-items: center;
        gap: 0.34rem;
        padding-bottom: 0.85rem;
    }

    .mobile-action-bar__phase-dot {
        display: inline-block;
        width: 0.55rem;
        height: 0.55rem;
        border-radius: 50%;
        background: rgba(244, 234, 215, 0.28);
        transition: background 0.15s ease, box-shadow 0.15s ease;
    }

    .mobile-action-bar__phase-dot.is-current {
        background: #f4d35e;
        box-shadow: 0 0 0 3px rgba(244, 211, 94, 0.18);
    }

    .mobile-action-bar__phase-label {
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        color: rgba(244, 234, 215, 0.78);
        font-size: 0.6rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    /* Float hold-to-confirm above the action bar */
    .start-battles-hold {
        bottom: calc(3.2rem + max(env(safe-area-inset-bottom), 0.4rem));
        min-width: min(70vw, 18rem);
        padding: 0.55rem 0.95rem;
        font-size: 0.82rem;
    }

    /* Battle console docks as a bottom sheet */
    .battle-console {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 2.5rem);
        padding: 0.7rem 0.6rem calc(3.2rem + max(env(safe-area-inset-bottom), 0.4rem));
        border-radius: 14px 14px 0 0;
        transform: none;
    }

    /* Territory readout: compact pill in the top-right so it does not
       collide with the action bar at the bottom. */
    .board-territory-readout {
        left: auto;
        right: 0.5rem;
        top: 0.5rem;
        bottom: auto;
        transform: none;
        max-width: min(20rem, calc(100vw - 1rem));
        min-width: 0;
        padding: 0.4rem 0.55rem;
        font-size: 0.7rem;
    }

    .board-territory-readout__name {
        font-size: 0.68rem;
    }

    .board-territory-readout__body {
        gap: 0.4rem;
        margin-top: 0.32rem;
    }

    .board-territory-piece {
        grid-template-rows: 2.4rem auto;
        min-width: 2.2rem;
        max-width: 2.8rem;
    }

    .board-territory-piece__icon {
        width: 2.2rem;
        height: 2.4rem;
    }

    .board-territory-piece img {
        max-width: 2rem;
        height: 2.1rem;
    }

    .board-territory-piece__count {
        font-size: 0.78rem;
    }

    .board-territory-piece__label {
        font-size: 0.5rem;
    }

    .board-territory-power__item {
        grid-template-rows: 1.5rem 0.85rem auto;
        min-width: 2.6rem;
    }

    .board-territory-power__item img {
        width: 1.3rem;
        height: 1.3rem;
    }

    .board-territory-power__item strong {
        font-size: 0.78rem;
    }
}

/* Portrait phone: cover the screen with a rotate prompt. The board still
   mounts behind it, so rotating dismisses the overlay instantly. */
@media (max-width: 932px) and (orientation: portrait) {
    .mobile-rotate-overlay {
        display: grid;
        position: fixed;
        inset: 0;
        z-index: 9999;
        place-items: center;
        padding: 1.5rem;
        background: linear-gradient(180deg, rgba(4, 6, 8, 0.96), rgba(8, 10, 12, 0.99));
        color: #f4ead7;
        text-align: center;
        font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    }

    .mobile-rotate-overlay__panel {
        max-width: 18rem;
        display: grid;
        gap: 0.65rem;
        justify-items: center;
    }

    .mobile-rotate-overlay__icon {
        font-size: 2.6rem;
        color: #f4d35e;
        animation: mobile-rotate-spin 2.6s ease-in-out infinite;
    }

    .mobile-rotate-overlay__title {
        font-size: 1.08rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .mobile-rotate-overlay__body {
        font-size: 0.82rem;
        line-height: 1.4;
        color: rgba(244, 234, 215, 0.82);
    }
}

@keyframes mobile-rotate-spin {
    0%, 60%, 100% { transform: rotate(90deg); }
    30%           { transform: rotate(0deg); }
}

/* ─── Per-team chat panels (rendered in each rail under the nation cards) ─── */
.board-team-chat {
    --chat-accent: 200, 220, 240;
    --chat-accent-strong: 132, 198, 255;
    display: grid;
    gap: 0.4rem;
    margin-top: 0.85rem;
    padding: 0.55rem 0.55rem 0.6rem;
    color: #f4ead7;
    background: linear-gradient(180deg, rgba(8, 12, 18, 0.92), rgba(4, 7, 12, 0.94));
    border: 1px solid rgba(var(--chat-accent), 0.35);
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 18px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.board-team-chat--allies {
    --chat-accent: 86, 160, 220;
    --chat-accent-strong: 132, 198, 255;
}

.board-team-chat--axis {
    --chat-accent: 200, 80, 70;
    --chat-accent-strong: 245, 132, 110;
}

.board-team-chat__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    color: rgba(244, 234, 215, 0.78);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.board-team-chat__title { color: rgba(var(--chat-accent-strong), 0.92); }

.board-team-chat__count {
    color: rgba(244, 234, 215, 0.62);
    font-size: 0.58rem;
}

.board-team-chat__log {
    display: grid;
    gap: 0.32rem;
    max-height: 14rem;
    overflow-y: auto;
    padding: 0.3rem;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(var(--chat-accent), 0.18);
    border-radius: 4px;
}

.board-team-chat__empty {
    margin: 0;
    color: rgba(244, 234, 215, 0.4);
    font-size: 0.66rem;
    text-align: center;
    font-style: italic;
}

.board-team-chat__message {
    display: grid;
    gap: 0.15rem;
    margin: 0;
    padding: 0.3rem 0.4rem;
    background: rgba(15, 22, 30, 0.72);
    border-left: 2px solid rgba(var(--chat-accent-strong), 0.55);
    border-radius: 3px;
    color: #f4ead7;
    font-size: 0.7rem;
    line-height: 1.25;
}

.board-team-chat__message p {
    margin: 0;
    overflow-wrap: anywhere;
}

.board-team-chat__message.is-scrambled {
    border-left-color: rgba(255, 102, 64, 0.52);
    color: rgba(244, 234, 215, 0.62);
    font-family: "Consolas", "Menlo", monospace;
    letter-spacing: 0.04em;
}

.board-team-chat__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    color: rgba(var(--chat-accent-strong), 0.85);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.board-team-chat__meta small {
    color: rgba(244, 234, 215, 0.5);
    font-weight: 600;
}

.board-team-chat__form {
    display: grid;
    gap: 0.32rem;
}

.board-team-chat__scope {
    display: flex;
    gap: 0.25rem;
}

.board-team-chat__scope button {
    flex: 1;
    min-height: 1.7rem;
    padding: 0.18rem 0.4rem;
    border: 1px solid rgba(var(--chat-accent), 0.42);
    background: rgba(0, 0, 0, 0.28);
    color: rgba(244, 234, 215, 0.78);
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.board-team-chat__scope button:hover {
    background: rgba(var(--chat-accent), 0.18);
    color: #fff;
}

.board-team-chat__scope button.is-active {
    background: rgba(var(--chat-accent-strong), 0.32);
    border-color: rgba(var(--chat-accent-strong), 0.95);
    color: #fff;
}

.board-team-chat__entry {
    display: flex;
    gap: 0.3rem;
}

.board-team-chat__entry input {
    flex: 1;
    min-width: 0;
    padding: 0.32rem 0.45rem;
    border: 1px solid rgba(var(--chat-accent), 0.42);
    background: rgba(0, 0, 0, 0.42);
    color: #f7f3e8;
    border-radius: 3px;
    font-size: 0.78rem;
}

.board-team-chat__entry input:focus {
    outline: 1px solid rgba(var(--chat-accent-strong), 0.65);
    outline-offset: 1px;
}

.board-team-chat__entry button {
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(var(--chat-accent-strong), 0.6);
    background: rgba(var(--chat-accent-strong), 0.22);
    color: #fff;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.board-team-chat__entry button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ─── Per-nation Telegram Ping button ───────────────────────────────────── */
.board-nation-ping {
    justify-self: end;
    margin-top: 0.18rem;
    padding: 0.18rem 0.6rem;
    min-height: 1.5rem;
    border: 1px solid rgba(244, 211, 94, 0.55);
    border-radius: 999px;
    background: rgba(244, 211, 94, 0.12);
    color: #ffe28a;
    font-size: 0.6rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    pointer-events: auto;
}

.board-nation-ping:hover:not(:disabled) {
    background: rgba(244, 211, 94, 0.28);
    border-color: rgba(244, 211, 94, 0.85);
    color: #fff;
}

.board-nation-ping:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    color: rgba(244, 234, 215, 0.6);
    border-color: rgba(244, 234, 215, 0.22);
    background: rgba(244, 234, 215, 0.05);
}

.board-nation-ping.is-busy {
    cursor: wait;
}

.board-player-rail--axis .board-nation-ping {
    justify-self: start;
}

/* ─── Game-chat error banner (fallback when the legacy panel is gone) ─── */
.game-chat-error {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    padding: 0.45rem 0.85rem;
    background: rgba(160, 30, 30, 0.88);
    color: #fff5cc;
    border: 1px solid rgba(255, 130, 80, 0.65);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

/* ─── Settings page additions (Telegram + Casualty stub) ───────────────── */
.settings-section {
    margin-top: 1.25rem;
}

.settings-step-icon {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    background: rgba(244, 211, 94, 0.18);
    border: 1px solid rgba(244, 211, 94, 0.42);
    border-radius: 999px;
    font-size: 1.05rem;
    color: #ffe28a;
}

.settings-telegram-status {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding: 0.65rem 0.85rem;
    background: rgba(8, 12, 18, 0.55);
    border: 1px solid rgba(86, 160, 220, 0.42);
    border-radius: 6px;
    color: #f4ead7;
    font-size: 0.85rem;
}

.settings-telegram-status--linked strong {
    color: #ffe28a;
}

.settings-telegram-muted {
    color: rgba(255, 168, 80, 0.92);
    font-size: 0.78rem;
}

.settings-telegram-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.settings-telegram-help {
    margin-top: 0.45rem;
    color: rgba(244, 234, 215, 0.7);
    font-size: 0.78rem;
}

.settings-telegram-help code {
    padding: 0.05rem 0.32rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(244, 211, 94, 0.32);
    border-radius: 3px;
    font-size: 0.74rem;
}

.settings-coming-soon {
    display: inline-block;
    margin-left: 0.55rem;
    padding: 0.05rem 0.45rem;
    background: rgba(244, 211, 94, 0.18);
    border: 1px solid rgba(244, 211, 94, 0.42);
    border-radius: 3px;
    color: #ffe28a;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    vertical-align: middle;
}

.settings-casualty-preview {
    margin: 0.65rem 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.32rem;
    opacity: 0.55;
    pointer-events: none;
}

.settings-casualty-preview li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.32rem 0.55rem;
    background: rgba(8, 12, 18, 0.55);
    border: 1px dashed rgba(244, 234, 215, 0.32);
    border-radius: 4px;
    color: #f4ead7;
    font-size: 0.85rem;
}

.settings-casualty-preview li span {
    width: 1.6rem;
    height: 1.6rem;
    display: grid;
    place-items: center;
    background: rgba(244, 211, 94, 0.22);
    border-radius: 999px;
    color: #ffe28a;
    font-size: 0.78rem;
    font-weight: 800;
}

.board-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 18;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.55rem;
    color: #f4ead7;
    background:
        radial-gradient(circle at 50% 38%, rgba(159, 131, 95, 0.18), transparent 32%),
        linear-gradient(180deg, rgba(7, 13, 19, 0.96), rgba(8, 14, 20, 0.98));
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.board-loading-overlay--hidden {
    opacity: 0;
}

.board-loading-mark {
    position: relative;
    width: 6.5rem;
    height: 6.5rem;
}

.board-loading-progress {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.board-loading-progress circle {
    fill: none;
    stroke: rgba(159, 131, 95, 0.24);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.board-loading-progress circle:last-child {
    stroke: #9F835F;
    stroke-dasharray: calc(3.141 * 2 * 40%);
    stroke-dashoffset: calc(3.141 * 2 * 40%);
    animation: dash 2s linear infinite;
}

.board-loading-logo {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 3.65rem;
    height: 3.3rem;
    object-fit: contain;
    transform: translate(-50%, -50%);
    filter:
        drop-shadow(0 0 10px rgba(212, 167, 106, 0.35))
        drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.board-loading-title {
    color: #f4ead7;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.board-loading-stage {
    min-height: 1.1rem;
    color: rgba(244, 234, 215, 0.76);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.board-territory-readout {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    z-index: 20;
    min-width: min(20rem, calc(100% - 2rem));
    max-width: min(54rem, calc(100% - 2rem));
    padding: 0.55rem 0.85rem 0.65rem;
    transform: translateX(-50%);
    color: #f7f3e8;
    background: rgba(8, 12, 14, 0.78);
    border: 1px solid rgba(235, 228, 204, 0.34);
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
    text-align: center;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

.board-territory-readout__name {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.15;
    text-transform: uppercase;
}

.board-territory-readout__body {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0.85rem;
    margin-top: 0.5rem;
}

.board-territory-readout__pieces {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.68rem;
    min-width: 0;
    flex-wrap: wrap;
}

.board-territory-piece {
    display: grid;
    grid-template-rows: 3.55rem auto;
    justify-items: center;
    min-width: 3.05rem;
    max-width: 4.1rem;
}

.board-territory-piece__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.55rem;
}

.board-territory-piece img {
    display: block;
    width: auto;
    max-width: 3rem;
    height: 3.2rem;
    object-fit: contain;
    filter:
        drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7))
        drop-shadow(0 7px 8px rgba(0, 0, 0, 0.28));
}

.board-territory-piece__fallback {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    color: #f6efe2;
    background: rgba(126, 112, 82, 0.74);
    border: 1px solid rgba(246, 236, 212, 0.58);
    border-radius: 4px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.26);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.board-territory-piece__count {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.board-territory-piece__label {
    max-width: 4.1rem;
    color: rgba(247, 243, 232, 0.78);
    font-size: 0.56rem;
    font-weight: 800;
    line-height: 1.05;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.board-territory-readout__divider {
    align-self: stretch;
    width: 1px;
    min-height: 3.6rem;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(235, 228, 204, 0.46) 18%,
        rgba(235, 228, 204, 0.46) 82%,
        transparent
    );
}

.board-territory-power {
    display: grid;
    grid-template-columns: repeat(2, minmax(3.6rem, auto));
    align-items: end;
    gap: 0.65rem;
}

.board-territory-power__item {
    display: grid;
    grid-template-rows: 2.05rem 1rem auto;
    align-items: end;
    justify-items: center;
    min-width: 3.8rem;
    max-width: 4.6rem;
    text-align: center;
}

.board-territory-power__item img {
    width: 1.85rem;
    height: 1.85rem;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.board-territory-power__label {
    color: rgba(247, 243, 232, 0.7);
    font-size: 0.55rem;
    font-weight: 900;
    line-height: 1.05;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.board-territory-power__item strong {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.board-territory-readout__empty {
    margin-top: 0.28rem;
    color: rgba(247, 243, 232, 0.68);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.board-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    background:
        radial-gradient(circle at 50% 12%, rgba(173, 211, 244, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(7, 17, 26, 0.8), rgba(5, 11, 16, 0.92));
}

.board-viewport.is-dragging {
    cursor: grabbing;
}

.board-viewport.is-team-cursor-active {
    cursor: crosshair;
}

.board-scene {
    position: absolute;
    inset: 0 auto auto 0;
    transform-origin: top left;
    /* No will-change here on purpose: pairing it with the runtime
       transform: scale() promoted the entire scene into a GPU-cached
       bitmap layer, so SVG territories were raster-scaled instead of
       re-rendered at the zoomed resolution and looked pixelated. The
       canvas-backed raster layers (.board-pixel-map-canvas,
       .board-ocean-canvas) carry the will-change hint individually
       so they still get GPU-accelerated when the scene transforms. */
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.board-ocean,
.board-ocean-canvas,
.board-pixel-map-canvas,
.board-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.board-ocean-canvas,
.board-pixel-map-canvas {
    display: block;
    /* These canvases ARE rasters by construction (WebGL ocean +
       procedurally-painted continents); promoting them individually
       lets the compositor GPU-scale them on transform without
       sweeping the SVG territory layer into the same bitmap cache. */
    will-change: transform;
}

.board-ocean-canvas {
    background: #061a2b;
}

.board-pixel-map-canvas {
    image-rendering: auto;
}

.board-ocean {
    background-image:
        var(--ocean-base-url),
        radial-gradient(circle at 52% 46%, rgba(255, 255, 255, 0.035), transparent 18%),
        linear-gradient(180deg, rgba(10, 74, 106, 0.24), rgba(4, 30, 52, 0.44));
    background-repeat: repeat-x, repeat-x, repeat;
    background-size:
        var(--board-width, 854px) var(--board-height, 621px),
        var(--board-width, 854px) var(--board-height, 621px),
        auto;
    background-position: 0 0, 0 0, 0 0;
    animation: ocean-drift 72s linear infinite;
    filter: saturate(0.92) brightness(0.94);
}

.board-ocean::before,
.board-ocean::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--ocean-wave-url);
    background-repeat: repeat-x;
    background-size: var(--board-width, 854px) var(--board-height, 621px);
    background-position: 0 0;
    opacity: 0.26;
    animation: ocean-ripple 48s linear infinite;
    mix-blend-mode: screen;
}

.board-ocean::after {
    opacity: 0.13;
    filter: blur(2px);
    transform: scale(1.02);
    animation-duration: 88s;
    animation-direction: reverse;
}

.board-atmosphere {
    background:
        linear-gradient(180deg, rgba(185, 220, 244, 0.035), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.24)),
        radial-gradient(circle at center, transparent 54%, rgba(0, 0, 0, 0.2) 100%);
}

.algo-board-copy {
    position: absolute;
    top: 0;
    display: block;
    overflow: visible;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.board-dynamic-overlay {
    position: absolute;
    display: block;
    overflow: visible;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.board-dynamic-copy.is-virtual-hidden {
    visibility: hidden;
}

.board-dynamic-overlay .board-turn-spotlight {
    opacity: 1;
    transition: opacity 0.18s ease-out;
}

.board-dynamic-overlay .board-turn-spotlight.is-hidden {
    opacity: 0;
}

.board-dynamic-overlay .board-turn-spotlight__dim {
    fill: rgba(0, 0, 0, 0.56);
}

.board-dynamic-overlay .board-turn-spotlight__glow {
    mix-blend-mode: screen;
}

.board-dynamic-overlay .board-turn-spotlight__ring {
    fill: none;
    stroke: color-mix(in srgb, var(--turn-spotlight-color, #f4d35e) 74%, #fff4c2 26%);
    stroke-width: 1.7;
    stroke-opacity: 0.48;
    stroke-dasharray: 4 5;
    filter: drop-shadow(0 0 6px rgba(255, 232, 150, 0.38));
}

.board-team-cursor {
    color: var(--team-cursor-color, #f4d35e);
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.75));
}

.board-team-cursor__halo {
    fill: color-mix(in srgb, currentColor 24%, transparent);
    stroke: color-mix(in srgb, currentColor 72%, #ffffff 28%);
    stroke-width: 1.4;
}

.board-team-cursor__pointer {
    fill: currentColor;
    stroke: #10131a;
    stroke-width: 1.25;
    stroke-linejoin: round;
}

.board-team-cursor__label {
    fill: #ffffff;
    stroke: rgba(0, 0, 0, 0.72);
    stroke-width: 3;
    paint-order: stroke;
    font: 900 10px system-ui, sans-serif;
    text-transform: uppercase;
}

.algo-board-copy .board-shape,
.algo-board-copy .territory-land-tint {
    transition:
        fill 0.18s ease-out,
        stroke 0.14s ease-out,
        filter 0.14s ease-out,
        opacity 0.14s ease-out,
        transform 0.14s ease-out;
    stroke-linejoin: round;
}

.algo-board-copy .territory-land-base {
    opacity: 1;
}

.algo-board-copy .territory-land-ridge {
    opacity: 0.82;
    mix-blend-mode: multiply;
}

.algo-board-copy .territory-land-tint {
    fill: var(--territory-tint, rgba(0, 0, 0, 0));
    opacity: 0.9;
    mix-blend-mode: normal;
}

.algo-board-copy .territory-land-hit {
    fill: rgba(0, 0, 0, 0.001);
    stroke: var(--territory-border, rgba(20, 18, 14, 0.29));
    stroke-width: 1;
    filter:
        drop-shadow(0 0 0 rgba(0, 0, 0, 0))
        drop-shadow(0 1px 0 rgba(255, 255, 255, 0.08));
}

.algo-board-copy .territory-sea {
    fill: rgba(5, 34, 58, 0.035);
    stroke: rgba(165, 205, 220, 0.2);
    stroke-width: var(--sea-zone-stroke-width, 1);
    stroke-linecap: round;
    stroke-dasharray: var(--sea-zone-dasharray, 0.34 2.38);
}

.algo-board-copy .territory-impassable-land-base {
    opacity: 0.96;
    filter: saturate(0.48) brightness(0.84) contrast(1.18);
}

.algo-board-copy .territory-impassable-land-ridge {
    opacity: 0.94;
    mix-blend-mode: multiply;
    filter: saturate(0.36) contrast(1.25);
}

.algo-board-copy .territory-impassable-land-border {
    opacity: 1;
    stroke: rgba(8, 10, 9, 0.29);
    stroke-width: 1;
    stroke-dasharray: none;
    pointer-events: none;
}

.algo-board-copy .territory-impassable-land-overlay {
    opacity: 0.65;
    mix-blend-mode: normal;
    stroke: none;
}

.algo-board-copy .board-impassable-overlay-layer {
    pointer-events: none;
}

.algo-board-copy .board-layer-land {
    filter: saturate(0.82) contrast(1.07);
}

.algo-board-copy .board-layer-impassable-land {
    filter: saturate(0.58) contrast(1.12) brightness(0.92);
}

.algo-board-copy .board-layer-sea {
    filter: brightness(0.98);
}

.algo-board-copy .board-shape.is-hovered,
.algo-board-copy .territory-land-tint.is-hovered {
    filter:
        drop-shadow(0 0 6px rgba(255, 225, 161, 0.45))
        drop-shadow(0 0 14px rgba(255, 225, 161, 0.18));
}

.algo-board-copy .territory-land-hit.is-hovered,
.algo-board-copy .territory-land-hit.is-highlighted,
.algo-board-copy .territory-land-hit.is-combat-move-eligible,
.algo-board-copy .territory-land-hit.is-combat-move-target {
    stroke: var(--territory-border-active, rgba(248, 228, 177, 0.88));
}

.algo-board-copy .territory-land-tint.is-hovered {
    opacity: 1;
}

.algo-board-copy .territory-land-tint.is-highlighted,
.algo-board-copy .territory-land-tint.is-combat-move-eligible,
.algo-board-copy .territory-land-tint.is-combat-move-target {
    opacity: 1;
    filter:
        drop-shadow(0 0 10px rgba(248, 228, 177, 0.18))
        drop-shadow(0 0 18px rgba(248, 228, 177, 0.12));
}

.algo-board-copy .territory-sea.is-hovered,
.algo-board-copy .territory-sea.is-highlighted,
.algo-board-copy .territory-sea.is-combat-move-eligible,
.algo-board-copy .territory-sea.is-combat-move-target {
    stroke: rgba(245, 250, 248, 0.88);
    fill: rgba(255, 255, 255, 0.08);
}

.algo-board-copy .board-shape.is-highlighted,
.algo-board-copy .board-shape.is-combat-move-eligible,
.algo-board-copy .board-shape.is-combat-move-target {
    filter:
        drop-shadow(0 0 8px rgba(255, 229, 160, 0.54))
        drop-shadow(0 0 20px rgba(255, 229, 160, 0.2));
}

.algo-board-copy .board-unit-layer {
    isolation: isolate;
}

.algo-board-copy .board-capital-token-layer,
.board-dynamic-overlay .board-capital-token-layer {
    isolation: isolate;
    pointer-events: none;
}

.algo-board-copy .board-piece-layer,
.board-dynamic-overlay .board-piece-layer {
    isolation: isolate;
    pointer-events: auto;
}

.algo-board-copy .board-ipc-value-layer,
.board-dynamic-overlay .board-ipc-value-layer {
    isolation: isolate;
    pointer-events: none;
}

.board-dynamic-overlay .board-movement-arrow-layer {
    isolation: isolate;
    pointer-events: none;
}

.board-dynamic-overlay .movement-route {
    color: var(--movement-route-color, #e06a62);
}

.board-dynamic-overlay .movement-route__shadow,
.board-dynamic-overlay .movement-route__glow,
.board-dynamic-overlay .movement-route__path {
    opacity: 0.78;
}

.board-dynamic-overlay .movement-route__head {
    opacity: 0.7;
}

.board-dynamic-overlay .movement-route__head-disc,
.board-dynamic-overlay .movement-route__head-tip {
    fill-opacity: 1;
}

.board-dynamic-overlay .movement-route__shadow,
.board-dynamic-overlay .movement-route__glow,
.board-dynamic-overlay .movement-route__path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.board-dynamic-overlay .movement-route__shadow {
    stroke: rgba(0, 0, 0, 0.42);
    stroke-width: 5.4;
    stroke-dasharray: 1 7;
    transform: translate(0.9px, 1.2px);
    filter: blur(1.4px);
    opacity: 0.78;
    /* Match the colored arc's flow so the shadow dots drift in lockstep. */
    animation: movement-route-shadow-flow 1.6s linear infinite;
}

@keyframes movement-route-shadow-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -8; }
}

.board-dynamic-overlay .movement-route__glow {
    stroke: currentColor;
    stroke-width: 4;
    stroke-opacity: 0.2;
    filter: drop-shadow(0 0 4px currentColor);
}

.board-dynamic-overlay .movement-route__path {
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-dasharray: 1 6;
    /* Subtle drift toward the destination — keeps the staged moves feeling
     * alive without becoming a distraction. */
    animation: movement-route-path-flow 1.6s linear infinite;
}

@keyframes movement-route-path-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -7; }
}

.board-dynamic-overlay .movement-route__head {
    filter: drop-shadow(0 1px 1.4px rgba(0, 0, 0, 0.72));
}

.board-dynamic-overlay .movement-route__head-disc {
    stroke: rgba(0, 0, 0, 0.78);
    stroke-width: 0.65;
}

.board-dynamic-overlay .movement-route__head-tip {
    stroke: rgba(0, 0, 0, 0.78);
    stroke-width: 0.5;
    stroke-linejoin: round;
}

.board-dynamic-overlay .movement-route__count circle {
    fill: color-mix(in srgb, currentColor 72%, #111 28%);
    stroke: rgba(0, 0, 0, 0.76);
    stroke-width: 1;
}

.board-dynamic-overlay .movement-route__count text {
    fill: #fff7df;
    stroke: rgba(0, 0, 0, 0.74);
    stroke-width: 0.35;
    paint-order: stroke;
    font-size: 3.5px;
    font-weight: 900;
}

.algo-board-copy .territory-ipc-value,
.board-dynamic-overlay .territory-ipc-value {
    opacity: 0.66;
    filter:
        drop-shadow(0 1.4px 1.2px rgba(0, 0, 0, 0.48))
        drop-shadow(0 0 5px rgba(255, 236, 190, 0.08));
    transition: opacity 0.14s ease-out, filter 0.14s ease-out;
}

.algo-board-copy .territory-ipc-value.is-hovered,
.board-dynamic-overlay .territory-ipc-value.is-hovered {
    opacity: 1;
    filter:
        drop-shadow(0 1.4px 1.2px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 7px rgba(255, 236, 190, 0.18));
}

.algo-board-copy .territory-ipc-value__disc,
.board-dynamic-overlay .territory-ipc-value__disc {
    fill: color-mix(in srgb, var(--ipc-owner, #8f8065) 76%, #12110d 24%);
    stroke: var(--ipc-owner-border, rgba(0, 0, 0, 0.82));
    stroke-width: 0.9;
    vector-effect: non-scaling-stroke;
}

.algo-board-copy .territory-ipc-value.is-neutral .territory-ipc-value__disc,
.board-dynamic-overlay .territory-ipc-value.is-neutral .territory-ipc-value__disc {
    fill: rgba(34, 31, 25, 0.78);
    stroke: rgba(255, 255, 255, 0.92);
    stroke-width: 1.05;
}

.algo-board-copy .territory-ipc-value__text,
.board-dynamic-overlay .territory-ipc-value__text {
    fill: #f7efd8;
    stroke: rgba(0, 0, 0, 0.72);
    stroke-width: 0.62;
    paint-order: stroke fill;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 4.1px;
    font-weight: 900;
}

.algo-board-copy .capital-token,
.board-dynamic-overlay .capital-token {
    opacity: 0.96;
    filter:
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 8px rgba(255, 232, 176, 0.16));
}

.algo-board-copy .capital-token-image,
.board-dynamic-overlay .capital-token-image {
    image-rendering: auto;
}

.algo-board-copy .game-piece,
.board-dynamic-overlay .game-piece {
    opacity: 0.98;
    filter:
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.58))
        drop-shadow(0 7px 10px rgba(0, 0, 0, 0.22));
}

.algo-board-copy .game-piece.is-combat-draggable,
.board-dynamic-overlay .game-piece.is-combat-draggable {
    cursor: grab;
    pointer-events: visiblePainted;
}

/* Pulsing amber halo on planes that combat-moved this turn and still need
 * to land before the NonCombat phase can end. */
.algo-board-copy .game-piece.is-stranded-plane .game-piece-image,
.board-dynamic-overlay .game-piece.is-stranded-plane .game-piece-image {
    filter:
        drop-shadow(0 0 3.5px rgba(255, 196, 64, 0.95))
        drop-shadow(0 0 7px rgba(255, 132, 32, 0.78));
    animation: stranded-plane-pulse 1.2s ease-in-out infinite;
}

@keyframes stranded-plane-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.stranded-planes-banner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.95rem;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(180deg, rgba(255, 168, 32, 0.14) 0%, rgba(196, 96, 16, 0.18) 100%);
    border: 1px solid rgba(255, 168, 32, 0.55);
    border-radius: 6px;
    color: #ffd58a;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.stranded-planes-banner__icon {
    font-size: 1.15rem;
    color: #ffc24c;
    text-shadow: 0 0 6px rgba(255, 168, 32, 0.7);
}

.stranded-planes-banner__text {
    flex: 1;
}

.algo-board-copy .game-piece-image,
.board-dynamic-overlay .game-piece-image {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.12s ease-out;
}

.algo-board-copy .game-piece:hover .game-piece-image,
.board-dynamic-overlay .game-piece:hover .game-piece-image {
    transform: scale(1.08);
}

.algo-board-copy .game-piece.is-dragging .game-piece-image,
.board-dynamic-overlay .game-piece.is-dragging .game-piece-image {
    transform: scale(1.15);
}

.board-viewport.is-combat-piece-dragging {
    cursor: grabbing;
}

.board-viewport.is-combat-piece-dragging .game-piece:not(.is-dragging):hover .game-piece-image {
    transform: scale(1.08);
}

.algo-board-copy .game-piece-image,
.board-dynamic-overlay .game-piece-image {
    image-rendering: auto;
}

.algo-board-copy .game-piece-wake,
.board-dynamic-overlay .game-piece-wake {
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.78;
    transform-box: fill-box;
    transform-origin: center;
    animation: piece-wake-drift 4.8s ease-in-out infinite;
}

.algo-board-copy .game-piece-wake__back,
.algo-board-copy .game-piece-wake__mid,
.board-dynamic-overlay .game-piece-wake__back,
.board-dynamic-overlay .game-piece-wake__mid {
    fill: none;
    stroke: rgba(206, 231, 231, 0.42);
    stroke-width: 0.85;
    vector-effect: non-scaling-stroke;
}

.algo-board-copy .game-piece-wake__back,
.board-dynamic-overlay .game-piece-wake__back {
    stroke-dasharray: 2.4 2.1;
    opacity: 0.45;
    animation: piece-wake-pulse 5.6s ease-in-out infinite;
}

.algo-board-copy .game-piece-wake__mid,
.board-dynamic-overlay .game-piece-wake__mid {
    stroke: rgba(238, 246, 238, 0.56);
    stroke-width: 0.62;
    stroke-dasharray: 1.7 2.5;
    opacity: 0.5;
    animation: piece-wake-pulse 4.2s ease-in-out infinite reverse;
}

.algo-board-copy .game-piece-wake__foam,
.board-dynamic-overlay .game-piece-wake__foam {
    fill: none;
    stroke: rgba(255, 255, 245, 0.58);
    stroke-width: 0.72;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    opacity: 0.5;
}

.algo-board-copy .game-piece-count,
.board-dynamic-overlay .game-piece-count {
    fill: #ffffff;
    stroke: rgba(0, 0, 0, 0.82);
    stroke-width: 1.05;
    paint-order: stroke fill;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 6.2px;
    font-weight: 800;
    pointer-events: none;
}

.algo-board-copy .unit-stack {
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.14s ease-out,
        transform 0.14s ease-out;
}

.algo-board-copy .unit-stack.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.algo-board-copy .unit-stack-badge {
    fill: color-mix(in srgb, var(--stack-owner, #8e846f) 54%, rgba(15, 20, 25, 0.94));
    stroke: rgba(245, 240, 224, 0.9);
    stroke-width: 1.2;
    filter:
        drop-shadow(0 2px 6px rgba(0, 0, 0, 0.34))
        drop-shadow(0 0 14px rgba(0, 0, 0, 0.12));
}

.algo-board-copy .unit-stack-count,
.algo-board-copy .unit-stack-label {
    fill: #f7f3e8;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-weight: 700;
    pointer-events: none;
}

.algo-board-copy .unit-stack-count {
    font-size: 11px;
    letter-spacing: 0.04em;
}

.algo-board-copy .unit-stack-label {
    font-size: 4.4px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

@keyframes ocean-drift {
    from {
        background-position: 0 0, 0 0, 0 0;
    }
    to {
        background-position: var(--board-width, 854px) 0, calc(var(--board-width, 854px) * 0.44) 18px, 0 0;
    }
}

@keyframes ocean-ripple {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(calc(var(--board-width, 854px) * -1), 0, 0);
    }
}

@keyframes piece-wake-drift {
    0%, 100% {
        translate: 0 0;
        scale: 0.96 1;
    }
    50% {
        translate: 0 0.4px;
        scale: 1.04 1;
    }
}

@keyframes piece-wake-pulse {
    0%, 100% {
        opacity: 0.28;
        stroke-dashoffset: 0;
    }
    50% {
        opacity: 0.62;
        stroke-dashoffset: 3;
    }
}

@media (max-width: 900px) {
    .board-toolbar {
        font-size: 0.72rem;
        letter-spacing: 0.05em;
    }

    .board-host {
        height: min(70vh, 760px);
    }

    .board-territory-readout {
        bottom: 0.65rem;
        max-width: calc(100% - 1.25rem);
        padding: 0.45rem 0.75rem;
        font-size: 0.78rem;
        letter-spacing: 0.05em;
    }
}

.panel {
    padding: 0.75rem 1rem;
    background: #1e232a;
    border-top: 1px solid #2a303a;
}

.panel h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #b9c1cc;
}

.panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.panel li {
    padding: 0.15rem 0;
    font-size: 0.95rem;
}

.panel li strong {
    color: #f4d35e;
    text-transform: capitalize;
    display: inline-block;
    min-width: 6rem;
}

.tech-selection-status {
    position: fixed;
    top: 5rem;
    left: 50%;
    z-index: 65;
    transform: translateX(-50%);
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(159, 131, 95, 0.5);
    border-radius: 6px;
    background: rgba(13, 12, 10, 0.86);
    color: #d8ccb9;
    font-size: 0.85rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
}

.tech-selection-status strong {
    color: #f0d39b;
}

.tech-chooser-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    background:
        linear-gradient(180deg, rgba(2, 5, 8, 0.76), rgba(0, 0, 0, 0.82)),
        rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
}

/* Confirmation dialog for destructive game-lifecycle actions
   (delete a test game, forfeit a multi-player game). Sits above every
   other UI layer including the battle console (z-index 240). */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: grid;
    place-items: center;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    background:
        linear-gradient(180deg, rgba(2, 5, 8, 0.78), rgba(0, 0, 0, 0.84)),
        rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(4px);
}

.confirm-card {
    width: min(94vw, 30rem);
    padding: clamp(1.25rem, 3vw, 1.8rem);
    border: 1px solid rgba(244, 211, 94, 0.46);
    border-radius: 8px;
    background: rgba(13, 18, 26, 0.96);
    color: #e8e1cc;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.56);
}

.confirm-card h2 {
    margin: 0 0 0.65rem 0;
    color: #f3eedb;
    font-size: 1.18rem;
    line-height: 1.2;
}

.confirm-card p {
    margin: 0 0 0.75rem 0;
    line-height: 1.45;
    font-size: 0.92rem;
}

.confirm-card__warning {
    padding: 0.55rem 0.7rem;
    border-left: 3px solid rgba(255, 122, 122, 0.86);
    background: rgba(78, 28, 30, 0.42);
    color: #ffd7d7;
    font-weight: 800;
}

.confirm-card__error {
    color: #ffb4b4;
}

.confirm-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.wallet-btn--danger {
    border: 1px solid rgba(255, 122, 122, 0.78);
    background: linear-gradient(180deg, #b03030, #6b1818);
    color: #ffe8e8;
    font-weight: 800;
    padding: 0.45rem 0.95rem;
    border-radius: 6px;
    cursor: pointer;
}

.wallet-btn--danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tech-chooser-backdrop--dice-roll {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.tech-chooser-backdrop--minimized,
.purchase-backdrop--minimized {
    place-items: end center;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.tech-chooser-card {
    position: relative;
    width: min(94vw, 45rem);
    max-height: min(90vh, 50rem);
    overflow: auto;
    padding: clamp(1.25rem, 3vw, 2.2rem);
    background:
        linear-gradient(135deg, rgba(18, 27, 33, 0.98), rgba(13, 12, 10, 0.98)),
        linear-gradient(90deg, rgba(204, 162, 99, 0.2), rgba(74, 137, 148, 0.18));
    color: #f4ead7;
    border: 1px solid rgba(244, 234, 215, 0.16);
    border-radius: 8px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 26px 60px rgba(0, 0, 0, 0.72);
    filter: drop-shadow(0 26px 60px rgba(0, 0, 0, 0.72));
}

.tech-chooser-card--minimized,
.purchase-card--minimized {
    width: min(94vw, 42rem);
    max-height: none;
    margin-bottom: 1rem;
    padding: 0.58rem 0.72rem;
    overflow: visible;
    border-radius: 6px;
    pointer-events: auto;
}

.phase-minibar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.58rem;
}

.phase-minibar div {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.phase-minibar strong {
    color: #ffe4a4;
    font-size: 0.82rem;
    font-weight: 950;
    line-height: 1.08;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.phase-minibar span {
    color: rgba(244, 234, 215, 0.72);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.1;
}

.tech-chooser-card--dice-roll {
    opacity: 0;
    pointer-events: none;
}

.tech-chooser-card--chart {
    width: min(96vw, 82rem);
    aspect-ratio: 3 / 2;
    max-height: min(88vh, 50rem);
    overflow: visible;
    padding: clamp(3.85rem, 6.4vw, 5.8rem) clamp(2rem, 3.7vw, 4.2rem) clamp(1.9rem, 3.15vw, 3.35rem);
    background:
        linear-gradient(180deg, rgba(8, 7, 5, 0.03), rgba(8, 7, 5, 0.13)),
        url("../img/menus/technology/tech_card_chooser.png") center / contain no-repeat;
    color: #251d14;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tech-chooser-card--award {
    width: min(92vw, 37rem);
    overflow: hidden;
}

.tech-chooser-card--status {
    width: min(92vw, 34rem);
}

.tech-chooser-card.tech-chooser-card--minimized {
    width: min(94vw, 42rem);
    aspect-ratio: auto;
    max-height: none;
    margin-bottom: 1rem;
    padding: 0.58rem 0.72rem;
    overflow: visible;
    border: 1px solid rgba(244, 234, 215, 0.16);
    border-radius: 6px;
    background:
        linear-gradient(135deg, rgba(18, 27, 33, 0.98), rgba(13, 12, 10, 0.98)),
        linear-gradient(90deg, rgba(204, 162, 99, 0.2), rgba(74, 137, 148, 0.18));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 18px 42px rgba(0, 0, 0, 0.62);
    color: #f4ead7;
    pointer-events: auto;
}

.tech-chooser-title,
.tech-chooser-card--chart > .tech-chooser-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.tech-chooser-close {
    position: absolute;
    top: clamp(1.2rem, 2.3vw, 2rem);
    right: clamp(1.25rem, 2.6vw, 2.2rem);
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(56, 39, 22, 0.38);
    border-radius: 50%;
    background: rgba(238, 222, 185, 0.7);
    color: #2c1e12;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.tech-chooser-close:disabled {
    opacity: 0.45;
    cursor: default;
}

.tech-buy-panel,
.tech-status-panel,
.tech-award-panel {
    display: grid;
    gap: 0.85rem;
    justify-items: center;
    text-align: center;
}

.tech-buy-panel {
    justify-items: stretch;
    text-align: left;
}

.tech-kicker {
    margin: 0;
    color: #8fd1d8;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tech-buy-panel h2,
.tech-status-panel h2,
.tech-award-panel h2 {
    margin: 0;
    color: #ffe4a4;
    font-size: clamp(1.6rem, 3.8vw, 2.5rem);
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.5);
}

.tech-buy-copy,
.tech-status-panel p,
.tech-award-panel p {
    margin: 0;
    color: rgba(244, 234, 215, 0.86);
    font-size: 0.98rem;
    line-height: 1.45;
}

.tech-buy-copy strong {
    color: #ffe4a4;
}

.tech-buy-budget {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.62rem 0.72rem;
    border: 1px solid rgba(143, 209, 216, 0.24);
    border-radius: 5px;
    background: rgba(4, 8, 10, 0.36);
}

.tech-buy-budget span,
.tech-buy-budget strong,
.tech-cost {
    color: #f4ead7;
    font-size: 0.9rem;
    font-weight: 900;
}

.tech-alert {
    margin: 0.9rem 0 0;
    color: #ff9d73;
    font-weight: 900;
    text-align: center;
}

.tech-dice-stepper {
    display: grid;
    grid-template-columns: 2.7rem 4rem 2.7rem;
    justify-content: center;
    align-items: center;
    gap: 0.7rem;
    margin: 1.2rem 0 0.55rem;
}

.tech-stepper-button {
    width: 2.7rem;
    height: 2.7rem;
    border: 1px solid rgba(255, 228, 164, 0.48);
    border-radius: 50%;
    background: rgba(10, 18, 22, 0.82);
    color: #ffe4a4;
    font-size: 1.55rem;
    font-weight: 950;
    line-height: 1;
    cursor: pointer;
}

.tech-stepper-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.tech-stepper-value {
    display: grid;
    place-items: center;
    min-height: 3.4rem;
    border: 1px solid rgba(143, 209, 216, 0.34);
    border-radius: 6px;
    background: rgba(4, 8, 10, 0.52);
    color: #ffffff;
    font-size: 2rem;
    font-weight: 950;
}

.tech-cost {
    margin: 0;
    text-align: center;
}

.tech-dialog-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.05rem;
    font-family: Tahoma, Geneva, sans-serif;
}

.tech-dialog-actions .tech-chooser-action {
    font-family: Tahoma, Geneva, sans-serif;
    text-shadow: none;
}

.tech-dialog-actions--center {
    justify-content: center;
}

.tech-breakthrough-banner {
    position: absolute;
    top: clamp(-2.85rem, -3vw, -2rem);
    left: 50%;
    display: grid;
    gap: 0.2rem;
    width: min(44rem, 72vw);
    padding: 0.58rem 1.1rem;
    border: 1px solid rgba(244, 234, 215, 0.2);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 52%),
        rgba(4, 7, 10, 0.88);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.035),
        0 14px 34px rgba(0, 0, 0, 0.42);
    transform: translateX(-50%);
    text-align: center;
    z-index: 3;
}

.tech-breakthrough-banner strong {
    color: #ffffff;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: clamp(0.92rem, 1.35vw, 1.2rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.76);
}

.tech-breakthrough-banner span {
    color: rgba(244, 234, 215, 0.9);
    font-size: clamp(0.76rem, 0.95vw, 0.9rem);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
}

.tech-dice-results {
    display: flex;
    justify-content: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.tech-dice-results--compact {
    position: absolute;
    top: clamp(0.92rem, 1.8vw, 1.55rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.tech-die-result {
    display: inline-grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 6px;
    background: #1d2428;
    color: #f4ead7;
    border: 1px solid rgba(244, 234, 215, 0.2);
    font-size: 1.3rem;
    font-weight: 950;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
}

.tech-die-result.is-six {
    background: #246d5e;
    color: #ffffff;
    border-color: rgba(143, 209, 216, 0.7);
}

.tech-chooser-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.35rem, 3.7vw, 4.4rem);
    height: 100%;
    padding-top: clamp(0.45rem, 1vw, 0.95rem);
}

.tech-chooser-column {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    padding: clamp(0.25rem, 0.65vw, 0.58rem) clamp(0.12rem, 0.55vw, 0.52rem);
}

.tech-chooser-column h3 {
    margin: 0 0 clamp(0.34rem, 0.7vw, 0.58rem);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: clamp(0.96rem, 1.34vw, 1.28rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.02;
    text-transform: uppercase;
    text-shadow:
        0 1px 0 rgba(255, 244, 217, 0.48),
        0 2px 2px rgba(29, 19, 10, 0.34);
}

.tech-chooser-column--weapons h3 {
    color: #CCA263;
}

.tech-chooser-column--industry h3 {
    color: #6C757B;
}

.tech-chooser-column ul {
    display: grid;
    gap: clamp(0.28rem, 0.5vw, 0.46rem);
    margin: 0;
    padding: clamp(0.5rem, 0.78vw, 0.72rem);
    list-style: none;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 241, 205, 0.62), rgba(224, 199, 151, 0.42)),
        repeating-linear-gradient(0deg, rgba(75, 47, 22, 0.08) 0 1px, transparent 1px 6px);
    border: 1px solid rgba(58, 38, 19, 0.2);
    box-shadow:
        inset 0 0 0 1px rgba(255, 247, 221, 0.24),
        0 5px 16px rgba(49, 32, 15, 0.16);
    backdrop-filter: blur(0.6px);
}

.tech-chooser-column--weapons ul {
    border-left: 4px solid #CCA263;
}

.tech-chooser-column--industry ul {
    border-left: 4px solid #6C757B;
}

.tech-chooser-column li {
    display: grid;
    grid-template-columns: clamp(2.85rem, 4.15vw, 4.05rem) minmax(0, 1fr);
    align-items: start;
    gap: clamp(0.48rem, 0.82vw, 0.72rem);
    color: #21170f;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.18;
    text-shadow: 0 1px 0 rgba(255, 247, 226, 0.62);
}

.tech-chooser-column li img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid rgba(58, 38, 19, 0.22);
    box-shadow: 0 2px 6px rgba(49, 32, 15, 0.24);
}

.tech-chooser-column li span {
    display: grid;
    gap: 0.14rem;
    min-width: 0;
}

.tech-chooser-column li strong {
    color: #17100a;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: clamp(0.82rem, 1vw, 1rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.08;
    text-transform: none;
}

.tech-chooser-column li em {
    color: rgba(29, 21, 14, 0.92);
    font-size: clamp(0.68rem, 0.84vw, 0.84rem);
    font-style: normal;
    font-weight: 700;
    line-height: 1.22;
}

.tech-chooser-action {
    max-width: 100%;
    min-height: 2.35rem;
    margin-top: clamp(0.5rem, 1vw, 0.9rem);
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(30, 22, 13, 0.68);
    border-radius: 3px;
    background: linear-gradient(180deg, #d8b67c, #CCA263);
    color: #1b130a;
    box-shadow: 0 4px 0 rgba(58, 39, 18, 0.62), 0 10px 20px rgba(48, 30, 14, 0.28);
    font-family: Tahoma, Geneva, sans-serif;
    font-size: clamp(0.76rem, 1.05vw, 0.98rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
    text-shadow: none;
    cursor: pointer;
}

.tech-chooser-column .tech-chooser-action {
    justify-self: end;
    align-self: end;
}

.tech-chooser-card--buy .tech-chooser-action,
.tech-chooser-card--status .tech-chooser-action,
.tech-chooser-card--award .tech-chooser-action {
    margin-top: 0;
}

.tech-chooser-action--secondary {
    background: rgba(10, 18, 22, 0.78);
    color: #f4ead7;
    text-shadow: none;
    box-shadow: none;
}

.tech-chooser-action--ok {
    min-width: 6.5rem;
    min-height: 2.75rem;
    padding: 0.65rem 1.65rem;
    font-family: Tahoma, Geneva, sans-serif;
    font-size: 1.08rem;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.1;
}

.tech-chooser-column--industry .tech-chooser-action {
    background: linear-gradient(180deg, #89939a, #6C757B);
    color: #f4ecdc;
    text-shadow: none;
    box-shadow: 0 4px 0 rgba(38, 43, 46, 0.7), 0 10px 20px rgba(20, 24, 27, 0.3);
}

.tech-chooser-action:hover {
    filter: brightness(1.08) contrast(1.03);
}

.tech-chooser-action:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(68, 45, 24, 0.55), 0 8px 16px rgba(48, 30, 14, 0.25);
}

.tech-award-emblem {
    position: relative;
    display: grid;
    place-items: center;
    width: min(52vw, 15rem);
    aspect-ratio: 1;
    margin: 0.25rem 0;
}

.tech-award-emblem::before,
.tech-award-emblem::after {
    content: "";
    position: absolute;
    inset: 5%;
    border: 1px solid rgba(143, 209, 216, 0.42);
    border-radius: 50%;
    animation: techAwardPulse 1.7s ease-out infinite;
}

.tech-award-emblem::after {
    inset: 14%;
    border-color: rgba(255, 228, 164, 0.44);
    animation-delay: 0.42s;
}

.tech-award-emblem img {
    position: relative;
    z-index: 1;
    width: 76%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 228, 164, 0.58);
    box-shadow:
        0 0 0 5px rgba(143, 209, 216, 0.08),
        0 0 36px rgba(143, 209, 216, 0.28),
        0 20px 42px rgba(0, 0, 0, 0.54);
}

.tech-enabled-text {
    color: #8fd1d8;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

@keyframes techAwardPulse {
    0% {
        transform: scale(0.86);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.16);
        opacity: 0;
    }
}

@media (max-width: 760px) {
    .tech-chooser-card--chart {
        aspect-ratio: auto;
        overflow: auto;
        padding: 3.4rem 1rem 1.15rem;
        background:
            linear-gradient(180deg, rgba(244, 226, 183, 0.92), rgba(210, 185, 140, 0.92)),
            url("../img/menus/technology/tech_card_chooser.png") center / cover no-repeat;
        border-radius: 8px;
    }

    .tech-breakthrough-banner,
    .tech-dice-results--compact {
        position: static;
        width: auto;
        transform: none;
        margin-bottom: 0.6rem;
    }

    .tech-chooser-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
        height: auto;
        padding-top: 0;
    }

    .tech-dialog-actions {
        justify-content: stretch;
        flex-direction: column-reverse;
    }

    .tech-dialog-actions .tech-chooser-action {
        width: 100%;
    }
}

.loading-mark {
    position: relative;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.loading-progress circle {
    fill: none;
    stroke: rgba(159, 131, 95, 0.24);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #9F835F;
    stroke-dasharray: calc(3.141 * 2 * 40%);
    stroke-dashoffset: calc(3.141 * 2 * 40%);
    animation: dash 2s linear infinite;
}

.loading-logo {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 4.4rem;
    height: 4rem;
    object-fit: contain;
    transform: translate(-50%, -50%);
    filter:
        drop-shadow(0 0 10px rgba(212, 167, 106, 0.35))
        drop-shadow(0 0 16px rgba(0, 219, 233, 0.16));
}

.loading-progress-text {
    text-align: center;
    color: #b9c1cc;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading AlgoWars…");
}

@keyframes dash {
    to { stroke-dashoffset: 0; }
}

/* Swap page — ALGO → AWAR buy flow. Mostly reuses .signin-gate, .panel,
   and .wallet-btn from the game page; the extras below style the amount
   input + result block. */
.swap-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 24rem;
    margin-top: 0.75rem;
}

.swap-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #b9c1cc;
    font-size: 0.9rem;
}

.swap-form input[type="number"] {
    padding: 0.5rem;
    font-size: 1.1rem;
    background: #1e232a;
    border: 1px solid #3a4150;
    border-radius: 4px;
    color: #e4e7ec;
}

.swap-preview {
    min-height: 1.5rem;
    color: #b9c1cc;
}

.swap-preview .error,
.swap-preview span.error {
    color: #e06060;
}

.swap-result {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #1a2a1c;
    border: 1px solid #2d5a33;
    border-radius: 4px;
}

.swap-result a {
    color: #86efac;
    word-break: break-all;
}

/* Pregame menu screens. */
.pregame-screen {
    min-height: calc(100vh - 54px);
    background:
        linear-gradient(rgba(10, 12, 16, 0.16), rgba(10, 12, 16, 0.24)),
        url("../img/menu_bg.png") center / cover no-repeat;
    padding: 3rem 2rem;
    color: #f7f0dc;
}

.pregame-cardless {
    width: min(760px, 92vw);
    margin: 0 auto;
    padding-top: 1rem;
}

.pregame-title {
    margin: 0 0 2rem;
    color: #f7f0dc;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3.8rem);
    font-weight: 800;
    text-align: center;
    text-shadow: 0 2px 2px rgba(43, 24, 12, 0.45);
}

.pregame-loading,
.pregame-error,
.pregame-inline-error {
    width: min(680px, 92vw);
    margin: 0 auto;
    padding: 0.8rem 1rem;
    background: rgba(60, 28, 22, 0.78);
    border: 1px solid rgba(126, 54, 39, 0.7);
    border-radius: 6px;
    color: #ffe4d8;
    text-align: center;
}

.settings-menu {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.settings-row {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(11rem, 16rem);
    align-items: center;
    gap: 1rem;
    color: #fbf3df;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 1px 1px rgba(43, 24, 12, 0.4);
}

.settings-row select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 249, 231, 0.94);
    border: 2px solid rgba(83, 51, 25, 0.72);
    border-radius: 5px;
    color: #2d2118;
    font: 800 0.85rem Georgia, "Times New Roman", serif;
    text-transform: uppercase;
}

.settings-row select:disabled {
    opacity: 0.72;
}

.settings-row-note {
    grid-column: 1 / -1;
    margin-top: -0.35rem;
    margin-bottom: 0.15rem;
    padding-left: 0.1rem;
    color: rgba(251, 243, 223, 0.78);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.78rem;
    font-style: italic;
    font-weight: 500;
    text-transform: none;
    line-height: 1.3;
    text-shadow: 0 1px 1px rgba(43, 24, 12, 0.35);
}

.pregame-cta-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pregame-cta,
.pregame-secondary {
    min-width: 11rem;
    padding: 0.75rem 1.15rem;
    border: 2px solid #6b4a18;
    border-radius: 5px;
    font: 900 0.9rem Georgia, "Times New Roman", serif;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
}

.pregame-cta {
    background: #d6a237;
    color: #1f1710;
    box-shadow: 0 2px 0 rgba(69, 43, 16, 0.72);
}

.pregame-secondary {
    background: rgba(255, 249, 231, 0.88);
    color: #2d2118;
}

.pregame-cta:disabled,
.pregame-secondary:disabled {
    opacity: 0.55;
    cursor: default;
}

.pregame-footnote {
    margin-top: 1rem;
    text-align: center;
    color: rgba(255, 249, 231, 0.86);
    font-weight: 700;
    text-transform: uppercase;
}

.invite-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 9.5rem;
    gap: 1rem;
    margin-top: 1.35rem;
    padding: 1rem;
    background: rgba(255, 249, 231, 0.88);
    border: 2px solid rgba(83, 51, 25, 0.72);
    border-radius: 6px;
    color: #2d2118;
    box-shadow: 0 2px 0 rgba(69, 43, 16, 0.35);
}

.invite-panel__main {
    display: grid;
    gap: 0.65rem;
}

.invite-panel h3,
.invite-panel p {
    margin: 0;
}

.invite-panel h3 {
    font: 900 1rem Georgia, "Times New Roman", serif;
    text-transform: uppercase;
}

.invite-panel p {
    color: rgba(45, 33, 24, 0.78);
    font-size: 0.88rem;
}

.invite-code,
.invite-link {
    display: grid;
    gap: 0.25rem;
}

.invite-code span,
.invite-link span {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invite-code code,
.invite-link input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.55rem;
    background: rgba(31, 23, 16, 0.08);
    border: 1px solid rgba(83, 51, 25, 0.35);
    border-radius: 4px;
    color: #1f1710;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
}

.invite-link input[type="email"] {
    background: #fff9e7;
}

.invite-mail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    text-decoration: none;
}

.invite-qr {
    align-self: start;
    justify-self: end;
    width: 9rem;
    padding: 0.35rem;
    background: #fff9e7;
    border: 1px solid rgba(83, 51, 25, 0.35);
    border-radius: 4px;
}

.invite-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.settings-create {
    padding: 0;
}

.settings-create .pregame-cardless {
    width: 100%;
    padding: 0;
}

.settings-create .pregame-title {
    display: none;
}

.settings-create .settings-row {
    color: #d7deea;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.86rem;
    text-shadow: none;
}

.settings-create .settings-row select {
    border-color: rgba(170, 185, 201, 0.28);
    background: #111820;
    color: #e6e6e6;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.settings-create .pregame-cta-row {
    justify-content: flex-start;
    margin-top: 1rem;
}

.region-layout {
    display: grid;
    grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr);
    gap: 2rem;
    width: min(1120px, 96vw);
    margin: 0 auto;
}

.selection-order {
    padding-top: 4.5rem;
}

.selection-order h3 {
    margin: 0 0 1rem;
    color: #f7f0dc;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
}

.selection-order ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.selection-order li {
    display: grid;
    gap: 0.1rem;
    padding: 0.65rem 0.75rem;
    background: rgba(40, 25, 15, 0.48);
    border: 1px solid rgba(255, 239, 196, 0.22);
    border-radius: 6px;
}

.selection-order li.is-active {
    background: rgba(214, 162, 55, 0.92);
    color: #1f1710;
}

.selection-order span,
.selection-order small {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.selection-order strong {
    overflow: hidden;
    text-overflow: ellipsis;
}

.region-main {
    min-width: 0;
}

.nation-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(7.5rem, 1fr));
    gap: 0.8rem;
}

.nation-card {
    position: relative;
    min-height: 17rem;
    padding: 0;
    overflow: hidden;
    background: #1b1612;
    border: 2px solid rgba(255, 239, 196, 0.36);
    border-radius: 6px;
    cursor: pointer;
}

.nation-card:disabled {
    cursor: default;
}

.nation-card img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 17rem;
    object-fit: cover;
}

.nation-card.is-disabled img {
    filter: grayscale(1) brightness(0.55);
}

.nation-card.is-picked img {
    filter: saturate(0.9) brightness(0.76);
}

.nation-name,
.nation-chip {
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    z-index: 1;
    text-align: center;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 900;
    text-transform: uppercase;
}

.nation-name {
    bottom: 0.6rem;
    padding: 0.3rem;
    color: #fff6dc;
    background: rgba(23, 15, 9, 0.72);
}

.nation-chip {
    top: 0.55rem;
    padding: 0.3rem 0.45rem;
    background: #f0ce5b;
    color: #22190f;
    border: 1px solid #6b4a18;
    border-radius: 4px;
    font-size: 0.75rem;
}

.nation-chip--available {
    background: #e3ac35;
}

@media (max-width: 900px) {
    .app-header {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 0.5rem 0.85rem;
    }

    .brand-lockup img {
        width: 3.5rem;
        height: 2.7rem;
    }

    .app-header .wallet-slot {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .lobby-shell {
        padding: 1rem;
    }

    .lobby-hero {
        display: block;
        margin-bottom: 1.4rem;
        padding-left: 0.85rem;
    }

    .lobby-era-readout {
        margin-top: 1rem;
    }

    .lobby-grid,
    .lobby-list-grid {
        grid-template-columns: 1fr;
    }

    .operation-card {
        align-items: stretch;
        flex-direction: column;
    }

    .command-btn--cyan {
        width: 100%;
    }

    .lobby__game-row,
    .lobby__paste {
        align-items: stretch;
        flex-direction: column;
    }

    .pledge-screen {
        align-items: start;
        padding: 1rem;
    }

    .pledge-poster {
        width: 100%;
    }

    .pledge-ledger {
        grid-template-columns: 1fr;
    }

    .landing-screen {
        grid-template-columns: 1fr;
        align-items: start;
        padding: 1rem;
    }

    .landing-hero {
        padding-left: 0.85rem;
    }

    .landing-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .landing-actions .command-btn {
        width: 100%;
    }

    .pregame-screen {
        padding: 2rem 1rem;
    }

    .settings-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .invite-panel {
        grid-template-columns: 1fr;
    }

    .invite-qr {
        justify-self: start;
    }

    .region-layout {
        grid-template-columns: 1fr;
    }

    .selection-order {
        padding-top: 0;
    }

    .nation-grid {
        grid-template-columns: repeat(2, minmax(8rem, 1fr));
    }
}

.purchase-backdrop {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: grid;
    place-items: center;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    background: rgba(4, 8, 16, 0.7);
    backdrop-filter: blur(4px);
}

.purchase-card {
    position: relative;
    width: min(94vw, 50rem);
    max-height: 88vh;
    overflow-y: auto;
    padding: 1.5rem 1.75rem 1.25rem;
    background: linear-gradient(180deg, #1a2438, #0e1828);
    border: 1px solid #38506e;
    border-radius: 12px;
    color: #e8e1cc;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    font-family: system-ui, sans-serif;
}

.purchase-backdrop.purchase-backdrop--minimized {
    place-items: end center;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.purchase-card.purchase-card--minimized {
    width: min(94vw, 42rem);
    max-height: none;
    margin-bottom: 1rem;
    padding: 0.58rem 0.72rem;
    overflow: visible;
    border-radius: 6px;
    pointer-events: auto;
}

.purchase-close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid #38506e;
    border-radius: 50%;
    background: rgba(15, 28, 44, 0.85);
    color: #e8e1cc;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.purchase-header h2 {
    margin: 0 0 0.4rem;
    font-size: 1.35rem;
    color: #f3eedb;
}

.purchase-budget {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.purchase-over {
    color: #ff6c6c;
    font-weight: 700;
}

.purchase-existing {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    opacity: 0.75;
}

.purchase-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 1rem 0 0;
    padding: 0.22rem;
    background: rgba(9, 18, 30, 0.72);
    border: 1px solid rgba(56, 80, 110, 0.65);
    border-radius: 6px;
}

.purchase-tab {
    min-width: 5.5rem;
    height: 2rem;
    padding: 0 0.75rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: rgba(232, 225, 204, 0.72);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.purchase-tab:hover,
.purchase-tab:focus-visible {
    color: #f3eedb;
    border-color: rgba(201, 163, 90, 0.55);
}

.purchase-tab.is-active {
    background: linear-gradient(180deg, rgba(201, 163, 90, 0.34), rgba(117, 84, 36, 0.46));
    border-color: rgba(234, 195, 116, 0.78);
    color: #fff3cf;
    box-shadow: inset 0 0 0 1px rgba(255, 244, 208, 0.08);
}

.purchase-status {
    margin: 1.5rem 0;
    text-align: center;
    opacity: 0.75;
}

.purchase-list {
    display: grid;
    gap: 0.4rem;
    margin: 1rem 0;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(56, 80, 110, 0.5);
    border-bottom: 1px solid rgba(56, 80, 110, 0.5);
}

.purchase-row {
    display: grid;
    grid-template-columns: 3.35rem minmax(8rem, 2fr) minmax(6rem, 1fr) 4rem 7rem 4.5rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
}

.purchase-row:nth-child(odd) {
    background: rgba(20, 36, 56, 0.55);
}

.purchase-row__asset {
    display: grid;
    place-items: center;
    width: 3.15rem;
    height: 3.15rem;
    border-radius: 5px;
    background:
        radial-gradient(circle at 50% 28%, rgba(255, 244, 208, 0.08), transparent 58%),
        rgba(5, 11, 18, 0.42);
}

.purchase-row__asset img {
    display: block;
    width: auto;
    max-width: 3rem;
    height: 2.95rem;
    object-fit: contain;
    filter:
        drop-shadow(0 2px 2px rgba(0, 0, 0, 0.72))
        drop-shadow(0 6px 7px rgba(0, 0, 0, 0.34));
}

.purchase-row__name {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.purchase-row__name strong {
    color: #f3eedb;
    font-size: 0.95rem;
}

.purchase-row__kind {
    font-size: 0.72rem;
    color: #9ab3cf;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.purchase-row__stats {
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    color: #c9d4e2;
}

.purchase-row__cost {
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    text-align: right;
    color: #c9a35a;
}

.purchase-row__qty {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    justify-self: center;
}

.purchase-row__qty button {
    width: 1.85rem;
    height: 1.85rem;
    border: 1px solid #38506e;
    border-radius: 50%;
    background: #142436;
    color: #f3eedb;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.purchase-row__qty button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.purchase-row__count {
    min-width: 1.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.purchase-row__line {
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: #e8e1cc;
}

.purchase-error {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: rgba(200, 67, 67, 0.18);
    border: 1px solid #c84343;
    border-radius: 6px;
    color: #ffd3d3;
}

.purchase-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(56, 80, 110, 0.5);
}

.purchase-total {
    flex: 1 1 auto;
    font-size: 1rem;
}

.purchase-confirm {
    padding: 0.55rem 1rem;
    border: none;
    border-radius: 6px;
    background: linear-gradient(180deg, #c9a35a, #9c7c3d);
    color: #1a1208;
    font-weight: 700;
    cursor: pointer;
}

.purchase-skip {
    min-width: 5.5rem;
    margin-top: 0;
}

.purchase-confirm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === Place phase: production tray + drop targets + quantity dialog === */

.prod-tray {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 220;
    width: min(96vw, 60rem);
    padding: 0.7rem 1rem;
    background: linear-gradient(180deg, rgba(20, 32, 48, 0.96), rgba(10, 20, 32, 0.96));
    border: 1px solid #38506e;
    border-radius: 12px;
    color: #e8e1cc;
    font-family: system-ui, sans-serif;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.prod-tray__header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.prod-tray__title {
    font-weight: 700;
    color: #f3eedb;
}

.prod-tray__hint {
    font-size: 0.78rem;
    color: #9ab3cf;
}

.prod-tray__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.prod-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    width: 4.5rem;
    padding: 0.4rem 0.3rem 0.35rem;
    background: rgba(20, 36, 56, 0.85);
    border: 1px solid #38506e;
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.prod-chip:hover:not(.prod-chip--disabled) {
    transform: translateY(-1px);
    border-color: #c9a35a;
    box-shadow: 0 6px 16px rgba(201, 163, 90, 0.25);
}

.prod-chip:active {
    cursor: grabbing;
}

.prod-chip--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.prod-chip__img {
    width: 2.6rem;
    height: 2.6rem;
    object-fit: contain;
    pointer-events: none;
}

.prod-chip__fallback {
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    background: #142436;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #9ab3cf;
}

.prod-chip__count {
    position: absolute;
    top: 2px;
    right: 4px;
    padding: 0 0.3rem;
    background: #c9a35a;
    color: #1a1208;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.prod-chip__label {
    font-size: 0.7rem;
    color: #c9d4e2;
    line-height: 1;
    text-align: center;
}

.drag-eligible {
    stroke: #f5d889;
    stroke-width: 4;
    stroke-linejoin: round;
    stroke-dasharray: 6 4;
    animation: prod-pulse 1.4s ease-in-out infinite;
}

.drag-target {
    stroke: #ffeac0 !important;
    stroke-width: 6 !important;
    stroke-dasharray: none !important;
    filter: drop-shadow(0 0 8px rgba(255, 234, 192, 0.85));
}

@keyframes prod-pulse {
    0%, 100% { stroke-opacity: 0.55; }
    50%      { stroke-opacity: 1; }
}

.start-battles-hold {
    --hold-progress: 0%;
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    min-width: 280px;
    padding: 0.85rem 1.6rem;
    border: 1px solid #c9a35a;
    border-radius: 999px;
    background: rgba(20, 14, 8, 0.92);
    color: #fff1c2;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.45),
        0 0 0 2px rgba(201, 163, 90, 0.25);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.start-battles-hold:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.start-battles-hold--finalize {
    border-color: rgba(133, 203, 214, 0.72);
    background: rgba(5, 24, 29, 0.94);
    color: #e5fbff;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.45),
        0 0 0 2px rgba(133, 203, 214, 0.2);
}

.start-battles-hold__fill {
    position: absolute;
    inset: 0;
    width: var(--hold-progress, 0%);
    background: linear-gradient(90deg, rgba(255, 102, 64, 0.85), rgba(255, 207, 90, 0.85));
    transition: width 0.05s linear;
    pointer-events: none;
}

.start-battles-hold__label {
    position: relative;
    z-index: 1;
}

.start-battles-hold--finalize .start-battles-hold__fill {
    background: linear-gradient(90deg, rgba(51, 126, 143, 0.88), rgba(133, 203, 214, 0.88));
}

.start-battles-hold.is-holding {
    border-color: #ffcf5a;
    box-shadow:
        0 8px 28px rgba(255, 102, 64, 0.35),
        0 0 0 2px rgba(255, 207, 90, 0.55);
}

.start-battles-hold--finalize.is-holding {
    border-color: #85cbd6;
    box-shadow:
        0 8px 28px rgba(51, 126, 143, 0.35),
        0 0 0 2px rgba(133, 203, 214, 0.52);
}

.qty-backdrop {
    position: fixed;
    inset: 0;
    z-index: 260;
    display: grid;
    place-items: center;
    background: rgba(4, 8, 16, 0.7);
    backdrop-filter: blur(4px);
}

.qty-card {
    width: min(92vw, 22rem);
    padding: 1.5rem 1.5rem 1.25rem;
    background: linear-gradient(180deg, #1a2438, #0e1828);
    border: 1px solid #38506e;
    border-radius: 12px;
    color: #e8e1cc;
    font-family: system-ui, sans-serif;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.qty-card h2 {
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
    color: #f3eedb;
}

.qty-target {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #9ab3cf;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 0.75rem;
}

.qty-stepper button {
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid #38506e;
    border-radius: 50%;
    background: #142436;
    color: #f3eedb;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.qty-stepper button[aria-label="Minimum"],
.qty-stepper button[aria-label="Maximum"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    padding: 0;
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.qty-stepper button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.qty-value {
    min-width: 3rem;
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #f3eedb;
}

.qty-cap {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    color: #9ab3cf;
}

.qty-error {
    margin: 0 0 0.75rem;
    padding: 0.4rem 0.6rem;
    background: rgba(200, 67, 67, 0.18);
    border: 1px solid #c84343;
    border-radius: 6px;
    color: #ffd3d3;
    font-size: 0.85rem;
}

.qty-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.qty-cancel {
    min-width: 5.25rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(232, 225, 204, 0.34);
    border-radius: 6px;
    background: rgba(8, 6, 6, 0.42);
    color: #f3eedb;
    font-weight: 700;
    cursor: pointer;
}

.qty-confirm {
    padding: 0.55rem 1rem;
    border: none;
    border-radius: 6px;
    background: linear-gradient(180deg, #c9a35a, #9c7c3d);
    color: #1a1208;
    font-weight: 700;
    cursor: pointer;
}

.qty-confirm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qty-cancel:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bombing-operation-card {
    width: min(34rem, calc(100vw - 2rem));
}

.bombing-operation-actions {
    display: grid;
    gap: 0.75rem;
}

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

.bombing-operation-actions .qty-cancel {
    justify-self: center;
    max-width: min(17rem, 100%);
    opacity: 0.78;
}

.bombing-operation-cancel {
    border-style: dashed;
}

.bombing-operation-choice {
    position: relative;
    display: grid;
    grid-template-rows: minmax(7rem, 1fr) auto;
    min-height: 10rem;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(232, 225, 204, 0.28);
    border-radius: 6px;
    background: rgba(8, 6, 6, 0.62);
    color: #f3eedb;
    font-family: Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

.bombing-operation-choice img {
    width: 100%;
    height: 100%;
    min-height: 7rem;
    object-fit: cover;
    filter: saturate(1.08) contrast(1.04);
}

.bombing-operation-choice span {
    display: grid;
    place-items: center;
    min-height: 2.45rem;
    padding: 0.45rem 0.6rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 48%),
        rgba(7, 6, 5, 0.84);
    letter-spacing: 0;
}

.bombing-operation-choice:hover,
.bombing-operation-choice:focus-visible {
    border-color: rgba(232, 225, 204, 0.72);
    transform: translateY(-1px);
}

.bombing-operation-choice:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.battle-console {
    position: fixed;
    top: 5.75rem;
    left: 50%;
    z-index: 260;
    display: grid;
    gap: 0.75rem;
    width: min(78rem, calc(100vw - 2rem));
    max-height: min(80vh, calc(100vh - 7.25rem));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.9rem;
    --battle-theme-rgb: 116, 24, 38;
    --battle-accent-rgb: 210, 74, 82;
    border: 1px solid rgba(var(--battle-accent-rgb), 0.52);
    border-radius: 0;
    background:
        linear-gradient(90deg, rgba(var(--battle-theme-rgb), 0.72), transparent 28%, transparent 72%, rgba(var(--battle-theme-rgb), 0.5)) top / 100% 1px no-repeat,
        linear-gradient(180deg, rgba(10, 8, 7, 0.34), rgba(8, 5, 4, 0.72)),
        radial-gradient(circle at 18% 0%, rgba(var(--battle-accent-rgb), 0.2), transparent 30%),
        linear-gradient(90deg, rgba(var(--battle-theme-rgb), 0.52), rgba(4, 6, 8, 0.68) 42%, rgba(var(--battle-theme-rgb), 0.42)),
        url("../img/battle/normandy.png") center / cover no-repeat,
        #100d0b;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.035),
        inset 0 0 42px rgba(var(--battle-theme-rgb), 0.16),
        0 12px 34px rgba(0, 0, 0, 0.46);
    color: #e8e1cc;
    transform: translateX(-50%);
    backdrop-filter: blur(9px) saturate(1.06);
    -webkit-backdrop-filter: blur(9px) saturate(1.06);
}

.tech-chooser-backdrop:not(.tech-chooser-backdrop--minimized):not(.tech-chooser-backdrop--dice-roll),
.purchase-backdrop:not(.purchase-backdrop--minimized),
.qty-backdrop,
.confirm-backdrop {
    background:
        linear-gradient(180deg, rgba(2, 5, 8, 0.58), rgba(0, 0, 0, 0.68)),
        rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lobby-boot,
.tech-chooser-card:not(.tech-chooser-card--chart):not(.tech-chooser-card--dice-roll),
.purchase-card,
.qty-card,
.confirm-card,
.battle-console {
    border: 1px solid rgba(0, 219, 233, 0.34);
    border-radius: 0;
    background:
        linear-gradient(90deg, rgba(0, 219, 233, 0.48), transparent 30%, transparent 70%, rgba(0, 219, 233, 0.22)) top / 100% 1px no-repeat,
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 44%),
        linear-gradient(135deg, rgba(0, 36, 38, 0.72), rgba(0, 18, 27, 0.74)),
        rgba(0, 20, 25, 0.68);
    color: #e8e1cc;
    box-shadow:
        inset 0 0 24px rgba(0, 219, 233, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 28px rgba(0, 219, 233, 0.12),
        0 24px 60px rgba(0, 0, 0, 0.54);
    backdrop-filter: blur(14px) saturate(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
}

.battle-console {
    border-color: rgba(var(--battle-accent-rgb), 0.54);
    background:
        linear-gradient(90deg, rgba(var(--battle-accent-rgb), 0.7), transparent 28%, transparent 72%, rgba(var(--battle-accent-rgb), 0.36)) top / 100% 1px no-repeat,
        linear-gradient(180deg, rgba(4, 4, 5, 0.24), rgba(4, 3, 3, 0.72)),
        radial-gradient(circle at 18% 0%, rgba(var(--battle-accent-rgb), 0.22), transparent 31%),
        linear-gradient(90deg, rgba(var(--battle-theme-rgb), 0.56), rgba(8, 6, 6, 0.66) 42%, rgba(var(--battle-theme-rgb), 0.44)),
        url("../img/battle/normandy.png") center / cover no-repeat,
        #100d0b;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 0 42px rgba(var(--battle-theme-rgb), 0.18),
        0 0 30px rgba(var(--battle-accent-rgb), 0.12),
        0 24px 60px rgba(0, 0, 0, 0.58);
}

.tech-chooser-card.tech-chooser-card--minimized,
.purchase-card.purchase-card--minimized {
    border-radius: 0;
    background:
        linear-gradient(90deg, rgba(0, 219, 233, 0.42), transparent 32%, transparent 68%, rgba(0, 219, 233, 0.18)) top / 100% 1px no-repeat,
        linear-gradient(135deg, rgba(0, 36, 38, 0.76), rgba(0, 18, 27, 0.78)),
        rgba(0, 20, 25, 0.72);
}

.turn-modal-theme.tech-chooser-backdrop:not(.tech-chooser-backdrop--minimized):not(.tech-chooser-backdrop--dice-roll),
.turn-modal-theme.purchase-backdrop:not(.purchase-backdrop--minimized),
.turn-modal-theme.qty-backdrop,
.turn-modal-theme.confirm-backdrop {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.turn-modal-theme .tech-chooser-card:not(.tech-chooser-card--chart):not(.tech-chooser-card--dice-roll),
.turn-modal-theme .purchase-card,
.turn-modal-theme .qty-card,
.turn-modal-theme .confirm-card {
    border-color: rgba(var(--battle-accent-rgb), 0.54);
    border-radius: 0;
    background:
        linear-gradient(90deg, rgba(var(--battle-accent-rgb), 0.66), transparent 28%, transparent 72%, rgba(var(--battle-accent-rgb), 0.3)) top / 100% 1px no-repeat,
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018) 42%, rgba(0, 0, 0, 0.22)),
        radial-gradient(circle at 18% 0%, rgba(var(--battle-accent-rgb), 0.18), transparent 31%),
        linear-gradient(135deg, rgba(var(--battle-theme-rgb), 0.48), rgba(8, 8, 10, 0.68) 52%, rgba(var(--battle-theme-rgb), 0.34)),
        rgba(9, 10, 12, 0.72);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 0 42px rgba(var(--battle-theme-rgb), 0.18),
        0 0 30px rgba(var(--battle-accent-rgb), 0.12),
        0 24px 60px rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(16px) saturate(1.12);
    -webkit-backdrop-filter: blur(16px) saturate(1.12);
}

.turn-modal-theme .tech-chooser-card.tech-chooser-card--minimized,
.turn-modal-theme .purchase-card.purchase-card--minimized {
    border-color: rgba(var(--battle-accent-rgb), 0.54);
    background:
        linear-gradient(90deg, rgba(var(--battle-accent-rgb), 0.62), transparent 32%, transparent 68%, rgba(var(--battle-accent-rgb), 0.28)) top / 100% 1px no-repeat,
        linear-gradient(135deg, rgba(var(--battle-theme-rgb), 0.72), rgba(8, 6, 6, 0.78)),
        rgba(14, 10, 10, 0.76);
}

.turn-modal-theme .tech-chooser-card--chart {
    filter: drop-shadow(0 26px 60px rgba(var(--battle-theme-rgb), 0.22)) drop-shadow(0 0 24px rgba(var(--battle-accent-rgb), 0.1));
}

.turn-modal-theme .phase-minibar strong,
.turn-modal-theme .tech-kicker,
.turn-modal-theme .purchase-row__cost,
.turn-modal-theme .qty-target strong {
    color: rgb(var(--battle-accent-rgb));
}

.turn-modal-theme .purchase-tabs {
    border-color: rgba(var(--battle-accent-rgb), 0.42);
    background: rgba(8, 6, 6, 0.58);
}

.turn-modal-theme .purchase-tab:hover,
.turn-modal-theme .purchase-tab:focus-visible,
.turn-modal-theme .purchase-tab.is-active {
    border-color: rgba(var(--battle-accent-rgb), 0.76);
    color: #fff3cf;
}

.turn-modal-theme .purchase-tab.is-active,
.turn-modal-theme .purchase-row__qty button,
.turn-modal-theme .qty-stepper button {
    background:
        linear-gradient(180deg, rgba(var(--battle-accent-rgb), 0.3), rgba(var(--battle-theme-rgb), 0.48)),
        rgba(8, 6, 6, 0.72);
}

.turn-modal-theme .purchase-row:nth-child(odd),
.turn-modal-theme .tech-buy-budget,
.turn-modal-theme .tech-status-panel,
.turn-modal-theme .tech-award-panel,
.turn-modal-theme .purchase-row__asset {
    background: rgba(var(--battle-theme-rgb), 0.28);
}

.turn-modal-theme .tech-chooser-action,
.turn-modal-theme .purchase-confirm,
.turn-modal-theme .qty-cancel,
.turn-modal-theme .qty-confirm,
.turn-modal-theme .bombing-operation-choice {
    border: 1px solid rgba(var(--battle-accent-rgb), 0.72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 44%),
        linear-gradient(180deg, rgba(var(--battle-accent-rgb), 0.9), rgba(var(--battle-theme-rgb), 0.86));
    color: #120d0a;
    box-shadow: 0 10px 24px rgba(var(--battle-theme-rgb), 0.22);
}

.turn-modal-theme .tech-chooser-action--secondary,
.turn-modal-theme .qty-cancel,
.turn-modal-theme .wallet-btn--link {
    background: rgba(8, 6, 6, 0.42);
    color: rgb(var(--battle-accent-rgb));
}

.turn-modal-theme .bombing-operation-choice {
    background: rgba(8, 6, 6, 0.58);
    color: #fff3cf;
}

.turn-modal-theme .bombing-operation-choice span {
    background:
        linear-gradient(180deg, rgba(var(--battle-accent-rgb), 0.28), rgba(var(--battle-theme-rgb), 0.56)),
        rgba(7, 6, 5, 0.84);
}

.battle-console__header,
.battle-console__row,
.battle-console__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.battle-console__header {
    text-align: center;
}

.battle-console__header h2 {
    margin: 0.1rem 0 0;
    color: #f3eedb;
    font-size: 1.25rem;
    line-height: 1.2;
}

.battle-console__header p {
    margin: 0.18rem 0 0;
    color: rgba(238, 230, 209, 0.82);
    font-size: 0.78rem;
}

.battle-console__kicker {
    color: rgb(var(--battle-accent-rgb));
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.battle-console__nav {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(var(--battle-accent-rgb), 0.46);
    border-radius: 0;
    background: rgba(var(--battle-theme-rgb), 0.36);
    color: rgb(var(--battle-accent-rgb));
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.battle-console__territories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.battle-console__territory {
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(var(--battle-accent-rgb), 0.34);
    border-radius: 0;
    background: rgba(9, 8, 8, 0.5);
    color: rgba(238, 230, 209, 0.84);
    font-size: 0.78rem;
    cursor: pointer;
}

.battle-console__territory.is-selected {
    border-color: rgba(var(--battle-accent-rgb), 0.9);
    background: rgba(var(--battle-theme-rgb), 0.48);
    color: #f3eedb;
    box-shadow: 0 0 16px rgba(var(--battle-accent-rgb), 0.16);
}

.battle-console__stage {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) minmax(13rem, 0.58fr) minmax(18rem, 1fr);
    gap: 0.9rem;
    min-height: min(31rem, calc(100vh - 16rem));
}

.battle-console__status {
    margin: 0;
    color: #9ab3cf;
    font-size: 0.86rem;
    line-height: 1.4;
}

/* Opponent-waiting state shown when the local player isn't on the casualty
   side. Replaces the silent disabled-chips experience with a clear "they're
   thinking" message so the active player knows the battle hasn't stalled. */
.battle-console__waiting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.45rem 0.65rem;
    border: 1px dashed rgba(var(--battle-accent-rgb), 0.42);
    border-radius: 0;
    background: rgba(8, 7, 7, 0.56);
    color: rgba(238, 230, 209, 0.84);
    font-size: 0.86rem;
    line-height: 1.35;
}

.battle-console__waiting-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.battle-console__primary,
.battle-console__secondary {
    min-height: 2.25rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0;
    font-weight: 800;
    cursor: pointer;
}

.battle-console__primary {
    border: 1px solid rgba(var(--battle-accent-rgb), 0.72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 44%),
        linear-gradient(180deg, rgba(var(--battle-accent-rgb), 0.95), rgba(var(--battle-theme-rgb), 0.86));
    color: #120d0a;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 0 18px rgba(var(--battle-accent-rgb), 0.18);
}

.battle-console__secondary {
    border: 1px solid rgba(var(--battle-accent-rgb), 0.38);
    background: rgba(var(--battle-theme-rgb), 0.34);
    color: #e8e1cc;
}

.battle-console__primary--center,
.battle-console__secondary--center {
    width: min(14rem, 100%);
    justify-self: center;
}

.battle-console__primary--center {
    min-height: 3rem;
    font-size: 1.3rem;
}

.battle-console button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.battle-console__center,
.battle-console__roll {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.75rem;
    text-align: center;
}

.battle-console__target {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem;
    width: 100%;
    border: 1px solid rgba(var(--battle-accent-rgb), 0.26);
    background: rgba(7, 6, 5, 0.48);
}

.battle-console__target span,
.battle-console__unresolved span {
    color: rgba(238, 230, 209, 0.72);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.battle-console__target strong {
    color: #f3eedb;
    font-size: 1.05rem;
}

.battle-console__unresolved {
    display: grid;
    gap: 0.2rem;
    min-width: 8rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(var(--battle-accent-rgb), 0.34);
    background: rgba(var(--battle-theme-rgb), 0.38);
}

.battle-console__unresolved strong {
    color: rgb(var(--battle-accent-rgb));
    font-size: 2rem;
    line-height: 1;
}

.battle-console__error {
    margin: 0;
    padding: 0.45rem 0.6rem;
    border: 1px solid #c84343;
    border-radius: 0;
    background: rgba(200, 67, 67, 0.18);
    color: #ffd3d3;
    font-size: 0.82rem;
}

.battle-side {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 26rem;
    min-width: 0;
    max-height: min(38rem, calc(100vh - 14rem));
    border: 1px solid rgba(var(--battle-accent-rgb), 0.42);
    background:
        linear-gradient(180deg, rgba(var(--battle-accent-rgb), 0.08), transparent 34%),
        linear-gradient(135deg, rgba(var(--battle-theme-rgb), 0.34), rgba(3, 3, 4, 0.56)),
        rgba(5, 5, 5, 0.54);
    box-shadow:
        inset 0 0 22px rgba(var(--battle-accent-rgb), 0.06),
        0 0 18px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px) saturate(1.08);
    -webkit-backdrop-filter: blur(6px) saturate(1.08);
    overflow: hidden;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, filter 0.16s ease;
}

.battle-side.is-active {
    border-color: rgba(var(--battle-accent-rgb), 0.9);
    box-shadow:
        0 0 0 1px rgba(var(--battle-accent-rgb), 0.24),
        0 0 28px rgba(var(--battle-accent-rgb), 0.16),
        inset 0 0 28px rgba(var(--battle-accent-rgb), 0.08);
}

.battle-side.is-active .battle-side__header {
    background: linear-gradient(90deg, rgba(var(--battle-accent-rgb), 0.16), rgba(var(--battle-theme-rgb), 0.1));
}

.battle-side.is-dimmed {
    opacity: 0.54;
    filter: saturate(0.72);
}

.battle-side__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(var(--battle-accent-rgb), 0.24);
}

.battle-side__header > div:first-child {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.battle-side__header span {
    color: #e8e1cc;
    font-size: 1.45rem;
    line-height: 1;
}

.battle-side__header strong {
    color: rgb(var(--battle-accent-rgb));
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.battle-side__flags {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    max-width: 11rem;
}

.battle-side__flags img {
    width: 4.2rem;
    height: 4.2rem;
    object-fit: cover;
    border: 1px solid rgba(var(--battle-accent-rgb), 0.7);
}

.battle-side__flags img:not(:only-child) {
    width: 3.25rem;
    height: 3.25rem;
}

.battle-side__units {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.7rem, 1fr));
    align-content: start;
    gap: 0.65rem;
    padding: 1rem;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--battle-accent-rgb), 0.5) rgba(2, 8, 12, 0.42);
}

.battle-side__units::-webkit-scrollbar {
    width: 0.45rem;
}

.battle-side__units::-webkit-scrollbar-track {
    background: rgba(2, 8, 12, 0.42);
}

.battle-side__units::-webkit-scrollbar-thumb {
    background: rgba(var(--battle-accent-rgb), 0.5);
}

.battle-side__empty {
    grid-column: 1 / -1;
    margin: 0;
    color: #9ab3cf;
    font-size: 0.86rem;
}

.battle-unit {
    display: grid;
    position: relative;
    justify-items: center;
    gap: 0.25rem;
    min-height: 7.5rem;
    padding: 1.65rem 0.5rem 0.5rem;
    border: 1px solid rgba(var(--battle-accent-rgb), 0.18);
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 44%),
        rgba(5, 6, 6, 0.44);
    color: #e8e1cc;
}

.battle-hit-target {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    display: inline-grid;
    place-items: center;
    min-width: 2rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border: 1px solid rgba(var(--battle-accent-rgb), 0.5);
    background:
        linear-gradient(180deg, rgba(var(--battle-accent-rgb), 0.18), rgba(0, 0, 0, 0.82)),
        rgba(2, 8, 12, 0.86);
    color: #f3eedb;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
    box-shadow:
        0 0.12rem 0.25rem rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.battle-roll-dice {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.16rem;
    max-width: 3.8rem;
    pointer-events: none;
}

.battle-unit .battle-roll-die {
    position: relative;
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--die-border, #dfbd73);
    border-radius: 0.22rem;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 42%),
        var(--die-fill, #c9a35a);
    box-shadow:
        0 0.12rem 0.25rem rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.battle-unit .battle-roll-die.is-hit {
    box-shadow:
        0 0 0 1px rgba(244, 211, 94, 0.4),
        0 0.12rem 0.35rem rgba(0, 0, 0, 0.55),
        0 0 0.55rem rgba(244, 211, 94, 0.2);
}

.battle-unit .battle-roll-die__pip {
    position: absolute;
    display: block;
    width: 0.22rem;
    height: 0.22rem;
    border-radius: 50%;
    background: var(--die-pip, #050505);
    transform: translate(-50%, -50%);
}

.battle-roll-die__pip.pip-top-left {
    top: 28%;
    left: 28%;
}

.battle-roll-die__pip.pip-top-right {
    top: 28%;
    left: 72%;
}

.battle-roll-die__pip.pip-middle-left {
    top: 50%;
    left: 28%;
}

.battle-roll-die__pip.pip-middle-right {
    top: 50%;
    left: 72%;
}

.battle-roll-die__pip.pip-center {
    top: 50%;
    left: 50%;
}

.battle-roll-die__pip.pip-bottom-left {
    top: 72%;
    left: 28%;
}

.battle-roll-die__pip.pip-bottom-right {
    top: 72%;
    left: 72%;
}

.battle-unit.can-select {
    border-color: rgba(var(--battle-accent-rgb), 0.5);
    cursor: grab;
}

.battle-unit.is-selected {
    border-color: rgb(var(--battle-accent-rgb));
    background: rgba(var(--battle-theme-rgb), 0.58);
    box-shadow: 0 0 18px rgba(var(--battle-accent-rgb), 0.18);
}

.battle-unit img {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
    filter: drop-shadow(0 0.2rem 0.18rem rgba(0, 0, 0, 0.7));
}

.battle-unit span {
    max-width: 100%;
    color: #f3eedb;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.battle-unit strong {
    color: #9ab3cf;
    font-size: 0.72rem;
}

.battle-side__losses {
    display: grid;
    gap: 0.55rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid rgba(var(--battle-accent-rgb), 0.2);
    background: rgba(4, 3, 3, 0.5);
}

.battle-side__loss-summary,
.battle-side__aw {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: rgba(238, 230, 209, 0.72);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.battle-side__loss-summary strong,
.battle-side__aw strong {
    color: #f3eedb;
}

.battle-side__loss-box {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 4.5rem;
    padding: 0.45rem;
    border: 1px dashed rgba(var(--battle-accent-rgb), 0.28);
    background: rgba(2, 2, 2, 0.42);
}

.battle-side__loss-box.is-droppable {
    border-color: rgba(var(--battle-accent-rgb), 0.58);
}

.battle-side__loss-box span {
    color: rgba(238, 230, 209, 0.72);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.battle-side__loss-box img {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
}

@media (max-width: 900px) {
    .battle-console {
        top: 4.75rem;
        right: auto;
        bottom: 0.75rem;
        left: 50%;
        width: calc(100vw - 1.5rem);
        max-height: min(80vh, calc(100vh - 5.5rem));
    }

    .battle-console__stage {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .battle-side {
        min-height: 18rem;
    }
}

.game-chat-panel {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 790;
    display: flex;
    flex-direction: column;
    width: 340px;
    max-width: calc(100vw - 36px);
    max-height: min(460px, calc(100vh - 140px));
    overflow: hidden;
    border: 1px solid #2a3a52;
    border-radius: 10px;
    background: rgba(10, 16, 26, 0.94);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    color: #d8d3c2;
    font-family: system-ui, sans-serif;
}

.game-chat-panel--collapsed {
    width: 190px;
}

.game-chat-panel__header {
    border-bottom: 1px solid rgba(154, 179, 207, 0.22);
}

.game-chat-panel--collapsed .game-chat-panel__header {
    border-bottom: 0;
}

.game-chat-panel__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.55rem;
    padding: 0.6rem 0.75rem;
    border: 0;
    background: transparent;
    color: #f6dca0;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
}

.game-chat-panel__toggle strong {
    display: grid;
    min-width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    border-radius: 999px;
    background: #38506e;
    color: #ffffff;
    font-size: 0.72rem;
}

.game-chat-panel__messages {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.48rem;
    min-height: 8rem;
    overflow: auto;
    padding: 0.65rem;
}

.game-chat-panel__empty {
    margin: auto;
    color: rgba(216, 211, 194, 0.62);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.game-chat-message {
    display: grid;
    gap: 0.25rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(154, 179, 207, 0.18);
    border-radius: 7px;
    background: rgba(15, 28, 44, 0.82);
}

.game-chat-message.is-scrambled {
    background:
        repeating-linear-gradient(135deg, rgba(246, 220, 160, 0.08) 0 5px, transparent 5px 10px),
        rgba(20, 21, 33, 0.86);
}

.game-chat-message__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: #f6dca0;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.game-chat-message__meta small {
    color: #9ab3cf;
    font-size: 0.66rem;
}

.game-chat-message p {
    margin: 0;
    color: #f3eedb;
    font-size: 0.86rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.game-chat-message.is-scrambled p {
    color: #c8bfd8;
    letter-spacing: 0.04em;
}

.game-chat-panel__form {
    display: grid;
    gap: 0.5rem;
    padding: 0.65rem;
    border-top: 1px solid rgba(154, 179, 207, 0.22);
}

.game-chat-panel__scope,
.game-chat-panel__entry {
    display: flex;
    gap: 0.45rem;
}

.game-chat-panel__scope button,
.game-chat-panel__entry button {
    border: 1px solid #38506e;
    border-radius: 6px;
    background: #0f1c2c;
    color: #e8e1cc;
    cursor: pointer;
    font-weight: 800;
}

.game-chat-panel__scope button {
    flex: 1 1 0;
    min-height: 2rem;
    font-size: 0.76rem;
}

.game-chat-panel__scope button.is-active,
.game-chat-panel__entry button {
    background: #f0c35c;
    border-color: #6e4d20;
    color: #1a1208;
}

.game-chat-panel__entry input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.35rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid #38506e;
    border-radius: 6px;
    background: #07111c;
    color: #f3eedb;
}

.game-chat-panel__entry button {
    flex: 0 0 auto;
    min-width: 4.5rem;
    min-height: 2.35rem;
}

.game-chat-panel button:disabled,
.game-chat-panel input:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.game-chat-panel__error {
    padding: 0.4rem 0.55rem;
    border: 1px solid #c84343;
    border-radius: 6px;
    background: rgba(200, 67, 67, 0.18);
    color: #ffd3d3;
    font-size: 0.78rem;
}

@media (max-width: 640px) {
    .game-chat-panel {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-width: none;
        max-height: 48vh;
    }

    .game-chat-panel--collapsed {
        left: auto;
        width: 190px;
    }
}

/* ──────────────────────────────────────────────────────────────────────
 * Video conferencing panel + per-participant tiles. Floats in the top-
 * right corner of the in-game viewport. Hidden entirely when the lobby
 * host hasn't enabled video conferencing for the table.
 * ──────────────────────────────────────────────────────────────────── */
.video-call-panel {
    position: fixed;
    top: 88px;
    right: 18px;
    width: 300px;
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 120px);
    overflow: auto;
    z-index: 800;
    background: rgba(10, 16, 26, 0.92);
    border: 1px solid #2a3a52;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    color: #d8d3c2;
    font-family: system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem;
}

.video-call-panel--connected {
    width: 340px;
}

.video-call-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f6dca0;
}

.video-call-panel__tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    min-height: 0;
}

.video-call-panel__tiles:empty {
    display: none;
}

.video-call-fallback-host {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.video-call-tile {
    position: relative;
    width: 100%;
    height: 100%;
    background: #1a1f2a;
    border: 1px solid #2a3a52;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-call-tile--self {
    border-color: #c9a35a;
}

.video-call-tile--team-private {
    border-color: #7c4f9f;
    background:
        repeating-linear-gradient(135deg, rgba(246, 220, 160, 0.12) 0 6px, transparent 6px 12px),
        #181521;
}

.video-call-grid .video-call-tile--team-private::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 5px),
        linear-gradient(180deg, rgba(87, 49, 114, 0.34), rgba(12, 16, 26, 0.2));
    mix-blend-mode: screen;
    pointer-events: none;
}

.video-call-tile__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-call-tile--team-private .video-call-tile__video {
    filter: blur(12px) contrast(1.6) saturate(0.35);
    transform: scale(1.12);
}

.video-call-tile__placeholder {
    font-size: 2.2rem;
    font-weight: 700;
    color: #d8d3c2;
    opacity: 0.6;
    user-select: none;
}

.video-call-tile__label {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.75rem;
    border-radius: 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
}

.video-call-tile__status {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 6px;
    background: rgba(200, 67, 67, 0.85);
    color: #fff;
    font-size: 0.75rem;
    border-radius: 4px;
    pointer-events: none;
}

.video-call-panel__cta,
.video-call-panel__controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.video-call-btn {
    flex: 1 1 auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid #38506e;
    border-radius: 6px;
    background: #0f1c2c;
    color: #e8e1cc;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease;
}

.video-call-btn:hover:not(:disabled) {
    background: #16263b;
}

.video-call-btn:disabled {
    opacity: 0.5;
    cursor: progress;
}

.video-call-btn--join {
    background: linear-gradient(180deg, #c9a35a, #9c7c3d);
    color: #1a1208;
    border-color: #6e4d20;
}

.video-call-btn--join:hover:not(:disabled) {
    background: linear-gradient(180deg, #d8b464, #ad8a46);
}

.video-call-btn--leave {
    flex: 0 0 auto;
    padding: 0.3rem 0.6rem;
    background: rgba(200, 67, 67, 0.18);
    border-color: #c84343;
    color: #ffd3d3;
    font-size: 0.75rem;
}

.video-call-btn--team-talk.is-active {
    background: #f0c35c;
    border-color: #6e4d20;
    color: #1a1208;
}

.video-call-panel__error {
    flex: 1 1 100%;
    padding: 0.4rem 0.6rem;
    background: rgba(200, 67, 67, 0.18);
    border: 1px solid #c84343;
    border-radius: 6px;
    color: #ffd3d3;
    font-size: 0.8rem;
}

/* AWAR Battle Center wallet */
.wallet-page {
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 3rem);
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0.82)),
        linear-gradient(110deg, rgba(212, 167, 106, 0.14), transparent 42%, rgba(0, 219, 233, 0.1)),
        url("../img/pledge_bg.png") center / cover fixed no-repeat;
    color: #e8e1cc;
}

.wallet-hero,
.wallet-balance-grid,
.wallet-flow-grid,
.wallet-readiness,
.wallet-success,
.wallet-error {
    width: min(1180px, 100%);
    margin-right: auto;
    margin-left: auto;
}

.wallet-hero {
    display: grid;
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

.wallet-back {
    width: fit-content;
    color: #7ef4ff;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
}

.wallet-back:hover {
    color: #ffffff;
}

.wallet-kicker {
    margin: 0 0 0.45rem;
    color: #d4a76a;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.wallet-hero h1 {
    max-width: 52rem;
    margin: 0;
    color: #f7efe2;
    font-size: clamp(2rem, 5vw, 4.4rem);
    font-weight: 950;
    line-height: 0.96;
    text-transform: uppercase;
}

.wallet-hero p:not(.wallet-kicker) {
    max-width: 48rem;
    margin: 0.75rem 0 0;
    color: rgba(232, 225, 204, 0.76);
    line-height: 1.58;
}

.wallet-balance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.wallet-balance-card,
.wallet-panel,
.wallet-readiness {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
        rgba(9, 14, 18, 0.86);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
}

.wallet-balance-card {
    position: relative;
    display: grid;
    gap: 0.55rem;
    min-height: 11rem;
    padding: 1.15rem;
    border-radius: 6px;
    overflow: hidden;
}

.wallet-balance-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #d4a76a;
}

.wallet-balance-card--chain::before { background: #7ef4ff; }
.wallet-balance-card--battle-center::before { background: #a5ff8a; }
.wallet-balance-card--reserve::before { background: #d4a76a; }

.wallet-balance-card__label {
    color: rgba(232, 225, 204, 0.62);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.wallet-balance-card strong {
    color: #ffffff;
    font-size: clamp(1.55rem, 3vw, 2.5rem);
    font-weight: 950;
    line-height: 1;
}

.wallet-balance-card p,
.wallet-balance-card small {
    margin: 0;
    color: rgba(232, 225, 204, 0.68);
    line-height: 1.45;
}

.wallet-warning {
    color: #ffcf8a !important;
}

.wallet-mini-action {
    width: fit-content;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(165, 255, 138, 0.34);
    border-radius: 4px;
    background: rgba(165, 255, 138, 0.1);
    color: #d7ffd0;
    font-weight: 800;
    cursor: pointer;
}

.wallet-mini-action--gold {
    border-color: rgba(244, 211, 94, 0.46);
    background: rgba(244, 211, 94, 0.14);
    color: #ffe88b;
}

.wallet-flow-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1rem;
    align-items: stretch;
}

.wallet-panel {
    padding: clamp(1rem, 2vw, 1.35rem);
    border-radius: 6px;
}

.wallet-panel--center {
    display: grid;
    justify-items: center;
    gap: 0.85rem;
    width: min(36rem, 100%);
    margin: 3rem auto 0;
    text-align: center;
}

.wallet-optin-panel {
    display: grid;
    gap: 0.9rem;
    width: min(1180px, 100%);
    margin: 0 auto 1rem;
}

.wallet-optin-panel code {
    color: #ffffff;
    font-weight: 900;
}

.wallet-optin-panel .wallet-action {
    width: fit-content;
}

.wallet-panel h2,
.wallet-readiness h2 {
    margin: 0;
    color: #f4d35e;
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wallet-panel p,
.wallet-readiness p {
    margin: 0.25rem 0 0;
    color: rgba(232, 225, 204, 0.72);
    line-height: 1.5;
}

.wallet-panel__heading {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.wallet-step {
    display: grid;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 1px solid rgba(0, 219, 233, 0.45);
    border-radius: 999px;
    color: #7ef4ff;
    font-weight: 950;
}

.wallet-transfer-panel {
    display: grid;
    align-content: start;
    gap: 0.9rem;
}

.wallet-alert {
    padding: 0.72rem 0.8rem;
    border: 1px solid rgba(255, 207, 138, 0.38);
    border-radius: 6px;
    background: rgba(76, 51, 18, 0.5);
    color: #ffe2b8;
    font-size: 0.88rem;
    line-height: 1.45;
}

.wallet-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.wallet-quick-row button {
    display: inline-flex;
    gap: 0.35rem;
    align-items: baseline;
    min-height: 2.1rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(212, 167, 106, 0.34);
    border-radius: 4px;
    background: rgba(212, 167, 106, 0.1);
    color: #f6dca0;
    font-weight: 850;
    cursor: pointer;
}

.wallet-quick-row button small {
    color: rgba(246, 220, 160, 0.72);
    font-size: 0.68rem;
    font-weight: 800;
}

.wallet-input-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    min-height: 3.1rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.36);
}

.wallet-input-row span,
.wallet-input-row b {
    color: rgba(232, 225, 204, 0.64);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.wallet-input-row input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.wallet-field-hint {
    color: #ffcf8a;
    font-size: 0.8rem;
    line-height: 1.35;
}

.wallet-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.76rem;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
}

.wallet-action--primary {
    background: #f4d35e;
    color: #1b1305;
    box-shadow: 0 0 20px rgba(244, 211, 94, 0.2);
}

.wallet-action--secondary {
    border-color: rgba(126, 244, 255, 0.42);
    background: rgba(0, 219, 233, 0.1);
    color: #bafaff;
}

.wallet-action:hover:not(:disabled) {
    filter: brightness(1.08);
}

.wallet-action:disabled,
.wallet-mini-action:disabled,
.wallet-quick-row button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.wallet-readiness {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 6px;
}

.wallet-success,
.wallet-error {
    padding: 0.75rem 0.9rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.wallet-success {
    border: 1px solid rgba(165, 255, 138, 0.32);
    background: rgba(41, 74, 44, 0.54);
    color: #d7ffd0;
}

.wallet-error {
    border: 1px solid rgba(255, 122, 122, 0.34);
    background: rgba(82, 24, 28, 0.54);
    color: #ffd3d3;
}

.wallet-buy-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
}

.wallet-buy-dialog {
    display: grid;
    gap: 1rem;
    width: min(38rem, 100%);
    max-height: min(90vh, 46rem);
    overflow: auto;
    padding: clamp(1rem, 2vw, 1.35rem);
    border: 1px solid rgba(244, 211, 94, 0.3);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(244, 211, 94, 0.08), transparent 38%),
        rgba(9, 14, 18, 0.96);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

.wallet-buy-dialog__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.wallet-buy-dialog__header h2 {
    margin: 0;
    color: #f4d35e;
    font-size: 1.25rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wallet-buy-close {
    display: grid;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: #e8e1cc;
    font-weight: 900;
    cursor: pointer;
}

.wallet-buy-close:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.wallet-buy-copy,
.wallet-buy-status {
    margin: 0;
    color: rgba(232, 225, 204, 0.76);
    line-height: 1.5;
}

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

.wallet-buy-options button {
    display: grid;
    gap: 0.25rem;
    min-height: 4.4rem;
    padding: 0.8rem;
    border: 1px solid rgba(244, 211, 94, 0.3);
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(244, 211, 94, 0.12), transparent),
        rgba(0, 0, 0, 0.32);
    color: #f7efe2;
    text-align: left;
    cursor: pointer;
}

.wallet-buy-options button:hover:not(:disabled) {
    border-color: rgba(244, 211, 94, 0.72);
    background: rgba(244, 211, 94, 0.16);
}

.wallet-buy-options button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.wallet-buy-options strong {
    color: #ffffff;
    font-size: 1.08rem;
    font-weight: 950;
}

.wallet-buy-options span {
    color: rgba(232, 225, 204, 0.68);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wallet-buy-error,
.wallet-buy-success {
    width: 100%;
    margin: 0;
}

.wallet-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(244, 211, 94, 0.18);
    border-top-color: #f4d35e;
    border-radius: 999px;
    animation: wallet-spin 0.85s linear infinite;
}

@keyframes wallet-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
    .wallet-balance-grid,
    .wallet-flow-grid {
        grid-template-columns: 1fr;
    }

    .wallet-readiness {
        align-items: stretch;
        flex-direction: column;
    }

    .wallet-buy-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .video-call-panel {
        top: auto;
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-width: none;
        max-height: 45vh;
    }

    .video-call-panel--connected {
        width: auto;
    }

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

/* Admin SVG map editor */
.map-editor-header {
    gap: 1.1rem;
}

.map-editor-header__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.map-editor-page {
    min-height: calc(100vh - 4.25rem);
    display: grid;
    grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr);
    background:
        linear-gradient(180deg, rgba(15, 18, 17, 0.96), rgba(7, 8, 8, 0.98)),
        #090908;
}

.map-editor-page--message {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
}

.map-editor-empty {
    width: min(34rem, calc(100vw - 2rem));
    padding: 1.5rem;
    border: 1px solid rgba(244, 211, 94, 0.24);
    border-radius: 8px;
    background: rgba(8, 10, 10, 0.84);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
    text-align: center;
}

.map-editor-empty img {
    width: 5rem;
    height: 4rem;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.map-editor-empty h1 {
    margin: 0 0 0.45rem;
    color: #f4d35e;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.map-editor-empty p {
    margin: 0;
    color: #b9c1cc;
}

.map-editor-tools {
    min-height: calc(100vh - 4.25rem);
    padding: 0.9rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(5, 6, 6, 0.74);
    overflow: auto;
}

.map-editor-panel {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
    margin-bottom: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(16, 20, 20, 0.74);
}

.map-editor-panel h2 {
    margin: 0;
    color: #e5e2e1;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.map-editor-tool {
    min-height: 2.35rem;
    border: 1px solid rgba(244, 211, 94, 0.24);
    border-radius: 6px;
    background: rgba(244, 211, 94, 0.08);
    color: #e5e2e1;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.map-editor-tool:hover {
    border-color: rgba(244, 211, 94, 0.5);
    color: #ffe28a;
}

.map-editor-tool.is-active {
    background: #d4a76a;
    border-color: #f4d35e;
    color: #1b1206;
}

.map-editor-field {
    display: grid;
    gap: 0.35rem;
}

.map-editor-field label {
    color: #b9c1cc;
    font-size: 0.74rem;
    font-weight: 760;
    text-transform: uppercase;
}

.map-editor-range-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.5rem;
    align-items: center;
    gap: 0.65rem;
}

.map-editor-range-row input {
    width: 100%;
}

.map-editor-range-row strong {
    color: #f4d35e;
    font-size: 0.78rem;
    text-align: right;
}

.map-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.map-editor-actions .wallet-btn {
    min-height: 2.15rem;
    padding: 0.42rem 0.72rem;
    font-size: 0.76rem;
}

.map-editor-hint {
    margin: 0;
    color: #9aa3ad;
    font-size: 0.78rem;
    line-height: 1.45;
}

.map-editor-stats {
    display: grid;
    gap: 0.45rem;
    margin: 0;
}

.map-editor-stats div {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.6rem;
    align-items: baseline;
}

.map-editor-stats dt {
    color: #8d98a4;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.map-editor-stats dd {
    margin: 0;
    color: #e5e2e1;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-editor-export {
    width: 100%;
    min-height: 9rem;
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.36);
    color: #b9c1cc;
    font: 0.72rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.map-editor-workbench {
    position: relative;
    min-width: 0;
    min-height: calc(100vh - 4.25rem);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.map-editor-statusbar {
    min-height: 2.45rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(8, 10, 10, 0.78);
    color: #b9c1cc;
    font-size: 0.82rem;
}

.map-editor-statusbar span:last-child {
    color: #f4d35e;
    font-weight: 800;
    text-transform: uppercase;
}

.map-editor-host {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        #111615;
    background-size: 24px 24px;
}

.map-editor-svg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
}

.map-editor-host[data-mode="pan"] .map-editor-svg {
    cursor: grab;
}

.map-editor-host[data-mode="lasso"] .map-editor-svg {
    cursor: crosshair;
}

.map-editor-shape {
    stroke: rgba(244, 211, 94, 0.4) !important;
    stroke-width: 0.9 !important;
    fill-opacity: 0.7 !important;
    cursor: pointer;
    transition: fill-opacity 0.12s ease, stroke 0.12s ease, stroke-width 0.12s ease;
}

.map-editor-shape--land {
    fill: #5f6f4b !important;
}

.map-editor-shape--sea {
    fill: #236f89 !important;
}

.map-editor-shape--impassable {
    fill: #666866 !important;
}

.map-editor-shape:hover {
    fill-opacity: 0.9 !important;
    stroke: rgba(255, 226, 138, 0.86) !important;
}

.map-editor-shape.is-selected {
    stroke: #00dbe9 !important;
    stroke-width: 1.75 !important;
    fill-opacity: 0.82 !important;
}

.map-editor-shape.is-target {
    stroke: #f4d35e !important;
    stroke-width: 1.55 !important;
    stroke-dasharray: 4 2;
}

.map-editor-shape.is-selected.is-target {
    stroke-dasharray: none;
}

.map-editor-reference-image {
    opacity: 0.2;
    pointer-events: none;
}

.map-editor-overlay {
    pointer-events: none;
}

.map-editor-point {
    pointer-events: all;
    fill: #00dbe9;
    stroke: #021113;
    stroke-width: 1.1;
    cursor: grab;
    vector-effect: non-scaling-stroke;
}

.map-editor-point--secondary {
    fill: #7ef4ff;
    opacity: 0.68;
}

.map-editor-point.is-lasso-selected {
    fill: #f4d35e;
    opacity: 1;
    stroke: #021113;
    stroke-width: 1.35;
}

.map-editor-point:hover {
    fill: #ffe28a;
}

.map-editor-host[data-mode="erase"] .map-editor-point {
    fill: #ff7a7a;
    cursor: not-allowed;
}

.map-editor-lasso {
    pointer-events: none;
    fill: rgba(244, 211, 94, 0.14);
    stroke: #f4d35e;
    stroke-width: 1;
    stroke-dasharray: 3 2;
    vector-effect: non-scaling-stroke;
}

@media (max-width: 980px) {
    .map-editor-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(34rem, 1fr);
    }

    .map-editor-tools {
        min-height: 0;
        max-height: 42vh;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .map-editor-header {
        flex-wrap: wrap;
    }

    .map-editor-header__actions {
        width: 100%;
        margin-left: 0;
    }
}
