/* styles.css */
:root {
    --ink: #090c11;
    --panel: #141922;
    --line: #343941;
    --sand: #e9dfcb;
    --muted: #9e988b;
    --amber: #e8a13a;
    --gold: #f5c36b;
    --danger: #c5543f;
    --green: #718c4a;
    --shadow: 0 24px 70px rgba(0, 0, 0, .65)
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #07090d;
    color: var(--sand);
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent
}

button,
input {
    font: inherit
}

button {
    touch-action: manipulation
}

#app {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(0px, 1.5vmin, 18px);
    background: radial-gradient(circle at 50% 0, #20242b 0, #090c11 62%)
}

#stage {
    position: relative;
    width: min(100%, 168vh);
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #0a0d13;
    box-shadow: var(--shadow);
    isolation: isolate
}

#stage:after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 0 80px rgba(0, 0, 0, .5)
}

#game {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    /* the in-game reticle IS the aim cursor — hide the OS pointer over the
       field so the two don't clash. UI buttons keep their own pointer cursor. */
    cursor: none
}

.hidden {
    display: none !important
}

#screens,
.screen {
    position: absolute;
    inset: 0
}

.screen {
    display: grid;
    place-items: center;
    padding: clamp(12px, 4vmin, 38px);
    background: rgba(6, 8, 11, .62);
    backdrop-filter: blur(3px)
}

/* The .panel is the real scroll container (max-height + overflow-y). Kill the
   horizontal scrollbar the decorative frame was triggering, and reserve the
   vertical gutter so a scrollbar appearing on hover never shifts / breaks the
   layout. Applied to every scrollable modal surface. */
.panel,
.set-scroll,
.ars-shop-scroll,
.set-panel {
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
}

.qr-loading {
    padding: 40px 12px;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 1px;
    text-align: center
}

/* ---------------------------------------------- BRIEFING CAROUSEL ---------- */
.how-panel { text-align: center; }
.brief-carousel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 12px;
}
.brief-viewport {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
.brief-track {
    display: flex;
    transition: transform .32s ease;
}
.brief-slide {
    flex: 0 0 100%;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    min-height: 190px;
    justify-content: center;
}
.brief-ico {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .5));
}
.brief-step {
    font-size: 10px;
    letter-spacing: 3px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--amber);
}
.brief-slide b {
    font-family: Georgia, serif;
    font-size: 20px;
    color: var(--sand);
}
.brief-slide p {
    margin: 2px 0 0;
    max-width: 340px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}
.brief-slide p b { font-family: inherit; font-size: inherit; color: var(--gold); }
.brief-arrow {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: rgba(10, 13, 18, .72);
    color: var(--sand);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .12s, color .12s, opacity .12s;
}
.brief-arrow:hover { border-color: var(--amber); color: var(--gold); }
.brief-arrow:disabled { opacity: .3; cursor: default; }
.brief-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}
.brief-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.brief-dot.active { background: var(--gold); transform: scale(1.3); }

.title-screen {
    place-items: stretch;
    background-image: linear-gradient(90deg, rgba(5, 7, 10, .92) 0%, rgba(5, 7, 10, .7) 42%, rgba(5, 7, 10, .12) 75%), linear-gradient(0deg, rgba(5, 7, 10, .85), transparent 45%), var(--title-bg, url("assets/branding/outpost-title-backdrop.webp"));
    background-size: cover;
    background-position: center
}

.title-layout {
    width: min(520px, 92%);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: clamp(6px, 4vw, 46px);
    animation: reveal .65s ease both
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--gold)
}

.eyebrow span {
    width: 26px;
    height: 1px;
    background: var(--amber)
}

.title {
    margin: 15px 0 0;
    font-family: Georgia, serif;
    font-size: clamp(40px, 7.4vmin, 70px);
    line-height: .84;
    letter-spacing: -2px;
    text-shadow: 0 6px 25px #000
}

.title-sub {
    display: block;
    margin-top: 12px;
    font-family: Inter, "Segoe UI", sans-serif;
    font-size: clamp(13px, 2.3vmin, 20px);
    letter-spacing: 8px;
    color: var(--amber)
}

.tagline {
    margin: 16px 0 24px;
    color: #c6bfaf;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: clamp(14px, 2.2vmin, 18px)
}

.title-actions {
    display: flex;
    gap: 10px;
    align-items: stretch
}

.primary-btn,
.secondary-btn {
    appearance: none;
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: .6px;
    transition: .15s ease
}

.primary-btn {
    color: #231708;
    background: linear-gradient(180deg, var(--gold), var(--amber));
    padding: 13px 24px;
    box-shadow: 0 5px 0 #8e5c1c, 0 12px 28px rgba(0, 0, 0, .35)
}

.primary-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px)
}

.primary-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #8e5c1c
}

.primary-large {
    min-width: 220px;
    display: flex;
    justify-content: space-between
}

.secondary-btn {
    padding: 10px 18px;
    color: var(--sand);
    background: rgba(15, 18, 22, .76);
    border: 1px solid #5b554a;
    display: flex;
    flex-direction: column;
    text-align: left
}

.secondary-btn span {
    font-size: 10px;
    color: var(--gold);
    margin-top: 3px
}

.briefing-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    margin-top: 20px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--sand);
    cursor: pointer;
    text-align: left
}

.briefing-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid #696255;
    border-radius: 50%;
    color: var(--gold)
}

.briefing-btn b,
.briefing-btn small {
    display: block
}

.briefing-btn small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px
}

.title-footer {
    position: absolute;
    left: clamp(18px, 5vw, 72px);
    right: clamp(18px, 4vw, 56px);
    bottom: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #8d887d
}

.live-dot:before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(113, 140, 74, .12)
}

.panel {
    width: min(620px, 96%);
    max-height: 94%;
    overflow-y: auto;
    overflow-x: hidden;   /* never a horizontal scrollbar (the frame overhangs 10px) */
    padding: clamp(20px, 4vmin, 36px);
    text-align: center;
    background: linear-gradient(165deg, rgba(40, 44, 50, .96), rgba(17, 21, 28, .98));
    border: 1px solid var(--line);
    box-shadow: var(--shadow)
}

.panel-kicker {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--amber)
}

.panel-title {
    margin: 7px 0 10px;
    font-family: Georgia, serif;
    font-size: clamp(25px, 4vmin, 36px)
}

.panel-copy {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px
}

.how-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    text-align: left;
    margin: 22px 0
}

.how-grid>div {
    position: relative;
    padding: 14px 14px 14px 46px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .06)
}

.how-grid>div>span {
    position: absolute;
    left: 14px;
    top: 15px;
    color: var(--amber);
    font-size: 11px;
    font-weight: 900
}

.how-grid b {
    font-size: 14px
}

.how-grid p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45
}

/* briefing: coin economy explainer */
.brief-coins {
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(240, 190, 90, 0.28);
    border-radius: 10px;
    background:
        linear-gradient(160deg, rgba(60, 46, 18, 0.35), rgba(18, 20, 26, 0.5))
}

