/* FREAKOUT client: screens (Blazor) and the DOM HUD over the render.js canvas. "Light as magic": gold on night blue. */
@property --p {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

:root {
    color-scheme: dark;
    --bg: #0B0F1A;
    --bg-2: #0d1322;
    --panel: rgba(12, 16, 28, 0.86);
    --panel-solid: #121828;
    --panel-2: #1a2134;
    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.16);
    --text: #e9e4d6;
    --muted: #9aa3b5;
    --gold: #F2C14E;
    --gold-2: #ffe9a8;
    --sand: #E8C98A;
    --danger: #ff6b6b;
    --ok: #8BE34B;
    --accent: #3fd6e0;
    --error: #ff6b6b;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
    overflow: hidden;
}

button {
    font: inherit;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line-2);
    border-radius: 9px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
}

    button:hover:not(:disabled) {
        background: #26304a;
        border-color: rgba(255, 255, 255, .26);
    }

    button:active:not(:disabled) {
        transform: translateY(1px);
    }

    button:disabled {
        opacity: .45;
        cursor: default;
    }

    button.primary {
        background: linear-gradient(180deg, #f6cf67, #e0a93a);
        color: #1a1205;
        border-color: #f2c14e;
        font-weight: 650;
    }

        button.primary:hover:not(:disabled) {
            background: linear-gradient(180deg, #ffe08a, #ebb548);
        }

        button.primary.on {
            background: linear-gradient(180deg, #a6ef6c, #73c93a);
            border-color: #8BE34B;
        }

    button.ghost {
        background: transparent;
    }

    button.wide {
        width: 100%;
    }

input {
    font: inherit;
    color: var(--text);
    background: #0b1020;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    padding: 9px 12px;
    outline: none;
    min-width: 0;
}

    input:focus {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px rgba(242, 193, 78, .18);
    }

    input.invalid {
        border-color: var(--danger);
    }

code {
    color: var(--accent);
}

.icon {
    display: inline-block;
    width: 1.6em;
    height: 1.6em;
    vertical-align: middle;
    flex: none;
}

    .icon.tiny {
        width: 1.05em;
        height: 1.05em;
    }

    .icon.mini {
        width: 26px;
        height: 26px;
    }

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
    box-shadow: 0 0 8px currentColor;
}

.hint {
    color: var(--muted);
    font-size: 12.5px;
    margin: 6px 0 0;
}

    .hint.center {
        text-align: center;
    }

.eyebrow {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
}

.notice {
    margin: 12px 0 0;
    padding: 9px 12px;
    border-radius: 9px;
    background: rgba(255, 107, 107, .1);
    border: 1px solid rgba(255, 107, 107, .35);
    color: #ffc2c2;
}

.field-error {
    margin: 4px 0 0;
    color: #ff9a9a;
    font-size: 12.5px;
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(242, 193, 78, .14);
    border: 1px solid rgba(242, 193, 78, .35);
    color: var(--gold-2);
    font-size: 12px;
}

    .badge.dim {
        background: rgba(255, 255, 255, .05);
        border-color: var(--line-2);
        color: var(--muted);
    }

.tag {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    color: var(--muted);
}

    .tag.gold {
        background: rgba(242, 193, 78, .18);
        color: var(--gold-2);
    }

/* ---------------------------------------------------------------- canvas */

canvas.arena {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    cursor: crosshair;
}

    canvas.arena.off {
        visibility: hidden;
    }

/* ---------------------------------------------------------------- screens */

.screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    z-index: 10;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
    max-width: 100%;
}

    .card h2 {
        margin: 2px 0 10px;
        font-size: 22px;
    }

.center-note {
    background: radial-gradient(ellipse at center, rgba(11, 15, 26, .35), rgba(11, 15, 26, .75));
}

.note-card {
    text-align: center;
    min-width: 280px;
    max-width: 440px;
}

.spinner {
    width: 34px;
    height: 34px;
    margin: 4px auto 10px;
    border-radius: 50%;
    border: 3px solid rgba(242, 193, 78, .2);
    border-top-color: var(--gold);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* start screen: a warm disc of light in the dark */
.screen.start {
    background: radial-gradient(circle at 50% 46%, #3a2c18 0%, #1b1a1f 32%, var(--bg) 62%);
}

.start-glow {
    position: absolute;
    width: min(70vmin, 620px);
    height: min(70vmin, 620px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(242, 193, 78, .22), rgba(242, 193, 78, .06) 55%, transparent 70%);
    box-shadow: inset 0 0 0 2px rgba(255, 217, 138, .16);
    pointer-events: none;
    animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
    50% {
        transform: scale(.94);
        opacity: .75;
    }
}

.start-card {
    position: relative;
    width: 400px;
}

.logo {
    margin: 0;
    text-align: center;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: .22em;
    color: var(--gold);
    text-shadow: 0 0 22px rgba(242, 193, 78, .55);
}

    .logo.small {
        font-size: 30px;
    }

.tagline {
    margin: 2px 0 18px;
    text-align: center;
    color: var(--muted);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

    .field > span {
        font-size: 12px;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--muted);
    }

.char-pick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.char-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, .03);
    text-align: center;
}

    .char-option .character-icon {
        width: 56px;
        height: 56px;
    }

    .char-option small {
        color: var(--muted);
        font-size: 11.5px;
        line-height: 1.25;
    }

    .char-option.on {
        border-color: var(--gold);
        background: rgba(242, 193, 78, .1);
        box-shadow: 0 0 0 1px var(--gold) inset, 0 0 18px rgba(242, 193, 78, .18);
    }

.char-pick.small .char-option {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 6px 10px;
}

    .char-pick.small .char-option .character-icon {
        width: 34px;
        height: 34px;
    }

.start-card > button.primary {
    margin-top: 18px;
    padding: 11px 14px;
    font-size: 15px;
}

.join-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.code-input {
    width: 112px;
    text-align: center;
    letter-spacing: .3em;
    font-weight: 700;
    text-transform: uppercase;
}

.join-row button {
    flex: 1;
}

/* lobby */
.lobby-card {
    width: 560px;
}

.lobby-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.room-code {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: .25em;
    color: var(--gold);
    text-shadow: 0 0 18px rgba(242, 193, 78, .45);
    line-height: 1.1;
}

    .room-code.small {
        font-size: 18px;
        letter-spacing: .18em;
    }

.lobby-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

    .lobby-meta .hint {
        margin: 0;
    }

.unit-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.unit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--line);
}

    .unit-row.me {
        border-color: rgba(242, 193, 78, .45);
    }

    .unit-row .name {
        font-weight: 650;
    }

        .unit-row .name small {
            color: var(--muted);
            font-weight: 400;
        }

    .unit-row .char {
        color: var(--muted);
        font-size: 12.5px;
        flex: 1;
    }

    .unit-row .wins {
        color: var(--gold-2);
        font-size: 12px;
    }

