/**
 * ========================================================================
 * MAPPER GAME - Stylesheet
 * ========================================================================
 * Jeu de géographie où le joueur doit replacer les noms des pays
 * sur une carte du monde.
 * 
 * Structure:
 * 1. Variables CSS
 * 2. Reset & Base
 * 3. Layout principal
 * 4. Fenêtre Windows 98
 * 5. Zone de jeu
 * 6. Carte SVG
 * 7. Labels des pays
 * 8. Interface utilisateur
 * 9. États du jeu
 * 10. Responsive
 */

/* ========================================================================
   1. VARIABLES CSS
   ======================================================================== */
:root {
    /* Couleurs Windows 98 */
    --win98-bg: #c0c0c0;
    --win98-border-light: #dfdfdf;
    --win98-border-dark: #808080;
    --win98-titlebar: #90c695;
    --win98-titlebar-inactive: #808080;
    --win98-white: #ffffff;
    --win98-black: #000000;
    
    /* Couleur en-tête modales */
    --modal-header-bg: #333333;
    
    /* Couleurs du jeu */
    --mapper-bg: #000000;
    --mapper-ocean: #a4c8e1;
    --mapper-land: #d4e6c3;
    --mapper-land-hover: #b8d4a0;
    --mapper-land-correct: #90ee90;
    --mapper-land-wrong: #ffcccb;
    --mapper-border: #666666;
    
    /* Labels */
    --label-bg: #ffffcc;
    --label-border: #cccc00;
    --label-text: #333333;
    --label-dragging: #ffff99;
    
    /* Typographie */
    --font-system: 'MS Sans Serif', Tahoma, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

/* ========================================================================
   1.1 DARK MODE
   ======================================================================== */
.dark-mode {
    /* Couleurs du jeu - Dark Mode */
    --mapper-ocean: #1a2a3a;
    --mapper-land: #2d3a4a;
    --mapper-land-hover: #3d4a5a;
    --mapper-border: #4a5a6a;
    
    /* Labels - Dark Mode */
    --label-bg: #3a3a4a;
    --label-border: #5a5a6a;
    --label-text: #ffffff;
    
    /* Couleur en-tête modales - Dark Mode */
    --modal-header-bg: #1a2a3a;
}

/* Carte en mode sombre */
.dark-mode .world-map {
    background: var(--mapper-ocean);
}

.dark-mode .world-map path.country-path {
    fill: var(--mapper-land);
    stroke: var(--mapper-border);
}

.dark-mode .world-map path.country-path:hover,
.dark-mode .world-map path.country-path.country-hover {
    fill: var(--mapper-land-hover);
    stroke: #6a7a8a;
}

/* Labels placés sur la carte en mode sombre */
.dark-mode .placed-label {
    color: #ffffff !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.dark-mode .country-label-text {
    fill: #ffffff;
}

/* Labels dans la liste en mode sombre */
.dark-mode .country-label {
    background: #1a1a1a;
    border-color: #333;
    color: #ffffff;
}

.dark-mode .country-label:hover {
    background: #333;
}

.dark-mode .country-label.selected {
    background: #1565c0;
    border-color: #0d47a1;
    color: #ffffff;
}

/* Map container en mode sombre */
.dark-mode .map-container {
    background: var(--mapper-ocean);
}

/* ========================================================================
   2. RESET & BASE
   ======================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-system);
}

body {
    display: flex;
    flex-direction: column;
    background: var(--mapper-bg);
}

/* ========================================================================
   3. LAYOUT PRINCIPAL
   ======================================================================== */
.window-frame {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 8px;
    background: #1A2A3A;
    border: none;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    min-height: 0; /* Important pour flex */
}

/* ========================================================================
   4. FENÊTRE WINDOWS 98
   ======================================================================== */

/* Barre de titre */
.titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px;
    background: var(--modal-header-bg);
    color: white;
    font-weight: bold;
    font-size: 12px;
    user-select: none;
    flex-shrink: 0;
}

.titlebar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.titlebar-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.titlebar-text {
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
}

.titlebar-controls {
    display: flex;
    gap: 2px;
}

.titlebar-btn {
    width: 16px;
    height: 14px;
    background: var(--win98-bg);
    border: 1px outset var(--win98-border-light);
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-system);
    color: var(--win98-black);
}

.titlebar-btn:hover {
    background: #d4d4d4;
}

.titlebar-btn:active {
    border-style: inset;
}

/* Barre de menu */
.menubar {
    display: flex;
    padding: 2px 4px;
    background: #1A2A3A;
    border-bottom: 4px solid #000000;
    font-size: 11px;
    flex-shrink: 0;
    color: #ffffff;
}