.brief-coins-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 15px;
    color: var(--sand)
}

.brief-coin-mark {
    color: var(--amber);
    font-size: 18px
}

.brief-coins-lead,
.brief-coins-foot {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5
}

.brief-coin-list {
    margin: 10px 0;
    padding-left: 18px;
    display: grid;
    gap: 4px
}

.brief-coin-list li {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4
}

.brief-coin-list b {
    color: var(--amber)
}

.brief-coins-foot {
    margin-top: 8px;
    font-style: italic
}

.back-btn {
    margin-top: 7px
}

.link-btn {
    appearance: none;
    border: 0;
    background: none;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer
}

.link-btn:hover {
    color: var(--gold)
}

.link-btn.danger {
    font-size: 11px;
    color: #a46e63
}

.score-list {
    list-style: none;
    margin: 18px 0;
    padding: 0;
    text-align: left
}

.score-empty {
    padding: 30px;
    color: var(--muted);
    text-align: center
}

.score-row {
    display: grid;
    grid-template-columns: 32px 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, .035);
    border-left: 2px solid transparent
}

.score-row .rank {
    color: var(--muted);
    font-weight: 900
}

.score-row .who {
    font-weight: 800
}

.score-row .pts {
    color: var(--gold);
    font-weight: 900
}

.score-row .secs {
    min-width: 48px;
    text-align: right;
    color: var(--muted);
    font-size: 12px
}

.score-row.top1 {
    background: rgba(232, 161, 58, .12);
    border-color: var(--amber)
}

.score-actions {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    margin: 20px 0 10px
}

.result-grid>div {
    padding: 13px 8px;
    background: rgba(255, 255, 255, .035);
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column
}

.res-label {
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted)
}

.res-big {
    margin-top: 5px;
    font-size: 22px;
    font-weight: 900
}

.accent {
    color: var(--gold)
}

.rank-callout {
    padding: 10px;
    border: 1px solid rgba(232, 161, 58, .25);
    background: rgba(232, 161, 58, .07);
    color: var(--gold);
    font-size: 12px
}

.name-entry {
    margin-top: 18px
}

.name-entry label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px
}

.name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px
}

.name-row .skip-score-btn {
    margin-top: 0
}

.name-row input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    color: var(--sand);
    background: #0b0e13;
    border: 1px solid var(--line);
    outline: none
}

.name-row input:focus {
    border-color: var(--amber)
}

/* two-part name: [Company] - [Player] */
.name-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px
}

.name-fields input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    color: var(--sand);
    background: #0b0e13;
    border: 1px solid var(--line);
    outline: none
}

.name-fields input:focus {
    border-color: var(--amber)
}

.name-sep {
    color: var(--muted);
    font-weight: 700;
    flex: 0 0 auto
}

.save-status {
    margin: 10px 0 0;
    min-height: 16px;
    font-size: 12.5px;
    text-align: center
}

.save-status.ok {
    color: #8bd48b
}

.save-status.err {
    color: #f0a58c
}

.save-status.muted {
    color: var(--muted)
}

.over-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 18px
}

#hud {
    position: absolute;
    inset: 0;
    z-index: 5;
    padding: clamp(9px, 2vmin, 17px);
    pointer-events: none
}

/* corners-only HUD: wave top-left, time/score top-right, integrity bottom.
   the play field between stays clear so raiders are never hidden. */
.hud-tl {
    position: absolute;
    top: clamp(9px, 2vmin, 17px);
    left: clamp(9px, 2vmin, 17px);
    display: flex;
    flex-direction: column;
    gap: 2px
}

.hud-tr {
    position: absolute;
    top: clamp(9px, 2vmin, 17px);
    /* keep clear of the fixed fullscreen button (top-right, ~44px wide zone) */
    right: clamp(52px, 6vmin, 64px);
    display: flex;
    gap: 16px;
    align-items: flex-start
}

.hud-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px
}

/* Wall integrity is the one number that decides the run, so it sits bottom-LEFT
   at a size you can read from across a room without turning your eyes away from
   the wall. The volley moved to the right rail to make room. */
.hud-bottom {
    position: absolute;
    left: clamp(10px, 1.8vmin, 16px);
    bottom: clamp(8px, 1.6vmin, 14px);
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 12px 9px;
    background: rgba(10, 13, 18, .72);
    border: 1px solid #4a4436;
    border-radius: 9px;
    backdrop-filter: blur(3px)
}

.hud-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted)
}

.hud-bottom .hud-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--gold)
}

.bar {
    width: clamp(130px, 28vmin, 235px);
    height: 10px;
    background: #080a0d;
    border: 1px solid rgba(255, 255, 255, .12)
}

.hud-bottom .bar {
    width: clamp(190px, 30vmin, 320px);
    height: 20px;
    border-radius: 4px;
    box-shadow: inset 0 2px 7px rgba(0, 0, 0, .65)
}

.bar-fill {
    height: 100%;
    background: var(--amber);
    transition: width .18s, background .2s
}

.hud-bottom .bar-fill {
    border-radius: 3px;
    box-shadow: 0 0 14px rgba(232, 161, 58, .35)
}

.integrity-text {
    font-size: 10px;
    font-weight: 900;
    color: var(--sand)
}

.hud-bottom .integrity-text {
    position: absolute;
    right: 14px;
    bottom: 11px;
    font-size: 15px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .9)
}

.wave-tag {
    font-family: Georgia, serif;
    font-size: clamp(15px, 2.4vmin, 21px);
    font-weight: 900;
    text-shadow: 0 2px 6px #000
}

.wave-sub {
    min-height: 14px;
    color: var(--gold);
    font-size: 10px
}

.hud-big {
    font-size: clamp(15px, 2.6vmin, 21px);
    font-weight: 900;
    line-height: 1
}

.hud-score {
    color: var(--gold);
    font-size: clamp(16px, 2.6vmin, 22px);
    font-weight: 900;
    line-height: 1
}

.ghost-btn {
    position: absolute;
    right: 12px;
    bottom: 15px;
    z-index: 8;
    pointer-events: auto;
    display: grid;
    place-items: center;
    height: 34px;
    min-width: 34px;
    padding: 0 9px;
    border: 1px solid var(--line);
    background: rgba(10, 13, 18, .8);
    color: var(--sand);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    border-radius: 7px
}

.mute-btn {
    right: 52px;
    width: 34px;
    padding: 0;
    font-size: 15px
}

.combo-pill {
    position: absolute;
    left: 50%;
    top: 72px;
    transform: translateX(-50%);
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--gold);
    text-shadow: 0 2px 8px #000;
    animation: pop .18s ease
}

.combo-pill span {
    font-size: 28px;
    font-weight: 1000
}

.combo-pill small {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 8px
}

/* Volley now lives on the RIGHT, directly under the arsenal rail, so every
   thing you spend sits on one side and the wall gauge owns the other. */
.volley-wrap {
    position: absolute;
    right: clamp(6px, 1.4vmin, 14px);
    left: auto;
    bottom: 58px;
    z-index: 8
}

