/* Styles spécifiques au jeu Puissance 4 */ 

/* Grille de jeu - Style Néon Cyberpunk Intense */
.game-grid-container {
    background: linear-gradient(180deg, rgba(0,20,60,0.95) 0%, rgba(0,10,40,0.98) 100%);
    border: 4px solid rgba(0,212,255,1);
    border-radius: 20px;
    padding: 15px;
    padding-bottom: 20px;
    margin-bottom: 10px;
    box-shadow:
        0 0 30px rgba(0,212,255,0.8),
        0 0 60px rgba(0,212,255,0.5),
        0 0 100px rgba(0,212,255,0.3),
        0 30px 80px rgba(0,0,0,0.9),
        inset 0 0 50px rgba(0,212,255,0.1);
    position: relative;
    backdrop-filter: blur(10px);
}

.game-grid-container::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: rgba(0,212,255,0.4);
    border-radius: 32px;
    z-index: -1;
    filter: blur(12px);
    animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.connect-four-grid {
    display: grid;
    grid-template-columns: repeat(7, 62px);
    grid-template-rows: repeat(6, 62px);
    gap: 10px;
    background: linear-gradient(180deg, rgba(0,10,40,0.6) 0%, rgba(0,5,30,0.8) 100%);
    padding: 15px;
    border-radius: 20px;
    border: 3px solid rgba(0,212,255,0.4);
    width: fit-content;
    margin: 0 auto;
    position: relative;
    box-shadow:
        inset 0 8px 30px rgba(0,0,0,0.7),
        inset 0 0 60px rgba(0,212,255,0.15),
        0 0 30px rgba(0,212,255,0.2);
}

.grid-cell {
    aspect-ratio: 1;
    background: radial-gradient(circle at 50% 50%, rgba(0,5,20,1) 0%, rgba(0,10,30,1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow:
        inset 0 8px 25px rgba(0,0,0,0.95),
        inset 0 -4px 15px rgba(0,212,255,0.2),
        0 0 15px rgba(0,212,255,0.4),
        0 3px 8px rgba(0,0,0,0.6);
    position: relative;
    border: 3px solid rgba(0,212,255,0.6);
}

.grid-cell::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 30%;
    height: 20%;
    background: radial-gradient(ellipse, rgba(0,212,255,0.15) 0%, transparent 100%);
    border-radius: 50%;
}

.grid-cell:hover:not(.filled) {
    background: radial-gradient(circle at 50% 50%, rgba(0,10,30,1) 0%, rgba(0,15,40,1) 100%);
    box-shadow:
        inset 0 8px 25px rgba(0,0,0,0.95),
        inset 0 -4px 15px rgba(0,255,255,0.3),
        0 0 25px rgba(0,255,255,0.6),
        0 0 40px rgba(0,255,255,0.3),
        0 3px 8px rgba(0,0,0,0.6);
    border-color: rgba(0,255,255,0.9);
    transform: scale(1.05);
}

.grid-cell.filled {
    cursor: default;
}

/* Jetons Premium */
.token {
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border-radius: 50%;
    position: absolute;
    top: 6px;
    left: 6px;
    --fall-distance: -400px;
    /* GPU acceleration for smooth animation */
    will-change: transform;
    backface-visibility: hidden;
    animation: tokenFall 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes tokenFall {
    0% {
        transform: translateY(var(--fall-distance)) translateZ(0);
    }
    75% {
        transform: translateY(6px) translateZ(0);
    }
    90% {
        transform: translateY(-3px) translateZ(0);
    }
    100% {
        transform: translateY(0) translateZ(0);
    }
}

.token.no-anim {
    animation: none;
    will-change: auto;
}

.token.red {
    background:
        radial-gradient(ellipse 60% 35% at 45% 20%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(ellipse 80% 40% at 50% 85%, rgba(0,0,0,0.5) 0%, transparent 100%),
        radial-gradient(circle at 50% 50%, #ff5555 0%, #ff3333 35%, #dd2222 65%, #aa1111 100%);
    border: 3px solid rgba(255,80,80,0.9);
    box-shadow:
        0 4px 15px rgba(255,60,60,0.6),
        0 0 25px rgba(255,80,80,0.4),
        inset 0 -4px 10px rgba(0,0,0,0.4),
        inset 0 4px 8px rgba(255,255,255,0.25);
}

.token.yellow {
    background:
        radial-gradient(ellipse 60% 35% at 45% 20%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(ellipse 80% 40% at 50% 85%, rgba(0,0,0,0.4) 0%, transparent 100%),
        radial-gradient(circle at 50% 50%, #ffee55 0%, #ffcc33 35%, #ffaa00 65%, #dd8800 100%);
    border: 3px solid rgba(255,220,50,0.9);
    box-shadow:
        0 4px 15px rgba(255,200,50,0.6),
        0 0 25px rgba(255,210,60,0.5),
        inset 0 -4px 10px rgba(0,0,0,0.35),
        inset 0 4px 8px rgba(255,255,255,0.3);
}

.token.winning {
    animation: winningToken 0.6s ease-in-out infinite;
}

@keyframes winningToken {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.12);
        filter: brightness(1.3);
        box-shadow:
            0 6px 30px rgba(255,255,255,0.6),
            0 0 60px rgba(255,255,255,0.5),
            0 0 100px rgba(255,255,255,0.3),
            inset 0 -5px 15px rgba(0,0,0,0.3),
            inset 0 5px 12px rgba(255,255,255,0.4);
    }
}

/* Indicateurs de colonnes - cachés */
.column-indicators {
    display: none;
}

/* Header de jeu */
.game-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
    gap: 20px;
}

/* Pot en haut au centre */
.pot-card-top {
    background: linear-gradient(145deg, rgba(0,50,35,0.95), rgba(0,80,55,0.9));
    border: 2px solid rgba(0,255,136,0.7);
    border-radius: 15px;
    padding: 15px 40px;
    text-align: center;
    backdrop-filter: blur(25px);
    box-shadow:
        0 15px 50px rgba(0,0,0,0.6),
        0 0 60px rgba(0,255,136,0.4),
        0 0 100px rgba(0,255,136,0.2),
        inset 0 2px 0 rgba(255,255,255,0.15),
        inset 0 0 30px rgba(0,255,136,0.1);
    position: relative;
    overflow: hidden;
    animation: potPulse 2s ease-in-out infinite;
}

@keyframes potPulse {
    0%, 100% {
        box-shadow:
            0 15px 50px rgba(0,0,0,0.6),
            0 0 60px rgba(0,255,136,0.4),
            0 0 100px rgba(0,255,136,0.2),
            inset 0 2px 0 rgba(255,255,255,0.15),
            inset 0 0 30px rgba(0,255,136,0.1);
    }
    50% {
        box-shadow:
            0 15px 50px rgba(0,0,0,0.6),
            0 0 80px rgba(0,255,136,0.6),
            0 0 120px rgba(0,255,136,0.3),
            inset 0 2px 0 rgba(255,255,255,0.15),
            inset 0 0 40px rgba(0,255,136,0.15);
    }
}

.pot-card-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2.5s infinite;
}

.pot-card-top::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,255,136,0.1) 0%, transparent 50%);
    animation: rotateBg 8s linear infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bouton retour en haut à droite */
