/* =============================================================================
   GAME STYLES - JUEGO INTERACTIVO MODERNO
   ============================================================================= */

.game-section {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--cream) 0%, #ffffff 50%, #f8f9fa 100%);
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.game-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="hearts" width="100" height="100" patternUnits="userSpaceOnUse"><text x="50" y="50" text-anchor="middle" font-size="20" fill="%23000" opacity="0.03">💝</text></pattern></defs><rect width="100" height="100" fill="url(%23hearts)"/></svg>');
    pointer-events: none;
    z-index: 1;
}

.game-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* =============================================================================
   HEADER DEL JUEGO
   ============================================================================= */

.game-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease;
}

.game-title {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
}

.game-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--gold-color));
    border-radius: 2px;
}

.game-subtitle {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: var(--medium-gray);
    margin-bottom: 30px;
    line-height: 1.6;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--light-gray);
    min-width: 120px;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.stat-label {
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    color: var(--medium-gray);
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-secondary);
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* =============================================================================
   PANTALLAS DEL JUEGO
   ============================================================================= */

.game-screen {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* =============================================================================
   PANTALLA DE INICIO
   ============================================================================= */

.start-content {
    text-align: center;
    background: var(--white);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--light-gray);
    position: relative;
    overflow: hidden;
}

.start-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.05), transparent);
    transform: rotate(45deg);
    animation: floating 8s ease-in-out infinite;
}

.game-logo {
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.logo-icon {
    display: block;
    font-size: 4rem;
    margin-bottom: 15px;
    animation: heartbeat 2s ease-in-out infinite;
}

.game-logo h2 {
    font-family: var(--font-primary);
    font-size: 2.2rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
}

.start-description {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: var(--dark-gray);
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

.game-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, var(--white));
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
    font-family: var(--font-secondary);
    font-weight: 500;
    color: var(--primary-color);
}

.feature-icon {
    font-size: 1.3rem;
    min-width: 25px;
}

/* =============================================================================
   PANTALLA DEL JUEGO
   ============================================================================= */

.question-container {
    max-width: 700px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--gold-color));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s ease-in-out infinite;
}

.question-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--light-gray);
    position: relative;
    overflow: hidden;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-gray);
}

.question-number {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: var(--gold-color);
    font-weight: 700;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.question-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-secondary);
    font-weight: 600;
    color: var(--primary-color);
    background: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--light-gray);
    box-shadow: var(--shadow-sm);
}

.timer-icon {
    font-size: 1.1rem;
}

#question-timer {
    font-size: 1rem;
    min-width: 35px;
}

.question-timer.warning {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    animation: timerPulse 1s ease-in-out infinite;
}

.question-text {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    color: var(--primary-color);
    line-height: 1.6;
    margin-bottom: 35px;
    text-align: center;
    font-weight: 600;
}

.options-container {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-family: var(--font-secondary);
    font-size: 1rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.5s ease;
}

.option-btn:hover::before {
    left: 100%;
}

.option-btn:hover {
    border-color: var(--gold-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--gold-color), #f1c40f);
    color: var(--white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    line-height: 1.5;
}

.option-btn.selected {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(231, 76, 60, 0.05));
}

.option-btn.correct {
    border-color: #27ae60;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(39, 174, 96, 0.05));
    animation: correctAnswer 0.6s ease;
}

.option-btn.incorrect {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(231, 76, 60, 0.05));
    animation: incorrectAnswer 0.6s ease;
}

.option-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.question-actions {
    text-align: center;
}

/* =============================================================================
   PANTALLA DE RESULTADOS
   ============================================================================= */

.results-content {
    text-align: center;
    background: var(--white);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--light-gray);
    position: relative;
    overflow: hidden;
}

.results-header {
    margin-bottom: 40px;
}

.results-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: celebrationBounce 1s ease infinite;
}

.results-title {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.results-subtitle {
    font-family: var(--font-secondary);
    font-size: 1.2rem;
    color: var(--medium-gray);
    margin: 0;
}

.score-display {
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa, var(--white));
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
}

.final-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.score-label {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: var(--medium-gray);
}

.score-number {
    font-family: var(--font-primary);
    font-size: 4rem;
    color: var(--gold-color);
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.score-total {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    color: var(--medium-gray);
}

.score-details {
    display: grid;
    gap: 15px;
}

.detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
}

.detail-icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

