*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- VARIABLES RÉACTIVES --- */
:root{
    --vh: 100vh;
    --table-max-w: 1200px;
    --table-max-h: 820px;

    --table-w: clamp(320px, 88vw, var(--table-max-w));
    --table-h: clamp(360px, 74vh, var(--table-max-h));
    --card-w: clamp(56px, 7.2vw, 96px);
    --card-h: calc(var(--card-w) * 1.5);
    --hand-height: calc(var(--card-h) + 40px);
    --avatar-size: clamp(36px, 4.2vw, 64px);
    --label-font: clamp(12px, 1.6vw, 16px);
    --gap: clamp(8px, 1.6vw, 20px);
    
    /* Variables Mobile */
    --card-w-mobile: 48px; /* Nouvelle taille pour téléphone */
    --card-h-mobile: calc(var(--card-w-mobile) * 1.5);
    --hand-height-mobile: calc(var(--card-h-mobile) + 20px);
}


/* --- ECRAN JEU (GRID LAYOUT) --- */
#screen-game {
    background: radial-gradient(circle at center, #2c3e50 0%, #000 100%);
    padding: 0;
    width: 100%;
    height: 100vh;
    grid-template-rows: 80px 1fr var(--hand-height);
    grid-template-columns: 100%;
    grid-template-areas: 
        "top-bar"
        "table"
        "bottom-bar";
    justify-items: center;
    align-items: center;
    overflow: hidden;
}

/* ========================================= */
/* 1. ZONE HAUTE (Barre info & Adversaires)  */
/* ========================================= */
#top-area {
    grid-area: top-bar;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-admin-controls {
    position: absolute; left: 20px; top: 20px; z-index: 200;
}
.sound-btn {
    top: 0;
}

/* Badge ULTIMO sur les joueurs */
.player-ultimo {
    position: absolute;
    top: -20px;
    right: 0;
    background: #f1c40f;
    color: #111;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    display: none;
    z-index: 40;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Variantes visuelles */
.player-label.ultimo .player-ultimo { display: block; animation: ultimo-pulse 1.2s ease-in-out infinite; }
@keyframes ultimo-pulse {
    0% { transform: translateY(0); box-shadow: 0 6px 18px rgba(87, 0, 0, 0.4); }
    50% { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(109, 89, 10, 0.18); }
    100% { transform: translateY(0); box-shadow: 0 6px 18px rgba(255, 0, 0, 0.4); }
}


/* ========================================= */
/* 2. ZONE CENTRALE (La Table)               */
/* ========================================= */
#game-container {
    grid-area: table;
    position: relative;
    width: calc(var(--table-w) - 100px);
    height: calc(var(--table-h) - 100px);
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #225e3f 0%, #153926 100%);
    border-radius: 20px;
    border: 8px solid #eaeaea;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 60px rgba(0,0,0,0.35);
}

/* Conteneur des avatars / labels (positionné au-dessus de la table) */
#opponents-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}

/* Le "Plateau" central (Pioche, Talon) */
#table-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--gap);
    z-index: 10;
    width: min(60%, 420px);
    height: min(48%, 380px);
    padding: clamp(12px, 2.6vw, 32px);
    background: rgba(0,0,0,0.18);
    border-radius: 30px;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.04);
}

.indicators-row {
    display: flex; justify-content: center; width: 100%; padding: 0 12px;
}
#active-color-indicator {
    font-size: 0.85em; font-weight: bold; text-transform: uppercase;
    padding: 6px 14px; border-radius: 14px; background: #222;
    border: 1px solid rgba(255,255,255,0.12); transition: background 0.25s;
}
#direction-indicator { font-size: 1.1em; color: rgba(255,255,255,0.6); }

.piles-row {
    display: flex; gap: 20px; align-items: center; justify-content: center;
}

/* Pioche et Talon */
.draw-deck, #pile { width: var(--card-w); height: var(--card-h); }