.state {
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
}

    .state.ok {
        color: #c9f5a6;
        background: rgba(139, 227, 75, .13);
        border-color: rgba(139, 227, 75, .45);
    }

    .state.wait {
        color: var(--muted);
    }

    .state.dummy {
        color: var(--gold-2);
        border-color: rgba(242, 193, 78, .35);
    }

.lobby-section {
    margin-top: 16px;
}

.section-label {
    display: block;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

    .toggle input {
        width: 16px;
        height: 16px;
        accent-color: var(--gold);
        padding: 0;
    }

/* buy phase */
.screen.buy {
    background: radial-gradient(ellipse at center, rgba(11, 15, 26, .25), rgba(11, 15, 26, .78));
}

/* Fixed size: buying/upgrading changes how long the two lists are, so the card must not resize with them (the timer and
   the Pronto/Sair buttons stay put); the lists scroll inside their columns instead. */
.buy-card {
    width: 860px;
    height: min(640px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .buy-card > .actions {
        flex: none;
    }

    .buy-card > .spectator-loadouts {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

/* Thin dark scrollbars for the scrolling lists of the buy card. */
.buy-card .scroll-y {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

    .buy-card .scroll-y::-webkit-scrollbar {
        width: 6px;
    }

    .buy-card .scroll-y::-webkit-scrollbar-track {
        background: transparent;
    }

    .buy-card .scroll-y::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .18);
        border-radius: 3px;
    }

        .buy-card .scroll-y::-webkit-scrollbar-thumb:hover {
            background: rgba(242, 193, 78, .45);
        }

.buy-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.timer {
    display: flex;
    align-items: baseline;
    gap: 2px;
    color: var(--gold);
}

.timer-value {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.timer.warn {
    color: #ff9a8a;
}

.timer-bar {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .07);
    overflow: hidden;
    margin: 10px 0 14px;
}

    .timer-bar i {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, var(--gold), var(--gold-2));
        transition: width .1s linear;
    }

    .timer-bar.thin {
        height: 3px;
        margin: 14px 0 4px;
    }

.coins-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
}

    .coins-line b {
        font-size: 22px;
        color: var(--gold);
    }

    .coins-line .hint {
        margin: 0;
    }

.buy-columns {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 18px;
    margin-top: 12px;
}

    .buy-columns > section {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .buy-columns .shop-list {
        flex: 1 1 auto;
        min-height: 0;
        padding-right: 4px;
    }

    .buy-columns h3 {
        margin: 0 0 8px;
        font-size: 13px;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--muted);
    }

.shop-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--line);
}