.detail-label {
    font-family: var(--font-secondary);
    color: var(--dark-gray);
    flex: 1;
    text-align: left;
}

.detail-value {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: var(--primary-color);
}

.name-input-section {
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border-radius: var(--border-radius);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.name-input-section h3 {
    font-family: var(--font-primary);
    color: var(--primary-color);
    margin-bottom: 10px;
}

.name-input-section p {
    font-family: var(--font-secondary);
    color: var(--medium-gray);
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.name-input {
    padding: 12px 20px;
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    font-family: var(--font-secondary);
    font-size: 1rem;
    min-width: 200px;
    text-align: center;
    background: var(--white);
    transition: all var(--transition);
}

.name-input:focus {
    outline: none;
    border-color: var(--gold-color);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* =============================================================================
   BOTONES
   ============================================================================= */

.game-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-width: 150px;
    justify-content: center;
}

.game-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.game-btn:hover::before {
    width: 300px;
    height: 300px;
}

.game-btn.primary {
    background: linear-gradient(135deg, var(--secondary-color), #e74c3c);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.game-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.game-btn.secondary {
    background: linear-gradient(135deg, var(--gold-color), #f1c40f);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.game-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.game-btn.tertiary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--light-gray);
    box-shadow: var(--shadow-sm);
}

.game-btn.tertiary:hover {
    border-color: var(--gold-color);
    transform: translateY(-2px);
}

.btn-icon {
    position: relative;
    z-index: 2;
}

/* =============================================================================
   MODALES
   ============================================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.ranking-modal .modal-content {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.modal-header h3 {
    font-family: var(--font-primary);
    color: var(--primary-color);
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--medium-gray);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--light-gray);
    color: var(--secondary-color);
}

.modal-body {
    margin-bottom: 25px;
}

.saved-score-display {
    text-align: center;
    margin-bottom: 20px;
}

.player-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, var(--white));
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
}

.player-avatar {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--gold-color), #f1c40f);
    color: var(--white);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.player-name {
    font-family: var(--font-primary);
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 700;
}

.player-score {
    font-family: var(--font-secondary);
    font-size: 1rem;
    color: var(--gold-color);
    font-weight: 600;
}

.ranking-position {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border-radius: var(--border-radius);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.position-icon {
    font-size: 1.5rem;
}

.position-text {
    font-family: var(--font-secondary);
    color: var(--primary-color);
    font-weight: 600;
}

.modal-message {
    font-family: var(--font-secondary);
    color: var(--dark-gray);
    line-height: 1.6;
    text-align: center;
}

.modal-actions {
    text-align: center;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
    transition: all var(--transition);
}

.ranking-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.ranking-item.current-player {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border-color: var(--gold-color);
}

.ranking-position-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--light-gray);
    color: var(--primary-color);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.ranking-position-number.first {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: var(--white);
}

.ranking-position-number.second {
    background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
    color: var(--white);
}

.ranking-position-number.third {
    background: linear-gradient(135deg, #CD7F32, #B87333);
    color: var(--white);
}

.ranking-player-info {
    flex: 1;
    text-align: left;
}

.ranking-player-name {
    font-family: var(--font-secondary);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
}

.ranking-player-score {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    color: var(--medium-gray);
    margin-top: 2px;
}

/* =============================================================================
   ANIMACIONES
   ============================================================================= */

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes floating {
    0%, 100% { transform: translateY(0px) rotate(45deg); }
    50% { transform: translateY(-20px) rotate(45deg); }
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes correctAnswer {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes incorrectAnswer {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

@keyframes celebrationBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .game-section {
        padding: 20px 10px;
    }
    
    .game-stats {
        gap: 15px;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 12px 15px;
    }
    
    .start-content,
    .question-card,
    .results-content {
        padding: 30px 20px;
    }
    
    .game-features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .question-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .option-btn {
        padding: 15px 20px;
    }
    
    .final-score {
        flex-direction: column;
        gap: 5px;
    }
    
    .score-number {
        font-size: 3rem;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .name-input {
        min-width: unset;
        width: 100%;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .game-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 25px;
    }
    
    .player-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .player-details {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .game-subtitle {
        font-size: 1rem;
    }
    
    .game-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .question-timer {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .option-btn {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .results-title {
        font-size: 2rem;
    }
    
    .score-number {
        font-size: 2.5rem;
    }
}