.draw-deck {
    background: linear-gradient(135deg, #2c3e50, #111);
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative;
    transition: transform 0.18s;
}
.draw-deck:hover { transform: translateY(-6px); border-color: #f1c40f; }
.draw-deck::after { content: 'ULTIMO'; color: #e74c3c; font-weight: 900; transform: rotate(-25deg); }

/* ========================================= */
/* 3. ZONE BASSE (Main & Contrôles)          */
/* ========================================= */
#bottom-area {
    grid-area: bottom-bar;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 6px;
}

/* Avatars couleurs (cosmétiques) */
.player-label[data-slot="0"] .player-avatar { background: #3498db; }
.player-label[data-slot="1"] .player-avatar { background: #e74c3c; }
.player-label[data-slot="2"] .player-avatar { background: #2ecc71; }
.player-label[data-slot="3"] .player-avatar { background: #9b59b6; }
.player-label[data-slot="4"] .player-avatar { background: #f1c40f; }
.player-label[data-slot="5"] .player-avatar { background: #e67e22; }
.player-label[data-slot="6"] .player-avatar { background: #1abc9c; }
.player-label[data-slot="7"] .player-avatar { background: #7f8c8d; }

/* MAIN DU JOUEUR - position absolute pour faciliter le centrage */
#my-hand {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: var(--hand-height);
    width: min(96%, calc(var(--table-w) - 24px));
    z-index: 5;
    pointer-events: none;
}

/* Cartes individuelles dans la main */
#my-hand .ultimo-card {
    pointer-events: auto;
    width: var(--card-w);
    height: var(--card-h);
    margin-left: calc(var(--card-w) * -0.28);
    transition: transform 0.18s, margin 0.18s, box-shadow 0.18s;
    box-shadow: -4px 0 12px rgba(0,0,0,0.35);
    cursor: pointer;
    transform-origin: bottom center;
    border-radius: 10px;
}

/* Hover/Selection */
#my-hand .ultimo-card:hover { transform: translateY(-12px) scale(1.05); z-index: 90; }
#my-hand .ultimo-card.selected { transform: translateY(-38px) scale(1.06) !important; z-index: 100 !important; box-shadow: 0 10px 30px rgba(241,196,15,0.18); border: 2px solid #fff; }
#my-hand .ultimo-card.playable { border: 3px solid #f1c40f; animation: glowPlayable 2s infinite; }
#my-hand .ultimo-card.not-playable { filter: brightness(0.6); }

/* Glow animation for playable */
@keyframes glowPlayable {
    0% { box-shadow: 0 0 6px #f1c40f; }
    50% { box-shadow: 0 0 22px #f1c40f; }
    100% { box-shadow: 0 0 6px #f1c40f; }
}

/* Boutons d'actions */
#game-controls {
    display: flex; gap: 12px; margin-bottom: 6px; z-index: 60;
    align-items: center; justify-content: center;
    pointer-events: auto;
}
.btn-action {
    padding: 10px 22px; border-radius: 24px; font-weight: 800; border: none;
    cursor: pointer; text-transform: uppercase; color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: transform 0.08s, filter 0.12s;
}
.btn-action:active { transform: scale(0.96); }
.btn-play-action { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.btn-take-action { background: linear-gradient(135deg, #8e44ad, #9b59b6); }
.btn-cut-action { background: linear-gradient(135deg, #c0392b, #e74c3c); }

/* Bouton ULTIMO Spécial */
.btn-ultimo-action { 
    background: linear-gradient(135deg, #d35400, #e67e22); 
    width: 74px; height: 56px; border-radius: 50%; padding: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.92em; border: 2px solid rgba(255,255,255,0.12);
}

/* ========================================= */
/* CARTES - DESIGN AMÉLIORÉ                   */
/* ========================================= */
.ultimo-card {
    width: var(--card-w);
    height: var(--card-h);
    border-radius: 14px;
    position: relative;
    user-select: none;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.03));
    transition: transform .18s ease, box-shadow .18s ease;
    cursor: pointer;
    will-change: transform;
    /* Deep subtle shadow + rim */
    box-shadow: 0 18px 40px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.35);
    overflow: visible;
}

/* Slight 3D tilt on hover for desktop */
@media (hover: hover) {
    .ultimo-card:hover { transform: translateY(-8px) rotateX(6deg); z-index:120; }
}

.card-inner {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* subtle inner bevel */
    box-shadow: inset 0 6px 18px rgba(0,0,0,0.25), inset 0 -6px 10px rgba(255,255,255,0.02);
    transform-origin: center;
}

/* White oval (ULTIMO trademark) with soft edge + slight emboss */
.card-inner::before {
    content: '';
    position: absolute;
    z-index: 1;
    width: 82%;
    height: 62%;
    left: 50%;
    top: 48%;
    transform: translate(-50%,-50%) rotate(-22deg);
    background: radial-gradient(ellipse at center,
        rgba(255,255,255,0.98) 0%,
        rgba(255,255,255,0.95) 60%,
        rgba(255,255,255,0.90) 100%);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18), inset 0 8px 30px rgba(255,255,255,0.35);
}

/* Gloss strip */
.card-inner::after {
    content: '';
    position: absolute;
    z-index: 3;
    top: -12%;
    right: -18%;
    width: 60%;
    height: 46%;
    transform: rotate(-18deg);
    background: linear-gradient(120deg, rgba(255,255,255,0.28), rgba(255,255,255,0.02));
    filter: blur(6px);
    mix-blend-mode: screen;
    pointer-events: none;
}

/* Central value */
.card-val {
    z-index: 4;
    font-family: 'Arial Black', 'Impact', sans-serif;
    font-weight: 900;
    font-size: clamp(1.4rem, 3.6vw, 3.2rem);
    line-height: 1;
    text-align: center;
    -webkit-text-stroke: 1.2px rgba(0,0,0,0.6);
    text-shadow: 0 6px 20px rgba(0,0,0,0.35);
    pointer-events: none;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 8px;
    background: transparent;
}

/* Corner values */
.card-corner {
    position: absolute;
    z-index: 5;
    color: rgba(255,255,255,0.96);
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
    font-size: calc(var(--card-w) * 0.12);
    line-height: 1;
}
.top-left { top: 8px; left: 10px; transform: none; }
.bottom-right { bottom: 8px; right: 10px; transform: rotate(180deg); }

/* Small action tag (for +2, +4, skip, reverse) */
.card-tag {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 6;
    padding: 4px 6px;
    border-radius: 8px;
    font-weight: 900;
    font-size: calc(var(--card-w) * 0.12);
    color: rgba(255,255,255,0.96);
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(4px);
    -webkit-text-stroke: 0.6px rgba(0,0,0,0.45);
}

/* PLAYABLE / SELECTED states */
.ultimo-card.playable { outline: 3px solid rgba(241,196,15,0.12); box-shadow: 0 26px 60px rgba(241,196,15,0.08); transform: translateY(-6px); }
.ultimo-card.selected { transform: translateY(-44px) scale(1.06); box-shadow: 0 34px 80px rgba(241,196,15,0.20); z-index:140; }

/* Color faces: glossy gradients and matching central text color */
.card-red .card-inner {
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.02)),
        linear-gradient(180deg, #ff6b6b 0%, #c0392b 70%);
}
.card-red .card-val { color: #ff3b3b; }

.card-blue .card-inner {
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.02)),
        linear-gradient(180deg, #66a6ff 0%, #2b7aa0 70%);
}
.card-blue .card-val { color: #4aa3ff; }

.card-green .card-inner {
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.02)),
        linear-gradient(180deg, #8ef7c6 0%, #1f8a5a 70%);
}
.card_green, .card-green .card-val { color: #2ae28a; }

.card-yellow .card-inner {
    background-image:
        linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.04)),
        linear-gradient(180deg, #fff38a 0%, #d4a017 70%);
}
.card-yellow .card-val { color: #f1c40f; text-shadow: 0 4px 10px rgba(0,0,0,0.35); }

/* Wilds: colorful oval + subtle texture */
.card-black .card-inner {
    background: linear-gradient(180deg, #2f3437 0%, #1b2022 100%);
}
.card-black .card-inner::before {
    background: conic-gradient(#ff5252 0 90deg, #448aff 90deg 180deg, #f1c40f 180deg 270deg, #69f0ae 270deg 360deg);
    box-shadow: inset 0 8px 28px rgba(0,0,0,0.6);
    border: 3px solid rgba(255,255,255,0.85);
}
.card-black .card-val { color: #fff; -webkit-text-stroke: 0.8px rgba(0,0,0,0.6); }

/* Responsive adjustments */
@media (max-width: 600px) {
    .ultimo-card { border-radius: 10px; padding: calc(var(--card-w) * 0.045); }
    .card-val { font-size: clamp(1rem, 6vw, 1.8rem); -webkit-text-stroke: 0.8px rgba(0,0,0,0.5); }
    .card-inner::after { display: none; } /* reduce clutter on small screens */
}

/* Accessibility: remove transforms on touch devices */
@media (hover: none) {
    .ultimo-card:hover { transform: none; }
    .ultimo-card.playable { transform: none; }
}

/* small helper to position numeric center reliably */
.card-center {
    z-index: 4;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(0, 0, 0, 0.96);
    font-weight: 900;
    font-size: clamp(1.4rem, 3.6vw, 3.2rem);
    line-height: 1;
    text-align: center;
}

/* ========================================= */
/* MODALS & PICKERS                          */
/* ========================================= */
#color-picker {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center; justify-content: center;
    z-index: 3000; backdrop-filter: blur(4px);
}
.color-picker-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.color-btn { width: 110px; height: 110px; border-radius: 50%; cursor: pointer; border: 6px solid #fff; transition: transform .14s; box-shadow: 0 6px 22px rgba(0,0,0,0.45); }
.color-btn:hover { transform: scale(1.06); box-shadow: 0 10px 32px rgba(255,255,255,0.06); }
.bg-red { background: #e74c3c; } .bg-blue { background: #3498db; } .bg-green { background: #2ecc71; } .bg-yellow { background: #f1c40f; }

/* Score modal */
#score-modal {
    position: fixed; top:0; left:0; width:100%; height:100%; display:none;
    background: rgba(0,0,0,0.9); z-index: 10; align-items:center; justify-content:center;
}
.score-box { background: #fff; color: #222; padding: 28px; border-radius: 14px; width: min(560px, 92%); text-align:center; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }

/* ========================================= */
/* RESPONSIVE RULES                           */
/* ========================================= */
@media (max-width: 900px) {
    #game-container { width: 96vw; height: 72vh; border-radius: 12px; border-width: 6px; }
    #table-center { width: 320px; height: 200px; padding: 12px; }
    #my-hand { bottom: 8px; width: 98%; }
    #my-hand .ultimo-card { margin-left: calc(var(--card-w) * -0.18); }
}

@media (max-width: 600px) {
    #screen-game { grid-template-rows: 60px 1fr calc(var(--card-h) + 40px); }
    #table-center {
        position: absolute; /* On la sort du flux grid pour la centrer manuellement */
        top: 45%; 
        left: 50%;
        transform: translate(-50%, -50%);
        width: 240px !important;  /* Largeur fixe petite */
        height: 160px !important; /* Hauteur fixe petite */
        padding: 10px;
        gap: 10px;
        z-index: 5; /* En dessous des pseudos (qui sont à z-index 10) */
    }

    #my-hand .ultimo-card { width: 60px; height: 90px; margin-left: -10px; }
    .card-inner::before { width: 78%; height: 60%; }
    .card-val { font-size: 1.6rem; }
    #active-color-indicator { font-size: 10px; padding: 4px 8px; }
    #direction-indicator { font-size: 14px; }
    
    /* Pseudos plus compacts */
    .player-label.dynamic {
        font-size: 11px;
    }
    
    .player-avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
        line-height: 28px;
    }
    #opponents-container { pointer-events: auto; }
}

/* Very small phones */
@media (max-width: 480px) {
    .btn-ultimo-action { width: 52px; height: 52px; }
    #my-hand { bottom: 6px; }
}

/* Accessibility helpers */
@media (hover: none) {
    #my-hand .ultimo-card:hover { transform: none; }
}

/* --- SCOREBOARD STYLING --- */
#score-modal {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.85);
}

.score-box {
    background: #1e272e;
    color: #fff;
    padding: 0; /* Reset padding for header/body split */
    border-radius: 20px;
    width: min(600px, 100%);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.score-header {
    background: linear-gradient(135deg, #2c3e50, #000);
    padding: 25px;
    text-align: center;
    border-bottom: 2px solid #f1c40f;
}

.score-header h2 {
    margin: 0;
    color: #f1c40f;
    text-transform: uppercase;
    font-size: 1.8em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.score-header p {
    margin: 5px 0 0;
    color: #bdc3c7;
    font-style: italic;
}

.score-body {
    padding: 20px;
}

.scoreboard-table {
    width: 100%;
    border-collapse: collapse;
}

.scoreboard-table th {
    text-align: left;
    color: #7f8c8d;
    font-size: 0.85em;
    text-transform: uppercase;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.scoreboard-table td {
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1.1em;
}

.scoreboard-table tr:last-child td { border-bottom: none; }

/* Styles de colonnes */
.col-rank { font-weight: bold; width: 60px; }
.col-name { font-weight: 600; }
.col-delta { text-align: right; font-family: monospace; }
.col-total { text-align: right; font-weight: 900; color: #fff; width: 100px; }

/* Styles spécifiques */
.score-delta {
    color: #e74c3c; /* Rouge pour les points pris */
    background: rgba(231, 76, 60, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.score-clean {
    color: #2ecc71; /* Vert pour 0 point */
    font-weight: bold;
}

.winner-row {
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.1), transparent);
}
.winner-row .col-name { color: #f1c40f; }

.my-row {
    background: rgba(255, 255, 255, 0.05);
}
.my-row .col-name::after {
    content: ' (Moi)';
    font-size: 0.7em;
    color: #bdc3c7;
    font-weight: normal;
}

.score-footer {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    gap: 15px;
}

.waiting-host {
    color: #95a5a6;
    font-style: italic;
    animation: blink 2s infinite;
}

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

/* --- ANIMATIONS AJOUTÉES --- */

/* 1. Carte volante (Ghost Card) */
.flying-card {
    position: fixed;
    z-index: 1000;
    width: var(--card-w);
    height: var(--card-h);
    border-radius: 14px;
    background: #fff; 
    pointer-events: none;
    /* AJOUT de width et height dans la transition et augmentation de la durée à 600ms */
    transition: 
        left 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
        top 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
        width 0.6s ease,
        height 0.6s ease,
        transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
        opacity 0.5s;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* 2. Rotation Direction */
.rotate-clockwise { animation: spin-right 0.5s ease-out forwards; }
.rotate-counter { animation: spin-left 0.5s ease-out forwards; }

@keyframes spin-right { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }
@keyframes spin-left { from { transform: rotate(0deg); } to { transform: rotate(-180deg); } }


/* 4. Pulse "C'est mon tour" */
.my-turn-pulse {
    animation: turnPulse 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.7);
}
@keyframes turnPulse {
    0% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(241, 196, 15, 0); }
    100% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0); }
}

/* Style pour le dos de la carte (flying card face cachée) */
.card-back-fly {
    background: linear-gradient(135deg, #2c3e50 0%, #000 100%);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px; /* Doit correspondre à vos cartes */
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
/* Petit motif "ULTIMO" au dos si vous voulez (optionnel) */
.card-back-fly::after {
    content: 'ULTIMO';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    color: #e74c3c;
    font-weight: 900;
    font-size: 14px;
}


/* ========================================== */
/* --- ADAPTATION MOBILE (Écrans < 600px) --- */
/* ========================================== */
@media (max-width: 600px), (max-height: 700px) {
    
    /* Retailler les cartes et la main */
    :root {
        --card-w: var(--card-w-mobile);
        --card-h: var(--card-h-mobile);
        --hand-height: var(--hand-height-mobile);
        --avatar-size: 32px;
        --label-font: 11px;
    }
    
    /* Positionnement de la zone de jeu */
    #game-container {
        /* On permet plus d'espace pour la main en bas */
        padding-bottom: var(--hand-height);
    }
    
    /* Retailler la carte de pioche et de défausse */
    #draw-pile, #discard-pile {
        width: var(--card-w);
        height: var(--card-h);
        font-size: 10px; /* Réduire la police des chiffres */
        border-radius: 8px; /* Coins plus petits */
    }
    
    /* Réduire la taille du sélecteur de couleur */
    #color-picker-modal .modal-box {
        width: 90vw;
        max-width: 300px;
    }

    .color-option {
        width: 60px;
        height: 60px;
    }
    
    /* Réduire l'espacement dans la main du joueur */
    #my-hand .hand-card {
        margin: 0 -12px;
    }

    /* Le panneau des règles et du salon */
    #rules-content, #lobby-content {
        padding: 10px;
    }
    
    /* Le panneau latéral (si vous en avez un) */
    #side-panel {
        display: none; /* Cachez le panneau latéral pour gagner de l'espace */
    }
    
    /* Les boutons de contrôle */
    #game-controls button {
        font-size: 12px;
    }

    /* Ajuster la taille des modales (score, erreur, confirmation) */
    .modal-box {
        width: 90vw;
        padding: 15px;
    }

    .rules-static-container {
        width: 100vw;
        max-width: 100%;
    }
}