:root {
    --station-bg: #071015;
    --station-panel: rgba(8, 22, 29, .94);
    --station-panel-soft: rgba(15, 37, 46, .72);
    --station-line: rgba(173, 213, 225, .18);
    --station-line-strong: rgba(173, 213, 225, .34);
    --station-text: #edf7fa;
    --station-muted: #8ba7b1;
    --station-ice: #c9e8ef;
    --station-alert: #b53b38;
    --station-amber: #c88f44;
}

.station-page,
.lobby {
    min-height: calc(100vh - 144px);
}

.station-page {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 660px) minmax(260px, 390px);
    gap: 28px;
    align-items: center;
    isolation: isolate;
}

.station-page-join {
    grid-template-columns: minmax(0, 600px);
    justify-content: center;
}

.station-backdrop {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: #061015;
}

.station-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 12, 16, .97) 0%, rgba(4, 15, 20, .82) 48%, rgba(4, 13, 18, .92) 100%),
        linear-gradient(180deg, rgba(4, 13, 18, .15), rgba(4, 13, 18, .86));
}

.station-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(.18) saturate(.62) contrast(1.08);
    opacity: .42;
}

.station-card,
.station-aside,
.lobby-roster,
.lobby-status-card,
.lobby-host-panel,
.lobby-guest-panel {
    border: 1px solid var(--station-line);
    background: var(--station-panel);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

.station-card {
    padding: clamp(28px, 5vw, 52px);
    border-radius: 4px;
    position: relative;
}

.station-card::before,
.lobby-roster::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 86px;
    height: 3px;
    background: var(--station-alert);
}

.station-card-compact {
    width: min(100%, 590px);
}

.station-back {
    color: var(--station-muted);
    text-decoration: none;
    font-size: .86rem;
}

.station-back:hover {
    color: var(--station-text);
}

.station-kicker,
.station-aside-label,
.lobby-code-panel > span,
.lobby-section-head span,
.lobby-status-card > span,
.lobby-host-panel > span,
.lobby-guest-panel > span {
    display: block;
    color: var(--station-amber);
    letter-spacing: .18em;
    font-size: .7rem;
    font-weight: 800;
}

.station-card h1,
.lobby h1 {
    margin: 10px 0 14px;
    color: var(--station-text);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.station-card h1 {
    font-size: clamp(2.1rem, 5vw, 4rem);
}

.station-lead,
.station-aside p,
.lobby-head p,
.lobby-status p,
.lobby-host-panel small {
    color: var(--station-muted);
    line-height: 1.65;
}

.station-field {
    display: block;
    margin-top: 22px;
}

.station-field > span {
    display: block;
    color: var(--station-ice);
    margin-bottom: 8px;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.station-field input,
.station-field select {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--station-line-strong);
    border-radius: 3px;
    background: rgba(1, 10, 14, .82);
    color: var(--station-text);
    padding: 0 15px;
    font: inherit;
    outline: none;
}

.station-field input:focus,
.station-field select:focus {
    border-color: rgba(201, 232, 239, .7);
    box-shadow: 0 0 0 3px rgba(201, 232, 239, .08);
}

.station-toggle {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: start;
    margin: 24px 0;
    cursor: pointer;
}

.station-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.station-toggle-box {
    width: 22px;
    height: 22px;
    border: 1px solid var(--station-line-strong);
    background: rgba(0, 0, 0, .25);
    position: relative;
}

.station-toggle input:checked + .station-toggle-box::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: var(--station-ice);
}

.station-toggle strong,
.station-toggle small {
    display: block;
}

.station-toggle strong {
    color: var(--station-text);
}

.station-toggle small {
    color: var(--station-muted);
    margin-top: 4px;
    line-height: 1.45;
}

.station-preview {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin: 24px 0;
    padding: 14px 16px;
    border-left: 3px solid var(--station-amber);
    background: var(--station-panel-soft);
}

.station-preview span {
    color: var(--station-muted);
    font-size: .72rem;
    letter-spacing: .11em;
}

.station-preview strong {
    color: var(--station-text);
}

