/* Variables de Diseño y Colores */
:root {
    --bg-primary: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    --color-text: #2c3e50;
    --color-white: #ffffff;
    
    /* Colores infantiles vibrantes */
    --color-pink: #ff6b81;
    --color-blue: #4fa8ff;
    --color-green: #2ed573;
    --color-yellow: #ffa502;
    --color-purple: #9b59b6;
    --color-shadow: rgba(0, 0, 0, 0.15);
    
    /* Tipografía */
    --font-main: 'Fredoka', 'Nunito', sans-serif;
}

/* Reset y Estilos Generales */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    overflow-x: hidden;
}

/* Contenedor Principal Ampliado para Proyección */
#app-container {
    width: 98vw;
    max-width: 1250px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 40px;
    border: 8px solid var(--color-white);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Encabezado */
header {
    background: linear-gradient(90deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 6px solid #ffccd5;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.8rem;
    color: #ff4757;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2f3542;
    text-shadow: 2px 2px 0px var(--color-white);
}

.mode-selector {
    display: flex;
    gap: 15px;
}

.mode-btn {
    font-family: var(--font-main);
    font-size: 1.25rem;
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background-color: var(--color-white);
    color: #57606f;
    box-shadow: 0 5px 8px var(--color-shadow);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 12px var(--color-shadow);
}

.mode-btn.active {
    background-color: #ff4757;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

/* Contenedores de Secciones */
#slides-section, #game-section {
    display: none;
    padding: 30px;
    flex-grow: 1;
}

#slides-section.active, #game-section.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.pulse {
    animation: pulse 2s infinite ease-in-out;
}

/* --- ESTILOS DE DIAPOSITIVAS --- */
.presentation-wrapper {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Barra de progreso */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #eccc68;
    padding: 12px 25px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.25rem;
    color: #2f3542;
    border: 4px solid var(--color-white);
}

.progress-bar {
    height: 18px;
    background: repeating-linear-gradient(
        -45deg,
        #ff4757,
        #ff4757 10px,
        #ff6b81 10px,
        #ff6b81 20px
    );
    border-radius: 10px;
    width: 5%;
    transition: width 0.4s ease;
}

/* Tarjeta de Diapositiva - Aumentada para Proyección */
.slide-card {
    background: var(--color-white);
    border-radius: 30px;
    padding: 30px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 35px;
    min-height: 480px;
    border: 5px dashed #74b9ff;
    align-items: center;
}

@media (max-width: 900px) {
    .slide-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

.slide-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f1f2f6;
    border-radius: 25px;
    padding: 25px;
    height: 100%;
    min-height: 320px;
    box-shadow: inset 0 6px 20px rgba(0,0,0,0.05);
}

.slide-illustration svg {
    max-width: 100%;
    max-height: 340px;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.12));
}

.slide-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 10px 0;
}

.slide-content h2 {
    font-size: 2.6rem;
    color: #2f3542;
    margin-bottom: 20px;
    line-height: 1.3;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.05);
}

.slide-content p {
    font-size: 1.6rem;
    color: #4b6584;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Audio narrador */
.audio-controls {
    margin-top: auto;
}

.audio-btn {
    font-family: var(--font-main);
    font-size: 1.4rem;
    font-weight: 700;
    padding: 15px 35px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    background-color: var(--color-green);
    color: var(--color-white);
    box-shadow: 0 6px 0px #1e924d;
    transition: all 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.audio-btn:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0px #1e924d;
}

.audio-btn.stop {
    background-color: var(--color-pink);
    box-shadow: 0 6px 0px #c83949;
}

.audio-btn.stop:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0px #c83949;
}

/* Botones de navegación */
.nav-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.nav-btn {
    font-family: var(--font-main);
    font-size: 1.45rem;
    font-weight: 700;
    padding: 16px 40px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    background-color: #ced6e0;
    color: #2f3542;
    box-shadow: 0 7px 0px #a4b0be;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn:active {
    transform: translateY(6px);
    box-shadow: 0 1px 0px #a4b0be;
}

.nav-btn.primary {
    background-color: #ffa502;
    color: var(--color-white);
    box-shadow: 0 7px 0px #cc8400;
}

.nav-btn.primary:active {
    transform: translateY(6px);
    box-shadow: 0 1px 0px #cc8400;
}

/* --- ESTILOS DE JUEGOS --- */
.game-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 520px;
}

.game-card {
    background: var(--color-white);
    border-radius: 30px;
    padding: 30px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    border: 5px dashed #ff6b81;
}

.game-card.active {
    display: flex;
}

.game-intro-icon {
    font-size: 6rem;
    animation: bounce 2s infinite;
}

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