.slot-key {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: #222b3f;
    border: 1px solid var(--line-2);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    flex: none;
}

.shop-icon {
    width: 40px;
    height: 40px;
    padding: 3px;
    border-radius: 9px;
    background: #0b1020;
    border: 1px solid var(--line);
}

.shop-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .shop-text small {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.3;
    }

        .shop-text small.stats {
            color: #c8b98f;
        }

.level-pips {
    display: inline-flex;
    gap: 3px;
    margin: 2px 0;
}

    .level-pips i {
        width: 14px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, .12);
    }

        .level-pips i.on {
            background: var(--gold);
            box-shadow: 0 0 6px rgba(242, 193, 78, .6);
        }

.buy-btn {
    flex: none;
    padding: 6px 10px;
    font-size: 12.5px;
    white-space: nowrap;
}

.spectator-loadouts {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .spectator-loadouts li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        border-radius: 10px;
        background: rgba(255, 255, 255, .035);
        border: 1px solid var(--line);
    }

    .spectator-loadouts .name {
        font-weight: 650;
        min-width: 90px;
    }

.coins {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--gold-2);
}

.loadout-icons {
    display: inline-flex;
    gap: 4px;
    margin-left: auto;
}

.mini-slot {
    position: relative;
    width: 30px;
    height: 30px;
    padding: 2px;
    border-radius: 7px;
    background: #0b1020;
    border: 1px solid var(--line-2);
}

    .mini-slot .icon {
        width: 100%;
        height: 100%;
    }

    .mini-slot b {
        position: absolute;
        right: -4px;
        bottom: -4px;
        font-size: 9.5px;
        line-height: 1;
        padding: 2px 3px;
        border-radius: 4px;
        background: var(--gold);
        color: #1a1205;
    }

    .mini-slot.cooling {
        opacity: .5;
    }

/* dev room list */
.rooms-card {
    width: 680px;
}

.room-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    background: rgba(255, 255, 255, .035);
}

.room-phase {
    min-width: 150px;
    color: var(--gold-2);
    font-size: 13px;
}

.room-units {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.room-unit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

    .room-unit small {
        color: var(--gold-2);
    }

.room-spec {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- round HUD (over the canvas) */

.hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    user-select: none;
}

    .hud button, .hud label, .hud input, .hud .spectator-panel {
        pointer-events: auto;
    }

.hud-top {
    position: absolute;
    top: 10px;
    left: 12px;
    right: 12px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: 12px;
}

.wins-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wins-unit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    font-size: 13px;
}

    .wins-unit.me {
        border-color: rgba(242, 193, 78, .5);
    }

    .wins-unit.gone {
        opacity: .45;
        text-decoration: line-through;
    }

    .wins-unit .crown, .spec-head .crown, .score-table .crown {
        width: 18px;
        height: 18px;
        filter: drop-shadow(0 0 6px rgba(242, 193, 78, .8));
    }

.pips {
    display: inline-flex;
    gap: 3px;
}

    .pips i {
        width: 9px;
        height: 9px;
        transform: rotate(45deg);
        border: 1px solid rgba(255, 255, 255, .35);
        background: transparent;
    }

        .pips i.on {
            background: var(--c, var(--gold));
            border-color: var(--c, var(--gold));
            box-shadow: 0 0 6px var(--c, var(--gold));
        }

.round-clock {
    text-align: center;
    padding: 6px 16px 8px;
    border-radius: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    min-width: 200px;
}

.round-label {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
}

.round-time {
    font-size: 24px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.shrink {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--muted);
}

    .shrink.warn {
        color: #ffb38a;
    }

    .shrink.late {
        color: #ff8a8a;
        font-weight: 650;
    }

    .shrink .lit {
        font-size: 11px;
    }