.back-lobby-btn-top {
    position: absolute;
    right: 150px;
    top: 8px;
    background: linear-gradient(145deg, rgba(0,50,80,0.9), rgba(0,30,50,0.9));
    border: 2px solid rgba(0,212,255,0.5);
    color: var(--neon-blue);
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 8px 25px rgba(0,0,0,0.4),
        0 0 20px rgba(0,212,255,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
}

.back-lobby-btn-top:hover {
    transform: translateY(-3px);
    background: linear-gradient(145deg, rgba(0,80,120,0.9), rgba(0,50,80,0.9));
    border-color: var(--neon-blue);
    box-shadow:
        0 12px 35px rgba(0,0,0,0.5),
        0 0 30px rgba(0,212,255,0.4);
    color: white;
}

/* Layout principal du jeu */
.game-layout {
    display: grid;
    grid-template-columns: 220px auto 220px;
    gap: 15px 50px;
    width: fit-content;
    margin: 0 auto;
    margin-top: 10px;
    align-items: center;
}

/* Section joueurs (gauche) */
.players-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.players-section .player-card {
    flex-shrink: 0;
    width: 100%;
}

.players-section .status-message {
    margin: 20px 0;
}

.player-card {
    background: linear-gradient(145deg, rgba(12,12,18,0.9), rgba(25,25,45,0.85));
    border: 2px solid rgba(255,207,64,0.3);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(25px);
    box-shadow:
        0 15px 40px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.2);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.player-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.player-card.player-1 {
    border-color: rgba(255,107,107,0.4);
    background: linear-gradient(145deg, rgba(20,10,10,0.9), rgba(35,20,25,0.85));
}

.player-card.player-1.active {
    border-color: #ff6b6b;
    animation: glowPulseRed 1.5s ease-in-out infinite;
}

.player-card.player-2 {
    border-color: rgba(255,207,64,0.4);
    background: linear-gradient(145deg, rgba(20,18,10,0.9), rgba(35,30,20,0.85));
}

.player-card.player-2.active {
    border-color: var(--neon-gold);
    animation: glowPulseGold 1.5s ease-in-out infinite;
}

@keyframes glowPulseRed {
    0%, 100% {
        box-shadow:
            0 0 25px rgba(255,107,107,0.5),
            0 15px 40px rgba(0,0,0,0.5),
            inset 0 0 30px rgba(255,107,107,0.1);
        border-color: #ff6b6b;
    }
    50% {
        box-shadow:
            0 0 50px rgba(255,107,107,0.8),
            0 0 80px rgba(255,107,107,0.4),
            0 15px 40px rgba(0,0,0,0.5),
            inset 0 0 40px rgba(255,107,107,0.15);
        border-color: #ff9a9a;
    }
}

@keyframes glowPulseGold {
    0%, 100% {
        box-shadow:
            0 0 25px rgba(255,207,64,0.5),
            0 15px 40px rgba(0,0,0,0.5),
            inset 0 0 30px rgba(255,207,64,0.1);
        border-color: var(--neon-gold);
    }
    50% {
        box-shadow:
            0 0 50px rgba(255,207,64,0.8),
            0 0 80px rgba(255,207,64,0.4),
            0 15px 40px rgba(0,0,0,0.5),
            inset 0 0 40px rgba(255,207,64,0.15);
        border-color: #ffe680;
    }
}

.player-avatar {
    font-size: 38px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    transition: transform 0.3s ease;
    position: relative;
    top: -6px;
}

.player-card.active .player-avatar {
    transform: scale(1.1);
}

.player-info {
    text-align: center;
    width: 100%;
}

.player-card .player-name {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    word-break: break-all;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    margin-top: -15px;
    display: flex;
    justify-content: center;
}

/* Stats row on player cards */
.player-stats-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 5px;
}

.player-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.player-stat .stat-icon {
    font-size: 14px;
}

.player-stat .stat-icon-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.player-stat .stat-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

/* Color coding for stats */
.player-card.player-1 .player-stat {
    border-color: rgba(255,107,107,0.3);
}

.player-card.player-2 .player-stat {
    border-color: rgba(255,207,64,0.3);
}