.volley-btn {
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 11px;
    overflow: hidden;
    border-radius: 7px;
    color: var(--sand);
    background: rgba(10, 13, 18, .88);
    border: 1px solid #575044;
    cursor: pointer
}

.volley-btn:disabled {
    cursor: not-allowed;
    opacity: .65
}

.volley-btn.ready {
    border-color: var(--gold);
    box-shadow: 0 0 22px rgba(232, 161, 58, .28);
    animation: pulse 1.1s infinite
}

.volley-key {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid #6c6457;
    font-weight: 900
}

.volley-copy {
    position: relative;
    z-index: 1;
    text-align: left
}

.volley-copy b,
.volley-copy small {
    display: block
}

/* compact in-game volley: hide the long label, keep the charge readout */
.volley-copy b {
    display: none
}

.volley-copy small {
    font-size: 9px;
    color: var(--gold)
}

.volley-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background: var(--amber);
    transition: width .2s
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateX(-18px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes pop {
    from {
        transform: translateX(-50%) scale(.7)
    }

    to {
        transform: translateX(-50%) scale(1)
    }
}

@keyframes pulse {
    50% {
        box-shadow: 0 0 35px rgba(232, 161, 58, .55)
    }
}

@media(max-width:650px) {
    #app {
        padding: 0
    }

    #stage {
        width: 100%;
        height: 100%;
        aspect-ratio: auto
    }

    .title-screen {
        background-position: 60% center
    }

    .title-layout {
        justify-content: flex-end;
        padding: 20px 20px 72px;
        background: linear-gradient(0deg, rgba(5, 7, 10, .96), rgba(5, 7, 10, .1) 75%)
    }

    .title-actions {
        flex-direction: column;
        width: 260px
    }

    .how-grid {
        grid-template-columns: 1fr
    }

    .result-grid {
        grid-template-columns: 1fr 1fr
    }

    .hud-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%)
    }

    .volley-wrap {
        bottom: 12px
    }

    .mute-btn {
        display: none
    }

    /* mute is hidden at this width, so settings takes its slot instead of
       leaving a gap that makes the gear look like it failed to render */
    .settings-btn {
        right: 54px !important
    }

    .bar {
        width: 115px
    }

    .hud-bottom .bar {
        width: clamp(150px, 42vw, 210px);
        height: 17px
    }

    .panel {
        max-height: 96%
    }
}

@media(max-height:560px) {
    .title {
        font-size: 42px
    }

    .tagline {
        margin: 10px 0 14px
    }

    .briefing-btn {
        margin-top: 14px
    }

    .title-footer {
        bottom: 10px
    }

    .panel {
        padding: 16px
    }

    .how-grid {
        margin: 10px 0
    }

    .how-grid>div {
        padding-top: 9px;
        padding-bottom: 9px
    }

    .result-grid {
        margin: 10px 0
    }
}

/* Illustrated character layer and cinematic screen staging. */
.title-layout {
    position: relative;
    z-index: 2
}

.warden-portrait {
    position: absolute;
    z-index: 1;
    right: clamp(8px, 2vw, 34px);
    bottom: -1%;
    width: min(43vw, 610px);
    height: 94%;
    pointer-events: none;
    background: url("assets/branding/warden-portrait.webp") right bottom / contain no-repeat;
    -webkit-mask-image: linear-gradient(100deg, transparent 0%, #000 28%);
    mask-image: linear-gradient(100deg, transparent 0%, #000 28%);
    filter: drop-shadow(-18px 16px 26px rgba(0, 0, 0, .6));
    opacity: .97;
    animation: wardenIn .9s cubic-bezier(.2, .8, .2, 1) both
}

@keyframes wardenIn {
    from {
        opacity: 0;
        transform: translateX(45px)
    }

    to {
        opacity: .97;
        transform: none
    }
}

@media(max-width:650px) {
    /* on phones the title text goes full-width; keep him as a faint side accent */
    .warden-portrait {
        right: -12%;
        height: 62%;
        opacity: .3
    }
}

.qr-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--sand);
    cursor: pointer;
    text-align: left
}

.qr-glyph {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid #696255;
    color: var(--gold);
    font-size: 20px
}

.qr-link b,
.qr-link small {
    display: block
}

.qr-link small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px
}

.qr-panel {
    width: min(430px, 94%)
}

.game-qr {
    width: 232px;
    height: 232px;
    margin: 18px auto;
    padding: 16px;
    display: grid;
    place-items: center;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .45)
}

.game-qr img,
.game-qr canvas {
    max-width: 100%;
    height: auto
}

/* versus defend-time picker */
.time-picker {
    display: flex;
    gap: 8px;
    margin: 6px 0 12px
}
.time-opt {
    flex: 1;
    padding: 9px 6px;
    border: 1px solid var(--line);
    background: rgba(10, 13, 18, .6);
    color: var(--sand);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    font-size: 13px
}
.time-opt.selected {
    border-color: var(--amber);
    background: rgba(40, 32, 16, .9);
    color: var(--gold)
}

.qr-url {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 9px;
    background: #0b0e13;
    color: var(--gold);
    font-size: 10px
}


/* ---------------- Multiplayer lobby ---------------- */

.multiplayer-panel {
    width: min(520px, 96%);
}

.room-form {
    width: min(360px, 100%);
    margin: 20px auto 0;
    text-align: left;
}

.field-label {
    display: block;
    margin: 14px 0 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.room-input {
    width: 100%;
    padding: 13px 14px;
    color: var(--sand);
    background: #0b0e13;
    border: 1px solid var(--line);
    border-radius: 2px;
    outline: none;
}

.room-input:focus {
    border-color: var(--amber);
}

.room-select {
    appearance: none;
    cursor: pointer;
}

.room-create-btn {
    width: 100%;
    margin-top: 18px;
}

.room-code-wrap {
    margin-top: 14px;
}

.room-code-label {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 2px;
}

.room-code {
    display: block;
    color: var(--gold);
    font-family: Consolas, monospace;
    font-size: clamp(30px, 6vmin, 48px);
    letter-spacing: 8px;
}

.player-lobby {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: 18px 0;
}

.player-card {
    min-height: 98px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.035);
}

.player-card.connected {
    border-color: rgba(113, 140, 74, 0.7);
}

.player-card.waiting {
    opacity: 0.72;
    border-style: dashed;
}

.player-card strong {
    margin-top: 5px;
    color: var(--sand);
}

.player-card small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.player-slot {
    color: var(--amber);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.room-message {
    margin: 12px 0;
    padding: 10px;
    color: var(--gold);
    background: rgba(232, 161, 58, 0.07);
    border: 1px solid rgba(232, 161, 58, 0.22);
    font-size: 12px;
}

.room-message.error {
    color: #e28a78;
    background: rgba(197, 84, 63, 0.08);
    border-color: rgba(197, 84, 63, 0.35);
}

.room-start-btn {
    width: 100%;
}

.room-start-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    filter: grayscale(0.5);
}

.room-cancel-btn {
    display: block;
    margin: 15px auto 0;
}

