:root {
    --color-blue: #7FB3D5;
    --color-green: #82E0AA;
    --color-brown: #D7BDE2;
    --color-light: #F8F9F9;
    --color-dark: #34495E;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-green) 50%, var(--color-brown) 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 800px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 600px;
    position: relative;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background-color: var(--color-dark);
    color: white;
    flex-wrap: nowrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
}

.score-display {
    display: flex;
    gap: 15px;
    font-size: 1rem;
    margin: 0 15px;
    flex-wrap: nowrap; /* Añadido para evitar saltos de línea */
    white-space: nowrap; /* Añadido para evitar saltos de línea */
}

.score-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-settings {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* Menu Styles */
.menu {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.menu-title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--color-dark);
}

.btn-game {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.2rem;
    background-color: var(--color-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-game:hover {
    background-color: var(--color-dark);
    transform: translateY(-2px);
}

/* Settings Styles */
.settings {
    padding: 20px;
}

.settings h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-dark);
}

.setting-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.setting-row label {
    min-width: 80px;
    font-weight: bold;
}

.setting-row input[type="range"] {
    flex-grow: 1;
    width: 250px;  
    height: 8px;  
}

.settings-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

#languageSelect {
    width: 180px;  /* Aumentar el ancho del desplegable */
}

/* Switch slider */
.switch {
    position: relative;
    display: inline-block;
    width: 36px; /* Reducido de 40px a 36px */
    height: 20px; /* Reducido de 24px a 20px */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px; /* Reducido de 20px a 16px */
    width: 16px;  /* Reducido de 20px a 16px */
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--color-blue);
}

input:checked + .slider:before {
    transform: translateX(58px); /* Reducido de 36px a 16px */
}

.slider.round {
    border-radius: 20px; /* Ajustado a la nueva altura */
}

.slider.round:before {
    border-radius: 50%;
}

/* Añadir estos estilos al final del archivo CSS */
.setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-blue);
    cursor: pointer;
}

.setting-row input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-blue);
    cursor: pointer;
    border: none;
}