.shrink-bar {
    width: 150px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

    .shrink-bar i {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, #3B4A63, #ffd98a);
    }

.hud-corner {
    justify-self: end;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.chip {
    padding: 5px 10px;
    font-size: 12.5px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line-2);
}

    .chip.toggle {
        display: inline-flex;
        gap: 6px;
        align-items: center;
    }

    .chip.danger:hover {
        border-color: var(--danger);
        color: #ffc2c2;
    }

.ping {
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

    .ping.good {
        color: #b6f08c;
    }

    .ping.mid {
        color: #ffd98a;
    }

    .ping.bad {
        color: #ff9a8a;
    }

.countdown {
    position: absolute;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.countdown-number {
    font-size: 120px;
    font-weight: 850;
    line-height: 1;
    color: var(--gold);
    text-shadow: 0 0 40px rgba(242, 193, 78, .7), 0 4px 0 rgba(0, 0, 0, .4);
}

.countdown-label {
    margin-top: 6px;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--gold-2);
}

.countdown.go .countdown-number {
    font-size: 90px;
    animation: pop .6s ease-out both;
}

@keyframes pop {
    from {
        transform: scale(.6);
        opacity: 0;
    }

    40% {
        transform: scale(1.1);
        opacity: 1;
    }

    to {
        transform: scale(1);
        opacity: 0;
    }
}

.dead-banner {
    position: absolute;
    left: 50%;
    top: 74px;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(40, 10, 16, .82);
    border: 1px solid rgba(255, 107, 107, .4);
    color: #ffc2c2;
}

.render-error {
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    max-width: min(560px, calc(100vw - 32px));
    padding: 14px 20px;
    border-radius: 12px;
    background: rgba(40, 10, 16, .9);
    border: 1px solid rgba(255, 107, 107, .5);
    color: #ffc2c2;
    text-align: center;
}

.hud-bottom {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    /* max-content: with left: 50% the shrink-to-fit width would be capped at half the viewport and wrap the hints. */
    width: max-content;
    max-width: calc(100vw - 24px);
}

.sanity-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 14px;
    border-radius: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.sanity-label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

    .sanity-label b {
        color: var(--gold-2);
        font-size: 15px;
        font-variant-numeric: tabular-nums;
    }

.sanity-bar {
    width: 180px;
    height: 8px;
    border-radius: 4px;
    background: #2a1d1d;
    overflow: hidden;
}

    .sanity-bar i {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, #F2C14E, #ffe9a8);
        box-shadow: 0 0 10px rgba(242, 193, 78, .6);
        transition: width .12s linear;
    }

    .sanity-bar.low i {
        background: linear-gradient(90deg, #ff5e5e, #ff9a8a);
        box-shadow: 0 0 10px rgba(255, 94, 94, .7);
    }

/* "Fora da luz" (PRD 4.3, Vendo de fora): a chip right above the sanity label. Absolute, so the bottom bar never changes size
   when it appears; stronger (red, pulsing) in full darkness than in the medium ring. */
.dark-warning {
    position: absolute;
    left: 8px;
    bottom: calc(100% + 6px);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
    pointer-events: none;
    color: #dfe3ee;
    background: rgba(26, 32, 50, .9);
    border: 1px solid rgba(154, 163, 181, .5);
    box-shadow: 0 0 10px rgba(90, 106, 150, .35);
    text-shadow: 0 1px 2px #000;
    animation: dark-warning-in .4s ease-out;
}

    .dark-warning.full {
        color: #ffd2d2;
        background: rgba(48, 12, 20, .9);
        border-color: rgba(255, 107, 107, .6);
        animation: dark-warning-in .4s ease-out, dark-warning-pulse 1s ease-in-out .4s infinite alternate;
    }

@keyframes dark-warning-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes dark-warning-pulse {
    from {
        box-shadow: 0 0 6px rgba(255, 94, 94, .25);
    }

    to {
        box-shadow: 0 0 16px rgba(255, 94, 94, .65);
    }
}

.rage {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

    .rage b {
        color: #ffb38a;
        font-variant-numeric: tabular-nums;
        min-width: 1.4em;
    }

.rage-cells {
    display: inline-flex;
    gap: 2px;
}

    .rage-cells i {
        width: 7px;
        height: 12px;
        border-radius: 2px;
        background: rgba(255, 255, 255, .1);
    }

        .rage-cells i.on {
            background: linear-gradient(180deg, #ffd27a, #ff5a1f);
            box-shadow: 0 0 6px rgba(255, 110, 40, .7);
        }

.slots {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.slot {
    --skill: #c8ccd8;
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 11px;
    background: radial-gradient(circle at 50% 35%, #1d2540, #0b1020);
    border: 2px solid color-mix(in srgb, var(--skill) 55%, transparent);
    overflow: hidden;
    display: grid;
    place-items: center;
}

    .slot > .icon {
        width: 42px;
        height: 42px;
        filter: drop-shadow(0 0 5px color-mix(in srgb, var(--skill) 55%, transparent));
    }

    .slot .key {
        position: absolute;
        left: 4px;
        top: 2px;
        font-size: 11px;
        font-weight: 750;
        color: var(--text);
        text-shadow: 0 1px 2px #000;
        z-index: 3;
    }

    .slot .lvl {
        position: absolute;
        right: 3px;
        bottom: 2px;
        font-size: 10px;
        font-weight: 750;
        padding: 0 4px;
        border-radius: 4px;
        background: var(--gold);
        color: #1a1205;
        z-index: 3;
    }

    /* radial cooldown: --p = fraction remaining (0..1), animated between HUD refreshes */
    .slot .cd-mask {
        position: absolute;
        inset: 0;
        background: conic-gradient(rgba(3, 5, 12, .78) calc(var(--p) * 1turn), transparent 0);
        transition: --p .11s linear;
        z-index: 1;
    }

    .slot .cd-text {
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        font-size: 18px;
        font-weight: 800;
        color: #fff;
        text-shadow: 0 1px 3px #000, 0 0 8px #000;
        z-index: 2;
    }

    .slot.empty {
        opacity: .35;
        border-style: dashed;
        border-color: rgba(255, 255, 255, .2);
    }

    .slot.cooling > .icon {
        filter: grayscale(.7) brightness(.8);
    }

    .slot.active {
        border-color: var(--gold);
        box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(242, 193, 78, .7);
        animation: channel 0.8s ease-in-out infinite alternate;
    }

        .slot.active .cd-mask {
            background: conic-gradient(rgba(242, 193, 78, .28) calc(var(--p) * 1turn), transparent 0);
        }

@keyframes channel {
    to {
        box-shadow: 0 0 0 1px var(--gold), 0 0 26px rgba(242, 193, 78, .95);
    }
}

.slot.dead {
    filter: grayscale(1);
    opacity: .5;
}

.slot.item {
    width: 44px;
    height: 44px;
    border: 2px dashed rgba(255, 255, 255, .14);
    background: #0b1020;
    opacity: .75;
}

    .slot.item > .icon {
        width: 26px;
        height: 26px;
        filter: none;
    }

.slot-gap {
    width: 8px;
}

/* Same size in both cast modes (G): the cast line always reserves the width of the longer confirm-mode text, and each
   line stays on one line; on narrow screens the two lines stack, still identically in both modes. */
.controls-hint {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 14px;
    max-width: 100%;
    font-size: 11px;
    line-height: 16px;
    color: rgba(233, 228, 214, .55);
    text-shadow: 0 1px 2px #000;
}

    .controls-hint > span {
        white-space: nowrap;
    }

    .controls-hint .cast-hint {
        min-width: 24em;
        text-align: right;
    }

    .controls-hint .move-hint {
        min-width: 24em;
        text-align: left;
    }

/* spectator */
.spectator-panel {
    position: absolute;
    right: 12px;
    top: 96px;
    width: 290px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 10px;
    border-radius: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-title {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
}

.spec-unit {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .035);
    border-left: 3px solid var(--c, var(--muted));
}

    .spec-unit.out {
        opacity: .6;
    }

    .spec-unit.gone {
        opacity: .4;
    }

.spec-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .spec-head .char {
        color: var(--muted);
        font-size: 12px;
        flex: 1;
    }

.spec-wins {
    color: var(--gold-2);
    font-size: 12px;
}

.spec-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    font-size: 12px;
}

.spec-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #2a1d1d;
    overflow: hidden;
}

    .spec-bar i {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, #F2C14E, #ffe9a8);
    }

    .spec-bar.low i {
        background: linear-gradient(90deg, #ff5e5e, #ff9a8a);
    }

.spec-num {
    min-width: 26px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.spec-rage {
    color: #ffb38a;
}

.spec-loadout {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
}

    .spec-loadout .mini-slot {
        width: 26px;
        height: 26px;
    }

.spec-coins {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--gold-2);
}

.spectator-tag {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

/* ---------------------------------------------------------------- scoreboards */

.scoreboard-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: radial-gradient(ellipse at center, rgba(11, 15, 26, .55), rgba(11, 15, 26, .88));
}

    .scoreboard-backdrop.soft {
        background: radial-gradient(ellipse at center, rgba(11, 15, 26, .25), rgba(11, 15, 26, .7));
    }

.scoreboard {
    width: 460px;
    text-align: center;
    animation: rise .35s ease-out both;
}

    .scoreboard h2 {
        font-size: 26px;
        margin: 4px 0 14px;
    }

    .scoreboard .subtitle {
        margin: -8px 0 14px;
        color: var(--muted);
    }

    .scoreboard.final {
        border-color: rgba(242, 193, 78, .4);
    }

.big-crown {
    width: 64px;
    height: 64px;
    margin-top: 6px;
    filter: drop-shadow(0 0 14px rgba(242, 193, 78, .8));
}

@keyframes rise {
    from {
        transform: translateY(14px);
        opacity: 0;
    }
}

.score-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

    .score-table td {
        padding: 8px 10px;
        background: rgba(255, 255, 255, .035);
    }

        .score-table td:first-child {
            border-radius: 10px 0 0 10px;
        }

        .score-table td:last-child {
            border-radius: 0 10px 10px 0;
        }

    .score-table .who {
        text-align: left;
        font-weight: 600;
    }

    .score-table .who-in {
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .score-table .who-in .hint {
            margin: 0;
        }

    .score-table td.pips-cell {
        width: 1%;
        white-space: nowrap;
    }

    .score-table .num {
        width: 40px;
        font-size: 18px;
        font-weight: 800;
        color: var(--gold);
        text-align: right;
    }

    .score-table tr.winner td {
        background: rgba(242, 193, 78, .14);
    }

    .score-table tr.gone td {
        opacity: .5;
    }

    .score-table tr.me .who-in > span:not(.dot) {
        text-decoration: underline;
        text-decoration-color: rgba(242, 193, 78, .6);
        text-underline-offset: 3px;
    }

/* ---------------------------------------------------------------- diagnostic page (/diag) */

.hud-panel {
    position: fixed;
    top: 16px;
    left: 16px;
    max-width: calc(100vw - 32px);
    padding: 12px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

    .hud-panel h1 {
        margin: 0;
        font-size: 18px;
        letter-spacing: .12em;
    }

    .hud-panel .subtitle {
        margin: 2px 0 10px;
        color: var(--muted);
        font-size: 12px;
    }

    .hud-panel dl {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 4px 12px;
        margin: 0;
    }

    .hud-panel dt {
        color: var(--muted);
    }

    .hud-panel dd {
        margin: 0;
        word-break: break-all;
    }

    .hud-panel .error {
        margin: 10px 0 0;
        color: var(--error);
    }

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 760px) {
    /* One column: the whole column block scrolls (two stacked scroll areas would be cramped). */
    .buy-columns {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .18) transparent;
    }

        .buy-columns .shop-list {
            flex: none;
            overflow-y: visible;
        }

    /* When the two hint lines stack, center both (same box in both cast modes). */
    .controls-hint .cast-hint, .controls-hint .move-hint {
        text-align: center;
    }

    .hud-top {
        grid-template-columns: 1fr;
    }

    .hud-corner {
        justify-self: start;
    }

    .slot {
        width: 48px;
        height: 48px;
    }

        .slot > .icon {
            width: 34px;
            height: 34px;
        }

    .spectator-panel {
        display: none;
    }
}

/* ---------------------------------------------------------------- Blazor boot / error UI */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    color: #222;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #26304a;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--gold);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Carregando");
    }

/* ---- Servidor (PRD 4.14): selector on the start / dev login screens, active server name in the lobby ---- */

select.server-select {
    font: inherit;
    color: var(--text);
    background: #0b1020;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    padding: 9px 12px;
    outline: none;
    min-width: 0;
}

    select.server-select:focus {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px rgba(242, 193, 78, .18);
    }

    select.server-select:disabled {
        opacity: .6;
    }

    select.server-select option:disabled {
        color: var(--muted);
    }

.server-line {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

    .start-card .server-line {
        text-align: center;
    }

    .server-line b {
        color: var(--text);
        font-weight: 600;
    }

.server-warning {
    margin: 8px 0 0;
    padding: 6px 10px;
    border-radius: 9px;
    background: rgba(242, 193, 78, .1);
    border: 1px solid rgba(242, 193, 78, .35);
    color: var(--gold-2);
    font-size: 12.5px;
    overflow-wrap: anywhere;
}
