/* ============================================================
   WHISTAO - Table de jeu
   ============================================================ */

/* Table de jeu principale */
.game-table {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, var(--felt-green-light) 0%, var(--felt-green) 50%, var(--felt-green-dark) 100%);
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-columns: minmax(0, max-content) 1fr minmax(0, max-content);
    overflow: hidden;
    max-width: 100vw;
}

/* Bordure bois de la table */
.game-table::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 8px solid var(--wood-brown);
    border-radius: 12px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 1;
}

/* Barre d'info en haut */
.game-info-bar {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 20px;
    background: rgba(0,0,0,0.4);
    z-index: 2;
    min-height: 40px;
}

/* Bloc gauche : tour + atout empiles */
.info-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.game-info-bar .round-info {
    font-size: 14px;
    color: var(--cream);
}

.game-info-bar .round-number {
    color: var(--gold);
    font-weight: bold;
    font-size: 16px;
}

.game-info-bar .trump-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: bold;
    color: var(--cream);
    padding: 2px 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid rgba(212,168,71,0.4);
}

.game-info-bar .trump-suit {
    font-size: 28px;
    font-weight: bold;
}

.trump-suit-spade, .trump-suit-club { color: #fff; text-shadow: 0 0 6px rgba(255,255,255,0.4); }
.trump-suit-heart, .trump-suit-diamond { color: var(--card-red); text-shadow: 0 0 6px rgba(255,80,80,0.4); }
.trump-no-trump { color: var(--cream-dark); font-style: italic; font-size: 15px; }

/* Indicateur sur/sous-demande */
.demand-info {
    font-size: 14px;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
    animation: fadeIn 0.3s ease;
}

.demand-icon {
    font-size: 16px;
    margin-right: 2px;
}

.demand-over {
    color: var(--inactive-red);
    background: rgba(231,76,60,0.15);
    border: 1px solid rgba(231,76,60,0.4);
}

.demand-under {
    color: var(--active-green);
    background: rgba(46,204,113,0.15);
    border: 1px solid rgba(46,204,113,0.4);
}

.demand-exact {
    color: var(--warning-orange);
    background: rgba(243,156,18,0.15);
    border: 1px solid rgba(243,156,18,0.4);
}

/* Bloc droite : boutons utilitaires */
.info-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Bouton son */
.sound-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.sound-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* Bouton revoir dernier pli */
.review-trick-btn {
    background: none;
    border: 1px solid rgba(212,168,71,0.4);
    font-size: 18px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
    color: var(--cream);
}

.review-trick-btn:hover {
    background: rgba(212,168,71,0.2);
    border-color: var(--gold);
}

/* Bouton tableau des scores */
.score-btn {
    background: none;
    border: 1px solid rgba(212,168,71,0.4);
    font-size: 18px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
    color: var(--cream);
}

.score-btn:hover {
    background: rgba(212,168,71,0.2);
    border-color: var(--gold);
}

/* Bouton plein écran */
.fullscreen-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    line-height: 1;
    flex-shrink: 0;
    color: var(--cream);
}

.fullscreen-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Overlay tableau des scores */
.scoreboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
    cursor: pointer;
}

.scoreboard-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    cursor: default;
}

/* Dans l'overlay, le tableau prend plus de place */
.scoreboard-overlay-content .scoreboard-container {
    max-height: 70vh;
}

.scoreboard-overlay-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.scoreboard-empty {
    font-size: 16px;
    color: var(--cream-dark);
    font-style: italic;
    padding: 20px;
}

/* Portrait mobile : overlay scoreboard plein écran */
@media (max-width: 600px) and (orientation: portrait) {
    .scoreboard-overlay-content {
        max-width: 100vw;
        max-height: 90vh;
        gap: 8px;
        padding: 0 4px;
    }

    .scoreboard-overlay-content .scoreboard-container {
        max-height: 78vh;
        max-width: 100vw;
    }

    .scoreboard-overlay-title {
        font-size: 17px;
    }
}

/* Overlay revoir le dernier pli */
.last-trick-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
    cursor: pointer;
}

.last-trick-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.last-trick-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.last-trick-hint {
    font-size: 13px;
    color: var(--cream-dark);
    opacity: 0.7;
}

