/* ================================================
   RESPONSIVE.CSS - Connect Four Web3
   Fichier de responsive design complet
   ================================================ */

/* ================================================
   ANTI-OVERFLOW GLOBAL
   ================================================ */
html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* Fix zone blanche mobile */
body {
    min-height: 100vh;
    min-height: 100dvh;
}

/* ================================================
   VARIABLES CSS POUR LE RESPONSIVE
   ================================================ */
:root {
    /* Espacements fluides */
    --spacing-xs: clamp(4px, 0.5vw, 8px);
    --spacing-sm: clamp(8px, 1vw, 16px);
    --spacing-md: clamp(12px, 1.5vw, 24px);
    --spacing-lg: clamp(16px, 2vw, 32px);
    --spacing-xl: clamp(24px, 3vw, 48px);

    /* Tailles de police fluides */
    --font-xs: clamp(9px, 1.2vw, 11px);
    --font-sm: clamp(10px, 1.4vw, 13px);
    --font-md: clamp(12px, 1.6vw, 15px);
    --font-lg: clamp(14px, 1.8vw, 18px);
    --font-xl: clamp(18px, 2.2vw, 24px);

    /* Hauteur du header */
    --header-height: clamp(60px, 8vh, 80px);
    --header-element-height: clamp(32px, 4.5vh, 44px);
}

/* ================================================
   HEADER - CORRECTIONS PRINCIPALES
   Priorite haute pour surpasser styles.css
   ================================================ */

/* Reset du header pour un meilleur controle */
.header {
    padding: var(--spacing-sm) 0 !important;
    padding-top: calc(var(--spacing-sm) + env(safe-area-inset-top, 0px)) !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

.header-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    max-width: 1920px !important;
    margin: 0 auto !important;
    padding: 0 var(--spacing-md) !important;
    gap: var(--spacing-sm) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-wrap: nowrap !important;
}

/* Logo responsive */
.logo {
    font-size: clamp(14px, 1.8vw, 20px) !important;
    flex-shrink: 0 !important;
}

/* Header Center - Wallet + Solde + Affiliate aligne */
.header-center {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--spacing-sm) !important;
    height: var(--header-element-height) !important;
    max-width: 60% !important;
    flex-shrink: 1 !important;
}

/* Uniformiser les hauteurs des elements du header */
.wallet-info-btn,
.escrow-balance-display,
.affiliate-btn {
    height: var(--header-element-height) !important;
    box-sizing: border-box !important;
}

