@keyframes holographicShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.game-details-content {
    padding: 8px;
}

/* Placeholder cards shown while the first game loads: they hold the positions
   of the header card and the players section so the left-to-right glance
   sweeps over a full layout instead of collapsing to a thin line. */
.game-details-content .game-skeleton-card {
    min-height: 200px;
}

.game-details-content .players-section.game-skeleton-card {
    min-height: 320px;
}

.game-details-content .game-header-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2), 0 0 0 1px rgba(0,255,204,0.1);
}

.game-details-content .game-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    min-height: 44px;
}

.game-details-content .game-info-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    flex: 0 0 auto;
}

.game-details-content .game-id {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(145deg, rgba(0,255,204,0.1), rgba(0,255,204,0.05));
    border: 1px solid rgba(0,255,204,0.3);
    border-radius: 12px;
    color: #00ffcc;
    font-weight: 600;
    font-size: 14px;
}

/* "Crash" label + multiplier, centered in the header row. */
.game-details-content .game-header-right {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.game-details-content .game-crash-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

.game-details-content .game-multiplier {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    background: linear-gradient(267deg, #00ffcc 0%, #00d4aa 25%, #4ecdc4 50%, #00ffcc 75%, #00d4aa 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holographicShift 3s ease-in-out infinite;
}

/* Scroll the full-page overlay instead of the centered modal, so the
   scrollbar sits on the right edge of the page. */
.game-details-overlay {
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Keep the modal box within the viewport: without border-box the horizontal
   padding of the body/content widens the box past 100% and clips the header
   card on narrow screens. */
.game-details-modal,
.game-details-modal .user-profile-modal-body,
.game-details-content {
    box-sizing: border-box;
}

.game-details-modal .user-profile-modal-body {
    max-width: 100%;
}

.game-details-overlay .game-details-modal {
    max-height: none;
    overflow: visible;
    margin: auto;
}

/* Close button sits inside the game-header-card, a little off the corner,
   matching the /user/:username modal. */
.game-details-modal .user-profile-modal-close {
    top: 30px;
    right: 40px;
}

/* Prev / Next round navigation: Previous on the left, timestamp centered,
   Next on the right. */
.game-details-content .game-header-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    margin-bottom: 8px;
    gap: 12px;
}

.game-details-content .game-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    color: #e6e8ee;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.game-details-content .game-pagination-btn:hover {
    background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.1));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    color: #fff;
}

/* Latest round: Next is shown but greyed out and not clickable. */
.game-details-content .game-pagination-btn--disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.game-details-content .game-timestamp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    width: fit-content;
}

.game-details-content .game-timestamp i {
    color: #00ffcc;
    font-size: 13px;
}

.game-details-content .game-timestamp-date {
    color: #fff;
    font-weight: 500;
}

.game-details-content .game-timestamp-sep {
    color: rgba(255,255,255,0.35);
}

.game-details-content .game-timestamp-ago {
    color: rgba(255,255,255,0.55);
}

/* Header summary stats: 1px rule above, 4 columns split by 1px rules */
.game-details-content .game-header-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: relative;
    margin-top: 24px;
    padding-top: 20px;
}

.game-details-content .game-header-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.28) 50%, rgba(255,255,255,0) 100%);
}

.game-details-content .game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 0 24px;
    position: relative;
}

.game-details-content .game-stat:first-child {
    padding-left: 0;
}

.game-details-content .game-stat:last-child {
    padding-right: 0;
}

.game-details-content .game-stat + .game-stat::before {
    content: '';
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.28) 50%, rgba(255,255,255,0) 100%);
}

.game-details-content .game-stat-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

.game-details-content .game-stat-value {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.game-details-content .game-stat-pos {
    color: #00ffcc;
}

.game-details-content .game-stat-neg {
    color: #ff6b6b;
}

.game-details-content .players-section {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

/* The popup cards stay flat: no accent line on the players section and no
   hover lift on the header card, matching the other popups. */
.game-details-content .players-section::before {
    content: none;
}

.game-details-content .game-header-card:hover {
    transform: translateZ(0);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2),
        0 0 0 1px rgba(0,255,204,0.1);
}

/* Section heading with the same green accent bar used on /user/:username */
.game-details-content .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px 0;
}

.game-details-content .section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #00ffcc, #00d4aa);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
}

.game-details-content .players-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.game-details-content .players-table thead {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
}

.game-details-content .players-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.game-details-content .players-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}

.game-details-content .players-table tbody tr:hover {
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.game-details-content .player-name {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.game-details-content .player-name:hover {
    color: #00ffcc;
    text-shadow: 0 0 8px rgba(0,255,204,0.5);
}

.game-details-content .bet-amount {
    font-family: 'Monaco', 'Menlo', monospace;
    color: #959ba1;
}

.game-details-content .cash-out-win { color: #02fac8; }
.game-details-content .cash-out-lose { color: #ff6b6b; }
.game-details-content .profit-positive { color: #02fac8; font-family: 'Monaco','Menlo',monospace; }
.game-details-content .profit-negative { color: #ff6b6b; font-family: 'Monaco','Menlo',monospace; }

.game-details-content .players-table tbody tr.lose {
    background: linear-gradient(145deg, rgba(239,68,68,0.05), rgba(239,68,68,0.02));
    border-left: 3px solid rgba(239,68,68,0.3);
}

.game-details-content .hash-section {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 24px;
}

.game-details-content .hash-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-details-content .hash-value {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 16px;
    font-family: 'Monaco','Menlo',monospace;
    font-size: 12px;
    color: #949494;
    text-align: center;
    word-break: break-all;
    line-height: 1.5;
}

.game-details-content .hash-link {
    color: #00ffcc;
    text-decoration: none;
}

.game-details-content .hash-link:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(0,255,204,0.5);
}

/* Horizontal scroll wrapper so every players column stays visible on narrow
   screens instead of being dropped. */
.game-details-content .players-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.game-details-content .players-table-scroll .players-table {
    min-width: 560px;
    width: 100%;
}

@media (max-width: 640px) {
    .game-details-overlay {
        padding: 0;
        padding-top: 44px;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .game-details-overlay .game-details-modal {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 16px 16px 16px 16px;
    }

    .game-details-modal .user-profile-modal-body {
        padding-top: 24px;
    }

    .game-details-modal .user-profile-modal-close {
        top: 44px;
        right: 40px;
    }

    .game-details-content .game-header-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .game-details-content .game-info-left {
        align-items: center;
    }

    .game-details-content .game-header-right {
        position: static;
        transform: none;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .game-details-content .game-header-stats {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 18px;
    }

    .game-details-content .game-stat {
        padding: 0 12px;
    }

    .game-details-content .game-stat:nth-child(odd) {
        padding-left: 0;
    }

    .game-details-content .game-stat:nth-child(even) {
        padding-right: 0;
    }

    .game-details-content .game-stat:nth-child(odd)::before {
        display: none;
    }

    /* Prev / Next drop below the timestamp: Previous left, Next right. */
    .game-details-content .game-header-pager {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .game-details-content .game-timestamp {
        order: 1;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 8px;
    }

    .game-details-content .game-header-pager > .game-pagination-btn:first-child {
        order: 2;
    }

    .game-details-content .game-header-pager > .game-pagination-btn:last-child {
        order: 3;
    }
}