.pot-label {
    font-size: 9px;
    color: rgba(255,255,255,0.8);
    font-weight: 700;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.pot-amount {
    font-family: 'Orbitron', monospace;
    font-size: 26px;
    font-weight: 900;
    color: #00ff88;
    text-shadow:
        0 0 10px rgba(0,255,136,1),
        0 0 30px rgba(0,255,136,0.8),
        0 0 50px rgba(0,255,136,0.6),
        0 0 80px rgba(0,255,136,0.4),
        0 2px 4px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    animation: amountGlow 1.5s ease-in-out infinite alternate;
    letter-spacing: 2px;
}

@keyframes amountGlow {
    0% {
        text-shadow:
            0 0 10px rgba(0,255,136,1),
            0 0 30px rgba(0,255,136,0.8),
            0 0 50px rgba(0,255,136,0.6),
            0 0 80px rgba(0,255,136,0.4),
            0 2px 4px rgba(0,0,0,0.5);
        transform: scale(1);
    }
    100% {
        text-shadow:
            0 0 15px rgba(0,255,136,1),
            0 0 40px rgba(0,255,136,0.9),
            0 0 70px rgba(0,255,136,0.7),
            0 0 100px rgba(0,255,136,0.5),
            0 2px 4px rgba(0,0,0,0.5);
        transform: scale(1.02);
    }
}

/* Section grille (centre) */
.grid-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* Section timer (droite) */
.timer-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.timer-card {
    background: linear-gradient(145deg, rgba(10,15,25,0.9), rgba(20,30,50,0.85));
    border: 2px solid rgba(0,212,255,0.4);
    border-radius: 15px;
    padding: 18px 15px;
    text-align: center;
    backdrop-filter: blur(25px);
    box-shadow:
        0 15px 40px rgba(0,0,0,0.5),
        0 0 30px rgba(0,212,255,0.1),
        inset 0 1px 0 rgba(255,255,255,0.08);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.timer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,212,255,0.4), transparent);
}

.timer-label {
    font-size: 9px;
    color: rgba(255,255,255,0.6);
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-timer {
    font-family: 'Orbitron', monospace;
    font-size: 44px;
    font-weight: 700;
    color: var(--neon-blue);
    text-shadow:
        0 0 30px rgba(0,212,255,0.8),
        0 0 60px rgba(0,212,255,0.4);
    margin-bottom: 12px;
    line-height: 1;
    transition: all 0.3s ease;
}

.game-timer.warning {
    animation: timerPulse 0.5s ease-in-out infinite;
    color: #ff6b6b;
    text-shadow:
        0 0 30px rgba(255,107,107,0.9),
        0 0 60px rgba(255,107,107,0.5);
}

.timer-bar {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0,212,255,0.3);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.timer-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
    border-radius: 10px;
    transition: width 1s linear;
    box-shadow:
        0 0 20px rgba(0,212,255,0.6),
        inset 0 1px 0 rgba(255,255,255,0.3);
    position: relative;
}

.timer-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
    border-radius: 10px 10px 0 0;
}

.timer-progress.warning {
    background: linear-gradient(90deg, #e74c3c, #ff6b6b);
    box-shadow:
        0 0 20px rgba(255,107,107,0.6),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Message de statut */
.status-message {
    text-align: center;
    padding: 10px 14px;
    background: linear-gradient(145deg, rgba(0,30,50,0.8), rgba(0,20,40,0.9));
    border: 2px solid rgba(0,212,255,0.4);
    border-radius: 12px;
    color: var(--neon-blue);
    font-size: 11px;
    font-weight: 700;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow:
        0 8px 25px rgba(0,0,0,0.4),
        0 0 20px rgba(0,212,255,0.15),
        inset 0 1px 0 rgba(255,255,255,0.05);
    text-shadow: 0 0 15px rgba(0,212,255,0.5);
    transition: all 0.3s ease;
}

/* Status message when it's my turn - yellow frame */
.status-message.my-turn {
    border-color: var(--neon-gold);
    background: linear-gradient(145deg, rgba(50,40,0,0.8), rgba(40,30,0,0.9));
    box-shadow:
        0 8px 25px rgba(0,0,0,0.4),
        0 0 25px rgba(255,207,64,0.3),
        inset 0 1px 0 rgba(255,255,255,0.05);
    text-shadow: 0 0 15px rgba(255,207,64,0.5);
}

/* Message de victoire/défaite - EPIC VERSION */
.game-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, rgba(10,10,15,0.98), rgba(26,26,46,0.98));
    border: 3px solid var(--neon-gold);
    border-radius: 25px;
    padding: 30px 45px;
    text-align: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow:
        0 25px 60px rgba(0,0,0,0.9),
        0 0 50px rgba(255,207,64,0.4);
    min-width: 320px;
}

.game-result.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.game-result.win {
    border-color: var(--neon-green);
    box-shadow:
        0 30px 80px rgba(0,0,0,0.9),
        0 0 100px rgba(0,255,136,0.6);
}

.game-result.lose {
    border-color: #ff6b6b;
    box-shadow:
        0 30px 80px rgba(0,0,0,0.9),
        0 0 60px rgba(255,107,107,0.5);
}

/* Transaction status */
.transaction-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px 0;
    padding: 8px 16px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.transaction-status.hidden {
    display: none;
}

.transaction-status.success {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.4);
}

.transaction-status.success .tx-text {
    color: var(--neon-green);
}

.tx-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.transaction-status.success .tx-spinner {
    display: none;
}

.transaction-status.success .tx-text::before {
    content: '✓ ';
    color: var(--neon-green);
}

.tx-text {
    font-size: 12px;
    color: var(--neon-blue);
}

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

/* Confettis pour la victoire */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    border-radius: 30px;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
}