/* Wallet Button */
.wallet-info-btn {
    padding: 0 clamp(8px, 1.5vw, 24px) !important;
    font-size: var(--font-md) !important;
    min-width: clamp(80px, 12vw, 180px) !important;
    border-radius: calc(var(--header-element-height) / 2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.wallet-address-display {
    font-size: var(--font-md) !important;
}

/* Groupe Balance + Affiliate - ils forment un bloc uni */
.balance-affiliate-group {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: var(--header-element-height) !important;
    flex-shrink: 1 !important;
}

/* Escrow Balance Display - meme hauteur que les autres */
.escrow-balance-display {
    padding: 0 clamp(6px, 1vw, 18px) !important;
    font-size: var(--font-sm) !important;
    min-width: clamp(70px, 10vw, 140px) !important;
    border-radius: calc(var(--header-element-height) / 2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    height: 100% !important;
    flex-shrink: 1 !important;
    overflow: hidden !important;
}

/* Affiliate Button - a droite du solde avec espacement */
.affiliate-btn {
    width: var(--header-element-height) !important;
    height: 100% !important;
    min-width: var(--header-element-height) !important;
    border-radius: clamp(8px, 1vw, 12px) !important;
    margin-left: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.affiliate-btn svg {
    width: clamp(14px, 1.8vw, 18px) !important;
    height: clamp(14px, 1.8vw, 18px) !important;
}

/* Header Right - Deposit/Withdraw */
.header-right {
    display: flex !important;
    align-items: center !important;
    gap: var(--spacing-sm) !important;
    margin-right: clamp(8px, 2vw, 40px) !important;
    flex-shrink: 0 !important;
}

.escrow-deposit-btn,
.escrow-withdraw-btn {
    height: var(--header-element-height) !important;
    padding: 0 clamp(8px, 1vw, 20px) !important;
    font-size: var(--font-xs) !important;
    border-radius: calc(var(--header-element-height) / 2) !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ================================================
   MAIN CONTAINER
   ================================================ */
.main-container {
    margin-top: calc(var(--header-height) + 10px);
    padding: var(--spacing-md);
    min-height: calc(100vh - var(--header-height) - 20px);
}

/* ================================================
   LOBBY - LAYOUT 3 COLONNES
   ================================================ */
.lobby-screen {
    padding: 0 var(--spacing-md);
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* Barre stats globales */
.global-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: var(--spacing-lg);
}

.global-stat-item {
    padding: var(--spacing-md) var(--spacing-sm);
}

.global-stat-item .stat-label {
    font-size: var(--font-xs);
}

.global-stat-item .stat-value {
    font-size: clamp(14px, 2vw, 22px);
}

/* Layout 3 colonnes */
.lobby-three-columns {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: var(--spacing-md);
    width: 100%;
    align-items: start;
}

.lobby-column {
    padding: var(--spacing-md);
    border-radius: clamp(12px, 1.5vw, 20px);
    font-size: clamp(12px, 1vw, 16px);
}

/* ================================================
   MEDIA QUERIES - ECRANS LARGES (4K, 2K)
   ================================================ */
@media (min-width: 2560px) {
    :root {
        --header-element-height: 48px;
    }

    .header-content {
        max-width: 2400px;
    }

    .lobby-screen {
        max-width: 2200px;
    }
}

@media (min-width: 3840px) {
    :root {
        --header-element-height: 56px;
    }

    .header-content {
        max-width: 3200px;
    }

    .lobby-screen {
        max-width: 3000px;
    }
}

/* ================================================
   MEDIA QUERIES - TABLETTES PAYSAGE (1024px - 1400px)
   ================================================ */
@media (max-width: 1400px) {
    :root {
        --header-element-height: 38px;
    }

    .lobby-three-columns {
        grid-template-columns: 1fr 1.8fr 1fr;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 1200px) {
    :root {
        --header-element-height: 36px;
    }

    .header-center {
        position: static !important;
        transform: none !important;
        max-width: none !important;
        flex: 1 1 auto !important;
    }

    .header-content {
        justify-content: space-between !important;
    }

    .logo {
        margin-left: 0;
    }

    .lobby-three-columns {
        grid-template-columns: 1fr 1.5fr 1fr;
    }
}

/* ================================================
   MEDIA QUERIES - TABLETTES PORTRAIT (768px - 1024px)
   CORRECTION PRINCIPALE DES SUPERPOSITIONS
   Priorite haute avec !important pour surpasser styles.css
   ================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --header-element-height: 34px !important;
        --spacing-md: 12px !important;
    }

    /* Header en mode compact */
    .header {
        padding: 8px 0 !important;
    }

    .header-content {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 0 12px !important;
    }

    .logo {
        font-size: 12px !important;
        flex-shrink: 0 !important;
        margin-left: 0 !important;
        white-space: nowrap !important;
        width: auto !important;
        text-align: left !important;
        order: unset !important;
    }

    /* Header center en ligne */
    .header-center {
        position: static !important;
        transform: none !important;
        display: flex !important;
        flex: 1 !important;
        justify-content: center !important;
        gap: 6px !important;
        order: unset !important;
    }

    .wallet-info-btn {
        min-width: 90px !important;
        padding: 0 10px !important;
        font-size: 10px !important;
        height: 34px !important;
    }

    .balance-affiliate-group {
        height: 34px !important;
    }

    .escrow-balance-display {
        min-width: 80px !important;
        padding: 0 8px !important;
        font-size: 10px !important;
        height: 100% !important;
    }

    .affiliate-btn {
        width: 34px !important;
        height: 100% !important;
        min-width: 34px !important;
    }

    .affiliate-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .header-right {
        display: flex !important;
        gap: 6px !important;
        margin-right: 8px !important;
        margin-left: 8px !important;
        order: unset !important;
        flex-wrap: nowrap !important;
    }

    .escrow-deposit-btn,
    .escrow-withdraw-btn {
        padding: 0 10px !important;
        font-size: 9px !important;
        height: 34px !important;
    }

    /* CORRECTION LOBBY TABLETTE PORTRAIT */
    .main-container {
        margin-top: 70px !important;
        padding: 12px !important;
    }

    .lobby-screen {
        padding: 0 8px !important;
    }

    /* Stats bar en 2x2 */
    .global-stats-bar {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
        margin-bottom: 16px !important;
        flex-direction: unset !important;
    }

    .global-stat-item {
        padding: 10px 8px !important;
        flex: unset !important;
    }

    .global-stat-item .stat-value {
        font-size: 16px !important;
    }

    .global-stat-item .stat-label {
        font-size: 9px !important;
    }

    /* LAYOUT TABLETTE - 2 colonnes puis 1 */
    .lobby-three-columns {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 12px !important;
        width: 100% !important;
        flex-direction: unset !important;
    }

    /* Leaderboard prend toute la largeur en haut */
    .lobby-column.leaderboard-column {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        order: 1 !important;
        max-height: none !important;
        width: 100% !important;
    }

    /* Colonne principale et stats cote a cote */
    .lobby-column.main-column {
        grid-column: 1 !important;
        grid-row: 2 !important;
        order: 2 !important;
        width: 100% !important;
    }

    .lobby-column.stats-column {
        grid-column: 2 !important;
        grid-row: 2 !important;
        order: 3 !important;
        width: 100% !important;
    }

    /* PumpFun en bas, pleine largeur */
    .pumpfun-panel {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        order: 4 !important;
        position: static !important;
        width: 100% !important;
    }

    /* Colonnes */
    .lobby-column {
        padding: 14px !important;
        border-radius: 14px !important;
        min-height: auto !important;
        max-height: none !important;
    }

    /* Leaderboard horizontal sur tablette */
    .leaderboard-list {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        overflow-x: auto !important;
        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .leaderboard-item {
        flex-shrink: 0 !important;
        min-width: 100px !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 10px 14px !important;
    }

    .rank {
        font-size: 12px !important;
    }

    .leaderboard-item .player-name {
        font-size: 10px !important;
    }

    .amount {
        font-size: 11px !important;
    }

    /* Sections creation */
    .column-header h3 {
        font-size: 13px !important;
        margin-bottom: 12px !important;
    }

    .create-section {
        padding: 14px !important;
        margin-bottom: 12px !important;
    }

    .section-label {
        font-size: 10px !important;
        margin-bottom: 10px !important;
    }

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

    .bet-chip {
        padding: 14px 10px !important;
        font-size: 12px !important;
        min-height: 45px !important;
    }

    .create-game-btn-large {
        padding: 14px 20px !important;
        font-size: 12px !important;
    }

    /* Stats personnelles */
    .personal-stats {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .stat-card {
        padding: 10px !important;
    }

    .stat-card-header .stat-label {
        font-size: 9px !important;
    }

    .stat-card-value {
        font-size: 14px !important;
    }

    /* Games list */
    .games-list {
        max-height: 300px !important;
    }

    .game-item {
        padding: 8px 10px !important;
        flex-direction: row !important;
    }
}

/* ================================================
   MEDIA QUERIES - PETITES TABLETTES (600px - 768px)
   ================================================ */
@media (max-width: 768px) and (min-width: 601px) {
    :root {
        --header-element-height: 32px;
    }

    .header {
        padding: 6px 8px;
    }

    .header-content {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 0 8px;
    }

    .logo {
        font-size: 11px;
        order: 1;
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }

    .header-center {
        position: static;
        transform: none;
        order: 2;
        gap: 6px;
    }

    .header-right {
        order: 3;
        gap: 6px;
        margin-right: 0;
    }

    .wallet-info-btn {
        min-width: 80px !important;
        padding: 0 10px !important;
        font-size: 9px !important;
    }

    .balance-affiliate-group {
        height: 32px !important;
    }

    .escrow-balance-display {
        min-width: 70px !important;
        padding: 0 8px !important;
        font-size: 9px !important;
        height: 100% !important;
    }

    .affiliate-btn {
        width: 32px !important;
        height: 100% !important;
        min-width: 32px !important;
    }

    .escrow-deposit-btn,
    .escrow-withdraw-btn {
        padding: 0 10px !important;
        font-size: 8px !important;
    }

    /* Lobby */
    .main-container {
        margin-top: 90px;
        padding: 10px;
    }

    .global-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .lobby-three-columns {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px;
    }

    .lobby-column {
        width: 100% !important;
        max-height: none !important;
    }

    .leaderboard-column { order: 1; }
    .main-column { order: 2; }
    .stats-column { order: 3; }
    .pumpfun-panel { order: 4; }
}

/* ================================================
   MEDIA QUERIES - MOBILE (< 600px)
   ================================================ */
@media (max-width: 600px) {
    :root {
        --header-element-height: 30px;
    }

    /* Header mobile - grille optimisee */
    .header {
        padding: 6px 10px;
        padding-top: calc(6px + env(safe-area-inset-top, 0px));
    }

    .header-content {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        grid-template-rows: 1fr 1fr !important;
        gap: 5px 10px !important;
        padding: 4px 8px;
        align-items: center;
    }

    .logo {
        grid-column: 1 !important;
        grid-row: 1 / 3 !important;
        font-size: 10px;
        white-space: pre-line;
        line-height: 1.2;
        width: auto !important;
        text-align: left !important;
        margin: 0;
    }

    .header-center {
        display: contents !important;
        position: static;
        transform: none;
    }

    .wallet-info-btn {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: center;
        min-width: auto !important;
        padding: 0 12px !important;
        font-size: 10px !important;
        height: 28px !important;
    }

    .balance-affiliate-group {
        grid-column: 2 !important;
        grid-row: 2 !important;
        justify-self: center;
        height: 28px !important;
        display: flex !important;
    }

    .escrow-balance-display {
        min-width: auto !important;
        padding: 0 10px !important;
        font-size: 10px !important;
        height: 100% !important;
        border-radius: 14px !important;
    }

    .affiliate-btn {
        width: 28px !important;
        height: 100% !important;
        min-width: 28px !important;
        border-radius: 8px !important;
    }

    .header-right {
        display: contents !important;
    }

    .escrow-deposit-btn {
        grid-column: 3 !important;
        grid-row: 1 !important;
        height: 28px !important;
        padding: 0 10px !important;
        font-size: 9px !important;
    }

    .escrow-withdraw-btn {
        grid-column: 3 !important;
        grid-row: 2 !important;
        height: 28px !important;
        padding: 0 10px !important;
        font-size: 9px !important;
    }

    /* Main container mobile */
    .main-container {
        margin-top: 70px;
        padding: 8px;
    }

    .lobby-screen {
        padding: 0;
    }

    /* Stats bar mobile */
    .global-stats-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-bottom: 10px;
        padding: 6px;
    }

    .global-stat-item {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
        padding: 8px 6px;
    }

    .global-stat-item .stat-label {
        font-size: 7px;
    }

    .global-stat-item .stat-value {
        font-size: 12px;
    }

    /* Layout mobile empile */
    .lobby-three-columns {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px;
    }

    .lobby-column {
        width: 100% !important;
        max-height: none !important;
        padding: 12px;
        border-radius: 12px;
    }

    .leaderboard-column { order: 1; }
    .main-column { order: 2; }
    .stats-column { order: 3; }
    .pumpfun-panel { order: 4; width: 100% !important; }

    /* Leaderboard horizontal */
    .leaderboard-list {
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .leaderboard-item {
        flex-shrink: 0;
        min-width: 80px;
        flex-direction: column;
        padding: 8px 10px;
    }

    .column-header h3 {
        font-size: 12px;
        margin-bottom: 10px;
    }

    /* Creation section */
    .create-section {
        padding: 10px;
        margin-bottom: 10px;
    }

    .bet-selector {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }

    .bet-chip {
        flex: 0 0 auto;
        padding: 10px 14px;
        font-size: 11px;
        min-height: auto;
    }

    .create-game-btn-large {
        padding: 12px 16px;
        font-size: 11px;
        margin-top: 10px;
    }

    /* Stats perso en grille */
    .personal-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .stat-card {
        padding: 8px 6px;
    }

    .stat-card-header .stat-label {
        font-size: 8px;
    }

    .stat-card-value {
        font-size: 12px;
    }

    /* Games list */
    .games-list {
        max-height: 200px;
    }

    .game-item {
        padding: 8px;
        flex-direction: column;
        gap: 6px;
    }
}

/* ================================================
   MEDIA QUERIES - TRES PETIT MOBILE (< 400px)
   ================================================ */
@media (max-width: 400px) {
    :root {
        --header-element-height: 26px;
    }

    .header-content {
        gap: 4px 6px !important;
        padding: 3px 5px;
    }

    .logo {
        font-size: 9px;
    }

    .wallet-info-btn {
        padding: 0 8px !important;
        font-size: 9px !important;
        height: 26px !important;
    }

    .balance-affiliate-group {
        height: 26px !important;
    }

    .escrow-balance-display {
        padding: 0 6px !important;
        font-size: 9px !important;
        height: 100% !important;
        border-radius: 13px !important;
    }

    .affiliate-btn {
        width: 26px !important;
        height: 100% !important;
        min-width: 26px !important;
        border-radius: 8px !important;
    }

    .affiliate-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .escrow-deposit-btn,
    .escrow-withdraw-btn {
        height: 26px !important;
        padding: 0 8px !important;
        font-size: 8px !important;
    }

    .main-container {
        margin-top: 65px;
        padding: 6px;
    }

    .global-stat-item {
        padding: 6px 4px;
    }

    .global-stat-item .stat-value {
        font-size: 11px;
    }

    .lobby-column {
        padding: 10px;
    }

    .bet-chip {
        padding: 8px 10px;
        font-size: 10px;
    }

    .personal-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   MEDIA QUERIES - ECRANS TRES PETITS (< 360px)
   ================================================ */
@media (max-width: 360px) {
    :root {
        --header-element-height: 22px;
    }

    .header {
        padding: 3px 2px !important;
        padding-top: calc(3px + env(safe-area-inset-top, 0px)) !important;
        max-width: 100vw !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .header-content {
        display: grid !important;
        grid-template-columns: 75px minmax(0, 1fr) auto !important;
        grid-template-rows: 1fr 1fr !important;
        gap: 2px 4px !important;
        padding: 2px 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        align-items: center !important;
    }

    .header-content * {
        box-sizing: border-box !important;
    }

    .logo {
        grid-column: 1 !important;
        grid-row: 1 / 3 !important;
        font-size: 11px !important;
        line-height: 1.15 !important;
        width: 55px !important;
        max-width: 55px !important;
        overflow: hidden !important;
        white-space: pre-line !important;
        margin-left: 16px !important;
    }

    /* Header center et right en display contents pour la grille */
    .header-center {
        display: contents !important;
    }

    .header-right {
        display: contents !important;
    }

    /* Boutons deposit/withdraw TOUJOURS VISIBLES */
    .escrow-deposit-btn {
        display: flex !important;
        grid-column: 3 !important;
        grid-row: 1 !important;
        height: 20px !important;
        padding: 0 4px !important;
        font-size: 6px !important;
        min-width: 0 !important;
        border-width: 1px !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        margin-right: 24px !important;
        justify-self: end !important;
    }

    .escrow-withdraw-btn {
        display: flex !important;
        grid-column: 3 !important;
        grid-row: 2 !important;
        height: 20px !important;
        padding: 0 4px !important;
        font-size: 6px !important;
        min-width: 0 !important;
        border-width: 1px !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        margin-right: 24px !important;
        justify-self: end !important;
    }

    .wallet-info-btn {
        grid-column: 2 !important;
        grid-row: 1 !important;
        font-size: 7px !important;
        padding: 0 8px !important;
        height: 22px !important;
        min-width: auto !important;
        max-width: fit-content !important;
        justify-self: center !important;
        width: auto !important;
    }

    .wallet-address-display {
        font-size: 7px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    .balance-affiliate-group {
        grid-column: 2 !important;
        grid-row: 2 !important;
        height: 22px !important;
        gap: 3px !important;
        justify-self: center !important;
        width: auto !important;
        display: flex !important;
    }

    .escrow-balance-display {
        font-size: 7px !important;
        padding: 0 6px !important;
        height: 100% !important;
        border-radius: 11px !important;
        min-width: auto !important;
        width: auto !important;
        flex: 0 0 auto !important;
        gap: 2px !important;
        border-width: 1px !important;
    }

    .escrow-balance-display .sol-icon {
        width: 10px !important;
        height: 10px !important;
        flex-shrink: 0 !important;
    }

    .escrow-balance-display .escrow-label {
        display: none !important;
    }

    .escrow-balance-display .escrow-amount {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .affiliate-btn {
        width: 20px !important;
        height: 100% !important;
        min-width: 20px !important;
        max-width: 20px !important;
        border-radius: 5px !important;
        flex-shrink: 0 !important;
        border-width: 1px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .affiliate-btn svg {
        width: 10px !important;
        height: 10px !important;
    }

    .main-container {
        margin-top: 60px;
        padding: 4px;
    }

    .lobby-column {
        padding: 8px;
        border-radius: 10px;
    }

    .column-header h3 {
        font-size: 11px;
    }

    .create-section {
        padding: 8px;
    }

    .bet-chip {
        padding: 6px 8px;
        font-size: 9px;
    }

    .create-game-btn-large {
        padding: 10px 12px;
        font-size: 10px;
    }

    .personal-stats {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .stat-card {
        padding: 6px 4px;
    }

    .stat-card-value {
        font-size: 11px;
    }
}

/* ================================================
   CORRECTIONS HAUTEUR VIEWPORT (ECRANS COURTS)
   ================================================ */
@media (max-height: 700px) {
    .main-container {
        margin-top: 60px;
    }

    .global-stats-bar {
        margin-bottom: 10px;
    }

    .global-stat-item {
        padding: 8px 6px;
    }

    .global-stat-item .stat-value {
        font-size: 14px;
    }

    .lobby-column {
        padding: 10px;
    }

    .create-section {
        padding: 10px;
        margin-bottom: 8px;
    }

    .bet-chip {
        padding: 10px 12px;
        min-height: 40px;
    }
}

@media (max-height: 600px) {
    :root {
        --header-element-height: 28px;
    }

    .header {
        padding: 4px 8px;
    }

    .main-container {
        margin-top: 50px;
        padding: 6px;
    }

    .global-stats-bar {
        display: none;
    }

    .lobby-column {
        padding: 8px;
    }

    .column-header h3 {
        margin-bottom: 8px;
        font-size: 11px;
    }
}

/* ================================================
   GAME SCREEN RESPONSIVE
   ================================================ */
.game-screen {
    max-width: 100%;
}

.game-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.players-section,
.timer-section {
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 250px;
}

.grid-section {
    flex: 0 1 auto;
}

/* Game screen tablette portrait */
@media (min-width: 769px) and (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
    }

    .players-section {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        width: 100%;
        max-width: 100%;
    }

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

    .status-message {
        display: none;
    }

    .timer-section {
        width: 100%;
        max-width: 300px;
    }
}

/* Game screen mobile */
@media (max-width: 768px) {
    .game-layout {
        flex-direction: column;
        gap: 10px;
    }

    .players-section {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        max-width: 100%;
    }

    .player-card {
        flex: 0 1 45%;
        max-width: 160px;
    }

    .grid-section {
        width: 100%;
        max-width: 100%;
    }

    .timer-section {
        width: 100%;
        max-width: 100%;
    }
}

/* ================================================
   MODALS RESPONSIVE
   ================================================ */
.wallet-modal-content,
.escrow-modal-content,
.withdraw-modal-content,
.affiliate-modal-content {
    width: min(95%, 520px);
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 600px) {
    .wallet-modal-content,
    .escrow-modal-content,
    .withdraw-modal-content,
    .affiliate-modal-content {
        width: 95%;
        padding: 16px;
        border-radius: 16px;
    }

    .escrow-modal-header h2,
    .withdraw-modal-header h2 {
        font-size: 20px;
    }

    .amount-preset {
        padding: 10px 14px;
        font-size: 12px;
    }

    .confirm-deposit-btn,
    .confirm-withdraw-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* ================================================
   PUMPFUN PANEL RESPONSIVE
   ================================================ */
.pumpfun-panel {
    padding: var(--spacing-md);
}

@media (max-width: 1024px) {
    .pumpfun-panel {
        position: static !important;
        width: 100% !important;
        right: auto !important;
        top: auto !important;
        margin-top: 0;
    }
}

/* ================================================
   LANGUAGE SELECTOR RESPONSIVE
   ================================================ */
.language-selector-container {
    position: fixed;
    bottom: clamp(10px, 2vh, 20px);
    right: clamp(10px, 2vw, 20px);
    z-index: 99;
}

#language-selector {
    padding: clamp(6px, 1vw, 10px) clamp(10px, 1.5vw, 16px);
}

@media (max-width: 600px) {
    .language-selector-container {
        bottom: 8px;
        right: 8px;
    }

    #language-selector {
        padding: 6px 10px;
    }

    #current-lang-flag {
        font-size: 16px;
    }
}

/* ================================================
   SCROLLBAR STYLING
   ================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,207,64,0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,207,64,0.5);
}

@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
}

/* ================================================
   UTILITAIRES RESPONSIVE
   ================================================ */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

.hide-tablet {
    display: block;
}

.show-tablet {
    display: none;
}

@media (min-width: 601px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }

    .show-tablet {
        display: block !important;
    }
}