.room-back-btn {
    margin: 18px auto 0;
}

@media (max-width: 520px) {
    .player-lobby {
        grid-template-columns: 1fr;
    }

    .room-code {
        font-size: 34px;
    }
}


/* Multiplayer mode selection */

.mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.mode-option {
  padding: 14px 12px;
  text-align: left;
  color: var(--sand);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.mode-option:hover {
  transform: translateY(-1px);
  border-color: #6b6254;
}

.mode-option.selected {
  background: rgba(232, 161, 58, 0.1);
  border-color: var(--amber);
}

.mode-option b,
.mode-option small {
  display: block;
}

.mode-option b {
  color: var(--sand);
  font-size: 13px;
}

.mode-option small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .mode-picker {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   MODERN TITLE SCREEN
   ========================================================= */

.title-screen {
  padding: 0;

  place-items: stretch;

  background-image:
    linear-gradient(
      90deg,
      rgba(3, 5, 8, .97) 0%,
      rgba(4, 6, 9, .91) 31%,
      rgba(5, 7, 10, .46) 59%,
      rgba(5, 7, 10, .1) 80%
    ),
    linear-gradient(
      0deg,
      rgba(3, 5, 8, .92),
      transparent 48%
    ),
    var(--title-bg, url("assets/branding/outpost-title-backdrop.webp"));

  background-size: cover;
  background-position: center;
}

.title-vignette {
  position: absolute;
  inset: 0;

  pointer-events: none;

  background:
    radial-gradient(
      circle at 70% 42%,
      transparent 0,
      rgba(0, 0, 0, .12) 43%,
      rgba(0, 0, 0, .68) 100%
    );
}

.event-brandbar {
  position: absolute;

  z-index: 4;

  top: 20px;
  left: 28px;
  right: 28px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  pointer-events: none;
}

.event-brand {
  height: 34px;

  display: flex;
  align-items: center;
}

.event-brand img {
  display: block;

  max-height: 100%;
  max-width: 115px;

  object-fit: contain;
}

.event-brand-right {
  padding: 6px 10px;

  background: rgba(255, 255, 255, .92);

  border-radius: 5px;
}

.event-build-label {
  color: rgba(233, 223, 203, .55);

  font-size: 9px;
  font-weight: 900;

  letter-spacing: 2.4px;
}

.modern-title-layout {
  z-index: 3;

  width: min(620px, 52vw);
  height: 100%;

  justify-content: center;

  padding:
    clamp(68px, 10vh, 110px)
    0
    clamp(48px, 7vh, 80px)
    clamp(34px, 6vw, 94px);
}

.hero-status {
  width: max-content;

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 7px 10px;

  border:
    1px solid
    rgba(245, 195, 107, .22);

  background:
    rgba(14, 18, 24, .62);

  color: #c9b986;

  font-size: 8px;
  font-weight: 900;

  letter-spacing: 1.8px;
}

.status-light {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: #82a85b;

  box-shadow:
    0 0 0 4px rgba(113, 140, 74, .12),
    0 0 12px rgba(113, 140, 74, .8);
}

.hero-kicker {
  margin-top: 20px;

  color: var(--amber);

  font-size: 9px;
  font-weight: 900;

  letter-spacing: 4px;
}

.modern-title {
  margin-top: 8px;

  font-size:
    clamp(48px, 6vw, 86px);

  letter-spacing: -4px;
}

.modern-title .title-sub {
  margin-top: 11px;

  font-size:
    clamp(13px, 1.45vw, 21px);

  letter-spacing:
    clamp(7px, 1vw, 12px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;

  margin:
    -8px 0
    20px;
}

.hero-meta span {
  padding: 5px 8px;

  background:
    rgba(255, 255, 255, .04);

  border:
    1px solid
    rgba(255, 255, 255, .065);

  color: #9f9a8d;

  font-size: 9px;
  font-weight: 700;
}

.modern-actions {
  display: grid;

  grid-template-columns:
    minmax(210px, 1.3fr)
    minmax(170px, .9fr);

  gap: 8px;

  max-width: 540px;
}

.hero-play {
  min-height: 64px;

  padding: 11px 18px;

  align-items: center;
}

.hero-play-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  line-height: 1.15;
}

.hero-play-copy small {
  margin-bottom: 4px;

  color:
    rgba(35, 23, 8, .6);

  font-size: 7px;

  letter-spacing: 1.5px;
}

.hero-arrow {
  font-size: 24px;
}

.menu-action-card {
  min-height: 64px;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 9px 13px;

  cursor: pointer;

  color: var(--sand);

  background:
    linear-gradient(
      145deg,
      rgba(31, 38, 47, .94),
      rgba(12, 15, 20, .95)
    );

  border:
    1px solid
    rgba(245, 195, 107, .25);

  transition:
    transform .16s ease,
    border-color .16s ease,
    background .16s ease;
}

.menu-action-card:hover {
  transform: translateY(-2px);

  border-color:
    rgba(245, 195, 107, .7);

  background:
    linear-gradient(
      145deg,
      rgba(51, 41, 25, .96),
      rgba(12, 15, 20, .96)
    );
}

.menu-action-icon {
  display: grid;
  place-items: center;

  width: 37px;
  height: 37px;

  flex: none;

  color: var(--gold);

  border:
    1px solid
    rgba(245, 195, 107, .35);
}

.menu-action-copy {
  display: flex;
  flex-direction: column;

  text-align: left;
}

.menu-action-copy small {
  color: var(--amber);

  font-size: 7px;
  font-weight: 900;

  letter-spacing: 1.5px;
}

.menu-action-copy strong {
  margin-top: 2px;

  font-size: 12px;
}

.menu-action-copy em {
  margin-top: 2px;

  color: var(--muted);

  font-size: 8px;

  font-style: normal;
}

.secondary-actions {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 6px;

  max-width: 540px;

  margin-top: 7px;
}

/* quick-access "Play with your Phone" (direct solo-phone QR) */
.phone-solo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.phone-solo-btn span { font-size: 1.1em; }

.secondary-tile {
  min-height: 49px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  gap: 1px;

  color: #cfc6b5;

  cursor: pointer;

  border:
    1px solid
    rgba(255, 255, 255, .07);

  background:
    rgba(9, 12, 17, .66);

  font-size: 9px;
  font-weight: 800;

  transition: .15s ease;
}

.secondary-tile > span {
  color: var(--amber);

  font-size: 13px;
}

.secondary-tile small {
  color: var(--muted);

  font-size: 7px;
}

.secondary-tile:hover {
  color: #fff;

  border-color:
    rgba(232, 161, 58, .48);

  background:
    rgba(232, 161, 58, .07);
}

.hero-tip {
  display: flex;
  align-items: center;
  gap: 8px;

  max-width: 540px;

  margin-top: 12px;

  color: rgba(202, 194, 179, .67);

  font-size: 8px;
}

.hero-tip-key {
  padding: 3px 5px;

  color: var(--gold);

  border:
    1px solid
    rgba(245, 195, 107, .22);

  font-weight: 900;
}

.modern-footer {
  z-index: 4;
}

@media (max-width: 850px) and (orientation: landscape) {
  .event-brandbar {
    top: 9px;
    left: 14px;
    right: 14px;
  }

  .event-brand {
    height: 24px;
  }

  .modern-title-layout {
    width: min(570px, 65vw);

    padding:
      48px 0
      36px
      24px;
  }

  .modern-title {
    font-size: 47px;
  }

  .tagline {
    margin: 10px 0 13px;
  }

  .hero-meta {
    margin-bottom: 11px;
  }

  .hero-tip {
    display: none;
  }
}


.map-picker-grid {
  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap: 6px;

  width: min(540px, 100%);

  margin-top: 9px;
}

.map-card {
  position: relative;

  min-width: 0;
  height: 74px;

  padding: 0;

  overflow: hidden;

  cursor: pointer;

  border:
    1px solid
    rgba(255,255,255,.1);

  background: #11151b;

  transition:
    transform .15s ease,
    border-color .15s ease;
}

.map-card img {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;

  opacity: .55;

  transition:
    opacity .15s ease,
    transform .2s ease;
}

.map-card-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;

  padding: 8px;

  text-align: left;

  background:
    linear-gradient(
      transparent,
      rgba(3,5,8,.94)
    );
}

.map-card strong {
  color: #eee4d0;

  font-size: 9px;
}

.map-card small {
  margin-top: 2px;

  overflow: hidden;

  color: #999387;

  font-size: 7px;

  text-overflow: ellipsis;

  white-space: nowrap;
}

.map-card:hover,
.map-card.selected {
  border-color:
    var(--amber);
}

.map-card:hover img,
.map-card.selected img {
  opacity: .86;

  transform: scale(1.04);
}

.map-card.selected::before {
  content: "";

  position: absolute;

  z-index: 3;

  top: 6px;
  right: 6px;

  width: 7px;
  height: 7px;

  border-radius: 50%;

  background:
    var(--gold);

  box-shadow:
    0 0 10px
    var(--amber);
}

@media (max-height: 600px) {
  .map-picker-grid {
    margin-top: 6px;
  }

  .map-card {
    height: 58px;
  }

  .map-card small {
    display: none;
  }
}


/* =========================================================
   GLOBAL RESPONSIVE SCREEN PANELS
   ========================================================= */

.screen {
  padding:
    clamp(8px, 2.4vmin, 26px);

  overflow: hidden;
}

.panel {
  position: relative;

  width:
    min(680px, 96vw);

  max-height:
    min(760px, 94dvh);

  overflow-y: auto;

  overscroll-behavior: contain;

  padding:
    clamp(18px, 3vmin, 34px);

  border:
    1px solid
    rgba(255,255,255,.10);

  border-radius: 7px;

  background:
    linear-gradient(
      155deg,
      rgba(34,39,47,.98),
      rgba(10,13,18,.995)
    );

  box-shadow:
    0 30px 100px
    rgba(0,0,0,.72);
}

.modal-close {
  position: absolute;

  z-index: 5;

  top: 12px;
  right: 12px;

  width: 32px;
  height: 32px;

  display: grid;
  place-items: center;

  cursor: pointer;

  color: #aaa397;

  border:
    1px solid
    rgba(255,255,255,.11);

  border-radius: 6px;

  background:
    rgba(5,8,12,.7);

  transition: .15s;
}

.modal-close:hover {
  color: #fff;

  border-color:
    rgba(197,84,63,.75);

  background:
    rgba(197,84,63,.12);
}

@media (max-width: 600px) {
  .screen {
    padding: 0;
  }

  .screen:not(.title-screen)
  .panel {
    width: 100vw;
    height: 100dvh;

    max-width: none;
    max-height: none;

    border: 0;
    border-radius: 0;

    padding:
      52px 16px 16px;
  }
}

@media (
  max-height: 500px
)
and
(
  orientation: landscape
) {
  .screen {
    padding: 5px;
  }

  .screen:not(.title-screen)
  .panel {
    width:
      min(860px,98vw);

    max-height:
      calc(100dvh - 10px);

    padding:
      36px 16px 12px;
  }

  .panel-title {
    font-size: 24px;

    margin: 3px 0 6px;
  }

  .panel-copy {
    margin-bottom: 9px;
  }
}

.optional-label {
  margin-left: 5px;
  color: var(--amber);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.skip-score-btn {
  margin-top: 10px;
  font-size: 10px;
}

.score-row {
  min-height: 48px;

  border:
    1px solid
    rgba(255,255,255,.045);

  border-left:
    2px solid transparent;

  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,.04),
      rgba(255,255,255,.015)
    );
}

