/* ── Game Night Session ── */

.gn-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
}

.gn-heading {
    font-family: 'Cabin Sketch', cursive;
    font-size: 2.2rem;
    text-align: center;
    background: linear-gradient(135deg, #ff6b9d, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gn-subtext {
    color: var(--muted, #9d8fb5);
    font-size: 0.9rem;
    text-align: center;
}

.gn-room-code {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted, #9d8fb5);
}

.gn-room-code .code {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.6rem;
    color: var(--text, #f0e6ff);
    letter-spacing: 0.15em;
}

.gn-copy-btn {
    background: transparent;
    border: 1px solid var(--border, #3d2b5f);
    color: var(--muted, #9d8fb5);
    border-radius: 8px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.gn-copy-btn:hover {
    border-color: var(--text, #f0e6ff);
    color: var(--text, #f0e6ff);
}

/* Section */
.gn-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gn-section-title {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.2rem;
    color: var(--text, #f0e6ff);
}

/* Player list */
.gn-player-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.gn-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: var(--surface, #2a1a4a);
    border: 1px solid var(--border, #3d2b5f);
    border-radius: 10px;
}

.gn-player.me {
    border-color: #a855f7;
}

.gn-player-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.gn-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.gn-badge.host {
    background: rgba(255, 107, 157, 0.2);
    color: #ff6b9d;
}

.gn-badge.you {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.gn-kick-btn {
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: rgba(255, 100, 100, 0.7);
    border-radius: 8px;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    cursor: pointer;
}

.gn-kick-btn:hover {
    background: rgba(255, 100, 100, 0.15);
}

/* Game picker */
.gn-game-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.gn-game-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.8rem;
    background: var(--surface, #2a1a4a);
    border: 2px solid var(--border, #3d2b5f);
    border-radius: 12px;
    color: var(--text, #f0e6ff);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.gn-game-chip:hover:not(:disabled) {
    border-color: #a855f7;
}

.gn-game-chip.selected {
    border-color: #ff6b9d;
    background: rgba(255, 107, 157, 0.1);
}

.gn-game-chip:disabled {
    opacity: 0.6;
    cursor: default;
}

.gn-game-chip.insufficient {
    opacity: 0.4;
    border-style: dashed;
}

.gn-chip-min {
    position: absolute;
    top: -6px;
    right: -6px;
    padding: 0 5px;
    height: 18px;
    background: var(--muted, #9d8fb5);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.gn-chip-order {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ff6b9d;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.gn-chip-icon {
    width: 1.2rem;
    height: 1.2rem;
    object-fit: contain;
    border-radius: 3px;
}

.gn-scoreboard-icon {
    width: 1.4rem;
    height: 1.4rem;
    object-fit: contain;
    border-radius: 3px;
    vertical-align: middle;
}

/* Playlist order */
.gn-playlist-order {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}

.gn-playlist-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    background: rgba(168, 85, 247, 0.08);
    border-radius: 8px;
    font-size: 0.88rem;
}

.gn-playlist-num {
    width: 22px;
    height: 22px;
    background: rgba(168, 85, 247, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #a855f7;
    flex-shrink: 0;
}

.gn-remove-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: rgba(255, 100, 100, 0.6);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem;
}

.gn-remove-btn:hover {
    color: #ff6464;
}

/* Buttons */
.gn-btn-primary {
    background: linear-gradient(135deg, #ff6b9d, #e8507a);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Cabin Sketch', cursive;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    width: 100%;
    max-width: 320px;
}

.gn-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.gn-btn-primary:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.gn-btn-secondary {
    background: transparent;
    border: 1px solid var(--border, #3d2b5f);
    color: var(--muted, #9d8fb5);
    border-radius: 12px;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.gn-btn-secondary:hover {
    border-color: var(--text, #f0e6ff);
    color: var(--text, #f0e6ff);
}

.gn-btn-row {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.gn-info-box {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid var(--border, #3d2b5f);
    border-radius: 10px;
    padding: 0.8rem 1.2rem;
    color: var(--muted, #9d8fb5);
    font-size: 0.88rem;
    text-align: center;
    width: 100%;
}

.gn-waiting {
    color: var(--muted, #9d8fb5);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem 0;
}

/* Loading */
.gn-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 60vh;
    color: var(--muted, #9d8fb5);
}

.gn-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border, #3d2b5f);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: gn-spin 0.8s linear infinite;
}

@keyframes gn-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gn-spinner {
        animation-duration: 0.001ms;
        animation-iteration-count: 1;
    }
}

/* In-game state */
.gn-ingame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 0;
}

/* Scoreboard */
.gn-winner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem 0;
}

.gn-trophy {
    font-size: 3rem;
}

.gn-winner-name {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.8rem;
    color: var(--text, #f0e6ff);
}

.gn-winner-label {
    color: #ff6b9d;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.gn-progress {
    color: var(--muted, #9d8fb5);
    font-size: 0.85rem;
    text-align: center;
}

.gn-leaderboard {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.gn-leaderboard thead th {
    color: var(--muted, #9d8fb5);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border, #3d2b5f);
    text-align: center;
}

.gn-leaderboard thead th:nth-child(2) {
    text-align: left;
}

.gn-leaderboard tbody td {
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid rgba(61, 43, 95, 0.4);
    text-align: center;
}

.gn-leaderboard tbody td:nth-child(2) {
    text-align: left;
}

.gn-you-row {
    background: rgba(168, 85, 247, 0.08);
}

.gn-rank {
    font-size: 1.1rem;
}

.gn-player-name-cell {
    font-weight: 700;
}

.gn-game-col {
    font-size: 1rem !important;
    min-width: 2.5rem;
}

.gn-score-cell .gn-score-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
}

.gn-score-badge.s0 {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted, #9d8fb5);
}

.gn-score-badge.s1 {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
}

.gn-score-badge.s2 {
    background: rgba(255, 230, 109, 0.2);
    color: #ffe66d;
}

.gn-score-badge.s3 {
    background: rgba(255, 107, 157, 0.2);
    color: #ff6b9d;
}

.gn-total {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.3rem !important;
    font-weight: 700;
    color: var(--text, #f0e6ff);
}

/* End Game Night button */
.gn-end-night-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.7rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}

.gn-end-night-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Game winner highlight in scoreboard */
.gn-game-winner {
    color: var(--yellow, #ffe66d);
    font-weight: 700;
    font-size: 1.1rem;
}

.gn-game-dash {
    color: var(--border, #3d2b5f);
    font-weight: 400;
}

.gn-wins-col {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.2rem;
}

/* Return button (used in GameOverViews) */
.gn-return-btn {
    background: var(--surface, #2a1a4a);
    color: var(--text, #f0e6ff);
    border: 1px solid var(--border, #3d2b5f);
    border-radius: 10px;
    padding: 0.7rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    display: inline-block;
}

.gn-return-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Home page session banner */
.gn-session-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin: 1rem 0;
}

.gn-session-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gn-session-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.gn-session-banner-title {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.2rem;
    color: var(--text, #f0e6ff);
    margin: 0;
}

.gn-session-banner-desc {
    font-size: 0.85rem;
    color: var(--muted, #9d8fb5);
    margin: 0.2rem 0 0;
    line-height: 1.4;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .gn-container {
        padding: 1.5rem 1rem;
    }

    .gn-heading {
        font-size: 1.6rem;
    }

    .gn-game-picker {
        grid-template-columns: repeat(2, 1fr);
    }

    .gn-leaderboard {
        font-size: 0.8rem;
    }

    .gn-game-col {
        min-width: 2rem;
    }

    .gn-session-banner {
        flex-direction: column;
        text-align: center;
    }

    .gn-session-banner-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Touch targets — kick button */
    .gn-kick-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    /* Action buttons — 44px minimum height */
    .gn-btn-primary,
    .gn-btn-secondary {
        min-height: 44px;
    }

    /* Game chips — 44px minimum height for touch */
    .gn-game-chip {
        min-height: 44px;
    }

    /* Single-column layout for session lobby */
    .gn-btn-row {
        flex-direction: column;
        align-items: stretch;
        max-width: none;
    }

    .gn-btn-row .gn-btn-primary,
    .gn-btn-row .gn-btn-secondary {
        max-width: none;
        text-align: center;
    }
}