/* Game Styles */
.game-container {
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.flag-container {
    width: 300px;
    height: 200px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-content: center;
    background-color: #f8f9f9;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.flag-container img {
    object-fit: cover;   
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

/* Juego 1 - Banderas (250x144) */
.flag-game1 {
    width: 250px !important;
    height: 144px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

/* Juego 2 - Siluetas (100%) */
.flag-game2 img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    filter: drop-shadow(4px 6px 12px rgba(0, 0, 0, 0.5));
}

/* Juego 3 - Mapa de China (100%) */
.flag-game3 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

.option-btn {
    padding: 12px;
    background-color: var(--color-light);
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.option-btn:hover {
    background-color: #e9e9e9;
}

.option-btn.correct {
    background-color: var(--color-green);
    color: white;
}

.option-btn.incorrect {
    background-color: #E74C3C;
    color: white;
}

.timer-container {
    width: 100%;
    max-width: 500px;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background-color: var(--color-blue);
    transition: width 0.1s linear;
}

.country-outline {
    background-color: #f8f9f9;
    border-radius: var(--border-radius);
    padding: 1px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.country-outline svg {
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Asegurar que las siluetas se centren correctamente */
.country-outline path {
    transform-origin: center;
    transform-box: fill-box;
}

.flag-container {
    width: 300px;
    height: 200px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9f9;
    padding: 0px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Stats Styles */
.stats {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats h2 {
    text-align: center;
    color: var(--color-dark);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: var(--color-light);
    border-radius: var(--border-radius);
}

/* Game Over Styles */
.game-over {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.game-over h2 {
    color: var(--color-dark);
}

.game-over-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Button Styles */
.btn-action {
    padding: 10px 15px;
    background-color: var(--color-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-action:hover {
    background-color: var(--color-dark);
}

/* Toast Styles */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: var(--color-dark);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 1000;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header {
        flex-direction: row; /* Cambiado de column a row */
        flex-wrap: wrap; /* Mantener wrap */
        gap: 10px;
        justify-content: space-between; /* Añadido */
        align-items: center; /* Añadido */
    }
    
    .score-display {
        order: 0; /* Cambiado de 3 a 0 */
        width: auto; /* Cambiado de 100% a auto */
        margin: 0; /* Añadido */
        flex-wrap: nowrap; /* Añadido */
        white-space: nowrap; /* Añadido */
        overflow-x: auto; /* Añadido para scroll horizontal si es necesario */
    }

    .btn-settings {
        order: 1; /* Añadido para mantener el botón a la derecha */
    }
    
    /* Opcional: ajustar tamaño de fuente en móviles */
    .score-item {
        font-size: 0.9rem;
    }
    
    .options-container {
        grid-template-columns: 1fr;
    }
    
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .settings-buttons {
        flex-direction: column;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .app-container {
        max-width: 90%;
    }
}

@media (min-width: 1025px) {
    .app-container {
        max-width: 800px;
    }
}

@media (max-height: 700px) {
    body {
        padding: 10px;
    }
    
    .app-container {
        min-height: 500px;
    }
    
    .menu {
        padding: 15px 20px;
    }
    
    .btn-game {
        padding: 10px;
    }
}

/* style.css - Estilos para el Juego 3 */

.color-game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.color-circles {
    display: grid;
    gap: 20px;
    padding: 20px;
}

.color-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.correct-circle {
    border: 3px solid #27ae60;
    box-shadow: 0 0 15px rgba(39, 174, 96, 0.5);
}

.color-option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
}

.option-letter {
    font-weight: bold;
    font-size: 1.2em;
    min-width: 30px;
}

.option-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
}

.question-text {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.skip-btn {
    margin-top: 15px;
    background-color: #95a5a6;
}

.skip-btn:hover {
    background-color: #7f8c8d;
}

/* Responsive */
@media (max-width: 768px) {
    .color-circle {
        width: 60px;
        height: 60px;
    }
    
    .color-circles {
        gap: 15px;
        padding: 15px;
    }
}

/* Estilos para el Juego 3 - Mapa de China */
.map-game-container {
    position: relative;
    width: 300px;
    height: 200px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f8f9f9;
}

.china-map {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.points-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.location-point {
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    from {
        r: 6;
        opacity: 0.8;
    }
    to {
        r: 9;
        opacity: 1;
    }
}

.map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #7f8c8d;
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
}

.place-option-btn {
    text-align: left;
    padding: 10px 15px;
    font-size: 0.95em;
}

.question-text {
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #2c3e50;
}

/* Asegurar que el SVG se superponga correctamente */
.points-overlay {
    z-index: 10;
}

/* Estilos para la lista de países */
.countries-list {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.search-container {
    margin: 15px 0;
    text-align: center;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 2px solid var(--color-blue);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.country-card {
    background: var(--color-light);
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.country-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--color-blue);
}

.country-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.country-pinyin {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.country-translation {
    font-size: 0.8em;
    color: #888;
}

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

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-dark);
    z-index: 1001;
}

.modal-flag-container,
.modal-outline-container {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9f9 0%, #e8ecec 100%);
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
    position: relative;
}

/* Sombreado mejorado para banderas */
.modal-flag {
    max-width: 220px;
    max-height: 140px;
    object-fit: contain;
    filter: 
        drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))
        drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2))
        drop-shadow(0 0 0 1px rgba(0, 0, 0, 0.1));
    border-radius: 4px;
}

/* Sombreado para siluetas */
.modal-outline {
    max-width: 220px;
    max-height: 140px;
    object-fit: contain;
    filter: 
        drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4))
        drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3))
        drop-shadow(0 0 0 1px rgba(0, 0, 0, 0.2));
    border-radius: 4px;
}

.modal-country-info {
    text-align: center;
    background: var(--color-light);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
}

.modal-country-info h3 {
    color: var(--color-dark);
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.modal-country-info p {
    margin: 5px 0;
    color: #666;
    font-size: 1rem;
}

/* Efecto hover para las tarjetas de país */
.country-card:hover .country-name {
    color: var(--color-blue);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }
    
    .modal-flag,
    .modal-outline {
        max-width: 180px;
        max-height: 110px;
    }
    
    .modal-flag-container,
    .modal-outline-container {
        padding: 12px;
    }
    
    .modal-country-info {
        padding: 12px;
    }
    
    .modal-country-info h3 {
        font-size: 1.2rem;
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
    .modal-flag,
    .modal-outline {
        max-width: 150px;
        max-height: 90px;
    }
}

/* Estilos para el mapa interactivo */
.interactive-map-container {
    padding: 20px;
    width: 100%; /* Cambiado de 90% a 100% */
    margin: 0 auto;
    box-sizing: border-box;
}

.map-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 20px 0;
}

.interactive-map {
    position: relative;
    width: 100%;
    height: 100%;
}

.china-map-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.interactive-points-overlay {
    position: absolute;
    top: 0;
    left: 0;
}

.interactive-point {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-point:hover {
    r: 12;
    fill: #e74c3c;
}

.location-info {
    background: var(--color-light);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 15px 0;
    min-height: 80px;
}

.location-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.location-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--color-dark);
    margin-bottom: 5px;
}

.location-pinyin {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 5px;
}

.location-translation {
    font-size: 1.1rem;
    color: var(--color-blue);
    margin: 0;
    font-weight: 500;
}

.location-description {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    margin-top: 8px;
}

/* Ajustes responsive para móviles */
@media (max-width: 768px) {
    .interactive-map-container {
        padding: 10px; /* Menos padding en móviles */
    }
    
    .map-wrapper {
        height: 300px; /* Altura ajustada para móviles */
        margin: 15px 0;
    }
    
    .location-info {
        padding: 12px;
        margin: 12px 0;
    }
    
    .location-header {
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .location-name {
        font-size: 1.1rem;
    }

    .location-pinyin,
    .location-translation {
        font-size: 1rem;
    }
}

/* Para tablets y pantallas más grandes */
@media (min-width: 769px) and (max-width: 1024px) {
    .map-wrapper {
        height: 450px; /* Un poco más alto en tablets */
    }
}

/* Para pantallas muy grandes */
@media (min-width: 1025px) {
    .map-wrapper {
        height: 500px; /* Más alto en desktop */
    }
}


