/* ===== JUEGO BÍBLICO: LANZA EL LIBRO ===== */
/* Variables globales */
:root {
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --old-testament: #8b4513;
    --new-testament: #4169e1;
    --success: #27ae60;
    --error: #c0392b;
    --warning: #f39c12;
    --info: #2980b9;
}

/* ===== SECCIÓN PRINCIPAL ===== */
.game-section {
    background: linear-gradient(135deg, #1e2b3a, #15202b);
    color: white;
    padding: 3rem 0;
    margin-top: 2rem;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--gold);
    text-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

.game-badge {
    display: inline-block;
    background: var(--gold);
    color: #1e2b3a;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    box-shadow: 0 5px 0 var(--gold-dark);
}

/* ===== ESTADÍSTICAS ===== */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    font-size: 1.3rem;
    background: rgba(0,0,0,0.5);
    padding: 1rem 2rem;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,215,0,0.3);
}

.score, .timer {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0,0,0,0.4);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    border: 2px solid rgba(255,215,0,0.3);
}

.score i, .timer i {
    color: var(--gold);
    font-size: 1.8rem;
}

.score span:first-child {
    color: #ffffff;
    font-size: 1.1rem;
    opacity: 0.9;
}

#modalScoreValue, #modalTimerValue,
#scoreValue, #timerValue {
    font-weight: bold;
    font-size: 1.8rem;
    color: white;
    min-width: 60px;
    text-align: center;
}

#modalScoreValue {
    color: #00ffff !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff;
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    margin-left: 10px;
    animation: pulseNeon 1.5s infinite;
}

#modalTimerValue, #timerValue {
    color: #1b1b18 !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    text-shadow: 0 0 10px #c9d81d, 0 0 20px #c9d81d, 0 0 30px #c9d81d;
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    margin-left: 10px;
    animation: pulseNeon 1.5s infinite;
}


#orderScoreValue {
    color: #00ffff !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff;
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    margin-left: 10px;
    animation: pulseNeon 1.5s infinite;
}

#orderTimerValue {
    color: #1b1b18 !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    text-shadow: 0 0 10px #c9d81d, 0 0 20px #c9d81d, 0 0 30px #c9d81d;
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    margin-left: 10px;
    animation: pulseNeon 1.5s infinite;
}

@keyframes pulseNeon {
    0%, 100% { text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff; }
    50% { text-shadow: 0 0 15px #00ffff, 0 0 30px #00ffff, 0 0 40px #00ffff; }
}

/* ===== CONTROLES ===== */
.game-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-game {
    background: var(--gold);
    color: #1e2b3a;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-game:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255,215,0,0.4);
}

.btn-game:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== ÁREA DE JUEGO ===== */
.game-play-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
    position: relative;
}