/* Overlay contrats (tours 17-20) */
.bids-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 240px;
}

.bids-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    font-size: 16px;
    color: var(--cream);
}

.bids-player-name {
    font-weight: bold;
    min-width: 90px;
}

.bids-value {
    color: var(--gold);
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.bids-tricks {
    min-width: 50px;
    text-align: center;
    font-weight: bold;
}

.bids-over {
    color: var(--inactive-red);
}

.bids-under {
    color: var(--cream-dark);
}

.bids-exact {
    color: var(--active-green);
}

/* Timer */
.timer-bar-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(0,0,0,0.3);
    z-index: 5;
    display: flex;
    align-items: center;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: var(--active-green);
    transition: width 0.1s linear;
    border-radius: 0 3px 3px 0;
}

.timer-bar.timer-critical {
    animation: timerPulse 0.5s infinite;
}

.timer-label {
    position: absolute;
    right: 8px;
    top: -18px;
    font-size: 12px;
    font-weight: bold;
    color: var(--cream);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

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

/* Tableau récapitulatif D/P (flottant en haut à gauche, sous la barre d'info) */
.bids-summary {
    position: absolute;
    top: 46px;
    left: 6px;
    z-index: 10;
}

.bids-summary-table {
    border-collapse: collapse;
    font-size: 15px;
    background: rgba(0,0,0,0.55);
    border-radius: 6px;
    overflow: hidden;
}

.bids-summary-table th {
    padding: 3px 8px;
    font-size: 11px;
    color: var(--gold);
    text-transform: uppercase;
    font-weight: normal;
    border-bottom: 1px solid rgba(212,168,71,0.3);
}

.bids-summary-table td {
    padding: 3px 8px;
    text-align: center;
    color: var(--cream);
}

.bids-summary-name {
    text-align: left !important;
    font-weight: bold;
    max-width: 75px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.bids-summary-bid {
    color: var(--gold) !important;
    font-weight: bold;
}

.bids-summary-tricks {
    font-weight: bold;
}

.bids-summary-over {
    color: var(--inactive-red) !important;
}

.bids-summary-ok {
    color: var(--active-green) !important;
}

/* Zones des joueurs */
.player-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    z-index: 2;
    position: relative;
}

/* Joueur Sud (humain - en bas) */
.player-south {
    grid-column: 1 / -1;
    grid-row: 4;
    flex-direction: column;
    padding-bottom: 12px;
    max-width: 100%;
    overflow: visible;
}

/* Joueur Nord (en haut, sur le tapis) */
.player-north {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: column-reverse;
    padding: 6px 0;
    max-width: 100%;
    overflow: visible;
}

/* Joueur Ouest (à gauche) */
.player-west {
    grid-column: 1;
    grid-row: 3;
    padding-left: 12px;
    max-width: 18vw;
    overflow: hidden;
    justify-content: center;
}

/* Joueur Est (à droite) */
.player-east {
    grid-column: 3;
    grid-row: 3;
    padding-right: 12px;
    max-width: 18vw;
    overflow: hidden;
    justify-content: center;
}

/* Info joueur (nom, contrat, plis) */
.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(0,0,0,0.4);
    border-radius: 20px;
    font-size: 15px;
    white-space: nowrap;
    max-width: 100%;
    flex-shrink: 1;
}

/* Info joueur compacte sur les cotes */
.player-west .player-info,
.player-east .player-info {
    flex-wrap: wrap;
    white-space: normal;
    gap: 4px 8px;
    padding: 4px 10px;
    font-size: 13px;
    justify-content: center;
    flex-shrink: 0;
    z-index: 3;
    position: relative;
}

.player-name {
    font-weight: bold;
    color: var(--cream);
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
}

.player-bid {
    color: var(--gold);
    font-size: 15px;
    font-weight: bold;
}

.player-tricks {
    color: var(--cream-dark);
    font-size: 15px;
    font-weight: bold;
}

.player-score {
    color: var(--gold-light);
    font-weight: bold;
    font-size: 15px;
}

/* Indicateur de tour (à qui de jouer) */
.player-indicator {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: bold;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
}

.player-indicator.active {
    background: var(--active-green);
    box-shadow: 0 0 12px var(--active-green);
    animation: pulse 1s infinite;
    border-color: rgba(255,255,255,0.5);
}

