/*
 * Final layout contracts shared by desktop, mobile, and the CS:S MOTD panel.
 * Keep exact control sizing here so page-specific rules cannot drift apart.
 */
:root {
    --yg-layout-gap: 1.5rem;
    --yg-layout-gap-compact: 1rem;
}

.stats-view-switcher a > span,
.stats-mode-switcher a,
.command-tab,
.stats-panel-heading h2,
.map-heading h2,
.server-meta-grid span {
    white-space: nowrap;
}

.map-detail-time-stack,
.map-detail-info-stack {
    gap: 0.07rem;
    line-height: 0.91rem;
    vertical-align: middle;
}

.map-detail-time-stack {
    display: inline-flex;
    align-items: baseline;
    flex-direction: column;
    white-space: nowrap;
}

.map-detail-time-stack > *,
.map-detail-info-stack > * {
    line-height: 0.91rem;
}

.map-detail-time-stack strong {
    color: var(--yg-text);
    font: inherit;
    font-weight: 800;
}

.map-detail-time-stack small {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 730;
}

.map-detail-time-stack small.is-placeholder {
    visibility: hidden;
}

.server-modal-map-link {
    color: var(--yg-muted);
    text-decoration: none;
}

.server-modal-map-link:not(.is-disabled):hover,
.server-modal-map-link:not(.is-disabled):focus-visible {
    color: #4f46e5;
}

.server-modal-map-link.is-disabled {
    pointer-events: none;
}

@media (min-width: 768px) and (max-width: 1399.98px) {
    .stats-main-grid-rankings .stats-panel-heading,
    .player-profile-record-grid .stats-panel-heading {
        align-items: stretch;
        flex-direction: column;
        gap: var(--yg-layout-gap-compact);
    }

    .stats-main-grid-rankings .stats-panel-heading > form,
    .player-profile-record-grid .stats-panel-heading > form {
        align-self: flex-end;
    }

    .stats-main-grid-rankings .stats-panel-heading > .stats-style-filter,
    .player-profile-record-grid .stats-panel-heading > .stats-style-filter {
        flex: 0 0 auto;
    }
}

@media (max-width: 575.98px) {
    .map-detail-table {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .map-detail-table colgroup {
        display: none;
    }

    .map-details-modal [data-map-modal-table],
    .map-details-modal .modal-body {
        overflow-x: hidden;
    }

    .stats-subnav-row {
        gap: var(--yg-layout-gap-compact);
    }

    .stats-subnav-right {
        width: 100%;
        margin-left: 0;
    }

    .stats-subnav-right .stats-view-switcher {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-subnav-right .stats-view-switcher a {
        width: 100%;
        min-width: 0;
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    .player-profile-identity {
        align-items: center;
        flex-direction: row;
        gap: 1rem;
    }

    .player-profile-avatar {
        width: 80px;
        height: 80px;
        border-width: 4px;
        border-radius: 24px;
    }

    .player-profile-avatar-link .stats-avatar-state {
        right: 1px;
        bottom: 1px;
        width: 18px;
        height: 18px;
        border-width: 3px;
    }

    .player-profile-text {
        min-height: 80px;
        justify-content: center;
        gap: 0.55rem;
        padding: 0;
    }

    .player-profile-identity h1 {
        font-size: clamp(2rem, 10vw, 2.7rem);
        line-height: 1;
        transform: none;
    }

    .player-profile-identity p {
        font-size: 0.86rem;
        line-height: 1.2;
        transform: none;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    body.is-motd .server-grid .server-meta-grid span {
        overflow: hidden;
        font-size: 0.56rem;
        letter-spacing: -0.025em;
        text-overflow: ellipsis;
    }
}
