/* ========================================
   ESTILOS GENERALES Y RESET
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   ENCABEZADO
   ======================================== */
.header {
    background: linear-gradient(45deg, #FF6B6B, #FFE66D, #4ECDC4, #95E1D3);
    background-size: 400% 400%;
    animation: gradientBG 10s ease infinite;
    padding: 40px 20px;
    text-align: center;
    color: white;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.5em;
    opacity: 0.95;
}

/* ========================================
   SECCIONES GENERALES
   ======================================== */
section {
    padding: 40px 20px;
    margin: 20px auto;
    max-width: 1000px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

section h2 {
    text-align: center;
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
}

.instruction {
    text-align: center;
    font-size: 1.3em;
    color: #666;
    margin-bottom: 30px;
}

/* ========================================
   SECCIÓN DE INTRODUCCIÓN
   ======================================== */
.intro-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.intro-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 280px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.intro-card.large {
    width: 450px;
    text-align: left;
}

.intro-card:hover {
    transform: translateY(-10px) scale(1.05);
}

.intro-card.large:hover {
    transform: translateY(-5px) scale(1.02);
}

.intro-icon {
    font-size: 4em;
    margin-bottom: 15px;
    text-align: center;
}

.intro-card h2 {
    font-size: 1.5em;
    color: #764ba2;
    margin-bottom: 10px;
    text-align: center;
}

.intro-card p {
    font-size: 1.1em;
    color: #555;
    line-height: 1.6;
}

.intro-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.intro-list li {
    font-size: 1.1em;
    color: #555;
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
}

.intro-list li:last-child {
    border-bottom: none;
}

.analogy-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-top: 15px;
    text-align: center;
    font-size: 1.05em;
    line-height: 1.5;
}

/* ========================================
   SECCIÓN DE USOS DIVERTIDOS
   ======================================== */
.uses-fun-section {
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 100%);
}

.uses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.use-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 5px solid transparent;
}

.use-card.fun {
    border-left-color: #4CAF50;
}

.use-card.fun:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: 0 20px 40px rgba(76, 175, 80, 0.2);
}

.use-card.boring {
    border-left-color: #2196F3;
}

.use-card.boring:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(33, 150, 243, 0.2);
}

.use-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
}

.use-card h3 {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 10px;
}

.use-card p {
    font-size: 1.1em;
    color: #666;
    line-height: 1.5;
}

.example-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 15px;
    border-radius: 15px;
    margin-top: 15px;
    text-align: left;
    font-size: 1em;
    color: #1565c0;
    border: 2px dashed #64b5f6;
}

.example-box strong {
    color: #0d47a1;
}

/* ========================================
   SECCIÓN DE USOS "ABURRIDOS"
   ======================================== */