.confetti:nth-child(1) { left: 10%; background: #ff6b6b; animation: confetti-fall 2s linear forwards; animation-delay: 0s; }
.confetti:nth-child(2) { left: 20%; background: #ffcf40; animation: confetti-fall 2.2s linear forwards; animation-delay: 0.1s; }
.confetti:nth-child(3) { left: 30%; background: #00ff88; animation: confetti-fall 1.8s linear forwards; animation-delay: 0.2s; }
.confetti:nth-child(4) { left: 40%; background: #00d4ff; animation: confetti-fall 2.1s linear forwards; animation-delay: 0.15s; }
.confetti:nth-child(5) { left: 50%; background: #bf00ff; animation: confetti-fall 1.9s linear forwards; animation-delay: 0.05s; }
.confetti:nth-child(6) { left: 60%; background: #ff6b6b; animation: confetti-fall 2.3s linear forwards; animation-delay: 0.25s; }
.confetti:nth-child(7) { left: 70%; background: #ffcf40; animation: confetti-fall 2s linear forwards; animation-delay: 0.1s; }
.confetti:nth-child(8) { left: 80%; background: #00ff88; animation: confetti-fall 1.7s linear forwards; animation-delay: 0.2s; }
.confetti:nth-child(9) { left: 90%; background: #00d4ff; animation: confetti-fall 2.4s linear forwards; animation-delay: 0.3s; }
.confetti:nth-child(10) { left: 15%; background: #bf00ff; animation: confetti-fall 2s linear forwards; animation-delay: 0.12s; }
.confetti:nth-child(11) { left: 35%; background: #ff6b6b; animation: confetti-fall 1.9s linear forwards; animation-delay: 0.08s; }
.confetti:nth-child(12) { left: 55%; background: #ffcf40; animation: confetti-fall 2.1s linear forwards; animation-delay: 0.18s; }
.confetti:nth-child(13) { left: 75%; background: #00ff88; animation: confetti-fall 2.2s linear forwards; animation-delay: 0.22s; }
.confetti:nth-child(14) { left: 85%; background: #00d4ff; animation: confetti-fall 1.8s linear forwards; animation-delay: 0.05s; }
.confetti:nth-child(15) { left: 45%; background: #bf00ff; animation: confetti-fall 2s linear forwards; animation-delay: 0.15s; }

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(350px) rotate(720deg); opacity: 0; }
}

.result-icon {
    font-size: 70px;
    margin-bottom: 10px;
    display: block;
}

.result-title {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(45deg, var(--neon-gold), var(--neon-blue));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-title.win {
    background: linear-gradient(45deg, #00ff88, #ffcf40, #00ff88);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-title.lose {
    background: linear-gradient(45deg, #ff6b6b, #e74c3c);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Message motivant */
.result-motivation {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 12px;
    font-style: italic;
}

/* Gains affichés en grand */
.result-amount {
    font-family: 'Orbitron', monospace;
    font-size: 36px;
    font-weight: 900;
    color: var(--neon-green);
    margin: 18px 0;
    text-shadow: 0 0 25px rgba(0,255,136,0.8);
    letter-spacing: 2px;
}

.result-amount.loss {
    color: #ff6b6b;
    text-shadow: 0 0 30px rgba(255,107,107,0.8);
}

/* Streak display */
.result-streak {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,207,64,0.15);
    border: 2px solid rgba(255,207,64,0.4);
    border-radius: 20px;
    padding: 6px 16px;
    margin-bottom: 15px;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: var(--neon-gold);
}

.result-streak .streak-fire {
    font-size: 16px;
}

.result-streak .streak-count {
    font-weight: 700;
    font-size: 15px;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.result-btn {
    border: none;
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 14px 30px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-btn.play-again {
    background: linear-gradient(145deg, #00ff88, #00cc6a);
    color: #000;
    box-shadow: 0 8px 25px rgba(0,255,136,0.4);
    font-size: 14px;
    padding: 15px 35px;
}

.result-btn.play-again:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,255,136,0.6);
}

.result-btn.lobby {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: none;
}

.result-btn.lobby:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

/* ============================================
   MODAL RECHERCHE DE PARTIES
   ============================================ */

.find-game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.find-game-modal.show {
    display: flex;
}

.find-game-content {
    background: linear-gradient(135deg, rgba(10,10,15,0.98), rgba(26,26,46,0.98));
    border: 2px solid rgba(0,212,255,0.3);
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 750px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 20px 50px rgba(0,0,0,0.6),
        0 0 30px rgba(0,212,255,0.2);
}

.find-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.find-game-header .section-title {
    margin: 0;
}

.close-modal-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #ff6b6b;
}

.find-game-content .game-search-container {
    margin-bottom: 15px;
}

.find-game-content .games-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.find-game-footer {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Boutons de la modal */
.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid;
}

.modal-btn .btn-icon {
    font-size: 16px;
}

.modal-btn.refresh {
    background: linear-gradient(145deg, rgba(0,212,255,0.2), rgba(0,212,255,0.1));
    border-color: rgba(0,212,255,0.5);
    color: var(--neon-blue);
}

.modal-btn.refresh:hover {
    background: linear-gradient(145deg, rgba(0,212,255,0.3), rgba(0,212,255,0.2));
    border-color: var(--neon-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,212,255,0.3);
}

.modal-btn.close {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

.modal-btn.close:hover {
    background: linear-gradient(145deg, rgba(255,107,107,0.2), rgba(255,107,107,0.1));
    border-color: rgba(255,107,107,0.5);
    color: #ff6b6b;
    transform: translateY(-2px);
}

.no-games-message {
    text-align: center;
    padding: 50px 20px;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    border: 1px dashed rgba(255,255,255,0.1);
}

/* Style amélioré pour les cartes de partie dans la modal */
.find-game-content .game-item {
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border: 1px solid rgba(0,212,255,0.2);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.find-game-content .game-item:hover {
    background: linear-gradient(145deg, rgba(0,212,255,0.15), rgba(0,212,255,0.05));
    border-color: rgba(0,212,255,0.5);
    transform: none;
}

/* ID de la partie - sur la même ligne, centré */
.find-game-content .game-id-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: rgba(0,212,255,0.8);
    background: rgba(0,212,255,0.1);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(0,212,255,0.2);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

/* Header avec badge + montant */
.find-game-content .game-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    top: 2px;
}

/* Right section avec joueur + bouton */
.find-game-content .game-right-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    align-self: center;
}

.find-game-content .game-status.waiting {
    background: linear-gradient(145deg, rgba(255,207,64,0.25), rgba(255,207,64,0.15));
    color: var(--neon-gold);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,207,64,0.4);
}

.find-game-content .game-bet-amount {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0,255,136,0.5);
}

.find-game-content .game-bet-amount .sol-icon {
    width: 14px;
    height: 14px;
}

.find-game-content .game-player {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    font-family: 'JetBrains Mono', monospace;
}

.find-game-content .join-game-btn {
    background: linear-gradient(145deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    color: #000;
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.find-game-content .join-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,212,255,0.4);
}

/* Lobby panel (côté droit) */
.lobby-panel {
    background: linear-gradient(135deg, rgba(10,10,15,0.9), rgba(26,26,46,0.9));
    border: 2px solid rgba(0,212,255,0.3);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(20px);
    box-shadow:
        0 20px 50px rgba(0,0,0,0.6),
        0 0 30px rgba(0,212,255,0.2);
}

.lobby-header {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--neon-blue);
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(0,212,255,0.5);
}

.create-game-section {
    background: rgba(255,207,64,0.05);
    border: 1px solid rgba(255,207,64,0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.bet-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.bet-chip {
    background: rgba(255,207,64,0.1);
    border: 2px solid rgba(255,207,64,0.4);
    color: var(--neon-gold);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    min-width: 70px;
    text-align: center;
}

.bet-chip:hover {
    background: rgba(255,207,64,0.2);
    border-color: var(--neon-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,207,64,0.3);
}

.bet-chip.selected {
    background: rgba(255,207,64,0.3);
    border-color: var(--neon-gold);
    box-shadow: 0 0 20px rgba(255,207,64,0.4);
}

/* Search container */
.game-search-container {
    margin-bottom: 15px;
    max-width: 280px;
}

.game-search-input {
    width: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(10,10,15,0.7));
    border: 2px solid rgba(0,212,255,0.4);
    border-radius: 10px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.9);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 20px rgba(0,212,255,0.15);
}

.game-search-input::placeholder {
    color: rgba(255,255,255,0.5);
}

.game-search-input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0,212,255,0.4), 0 4px 12px rgba(0,0,0,0.5);
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(10,10,15,0.8));
}

.games-list {
    max-height: 400px;
    overflow-y: auto;
}

.game-item {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
}

.game-item:hover {
    background: rgba(0,212,255,0.1);
    border-color: var(--neon-blue);
}

.game-item-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.game-right-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-status {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
    width: fit-content;
}

.game-status.waiting {
    background: rgba(255,207,64,0.2);
    color: var(--neon-gold);
}

.game-status.playing {
    background: rgba(0,255,136,0.2);
    color: var(--neon-green);
}

.game-bet-amount {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: var(--neon-green);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-bet-amount .sol-icon {
    width: 16px;
    height: 16px;
}

.game-id-display {
    font-size: 10px;
    color: rgba(0,212,255,0.7);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 500;
    background: rgba(0,212,255,0.1);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(0,212,255,0.2);
    width: fit-content;
    justify-self: center;
    text-align: center;
}

.game-player {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-family: 'Courier New', monospace;
}

.join-game-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--neon-blue);
    border-radius: 8px;
    color: var(--neon-blue);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 100px;
}

.join-game-btn:hover {
    background: var(--neon-blue);
    color: #000;
    transform: translateX(3px);
    box-shadow: 0 0 15px rgba(0,212,255,0.4);
}

/* Animations */
@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes winningToken {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

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

/* ===== RESPONSIVE DESIGN ===== */

/* 4K+ Ultra Wide screens (3840px+) */
@media (min-width: 3840px) {
    .game-layout {
        grid-template-columns: 500px 1fr 500px;
        gap: 80px;
        max-width: 3400px;
    }

    .connect-four-grid {
        grid-template-columns: repeat(7, 160px);
        grid-template-rows: repeat(6, 160px);
        gap: 22px;
        padding: 45px;
        border-radius: 35px;
    }

    .game-grid-container {
        padding: 65px;
        border-radius: 50px;
        border-width: 5px;
    }

    .player-card {
        padding: 35px;
        border-radius: 28px;
        gap: 18px;
        border-width: 3px;
    }

    .player-avatar {
        font-size: 80px;
    }

    .player-name {
        font-size: 22px;
    }

    .timer-card {
        padding: 45px 35px;
        border-radius: 28px;
        border-width: 3px;
    }

    .timer-label {
        font-size: 20px;
        margin-bottom: 25px;
        letter-spacing: 2px;
    }

    .game-timer {
        font-size: 100px;
        margin-bottom: 35px;
    }

    .timer-bar {
        height: 22px;
        border-radius: 15px;
    }

    .pot-card-top {
        padding: 22px 60px;
        border-radius: 25px;
        border-width: 3px;
    }

    .pot-label {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .pot-amount {
        font-size: 38px;
    }

    .back-lobby-btn-top {
        font-size: 22px;
        padding: 22px 38px;
        border-radius: 20px;
        right: -50px;
    }

    .status-message {
        font-size: 20px;
        padding: 22px 32px;
        border-radius: 18px;
    }

    .game-result {
        padding: 100px;
        border-radius: 55px;
        border-width: 5px;
    }

    .result-icon {
        font-size: 140px;
        margin-bottom: 35px;
    }

    .result-title {
        font-size: 64px;
        margin-bottom: 25px;
    }

    .result-amount {
        font-size: 48px;
        margin: 35px 0;
    }

    .result-buttons {
        gap: 25px;
        margin-top: 50px;
    }

    .result-btn {
        font-size: 26px;
        padding: 28px 55px;
        border-radius: 35px;
    }

    .game-header {
        margin-bottom: 35px;
    }

    .token {
        box-shadow:
            0 6px 16px rgba(0,0,0,0.5),
            inset 0 -3px 12px rgba(0,0,0,0.3),
            inset 0 3px 12px rgba(255,255,255,0.3);
    }

    .grid-cell {
        box-shadow:
            inset 0 6px 12px rgba(0,0,0,0.6),
            0 3px 12px rgba(0,0,0,0.3);
    }
}

/* 3200px - 3840px screens */
@media (min-width: 3200px) and (max-width: 3839px) {
    .game-layout {
        grid-template-columns: 440px 1fr 440px;
        gap: 65px;
        max-width: 2900px;
    }

    .connect-four-grid {
        grid-template-columns: repeat(7, 135px);
        grid-template-rows: repeat(6, 135px);
        gap: 20px;
        padding: 38px;
        border-radius: 30px;
    }

    .game-grid-container {
        padding: 55px;
        border-radius: 42px;
        border-width: 4px;
    }

    .player-card {
        padding: 30px;
        border-radius: 24px;
        gap: 15px;
    }

    .player-avatar {
        font-size: 68px;
    }

    .player-name {
        font-size: 19px;
    }

    .timer-card {
        padding: 38px 30px;
        border-radius: 24px;
    }

    .timer-label {
        font-size: 18px;
        margin-bottom: 22px;
    }

    .game-timer {
        font-size: 85px;
        margin-bottom: 30px;
    }

    .timer-bar {
        height: 18px;
    }

    .pot-card-top {
        padding: 18px 52px;
        border-radius: 22px;
    }

    .pot-label {
        font-size: 18px;
    }

    .pot-amount {
        font-size: 34px;
    }

    .back-lobby-btn-top {
        font-size: 20px;
        padding: 20px 32px;
        border-radius: 18px;
        right: -40px;
    }

    .status-message {
        font-size: 18px;
        padding: 20px 28px;
    }

    .game-result {
        padding: 85px;
        border-radius: 48px;
    }

    .result-icon {
        font-size: 120px;
    }

    .result-title {
        font-size: 54px;
    }

    .result-amount {
        font-size: 42px;
    }

    .result-btn {
        font-size: 24px;
        padding: 24px 48px;
    }

    .game-header {
        margin-bottom: 30px;
    }
}

/* Ultra Wide screens (2560px - 3200px) - 2K monitors */
@media (min-width: 2560px) and (max-width: 3199px) {
    .game-layout {
        grid-template-columns: 380px 1fr 380px;
        gap: 50px;
        max-width: 2200px;
    }

    .connect-four-grid {
        grid-template-columns: repeat(7, 110px);
        grid-template-rows: repeat(6, 110px);
        gap: 16px;
        padding: 30px;
    }

    .game-grid-container {
        padding: 45px;
        border-radius: 35px;
    }

    .player-card {
        padding: 25px;
        border-radius: 20px;
    }

    .player-avatar {
        font-size: 55px;
    }

    .player-name {
        font-size: 16px;
    }

    .timer-card {
        padding: 30px 25px;
        border-radius: 20px;
    }

    .timer-label {
        font-size: 15px;
        margin-bottom: 18px;
    }

    .game-timer {
        font-size: 70px;
        margin-bottom: 25px;
    }

    .timer-bar {
        height: 16px;
    }

    .pot-card-top {
        padding: 15px 45px;
        border-radius: 20px;
    }

    .pot-label {
        font-size: 15px;
    }

    .pot-amount {
        font-size: 28px;
    }

    .back-lobby-btn-top {
        font-size: 18px;
        padding: 16px 28px;
        border-radius: 16px;
    }

    .status-message {
        font-size: 16px;
        padding: 16px 24px;
    }

    .game-result {
        padding: 70px;
        border-radius: 40px;
    }

    .result-icon {
        font-size: 100px;
    }

    .result-title {
        font-size: 48px;
    }

    .result-amount {
        font-size: 36px;
    }

    .result-btn {
        font-size: 20px;
        padding: 20px 40px;
    }
}

/* Very Large screens (1920px - 2560px) - Full HD+ */
@media (min-width: 1920px) and (max-width: 2559px) {
    .game-layout {
        grid-template-columns: 320px 1fr 320px;
        gap: 40px;
        max-width: 1900px;
    }

    .connect-four-grid {
        grid-template-columns: repeat(7, 95px);
        grid-template-rows: repeat(6, 95px);
        gap: 14px;
        padding: 25px;
    }

    .game-grid-container {
        padding: 38px;
        border-radius: 30px;
    }

    .player-card {
        padding: 20px;
    }

    .player-avatar {
        font-size: 48px;
    }

    .player-name {
        font-size: 15px;
    }

    .timer-card {
        padding: 25px 20px;
    }

    .game-timer {
        font-size: 58px;
        margin-bottom: 20px;
    }

    .timer-bar {
        height: 14px;
    }

    .pot-card-top {
        padding: 12px 38px;
    }

    .pot-amount {
        font-size: 24px;
    }

    .back-lobby-btn-top {
        font-size: 16px;
        padding: 14px 24px;
    }

    .status-message {
        font-size: 15px;
        padding: 14px 22px;
    }
}

/* Large screens (1600px - 1920px) */
@media (min-width: 1600px) and (max-width: 1919px) {
    .game-layout {
        grid-template-columns: 300px 1fr 300px;
        gap: 35px;
        max-width: 1700px;
    }

    .connect-four-grid {
        grid-template-columns: repeat(7, 90px);
        grid-template-rows: repeat(6, 90px);
        gap: 13px;
        padding: 22px;
    }

    .game-grid-container {
        padding: 32px;
    }

    .player-avatar {
        font-size: 44px;
    }

    .player-name {
        font-size: 14px;
    }

    .game-timer {
        font-size: 52px;
    }

    .pot-amount {
        font-size: 22px;
    }

    .back-lobby-btn-top {
        font-size: 15px;
        padding: 13px 22px;
    }
}

/* Extra Large screens (> 1400px) */
@media (max-width: 1400px) {
    .game-layout {
        grid-template-columns: 220px 1fr 220px;
        gap: 20px;
    }

    .game-timer {
        font-size: 48px;
    }

    .connect-four-grid {
        grid-template-columns: repeat(7, 70px);
        grid-template-rows: repeat(6, 70px);
        gap: 10px;
    }

    .game-grid-container {
        padding: 25px;
    }
}

/* Large screens (1200px - 1400px) */
@media (max-width: 1200px) {
    .game-layout {
        grid-template-columns: 180px 1fr 180px;
        gap: 15px;
    }

    .connect-four-grid {
        grid-template-columns: repeat(7, 55px);
        grid-template-rows: repeat(6, 55px);
        gap: 8px;
        padding: 15px;
    }

    .game-grid-container {
        padding: 20px;
    }

    .player-card {
        padding: 12px;
    }

    .player-avatar {
        font-size: 32px;
    }

    .player-name {
        font-size: 11px;
    }

    .timer-card {
        padding: 15px 12px;
    }

    .game-timer {
        font-size: 42px;
    }

    .pot-card-top {
        padding: 8px 20px;
    }

    .pot-amount {
        font-size: 18px;
    }

    .back-lobby-btn-top {
        font-size: 12px;
        padding: 10px 15px;
        right: 0;
    }
}

/* Medium screens / Tablets (768px - 1200px) */
@media (max-width: 992px) {
    .game-layout {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 600px;
        margin: 0 auto;
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .back-lobby-btn-top {
        position: static;
        order: -1;
        align-self: flex-end;
    }

    .players-section {
        flex-direction: row;
        justify-content: center;
        order: 1;
    }

    .player-card {
        flex: 1;
        max-width: 200px;
    }

    .grid-section {
        order: 2;
    }

    .timer-section {
        order: 0;
    }

    .timer-card {
        max-width: 300px;
    }

    .connect-four-grid {
        grid-template-columns: repeat(7, 50px);
        grid-template-rows: repeat(6, 50px);
        gap: 8px;
        padding: 15px;
    }

    .game-grid-container {
        padding: 18px;
    }

    .status-message {
        max-width: 250px;
    }
}

/* Small screens / Mobile (< 768px) */
@media (max-width: 768px) {
    .game-screen {
        padding: 0 5px;
        padding-top: 5px;
        min-height: calc(100vh - 80px);
        flex-direction: column;
    }

    .game-header {
        margin-bottom: 8px;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 0 5px;
    }

    .pot-card-top {
        padding: 8px 16px;
        border-radius: 10px;
        order: 1;
        flex: 1;
        max-width: 150px;
    }

    .pot-label {
        font-size: 7px;
        letter-spacing: 0.5px;
    }

    .pot-amount {
        font-size: 16px;
    }

    .back-lobby-btn-top {
        position: static;
        font-size: 9px;
        padding: 6px 12px;
        border-radius: 8px;
        order: 2;
    }

    /* Layout jeu mobile - Grille en haut, infos en bas */
    .game-layout {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: center;
        width: 100%;
        flex: 1;
    }

    /* Grille au centre */
    .grid-section {
        order: 1;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .game-grid-container {
        padding: 8px;
        border-radius: 12px;
        border-width: 2px;
        box-shadow:
            0 0 15px rgba(0,212,255,0.5),
            0 0 30px rgba(0,212,255,0.2),
            0 10px 30px rgba(0,0,0,0.6);
    }

    /* Grille adaptée à la largeur d'écran - max 85vw */
    .connect-four-grid {
        grid-template-columns: repeat(7, min(calc((85vw - 40px) / 7), 42px));
        grid-template-rows: repeat(6, min(calc((85vw - 40px) / 7), 42px));
        gap: 4px;
        padding: 8px;
        border-radius: 10px;
        max-width: 320px;
    }

    .grid-cell {
        border-width: 2px;
    }

    .token {
        border-width: 2px;
    }

    /* Section joueurs en ligne horizontale */
    .players-section {
        order: 2;
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 0 5px;
    }

    .player-card {
        padding: 8px 10px;
        max-width: 48%;
        flex: 1;
        border-radius: 10px;
        border-width: 2px;
    }

    .player-avatar {
        font-size: 22px;
        top: -3px;
    }

    .player-card .player-name {
        font-size: 9px;
        margin-top: -8px;
        margin-bottom: 4px;
    }

    .player-stats-row {
        gap: 4px;
        margin-top: 3px;
    }

    .player-stat {
        padding: 2px 4px;
        border-radius: 6px;
    }

    .player-stat .stat-icon {
        font-size: 9px;
    }

    .player-stat .stat-icon-img {
        width: 10px;
        height: 10px;
    }

    .player-stat .stat-val {
        font-size: 9px;
    }

    /* Status message entre les joueurs */
    .players-section .status-message {
        display: none;
    }

    .status-message {
        order: 3;
        font-size: 10px;
        padding: 6px 12px;
        border-radius: 8px;
        max-width: 250px;
        margin: 0 auto;
    }

    /* Timer compact */
    .timer-section {
        order: 4;
        width: 100%;
        max-width: 140px;
    }

    .timer-card {
        padding: 8px 12px;
        border-radius: 10px;
    }

    .timer-label {
        font-size: 7px;
        margin-bottom: 4px;
    }

    .game-timer {
        font-size: 24px;
        margin-bottom: 5px;
    }

    .timer-bar {
        height: 4px;
        border-radius: 4px;
    }

    /* Game result modal */
    .game-result {
        padding: 25px 20px;
        border-radius: 18px;
        max-width: 90%;
        min-width: 280px;
        border-width: 2px;
    }

    .result-icon {
        font-size: 50px;
        margin-bottom: 12px;
    }

    .result-title {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .result-amount {
        font-size: 24px;
        margin: 12px 0;
    }

    .transaction-status {
        padding: 6px 12px;
        margin: 10px 0;
    }

    .tx-spinner {
        width: 14px;
        height: 14px;
    }

    .tx-text {
        font-size: 11px;
    }

    .result-buttons {
        flex-direction: column;
        gap: 8px;
        margin-top: 15px;
    }

    .result-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 12px;
        border-radius: 12px;
    }

    .result-btn.play-again {
        padding: 14px 24px;
        font-size: 13px;
    }

    /* Bet selector in game */
    .bet-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .bet-chip {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 60px;
    }

    .game-item {
        padding: 10px;
        flex-wrap: wrap;
    }

    .game-item-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    .game-bet-amount {
        font-size: 14px;
    }

    .game-bet-amount .sol-icon {
        width: 14px;
        height: 14px;
    }

    .game-player {
        font-size: 10px;
        width: 100%;
    }

    .join-game-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* Find game modal mobile */
    .find-game-content {
        padding: 18px;
        max-height: 85vh;
        border-radius: 16px;
    }

    .find-game-header .section-title {
        font-size: 14px;
    }

    .find-game-footer {
        margin-top: 15px;
        gap: 10px;
    }

    .modal-btn {
        padding: 10px 18px;
        font-size: 12px;
    }
}

/* Extra small screens (< 480px) */
@media (max-width: 480px) {
    .game-screen {
        padding: 0 3px;
        padding-top: 20px;
    }

    .game-header {
        padding: 0 3px;
        margin-bottom: 5px;
    }

    .pot-card-top {
        padding: 6px 12px;
        max-width: 120px;
    }

    .pot-label {
        font-size: 6px;
    }

    .pot-amount {
        font-size: 14px;
    }

    .back-lobby-btn-top {
        font-size: 8px;
        padding: 5px 8px;
    }

    .game-layout {
        gap: 6px;
    }

    /* Grille compacte pour petits écrans */
    .connect-four-grid {
        grid-template-columns: repeat(7, min(calc((90vw - 30px) / 7), 38px));
        grid-template-rows: repeat(6, min(calc((90vw - 30px) / 7), 38px));
        gap: 3px;
        padding: 6px;
        border-radius: 10px;
        max-width: 300px;
    }

    .game-grid-container {
        padding: 6px;
        border-radius: 10px;
        border-width: 2px;
    }

    .grid-cell {
        border-width: 2px;
        box-shadow:
            inset 0 3px 10px rgba(0,0,0,0.9),
            inset 0 -2px 6px rgba(0,212,255,0.15),
            0 0 6px rgba(0,212,255,0.3);
    }

    .token {
        width: calc(100% - 6px);
        height: calc(100% - 6px);
        top: 3px;
        left: 3px;
    }

    .players-section {
        gap: 6px;
        padding: 0 3px;
    }

    .player-card {
        padding: 6px 8px;
        border-radius: 8px;
    }

    .player-avatar {
        font-size: 18px;
        top: -2px;
    }

    .player-card .player-name {
        font-size: 8px;
        margin-top: -6px;
        margin-bottom: 3px;
    }

    .player-stats-row {
        gap: 3px;
    }

    .player-stat {
        padding: 2px 3px;
    }

    .player-stat .stat-icon {
        font-size: 8px;
    }

    .player-stat .stat-icon-img {
        width: 10px;
        height: 10px;
    }

    .player-stat .stat-val {
        font-size: 8px;
    }

    .status-message {
        font-size: 9px;
        padding: 5px 10px;
        max-width: 200px;
    }

    .timer-section {
        max-width: 120px;
    }

    .timer-card {
        padding: 6px 10px;
        border-radius: 8px;
    }

    .timer-label {
        font-size: 6px;
        margin-bottom: 3px;
    }

    .game-timer {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .timer-bar {
        height: 3px;
    }

    .game-result {
        padding: 20px 16px;
        min-width: 260px;
    }

    .result-icon {
        font-size: 44px;
        margin-bottom: 10px;
    }

    .result-title {
        font-size: 18px;
    }

    .result-amount {
        font-size: 20px;
        margin: 10px 0;
    }

    .result-buttons {
        gap: 6px;
    }

    .result-btn {
        padding: 10px 16px;
        font-size: 11px;
    }

    .result-btn.play-again {
        padding: 12px 20px;
        font-size: 12px;
    }

    .game-item {
        padding: 8px;
    }

    .game-item-header {
        gap: 5px;
    }

    .game-status {
        font-size: 9px;
        padding: 2px 6px;
    }

    .game-bet-amount {
        font-size: 12px;
    }

    .game-bet-amount .sol-icon {
        width: 12px;
        height: 12px;
    }

    .game-player {
        font-size: 9px;
    }

    .join-game-btn {
        padding: 5px 10px;
        font-size: 10px;
    }
}

/* Very small screens (< 360px) */
@media (max-width: 360px) {
    .connect-four-grid {
        grid-template-columns: repeat(7, 32px);
        grid-template-rows: repeat(6, 32px);
        gap: 3px;
        padding: 8px;
    }

    .game-grid-container {
        padding: 10px;
    }

    .player-card {
        max-width: 100px;
        padding: 6px;
    }

    .player-avatar {
        font-size: 20px;
    }

    .player-name {
        font-size: 8px;
    }

    .game-timer {
        font-size: 26px;
    }
}
