/* Import de fonts Google */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e5e7eb;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #f8f9fa;
    --text-secondary: #9ca3af;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #404040;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navigation */
.main-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-logo:hover {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Manrope', -apple-system, sans-serif;
    font-size: 1rem;
}

.nav-link:hover {
    color: var(--accent-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

/* Menu déroulant */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-btn {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    min-width: 180px;
    z-index: 1000;
    padding: 0.25rem 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.nav-dropdown.active .nav-dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.nav-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.nav-dropdown-content a:hover {
    background: var(--bg-primary);
}

.nav-dropdown-content a:first-child:hover {
    border-radius: 8px 8px 0 0;
}

.nav-dropdown-content a:last-child:hover {
    border-radius: 0 0 8px 8px;
}

.flag-icon {
    width: 20px;
    height: 15px;
    display: inline-block;
}

/* Page d'accueil */
.homepage {
    background: linear-gradient(135deg, #1a3a3a 0%, #0d1f1f 100%);
    min-height: 100vh;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
}

.hero-logo {
    margin: 0 auto 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-family: 'Space Mono', monospace;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #5ba8a0;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(91, 168, 160, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #7ec4bd;
    margin-bottom: 4rem;
    font-weight: 400;
}

.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.game-card {
    background: rgba(91, 168, 160, 0.15);
    border: 2px solid #5ba8a0;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: #7ec4bd;
    box-shadow: 0 20px 40px rgba(91, 168, 160, 0.3);
    background: rgba(91, 168, 160, 0.25);
}

.card-icon {
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.game-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 700;
}

.card-description {
    color: #b8d4d1;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: center;
}

.card-button {
    background: #5ba8a0;
    color: #fff;
    padding: 1rem 3rem;
    border-radius: 50px;
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Manrope', sans-serif;
}

.card-button:hover {
    background: #7ec4bd;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(91, 168, 160, 0.4);
}

/* Logo dans la navigation */
.logo-icon {
    vertical-align: middle;
    margin-right: 0.5rem;
}

.logo-text {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.nav-logo {
    display: flex;
    align-items: center;
    color: #5ba8a0;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-logo:hover {
    color: #7ec4bd;
}

/* Navigation sur la homepage */
.homepage .main-nav {
    background: rgba(13, 31, 31, 0.8);
    backdrop-filter: blur(10px);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .game-modes {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
}

/* Mode Carte */
.carte-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.game-header {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.search-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-input-wrapper {
    position: relative;
}

.country-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.country-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-height: 1.25rem;
    padding-left: 0.5rem;
}

.input-message.error {
    color: var(--error);
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    transition: transform 0.2s;
}

.stat-value.pop {
    animation: pop 0.3s ease;
}

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

.btn-abandon {
    background: var(--error);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.btn-abandon:hover {
    background: #dc2626;
    transform: scale(1.02);
}

.map-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.progress-container {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

.progress-bar-wrapper {
    flex: 1;
    height: 24px;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 12px;
}

.progress-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: right;
    position: relative;
    z-index: 10;
}

#world-map {
    width: 100%;
    height: 600px;
    cursor: default;
    position: relative;
    z-index: 1;
}

.continents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.continent-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.continent-title {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.countries-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.country-item {
    padding: 0.5rem;
    border-radius: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    font-size: 0.85rem;
    user-select: none; /* Empêcher la sélection du texte */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.country-item.found {
    background: #d1fae5;
    border-color: var(--success);
    color: var(--success);
    font-weight: 600;
}

.country-item.not-found {
    background: #fee2e2;
    border-color: var(--error);
    color: var(--error);
    font-weight: 600;
}

.country-item.empty {
    background: var(--bg-primary);
    color: transparent; /* Texte invisible pour les cases vides */
    min-height: 2.5rem; /* Hauteur minimale pour garder l'uniformité */
}

/* SVG Map Styles */
.country-path {
    fill: #cbd5e1;
    stroke: #ffffff;
    stroke-width: 0.5;
    transition: fill 0.3s;
}

.country-path.found {
    fill: var(--success);
}

.country-path.not-found {
    fill: var(--error);
}

/* Message de sauvegarde */
.save-notice-bottom {
    text-align: center;
    padding: 1rem 0;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    opacity: 0.7;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.modal-title-victory {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.primary {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: var(--accent-primary);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stats-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.stats-section-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.stats-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-align: right;
}

.continent-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.continent-stat-row:last-child {
    margin-bottom: 0;
}

.continent-name {
    font-weight: 600;
    color: var(--text-primary);
}

.continent-value {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.modal-content h2 {
    font-family: 'Space Mono', monospace;
    margin-bottom: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: scale(1.02);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    #world-map {
        height: 400px;
    }
    
    .continents-grid {
        grid-template-columns: 1fr;
    }
}

/* Page d'accueil */
.home-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem 2rem;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-section {
    text-align: center;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.hero-title {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.modes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    max-width: 1400px;
    margin: 0 auto 2rem auto;
    flex: 0 1 auto;
}

.mode-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.mode-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mode-card-link:hover .mode-card {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.mode-card:nth-child(1) .mode-icon {
    animation-delay: 0s;
}

.mode-card-link:nth-child(2) .mode-card .mode-icon {
    animation-delay: 0.5s;
}

.mode-card-link:nth-child(3) .mode-card .mode-icon {
    animation-delay: 1s;
}

.mode-card-link:nth-child(4) .mode-card .mode-icon {
    animation-delay: 1.5s;
}

.mode-card-link:nth-child(5) .mode-card .mode-icon {
    animation-delay: 2s;
}

.mode-card-link:nth-child(6) .mode-card .mode-icon {
    animation-delay: 2.5s;
}

.mode-card h2 {
    font-family: 'Space Mono', monospace;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.mode-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1;
}

.copyright-footer {
    text-align: center;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    opacity: 0.7;
    flex-shrink: 0;
    margin-top: 1rem;
}

.btn-primary {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

/* ========================================
   MODE SILHOUETTE
   ======================================== */

.silhouette-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

/* Écran de jeu */
.game-screen {
    display: block;
}

.game-screen.hidden {
    display: none;
}

.game-header {
    margin-bottom: 2rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 1.125rem;
}

.question-counter {
    color: var(--text-secondary);
}

.score-display {
    color: var(--accent-primary);
    font-weight: 700;
}

/* Affichage de la silhouette */
.silhouette-display {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    box-shadow: var(--shadow-lg);
}

.silhouette-display svg {
    max-width: 100%;
    max-height: 350px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

/* Section de réponse */
.answer-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.input-wrapper {
    margin-bottom: 1.5rem;
}

.answer-section .country-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    transition: border-color 0.3s;
}

.answer-section .country-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.answer-section .country-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-message {
    margin-top: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    min-height: 1.5rem;
}

.feedback-message.success {
    color: var(--success);
}

.feedback-message.error {
    color: var(--error);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.action-buttons button {
    flex: 1;
    max-width: 250px;
}

/* Écran de fin */
.end-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
}

.end-screen.hidden {
    display: none;
}

.end-content {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
}

.end-title {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-box {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
}

.stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.end-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.end-buttons button {
    flex: 1;
    max-width: 200px;
}

/* Responsive */
@media (max-width: 600px) {
    .silhouette-display {
        padding: 2rem 1rem;
        min-height: 300px;
    }

    .final-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .end-title {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        max-width: 100%;
    }
}

/* Notice de sauvegarde (Mode Carte) */
.save-notice {
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Style pour le message d'avertissement */
.feedback-message.warning {
    color: var(--warning);
}

/* Animation de confettis */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    opacity: 0;
    animation: confetti-fall linear forwards;
    z-index: 1000;
}

@keyframes confetti-fall {
    0% {
        top: -10px;
        opacity: 1;
        transform: translateX(0) rotateZ(0deg);
    }
    100% {
        top: 100%;
        opacity: 0;
        transform: translateX(calc(100vw * (var(--random) - 0.5) * 0.3)) rotateZ(720deg);
    }
}

/* Position relative pour l'écran de fin */
.end-screen {
    position: relative;
    overflow: hidden;
}

/* Affichage du drapeau (Mode Drapeaux) */
.flag-display {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    box-shadow: var(--shadow-lg);
}

.flag-img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ========================================
   MODE CHAÎNE
   ======================================== */

.chaine-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

/* Écran de sélection de difficulté */
.difficulty-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
}

.difficulty-content {
    max-width: 900px;
    width: 100%;
    text-align: center;
}

.difficulty-title {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.difficulty-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.difficulty-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.difficulty-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    font-family: 'Manrope', sans-serif;
}

.difficulty-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
}

.difficulty-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.difficulty-card:nth-child(2) .difficulty-icon {
    animation-delay: 0.5s;
}

.difficulty-name {
    font-family: 'Space Mono', monospace;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.difficulty-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

.difficulty-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-badge.normal {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.difficulty-badge.expert {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.chain-game-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Section carte */
.chain-map-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.objective-title-small {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

.countries-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.country-inline {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
}

.country-inline.start {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.country-inline.end {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
}

.arrow-inline {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.map-container-chain {
    width: 100%;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
}

#chain-map {
    width: 100%;
    height: auto;
    display: block;
}

/* Section d'interaction */
.chain-input-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.chain-progress {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.path-title {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.chain-path {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-height: 60px;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.path-country-wrapper {
    position: relative;
}

.path-country {
    background: var(--accent-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    animation: slideIn 0.3s ease;
    position: relative;
}

.delete-country {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    transition: transform 0.2s;
}

.path-country-wrapper:hover .delete-country {
    display: flex;
}

.delete-country:hover {
    transform: scale(1.1);
    background: #dc2626;
}

.path-arrow {
    color: var(--text-secondary);
    font-size: 1.25rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Anciens styles conservés pour compatibilité */
.chain-display {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.objective-section {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.objective-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.countries-to-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.country-badge {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.country-badge.start {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.country-badge.end {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.arrow {
    font-size: 2rem;
    color: var(--text-secondary);
}

/* Écran de chaîne terminée */
.chain-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.completed-paths {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.path-section {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
}

.path-section h4 {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.completed-path, .optimal-path {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
}

.path-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.path-badge {
    background: var(--accent-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.path-badge.optimal {
    background: #10b981;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content-small {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-content-small h3 {
    font-family: 'Space Mono', monospace;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-content-small p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Récapitulatif des chaînes */
.chains-recap {
    margin-bottom: 2rem;
}

.recap-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.recap-chain {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.recap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.recap-number {
    font-weight: 600;
    color: var(--text-primary);
}

.recap-score {
    font-family: 'Space Mono', monospace;
    color: var(--accent-primary);
    font-weight: 700;
}

.recap-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive pour le mode chaîne */
@media (max-width: 1024px) {
    .chain-game-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .chaine-container {
        padding: 1rem;
    }
    
    .difficulty-title {
        font-size: 1.75rem;
    }
    
    .difficulty-subtitle {
        font-size: 1rem;
    }
    
    .difficulty-options {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .difficulty-icon {
        font-size: 2.5rem;
    }
    
    .difficulty-name {
        font-size: 1.5rem;
    }
    
    .chain-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .countries-to-link {
        flex-direction: column;
        gap: 1rem;
    }
    
    .chain-path {
        justify-content: center;
    }
    
    .home-container {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .modes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Tablette */
@media (max-width: 1024px) and (min-width: 769px) {
    .modes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   MODE SPEEDRUN
   ======================================== */

.speedrun-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.speedrun-header {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.speedrun-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-box-speedrun {
    text-align: center;
    transition: transform 0.2s;
}

.stat-label-speedrun {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value-speedrun {
    font-family: 'Space Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timer-display {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    transition: all 0.3s;
}

.score-display {
    color: var(--success);
}

.multiplier-box {
    transition: opacity 0.3s, transform 0.2s;
}

.multiplier-display {
    color: var(--warning);
    font-size: 2rem;
}

.search-section-speedrun {
    position: relative;
}

.country-input-speedrun {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Manrope', sans-serif;
    transition: all 0.2s;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.country-input-speedrun:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.country-input-speedrun:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-message-speedrun {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.feedback-message-speedrun.success {
    background: var(--success);
    color: white;
}

.feedback-message-speedrun.error {
    background: var(--error);
    color: white;
}

.feedback-message-speedrun.warning {
    background: var(--warning);
    color: white;
}

.speedrun-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.map-section-speedrun {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

#world-map {
    width: 100%;
    height: auto;
    display: block;
}

.country-path-speedrun {
    transition: all 0.3s;
    cursor: default;
}

.countries-list-speedrun {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    max-height: 600px;
    overflow-y: auto;
}

.list-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.found-countries-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

.found-country-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s;
}

.country-name-found {
    font-weight: 600;
    color: var(--text-primary);
}

.points-earned {
    font-family: 'Space Mono', monospace;
    color: var(--success);
    font-weight: 700;
}

.final-stats-speedrun {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Animation de tremblement */
@keyframes shake {
    0%, 100% { transform: translateX(0) scale(var(--scale, 1)); }
    25% { transform: translateX(calc(-1 * var(--shake-amount, 0px))) scale(var(--scale, 1)); }
    75% { transform: translateX(var(--shake-amount, 0px)) scale(var(--scale, 1)); }
}

/* Responsive */
@media (max-width: 1200px) {
    .speedrun-content {
        grid-template-columns: 1fr;
    }
    
    .countries-list-speedrun {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .speedrun-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .timer-display {
        font-size: 2rem;
    }
    
    .stat-value-speedrun {
        font-size: 1.5rem;
    }
    
    .speedrun-container {
        padding: 1rem;
    }
}

/* ========================================
   MODE CHAÎNE - Améliorations visuelles
   ======================================== */

/* Affichage de la chaîne en cours (petites cases) */
.path-country-box {
    display: inline-flex;
    align-items: center;
    position: relative;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin: 0.25rem;
    transition: all 0.2s;
}

.path-country-box:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.path-country-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.delete-country-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--error);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}

.delete-country-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.path-arrow-inline {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin: 0 0.5rem;
}

/* Cases pour les chemins dans les écrans de résultats */
.country-badge {
    display: inline-block;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0.25rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.country-badge.user {
    border-color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.1);
}

.country-badge.optimal {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.country-badge-small {
    display: inline-block;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-weight: 500;
    font-size: 0.85rem;
    margin: 0.2rem;
    color: var(--text-primary);
}

.country-badge-small.user {
    border-color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.08);
}

.country-badge-small.optimal {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.08);
}

.arrow-badge {
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0 0.3rem;
}

.path-display-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

/* Statistiques globales dans l'écran final */
.global-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-item-recap {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stat-value-recap {
    font-family: 'Space Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label-recap {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Récapitulatif des chaînes */
.recap-path-container {
    margin: 1rem 0;
}

.recap-path-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.recap-path {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.recap-efficiency {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.95rem;
}

/* Masquer le jeu quand l'écran de fin est affiché */
.end-screen:not(.hidden) ~ .game-screen,
.chain-complete-screen:not(.hidden) ~ .game-screen {
    display: none !important;
    visibility: hidden !important;
}

/* Responsive pour mode chaîne */
@media (max-width: 900px) {
    .global-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .path-country-box {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .global-stats {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   MODE SURVIE
   ======================================== */

.survie-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    min-height: calc(100vh - 80px);
    overflow: hidden;
}

.survie-game-screen {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

/* Header minimal */
.survie-header {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.survie-score {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
}

.score-label {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.score-value {
    color: var(--accent-primary);
    font-size: 2rem;
}

/* Label de format */
.format-label {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: var(--bg-secondary);
    padding: 1.5rem 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.format-label.visible {
    opacity: 1;
}

/* Zone de contenu centrale */
.survie-content-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    max-height: 60vh;
}

/* Drapeau */
.flag-display-survie {
    max-width: 640px;
    max-height: 480px;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    overflow: hidden;
}

.flag-image-survie {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Section input */
.survie-input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.country-input-survie {
    width: 100%;
    max-width: 500px;
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
    text-align: center;
}

.country-input-survie:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.feedback-message-survie {
    font-size: 2rem;
    font-weight: 700;
    min-height: 2.5rem;
    transition: opacity 0.2s;
}

.feedback-message-survie.success {
    color: #10b981;
}

.feedback-message-survie.error {
    color: #ef4444;
}

.feedback-message-survie.warning {
    color: #f59e0b;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Modal de fin (position fixed) */
.modal-survie {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
    overflow-y: auto;
}

.modal-content-survie {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 700px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content-survie .end-title {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Grille des stats principales */
.final-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-big {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
    padding: 2rem;
    border-radius: 16px;
    color: white;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value-huge {
    font-family: 'Space Mono', monospace;
    font-size: 4rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-value-big {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin: 0.5rem 0;
}

.stat-card-big .stat-value-huge {
    color: white;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.stat-card-big .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Répartition par format */
.stats-breakdown {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.breakdown-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.format-stats {
    display: grid;
    gap: 0.75rem;
}

.format-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.format-label {
    font-weight: 600;
    color: var(--text-primary);
}

.format-value {
    font-family: 'Space Mono', monospace;
    color: var(--accent-primary);
    font-weight: 700;
}

/* Dernières réponses */
.last-answers {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.answers-list {
    display: grid;
    gap: 0.5rem;
}

.answer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    gap: 1rem;
}

.answer-number {
    font-family: 'Space Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 40px;
}

.answer-country {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
}

.answer-format {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

/* Section erreur */
.error-section {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    color: white;
}

.error-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.error-details {
    text-align: left;
}

.error-detail {
    margin: 0.75rem 0;
    font-size: 1rem;
}

.correct-answer {
    color: #fef3c7;
    font-weight: 700;
}

.wrong-answer {
    color: #fecaca;
    font-weight: 700;
}

.error-format {
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.error-detail strong {
    color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .survie-game-screen {
        padding: 1rem;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    .format-label {
        font-size: 1.5rem;
        padding: 1rem 2rem;
    }
    
    .country-input-survie {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .stat-value-big {
        font-size: 3rem;
    }
    
    .modal-content-survie {
        padding: 1.5rem;
    }
    
    .modal-content-survie .end-title {
        font-size: 1.5rem;
    }
    
    /* Statistiques responsive */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card.primary {
        grid-column: 1;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .modal-title-victory {
        font-size: 1.5rem;
    }
    
    .modal-subtitle {
        font-size: 1rem;
    }
    
    .stats-section {
        padding: 1rem;
    }
    
    .stats-section-title {
        font-size: 1rem;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem 0;
    }
    
    .stats-value {
        text-align: left;
    }
    
    .continent-stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    /* Page d'accueil mobile */
    .home-container {
        padding: 1rem;
        min-height: auto;
        justify-content: flex-start;
    }
    
    .hero-section {
        margin-bottom: 1.5rem;
        margin-top: 1rem;
    }
    
    .modes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .mode-card {
        padding: 1.5rem;
    }
    
    .mode-icon {
        font-size: 2.5rem;
    }
    
    .copyright-footer {
        padding: 1rem 0;
        margin-top: 1rem;
    }
}

/* Texte "Appuyez sur entrée" dans le mode survie */
.press-enter-hint {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.press-enter-hint kbd {
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Ajout pour le hint "Appuyez sur Entrée" dans Mode Survie */
.enter-hint {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
}

.enter-hint kbd {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Space Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Fix pour page d'accueil - empêcher le scroll ET corriger les cartes */
body:has(.home-container) {
    overflow: hidden;
    height: 100vh;
}

/* Correction des cartes pour qu'elles aient la bonne hauteur */
.mode-card {
    min-height: 260px;
}

/* S'assurer que le paragraphe ne pousse pas le bouton dehors */
.mode-card p {
    margin-bottom: 1rem;
}

.btn-primary {
    margin-top: auto;
}
