body {
    background: linear-gradient(135deg, #1abc9c 0%, #34495e 100%);
}
hr {
    border: none;
    border-top: 2px solid #1abc9c;
    margin: 18px 0;
}

/* GAME PAGE DESIGN */
.game-card {
    margin: auto;
    margin-top: 32px;
    border-radius: 18px;
    max-width: 500px;
    width: 100%;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: visible !important;
}
.game-header {
    background: linear-gradient(90deg, #1abc9c 60%, #34495e 100%);
    color: #fff;
    padding: 20px 12px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.game-header h2 {
    margin: 0;
    font-size: 2.1em;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.game-content {
    flex: 1;
    padding: 32px 8px 56px 8px; /* padding haut et bas augmenté */
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    overflow: visible !important; /* force visible */
}

/* Encadrés situation et mots à trouver */
.game-situation-card, .game-word-card {
    border-radius: 12px;
    max-width: 350px;
    margin: 0 auto 18px auto;
    padding: 14px 18px 12px 18px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.10);
    font-size: 1em;
    width: 100%;
    min-height: unset; /* <-- retire toute hauteur minimale */
    height: auto;      /* <-- laisse la hauteur s'adapter au contenu */
    box-sizing: border-box;
}
.game-situation-card {
    background: #e0f7fa;
}
.game-word-card {
    background: #fffde7;
}
.situation-title, .word-title {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.05em;
    margin-bottom: 6px;
    gap: 6px;
}
.situation-text, .word-list {
    font-size: 1em;
    line-height: 1.4em;
    margin-left: 2px;
}
.word-list ol {
    padding-left: 18px;
    margin: 0;
}

/* TIMER CIRCULAR & MODERN */
.game-timer-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 110px; /* hauteur suffisante pour le SVG */
    padding-top: 8px;
    padding-bottom: 8px;
    box-sizing: border-box;
    overflow: visible !important;
}
.game-timer-circular {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
    min-height: 90px; /* force l'espace pour le minuteur */
    overflow: visible !important;
}
.countdown-svg {
    background: transparent;
    display: block;
    margin: 0 auto;
    width: 90px;
    height: 90px;
    max-width: 100%;
    max-height: 100%;
    overflow: visible !important;
}
.countdown-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 10;
}
.countdown-bar {
    fill: none;
    stroke: #ffa000;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 377;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.5s linear;
}
.countdown-text {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 2em;
    font-weight: bold;
    fill: #ffa000;
    dominant-baseline: middle;
    alignment-baseline: middle;
}

/* Boutons parfaitement alignés et identiques */
.game-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px; /* espace entre les boutons */
    margin-top: 18px;
}
.next-player-btn, .pause-btn {
    width: 160px;
    min-width: 120px;
    max-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    border-radius: 32px;
    padding: 12px 0;
    box-shadow: 0 4px 16px rgba(44,62,80,0.10);
    font-weight: bold;
    border: none;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
    gap: 8px;
    margin: 0; /* important: pas de margin vertical */
}

.next-player-btn {
    background: linear-gradient(90deg, #3f51b5 60%, #2196f3 100%);
    color: #fff;
    transition: background 0.2s;
}
.next-player-btn:hover {
    background: linear-gradient(90deg, #2196f3 60%, #3f51b5 100%);
    color: #fff;
}

.pause-btn {
    background: linear-gradient(90deg, #ffa000 60%, #1abc9c 100%);
    color: #fff;
    transition: background 0.2s;
}
.pause-btn:hover {
    background: linear-gradient(90deg, #1abc9c 60%, #ffa000 100%);
    color: #fff;
}
.settings-btn {
    margin-left: 16px;
    background: linear-gradient(90deg, #26a69a 60%, #80cbc4 100%);
    color: #fff;
    border-radius: 50%;
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(44,62,80,0.10);
    border: none;
    transition: background 0.2s;
}
.settings-btn:hover {
    background: linear-gradient(90deg, #80cbc4 60%, #26a69a 100%);
    color: #fff;
}
.settings-btn .material-icons {
    font-size: 1.7em;
}

/* POPUP STYLES */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(44,62,80,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.popup-content, .end-session-content {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 8px 32px rgba(44,62,80,0.18);
    text-align: center;
    min-width: 220px;
}
.end-session-content h2 {
    color: #e53935;
    margin: 16px 0 8px 0;
    font-size: 2em;
    font-weight: bold;
    letter-spacing: 1px;
}
@keyframes popIn {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
    .game-card {
        max-width: 98vw;
        margin-top: 8px;
        min-height: 96vh;
    }
    .game-header {
        padding: 12px 4px 8px 4px;
    }
    .game-content {
        padding: 28px 2px 64px 2px; /* padding haut et bas encore plus grand sur mobile */
        gap: 6px;
        overflow: visible !important;
    }
    .game-situation-card, .game-word-card {
        max-width: 98vw;
        padding: 8px 6px 8px 6px;
        font-size: 0.95em;
        margin-bottom: 10px;
        min-height: unset; /* <-- retire toute hauteur minimale sur mobile */
        height: auto;
    }
    .situation-title, .word-title {
        font-size: 1em;
    }
    .game-timer-wrapper {
        min-height: 100px; /* hauteur réduite mais suffisante sur mobile */
        padding-top: 4px;
        padding-bottom: 4px;
    }
    .game-timer-circular {
        min-height: 60px; /* espace garanti pour le minuteur sur mobile */
        margin-bottom: 6px;
        width: 100%;
        overflow: visible !important;
    }
    .countdown-svg {
        width: 60px;
        height: 60px;
        max-width: 100vw;
        max-height: 100vw;
        overflow: visible !important;
    }
}