/* ========================================
   Server Cards - Modern Professional Design
   ======================================== */

/* CLS: reserve carousel viewport height so the loading state and
   first-frame swap don't shift the page below. The active slide
   determines real height; this is just a floor. */
.carousel-inner {
    min-height: 320px;
}

.activity-record-card {
    min-height: 120px;
}

/* ========================================
   Milestone Panel
   ======================================== */

.servers-milestone-panel {
    background: rgba(15, 22, 33, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.07);
    position: relative;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.servers-milestone-panel:hover {
    border-color: rgba(255, 255, 255, 0.13);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.servers-milestone-accent-bar {
    display: none;
}

.servers-milestone-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.625rem;
    border-radius: 0.5rem;
    border-left: 3px solid;
    transition: background 0.2s ease;
}

.servers-milestone-chip-right {
    border-left: none;
    border-right: 3px solid;
    justify-content: flex-end;
}

.servers-milestone-chip-info {
    background: rgba(13, 202, 240, 0.07);
    border-color: #0dcaf0;
}

.servers-milestone-chip-info:hover {
    background: rgba(13, 202, 240, 0.12);
}

.servers-milestone-chip-warning {
    background: rgba(255, 193, 7, 0.07);
    border-color: #ffc107;
}

.servers-milestone-chip-warning:hover {
    background: rgba(255, 193, 7, 0.12);
}

.servers-milestone-icon-ring {
    display: none;
}

.servers-milestone-icon-ring-warning {
    display: none;
}

.servers-milestone-divider {
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.1) 20%,
        rgba(255, 255, 255, 0.1) 80%,
        transparent
    );
    align-self: stretch;
}

