/* --------------------------------------------------
   SISTEMA DE DISEÑO - MELOCOTÓN & OLIVIA INFORMATICA
   -------------------------------------------------- */

:root {
    --font-primary: 'Fredoka', 'Quicksand', system-ui, -apple-system, sans-serif;
    
    /* Harmonious Child-Friendly Colors (Soft & Vibrant) */
    --bg-app: #e0f2fe; /* Light sky blue */
    --text-main: #1e293b;
    --text-light: #475569;
    --border-color: #cbd5e1;
    
    /* Activity themes */
    --color-pink: #ec4899;
    --color-pink-dark: #be185d;
    --color-orange: #f97316;
    --color-orange-dark: #c2410c;
    --color-yellow: #eab308;
    --color-yellow-dark: #a16207;
    --color-green: #22c55e;
    --color-green-dark: #15803d;
    --color-blue: #3b82f6;
    --color-blue-dark: #1d4ed8;
    --color-purple: #a855f7;
    --color-purple-dark: #7e22ce;
    
    /* Glassmorphism settings */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 12px 32px rgba(31, 38, 135, 0.08);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    font-family: var(--font-primary);
    background: radial-gradient(circle at top, #f0f9ff 0%, #e0f2fe 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

#app-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Floating background bubbles */
.bubble-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.bubble-bg::before, .bubble-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: float-bubbles 12s infinite alternate ease-in-out;
}
.bubble-bg::before {
    width: 250px;
    height: 250px;
    left: 5%;
    top: 10%;
}
.bubble-bg::after {
    width: 350px;
    height: 350px;
    right: -5%;
    bottom: 10%;
    animation-delay: -4s;
    background: rgba(147, 197, 253, 0.25);
}

/* Header Styles */
.app-header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 4px solid #bae6fd;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.header-logo {
    display: flex;
    align-items: center;
}
.logo-img {
    height: 48px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.logo-img:hover {
    transform: scale(1.1) rotate(-3deg);
}

.header-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0369a1;
    text-shadow: 1px 1px 0px #fff;
    text-align: center;
}

.header-controls {
    display: flex;
    gap: 15px;
}

/* Circles Buttons (Sound, Megaphone) */
.btn-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
    transition: all 0.1s ease;
    outline: none;
}
.btn-circle:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
#btn-sound-toggle.sound-on {
    background: var(--color-green);
    box-shadow: 0 4px 0 var(--color-green-dark), 0 6px 10px rgba(0,0,0,0.1);
}
#btn-sound-toggle.sound-off {
    background: #94a3b8;
    box-shadow: 0 4px 0 #64748b, 0 6px 10px rgba(0,0,0,0.1);
}
.btn-voice {
    background: var(--color-blue);
    box-shadow: 0 4px 0 var(--color-blue-dark), 0 6px 10px rgba(0,0,0,0.1);
}

/* Main content views */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 30px;
    position: relative;
    z-index: 5;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.view {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    width: 100%;
}
.view.active {
    display: block;
    opacity: 1;
}

/* LOBBY / WELCOME STAGE */
.welcome-container {
    background: var(--glass-bg);
    border: 3px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 32px;
    padding: 25px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    position: relative;
    backdrop-filter: blur(8px);
}

.characters-greeting {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    min-width: 250px;
}
.char-wrapper {
    position: relative;
}
.melocoton-svg {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.1));
}
.olivia-svg {
    width: 150px;
    height: 94px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.1));
}

/* Speech Bubble */
.speech-bubble {
    background: #fff;
    border: 3px solid #0284c7;
    border-radius: 24px;
    padding: 20px 25px;
    position: relative;
    max-width: 600px;
    box-shadow: 0 8px 0 rgba(2, 132, 199, 0.15);
}
.speech-bubble p {
    font-size: 1.35rem;
    line-height: 1.5;
    color: var(--text-main);
}
.speech-bubble::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 20px solid #0284c7;
}
.speech-bubble::after {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 18px solid #fff;
}

