/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Neue', cursive;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    padding: 20px;
}

/* Header principal */
.main-header {
    text-align: center;
    margin-bottom: 40px;
    animation: bounceIn 1s ease-out;
}

.main-title {
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 3px 3px 0px #ff6b6b, 6px 6px 0px #4ecdc4;
    margin-bottom: 10px;
    animation: rainbow 3s linear infinite;
}

.subtitle {
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
    font-weight: 300;
}

/* Grid de personajes */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tarjetas de personajes */
.character-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 4px solid transparent;
    animation: float 3s ease-in-out infinite;
}

.character-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border-color: #ff6b6b;
}

.character-card:nth-child(1) { animation-delay: 0s; }
.character-card:nth-child(2) { animation-delay: 0.5s; }
.character-card:nth-child(3) { animation-delay: 1s; }
.character-card:nth-child(4) { animation-delay: 1.5s; }

/* Círculos de personajes */
.character-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.character-card:hover .character-circle {
    transform: scale(1.1);
}

/* Personajes específicos */
.numeros-character {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.colores-character {
    background: linear-gradient(45deg, #4ecdc4, #6dd5d0);
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

.naturaleza-character {
    background: linear-gradient(45deg, #45b7d1, #6bc5d8);
    box-shadow: 0 0 20px rgba(69, 183, 209, 0.5);
}

.animales-character {
    background: linear-gradient(45deg, #f9ca24, #fbd54a);
    box-shadow: 0 0 20px rgba(249, 202, 36, 0.5);
}

/* Ojos de los personajes */
.eyes {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.eye {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    animation: blink 3s infinite;
}

.eye::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Boca de los personajes */
.character-mouth {
    width: 30px;
    height: 15px;
    border: 3px solid #333;
    border-top: none;
    border-radius: 0 0 30px 30px;
    margin-top: 5px;
}

/* Nombres y descripciones */
.character-name {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
}

.character-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    font-weight: 400;
}

/* Elementos de los personajes */
.character-items {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.item {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.item:nth-child(1) { animation-delay: 0s; }
.item:nth-child(2) { animation-delay: 0.3s; }
.item:nth-child(3) { animation-delay: 0.6s; }

.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

.color-dot.red { background: #ff4757; }
.color-dot.blue { background: #3742fa; }
.color-dot.yellow { background: #ffa502; }

/* Botón de regreso */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-button:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

/* Secciones de contenido */
.content-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: slideIn 0.5s ease-out;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.section-header p {
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
}

/* Grids de contenido */
.numbers-grid,
.colors-grid,
.nature-grid,
.animals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* Elementos interactivos */
.number-card,
.color-card,
.nature-card,
.animal-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 3px solid transparent;
}

.number-card:hover,
.color-card:hover,
.nature-card:hover,
.animal-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border-color: #ff6b6b;
}

/* Animaciones */
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes rainbow {
    0% { color: #ff6b6b; }
    16% { color: #4ecdc4; }
    32% { color: #45b7d1; }
    48% { color: #f9ca24; }
    64% { color: #ff9ff3; }
    80% { color: #54a0ff; }
    100% { color: #ff6b6b; }
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .characters-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .character-card {
        padding: 20px;
    }
    
    .character-circle {
        width: 100px;
        height: 100px;
    }
    
    .back-button {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 10px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .characters-grid {
        grid-template-columns: 1fr;
    }
    
    .character-circle {
        width: 80px;
        height: 80px;
    }
    
    .eye {
        width: 15px;
        height: 15px;
    }
    
    .eye::after {
        width: 6px;
        height: 6px;
    }
}

/* Estilos para la sección de números interactiva */
.numbers-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.numbers-controls {
    text-align: center;
    margin-bottom: 30px;
}

.control-button {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.control-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.start-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
}

.exercise-btn {
    background: linear-gradient(45deg, #4ecdc4, #6dd5d0);
}

.reset-btn {
    background: linear-gradient(45deg, #f9ca24, #fbd54a);
}

/* Área de presentación */
.presentation-area {
    text-align: center;
    padding: 20px;
}

.stage {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border-radius: 20px;
    border: 2px dashed rgba(255,255,255,0.3);
}

.number-character {
    position: relative;
}

.number-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 4px solid rgba(255,255,255,0.3);
}

.number-eyes {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
}

.number-eye {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    animation: blink 3s infinite;
}

.number-eye::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.number-mouth {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 15px;
    border: 3px solid #333;
    border-top: none;
    border-radius: 0 0 30px 30px;
}

.number-display {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.number-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.number-text {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
    margin: 0;
}

.presentation-text {
    font-size: 1.5rem;
    color: white;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
    font-weight: 400;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Área de ejercicio */
.exercise-area {
    text-align: center;
    padding: 20px;
}

.exercise-question {
    margin-bottom: 30px;
}

.exercise-question h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

.numbers-grid-exercise {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto 30px;
}

.exercise-number-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 3px solid transparent;
    animation: slideInUp 0.5s ease-out;
}

.exercise-number-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border-color: #ff6b6b;
}

.exercise-number-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.exercise-number-eyes {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.exercise-number-eye {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    animation: blink 3s infinite;
}

.exercise-number-eye::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background: #333;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.exercise-number-mouth {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    border: 2px solid #333;
    border-top: none;
    border-radius: 0 0 20px 20px;
}

.exercise-number-display {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.exercise-number-emoji {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 2px;
}

.exercise-number-text {
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    color: white;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
    margin: 0;
}

/* Barra de progreso */
.exercise-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    color: white;
    font-size: 1.1rem;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
}

/* Pantalla de ejercicio completado */
.exercise-complete {
    text-align: center;
    padding: 40px;
    background: rgba(255,255,255,0.95);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.complete-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.exercise-complete h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
}

.exercise-complete p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 20px;
}

.final-score {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.complete-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.complete-button {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.complete-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Modales de respuesta */
.correct-modal {
    text-align: center;
}

.correct-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: bounce 0.5s ease-out;
}

.correct-modal h2 {
    color: #2ed573;
    margin-bottom: 15px;
}

.correct-number {
    background: linear-gradient(45deg, #2ed573, #7bed9f);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.correct-emoji {
    font-size: 2rem;
}

.correct-text {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
}

.incorrect-modal {
    text-align: center;
}

.incorrect-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: shake 0.5s ease-out;
}

.incorrect-modal h2 {
    color: #ff4757;
    margin-bottom: 15px;
}

.try-again {
    margin-top: 20px;
}

.try-button {
    background: linear-gradient(45deg, #ff4757, #ff6b6b);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
}

.try-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

/* Animaciones específicas para números */
@keyframes numberEnter {
    0% { 
        transform: translateX(-100%) scale(0.5); 
        opacity: 0; 
    }
    50% { 
        transform: translateX(-20%) scale(0.8); 
        opacity: 0.7; 
    }
    100% { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
}

@keyframes numberJump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes numberWave {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

@keyframes numberExit {
    0% { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: translateX(20%) scale(0.8); 
        opacity: 0.7; 
    }
    100% { 
        transform: translateX(100%) scale(0.5); 
        opacity: 0; 
    }
}

@keyframes slideInUp {
    0% { 
        transform: translateY(50px); 
        opacity: 0; 
    }
    100% { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Notificaciones de voz */
.voice-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    color: white;
    padding: 15px 20px;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.voice-notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 1.2rem;
}

.notification-text {
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
}

/* Responsive para números */
@media (max-width: 768px) {
    .stage {
        height: 250px;
    }
    
    .number-circle {
        width: 120px;
        height: 120px;
    }
    
    .number-eyes {
        gap: 15px;
    }
    
    .number-eye {
        width: 16px;
        height: 16px;
    }
    
    .number-eye::after {
        width: 6px;
        height: 6px;
    }
    
    .number-emoji {
        font-size: 1.5rem;
    }
    
    .number-text {
        font-size: 1.5rem;
    }
    
    .presentation-text {
        font-size: 1.2rem;
    }
    
    .exercise-question h3 {
        font-size: 1.5rem;
    }
    
    .numbers-grid-exercise {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .exercise-number-circle {
        width: 60px;
        height: 60px;
    }
    
    .exercise-number-eyes {
        gap: 8px;
    }
    
    .exercise-number-eye {
        width: 10px;
        height: 10px;
    }
    
    .exercise-number-eye::after {
        width: 4px;
        height: 4px;
    }
    
    .exercise-number-emoji {
        font-size: 1rem;
    }
    
    .exercise-number-text {
        font-size: 1rem;
    }
    
    .complete-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .stage {
        height: 200px;
    }
    
    .number-circle {
        width: 100px;
        height: 100px;
    }
    
    .control-button {
        padding: 12px 20px;
        font-size: 1rem;
        margin: 5px;
    }
    
    .presentation-text {
        font-size: 1rem;
        min-height: 40px;
    }
    
    .exercise-question h3 {
        font-size: 1.3rem;
    }
    
    .numbers-grid-exercise {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }
    
    .exercise-number-card {
        padding: 15px;
    }
    
    .exercise-number-circle {
        width: 50px;
        height: 50px;
    }
    
    .exercise-number-eyes {
        gap: 6px;
    }
    
    .exercise-number-eye {
        width: 8px;
        height: 8px;
    }
    
    .exercise-number-eye::after {
        width: 3px;
        height: 3px;
    }
    
    .exercise-number-emoji {
        font-size: 0.8rem;
    }
    
    .exercise-number-text {
        font-size: 0.8rem;
    }
}