.uses-boring-section {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

.boring-intro {
    background: white;
    padding: 25px 40px;
    border-radius: 20px;
    max-width: 800px;
    margin: 0 auto 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.boring-intro p {
    font-size: 1.3em;
    color: #555;
    line-height: 1.6;
}

.boring-conclusion {
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    max-width: 800px;
    margin: 30px auto 0;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.boring-conclusion h3 {
    font-size: 1.6em;
    color: #764ba2;
    margin-bottom: 15px;
}

.boring-conclusion p {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.6;
}

.boring-conclusion .highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    margin-top: 20px;
    font-size: 1.3em;
}

/* ========================================
   SECCIÓN DEL DÍA A DÍA
   ======================================== */
.day-section {
    background: linear-gradient(135deg, #d4a5ff 0%, #c2b0f5 100%);
}

.timeline {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding-left: 50px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 6px;
    background: white;
    border-radius: 3px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    position: relative;
}

.time-icon {
    position: absolute;
    left: -50px;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1;
}

.time-content {
    background: white;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    flex: 1;
    margin-left: 20px;
}

.time-content h4 {
    font-size: 1.3em;
    color: #764ba2;
    margin-bottom: 8px;
}

.time-content p {
    font-size: 1.1em;
    color: #666;
    line-height: 1.5;
}

.timeline-item:hover .time-content {
    transform: translateX(10px);
    transition: transform 0.3s ease;
}

.timeline-item:hover .time-icon {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

/* ========================================
   SECCIÓN DE INTELIGENCIA ARTIFICIAL
   ======================================== */
.ai-section {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ai-intro {
    background: white;
    padding: 30px 40px;
    border-radius: 25px;
    max-width: 800px;
    margin: 0 auto 30px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.ai-robot {
    font-size: 5em;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.ai-intro p {
    font-size: 1.3em;
    color: #333;
    line-height: 1.6;
    flex: 1;
    min-width: 300px;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.ai-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-top: 5px solid #4facfe;
}

.ai-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(79, 172, 254, 0.3);
}

.ai-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.ai-card h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 10px;
}

.ai-card p {
    font-size: 1.05em;
    color: #666;
    line-height: 1.5;
}

.ai-fun-fact {
    background: white;
    padding: 30px 40px;
    border-radius: 25px;
    max-width: 700px;
    margin: 30px auto 0;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border: 3px dashed #4facfe;
}

.ai-fun-fact h3 {
    font-size: 1.5em;
    color: #4facfe;
    margin-bottom: 15px;
}

.ai-fun-fact p {
    font-size: 1.2em;
    color: #333;
    line-height: 1.6;
}

/* ========================================
   SECCIÓN INTRO INTERACTIVA
   ======================================== */
.interactive-intro {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    text-align: center;
}

.interactive-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.interactive-text {
    background: white;
    padding: 30px 40px;
    border-radius: 25px;
    max-width: 500px;
    text-align: left;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.interactive-text p {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 15px;
}

.interactive-text ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.interactive-text li {
    font-size: 1.1em;
    color: #555;
    padding: 8px 0;
}

.interactive-text .highlight-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.3em;
}

.interactive-emoji {
    display: flex;
    gap: 15px;
}

.big-emoji {
    font-size: 4em;
}

.big-emoji.bounce {
    animation: bounce 2s ease infinite;
}

.big-emoji.delay1 {
    animation-delay: 0.3s;
}

.big-emoji.delay2 {
    animation-delay: 0.6s;
}

.ready-text {
    font-size: 2em;
    color: white;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
    font-weight: bold;
}

/* ========================================
   ESTILOS GENERALES PARA BADGES DE SECCIÓN
   ======================================== */
.section-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.section-badge.final-badge {
    background: linear-gradient(135deg, #FFE66D 0%, #FF6B6B 100%);
    font-size: 1.2em;
    animation: pulse 2s ease infinite;
}

.pacman-connection {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.pacman-connection p {
    margin: 0;
    font-size: 1.1em;
}

.pacman-connection.colors-conn {
    max-width: 600px;
}

/* ========================================
   SECCIÓN DEL ROBOT - LAYOUT HORIZONTAL
   ======================================== */
.robot-section {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.robot-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}

.robot-controls-panel {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    min-width: 280px;
}

.robot-explanation {
    background: rgba(118, 75, 162, 0.1);
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.robot-explanation p {
    font-size: 1em;
    color: #555;
    margin: 5px 0;
}

.robot-playground {
    display: flex;
    justify-content: center;
}

.grid-container {
    width: 350px;
    height: 350px;
    background: linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
                linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
                linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 50px 50px;
    background-position: 0 0, 0 25px, 25px -25px, -25px 0px;
    background-color: #f0f0f0;
    border-radius: 20px;
    position: relative;
    border: 5px solid #764ba2;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.1);
}

.robot {
    position: absolute;
    font-size: 2.5em;
    transition: all 0.3s ease;
    left: 25px;
    top: 25px;
    filter: drop-shadow(3px 3px 5px rgba(0,0,0,0.3));
}

.goal {
    position: absolute;
    font-size: 2.5em;
    right: 25px;
    bottom: 25px;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-row {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 18px;
    font-size: 1.5em;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 60px;
    height: 60px;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.control-btn:active {
    transform: scale(0.95);
}

.dance-btn {
    background: linear-gradient(145deg, #FF6B6B, #FFE66D);
}

.reset-btn {
    background: linear-gradient(145deg, #4ECDC4, #95E1D3);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1em;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 10px;
    font-family: inherit;
    transition: all 0.3s ease;
    width: 100%;
}

.reset-btn:hover {
    transform: scale(1.05);
}

.message {
    text-align: center;
    font-size: 1.2em;
    margin-top: 15px;
    min-height: 30px;
    color: #764ba2;
    font-weight: bold;
}

/* ========================================
   SECCIÓN DE COLORES - BOLITAS
   ======================================== */
.colors-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.colors-section h2,
.colors-section .instruction {
    color: #FFE66D;
}

.shapes-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 20px;
}

.shape {
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape:hover {
    transform: scale(1.2);
}

.pacman-dot-demo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #FFE66D;
    box-shadow: 0 0 20px #FFE66D, 0 0 40px rgba(255, 230, 109, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}

.pacman-dot-demo.star-shape {
    background: transparent;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.pacman-dot-demo.heart-shape {
    background: transparent;
    box-shadow: 0 0 20px rgba(255, 100, 100, 0.5);
}

.pacman-dot-demo.circle-shape {
    background: #FFE66D;
}

.pacman-dot-demo:hover {
    transform: scale(1.2);
    box-shadow: 0 0 30px #FFE66D, 0 0 60px rgba(255, 230, 109, 0.7);
}

.pacman-dot-demo.eating {
    animation: eatDot 0.3s ease forwards;
}

@keyframes eatDot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

.colors-section .shape-message {
    color: #FFE66D;
}

.circle {
    border-radius: 50%;
    background: #FF6B6B;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
}

.square {
    border-radius: 15px;
    background: #4ECDC4;
    box-shadow: 0 10px 30px rgba(78, 205, 196, 0.4);
}

.triangle {
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid #FFE66D;
    background: transparent;
    filter: drop-shadow(0 10px 15px rgba(255, 230, 109, 0.4));
}

.star {
    font-size: 5em;
    color: #95E1D3;
    background: none;
    text-shadow: 0 10px 20px rgba(149, 225, 211, 0.4);
}

.heart {
    font-size: 5em;
    background: none;
    text-shadow: 0 10px 20px rgba(255, 100, 100, 0.4);
}

.shape-message {
    text-align: center;
    font-size: 1.4em;
    color: #333;
    min-height: 30px;
    font-weight: bold;
}

/* ========================================
   SECCIÓN DEL CONTADOR
   ======================================== */
.counter-section {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

.counter-display {
    text-align: center;
    margin: 30px 0;
}

.counter-display span {
    font-size: 8em;
    color: #333;
    background: white;
    padding: 20px 60px;
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    display: inline-block;
}

.counter-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.counter-btn {
    padding: 20px 40px;
    font-size: 1.4em;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    color: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.counter-btn.plus {
    background: linear-gradient(145deg, #4CAF50, #8BC34A);
}

.counter-btn.minus {
    background: linear-gradient(145deg, #f44336, #E91E63);
}

.counter-btn.reset {
    background: linear-gradient(145deg, #2196F3, #03A9F4);
}

.counter-btn:hover {
    transform: scale(1.1);
}

.fun-facts {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.fun-facts p {
    font-size: 1.2em;
    color: #555;
}

/* ========================================
   SECCIÓN DE ANIMALES
   ======================================== */
.animals-section {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
}

.animals-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.animal-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-width: 120px;
}

.animal-card:hover {
    transform: translateY(-10px) scale(1.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.animal-emoji {
    font-size: 4em;
    display: block;
    margin-bottom: 10px;
}

.animal-name {
    font-size: 1.2em;
    color: #333;
    font-weight: bold;
}

.speech-bubble {
    background: white;
    padding: 20px 40px;
    border-radius: 30px;
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    animation: popIn 0.3s ease;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    border: 15px solid transparent;
    border-bottom-color: white;
}

@keyframes popIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.speech-bubble span {
    font-size: 2em;
    font-weight: bold;
    color: #764ba2;
}

.hidden {
    display: none;
}

/* ========================================
   SECCIÓN DE PATRONES
   ======================================== */
.pattern-section {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.pattern-display {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pattern-show {
    font-size: 1.5em;
    color: #333;
}

.pattern-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pattern-btn {
    width: 100px;
    height: 100px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.pattern-btn:hover {
    transform: scale(1.1);
}

.pattern-btn:active {
    transform: scale(0.9);
}

.pattern-btn.red {
    background: linear-gradient(145deg, #ff6b6b, #ee5a5a);
}

.pattern-btn.blue {
    background: linear-gradient(145deg, #4e9af1, #3d7dc9);
}

.pattern-btn.green {
    background: linear-gradient(145deg, #51cf66, #40c057);
}

.pattern-btn.yellow {
    background: linear-gradient(145deg, #ffd43b, #fab005);
}

.pattern-btn.flash {
    animation: flash 0.6s ease;
}

@keyframes flash {
    0% { opacity: 1; transform: scale(1); box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
    50% { opacity: 1; transform: scale(1.3); box-shadow: 0 0 50px rgba(255,255,255,0.9), 0 0 80px currentColor; filter: brightness(2); }
    100% { opacity: 1; transform: scale(1); box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
}

.new-game-btn {
    display: block;
    margin: 20px auto;
    padding: 20px 40px;
    font-size: 1.4em;
    background: white;
    color: #764ba2;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.new-game-btn:hover {
    transform: scale(1.05);
    background: #764ba2;
    color: white;
}

.pattern-message {
    text-align: center;
    font-size: 1.5em;
    color: white;
    min-height: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.pattern-score {
    text-align: center;
    font-size: 1.3em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* ========================================
   SECCIÓN DE DIBUJO
   ======================================== */
.drawing-section {
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}

.color-picker {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.color-option {
    width: 50px;
    height: 50px;
    border: 4px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.color-option:hover {
    transform: scale(1.2);
}

.color-option.selected {
    border-color: #333;
    transform: scale(1.2);
}

#drawingCanvas {
    display: block;
    margin: 0 auto 20px;
    background: white;
    border-radius: 20px;
    cursor: crosshair;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    max-width: 100%;
}

.clear-btn {
    display: block;
    margin: 0 auto;
    padding: 15px 40px;
    font-size: 1.3em;
    background: white;
    color: #f44336;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.clear-btn:hover {
    background: #f44336;
    color: white;
    transform: scale(1.05);
}

/* ========================================
   SECCIÓN PAC-MAN - LAYOUT HORIZONTAL
   ======================================== */
.pacman-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    text-align: center;
}

.pacman-section h2 {
    color: #FFE66D;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
}

.pacman-section .instruction {
    color: #fff;
    opacity: 0.9;
}

.learned-recap {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.learned-recap span {
    background: rgba(255,255,255,0.1);
    color: #4CAF50;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1em;
    font-weight: bold;
}

.pacman-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.pacman-game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pacman-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.pacman-score, .pacman-lives {
    background: rgba(255,255,255,0.1);
    padding: 12px 25px;
    border-radius: 12px;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
}

.pacman-score span:last-child {
    color: #FFE66D;
}

.pacman-lives span:last-child {
    color: #FF6B6B;
}

.pacman-arena {
    width: 350px;
    height: 350px;
    background: #000;
    border: 5px solid #2196F3;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(33, 150, 243, 0.5), inset 0 0 50px rgba(0,0,0,0.5);
}

.pacman-player {
    position: absolute;
    width: 35px;
    height: 35px;
    z-index: 10;
    transition: all 0.15s ease;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pacman-ghost {
    position: absolute;
    width: 35px;
    height: 35px;
    z-index: 5;
    transition: all 0.3s ease;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.emoji-character {
    background: none !important;
}

.ghost1 {
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.5));
}

.ghost2 {
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.5));
}

.pacman-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FFE66D;
    border-radius: 50%;
    box-shadow: 0 0 10px #FFE66D;
}

.pacman-dot.big {
    width: 18px;
    height: 18px;
    animation: pulse 0.8s ease infinite;
}

.pacman-message {
    background: rgba(255,255,255,0.1);
    padding: 15px 30px;
    border-radius: 12px;
    color: #FFE66D;
    font-size: 1.1em;
    font-weight: bold;
    margin: 25px auto 0;
    max-width: 600px;
    text-align: center;
}

.pacman-controls-panel {
    background: rgba(255,255,255,0.05);
    padding: 25px;
    border-radius: 20px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.pacman-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.pacman-control-row {
    display: flex;
    gap: 8px;
}

.pacman-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5em;
    background: linear-gradient(145deg, #2196F3, #1976D2);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.pacman-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.6);
}

.pacman-btn:active {
    transform: scale(0.95);
}

.pacman-btn.start-btn {
    background: linear-gradient(145deg, #4CAF50, #388E3C);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.pacman-btn.start-btn.full-width {
    width: 100%;
    height: 50px;
    font-size: 1.2em;
    margin-top: 15px;
}

.pacman-btn.start-btn:hover {
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.6);
}

.pacman-instructions {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    text-align: left;
}

.pacman-instructions h4 {
    color: #FFE66D;
    font-size: 1.1em;
    margin-bottom: 10px;
    text-align: center;
}

.pacman-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pacman-instructions li {
    color: white;
    font-size: 0.95em;
    padding: 5px 0;
}

/* Estilos adicionales para fantasmas demo */
.ghost-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.ghost-demo {
    font-size: 3em;
    animation: float 2s ease-in-out infinite;
    color: #ff6b6b;
}

.ghost-demo:nth-child(2) { animation-delay: 0.3s; }
.ghost-demo:nth-child(3) { animation-delay: 0.6s; }
.ghost-demo:nth-child(4) { animation-delay: 0.9s; }

/* Botón de puntos grandes */
.counter-btn.big-points {
    background: linear-gradient(145deg, #FFE66D, #FFA500);
    width: 100%;
}

/* Estilos para sonidos de juego */
.game-sound {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%) !important;
}

.game-sound .animal-emoji {
    filter: drop-shadow(0 0 10px currentColor);
}

/* ========================================
   SECCIÓN FINAL
   ======================================== */
.final-section {
    background: linear-gradient(135deg, #FFE66D 0%, #FF6B6B 50%, #4ECDC4 100%);
    text-align: center;
}

.final-section h2 {
    color: white;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
}

.final-message {
    background: white;
    padding: 40px;
    border-radius: 30px;
    max-width: 600px;
    margin: 0 auto 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.final-message p {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 20px;
}

.final-message ul {
    text-align: left;
    padding-left: 30px;
    margin-bottom: 20px;
}

.final-message li {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #555;
}

.big-text {
    font-size: 1.8em !important;
    color: #764ba2 !important;
    font-weight: bold;
}

.celebration-btn {
    padding: 25px 60px;
    font-size: 1.8em;
    background: linear-gradient(145deg, #764ba2, #667eea);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    animation: pulse 2s ease infinite;
}

.celebration-btn:hover {
    transform: scale(1.1);
}

#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 15px;
    height: 15px;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px;
    font-size: 1.2em;
}

.footer p {
    margin: 5px 0;
}

/* ========================================
   ANIMACIONES EXTRA
   ======================================== */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

.jump {
    animation: jump 0.5s ease;
}

@keyframes jump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

.spin {
    animation: spin 1s ease;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dance {
    animation: dance 0.5s ease infinite;
}

@keyframes dance {
    0%, 100% { transform: rotate(-10deg) scale(1.1); }
    50% { transform: rotate(10deg) scale(1.1); }
}

.animal-active {
    animation: animal-bounce 0.5s ease;
    box-shadow: 0 0 30px rgba(118, 75, 162, 0.5) !important;
}

@keyframes animal-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.pulse-once {
    animation: pulse-once 0.5s ease;
}

@keyframes pulse-once {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ========================================
   SELECTOR DE FORMA DE BOLITAS
   ======================================== */
.dot-shape-selector {
    margin-top: 30px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    text-align: center;
}

.dot-shape-selector h4 {
    color: #FFE66D;
    font-size: 1.3em;
    margin-bottom: 20px;
}

.dot-shapes-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.dot-shape-option {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 4px solid transparent;
}

.dot-shape-option:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(255, 230, 109, 0.5);
}

.dot-shape-option.selected {
    border-color: #FFE66D;
    background: #fff9e6;
    transform: scale(1.1);
}

.dot-preview {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}

.dot-preview.circle {
    background: #FFE66D;
    border-radius: 50%;
}

.selection-message {
    color: #fff;
    font-size: 1.1em;
    margin: 15px 0;
}

/* ========================================
   BOTÓN CARGAR AL JUEGO
   ======================================== */
.load-to-game-btn {
    display: inline-block;
    padding: 15px 35px;
    font-size: 1.2em;
    background: linear-gradient(45deg, #00b894, #00cec9);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4);
    margin-top: 15px;
}

.load-to-game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 184, 148, 0.5);
}

.load-to-game-btn.loaded {
    background: linear-gradient(45deg, #6c5ce7, #a29bfe);
    animation: pulse-success 0.5s ease;
}

@keyframes pulse-success {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.load-to-game-btn.big-btn {
    padding: 20px 50px;
    font-size: 1.4em;
    margin-top: 25px;
}

/* ========================================
   SECCIÓN DE DIBUJO - BOTONES
   ======================================== */
.drawing-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.drawing-buttons .clear-btn {
    margin: 0;
}

/* ========================================
   SECCIÓN DE PERSONAJES
   ======================================== */
.characters-section {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    text-align: center;
}

.characters-section h2 {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.character-selection {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}

.character-group {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 20px;
    min-width: 280px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.character-group h4 {
    color: #333;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.character-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.player-option,
.ghost1-option,
.ghost2-option {
    width: 60px;
    height: 60px;
    font-size: 2.2em;
    background: #f8f9fa;
    border: 3px solid #dee2e6;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-option:hover,
.ghost1-option:hover,
.ghost2-option:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.player-option.selected {
    border-color: #00b894;
    background: #d4edda;
    transform: scale(1.15);
}

.ghost1-option.selected {
    border-color: #e74c3c;
    background: #f8d7da;
    transform: scale(1.15);
}

.ghost2-option.selected {
    border-color: #9b59b6;
    background: #e8daef;
    transform: scale(1.15);
}

.character-group .selection-message {
    color: #333;
    font-size: 1em;
}

/* ========================================
   PERSONAJES EMOJI EN PAC-MAN
   ======================================== */
.emoji-character {
    width: 35px !important;
    height: 35px !important;
    background: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 28px !important;
    line-height: 1 !important;
}

/* ========================================
   FORMAS DE BOLITAS EN EL JUEGO
   ======================================== */
#dots-container[data-dot-shape="star"] .pacman-dot {
    background: none;
    box-shadow: none;
}

#dots-container[data-dot-shape="star"] .pacman-dot::before {
    content: '⭐';
    font-size: 16px;
}

#dots-container[data-dot-shape="heart"] .pacman-dot {
    background: none;
    box-shadow: none;
}

#dots-container[data-dot-shape="heart"] .pacman-dot::before {
    content: '❤️';
    font-size: 14px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1.2em;
    }
    
    section h2 {
        font-size: 1.8em;
    }
    
    .grid-container {
        width: 300px;
        height: 300px;
    }
    
    .counter-display span {
        font-size: 5em;
        padding: 15px 40px;
    }
    
    .pattern-btn {
        width: 70px;
        height: 70px;
    }
    
    #drawingCanvas {
        width: 100%;
        height: 200px;
    }
    
    .character-selection {
        flex-direction: column;
        align-items: center;
    }
    
    .character-group {
        width: 100%;
        max-width: 320px;
    }
    
    .dot-shapes-container {
        gap: 15px;
    }
}