.score-row.top1 {
  border-left-color:
    #f4c15d;

  background:
    linear-gradient(
      90deg,
      rgba(244,193,93,.14),
      rgba(255,255,255,.015)
    );
}

.score-row.top2 {
  border-left-color:
    #aab0b8;
}

.score-row.top3 {
  border-left-color:
    #b77a49;
}

.score-row .rank {
  color: var(--gold);

  text-align: center;
}

/* --- Event repair: keep title/map UI and in-game bottom dock separated --- */
.modern-title-layout{
  overflow:visible;
}
#map-picker{
  flex:0 0 auto;
}
@media (max-height:650px) and (orientation:landscape){
  .modern-title-layout{
    justify-content:center;
    padding-top:44px;
    padding-bottom:44px;
  }
  .hero-tip{display:none}
}
@media (max-height:540px) and (orientation:landscape){
  .volley-wrap{bottom:50px;right:10px;left:auto}
  #pause-btn{right:10px;bottom:9px}
  .mute-btn{right:50px;bottom:9px}
  .settings-btn{right:90px;bottom:9px}
  .hud-bottom{padding:6px 10px 7px}
  .hud-bottom .bar{width:clamp(150px,26vmin,240px);height:16px}
  .hud-bottom .integrity-text{font-size:13px;bottom:9px;right:12px}
}

/* Main-screen game emblem */
.game-emblem-wrap{
  width:min(450px,72vw);
  margin:10px 0 8px;
}
.game-emblem{
  display:block;
  width:100%;
  height:auto;
  object-fit:contain;
  filter:drop-shadow(0 10px 28px rgba(0,0,0,.62));
}
@media(max-height:650px) and (orientation:landscape){
  .game-emblem-wrap{width:min(330px,39vw);margin:4px 0 2px}
}
@media(max-width:650px){
  .game-emblem-wrap{width:min(320px,82vw)}
  .warden-portrait{
    right:-2%;
    width:46vw;
    height:60%;
    opacity:.30;
  }
}


/* =========================================================
   HOTFIX: compact title composition — emblem must not push actions off-screen
   ========================================================= */