/* Games Catalog Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.game-card {
    background: #fff;
    border: 4px solid var(--border-color);
    border-radius: 28px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 8px 0 var(--border-color), 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 330px;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 0 var(--border-color), 0 20px 30px rgba(0,0,0,0.08);
}

.game-card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2);
}

.card-color-1 { background: var(--color-pink); }
.card-color-2 { background: var(--color-orange); }
.card-color-3 { background: var(--color-yellow); }
.card-color-4 { background: var(--color-purple); }

.game-card h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.game-card p {
    font-size: 1.05rem;
    color: var(--text-light);
    flex-grow: 1;
    line-height: 1.4;
}

/* Kids Style 3D Buttons */
.btn-play {
    margin-top: 15px;
    width: 100%;
    background: var(--color-blue);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 18px;
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--color-blue-dark);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.game-card:hover .btn-play {
    background: #2563eb;
}
.btn-play:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--color-blue-dark);
}

.btn-3d {
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 0 rgba(0,0,0,0.2);
}
.btn-3d:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

.btn-back {
    background: #64748b;
    box-shadow: 0 5px 0 #475569;
}
.btn-green {
    background: var(--color-green);
    box-shadow: 0 5px 0 var(--color-green-dark);
}
.btn-blue {
    background: var(--color-blue);
    box-shadow: 0 5px 0 var(--color-blue-dark);
}
.btn-yellow {
    background: var(--color-yellow);
    box-shadow: 0 5px 0 var(--color-yellow-dark);
}

/* GAME VIEWS GLOBAL STUFF */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}
.game-header h2 {
    font-size: 1.8rem;
    color: #0369a1;
    text-shadow: 1px 1px 0px #fff;
}
.game-score {
    background: #fff;
    border: 3px solid #0ea5e9;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0369a1;
    box-shadow: 0 4px 0 rgba(14, 165, 233, 0.15);
}

/* ACTIVIDAD 1: ALIMENTA A OLIVIA WORKSPACE */
.game1-workspace, .game2-workspace, .game3-workspace, .game4-workspace {
    background: var(--glass-bg);
    border: 4px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 32px;
    padding: 30px;
    backdrop-filter: blur(8px);
}

.game1-instruction, .game2-instruction, .game3-instruction {
    background: rgba(255,255,255,0.9);
    border: 2px solid #bae6fd;
    border-radius: 20px;
    padding: 12px 25px;
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 25px;
    text-align: center;
}

.game1-stage {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 40px;
    min-height: 380px;
}

/* Left panel: food list */
.food-container {
    background: rgba(255, 255, 255, 0.8);
    border: 3px dashed #93c5fd;
    border-radius: 24px;
    padding: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 320px;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
}

.draggable-food {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: #fff;
    border: 3px solid #cbd5e1;
    box-shadow: 0 4px 0 #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    gap: 4px;
}
.draggable-food:hover {
    transform: scale(1.08) rotate(3deg);
    border-color: var(--color-blue);
    box-shadow: 0 6px 0 var(--color-blue-dark);
}
.draggable-food:active {
    cursor: grabbing;
}
.draggable-food i {
    font-size: 2.1rem;
}
.draggable-food span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
}

/* Food Icons Specific Colors */
#food-bone i { color: #f1f5f9; text-shadow: 1px 1px 0 #94a3b8; }
#food-cookie i { color: #d97706; }
#food-steak i { color: #dc2626; }
#food-ball i { color: #eab308; }
#food-cheese i { color: #fbbf24; }

/* Right panel: Olivia Target */
.olivia-feeding-zone {
    width: 360px;
    height: 300px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.8);
    border: 4px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px rgba(0,0,0,0.02);
}
.olivia-feeding-zone.dragover {
    border-color: var(--color-green);
    background: #f0fdf4;
    transform: scale(1.03);
}

.olivia-svg-game {
    width: 250px;
    height: 156px;
    transition: transform 0.2s ease;
}

.target-indicator {
    position: absolute;
    top: 15px;
    background: var(--color-orange);
    color: #fff;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 3px 0 var(--color-orange-dark);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}
.olivia-feeding-zone.dragover .target-indicator {
    opacity: 1;
    transform: translateY(0);
}

.olivia-status-text {
    margin-top: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-orange-dark);
    background: #ffedd5;
    padding: 5px 15px;
    border-radius: 15px;
}

/* ACTIVIDAD 2: HARDWARE AL RESCATE WORKSPACE */
.game2-stage {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 40px;
    min-height: 420px;
}

.hardware-parts-container {
    background: rgba(255, 255, 255, 0.85);
    border: 3px dashed #93c5fd;
    border-radius: 28px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 240px;
}