.yellow-trophy {
    color: #eccc68;
    filter: drop-shadow(0 6px 8px rgba(0,0,0,0.1));
}

.game-card h2 {
    font-size: 2.6rem;
    color: #2f3542;
    text-align: center;
}

.game-card p {
    font-size: 1.5rem;
    color: #57606f;
    text-align: center;
    max-width: 700px;
}

.game-btn-start {
    font-family: var(--font-main);
    font-size: 1.6rem;
    font-weight: 700;
    padding: 18px 45px;
    border: none;
    border-radius: 35px;
    cursor: pointer;
    background-color: var(--color-pink);
    color: var(--color-white);
    box-shadow: 0 9px 0px #b83b4f;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.game-btn-start:active {
    transform: translateY(7px);
    box-shadow: 0 2px 0px #b83b4f;
}

/* Encabezado del Juego */
.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f1f2f6;
    padding: 15px 25px;
    border-radius: 20px;
    border: 3px solid #ced6e0;
}

.level-indicator {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e90ff;
}

.game-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffa502;
}

/* Área del Nivel */
#game-stage {
    width: 100%;
    min-height: 400px;
}

.level-container {
    display: none;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.level-container.active {
    display: block;
}

.instructions {
    font-size: 1.4rem;
    color: #4b6584;
    background: #f5f6fa;
    padding: 15px 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 6px solid #2ed573;
    text-align: left !important;
}

/* NIVEL 1: Drag & Drop */
.drag-zone {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    min-height: 140px;
    background: #f1f2f6;
    border-radius: 25px;
    padding: 25px;
    border: 4px dashed #ced6e0;
    margin-bottom: 35px;
}

.drag-item {
    background: var(--color-white);
    border: 4px solid #74b9ff;
    padding: 15px 10px;
    border-radius: 20px;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: grab;
    user-select: none;
    box-shadow: 0 6px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 130px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.drag-item:hover {
    transform: scale(1.06);
}

.drag-item:active {
    cursor: grabbing;
}

.drag-item.selected {
    border-color: #ff4757;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.4);
    background-color: #fff2f2;
}

.drag-item-icon {
    font-size: 3rem;
}

.drop-zones {
    display: flex;
    justify-content: space-around;
    gap: 30px;
}

.drop-target {
    flex: 1;
    background: #f1f2f6;
    border: 5px dashed #cbd5e0;
    border-radius: 25px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #718096;
    transition: all 0.2s ease;
    min-height: 180px;
    justify-content: center;
}

.drop-target-icon {
    font-size: 4.5rem;
    transition: transform 0.2s;
}

.drop-target.hover {
    background: #e2e8f0;
    border-color: #4a5568;
    transform: scale(1.03);
}

.drop-target.hover .drop-target-icon {
    transform: scale(1.18);
}

.folder-target {
    border-color: #ffd32a;
    color: #b38f00;
}

.folder-target.hover {
    background: #fff9db;
}

.trash-target {
    border-color: #ff3f34;
    color: #bf170d;
}

.trash-target.hover {
    background: #ffe3e3;
}

.counter {
    background: var(--color-white);
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 1.15rem;
    border: 3px solid;
}

/* NIVEL 2: Burbujas flotantes (Aumentadas) */
.bubble-game-area {
    position: relative;
    width: 100%;
    height: 420px;
    background: linear-gradient(180deg, #dff9fb 0%, #c7ecee 100%);
    border-radius: 25px;
    border: 5px solid #95afc0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.95) 0%, rgba(116,185,255,0.4) 70%, rgba(9,132,227,0.6) 100%);
    box-shadow: inset -6px -6px 18px rgba(0,0,0,0.1), 0 6px 12px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.8rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s ease;
}

.bubble:active {
    transform: scale(0.9);
}

.bubble-pop-effect {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(116, 185, 255, 0.85);
    animation: popAnim 0.3s forwards ease-out;
}

@keyframes popAnim {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* NIVEL 3: Ventanas Mágicas */
.program-dock {
    display: flex;
    justify-content: center;
    gap: 20px;
    background: #e2e8f0;
    padding: 15px;
    border-radius: 25px;
    margin-bottom: 30px;
}

.dock-app {
    font-family: var(--font-main);
    font-size: 1.35rem;
    font-weight: 700;
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    background-color: var(--color-white);
    color: var(--color-text);
    box-shadow: 0 5px 0px #94a3b8;
    transition: all 0.1s ease;
}

.dock-app:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0px #94a3b8;
}

.desktop-area {
    position: relative;
    width: 100%;
    height: 480px;
    background-color: #2e86de;
    background-image: radial-gradient(rgba(255,255,255,0.15) 15%, transparent 20%), radial-gradient(rgba(255,255,255,0.15) 15%, transparent 20%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    border-radius: 25px;
    border: 5px solid #10ac84;
    overflow: hidden;
}

/* Ventanas */
.window-app {
    position: absolute;
    width: 380px;
    background: var(--color-white);
    border-radius: 16px;
    border: 5px solid #2c3e50;
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
    overflow: hidden;
    display: none;
    flex-direction: column;
    transition: all 0.3s ease;
}

.window-app.active {
    display: flex;
}

.window-app.maximized {
    top: 5px !important;
    left: 5px !important;
    width: calc(100% - 10px) !important;
    height: calc(100% - 10px) !important;
}

.window-title-bar {
    background: #2c3e50;
    color: var(--color-white);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.window-title-bar .title {
    font-size: 1.15rem;
    font-weight: 700;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.win-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
    transition: background 0.1s;
}

.win-btn:hover {
    background: rgba(255,255,255,0.4);
}

.win-btn.close:hover {
    background: #ff4757;
}

.window-body {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.win-desc {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #4b6584;
}

/* Paint Window */
#paint-canvas {
    width: 100%;
    height: 220px;
    background: var(--color-white);
    border: 3px solid #cbd5e0;
    border-radius: 12px;
    cursor: crosshair;
}

.canvas-controls {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-controls button {
    font-family: var(--font-main);
    padding: 8px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    border: 3px solid #2c3e50;
    cursor: pointer;
    background: var(--color-white);
}

.colors {
    display: flex;
    gap: 8px;
}

.color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #cbd5e0;
    cursor: pointer;
    transition: transform 0.1s;
}

.color-dot.active {
    transform: scale(1.25);
    border-color: #2c3e50;
}

/* Piano Window */
.piano-keys {
    display: flex;
    height: 180px;
    border: 3px solid #2c3e50;
    border-radius: 12px;
    overflow: hidden;
}

.piano-key {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--color-white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    cursor: pointer;
    border-right: 1px solid rgba(0,0,0,0.15);
    transition: transform 0.05s, brightness 0.1s;
    user-select: none;
}

.piano-key:last-child {
    border-right: none;
}

.piano-key:active {
    transform: scaleY(0.96);
    filter: brightness(0.85);
}

/* Animal/Cat Window */
.animal-body {
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.pet-character {
    font-size: 5.5rem;
    transition: transform 0.2s ease;
    user-select: none;
}

.pet-actions {
    display: flex;
    gap: 10px;
}

.pet-actions button {
    font-family: var(--font-main);
    padding: 8px 16px;
    font-size: 1.1rem;
    border-radius: 10px;
    border: 3px solid #2c3e50;
    background: #e2e8f0;
    cursor: pointer;
    font-weight: 700;
}

.pet-actions button:active {
    transform: translateY(3px);
}

.pet-status {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff6b81;
}

/* Botón Final */
.level-3-finish-container {
    display: none;
    justify-content: center;
    margin-top: 25px;
}

.finish-btn {
    font-family: var(--font-main);
    font-size: 1.6rem;
    font-weight: 700;
    padding: 15px 35px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    background-color: var(--color-green);
    color: var(--color-white);
    box-shadow: 0 6px 0px #1e924d;
    transition: all 0.1s ease;
}

.finish-btn:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0px #1e924d;
}

/* --- PANTALLA VICTORIA / DIPLOMA --- */
#game-win-screen {
    border-color: #ffa502;
    background: linear-gradient(135deg, #fffcf0 0%, #fff7d6 100%);
}

.diploma {
    background: var(--color-white);
    padding: 25px;
    border-radius: 25px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 700px;
}

.diploma-border {
    border: 8px double #ffa502;
    border-radius: 20px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
    gap: 20px;
}

.diploma-ribbon {
    font-size: 5rem;
    color: #ffa502;
    position: absolute;
    top: -30px;
    right: 35px;
    filter: drop-shadow(0 5px 6px rgba(0,0,0,0.1));
}

.diploma h2 {
    font-size: 2.6rem;
    color: #b38f00;
    margin-top: 15px;
}

.diploma p {
    font-size: 1.35rem;
    color: #4b6584;
    line-height: 1.5;
}

.diploma-name {
    font-size: 2.6rem;
    font-weight: 700;
    color: #ff4757;
    margin: 15px 0;
    text-shadow: 1px 1px 0px #ced6e0;
}

.diploma-footer {
    margin-top: 25px;
    font-style: italic;
    font-weight: 700;
    color: #747d8c;
    font-size: 1.2rem;
}