.station-primary,
.station-secondary,
.lobby-code-panel button,
.participant-remove {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.station-primary {
    width: 100%;
    min-height: 54px;
    background: var(--station-ice);
    color: #061015;
    padding: 0 18px;
}

.station-primary:hover:not(:disabled) {
    filter: brightness(1.06);
}

.station-primary:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.station-secondary {
    min-height: 38px;
    padding: 0 14px;
    background: rgba(201, 232, 239, .08);
    color: var(--station-ice);
    border: 1px solid var(--station-line-strong);
}

.station-error {
    margin: 16px 0;
    padding: 12px 14px;
    border-left: 3px solid var(--station-alert);
    background: rgba(181, 59, 56, .12);
    color: #f0c2c0;
    line-height: 1.45;
}

.station-aside {
    padding: 28px;
    align-self: end;
    margin-bottom: 42px;
}

.station-aside h2 {
    color: var(--station-text);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    margin: 12px 0;
}

.station-signal {
    display: flex;
    gap: 5px;
    align-items: end;
    margin-top: 24px;
    height: 24px;
}

.station-signal span {
    width: 7px;
    background: var(--station-ice);
    opacity: .72;
}

.station-signal span:nth-child(1) { height: 6px; }
.station-signal span:nth-child(2) { height: 10px; }
.station-signal span:nth-child(3) { height: 14px; }
.station-signal span:nth-child(4) { height: 19px; }
.station-signal span:nth-child(5) { height: 24px; }

.lobby {
    padding: 18px 0 42px;
}

.lobby-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
}

.lobby-head h1 {
    font-size: clamp(2rem, 5vw, 4.2rem);
}

.lobby-head p {
    max-width: 690px;
    margin-bottom: 0;
}

.lobby-code-panel {
    min-width: 250px;
    border: 1px solid var(--station-line-strong);
    padding: 16px;
    background: rgba(8, 22, 29, .86);
    text-align: center;
}

.lobby-code-panel strong {
    display: block;
    color: var(--station-text);
    letter-spacing: .22em;
    font-size: 2rem;
    margin: 8px 0 10px;
}

.lobby-code-panel button {
    width: 100%;
    min-height: 34px;
    background: rgba(201, 232, 239, .1);
    color: var(--station-ice);
    border: 1px solid var(--station-line);
}

.lobby-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 20px;
}

.lobby-roster {
    position: relative;
    padding: 22px;
}

.lobby-section-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--station-line);
}

.lobby-section-head strong {
    display: block;
    color: var(--station-text);
    font-size: 1.25rem;
    margin-top: 5px;
}

.lobby-participants {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.participant-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 14px auto;
    gap: 14px;
    align-items: center;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid var(--station-line);
    background: rgba(6, 17, 22, .72);
}

.participant-bot {
    border-style: dashed;
}

.participant-order {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--station-line-strong);
    color: var(--station-muted);
    font-family: monospace;
}

.participant-identity strong {
    display: block;
    color: var(--station-text);
    font-size: 1rem;
}

.participant-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.participant-badges span {
    padding: 2px 6px;
    border: 1px solid var(--station-line);
    color: var(--station-muted);
    font-size: .62rem;
    letter-spacing: .08em;
}

.participant-badges .badge-host {
    color: #e1b06f;
    border-color: rgba(200, 143, 68, .35);
}

.participant-signal {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7ba78a;
    box-shadow: 0 0 10px rgba(123, 167, 138, .5);
}

.participant-remove {
    min-height: 32px;
    padding: 0 10px;
    background: rgba(181, 59, 56, .12);
    color: #e4aaa7;
    border: 1px solid rgba(181, 59, 56, .3);
    font-size: .65rem;
}

.lobby-status {
    display: grid;
    gap: 14px;
    align-content: start;
}

.lobby-status-card,
.lobby-host-panel,
.lobby-guest-panel {
    padding: 20px;
}

.lobby-status-card strong {
    display: block;
    color: var(--station-text);
    margin: 9px 0 4px;
}

.lobby-host-panel .station-primary {
    margin: 16px 0 10px;
}

.lobby-host-panel small {
    display: block;
}

@media (max-width: 850px) {
    .station-page,
    .lobby-grid {
        grid-template-columns: 1fr;
    }

    .station-aside {
        margin: 0;
    }

    .lobby-head {
        align-items: stretch;
        flex-direction: column;
    }

    .lobby-code-panel {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .station-card,
    .station-aside,
    .lobby-roster,
    .lobby-status-card,
    .lobby-host-panel,
    .lobby-guest-panel {
        padding: 18px;
    }

    .station-preview,
    .lobby-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .participant-card {
        grid-template-columns: 42px minmax(0, 1fr) 10px;
    }

    .participant-remove {
        grid-column: 2 / -1;
        justify-self: start;
    }
}