.menu-item {
    padding: 2px 8px;
    cursor: pointer;
    position: relative;
}

.menu-item:hover {
    background: #3A4A5A;
    color: white;
}

/* Menu déroulant */
.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    background: #1A2A3A;
    border: 1px solid #000000;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.menu-item:hover .menu-dropdown,
.menu-item.menu-open .menu-dropdown {
    display: block;
}

.menu-dropdown-item {
    padding: 4px 12px;
    cursor: pointer;
    color: #ffffff;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-dropdown-item:hover {
    background: #3A4A5A;
    color: white;
}

.menu-checkbox {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Barre d'outils */
.toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--win98-bg);
    border-bottom: 1px solid var(--win98-border-dark);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 4px 12px;
    background: var(--win98-bg);
    border: 2px outset var(--win98-border-light);
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font-system);
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #d4d4d4;
}

.toolbar-btn:active:not(:disabled) {
    border-style: inset;
}

.toolbar-btn:disabled {
    color: var(--win98-border-dark);
    cursor: not-allowed;
}

.toolbar-btn.active {
    border-style: inset;
    background: #a0a0a0;
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--win98-border-dark);
    margin: 0 4px;
}

/* ========================================================================
   5. ZONE DE JEU
   ======================================================================== */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    margin: 0;
    overflow: hidden;
    position: relative;
    min-height: 0; /* Important pour flex */
}

.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

/* Zone de la carte */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden; /* Plus de scroll - le zoom/pan se fait via viewBox SVG */
    background: var(--mapper-ocean);
    min-height: 0;
    cursor: default;
}

/* Indicateur de niveau de zoom */
.zoom-indicator {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    font-family: var(--font-mono);
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.zoom-indicator.visible {
    opacity: 1;
}

.zoom-indicator.fading {
    opacity: 0;
}

/* HUD flottant en haut à droite */
.game-hud {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
    pointer-events: none;
}

.hud-item {
    background: rgba(0, 0, 0, 0.7);
    color: #4CAF50;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    font-family: var(--font-mono);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    text-align: right;
}

.hud-item#status-message {
    color: #4CAF50;
}

.hud-item#status-time {
    color: #ffffff;
}

.hud-item#status-score {
    color: #4CAF50;
}

/* Curseur pour le pan quand zoomé */
.map-container.zoomed {
    cursor: grab;
}

.map-container.panning {
    cursor: grabbing;
}

/* ========================================================================
   6. CARTE SVG
   ======================================================================== */
.world-map {
    display: block;
    /* Le SVG remplit 100% du conteneur - le zoom se fait via viewBox */
    width: 100%;
    height: 100%;
    /* Pas de transition pour éviter le lag du zoom */
    will-change: auto;
    /* Améliorer le rendu vectoriel - crisp-edges pour des bordures nettes */
    shape-rendering: geometricPrecision;
    /* Le SVG est re-rendu nativement, pas besoin d'optimisation d'image */
}