.modern-title-layout{
  box-sizing:border-box;
  justify-content:center;
  max-height:100dvh;
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-width:none;
  padding-top:clamp(54px,7vh,76px);
  padding-bottom:clamp(28px,4vh,46px);
}
.modern-title-layout::-webkit-scrollbar{display:none}
.hero-kicker{margin-top:8px}
.game-emblem-wrap{
  width:min(420px,46vw);
  height:150px;
  margin:6px 0 6px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex:0 0 auto;
}
.game-emblem{
  width:auto;
  max-width:100%;
  height:100%;
  max-height:150px;
  object-fit:contain;
  object-position:left center;
}
.tagline{margin:4px 0 8px}
.hero-meta{margin:0 0 9px}
.modern-actions{gap:6px}
.hero-play,.menu-action-card{min-height:54px}
.secondary-actions{margin-top:5px}
.secondary-tile{min-height:42px}
.hero-tip{margin-top:6px}
.map-picker-grid{margin-top:6px}
.map-card{height:58px}

@media(max-height:720px) and (orientation:landscape){
  .modern-title-layout{padding-top:48px;padding-bottom:24px}
  .hero-status{padding:5px 8px}
  .hero-kicker{display:none}
  .game-emblem-wrap{width:min(340px,40vw);height:112px;margin:3px 0}
  .game-emblem{max-height:112px}
  .tagline{font-size:12px;margin:2px 0 6px}
  .hero-meta span{padding:3px 6px;font-size:8px}
  .hero-play,.menu-action-card{min-height:48px}
  .secondary-tile{min-height:38px}
  .map-card{height:48px}
  .hero-tip{display:none}
}

@media(max-height:560px) and (orientation:landscape){
  .modern-title-layout{padding-top:42px;padding-bottom:14px;width:min(610px,56vw)}
  .hero-status{font-size:7px;padding:4px 7px}
  .game-emblem-wrap{width:min(270px,32vw);height:84px;margin:1px 0}
  .game-emblem{max-height:84px}
  .tagline{display:none}
  .hero-meta{margin:1px 0 5px}
  .hero-meta span{font-size:7px;padding:2px 5px}
  .modern-actions{grid-template-columns:minmax(180px,1.2fr) minmax(150px,.8fr)}
  .hero-play,.menu-action-card{min-height:42px;padding-top:6px;padding-bottom:6px}
  .secondary-actions{margin-top:4px}
  .secondary-tile{min-height:34px;font-size:8px}
  .secondary-tile>span{font-size:11px}
  .map-picker-grid{margin-top:4px}
  .map-card{height:40px}
  .map-card small{display:none}
}


/* ==========================================================================
   FINAL ASSET-INTEGRATED GAME UI OVERRIDES
   ========================================================================== */

:root {
  --game-glass: rgba(8, 10, 14, .82);
  --game-edge: rgba(206, 155, 86, .34);
  --game-edge-soft: rgba(255, 255, 255, .08);
}

/* Keep title content inside the visible 16:9 viewport. */
.title-screen {
  overflow: hidden;
}

.modern-title-layout {
  width: min(600px, 56vw);
  max-height: calc(100dvh - 92px);
  padding: clamp(76px, 9vh, 102px) 0 clamp(50px, 6vh, 68px) clamp(24px, 4vw, 68px);
  justify-content: center;
  gap: clamp(5px, .9vh, 10px);
}

.game-emblem-wrap {
  margin: 0;
  width: min(520px, 100%);
}

.game-emblem {
  display: block;
  width: min(500px, 100%);
  max-height: 126px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.65));
}

.hero-kicker {
  margin: 0;
}

.tagline {
  margin: 2px 0 6px;
}

.hero-meta {
  margin: 0 0 4px;
}

.modern-actions {
  margin-top: 2px;
}

.secondary-actions {
  margin-top: 2px;
}

.hero-tip {
  margin-top: 2px;
}

/* The portrait is scenery, never layout. */
.warden-portrait {
  width: min(43vw, 600px);
  right: max(-18px, 1vw);
  bottom: -4%;
  height: 95%;
  background-image: url("assets/branding/warden-portrait.webp");
}

/* Modern HUD: readable without large opaque boxes over the battlefield. */
#hud {
  padding: 12px 16px;
}

.hud-top {
  align-items: flex-start;
}

.hud-block {
  min-width: 150px;
  padding: 8px 11px;
  border: 1px solid var(--game-edge-soft);
  background:
    linear-gradient(180deg, rgba(18,20,24,.87), rgba(7,9,12,.71));
  box-shadow: 0 8px 20px rgba(0,0,0,.28);
  backdrop-filter: blur(5px);
}

.hud-center {
  min-width: 150px;
  border-color: var(--game-edge);
}

.bar {
  height: 8px;
  border-radius: 1px;
  overflow: hidden;
}

.bar-fill {
  box-shadow: 0 0 12px currentColor;
}

.volley-btn {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--game-edge);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  background:
    linear-gradient(180deg, rgba(31,28,23,.92), rgba(9,11,15,.94));
}

.combo-pill {
  top: 76px;
  padding: 5px 12px;
  border: 1px solid rgba(232,161,58,.23);
  background: rgba(8,10,13,.66);
  backdrop-filter: blur(4px);
}

/* Modal X: all major modal panels can opt into .modal-close cleanly. */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  z-index: 20;
  cursor: pointer;
}

/* Leaderboard medals should have enough canvas to show their supplied art. */
.score-row .rank {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

/* Full-screen panels feel like a game menu rather than generic web modals. */
.screen:not(.title-screen) {
  background:
    radial-gradient(circle at 50% 42%, rgba(29, 30, 31, .28), rgba(3,4,6,.86)),
    url("assets/branding/outpost-title-backdrop.webp") center / cover no-repeat;
}

.panel {
  overflow: visible;
}

.panel > .panel-copy,
.panel .how-grid,
.panel .score-list,
.panel .result-grid,
.panel .name-entry,
.panel .over-actions {
  position: relative;
}

/* Multiplayer form layout */
.multiplayer-panel {
  width: min(760px, 94vw);
}

#room-setup .room-form {
  width: min(560px, 100%);
}

#room-lobby {
  max-height: min(650px, 78dvh);
  overflow-y: auto;
  padding: 0 7px 5px;
}

/* Game-over presentation */
.over-panel {
  width: min(670px, 94vw);
}

.result-grid > div {
  min-height: 84px;
  justify-content: center;
}

/* Short screens */
@media (max-height: 720px) and (orientation: landscape) {
  .modern-title-layout {
    padding-top: 64px;
    padding-bottom: 42px;
    gap: 3px;
  }

  .game-emblem {
    max-height: 92px;
  }

  .tagline {
    margin: 0 0 3px;
    font-size: 13px;
  }

  .hero-meta {
    transform: scale(.92);
    transform-origin: left center;
  }

  .hero-tip {
    display: none;
  }
}


/* ==========================================================================
   FINAL CLEAN LAYOUT LAYER
   styles.css owns structure, typography, spacing and interactions.
   Decorative PNG/WEBP skins belong in styles.ui-assets.css.
   ========================================================================== */

:root {
  --game-glass: rgba(8, 10, 14, .82);
  --game-edge: rgba(206, 155, 86, .34);
  --game-edge-soft: rgba(255, 255, 255, .08);
}