.server-card {
    position: relative;
    background: rgba(15, 22, 33, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    backdrop-filter: blur(20px);
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.server-card:hover {
    border-color: rgba(13, 202, 240, 0.3) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(13, 202, 240, 0.1) !important;
}

.server-card:hover::before {
    opacity: 1;
}

.server-image-wrapper {
    height: 140px;
    position: relative;
    background: rgba(15, 22, 33, 0.9);
    overflow: hidden;
}

.server-map-image {
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.6) contrast(1.1);
}

/* ========================================
   Modal - Modern Design (Reusing existing patterns)
   ======================================== */

.modal-backdrop-blur {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content-modern {
    background: linear-gradient(135deg, rgba(33, 37, 41, 0.95) 0%, rgba(23, 27, 31, 0.95) 100%);
    border: 1px solid rgba(13, 202, 240, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(13, 202, 240, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-header-modern {
    border-bottom: 1px solid rgba(13, 202, 240, 0.2);
}

.modal-footer-modern {
    border-top: 1px solid rgba(13, 202, 240, 0.2);
}

.modal-body-scrollable {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Player list - compact and simple */
.player-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
}

.player-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: rgba(15, 22, 33, 0.5);
    transition: all 0.2s ease;
}

.player-list-item:hover {
    background: rgba(13, 202, 240, 0.1);
    padding-left: 1.25rem;
}

.player-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0dcaf0;
    background: rgba(13, 202, 240, 0.15);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.player-list-item:hover .player-number {
    background: rgba(13, 202, 240, 0.25);
    transform: scale(1.05);
}

.player-name {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

/* Modal animations */
.modal.fade.show {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-dialog {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   Score Display - Modern Design
   ======================================== */

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.score-badges-inline {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.score-badge {
    font-size: 0.875rem;
    font-weight: 700;
    min-width: 1.5rem;
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.score-badge-t {
    color: #212529;
    background: linear-gradient(135deg, rgb(255, 203, 49) 0%, rgb(230, 183, 44) 100%);
    box-shadow: 0 2px 4px rgba(255, 203, 49, 0.3);
}

.score-badge-ct {
    color: #212529;
    background: linear-gradient(135deg, rgb(13, 202, 240) 0%, rgb(12, 182, 216) 100%);
    box-shadow: 0 2px 4px rgba(13, 202, 240, 0.3);
}

.score-separator {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    font-size: 1rem;
    padding: 0 0.125rem;
}

/* Match Status Badges - Modern Design */
.match-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    border: 1px solid;
    transition: all 0.2s ease;
}

.match-status-badge i {
    font-size: 0.625rem;
}

.match-status-warmup {
    color: rgb(255, 203, 49);
    background: rgba(255, 203, 49, 0.15);
    border-color: rgba(255, 203, 49, 0.3);
}

.match-status-ongoing {
    color: rgb(25, 238, 25);
    background: rgba(25, 238, 25, 0.15);
    border-color: rgba(25, 238, 25, 0.3);
    animation: pulse-subtle 2s ease-in-out infinite;
}

.match-status-ongoing i {
    animation: pulse-icon 1.5s ease-in-out infinite;
}

.match-status-waiting {
    color: rgb(13, 202, 240);
    background: rgba(13, 202, 240, 0.15);
    border-color: rgba(13, 202, 240, 0.3);
}

.match-status-unknown {
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Subtle animations for ongoing match */
@keyframes pulse-subtle {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(25, 238, 25, 0.4);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(25, 238, 25, 0);
    }
}

@keyframes pulse-icon {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

.server-card:hover .server-map-image {
    transform: scale(1.1);
    filter: brightness(0.7) contrast(1.1);
}

.server-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 22, 33, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1;
}

.server-status-text {
    font-size: 0.75rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-online .status-dot {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.status-online {
    color: #22c55e;
}

.status-offline .status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.status-offline {
    color: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.server-content {
    position: relative;
}

.server-prefix {
    background: rgba(13, 202, 240, 0.15);
    color: #0dcaf0;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.server-title {
    font-size: 0.95rem;
}

.detail-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
    transition: all 0.3s ease;
}

.server-card:hover .detail-icon {
    background: rgba(13, 202, 240, 0.2);
    transform: scale(1.1);
}

.server-ip-code {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    background: rgba(13, 202, 240, 0.05);
    border: 1px solid rgba(13, 202, 240, 0.25);
    border-radius: 0.375rem;
    color: #0dcaf0;
}

.ip-copy-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    background: rgba(13, 202, 240, 0.1);
    border: 1px solid rgba(13, 202, 240, 0.5);
    transition: all 0.2s ease;
}

.ip-copy-btn:hover {
    background: rgba(13, 202, 240, 0.2);
    border-color: rgba(13, 202, 240, 0.5) !important;
    transform: scale(1.05);
}

.ip-copy-btn:active {
    transform: scale(0.95);
}

.connect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.connect-btn:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(34, 197, 94, 0.2) 100%);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.connect-btn:active {
    transform: translateY(0);
}

.connect-btn-warning {
    background: linear-gradient(135deg, rgba(255, 203, 49, 0.2) 0%, rgba(255, 203, 49, 0.1) 100%);
    border-color: rgba(255, 203, 49, 0.3);
    color: rgb(255, 203, 49);
}

.connect-btn-warning:hover {
    background: linear-gradient(135deg, rgba(255, 203, 49, 0.3) 0%, rgba(255, 203, 49, 0.2) 100%);
    border-color: rgba(255, 203, 49, 0.5);
    color: rgb(255, 203, 49);
    box-shadow: 0 4px 12px rgba(255, 203, 49, 0.2);
}

.progress-fill-gradient {
    background: linear-gradient(90deg, #22c55e 0%, #0dcaf0 100%);
    box-shadow: 0 0 8px rgba(13, 202, 240, 0.5);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.server-icon-box {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.2) 0%, rgba(13, 202, 240, 0.1) 100%);
    border-radius: 10px;
    border: 1px solid rgba(13, 202, 240, 0.3);
}

.server-connect-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.player-count-cell {
    min-width: 150px;
}

.player-count-badge {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.2) 0%, rgba(13, 202, 240, 0.1) 100%);
    border: 1px solid rgba(13, 202, 240, 0.3);
    font-size: 0.9rem;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
}

.player-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    width: 100px;
}

.player-progress .progress-bar {
    transition: width 0.3s ease;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid;
    transition: all 0.2s ease;
}

.status-indicator-online {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
    border-color: rgba(34, 197, 94, 0.4);
}

.status-indicator-offline {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    border-color: rgba(239, 68, 68, 0.4);
}

/* 5-column grid for XXL screens */
@media (min-width: 1400px) {
    .col-xxl-2-4 {
        flex: 0 0 auto;
        width: 20%;
    }
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .server-image-wrapper {
        height: 120px;
    }
}

@media (max-width: 575px) {
    .server-ip-code {
        font-size: 0.75rem !important;
    }
    
    .connect-btn {
        padding: 0.4rem 0.625rem;
        font-size: 0.75rem !important;
    }
}

/* ========================================
   Server Dropdown Menu
   ======================================== */

.server-dropdown-menu {
    background: rgba(15, 22, 33, 0.7) !important;
    backdrop-filter: blur(2px) !important;
}

.server-dropdown-item {
    background: transparent !important;
}

.server-dropdown-item:hover {
    background: rgba(31, 41, 54, 0.8) !important;
    transition: ease-in-out;
}

.server-dropdown-span {
    line-height: 1.2 !important;
}

/* ========================================
   Server Table - Glassy Design
   ======================================== */

.server-table-glassy {
    background: rgba(15, 22, 33, 0.6) !important;
    backdrop-filter: blur(10px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 !important;
}

.server-table-glassy:hover {
    border-color: rgba(13, 202, 240, 0.3) !important;
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45), 0 0 20px rgba(13, 202, 240, 0.1) !important;
}

.server-table-header {
    background: rgba(13, 202, 240, 0.12) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(13, 202, 240, 0.3) !important;
}

.server-table-row {
    transition: all 0.2s ease !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: transparent !important;
}

.server-table-row:hover {
    background: rgba(13, 202, 240, 0.08) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

.server-table {
    --bs-table-bg: transparent !important;
    --bs-table-hover-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-active-bg: transparent !important;
    --bs-table-border-color: transparent !important;
    margin-bottom: 0 !important;
    border: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ========================================
   Servers List (home page) — two-column row cards
   ======================================== */

/* Bootstrap has no min-width:0 utility; flex children need it to truncate. */
.servers-min0 {
    min-width: 0;
}

.servers-row {
    overflow: hidden;
}

.servers-row:hover {
    transform: translateY(-2px);
}

/* Full-bleed map art down the left edge of the card. Scales with the card the
   row sits in — a full-width detail card earns more art than a half-width one. */
.servers-media {
    position: relative;
    width: clamp(100px, 20%, 200px);
    flex-shrink: 0;
    overflow: hidden;
    /* Fade the art out instead of painting an opaque gradient over it — the card
       surface is translucent, so masking blends into whatever shows through. */
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 35%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 35%, transparent 100%);
}

.servers-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.62) contrast(1.05);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.servers-row:hover .servers-media img {
    transform: scale(1.08);
    filter: brightness(0.78) contrast(1.05);
}

.servers-count {
    min-width: 4.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Compact the shared score badges when they ride along on the map row. */
.servers-rounds .score-badge {
    min-width: 1.35rem;
    padding: 0.1rem 0.35rem;
}

.servers-count:not(:disabled):hover {
    transform: scale(1.06);
}

.servers-count:disabled {
    cursor: default;
}

/* A server with people on it must be unmistakable; an empty one recedes
   without ever disappearing; offline recedes further. */
.servers-live {
    border-color: rgba(25, 238, 25, 0.45) !important;
}

.servers-live:hover {
    border-color: rgba(25, 238, 25, 0.75) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 22px rgba(25, 238, 25, 0.18) !important;
}

.servers-idle {
    opacity: 0.72;
}

.servers-idle:hover,
.servers-offline:hover {
    opacity: 1;
}

.servers-offline {
    opacity: 0.45;
}

.servers-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.servers-dot-on {
    background: rgb(25, 238, 25);
    box-shadow: 0 0 8px rgba(25, 238, 25, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

/* Online but empty — reachable, just nobody there. Never green. */
.servers-dot-idle {
    background: rgba(13, 202, 240, 0.75);
    box-shadow: 0 0 6px rgba(13, 202, 240, 0.45);
}

.servers-dot-off {
    background: rgb(255, 19, 19);
    box-shadow: 0 0 8px rgba(255, 19, 19, 0.6);
}

/* Occupancy bar sits directly under the player count it describes. */
.servers-meter {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.servers-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, rgb(25, 238, 25) 0%, #0dcaf0 100%);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.servers-meter-fill-idle {
    background: rgba(255, 255, 255, 0.14);
}

/* ---- Servers header stats banner. ---- */

/* Caption sizing comes from Bootstrap .small on the element; the colour is the
   stat's own accent, so the label ties back to its icon tile. */
.sstat-caption {
    text-transform: uppercase;
    letter-spacing: 0.07em;
    line-height: 1;
}

/* Date qualifier inside a caption — neutral and untracked so it reads as an
   aside rather than part of the coloured label. */
.sstat-sub {
    color: rgba(255, 255, 255, 0.5);
    text-transform: none;
    letter-spacing: normal;
}

.sstat-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
}

.sstat-tile-success { background: rgba(25, 238, 25, 0.16); }
.sstat-tile-info { background: rgba(13, 202, 240, 0.16); }
.sstat-tile-warning { background: rgba(255, 203, 49, 0.16); }
.sstat-tile-muted { background: rgba(255, 255, 255, 0.08); }

.sstat-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem 1.5rem;
    padding: 0.8rem 1.15rem;
    border-radius: 0.75rem;
    background: rgba(15, 22, 33, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

/* Phones: one element per line. Bootstrap utilities on these nodes carry
   !important, so the overrides have to as well. */
@media (max-width: 767.98px) {
    .servers-row {
        flex-direction: column;
    }

    /* Map art becomes a top banner, so the fade has to run downward instead. */
    .servers-media {
        width: 100%;
        height: 84px;
        -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 100%);
        mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 100%);
    }

    .servers-body {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .servers-maprow {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .servers-rounds {
        margin-left: 0 !important;
    }

    .servers-count {
        width: 100%;
    }

    .servers-connect {
        width: 100%;
    }
}

/* ---- Server detail page: spec-sheet layout, deliberately unlike the list card. ---- */
.sdetail-map {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Side by side from md up, so the art matches the spec column instead of
   being sized by its own ratio. */
@media (min-width: 768px) {
    .sdetail-map {
        aspect-ratio: auto;
        height: 100%;
    }
}

/* Display-scale page title; no Bootstrap step lands between fs-1 and fs-2 here. */
.sdetail-title {
    font-size: 1.9rem;
    line-height: 1.15;
    word-break: break-word;
}

.sdetail-copy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 32rem;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 22, 33, 0.6);
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sdetail-copy:hover {
    border-color: rgba(13, 202, 240, 0.5);
    background: rgba(15, 22, 33, 0.8);
}

.sdetail-copy code {
    /* Overflow rather than wrap: an address split across lines is unreadable. */
    min-width: 0;
    background: none;
    padding: 0;
}

@media (max-width: 575.98px) {
    .sdetail-title {
        font-size: 1.4rem;
    }
}

/* Scoped to this table — .ranks-td is shared by every data table in the app. */
.sdetail-players th:first-child,
.sdetail-players td:first-child {
    padding-left: 1.25rem;
}

.sdetail-players th:last-child,
.sdetail-players td:last-child {
    padding-right: 1.25rem;
}

/* Divider between the populated block and everything else. */
.servers-group {
    color: rgba(255, 255, 255, 0.45);
    margin: 0.25rem 0 0.75rem;
}

.servers-group-live {
    color: rgb(25, 238, 25);
}

.servers-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.servers-group-live .servers-group-count {
    background: rgba(25, 238, 25, 0.15);
    border-color: rgba(25, 238, 25, 0.4);
}

.servers-group-rule {
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent);
}

.servers-group-live .servers-group-rule {
    background: linear-gradient(90deg, rgba(25, 238, 25, 0.4), transparent);
}

.servers-row-clickable {
    cursor: pointer;
}

.servers-row-clickable:focus-visible {
    outline: none;
    border-color: rgba(13, 202, 240, 0.7) !important;
    box-shadow: 0 0 0 3px rgba(13, 202, 240, 0.15) !important;
}

/* ---- Hourly occupancy chart (server detail page) ---- */

.servers-preset-btn {
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
    background: rgba(13, 202, 240, 0.08);
    border: 1px solid rgba(13, 202, 240, 0.3);
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.servers-preset-btn:hover:not(:disabled) {
    background: rgba(13, 202, 240, 0.16);
    border-color: rgba(13, 202, 240, 0.5);
    color: #fff;
}

.servers-preset-btn.active {
    background: rgba(13, 202, 240, 0.22);
    border-color: #0dcaf0;
    color: #0dcaf0;
}

.servers-preset-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Occupancy charts. The curve is SVG but every label stays DOM text — text inside
   the stretched viewBox is what distorted on the first attempt at this. */
.servers-chart {
    display: grid;
    grid-template-columns: 2.75rem 1fr;
    gap: 0.5rem;
    /* Top-aligned so the axis tracks the plot; end-aligned it follows the hour
       labels and scrollbar instead, dropping the 0 tick below the baseline. */
    align-items: start;
}

.servers-chart-yaxis {
    position: relative;
    height: 200px;
}

.servers-chart-ytick {
    position: absolute;
    right: 0;
    transform: translateY(50%);
    white-space: nowrap;
}

.servers-chart-plot {
    position: relative;
    height: 200px;
}

.servers-chart-grid {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* The curve is stretched to the plot box, so the stroke has to opt out of scaling
   or it renders thick horizontally and thin vertically. */
.servers-chart-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.servers-chart-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.servers-chart-points {
    position: absolute;
    inset: 0;
    /* A dot or peak label at the very edge must not widen the scroll area. */
    overflow: hidden;
}

/* Full-height hover target, already clamped inside the plot by the component. */
.servers-chart-hit {
    position: absolute;
    top: 0;
    bottom: 0;
}

.servers-chart-dot {
    position: absolute;
    left: 50%;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 202, 240, 0.25);
    transform: translate(-50%, 50%);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.servers-chart-hit:hover .servers-chart-dot {
    opacity: 1;
}

/* Glass tooltip. `translate` carries the offsets rather than `transform` so the
   edge and below variants can each override one axis without restating both. */
.servers-chart-tip {
    --tip-x: -50%;
    --tip-y: 0;
    position: absolute;
    left: 50%;
    z-index: 2;
    min-width: 7.5rem;
    margin-bottom: 0.9rem;
    padding: 0.45rem 0.6rem;
    translate: var(--tip-x) var(--tip-y);
    background: rgba(15, 22, 33, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.6rem;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.servers-chart-hit:hover .servers-chart-tip {
    opacity: 1;
}

.servers-chart-tip-below {
    --tip-y: calc(100% + 1.8rem);
}

.servers-chart-tip-start {
    --tip-x: 0;
    left: 0;
}

.servers-chart-tip-end {
    --tip-x: 0;
    left: auto;
    right: 0;
}

.servers-chart-tip-title {
    line-height: 1.2;
    white-space: nowrap;
}

.servers-chart-tip-row {
    margin-top: 0.25rem;
    line-height: 1.2;
    white-space: nowrap;
}

.servers-chart-tip-swatch {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 2px;
    background: #0dcaf0;
    flex: 0 0 auto;
}

.servers-chart-legend-swatch {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(13, 202, 240, 0.95) 0%, rgba(13, 202, 240, 0.25) 100%);
}

.servers-chart-hours {
    display: flex;
    gap: 2px;
    margin-top: 0.4rem;
}

.servers-chart-hour {
    flex: 1 1 0;
    text-align: center;
    white-space: nowrap;
}

/* The plot scrolls sideways rather than crushing labels together — on phones for
   any bucket count, on desktop only once a long range outgrows the container. */
.servers-chart-scroll {
    overflow-x: auto;
    /* A dot sitting on the baseline hangs half below it; clip rather than scroll. */
    overflow-y: hidden;
    overscroll-behavior-x: contain;
}

/* The plot never grows past this, so any container at least this wide shows the whole
   range and only phones scroll. Long ranges thin their axis labels instead of widening. */
.servers-chart-plot,
.servers-chart-hours {
    min-width: 620px;
}

/* Opens on the newest bucket when it does scroll. `rtl` on the scroller alone flips
   the initial scroll position; the content restores `ltr` so nothing else changes. */
.servers-chart-scroll-end {
    direction: rtl;
}

.servers-chart-scroll-end > * {
    direction: ltr;
}