.player-indicator.inactive {
    background: rgba(100,100,100,0.5);
    opacity: 0.8;
    border-color: rgba(255,255,255,0.15);
}

/* Zone centrale (pli en cours) */
.center-area {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Pli complet - label gagnant */
.trick-winner-label {
    font-size: 16px;
    font-weight: bold;
    color: var(--gold);
    text-align: center;
    padding: 6px 16px;
    background: rgba(0,0,0,0.6);
    border-radius: var(--border-radius);
    border: 1px solid var(--gold-dark);
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

.trick-completed {
    opacity: 0.95;
}

/* Bandeau score en jeu */
.score-strip {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.score-strip-item {
    text-align: center;
    font-size: 12px;
}

.score-strip-item .score-value {
    color: var(--gold);
    font-weight: bold;
    font-size: 16px;
}

/* Message central */
.center-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    padding: 16px 32px;
    background: rgba(0,0,0,0.7);
    border: 1px solid var(--gold);
    border-radius: var(--border-radius);
    color: var(--gold);
    font-size: 18px;
    font-weight: bold;
    animation: fadeIn 0.3s ease;
}

/* Dialog choix contrat */
.bid-dialog {
    position: absolute;
    bottom: calc(var(--card-height) + 130px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 20;
    animation: slideUp 0.3s ease;
}

.bid-dialog-title {
    font-size: 14px;
    color: var(--cream);
    margin-bottom: 4px;
}

.bid-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.bid-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: rgba(0,0,0,0.5);
    color: var(--cream);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.bid-btn:hover:not(:disabled) {
    background: var(--gold);
    color: var(--wood-brown-dark);
    transform: scale(1.1);
}

.bid-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #555;
}

/* Dialog choix atout */
.trump-dialog {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.trump-choices {
    display: flex;
    gap: 10px;
}

.trump-choice {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    border: 2px solid var(--gold-dark);
    background: rgba(0,0,0,0.4);
    color: var(--cream);
    font-size: 34px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trump-choice:hover {
    background: rgba(212,168,71,0.3);
    border-color: var(--gold);
    transform: scale(1.1);
}

.trump-choice-sa {
    font-size: 14px;
    font-weight: bold;
    color: var(--cream);
}

/* Option parler en dernier */
.speak-last-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--cream-dark);
}

.speak-last-option input[type="checkbox"] {
    accent-color: var(--gold);
    width: 18px;
    height: 18px;
}

/* Devinettes précédentes dans le dialog de devinette */
.trump-previous-guesses {
    margin-bottom: 12px;
    padding: 8px 14px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid rgba(212,168,71,0.3);
    min-width: 200px;
}

.trump-prev-title {
    font-size: 13px;
    color: var(--cream-dark);
    margin-bottom: 6px;
}

.trump-guess-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 15px;
    color: var(--cream);
}

/* Récapitulatif des devinettes d'atout */
.trump-result-dialog {
    min-width: 280px;
    text-align: center;
}

.trump-result-chooser {
    font-size: 16px;
    color: var(--cream);
    margin-bottom: 4px;
}

.trump-result-sep {
    border: none;
    border-top: 1px solid rgba(212,168,71,0.3);
    margin: 10px 0;
}

.trump-result-guesses {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
}

.trump-result-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    font-size: 16px;
    color: var(--cream);
}

.guess-player-name {
    font-weight: bold;
    min-width: 80px;
    text-align: left;
}

.guess-suit {
    font-size: 22px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    color: var(--cream);
}

.guess-suit.suit-red {
    color: var(--card-red);
}

.guess-correct {
    color: var(--active-green);
    font-weight: bold;
    font-size: 20px;
    min-width: 24px;
    text-align: center;
}

.guess-wrong {
    color: var(--inactive-red);
    font-weight: bold;
    font-size: 20px;
    min-width: 24px;
    text-align: center;
}

/* Bonus divinatoire */
.perfect-guess-dialog {
    text-align: center;
    min-width: 280px;
}

.perfect-guess-title {
    color: var(--gold) !important;
    text-shadow: 0 0 12px rgba(212,168,71,0.6);
}

.perfect-guess-desc {
    font-size: 14px;
    color: var(--cream-dark);
    margin-bottom: 12px;
}