/* --------------------------------------------------------------------------
   TITLE SCREEN
   -------------------------------------------------------------------------- */

.title-screen {
  padding: 0;
  place-items: stretch;
  overflow: hidden;

  background-image:
    linear-gradient(
      90deg,
      rgba(3, 5, 8, .97) 0%,
      rgba(4, 6, 9, .90) 31%,
      rgba(5, 7, 10, .45) 59%,
      rgba(5, 7, 10, .10) 80%
    ),
    linear-gradient(
      0deg,
      rgba(3, 5, 8, .92),
      transparent 48%
    ),
    var(--title-bg, url("assets/branding/outpost-title-backdrop.webp"));

  background-size: cover;
  background-position: center;
}

.title-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 70% 42%,
      transparent 0,
      rgba(0, 0, 0, .12) 43%,
      rgba(0, 0, 0, .68) 100%
    );
}

.event-brandbar {
  position: absolute;
  z-index: 8;
  top: 16px;
  left: 24px;
  right: 24px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  pointer-events: none;
}

.event-brand {
  height: 30px;
  display: flex;
  align-items: center;
}

.event-brand img {
  display: block;
  max-height: 100%;
  max-width: 120px;
  object-fit: contain;
}

.event-brand-right {
  padding: 4px 8px;
  background: rgba(255, 255, 255, .92);
  border-radius: 4px;
}

.event-build-label {
  color: rgba(233, 223, 203, .55);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2.4px;
}

.modern-title-layout {
  position: relative;
  z-index: 5;

  width: min(600px, 56vw);
  height: 100%;
  max-height: 100dvh;

  display: flex;
  flex-direction: column;
  justify-content: center;

  overflow: hidden;

  padding:
    clamp(64px, 8vh, 88px)
    0
    clamp(34px, 5vh, 54px)
    clamp(26px, 4.2vw, 70px);

  gap: clamp(4px, .7vh, 8px);
}

.hero-kicker {
  margin: 0;
  color: var(--amber);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 4px;
}

.game-emblem-wrap {
  width: min(440px, 92%);
  height: clamp(76px, 12vh, 118px);

  display: flex;
  align-items: center;
  justify-content: flex-start;

  margin: 0;
  flex: 0 0 auto;
}

.game-emblem {
  display: block;

  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 118px;

  object-fit: contain;
  object-position: left center;

  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .65));
}

.tagline {
  margin: 0 0 6px;
  color: #c6bfaf;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(13px, 1.6vw, 18px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
}

.hero-meta span {
  padding: 4px 7px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .065);
  color: #9f9a8d;
  font-size: 8px;
  font-weight: 700;
}

.modern-actions {
  display: grid;
  grid-template-columns:
    minmax(210px, 1.25fr)
    minmax(175px, .9fr);

  width: min(540px, 100%);
  gap: 7px;
  margin: 0;
}

.hero-play {
  min-height: 56px;
  padding: 9px 18px;
  align-items: center;
}

.hero-play-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.12;
}

.hero-play-copy small {
  margin-bottom: 3px;
  color: rgba(244, 223, 178, .72);
  font-size: 7px;
  letter-spacing: 1.5px;
}

.hero-arrow {
  font-size: 23px;
}

.menu-action-card {
  min-height: 56px;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 8px 12px;
  cursor: pointer;

  color: var(--sand);
  background:
    linear-gradient(
      145deg,
      rgba(31, 38, 47, .94),
      rgba(12, 15, 20, .95)
    );

  border: 1px solid rgba(245, 195, 107, .25);

  transition:
    transform .16s ease,
    border-color .16s ease,
    background .16s ease;
}

.menu-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 195, 107, .7);
}

.menu-action-icon {
  display: grid;
  place-items: center;

  width: 35px;
  height: 35px;

  flex: none;

  color: var(--gold);
  border: 1px solid rgba(245, 195, 107, .35);
}

.menu-action-copy {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.menu-action-copy small {
  color: var(--amber);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.menu-action-copy strong {
  margin-top: 1px;
  font-size: 12px;
}

.menu-action-copy em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.secondary-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  width: min(540px, 100%);
  gap: 6px;
  margin: 0;
}

.secondary-tile {
  min-height: 44px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  gap: 1px;

  color: #cfc6b5;
  cursor: pointer;

  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(9, 12, 17, .66);

  font-size: 9px;
  font-weight: 800;

  transition:
    color .15s ease,
    transform .15s ease,
    border-color .15s ease,
    background .15s ease;
}

.secondary-tile > span {
  color: var(--amber);
  font-size: 13px;
}

.secondary-tile small {
  color: var(--muted);
  font-size: 7px;
}

.secondary-tile:hover {
  color: #fff;
  transform: translateY(-1px);
  border-color: rgba(232, 161, 58, .48);
  background: rgba(232, 161, 58, .07);
}

.hero-tip {
  display: flex;
  align-items: center;
  gap: 8px;

  width: min(540px, 100%);
  margin: 0;

  color: rgba(202, 194, 179, .67);
  font-size: 8px;
}

.hero-tip-key {
  padding: 3px 5px;

  color: var(--gold);
  border: 1px solid rgba(245, 195, 107, .22);

  font-weight: 900;
}

.warden-portrait {
  position: absolute;
  z-index: 2;

  right: max(-16px, 1vw);
  bottom: -3%;

  width: min(43vw, 590px);
  height: 94%;

  pointer-events: none;

  background:
    url("assets/branding/warden-portrait.webp")
    right bottom / contain no-repeat;

  -webkit-mask-image:
    linear-gradient(
      100deg,
      transparent 0%,
      rgba(0,0,0,.30) 12%,
      #000 30%
    );

  mask-image:
    linear-gradient(
      100deg,
      transparent 0%,
      rgba(0,0,0,.30) 12%,
      #000 30%
    );

  filter:
    drop-shadow(-18px 16px 26px rgba(0, 0, 0, .62));

  opacity: .97;
}

/* --------------------------------------------------------------------------
   MAP PICKER
   -------------------------------------------------------------------------- */

.map-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  width: min(540px, 100%);
  gap: 6px;
  margin: 0;
}

.map-card {
  position: relative;

  min-width: 0;
  height: 58px;

  padding: 0;
  overflow: hidden;

  cursor: pointer;

  border: 1px solid rgba(255, 255, 255, .10);
  background: #11151b;

  transition:
    transform .15s ease,
    border-color .15s ease;
}

.map-card img {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  opacity: .58;

  transition:
    opacity .15s ease,
    transform .2s ease;
}

.map-card-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;

  padding: 7px;

  text-align: left;

  background:
    linear-gradient(
      transparent,
      rgba(3, 5, 8, .94)
    );
}

.map-card strong {
  color: #eee4d0;
  font-size: 9px;
}

.map-card small {
  margin-top: 2px;

  overflow: hidden;

  color: #999387;
  font-size: 7px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-card:hover,
.map-card.selected {
  border-color: var(--amber);
}

.map-card:hover img,
.map-card.selected img {
  opacity: .88;
  transform: scale(1.04);
}

.map-card.selected::before {
  content: "";

  position: absolute;
  z-index: 3;

  top: 6px;
  right: 6px;

  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--amber);
}

