.lobby-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.lobby-welcome {
    margin-bottom: 2rem;
}

.lobby-welcome h1 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin-bottom: 0.25rem;
}

/* ============================================================
   SECTIONS
============================================================ */
.lobby-section {
    margin-bottom: 2rem;
}

.section-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* ============================================================
   LOBBY GRID
============================================================ */
.lobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 0;
}

.lobby-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.8rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.lobby-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-3px);
}

.lobby-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.lobby-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.lobby-card p {
    font-size: 0.82rem;
}

.mode-card.selected {
    border-color: var(--accent-gold);
    background: rgba(201, 168, 76, 0.08);
}

/* ============================================================
   MATCHMAKING STATUS
============================================================ */
.matchmaking-status {
    background: var(--bg-panel);
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    display: none;
}

.matchmaking-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.matchmaking-status h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* ============================================================
   CODE PANEL
============================================================ */
.code-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.8rem;
    margin-bottom: 2rem;
    display: none;
}

.code-panel h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.code-input-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.code-input-row input {
    flex: 1;
    min-width: 160px;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s;
}

.code-input-row input:focus {
    border-color: var(--accent-gold);
}

.code-display {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin-top: 1rem;
}

.code-display p {
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.code-display .game-code {
    font-family: 'Cinzel', 'Courier New', monospace;
    font-size: 2rem;
    color: var(--accent-gold);
    letter-spacing: 6px;
}

.cancel-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 0.75rem;
    text-decoration: underline;
    font-family: 'Nunito', sans-serif;
}

.cancel-btn:hover {
    color: var(--text-primary);
}

/* ============================================================
   LIVE INFO
============================================================ */
.live-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.live-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

.live-panel-header {
    background: var(--bg-secondary);
    padding: 0.9rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.live-panel-header h3 {
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--card-upgrade);
    animation: pulse 2s infinite;
}

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

.live-panel-body {
    padding: 1rem 1.2rem;
}

.live-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.88rem;
}

.live-stat:last-child {
    border-bottom: none;
}

.live-stat-value {
    color: var(--accent-gold);
    font-family: 'Cinzel', serif;
    font-size: 1rem;
}

.live-empty {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0;
}

.player-slot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 1rem;
}

.player-slot {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: linear-gradient(145deg, rgba(30, 36, 56, 0.8), rgba(26, 31, 53, 0.8));
    min-height: 48px;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

/* Filled slot */
.player-slot.filled {
    border-color: rgba(242, 193, 78, 0.3);
    background: linear-gradient(145deg, rgba(242, 193, 78, 0.06), rgba(30, 36, 56, 0.9));
}

/* Empty slot */
.player-slot.empty {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.1);
    opacity: 0.75;
}

.slot-icon {
    font-size: 0.95rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.slot-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-slot.empty .slot-name {
    color: var(--text-secondary);
    font-weight: 400;
}

/* "You" badge */
.slot-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-gold);
    background: rgba(242, 193, 78, 0.12);
    border: 1px solid rgba(242, 193, 78, 0.25);
    border-radius: 4px;
    padding: 1px 6px;
    flex-shrink: 0;
}

/* Invite button inside empty slot */
.slot-invite-btn {
    margin-left: auto;
    flex-shrink: 0;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(242, 193, 78, 0.35);
    background: rgba(242, 193, 78, 0.1);
    color: var(--accent-gold);
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.slot-invite-btn:hover {
    background: rgba(242, 193, 78, 0.2);
}

/* ============================================================
   PLAYER SLOT GRID — add to lobby.css
   ============================================================ */

.player-slot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 1rem;
}

.player-slot {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: linear-gradient(145deg, rgba(30, 36, 56, 0.8), rgba(26, 31, 53, 0.8));
    min-height: 48px;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

/* Filled slot */
.player-slot.filled {
    border-color: rgba(242, 193, 78, 0.3);
    background: linear-gradient(145deg, rgba(242, 193, 78, 0.06), rgba(30, 36, 56, 0.9));
}

/* Empty slot */
.player-slot.empty {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.1);
    opacity: 0.75;
}

.slot-icon {
    font-size: 0.95rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.slot-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-slot.empty .slot-name {
    color: var(--text-secondary);
    font-weight: 400;
}

/* "You" badge */
.slot-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-gold);
    background: rgba(242, 193, 78, 0.12);
    border: 1px solid rgba(242, 193, 78, 0.25);
    border-radius: 4px;
    padding: 1px 6px;
    flex-shrink: 0;
}

/* Invite button inside empty slot */
.slot-invite-btn {
    margin-left: auto;
    flex-shrink: 0;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(242, 193, 78, 0.35);
    background: rgba(242, 193, 78, 0.1);
    color: var(--accent-gold);
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.slot-invite-btn:hover {
    background: rgba(242, 193, 78, 0.2);
}

/* ── Host Game timer selector ──────────────────────────────── */
.host-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    width: 100%;
    justify-content: center;
}

.host-options label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.host-options select {
    background: rgba(10, 13, 28, 0.7);
    border: 1px solid rgba(242, 193, 78, 0.3);
    color: var(--accent-gold);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.host-options select:focus {
    border-color: rgba(242, 193, 78, 0.6);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 600px) {
    .lobby-grid {
        grid-template-columns: 1fr;
    }

    .lobby-card {
        padding: 1.2rem 1rem;
        display: flex;
        align-items: center;
        text-align: left;
        gap: 1rem;
    }

    .lobby-card-icon {
        font-size: 2rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .lobby-card h3 {
        margin-bottom: 0.2rem;
    }
}.slot-badge-spectator { color: #a0a8cc; background: rgba(160,168,204,0.1); border-color: rgba(160,168,204,0.25); text-transform: none; font-weight: 600; }