.perfect-guess-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perfect-guess-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(212,168,71,0.15);
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    font-size: 16px;
}

.perfect-guess-name {
    font-weight: bold;
    color: var(--cream);
}

.perfect-guess-bonus {
    color: var(--gold);
    font-weight: bold;
    font-size: 18px;
}

/* Boutons de tri de la main */
.hand-sort-bar {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 2px;
}

.sort-btn {
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(212,168,71,0.3);
    background: rgba(0,0,0,0.3);
    color: var(--cream-dark);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.sort-btn:hover {
    border-color: var(--gold);
    background: rgba(212,168,71,0.15);
}

.sort-btn-active {
    background: rgba(212,168,71,0.3);
    border-color: var(--gold);
    color: var(--gold);
    font-weight: bold;
}

/* Dialog choix d'atout (non-modal, au-dessus de la main) */
.trump-choose-dialog {
    position: absolute;
    bottom: calc(var(--card-height) + 110px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 20;
    padding: 16px 24px;
    background: rgba(0,0,0,0.88);
    border: 2px solid var(--gold);
    border-radius: 12px;
    animation: slideUp 0.3s ease;
}

.trump-choose-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--gold);
}

/* Dialog devinette d'atout (non-modal, au-dessus de la main) */
.trump-guess-dialog {
    position: absolute;
    bottom: calc(var(--card-height) + 130px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 20;
    padding: 14px 20px;
    background: rgba(0,0,0,0.88);
    border: 2px solid var(--gold);
    border-radius: 12px;
    animation: slideUp 0.3s ease;
}

.trump-guess-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--gold);
}

.trump-guess-dialog .trump-previous-guesses {
    margin-bottom: 4px;
    padding: 6px 10px;
    min-width: 160px;
}

/* Couleurs des boutons de couleur */
.trump-choice-red {
    color: var(--card-red);
}