/* --------------------------------------------------------------------------
   MODALS / PANELS
   -------------------------------------------------------------------------- */

.screen {
  padding: clamp(8px, 2.4vmin, 26px);
  overflow: hidden;
}

.screen:not(.title-screen) {
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(29, 30, 31, .28),
      rgba(3, 4, 6, .86)
    ),
    url("assets/branding/outpost-title-backdrop.webp")
    center / cover no-repeat;
}

.panel {
  position: relative;

  width: min(680px, 96vw);
  max-height: min(760px, 94dvh);

  overflow-y: auto;
  overflow-x: hidden;   /* no horizontal scrollbar (authoritative — beats the earlier `overflow:visible`) */
  overscroll-behavior: contain;

  padding: clamp(18px, 3vmin, 34px);

  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 7px;

  background:
    linear-gradient(
      155deg,
      rgba(34, 39, 47, .98),
      rgba(10, 13, 18, .995)
    );

  box-shadow:
    0 30px 100px rgba(0, 0, 0, .72);
}

.multiplayer-panel {
  width: min(760px, 94vw);
}

#room-setup .room-form {
  width: min(560px, 100%);
}

#room-lobby {
  max-height: min(650px, 78dvh);
  overflow-y: auto;
  padding: 0 7px 5px;
}

.over-panel {
  width: min(670px, 94vw);
}

.result-grid > div {
  min-height: 84px;
  justify-content: center;
}

.modal-close {
  position: absolute;

  z-index: 20;

  top: 12px;
  right: 12px;

  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  cursor: pointer;

  color: #aaa397;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 6px;
  background: rgba(5, 8, 12, .72);

  transition:
    color .15s ease,
    border-color .15s ease,
    background .15s ease;
}

.modal-close:hover {
  color: #fff;
  border-color: rgba(197, 84, 63, .75);
  background: rgba(197, 84, 63, .12);
}

/* --------------------------------------------------------------------------
   HUD
   -------------------------------------------------------------------------- */

#hud {
  padding: 12px 16px;
}

.hud-top {
  align-items: flex-start;
}

.hud-block {
  min-width: 150px;

  padding: 8px 11px;

  border: 1px solid var(--game-edge-soft);

  background:
    linear-gradient(
      180deg,
      rgba(18, 20, 24, .87),
      rgba(7, 9, 12, .71)
    );

  box-shadow:
    0 8px 20px rgba(0, 0, 0, .28);

  backdrop-filter: blur(5px);
}

.hud-center {
  min-width: 150px;
  border-color: var(--game-edge);
}

.bar {
  height: 8px;
  border-radius: 1px;
  overflow: hidden;
}

.bar-fill {
  box-shadow: 0 0 12px currentColor;
}

.combo-pill {
  top: 76px;

  padding: 5px 12px;

  border: 1px solid rgba(232, 161, 58, .23);

  background:
    rgba(8, 10, 13, .66);

  backdrop-filter: blur(4px);
}

.volley-btn {
  min-width: 0;
  min-height: 48px;

  border: 1px solid var(--game-edge);

  clip-path:
    polygon(
      8px 0,
      calc(100% - 8px) 0,
      100% 8px,
      100% calc(100% - 8px),
      calc(100% - 8px) 100%,
      8px 100%,
      0 calc(100% - 8px),
      0 8px
    );

  background:
    linear-gradient(
      180deg,
      rgba(31, 28, 23, .92),
      rgba(9, 11, 15, .94)
    );
}

/* --------------------------------------------------------------------------
   SCORE LIST
   -------------------------------------------------------------------------- */

.score-row {
  min-height: 48px;

  border: 1px solid rgba(255, 255, 255, .045);
  border-left: 2px solid transparent;

  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, .04),
      rgba(255, 255, 255, .015)
    );
}

.score-row.top1 {
  border-left-color: #f4c15d;
  background:
    linear-gradient(
      90deg,
      rgba(244, 193, 93, .14),
      rgba(255, 255, 255, .015)
    );
}

.score-row.top2 {
  border-left-color: #aab0b8;
}

.score-row.top3 {
  border-left-color: #b77a49;
}

.score-row .rank {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  color: var(--gold);
  text-align: center;

  background-size: contain !important;
  background-repeat: no-repeat !important;
}

/* --------------------------------------------------------------------------
   OPTIONAL SCORE LABEL
   -------------------------------------------------------------------------- */

.optional-label {
  margin-left: 5px;

  color: var(--amber);

  font-size: 8px;
  font-weight: 900;

  letter-spacing: 1px;
  text-transform: uppercase;
}

.skip-score-btn {
  margin-top: 10px;
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   LANDSCAPE HEIGHT TIGHTENING
   -------------------------------------------------------------------------- */

@media (max-height: 720px) and (orientation: landscape) {
  .modern-title-layout {
    width: min(590px, 57vw);
    padding-top: 48px;
    padding-bottom: 24px;
    gap: 3px;
  }

  .hero-kicker {
    display: none;
  }

  .game-emblem-wrap {
    width: min(335px, 39vw);
    height: 92px;
  }

  .game-emblem {
    max-height: 92px;
  }

  .tagline {
    margin: 0 0 4px;
    font-size: 12px;
  }

  .hero-meta {
    margin-bottom: 4px;
  }

  .hero-meta span {
    padding: 3px 6px;
    font-size: 7px;
  }

  .hero-play,
  .menu-action-card {
    min-height: 46px;
  }

  .secondary-tile {
    min-height: 36px;
    font-size: 8px;
  }

  .map-card {
    height: 43px;
  }

  .map-card small,
  .hero-tip {
    display: none;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .modern-title-layout {
    width: min(610px, 58vw);
    padding-top: 38px;
    padding-bottom: 12px;
  }

  .game-emblem-wrap {
    width: min(265px, 31vw);
    height: 70px;
  }

  .game-emblem {
    max-height: 70px;
  }

  .tagline {
    display: none;
  }

  .modern-actions {
    grid-template-columns:
      minmax(180px, 1.2fr)
      minmax(150px, .8fr);
  }

  .hero-play,
  .menu-action-card {
    min-height: 39px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .secondary-tile {
    min-height: 31px;
  }

  .map-card {
    height: 34px;
  }
}

.remote-watch {
  width: 100%;
  flex: none;

  background:
    rgba(7, 9, 12, .88);

  border:
    1px solid
    rgba(232, 161, 58, .22);
}

.remote-watch-head {
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding:
    0 10px;

  color:
    #e8a13a;

  font-size:
    8px;

  font-weight:
    900;

  letter-spacing:
    1.5px;
}

.remote-watch-head small {
  color:
    #777267;

  font-size:
    8px;
}

.remote-watch-screen {
  width: 100%;

  aspect-ratio:
    16 / 9;

  overflow: hidden;

  background:
    #07090d;
}

#remote-game-preview {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  pointer-events: none;
}