/* Zonas de testamento */
.testament-zone {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border: 4px solid rgba(255,255,255,0.1);
    border-radius: 30px;
    padding: 2rem 1rem;
    text-align: center;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.testament-zone.old-zone {
    background: linear-gradient(145deg, #4a2511, #2c1810);
    border-color: var(--old-testament);
}

.testament-zone.new-zone {
    background: linear-gradient(145deg, #1a3a5f, #0a1a2e);
    border-color: var(--new-testament);
}

.testament-zone.active {
    transform: scale(1.02);
    box-shadow: 0 0 30px currentColor;
}

.testament-zone.old-zone.active {
    border-color: #ff8c00;
    box-shadow: 0 0 30px rgba(255,140,0,0.5);
}

.testament-zone.new-zone.active {
    border-color: #00bfff;
    box-shadow: 0 0 30px rgba(0,191,255,0.5);
}

.zone-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.testament-zone h3 {
    font-size: 2rem;
    margin: 0.5rem 0;
    color: var(--gold);
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

/* Badges de testamentos */
.zone-badge {
    background: linear-gradient(145deg, #f39c12, #e67e22) !important;
    color: white !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 0.6rem 1.5rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 0 #b8860b, 0 10px 15px rgba(0,0,0,0.3) !important;
    position: relative;
    overflow: hidden;
}

.old-zone .zone-badge {
    background: linear-gradient(145deg, #8e44ad, #9b59b6) !important;
    box-shadow: 0 5px 0 #6c3483, 0 10px 15px rgba(0,0,0,0.3) !important;
}

.new-zone .zone-badge {
    background: linear-gradient(145deg, #2980b9, #3498db) !important;
    box-shadow: 0 5px 0 #1f618d, 0 10px 15px rgba(0,0,0,0.3) !important;
}

.zone-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.zone-badge:hover::before {
    left: 100%;
}

/* ===== LIBRO CENTRAL ===== */
.book-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.book-card {
    background: linear-gradient(145deg, #f39c12, #e67e22);
    width: 240px;
    height: 320px;
    border-radius: 20px 30px 30px 20px;
    box-shadow: 15px 15px 30px rgba(0,0,0,0.5),
                inset 0 0 20px rgba(255,255,255,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    border: 3px solid var(--gold);
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.book-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 12px;
    background: linear-gradient(to right, #d35400, #f39c12);
    border-radius: 10px 0 0 10px;
    box-shadow: inset -3px 0 5px rgba(0,0,0,0.3);
}

.book-card.throw-animation {
    animation: throwBook 0.5s ease-out;
}

@keyframes throwBook {
    0% { transform: scale(1) translateY(0); }
    30% { transform: scale(1.2) translateY(-30px); }
    70% { transform: scale(0.8) translateY(100px); opacity: 0.7; }
    100% { transform: scale(0) translateY(200px); opacity: 0; }
}

.book-icon {
    font-size: 5rem;
    color: var(--gold);
    text-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

.book-name {
    font-size: 1.9rem;
    font-weight: bold;
    color: white;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    font-family: 'Playfair Display', serif;
    line-height: 1.2;
}

/* ===== INDICADORES DE MODO ===== */
.mode-indicator {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: #1e2b3a;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 5px 0 var(--gold-dark);
    white-space: nowrap;
    z-index: 20;
    border: 2px solid white;
}

.mode-indicator.old-mode {
    background: var(--old-testament);
    color: white;
    box-shadow: 0 5px 0 #4a2511;
}

.mode-indicator.new-mode {
    background: var(--new-testament);
    color: white;
    box-shadow: 0 5px 0 #1e3a6b;
}

.book-mode-badge {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: var(--gold);
    padding: 0.1rem 0.8rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--gold);
    white-space: nowrap;
}

/* ===== FEEDBACK ===== */
.game-feedback {
    position: relative;
    width: 100%;
    min-height: 60px;
    margin: 1rem 0;
    pointer-events: none;
    z-index: 1000;
}

.feedback-bubble {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: bubblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1001;
    pointer-events: none;
    border: 2px solid white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

@keyframes bubblePop {
    0% { transform: scale(0) translateY(20px); opacity: 0; }
    50% { transform: scale(1.2) translateY(-5px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.feedback-bubble.success {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
    border-color: #f1c40f;
}

.feedback-bubble.error {
    background: linear-gradient(145deg, #c0392b, #e74c3c);
    color: white;
    border-color: #f39c12;
}

.feedback-bubble.warning {
    background: linear-gradient(145deg, #f39c12, #f1c40f);
    color: #2c3e50;
    border-color: #e67e22;
}

.feedback-bubble.info {
    background: linear-gradient(145deg, #2980b9, #3498db);
    color: white;
    border-color: #f1c40f;
}

.feedback-bubble.celebration {
    background: linear-gradient(145deg, #8e44ad, #9b59b6);
    color: white;
    border-color: #f1c40f;
    animation: bubblePop 0.4s ease, celebrationGlow 1s infinite alternate;
}

/* ===== PARTÍCULAS DEL LIBRO ===== */
.book-particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15; /* AUMENTADO para estar sobre el libro */
    overflow: visible; /* Cambiado a visible */
    border-radius: 20px 30px 30px 20px;
}

.book-particle {
    position: absolute;
    width: var(--size);
    height: var(--size);
    background: var(--color);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(var(--blur));
    opacity: var(--opacity);
    animation: particleFloat var(--duration) linear infinite;
    left: var(--x);
    top: var(--y);
    z-index: 16;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: var(--opacity);
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Rachas de partículas */
.book-particle.streak-10 {
    --color: rgba(255, 215, 0, 0.7);
    --blur: 2px;
    --size: 5px;
    animation-duration: 2s;
}

.book-particle.streak-20 {
    --color: rgba(255, 165, 0, 0.8);
    --blur: 1.5px;
    --size: 6px;
    animation-duration: 1.8s;
}

.book-particle.streak-30 {
    --color: rgba(255, 69, 0, 0.9);
    --blur: 1px;
    --size: 7px;
    animation-duration: 1.5s;
}

.book-particle.streak-40 {
    --color: rgba(255, 0, 0, 1);
    --blur: 0.5px;
    --size: 8px;
    animation-duration: 1.2s;
    box-shadow: 0 0 8px currentColor;
}

/* ===== HINT ===== */
.game-hint {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    display: inline-block;
    align-self: center;
}

.hint-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--gold);
    font-size: 1.1rem;
}

/* ===== HIGH SCORES ===== */
.high-scores {
    margin-top: 1.5rem;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    padding: 1rem;
}

.high-scores h3 {
    color: var(--gold);
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scores-table {
    width: 100%;
    border-collapse: collapse;
    color: white;
    font-size: 0.9rem;
}

.scores-table th,
.scores-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,215,0,0.2);
}

.scores-table th {
    background: rgba(255,215,0,0.2);
    color: var(--gold);
    font-weight: bold;
    font-size: 0.8rem;
}

/* ===== MODAL ===== */
.game-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.game-modal-content {
    background: linear-gradient(135deg, #1e2b3a, #15202b);
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
    position: relative;
}

.game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,215,0,0.3);
}

.game-modal-header h2 {
    color: var(--gold);
    font-size: 1.5rem;
    margin: 0;
}

.game-modal-close {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 2.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== GAME OVER MODAL ===== */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.game-over-content {
    background: linear-gradient(145deg, #2c3e50, #1e2b3a);
    padding: 2rem;
    border-radius: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 3px solid var(--gold);
    box-shadow: 0 0 30px rgba(255,215,0,0.3);
    animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.game-over-icon {
    font-size: 4rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.game-over-content h2 {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.final-score {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.final-score span {
    color: var(--gold);
    font-weight: bold;
    font-size: 2.5rem;
}

.score-message {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: rgba(255,255,255,0.9);
    padding: 0.5rem;
    background: rgba(0,0,0,0.3);
    border-radius: 30px;
}

.score-form {
    margin-top: 1rem;
}

.score-form input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    border: 2px solid var(--gold);
    border-radius: 15px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1rem;
    text-align: center;
}

.score-buttons {
    display: flex;
    gap: 0.8rem;
}

.btn-score {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-score.save {
    background: var(--success);
    color: white;
    border-bottom: 3px solid #1e8449;
}

.btn-score.cancel {
    background: #7f8c8d;
    color: white;
    border-bottom: 3px solid #5a6263;
}

/* ===== BOTONES FLOTANTES ===== */
.floating-game-btn {
    position: fixed;
    bottom: 132px;
    right: 5px;
    width: 25px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f39c12, #e67e22);
    color: white;
    border: 3px solid var(--gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    animation: pulse 2s infinite;
}

.floating-game-btn i {
    font-size: 1.5rem;
    color: var(--gold);
}

.floating-game-btn span {
    display: none;
    position: absolute;
    right: 29px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
    border: 1px solid var(--gold);
}

.floating-game-btn:hover span {
    display: block;
}

.floating-game-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(255,215,0,0.4);
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 768px) {
    .game-modal-content { padding: 0.8rem; }
    
    .game-stats {
        gap: 0.5rem;
        padding: 0.6rem;
        font-size: 1rem;
    }
    
    .btn-game { padding: 0.6rem 1rem; font-size: 0.9rem; }
    
    .game-play-area {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .testament-zone {
        width: 100%;
        min-height: auto;
        padding: 0.8rem;
        flex-direction: row;
        justify-content: space-around;
    }
    
    .testament-zone h3 { font-size: 1.2rem; }
    .zone-icon { font-size: 2rem; }
    .zone-badge { padding: 0.3rem 1rem; font-size: 0.8rem; }
    
    #modalOldTestament { order: 1; }
    #modalNewTestament { order: 2; }
    .book-area { order: 3; margin: 0.5rem 0; }
    .game-hint { order: 4; }
    
    .book-card {
        width: 280px;
        height: 220px;
    }
    
.book-name {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    font-family: 'Playfair Display', serif;
    text-align: center;
    width: 100%;
    padding: 0 10px;
    margin: 0;
    position: relative;
    top: -20px;
    right: auto;
    transform: none;
    line-height: 1.2;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
}

    .mode-indicator {
        top: -15px;
        padding: 0.3rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .book-mode-badge {
        bottom: px;
        padding: 0.2rem 0.6rem;
        font-size: 0.6rem;
    }
    
    .game-feedback { min-height: 40px; }
    .feedback-bubble { font-size: 0.9rem; padding: 0.5rem 1rem; }
    
    .floating-game-btn {
        bottom: 129px;
        width: 25px;
        height: 12px;
    }
}

@media (max-width: 360px) {
    .book-card { 
        width: 220px; 
        height: 200px; 
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .book-name { 
        font-size: 1.3rem !important; /* Más grande */
        font-weight: bold;
        color: white;
        text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
        font-family: 'Playfair Display', serif;
        text-align: center;
        width: 100%;
        padding: 0 5px;
        margin: 0;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        line-height: 1.2;
        word-wrap: break-word;
        display: flex;
        align-items: center;
        justify-content: center;
        height: auto;
        max-width: 180px;
        margin: 0 auto;
    }
    
    .book-icon {
        font-size: 2.2rem !important;
        margin-bottom: 0.2rem;
    }
    
    .mode-indicator { 
        min-width: 120px;
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .book-mode-badge { 
        min-width: 90px;
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
        bottom: 5px;
    }
}

/* NUEVO: RACHA 15 */
.feedback-bubble.streak-15 {
    background: linear-gradient(145deg, #f1c40f, #e67e22);
    border-color: #f39c12;
    animation: bubblePop 0.4s ease, softShake 0.4s infinite;
    box-shadow: 0 0 25px #f1c40f, 0 0 40px #e67e22;
}

.feedback-bubble.streak-15::before {
    content: '🌟';
    position: absolute;
    left: -20px;
    top: -10px;
    font-size: 1.8rem;
    animation: starSpin 2s infinite;
}

@keyframes starSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

@media (max-width: 768px) {
    .feedback-bubble.streak-40::before,
    .feedback-bubble.streak-40::after {
        font-size: 1.8rem !important;
    }
    
    .feedback-bubble.streak-30::before,
    .feedback-bubble.streak-30::after {
        font-size: 1.5rem !important;
    }
    
    .feedback-bubble.streak-20::before {
        font-size: 1.5rem !important;
    }
    
    .feedback-bubble.streak-15::before {
        font-size: 1.5rem !important;
        left: -15px;
    }
}
/* ===== EFECTOS MEJORADOS PARA RACHAS ===== */

/* RACHA 20 - BRILLO ESTELAR */
.feedback-bubble.streak-20 {
    background: linear-gradient(145deg, #ffd700, #f1c40f, #ffffff);
    border-color: #f39c12;
    animation: bubblePop 0.4s ease, stellarGlow 1.5s infinite alternate;
    box-shadow: 0 0 30px #ffd700, 0 0 60px #f1c40f;
    text-shadow: 0 0 10px #fff, 0 0 20px #ffd700;
    font-size: 1.1rem !important; /* Tamaño normal */
    padding: 0.6rem 1.5rem !important; /* Padding normal */
}

.feedback-bubble.streak-20::before {
    content: '✨';
    position: absolute;
    left: -25px;
    top: -15px;
    font-size: 1.8rem;
    animation: starSpin 2s infinite linear;
    filter: drop-shadow(0 0 5px gold);
}

.feedback-bubble.streak-20::after {
    content: '✨';
    position: absolute;
    right: -25px;
    bottom: -15px;
    font-size: 1.8rem;
    animation: starSpin 2s infinite linear reverse;
    filter: drop-shadow(0 0 5px gold);
}

/* RACHA 30 - RAYOS CELESTIALES */
.feedback-bubble.streak-30 {
    background: linear-gradient(145deg, #9b59b6, #8e44ad, #f1c40f);
    border-color: #e67e22;
    animation: bubblePop 0.4s ease, celestialPulse 1s infinite alternate;
    box-shadow: 0 0 30px #9b59b6, 0 0 60px #f1c40f;
    text-shadow: 0 0 10px #fff, 0 0 20px #f1c40f;
    font-size: 1.1rem !important;
    padding: 0.6rem 1.5rem !important;
}

.feedback-bubble.streak-30::before {
    content: '⭐';
    position: absolute;
    left: -30px;
    top: -20px;
    font-size: 2rem;
    animation: starSpin 1.5s infinite linear;
    filter: drop-shadow(0 0 8px #9b59b6);
}

.feedback-bubble.streak-30::after {
    content: '⭐';
    position: absolute;
    right: -30px;
    bottom: -20px;
    font-size: 2rem;
    animation: starSpin 1.5s infinite linear reverse;
    filter: drop-shadow(0 0 8px #f1c40f);
}

/* RACHA 40 - FUEGO DIVINO (CORREGIDO - TAMAÑO NORMAL) */
.feedback-bubble.streak-40 {
    background: linear-gradient(145deg, #e74c3c, #c0392b, #f39c12);
    border-color: #ffd700;
    animation: bubblePop 0.4s ease, divineFire 0.8s infinite alternate;
    box-shadow: 0 0 30px #e74c3c, 0 0 60px #f39c12;
    text-shadow: 0 0 10px #fff, 0 0 20px #ff0;
    font-size: 1.1rem !important; /* Tamaño normal */
    padding: 0.6rem 1.5rem !important; /* Padding normal */
    position: relative;
}

.feedback-bubble.streak-40::before {
    content: '🔥';
    position: absolute;
    left: -30px;
    top: -20px;
    font-size: 2rem;
    animation: flameFlicker 0.2s infinite alternate, starSpin 3s infinite linear;
    filter: drop-shadow(0 0 10px #f90);
}

.feedback-bubble.streak-40::after {
    content: '🔥';
    position: absolute;
    right: -30px;
    bottom: -20px;
    font-size: 2rem;
    animation: flameFlicker 0.2s infinite alternate-reverse, starSpin 3s infinite linear reverse;
    filter: drop-shadow(0 0 10px #f90);
}

/* RACHA 15 - CON ESTRELLA GIRATORIA (MEJORADA) */
.feedback-bubble.streak-15 {
    background: linear-gradient(145deg, #f1c40f, #e67e22);
    border-color: #f39c12;
    animation: bubblePop 0.4s ease, softShake 0.4s infinite;
    box-shadow: 0 0 25px #f1c40f, 0 0 40px #e67e22;
    font-size: 1.1rem !important;
    padding: 0.6rem 1.5rem !important;
}

.feedback-bubble.streak-15::before {
    content: '🌟';
    position: absolute;
    left: -30px;
    top: -15px;
    font-size: 2rem;
    animation: starSpin 2s infinite linear;
    filter: drop-shadow(0 0 8px gold);
}

.feedback-bubble.streak-15::after {
    content: '🌟';
    position: absolute;
    right: -30px;
    bottom: -15px;
    font-size: 2rem;
    animation: starSpin 2s infinite linear reverse;
    filter: drop-shadow(0 0 8px orange);
}

/* RACHA 10 - CON DESTELLOS */
.feedback-bubble.streak-10 {
    background: linear-gradient(145deg, #e67e22, #f39c12);
    border-color: #e67e22;
    animation: bubblePop 0.4s ease, shake 0.3s infinite;
    box-shadow: 0 0 20px #f39c12;
    font-size: 1.1rem !important;
    padding: 0.6rem 1.5rem !important;
}

.feedback-bubble.streak-10::before {
    content: '⚡';
    position: absolute;
    left: -25px;
    top: -10px;
    font-size: 1.8rem;
    animation: starSpin 2s infinite linear;
}

/* RACHA 5 - CON CHISPAS */
.feedback-bubble.streak-5 {
    background: linear-gradient(145deg, #f39c12, #f1c40f);
    border-color: #e67e22;
    box-shadow: 0 0 15px #f1c40f;
    font-size: 1.1rem !important;
    padding: 0.6rem 1.5rem !important;
}

.feedback-bubble.streak-5::before {
    content: '🔥';
    position: absolute;
    left: -20px;
    top: -5px;
    font-size: 1.5rem;
    animation: starSpin 3s infinite linear;
}

/* Animación de estrella giratoria - LA CLAVE */
@keyframes starSpin {
    0% { 
        transform: rotate(0deg) scale(1); 
    }
    100% { 
        transform: rotate(360deg) scale(1); 
    }
}

/* Versión responsive */
@media (max-width: 768px) {
    .feedback-bubble.streak-40::before,
    .feedback-bubble.streak-40::after {
        font-size: 1.5rem !important;
        left: -20px;
        right: -20px;
    }
    
    .feedback-bubble.streak-30::before,
    .feedback-bubble.streak-30::after,
    .feedback-bubble.streak-20::before,
    .feedback-bubble.streak-20::after,
    .feedback-bubble.streak-15::before,
    .feedback-bubble.streak-15::after {
        font-size: 1.5rem !important;
    }
}

/* ===== HIGHSCORES ADAPTABLE PARA MÓVIL ===== */
@media (max-width: 480px) {
    .high-scores {
        padding: 0.8rem;
        margin-top: 1rem;
    }
    
    .high-scores h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .scores-table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .scores-table th,
    .scores-table td {
        padding: 0.4rem 0.3rem;
        min-width: 60px;
    }
    
    .scores-table th:first-child,
    .scores-table td:first-child {
        min-width: 40px;
    }
    
    .scores-table th:nth-child(2),
    .scores-table td:nth-child(2) {
        min-width: 80px;
    }
    
    .scores-table th:nth-child(3),
    .scores-table td:nth-child(3),
    .scores-table th:nth-child(4),
    .scores-table td:nth-child(4) {
        min-width: 50px;
    }
    
    .scores-table th:nth-child(5),
    .scores-table td:nth-child(5) {
        min-width: 70px;
    }
}

@media (max-width: 360px) {
    .high-scores {
        padding: 0.5rem;
    }
    
    .scores-table {
        font-size: 0.7rem;
    }
    
    .scores-table th,
    .scores-table td {
        padding: 0.3rem 0.2rem;
    }
}

/* Estilos para el panel de admin de puntuaciones */
.game-scores-admin-panel {
    background: linear-gradient(145deg, #2c3e50, #1e2b3a);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 1rem;
    margin-top: 1.5rem;
    color: white;
    box-shadow: 0 0 20px rgba(255,215,0,0.2);
}

.game-scores-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,215,0,0.3);
}

.game-scores-admin-header h4 {
    color: var(--gold);
    margin: 0;
    font-size: 1.1rem;
}

.game-scores-admin-header .btn-close {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
}

.admin-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #ccc;
}

.btn-refresh {
    background: #34495e;
    color: white;
    border: 1px solid var(--gold);
    border-radius: 5px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: #3d566e;
    transform: scale(1.05);
}

.scores-list-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 10px;
    background: rgba(0,0,0,0.2);
}

.admin-scores-table {
    width: 100%;
    border-collapse: collapse;
    color: white;
    font-size: 0.9rem;
}

.admin-scores-table th {
    background: rgba(255,215,0,0.2);
    color: var(--gold);
    padding: 0.5rem;
    font-size: 0.8rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-scores-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,215,0,0.1);
}

.admin-scores-table tr:hover {
    background: rgba(255,215,0,0.1);
}

.btn-delete-score {
    background: #c0392b;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-delete-score:hover {
    background: #e74c3c;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .game-scores-admin-panel {
        padding: 0.8rem;
    }
    
    .admin-scores-table {
        font-size: 0.8rem;
    }
    
    .admin-scores-table th,
    .admin-scores-table td {
        padding: 0.3rem;
    }
    
    .btn-delete-score {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
}

/* Alertas flotantes */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideInRight 0.3s ease;
}

.alert-success {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
}

.alert-error {
    background: linear-gradient(145deg, #c0392b, #e74c3c);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== JUEGO ORDENA LIBROS - ESTILOS ESPECÍFICOS ===== */

/* Contenedor de tarjetas */
.order-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Tarjetas de libros */
.order-card {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border-radius: 15px;
    padding: 1.2rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.order-card.selected {
    background: #fff9e6;
    transform: scale(1.02);
}

/* Número de orden en la tarjeta */
.card-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ecf0f1;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 auto 0.5rem auto;
    transition: all 0.3s ease;
}

.card-number.filled {
    background: #27ae60;
    color: white;
    animation: popNumber 0.3s ease;
}

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

/* Nombre del libro en la tarjeta */
.card-name {
       font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    word-break: break-word;       /* Permite cortar palabras largas */
    overflow-wrap: break-word;
    hyphens: auto;                 /* Añade guiones si es necesario (opcional) */
    line-height: 1.3;
}

/* Indicador de testamento (AT/NT) */
.card-testament {
    font-size: 0.8rem;
    color: #7f8c8d;
    background: #ecf0f1;
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    margin: 0 auto;
}

/* ===== BOTONES DE ACCIÓN ===== */
.order-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.btn-check-order, .btn-reset-order {
    padding: 1rem 2rem;
    border: none;
    border-radius: 15px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 250px;
}

.btn-check-order {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    border-bottom: 4px solid #1f4e7a;
}

.btn-check-order.ready {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    border-bottom-color: #1e8449;
    animation: pulse 2s infinite;
}

.btn-check-order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-reset-order {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    color: white;
    border-bottom: 4px solid #5a6263;
}

.btn-check-order:hover:not(:disabled), .btn-reset-order:hover {
    transform: translateY(-3px);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ===== SELECTOR DE MODO (3/5 LIBROS) ===== */
.mode-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.mode-btn {
    background: linear-gradient(145deg, #34495e, #2c3e50);
    border: none;
    border-radius: 15px;
    padding: 1rem 2rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    border: 2px solid transparent;
}

.mode-btn.active {
    border-color: #ffd700;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.mode-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
}

.mode-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== HEADER DEL JUEGO ORDENA ===== */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.order-mode-indicator {
    background: #2c3e50;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffd700;
}

.order-instruction {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* ===== ÁREA DE JUEGO ORDENA ===== */
.order-play-area {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    margin: 1rem 0;
}

/* ===== MEDIA QUERIES PARA ORDENA LIBROS ===== */
@media (max-width: 768px) {
    .order-cards-container {
        display: grid;
        gap: 0.8rem;
        margin: 1rem 0;
    }
    
    /* Cuando hay 3 libros */
    .order-cards-container[data-mode="3"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Cuando hay 5 libros */
    .order-cards-container[data-mode="5"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .order-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .order-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-check-order, .btn-reset-order {
        width: 100%;
        max-width: none;
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    .mode-selector {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .mode-btn {
        padding: 0.6rem 0.8rem;
    }
    
    .mode-number {
        font-size: 1.3rem;
    }
    
    .mode-label {
        font-size: 0.8rem;
    }
}


@media (max-width: 360px) {
    .order-cards-container[data-mode="3"] {
        gap: 0.3rem;
    }

        .order-cards-container[data-mode="5"] {
        grid-template-columns: repeat(2, 1fr); /* Siempre 2 columnas */
    }
    
    .order-card {
        padding: 0.6rem 0.2rem;
    }
    
    .card-name {
         font-weight: bold;
        color: #2c3e50;
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
        word-break: break-word;   
        overflow-wrap: break-word;
        hyphens: auto;                 /* Añade guiones si es necesario (opcional) */
        line-height: 1.3;
    }
    
    .card-testament {
        font-size: 0.65rem;
        padding: 0.1rem 0.4rem;
    }
    
    .btn-check-order, .btn-reset-order {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
}

/* Versión para 5 libros en tablets medianas */
@media (min-width: 481px) and (max-width: 600px) {
    .order-cards-container[data-mode="5"] {
        grid-template-columns: repeat(2, 1fr); /* Siempre 2 columnas */
    }
    
    .card-name {
        font-size: 0.9rem;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-card {
    animation: slideIn 0.3s ease;
}

/* ===== EFECTOS DE COMPROBACIÓN ===== */
@keyframes correctPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 10px rgba(39, 174, 96, 0.5); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

@keyframes correctGlow {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.3) drop-shadow(0 0 10px #27ae60); }
    100% { filter: brightness(1); }
}

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

@keyframes incorrectFlash {
    0% { background-color: #fff; border-color: #c0392b; }
    50% { background-color: #c0392b; border-color: #fff; }
    100% { background-color: #fff; border-color: #c0392b; }
}

.order-card.correct-animation {
    animation: correctPulse 0.8s ease, correctGlow 1.5s ease;
    border-color: #27ae60 !important;
    background: linear-gradient(145deg, #ffffff, #d4edda) !important;
}

.order-card.incorrect-animation {
    animation: incorrectShake 0.5s ease, incorrectFlash 0.5s ease;
    border-color: #c0392b !important;
}

/* Estrellas de acierto */
.correct-star {
    position: absolute;
    pointer-events: none;
    font-size: 1.5rem;
    animation: starFly 1s ease-out forwards;
    z-index: 100;
}

@keyframes starFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(360deg);
    }
}

/* Mensaje de resultado */
.check-result-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 2rem;
    z-index: 10000;
    animation: resultPop 1s ease-out forwards;
    text-align: center;
    white-space: nowrap;
}

@keyframes resultPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

.check-result-message.perfect {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
    border: 3px solid #ffd700;
    box-shadow: 0 0 50px rgba(39, 174, 96, 0.5);
}

.check-result-message.partial {
    background: linear-gradient(145deg, #f39c12, #f1c40f);
    color: #2c3e50;
    border: 3px solid #e67e22;
    box-shadow: 0 0 50px rgba(243, 156, 18, 0.5);
}


/* Feedback normal con puntos */
.feedback-bubble.success {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
    border-color: #f1c40f;
    font-size: 1.3rem !important;
    padding: 0.8rem 2rem !important;
}

.feedback-bubble.info {
    background: linear-gradient(145deg, #2980b9, #3498db);
    color: white;
    border-color: #f1c40f;
    font-size: 1.3rem !important;
    padding: 0.8rem 2rem !important;
}

/* ===== ANIMACIONES DE ENTRADA PARA MODALES ===== */
@keyframes modalFadeIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

@keyframes modalContentSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalContentPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        box-shadow: 0 0 30px 10px rgba(255, 215, 0, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

@keyframes modalHeaderGlow {
    0% {
        border-bottom-color: rgba(255, 215, 0, 0.1);
    }
    50% {
        border-bottom-color: rgba(255, 215, 0, 0.8);
    }
    100% {
        border-bottom-color: rgba(255, 215, 0, 0.1);
    }
}
/* ===== ANIMACIONES SIMPLES PARA MODALES ===== */
@keyframes modalSimpleFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Clases de animación - MÍNIMAS y que NO afectan el scroll */
.game-modal-overlay {
    animation: modalSimpleFadeIn 0.3s ease forwards;
}

.game-modal-content {
    animation: modalSimpleSlideIn 0.3s ease forwards;
}

/* Animación de salida */
.game-modal-overlay.fade-out {
    animation: modalSimpleFadeOut 0.2s ease forwards;
}

@keyframes modalSimpleFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.game-modal-overlay.fade-out .game-modal-content {
    animation: modalSimpleSlideOut 0.2s ease forwards;
}
/* Efecto de partículas de entrada */
.modal-particle {
    position: absolute;
    pointer-events: none;
    font-size: 1.5rem;
    opacity: 0;
    animation: modalParticleFloat 2s ease-out forwards;
    z-index: 10001;
}

@keyframes modalParticleFloat {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(0deg) scale(0);
    }
    20% {
        opacity: 1;
        transform: translate(calc(var(--tx) * 0.2), calc(var(--ty) * 0.2)) rotate(72deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) rotate(360deg) scale(0);
    }
}

/* Animación de entrada para elementos internos */
.game-stats,
.game-controls,
.mode-selector,
.order-play-area,
.game-play-area,
.high-scores {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.game-stats { animation-delay: 0.1s; }
.game-controls { animation-delay: 0.2s; }
.mode-selector { animation-delay: 0.3s; }
.order-play-area,
.game-play-area { animation-delay: 0.4s; }
.high-scores { animation-delay: 0.5s; }

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

/* Efecto de brillo en el título */
.game-modal-header h2 {
    animation: titleGlow 2s infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700;
    }
    50% {
        text-shadow: 0 0 20px #ffd700, 0 0 30px #ffd700, 0 0 40px #ffd700;
    }
}

/* Animación de salida */
.game-modal-overlay.fade-out {
    animation: modalFadeOut 0.3s ease forwards;
}

@keyframes modalFadeOut {
    0% {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
    100% {
        opacity: 0;
        backdrop-filter: blur(0);
    }
}

.game-modal-overlay.fade-out .game-modal-content {
    animation: modalContentSlideOut 0.3s ease forwards;
}

@keyframes modalContentSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
}

/* Versión responsive para mensajes de resultado */
@media (max-width: 768px) {
    .check-result-message {
        padding: 0.8rem 1.5rem !important;
        font-size: 1.5rem !important;
        max-width: 90vw;
        white-space: normal !important;
        word-wrap: break-word;
        min-width: 200px;
        text-align: center;
    }
    
    .check-result-message.perfect {
        font-size: 1.5rem !important;
    }
    
    .check-result-message.perfect div:first-child {
        font-size: 1.2rem !important;
    }
    
    .check-result-message.perfect div:nth-child(2) {
        font-size: 2rem !important;
    }
    
    .bonus-indicators {
        flex-wrap: wrap;
        gap: 0.3rem !important;
    }
}

@media (max-width: 480px) {
    .check-result-message {
        padding: 0.6rem 1rem !important;
        max-width: 85vw;
    }
    
    .check-result-message.perfect div:first-child {
        font-size: 1rem !important;
    }
    
    .check-result-message.perfect div:nth-child(2) {
        font-size: 1.6rem !important;
    }
    
    .bonus-indicator {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 360px) {
    .check-result-message {
        padding: 0.5rem 0.8rem !important;
        max-width: 80vw;
    }
    
    .check-result-message.perfect div:first-child {
        font-size: 0.9rem !important;
    }
    
    .check-result-message.perfect div:nth-child(2) {
        font-size: 1.4rem !important;
    }
}