.draggable-hardware {
    padding: 12px 20px;
    background: #fff;
    border: 3px solid #cbd5e1;
    border-radius: 20px;
    box-shadow: 0 4px 0 #94a3b8;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: grab;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.draggable-hardware:hover {
    transform: translateX(5px) scale(1.03);
    border-color: var(--color-orange);
    box-shadow: 0 5px 0 var(--color-orange-dark);
}
.draggable-hardware i {
    font-size: 1.8rem;
    color: var(--color-orange);
}
.draggable-hardware span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Assembly target grid */
.computer-silhouette-stage {
    flex-grow: 1;
    max-width: 550px;
    background: rgba(255, 255, 255, 0.7);
    border: 4px solid #bae6fd;
    border-radius: 32px;
    padding: 20px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.03);
}

.silhouette-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: #0369a1;
    margin-bottom: 20px;
}

.computer-assembly-zone {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 200px 70px;
    gap: 15px;
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}

/* Dropzones */
.hardware-dropzone {
    border: 3px dashed #bae6fd;
    border-radius: 20px;
    background: rgba(224, 242, 254, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: default;
    position: relative;
}
.hardware-dropzone.dragover {
    background: #e0f2fe;
    border-color: var(--color-blue);
    transform: scale(1.02);
}

.zone-outline {
    font-size: 2.2rem;
    color: #93c5fd;
    opacity: 0.65;
}
.zone-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0284c7;
    margin-top: 5px;
    text-transform: uppercase;
}

/* Assembly Grid Layout Details */
.monitor-target {
    grid-column: 1;
    grid-row: 1;
}
.cpu-target {
    grid-column: 2;
    grid-row: 1 / 3; /* CPU is tall */
}
.keyboard-target {
    grid-column: 1;
    grid-row: 2;
}
.mouse-target {
    grid-column: 1; /* Actually placed next to keyboard in grid, let's place it overlayed or handle locally */
    grid-row: 2;
    width: 60px;
    height: 60px;
    justify-self: end;
    margin-right: 10px;
    align-self: center;
    z-index: 2;
}

/* Dropped success state */
.hardware-dropzone.completed {
    background: #f0fdf4;
    border: 3px solid var(--color-green);
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.15);
}
.hardware-dropzone.completed .zone-outline {
    color: var(--color-green);
    opacity: 1;
}
.hardware-dropzone.completed .zone-label {
    color: var(--color-green-dark);
}

/* ACTIVIDAD 3: TECLADO MÁGICO WORKSPACE */
.game3-stage {
    height: 380px;
    position: relative;
    border: 3px dashed #bae6fd;
    border-radius: 28px;
    background: radial-gradient(circle, #ffffff 0%, #f0f9ff 100%);
    overflow: hidden;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.02);
}

/* Flying Balloon Element */
.balloon {
    position: absolute;
    width: 80px;
    height: 100px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.3rem;
    font-weight: 700;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.15);
    box-shadow: inset -8px -8px 0 rgba(0, 0, 0, 0.08), 0 10px 15px rgba(0, 0, 0, 0.06);
    animation: sway 3s infinite ease-in-out;
    bottom: -120px;
    transition: transform 0.1s ease;
}

/* Balloon knot & string */
.balloon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 36px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid inherit; /* JS dynamically sets border color */
}
.balloon-string {
    position: absolute;
    bottom: -35px;
    left: 40px;
    width: 2px;
    height: 30px;
    background: rgba(0,0,0,0.15);
}

