/* Sticky live status HUD and header-mounted regia commands for the game page. */
.er-game-top-status {
    position: sticky;
    z-index: 20900;
    top: var(--er-shared-header-height);
    display: grid;
    grid-template-columns: minmax(220px, .82fr) minmax(0, 2.4fr);
    align-items: stretch;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 10px;
    padding: 10px 22px;
    border: 1px solid rgba(201, 164, 95, .23);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background:
        radial-gradient(circle at 0 0, rgba(201, 164, 95, .08), transparent 35%),
        linear-gradient(180deg, rgba(14, 18, 24, .965), rgba(7, 10, 14, .975));
    box-shadow: 0 14px 36px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .025);
    isolation: isolate;
}

.er-game-top-status.is-paused {
    border-color: rgba(220, 176, 80, .45);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .3), inset 3px 0 0 rgba(220, 176, 80, .62);
}

.er-game-top-status__lead {
    display: grid;
    align-content: center;
    gap: 2px;
    min-width: 0;
    padding: 5px 10px 5px 4px;
    border-right: 1px solid rgba(255, 255, 255, .065);
}

.er-game-top-status__lead > span {
    color: #d7b66f;
    font-size: .58rem;
    font-weight: 950;
    letter-spacing: .16em;
}

.er-game-top-status__lead > strong {
    overflow: hidden;
    color: #f1ddb0;
    font-size: .92rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.er-game-top-status__lead > small {
    overflow: hidden;
    color: #8f9aa6;
    font-size: .67rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.er-game-top-status__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
}

.er-game-top-status__chip {
    display: grid;
    align-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 6px 9px;
    border: 1px solid rgba(80, 94, 111, .32);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(13, 18, 24, .86), rgba(8, 12, 17, .9));
}

.er-game-top-status__chip small {
    overflow: hidden;
    color: #788491;
    font-size: .54rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.er-game-top-status__chip strong {
    overflow: hidden;
    margin-top: 1px;
    color: #dce2e8;
    font-size: .72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.er-game--compact-regia > .er-admin-bar:not(#install-banner) {
    display: none !important;
}

.er-game-command-menu {
    position: relative;
    display: block;
    flex: 0 1 310px;
    width: min(310px, 28vw);
    min-width: 172px;
}

.er-game-command-menu > summary {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    padding: 6px 10px;
    border: 1px solid rgba(201, 164, 95, .27);
    border-radius: 11px;
    background: linear-gradient(180deg, rgba(19, 24, 31, .94), rgba(10, 14, 19, .96));
    color: #e6e9ed;
    cursor: pointer;
    list-style: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .025);
}

.er-game-command-menu > summary::-webkit-details-marker {
    display: none;
}

.er-game-command-menu > summary:hover,
.er-game-command-menu > summary:focus-visible,
.er-game-command-menu[open] > summary {
    border-color: rgba(221, 181, 91, .52);
    outline: none;
    background: linear-gradient(180deg, rgba(36, 30, 19, .96), rgba(13, 15, 18, .98));
}

.er-game-command-menu__mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 30px;
    border: 1px solid rgba(201, 164, 95, .5);
    border-radius: 8px;
    color: #e2bd69;
    font-size: .6rem;
    font-weight: 950;
    letter-spacing: .08em;
}

.er-game-command-menu > summary > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.er-game-command-menu > summary strong {
    overflow: hidden;
    color: #efd9a5;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.er-game-command-menu > summary small {
    overflow: hidden;
    color: #8b96a2;
    font-size: .61rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.er-game-command-menu__chevron {
    color: #c19b4c;
    font-size: .9rem;
    transition: transform .16s ease;
}

.er-game-command-menu[open] .er-game-command-menu__chevron {
    transform: rotate(180deg);
}

.er-game-command-menu__popover {
    position: absolute;
    z-index: 21600;
    top: calc(100% + 10px);
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    width: min(680px, calc(100vw - 24px));
    padding: 10px;
    border: 1px solid rgba(201, 164, 95, .29);
    border-radius: 14px;
    background: rgba(7, 10, 14, .99);
    box-shadow: 0 28px 82px rgba(0, 0, 0, .64), inset 0 1px 0 rgba(255, 255, 255, .025);
    -webkit-backdrop-filter: blur(22px) saturate(115%);
    backdrop-filter: blur(22px) saturate(115%);
}

.er-game-command-menu__popover > span:not(.er-survival-actions) {
    flex: 1 1 100%;
    padding: 4px 5px 8px;
    color: #929da9;
    font-size: .68rem;
    line-height: 1.4;
}

.er-game-command-menu__popover .er-btn,
.er-game-command-menu__popover .er-survival-actions {
    flex: 0 0 auto;
}

.er-game-command-menu__popover .er-survival-actions {
    display: flex !important;
    gap: 7px;
    margin-left: 0 !important;
}

.er-game--compact-regia .er-survival-strip {
    display: none !important;
}

@media (max-width: 1220px) {
    .er-game-command-menu {
        flex-basis: 250px;
        width: min(250px, 30vw);
        min-width: 150px;
    }

    .er-game-command-menu > summary small {
        display: none;
    }
}

@media (max-width: 900px) {
    .er-game-top-status {
        grid-template-columns: minmax(150px, .55fr) minmax(0, 1fr);
        gap: 7px;
        margin: 0 0 8px;
        padding: 7px 10px;
        border-radius: 0;
    }

    .er-game-top-status__lead {
        padding: 4px 8px 4px 3px;
    }

    .er-game-top-status__grid {
        display: flex;
        gap: 5px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    .er-game-top-status__chip {
        flex: 0 0 112px;
        min-height: 46px;
    }

    .er-game-command-menu {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
    }

    .er-game-command-menu > summary {
        grid-template-columns: 30px auto 14px;
        gap: 6px;
        min-height: 46px;
        padding: 5px 7px;
    }

    .er-game-command-menu__mark {
        width: 28px;
        height: 28px;
    }

    .er-game-command-menu > summary small {
        display: none;
    }

    .er-game-command-menu__popover {
        position: fixed;
        top: calc(var(--er-shared-header-height) + 8px);
        right: 10px;
        left: 10px;
        width: auto;
        max-height: calc(100dvh - var(--er-shared-header-height) - 20px);
        overflow: auto;
    }
}

@media (max-width: 620px) {
    .er-game-top-status {
        display: block;
    }

    .er-game-top-status__lead {
        display: none;
    }

    .er-game-command-menu > summary {
        grid-template-columns: 30px 12px;
    }

    .er-game-command-menu > summary > span:nth-child(2) {
        display: none;
    }
}

@media (max-width: 430px) {
    .er-game-top-status__chip {
        flex-basis: 104px;
        padding-right: 7px;
        padding-left: 7px;
    }
}