/* Résultat du pli */
.trick-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    border: 1px solid var(--gold);
    border-radius: var(--border-radius);
    padding: 12px 20px;
    color: var(--gold);
    font-weight: bold;
    z-index: 15;
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .game-table::before {
        border-width: 4px;
    }

    .game-info-bar {
        padding: 4px 12px;
        font-size: 13px;
        min-height: 36px;
    }

    .game-info-bar .trump-info {
        font-size: 14px;
        padding: 2px 8px;
    }

    .game-info-bar .trump-suit {
        font-size: 24px;
    }

    .player-info {
        font-size: 14px;
        padding: 5px 12px;
        gap: 7px;
    }

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

    .player-bid,
    .player-tricks,
    .player-score {
        font-size: 14px;
    }

    /* Boutons contrat plus grands pour le tactile */
    .bid-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
        min-width: 50px;
        min-height: 50px;
    }

    .bid-buttons {
        gap: 8px;
    }

    .bid-dialog {
        bottom: calc(var(--card-height) + 110px);
    }

    .bid-dialog-title {
        font-size: 15px;
    }

    /* Choix d'atout plus grands */
    .trump-choice {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }

    .trump-choices {
        gap: 12px;
    }

    .trump-choose-dialog {
        bottom: calc(var(--card-height) + 110px);
    }

    .trump-guess-dialog {
        bottom: calc(var(--card-height) + 110px);
    }

    /* Réduire les paddings latéraux */
    .player-west { padding-left: 6px; max-width: 15vw; }
    .player-east { padding-right: 6px; max-width: 15vw; }
    .player-south { padding-bottom: 8px; }
    .player-north { padding: 4px 0; }

    .bids-summary { top: 42px; }
    .bids-summary-table { font-size: 12px; }
    .bids-summary-name { max-width: 55px; font-size: 11px; }

    /* Message central un peu plus petit */
    .center-message {
        font-size: 16px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .game-info-bar {
        padding: 3px 8px;
        font-size: 12px;
        min-height: 32px;
    }

    .game-info-bar .trump-info {
        font-size: 13px;
        padding: 1px 6px;
    }

    .game-info-bar .trump-suit {
        font-size: 20px;
    }

    .player-info {
        font-size: 13px;
        padding: 4px 10px;
        gap: 5px;
    }

    .player-name {
        max-width: 60px;
        font-size: 13px;
    }

    .player-bid,
    .player-tricks,
    .player-score {
        font-size: 13px;
    }

    .bid-btn {
        width: 48px;
        height: 48px;
        font-size: 17px;
    }

    .bid-dialog {
        bottom: calc(var(--card-height) + 95px);
    }

    .trump-choice {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }

    .trump-choose-dialog {
        bottom: calc(var(--card-height) + 95px);
    }

    .trump-guess-dialog {
        bottom: calc(var(--card-height) + 95px);
    }

    .player-west { padding-left: 4px; max-width: 13vw; }
    .player-east { padding-right: 4px; max-width: 13vw; }
    .player-south { padding-bottom: 6px; }
    .player-north { padding: 3px 0; }

    .bids-summary { top: 38px; }
    .bids-summary-table { font-size: 11px; }
    .bids-summary-table th { font-size: 8px; padding: 1px 4px; }
    .bids-summary-table td { padding: 2px 4px; }
    .bids-summary-name { max-width: 50px; font-size: 9px; }

    .center-message {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* ===========================
   PAYSAGE MOBILE — Layout optimisé
   =========================== */
@media (max-height: 500px) and (orientation: landscape) {

    .game-table {
        grid-template-rows: auto auto minmax(0, 1fr) auto;
    }

    .game-table::before {
        border-width: 3px;
    }

    /* Info bar ultra-compacte */
    .game-info-bar {
        padding: 2px 12px;
        min-height: 24px;
        font-size: 11px;
    }

    .info-left {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .game-info-bar .trump-info {
        font-size: 12px;
        padding: 1px 6px;
    }

    .game-info-bar .trump-suit {
        font-size: 18px;
    }

    .game-info-bar .round-info {
        font-size: 11px;
    }

    .game-info-bar .round-number {
        font-size: 13px;
    }

    .demand-info {
        font-size: 11px;
        padding: 1px 6px;
    }

    /* Joueurs compacts */
    .player-info {
        font-size: 11px;
        padding: 2px 8px;
        gap: 5px;
    }

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

    .player-bid,
    .player-tricks,
    .player-score {
        font-size: 11px;
    }

    .player-indicator {
        width: 22px;
        height: 22px;
        font-size: 12px;
        border-width: 1px;
    }

    .player-south {
        padding-bottom: 2px;
    }

    .player-north {
        padding: 1px 0;
    }

    .player-west {
        padding-left: 6px;
        max-width: 18vw;
    }

    .player-east {
        padding-right: 6px;
        max-width: 18vw;
    }

    /* Tableau D/P compact */
    .bids-summary { top: 30px; left: 4px; }
    .bids-summary-table { font-size: 10px; }
    .bids-summary-table th { font-size: 8px; padding: 1px 4px; }
    .bids-summary-table td { padding: 1px 4px; }
    .bids-summary-name { max-width: 50px; font-size: 9px; }

    /* Zones latérales plus larges en paysage */
    .player-west .player-info,
    .player-east .player-info {
        font-size: 10px;
        padding: 2px 6px;
        gap: 3px 5px;
    }

    /* Main du joueur compact */
    .hand {
        padding: 2px 4px;
    }

    /* Bid dialog */
    .bid-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
        min-width: 42px;
        min-height: 42px;
    }

    .bid-buttons {
        gap: 4px;
    }

    .bid-dialog {
        bottom: calc(var(--card-height) + 55px);
        gap: 4px;
    }

    .bid-dialog-title {
        font-size: 12px;
    }

    /* Sort buttons compact */
    .hand-sort-bar { gap: 3px; margin-bottom: 1px; }
    .sort-btn { font-size: 10px; padding: 1px 6px; }

    /* Trump choose dialog compact */
    .trump-choose-dialog {
        bottom: calc(var(--card-height) + 55px);
        padding: 10px 16px;
        gap: 6px;
    }
    .trump-choose-title { font-size: 13px; }

    .trump-guess-dialog {
        bottom: calc(var(--card-height) + 55px);
        padding: 10px 16px;
        gap: 4px;
    }
    .trump-guess-title { font-size: 12px; }

    /* Trump dialog compact */
    .trump-choice {
        width: 52px;
        height: 52px;
        font-size: 28px;
    }

    .trump-choices {
        gap: 8px;
    }

    .speak-last-option {
        font-size: 12px;
    }

    /* Winner label compact */
    .trick-winner-label {
        font-size: 13px;
        padding: 3px 10px;
        margin-bottom: 4px;
    }

    /* Message central compact */
    .center-message {
        font-size: 14px;
        padding: 8px 16px;
    }

    /* Review trick button compact */
    .review-trick-btn {
        font-size: 14px;
        padding: 2px 6px;
    }

    .score-btn {
        font-size: 14px;
        padding: 2px 6px;
    }

    .fullscreen-btn {
        font-size: 14px;
        padding: 2px 6px;
    }

    .sound-toggle {
        font-size: 16px;
        padding: 2px 6px;
    }

    .scoreboard-overlay-title {
        font-size: 16px;
    }
}

/* Très petit paysage (iPhone SE landscape ~320px height) */
@media (max-height: 400px) and (orientation: landscape) {

    .game-info-bar {
        padding: 1px 10px;
        min-height: 20px;
    }

    .player-info {
        font-size: 10px;
        padding: 1px 6px;
        gap: 4px;
    }

    .player-indicator {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .bids-summary { top: 24px; left: 3px; }
    .bids-summary-table { font-size: 9px; }
    .bids-summary-table th { font-size: 7px; padding: 1px 3px; }
    .bids-summary-table td { padding: 1px 3px; }
    .bids-summary-name { max-width: 40px; font-size: 8px; }

    .player-north {
        padding: 0;
    }

    .player-south {
        padding-bottom: 1px;
    }

    .bid-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
        min-width: 38px;
        min-height: 38px;
    }

    .bid-dialog {
        bottom: calc(var(--card-height) + 45px);
    }

    .trump-choice {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .trump-choose-dialog {
        bottom: calc(var(--card-height) + 30px);
        padding: 8px 12px;
        gap: 4px;
    }
    .trump-choose-title { font-size: 12px; }

    .trump-guess-dialog {
        bottom: calc(var(--card-height) + 30px);
        padding: 8px 12px;
        gap: 3px;
    }
    .trump-guess-title { font-size: 11px; }
}

/* ============================================================
   Disconnect / Reconnect indicators
   ============================================================ */

.player-indicator.disconnected {
    background: var(--warning-orange);
    box-shadow: 0 0 8px var(--warning-orange);
    animation: pulse 1.5s infinite;
    border-color: rgba(255,255,255,0.4);
}

.player-indicator.bot-replaced {
    background: var(--inactive-red);
    opacity: 0.7;
    border-color: rgba(255,255,255,0.2);
}

.player-status-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: bold;
    white-space: nowrap;
}

.disconnected-badge {
    background: rgba(243, 156, 18, 0.3);
    color: var(--warning-orange);
    border: 1px solid var(--warning-orange);
}

.bot-badge {
    background: rgba(231, 76, 60, 0.2);
    color: var(--inactive-red);
    border: 1px solid var(--inactive-red);
}

/* ============================================================
   Toast notifications
   ============================================================ */

.toast-container {
    position: absolute;
    top: 50px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
    pointer-events: none;
}

.game-toast {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: bold;
    color: var(--cream);
    animation: slideInRight 0.3s ease;
    pointer-events: auto;
    max-width: 280px;
}

.game-toast-info {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--gold-dark);
}

.game-toast-warning {
    background: rgba(243, 156, 18, 0.2);
    border: 1px solid var(--warning-orange);
    color: var(--warning-orange);
}

.game-toast-success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid var(--active-green);
    color: var(--active-green);
}

.game-toast-exit {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   Reconnecting overlay
   ============================================================ */

.reconnect-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

.reconnect-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.reconnect-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(212, 168, 71, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.reconnect-text {
    font-size: 20px;
    font-weight: bold;
    color: var(--gold);
}

.reconnect-subtext {
    font-size: 14px;
    color: var(--cream-dark);
}

/* ============================================================
   Leave game button
   ============================================================ */

.leave-game-btn {
    background: none;
    border: 1px solid rgba(231, 76, 60, 0.4);
    font-size: 18px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
    color: var(--cream);
}

.leave-game-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: var(--inactive-red);
}