/* Balloon pop animation */
.balloon.popped {
    animation: balloon-pop 0.25s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Melocoton Helper */
.melocoton-helper-g3 {
    position: absolute;
    bottom: 10px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    pointer-events: none;
    z-index: 5;
}
.melocoton-svg-helper {
    width: 75px;
    height: 75px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.helper-bubble {
    background: #fff;
    border: 2px solid var(--color-purple);
    border-radius: 16px;
    padding: 8px 15px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-purple-dark);
    box-shadow: 0 4px 0 rgba(168, 85, 247, 0.1);
}

/* ACTIVIDAD 4: PINTOR DE PIXELES WORKSPACE */
.game4-layout {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

.game4-left-panel {
    width: 250px;
    background: rgba(255,255,255,0.8);
    border: 3px solid #bae6fd;
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.game4-left-panel h3 {
    font-size: 1.15rem;
    color: #0369a1;
    margin-bottom: 12px;
    font-weight: 700;
}

.palette-colors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.color-swatch {
    height: 52px;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0,0,0,0.12);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
}
.color-swatch:hover {
    transform: scale(1.08);
}
.color-swatch.active {
    transform: scale(1.06) translateY(2px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.12);
    border-color: #0369a1;
}

.template-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn-template {
    padding: 10px 15px;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    background: #fff;
    border: 2px solid var(--border-color);
    color: var(--text-light);
    text-align: left;
    transition: all 0.2s ease;
}
.btn-template:hover {
    background: #f8fafc;
    border-color: var(--color-blue);
    color: var(--color-blue-dark);
}
.btn-template.active {
    background: #eff6ff;
    border-color: var(--color-blue);
    color: var(--color-blue-dark);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.game4-canvas-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border: 4px solid #bae6fd;
    border-radius: 28px;
    padding: 20px;
    min-height: 400px;
}

.pixel-canvas {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: 2px;
    width: 380px;
    height: 380px;
    background: #f1f5f9;
    border: 4px solid #cbd5e1;
    border-radius: 12px;
    padding: 2px;
}

.pixel {
    background-color: #ffffff;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.1s ease;
}
.pixel:hover {
    filter: brightness(0.95);
    border: 1px solid #94a3b8;
}

.game4-controls-top {
    display: flex;
    gap: 10px;
}

/* CELEBRATION MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.victory-box {
    background: #fff;
    border: 6px solid #eab308;
    border-radius: 40px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .victory-box {
    transform: scale(1);
}

.victory-box h2 {
    font-size: 2.2rem;
    color: var(--color-orange-dark);
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px rgba(254, 240, 138, 0.5);
}

.victory-box p {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.victory-characters {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 25px;
    margin-bottom: 35px;
}
.char-victory {
    width: 120px;
}
.melocoton-svg-victory {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.1));
}
.olivia-svg-victory {
    width: 130px;
    height: 82px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.1));
}

.victory-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* --------------------------------------------------
   ANIMATIONS & KEYFRAMES
   -------------------------------------------------- */

/* Floppy character floating */
.float-animation {
    animation: float 4s infinite ease-in-out;
}
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* Olivia bounce greet */
.bounce-animation {
    animation: soft-bounce 3.5s infinite ease-in-out;
}
@keyframes soft-bounce {
    0% { transform: translateY(0) scaleY(1); }
    40% { transform: translateY(-5px) scaleY(1.02); }
    50% { transform: translateY(0) scaleY(0.98); }
    60% { transform: translateY(-2px) scaleY(1.01); }
    100% { transform: translateY(0) scaleY(1); }
}

/* Olivia Tail Wagging */
.wag-tail {
    transform-origin: 22px 50px;
    animation: tail-wag 0.4s infinite alternate ease-in-out;
}
@keyframes tail-wag {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(15deg); }
}
.wag-tail-fast {
    transform-origin: 22px 50px;
    animation: tail-wag 0.15s infinite alternate ease-in-out;
}

/* Olivia Ears Flop */
.floppy-ear {
    transform-origin: 115px 22px;
    animation: ear-flop 3s infinite alternate ease-in-out;
}
@keyframes ear-flop {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(-4deg); }
    100% { transform: rotate(3deg); }
}

/* Background bubble float */
@keyframes float-bubbles {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-30px) scale(1.08); }
}

/* Balloon Swaying */
@keyframes sway {
    0% { transform: translateX(0) rotate(0deg); }
    33% { transform: translateX(8px) rotate(4deg); }
    66% { transform: translateX(-8px) rotate(-4deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

/* Balloon Pop */
@keyframes balloon-pop {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

/* Victory characters jumping */
.melocoton-jump {
    animation: jump-joy 0.6s infinite alternate cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.olivia-jump {
    animation: jump-joy 0.6s infinite alternate-reverse cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation-delay: 0.15s;
}
@keyframes jump-joy {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-20px) scale(0.95, 1.05); }
}

/* --------------------------------------------------
   RESPONSIVE DESIGN FOR SCHOOL MONITORS / TABLETS
   -------------------------------------------------- */

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    .header-title h1 {
        font-size: 1.4rem;
    }
    .welcome-container {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
        text-align: center;
    }
    .speech-bubble::before, .speech-bubble::after {
        display: none; /* remove pointer arrow on mobile */
    }
    .game1-stage, .game2-stage {
        flex-direction: column;
        gap: 20px;
    }
    .game4-layout {
        flex-direction: column;
        align-items: center;
    }
    .game4-left-panel {
        width: 100%;
        margin-bottom: 20px;
    }
    .pixel-canvas {
        width: 320px;
        height: 320px;
    }
}