/* Style de base des pays */
.world-map path.country-path {
    fill: var(--mapper-land);
    stroke: var(--mapper-border);
    stroke-width: 0.5;
    cursor: pointer;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

/* Survol des pays */
.world-map path.country-path:hover,
.world-map path.country-path.country-hover {
    fill: var(--mapper-land-hover);
    stroke: #444444;
    stroke-width: 1;
}

/* Pays correct - Reste vert permanent */
.world-map path.country-correct {
    fill: #4caf50 !important;
    stroke: #2e7d32;
    stroke-width: 1;
    animation: correctPulse 0.5s ease;
}

@keyframes correctPulse {
    0% { fill: #81c784; }
    50% { fill: #2e7d32; }
    100% { fill: #4caf50; }
}

/* Pays incorrect (loin) - Rouge temporaire */
.world-map path.country-wrong {
    fill: #e53935 !important;
    stroke: #b71c1c;
    stroke-width: 1.5;
    animation: wrongShake 0.4s ease;
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Pays voisin (proche) - Orange temporaire */
.world-map path.country-neighbor {
    fill: #ff9800 !important;
    stroke: #e65100;
    stroke-width: 1.5;
    animation: neighborPulse 0.4s ease;
}

@keyframes neighborPulse {
    0% { fill: #ffcc80; }
    50% { fill: #e65100; }
    100% { fill: #ff9800; }
}

/* Pays en surbrillance */
.world-map path.country-highlight {
    fill: #ffd700;
    stroke: #ff8c00;
    stroke-width: 2;
}

/* ========================================================================
   6.1 LABELS SUR LA CARTE SVG
   ======================================================================== */

/* Groupe de labels */
.country-labels-group {
    pointer-events: none;
}

/* Labels texte SVG */
.country-label-text {
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 8px;
    font-weight: bold;
    fill: #333333;
    stroke: #ffffff;
    stroke-width: 2px;
    paint-order: stroke fill;
    pointer-events: none;
    user-select: none;
}

/* ========================================================================
   6.2 LABELS VERROUILLÉS (placés correctement)
   ======================================================================== */

.locked-label {
    pointer-events: none;
    animation: labelLock 0.4s ease;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Label en cours de disparition */
.locked-label.fading-out {
    opacity: 0;
}

/* Label caché (après 20 secondes) */
.locked-label.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Label qui réapparaît brièvement au clic */
.locked-label.showing {
    opacity: 1;
    visibility: visible;
    animation: labelFlash 0.3s ease;
}

@keyframes labelFlash {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.locked-label .locked-bg {
    fill: rgba(46, 125, 50, 0.95);
    stroke: #1b5e20;
    stroke-width: 1.5px;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.4));
}

.locked-label .locked-text {
    fill: #ffffff;
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-weight: bold;
    stroke: none;
    text-shadow: none;
    /* Le font-size est défini dynamiquement dans le JS */
}

@keyframes labelLock {
    0% {
        opacity: 0;
        transform: scale(1.5);
    }
    50% {
        opacity: 1;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================================================
   6.3 TOOLTIP POUR LES PETITS PAYS
   ======================================================================== */

.map-tooltip {
    position: fixed;
    z-index: 3000;
    background: var(--label-bg);
    border: 1px solid var(--label-border);
    padding: 4px 10px;
    font-family: var(--font-system);
    font-size: 11px;
    font-weight: bold;
    color: var(--label-text);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    white-space: nowrap;
    border-radius: 2px;
}

/* Animation d'apparition du tooltip */
.map-tooltip {
    animation: tooltipFadeIn 0.15s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================================
   7. LABELS DES PAYS (DRAGGABLES)
   ======================================================================== */

/* Conteneur des labels visible */
.labels-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 2px solid #000000;
    padding: 8px 12px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.labels-pool {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Wrapper pour les 3 labels visibles */
.labels-visible-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-width: 300px;
}

/* Bouton refresh */
.labels-refresh-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
    margin-left: 12px;
    padding: 8px;
    position: relative;
    z-index: 1;
}

.labels-refresh-btn .refresh-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: invert(1);
}

.labels-refresh-btn:hover {
    background: #333;
}

.labels-refresh-btn:active {
    background: #000;
}

.labels-refresh-btn.spinning {
    animation: spin 0.3s ease;
}

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

/* Animation de tremblement pour attirer l'attention */
.labels-refresh-btn.shake {
    animation: shuffleShake 0.5s ease-in-out;
}

@keyframes shuffleShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ========================================================================
   Animation curseur d'aide (hint)
   ======================================================================== */
.cursor-hint-animation {
    filter: drop-shadow(0 0 5px rgba(255, 200, 0, 0.8));
}

/* Message quand tous les pays sont placés */
.no-labels-message {
    padding: 10px 20px;
    font-family: var(--font-system);
    font-size: 14px;
    color: #006400;
    font-weight: bold;
}

/* Label de base */
.country-label {
    display: inline-block;
    padding: 6px 14px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--font-system);
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    position: relative;
    z-index: 1;
}

.country-label:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    background: #333;
}

/* Label sélectionné */
.country-label.selected {
    background: #90caf9;
    border-color: #1976d2;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
    animation: selectPulse 0.3s ease;
}

@keyframes selectPulse {
    0% { transform: translateY(-3px) scale(1); }
    50% { transform: translateY(-3px) scale(1.1); }
    100% { transform: translateY(-3px) scale(1.05); }
}

/* Wrapper quand GEO-COMBO est actif (3 labels sélectionnés) */
.labels-visible-wrapper.geo-combo-active {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(255, 87, 34, 0.2));
    border-radius: 8px;
    padding: 8px 12px;
    animation: comboGlow 1s ease-in-out infinite alternate;
}

@keyframes comboGlow {
    from {
        box-shadow: 0 0 5px rgba(255, 152, 0, 0.3);
    }
    to {
        box-shadow: 0 0 15px rgba(255, 87, 34, 0.5);
    }
}

.labels-visible-wrapper.geo-combo-active .country-label.selected {
    background: linear-gradient(135deg, #ffb74d, #ff9800);
    border-color: #e65100;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

/* ========================================================================
   GEO-COMBO - Effet de flamme sur les barres
   ======================================================================== */

/* Animation de flamme/scintillement */
@keyframes fireFlicker {
    0%, 100% {
        background-position: 0% 50%;
        filter: brightness(1);
    }
    25% {
        background-position: 50% 50%;
        filter: brightness(1.1);
    }
    50% {
        background-position: 100% 50%;
        filter: brightness(1.2);
    }
    75% {
        background-position: 50% 50%;
        filter: brightness(1.05);
    }
}

@keyframes emberGlow {
    0%, 100% {
        box-shadow: 
            inset 0 0 10px rgba(255, 100, 0, 0.3),
            0 0 5px rgba(255, 100, 0, 0.2);
    }
    50% {
        box-shadow: 
            inset 0 0 20px rgba(255, 150, 0, 0.5),
            0 0 15px rgba(255, 100, 0, 0.4);
    }
}

/* Titlebar en mode GEO-COMBO */
.titlebar.geo-combo-fire {
    background: linear-gradient(
        90deg,
        #0000ff 0%,
        #ff6600 15%,
        #ff9900 30%,
        #ffcc00 50%,
        #ff9900 70%,
        #ff6600 85%,
        #0000ff 100%
    );
    background-size: 200% 100%;
    animation: fireFlicker 0.8s ease-in-out infinite, emberGlow 1.2s ease-in-out infinite;
    transition: all 0.3s ease;
}

.titlebar.geo-combo-fire .titlebar-text {
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #ff6600,
        0 0 15px #ff3300;
    animation: textPulse 0.5s ease-in-out infinite alternate;
}

@keyframes textPulse {
    from { opacity: 0.9; }
    to { opacity: 1; }
}

/* Menubar en mode GEO-COMBO */
.menubar.geo-combo-fire {
    background: linear-gradient(
        180deg,
        var(--win98-bg) 0%,
        rgba(255, 150, 50, 0.3) 50%,
        var(--win98-bg) 100%
    );
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, #ff6600, #ffcc00, #ff6600) 1;
    animation: menubarFlicker 1s ease-in-out infinite;
}

@keyframes menubarFlicker {
    0%, 100% { border-image: linear-gradient(90deg, #ff6600, #ffcc00, #ff6600) 1; }
    50% { border-image: linear-gradient(90deg, #ffcc00, #ff6600, #ffcc00) 1; }
}

/* Toolbar en mode GEO-COMBO */
.toolbar.geo-combo-fire {
    background: linear-gradient(
        180deg,
        rgba(255, 150, 50, 0.15) 0%,
        var(--win98-bg) 100%
    );
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, #ff9900, #ff6600, #ff9900) 1;
}

.toolbar.geo-combo-fire .toolbar-btn {
    animation: btnGlow 0.6s ease-in-out infinite alternate;
}

@keyframes btnGlow {
    from {
        box-shadow: 0 0 2px rgba(255, 100, 0, 0.3);
    }
    to {
        box-shadow: 0 0 8px rgba(255, 150, 0, 0.6);
    }
}

/* Label placé correctement */
.country-label.placed {
    position: absolute;
    background: var(--mapper-land-correct);
    border-color: #228b22;
    cursor: default;
    animation: placeSuccess 0.3s ease;
}

@keyframes placeSuccess {
    0% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ========================================================================
   7.1 NOTIFICATION GEO-COMBO
   ======================================================================== */

.geo-combo-notification {
    position: absolute;
    right: 20px;
    bottom: 100px;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(255, 87, 34, 0.5);
    z-index: 1000;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    text-align: center;
    font-family: var(--font-system);
}

.geo-combo-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.geo-combo-notification.hide {
    opacity: 0;
    transform: translateY(-30px);
}

.geo-combo-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: comboTitlePulse 0.5s ease-in-out 3;
}

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

.geo-combo-bonus {
    font-size: 13px;
    opacity: 0.95;
}

/* ========================================================================
   7.2 NOTIFICATION AUTO-SHUFFLE
   ======================================================================== */

.auto-shuffle-notification {
    position: absolute;
    right: 20px;
    bottom: 100px;
    background: linear-gradient(135deg, #e53935, #c62828);
    color: white;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(229, 57, 53, 0.5);
    z-index: 1000;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    text-align: center;
    font-family: var(--font-system);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 320px;
}

.auto-shuffle-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.auto-shuffle-notification.hide {
    opacity: 0;
    transform: translateY(-20px);
}

/* Notification GEO-COMBO error - centrée en bas */
.auto-shuffle-notification.geo-combo-error {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    bottom: 80px;
}

.auto-shuffle-notification.geo-combo-error.show {
    transform: translateX(-50%) translateY(0);
}

.auto-shuffle-notification.geo-combo-error.hide {
    transform: translateX(-50%) translateY(-20px);
}

.auto-shuffle-icon {
    font-size: 24px;
    animation: shuffleSpin 0.6s ease-in-out 2;
}

@keyframes shuffleSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auto-shuffle-text {
    font-size: 14px;
    font-weight: bold;
}

/* Indicateur de drop valide sur la carte */
.map-container.drag-over {
    outline: 2px dashed #000080;
    outline-offset: -2px;
}

/* Highlight du pays pendant le survol avec un label */
.world-map path.country-path.drop-target {
    fill: #ffd700 !important;
    stroke: #ff8c00 !important;
    stroke-width: 2px !important;
}

/* ========================================================================
   8. INTERFACE UTILISATEUR
   ======================================================================== */

/* Message de chargement / placeholder */
.placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--win98-border-dark);
    z-index: 50;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.placeholder-title {
    font-size: 24px;
    font-weight: bold;
    color: #000080;
    margin-bottom: 8px;
}

.placeholder-text {
    font-size: 14px;
    color: #404040;
}

.placeholder-loading {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--win98-border-dark);
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--win98-bg);
    border-top-color: #000080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Message de succès */
.ready-message {
    background: #90ee90;
    border: 2px solid #228b22;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    color: #006400;
}

/* Timer et score */
.game-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Animation score gagné */
.score-anim {
    font-size: 2.2em;
    font-weight: bold;
    pointer-events: none;
    position: absolute;
    will-change: transform, opacity;
    transition: opacity 0.2s;
    user-select: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
}
.score-anim-green {
    color: #2ecc40;
}
.score-anim-orange {
    color: #ff9800;
}
.score-anim-purple {
    color: #8e44ad;
}
.score-anim-red {
    color: #e53935;
    text-shadow: 0 0 8px #e53935, 0 0 16px #e53935;
}

/* Effet shake sur la zone de score */
.score-shake {
    animation: scoreShake 0.7s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes scoreShake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

/* ========================================================================
   9. ÉTATS DU JEU
   ======================================================================== */

/* État: en attente */
.game-state-waiting .map-container {
    opacity: 0.5;
    pointer-events: none;
}

/* État: en jeu */
.game-state-playing .placeholder {
    display: none;
}

/* État: terminé */
.game-state-finished .labels-container {
    display: none;
}

.game-state-finished .map-container {
    pointer-events: none;
}

/* ========================================================================
   10. RESPONSIVE
   ======================================================================== */
@media (max-width: 768px) {
    .window-frame {
        margin: 4px;
    }

    .toolbar {
        padding: 4px;
        gap: 2px;
    }

    .toolbar-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

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

    .placeholder-icon {
        font-size: 48px;
    }

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

    .labels-container {
        padding: 6px 8px;
    }
    
    .labels-visible-wrapper {
        min-width: 200px;
        gap: 6px;
    }

    .country-label {
        padding: 6px 10px;
        font-size: 13px;
        max-width: 140px;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
    
    .labels-refresh-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .world-map {
        min-width: 600px;
        min-height: 300px;
    }
    
    /* Labels verrouillés plus petits */
    .locked-label .locked-text {
        font-size: 6px;
    }
}

@media (max-width: 480px) {
    .window-frame {
        margin: 2px;
    }
    
    .toolbar-separator {
        display: none;
    }
    
    .toolbar {
        justify-content: center;
    }
    
    .toolbar-btn {
        padding: 3px 6px;
        font-size: 9px;
    }
    
    .labels-visible-wrapper {
        min-width: 150px;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .country-label {
        padding: 5px 8px;
        font-size: 12px;
        max-width: 120px;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
    
    .labels-refresh-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
        margin-left: 4px;
    }
    
    .world-map {
        min-width: 500px;
        min-height: 250px;
    }
    
    /* Countdown plus petit */
    .countdown-number {
        font-size: 80px;
    }
    
    .countdown-text {
        font-size: 14px;
    }
    
    /* HUD responsive */
    .game-hud {
        top: 10px;
        right: 10px;
        gap: 5px;
    }
    
    .hud-item {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* ========================================================================
   11. LIEN RETOUR
   ======================================================================== */
.back-link {
    margin-left: auto;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 2px 8px;
}

.back-link:hover {
    color: #ffffff;
}

/* ========================================================================
   12. SCROLLBARS WINDOWS 98
   ======================================================================== */
.map-container::-webkit-scrollbar,
.labels-container::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

.map-container::-webkit-scrollbar-track,
.labels-container::-webkit-scrollbar-track {
    background: var(--win98-bg);
    border: 1px inset var(--win98-border-light);
}

.map-container::-webkit-scrollbar-thumb,
.labels-container::-webkit-scrollbar-thumb {
    background: var(--win98-bg);
    border: 2px outset var(--win98-border-light);
}

.map-container::-webkit-scrollbar-button,
.labels-container::-webkit-scrollbar-button {
    background: var(--win98-bg);
    border: 2px outset var(--win98-border-light);
    width: 16px;
    height: 16px;
}

/* ========================================================================
   13. MODALE DE SÉLECTION DE LANGUE
   ======================================================================== */

/* Overlay sombre */
.language-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.language-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Fenêtre modale - Thème sombre */
.language-modal {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    padding: 0;
    min-width: 320px;
    max-width: 90vw;
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Barre de titre de la modale */
.language-modal-title {
    background: #2a2a2a;
    color: #ffffff;
    padding: 12px 16px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    border-bottom: 1px solid #333;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Icône dans le titre de la modale */
.modal-title-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}

/* Sous-titre */
.language-modal-subtitle {
    padding: 20px 24px 12px;
    text-align: center;
    font-size: 13px;
    color: #b0b0b0;
}

/* Conteneur des drapeaux */
.language-flags {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 24px 32px 32px;
}

/* Boutons drapeaux - Style minimaliste */
.flag-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-system);
    transition: transform 0.2s ease;
    border-radius: 8px;
}

.flag-button:hover {
    transform: translateY(-4px) scale(1.05);
    background: rgba(255, 255, 255, 0.05);
}

.flag-button:active {
    transform: translateY(0) scale(0.98);
}

.flag-button:focus {
    outline: 2px solid #90caf9;
    outline-offset: 4px;
}

/* Emoji drapeau */
.flag-emoji {
    font-size: 48px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Images drapeaux PNG */
.flag-img {
    width: 64px;
    height: auto;
    display: block;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    transition: box-shadow 0.2s ease;
}

.flag-button:hover .flag-img {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Label sous le drapeau */
.flag-label {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

/* État sélectionné */
.flag-button.selected {
    background: rgba(144, 202, 249, 0.2);
}

/* Animation de fermeture */
.language-modal-overlay.closing {
    opacity: 0;
}

.language-modal-overlay.closing .language-modal {
    animation: modalDisappear 0.2s ease forwards;
}

@keyframes modalDisappear {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* ========================================================================
   13b. MODALE DE SÉLECTION DE DIFFICULTÉ
   ======================================================================== */

/* Overlay sombre */
.difficulty-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.difficulty-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Fenêtre modale - Thème sombre */
.difficulty-modal {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    padding: 0;
    min-width: 380px;
    max-width: 90vw;
    animation: modalAppear 0.3s ease;
}

/* Barre de titre de la modale */
.difficulty-modal-title {
    background: #2a2a2a;
    color: #ffffff;
    padding: 12px 16px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    border-bottom: 1px solid #333;
    border-radius: 6px 6px 0 0;
}

/* Sous-titre */
.difficulty-modal-subtitle {
    padding: 20px 24px 12px;
    text-align: center;
    font-size: 13px;
    color: #b0b0b0;
}

/* Conteneur des options de difficulté */
.difficulty-options {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px 24px;
}

/* Boutons de difficulté - Style minimaliste sombre */
.difficulty-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: #2a2a2a;
    border: 2px solid #404040;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-system);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    position: relative;
    min-width: 90px;
}

.difficulty-button:hover {
    background: #333;
    border-color: #555;
    transform: translateY(-3px);
}

.difficulty-button:active {
    transform: translateY(0);
    background: #252525;
}

.difficulty-button:focus {
    outline: 2px solid #90caf9;
    outline-offset: 2px;
}

/* Icône de difficulté */
.difficulty-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* Label de difficulté */
.difficulty-label {
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
}

/* Tooltip de description - caché par défaut */
.difficulty-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    width: 220px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Flèche du tooltip */
.difficulty-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #333;
}

/* Afficher le tooltip au survol (PC) */
.difficulty-button:hover .difficulty-tooltip {
    opacity: 1;
    visibility: visible;
}

/* État "pré-sélectionné" pour mobile (premier tap) */
.difficulty-button.touch-active {
    background: #404040;
    border-color: #555;
}

.difficulty-button.touch-active .difficulty-tooltip {
    opacity: 1;
    visibility: visible;
}

/* État sélectionné */
.difficulty-button.selected {
    background: #90caf9;
    border-color: #1976d2;
}

.difficulty-button.selected .difficulty-label {
    color: #0d47a1;
}

/* Style spécial pour le bouton Géo-Poursuite */
.difficulty-button-pursuit {
    background: linear-gradient(180deg, #3d3d00 0%, #4a4a00 100%);
    border-color: #666600;
}

.difficulty-button-pursuit:hover {
    background: linear-gradient(180deg, #4a4a00 0%, #5a5a00 100%);
    border-color: #808000;
}

.difficulty-button-pursuit .difficulty-label {
    color: #ffc107;
}

/* Animation de fermeture */
.difficulty-modal-overlay.closing {
    opacity: 0;
}

.difficulty-modal-overlay.closing .difficulty-modal {
    animation: modalDisappear 0.2s ease forwards;
}

/* ========================================================================
   14. MODALE DE FIN DE PARTIE
   ======================================================================== */

.endgame-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.endgame-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.endgame-modal {
    background: var(--win98-bg);
    border: 2px outset var(--win98-border-light);
    padding: 24px 32px;
    min-width: 320px;
    max-width: 90vw;
    text-align: center;
    animation: modalAppear 0.3s ease;
}

.endgame-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 24px;
    font-weight: bold;
    color: #000080;
    margin-bottom: 24px;
    font-family: var(--font-system);
}

.endgame-title-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.endgame-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.endgame-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px inset var(--win98-border-dark);
}

.endgame-stat-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-right: 12px;
}

.endgame-stat-label {
    flex: 1;
    text-align: left;
    font-family: var(--font-system);
    font-size: 14px;
    color: #404040;
}

.endgame-stat-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: bold;
    color: #000080;
}

.endgame-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.endgame-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-system);
    font-size: 14px;
    cursor: pointer;
    border: 2px outset var(--win98-border-light);
    transition: all 0.1s ease;
}

.endgame-btn:hover {
    background: #d4d4d4;
}

.endgame-btn:active {
    border-style: inset;
}

.endgame-btn-primary {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #333;
}

.endgame-btn-primary:hover {
    background: #333;
}

.endgame-btn-secondary {
    background: var(--win98-bg);
    color: #000000;
}

.endgame-btn-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.endgame-btn-primary .endgame-btn-icon {
    filter: invert(1);
}

/* Animation de fermeture modale fin */
.endgame-modal-overlay.closing {
    opacity: 0;
}

.endgame-modal-overlay.closing .endgame-modal {
    animation: modalDisappear 0.2s ease forwards;
}

/* Responsive pour mobile */
@media (max-width: 480px) {
    .endgame-modal {
        padding: 16px 20px;
        min-width: 280px;
    }
    
    .endgame-title {
        font-size: 20px;
    }
    
    .endgame-title-icon {
        width: 40px;
        height: 40px;
    }
    
    .endgame-stat {
        padding: 10px 12px;
    }
    
    .endgame-stat-icon {
        width: 24px;
        height: 24px;
    }
    
    .endgame-stat-value {
        font-size: 16px;
    }
    
    .endgame-btn-icon {
        width: 20px;
        height: 20px;
    }
}

/* ========================================================================
   15. ÉCRAN DE COMPTE À REBOURS
   ======================================================================== */

.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    pointer-events: all;
}

.countdown-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.countdown-number {
    font-size: 120px;
    font-weight: bold;
    color: #FFD700;
    font-family: var(--font-mono);
    text-shadow: 
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000,
        0 0 10px rgba(0, 0, 0, 0.5);
    animation: countdownPulse 1s ease infinite;
}

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

.countdown-text {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 4px;
}

.countdown-go {
    font-size: 36px;
    color: #228b22;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
    animation: countdownGo 0.5s ease;
    text-align: center;
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
}

@keyframes countdownGo {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================================================
   12. MODALE DES CRÉDITS
   ======================================================================== */

.credits-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.credits-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.credits-modal {
    background: var(--win98-bg);
    border: 2px outset var(--win98-border-light);
    box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.4);
    min-width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.credits-close-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--win98-bg);
    border: 2px outset var(--win98-border-light);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--win98-black);
    z-index: 10;
}

.credits-close-btn:hover {
    background: #d4d4d4;
}

.credits-close-btn:active {
    border-style: inset;
}

.credits-title {
    background: var(--modal-header-bg);
    color: white;
    padding: 8px 16px;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
}

.credits-content {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.credits-section h3 {
    font-size: 16px;
    color: #000080;
    margin: 16px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--win98-border-dark);
}

.credits-section:first-child h3 {
    margin-top: 0;
}

.credits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.credits-list li {
    background: #ffffff;
    border: 1px inset var(--win98-border-dark);
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.credits-list li:last-child {
    margin-bottom: 0;
}

.credits-item-name {
    font-weight: bold;
    color: #333;
}

.credits-author {
    color: #006400;
    font-weight: bold;
}

.credits-list a {
    color: #0000ee;
    text-decoration: underline;
}

.credits-list a:hover {
    color: #551a8b;
}

.credits-list a:visited {
    color: #551a8b;
}

.credits-license {
    color: #666;
    font-style: italic;
    font-size: 12px;
}

/* Styles pour les règles du jeu */
.rules-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ddd;
}

.rules-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.rules-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #000080;
    margin: 0 0 8px 0;
}

.rules-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.rules-section p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 8px 0;
    color: #333;
}

.rules-section ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.rules-section li {
    margin-bottom: 4px;
    color: #333;
}

/* Responsive pour la modale de langue */
@media (max-width: 480px) {
    .language-modal {
        min-width: auto;
        margin: 16px;
    }
    
    .language-flags {
        gap: 24px;
        padding: 20px 24px 28px;
    }
    
    .flag-button {
        padding: 12px 16px;
    }
    
    .flag-emoji {
        font-size: 36px;
    }
    
    .flag-img {
        width: 56px;
    }
    
    .flag-label {
        font-size: 13px;
    }
    
    .credits-modal {
        min-width: auto;
        margin: 16px;
    }
    
    .credits-section h3 {
        font-size: 14px;
    }
    
    .credits-list li {
        font-size: 12px;
    }
    
    .credits-license {
        font-size: 10px;
    }
    
    .rules-section h3 {
        font-size: 14px;
    }
    
    .rules-section p,
    .rules-section ul {
        font-size: 12px;
    }
}

/* ========================================================================
   ANIMATION AVION
   ======================================================================== */
.flying-plane {
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.4));
    transition: filter 0.3s ease;
}

.flying-plane:hover {
    filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.6));
}

/* ========================================================================
   MODE GÉO-POURSUITE
   ======================================================================== */

/* Notification de poursuite - positionnée au-dessus de la zone des labels */
.pursuit-notification {
    position: absolute;
    right: 20px;
    bottom: 100px;
    transform: translateY(30px);
    background: linear-gradient(135deg, #ff9500 0%, #ff5e00 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 10px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    box-shadow: 0 6px 24px rgba(255, 94, 0, 0.4);
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-system);
}

.pursuit-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.pursuit-notification.hide {
    opacity: 0;
    transform: translateY(-20px);
}

.pursuit-icon {
    font-size: 24px;
    animation: pursuitIconBounce 0.5s ease infinite alternate;
    flex-shrink: 0;
}

@keyframes pursuitIconBounce {
    from { transform: translateX(-3px); }
    to { transform: translateX(3px); }
}

.pursuit-content {
    text-align: left;
}

.pursuit-text {
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.pursuit-country {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Style pour l'écran de défaite en mode poursuite */
.endgame-modal-overlay.pursuit-defeat .endgame-modal {
    border-color: #dc3545;
    background: linear-gradient(180deg, #f8d7da 0%, var(--win98-bg) 30%);
}

.pursuit-explanation {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.pursuit-defeat-text {
    margin: 0;
    font-size: 13px;
    color: #721c24;
    line-height: 1.5;
}

/* Dark mode pour le mode poursuite */
.dark-mode .pursuit-notification {
    background: linear-gradient(135deg, #cc7000 0%, #cc4500 100%);
}

.dark-mode .endgame-modal-overlay.pursuit-defeat .endgame-modal {
    background: linear-gradient(180deg, #3a2020 0%, #2d3a4a 30%);
    border-color: #a02020;
}

.dark-mode .pursuit-explanation {
    background: rgba(160, 32, 32, 0.2);
    border-color: rgba(160, 32, 32, 0.4);
}

.dark-mode .pursuit-defeat-text {
    color: #f8d7da;
}

/* ==========================================================================
   INDICATEUR DE PAUSE
   ========================================================================== */

.pause-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    padding: 20px 50px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(30, 30, 30, 0.9) 100%);
    border: 3px solid var(--win98-border-dark, #404040);
    border-radius: 12px;
    color: #ffffff;
    font-size: 42px;
    font-weight: bold;
    font-family: 'W95FA', 'MS Sans Serif', Tahoma, sans-serif;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    pointer-events: none;
}

.pause-indicator.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Animation de pulsation subtile */
.pause-indicator.visible {
    animation: pausePulse 1.5s ease-in-out infinite;
}

@keyframes pausePulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 20px rgba(255, 255, 255, 0.1);
    }
}
