/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
    background-size: 400% 400%;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Contenedores principales */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.screen.overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100;
}

/* Pantalla de carga */
.loading-container {
    text-align: center;
    color: white;
}

.fruit-logo {
    font-size: 4rem;
    animation: bounce 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

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

.game-title {
    font-family: 'Fredoka', cursive;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 3px 3px 0px #ff6b6b, 6px 6px 0px #4ecdc4;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    width: 0%;
    animation: loadingProgress 3s ease-in-out forwards;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.loading-text {
    font-size: 1rem;
    opacity: 0.8;
}

/* Menú principal */
.menu-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.floating-fruits {
    position: relative;
    width: 100%;
    height: 100%;
}

.fruit-bg {
    position: absolute;
    font-size: 3rem;
    opacity: 0.1;
    animation: floatAround 10s ease-in-out infinite;
}

.fruit-bg:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.fruit-bg:nth-child(2) { top: 20%; right: 10%; animation-delay: 2s; }
.fruit-bg:nth-child(3) { bottom: 30%; left: 15%; animation-delay: 4s; }
.fruit-bg:nth-child(4) { bottom: 20%; right: 20%; animation-delay: 6s; }
.fruit-bg:nth-child(5) { top: 50%; left: 50%; animation-delay: 8s; }

@keyframes floatAround {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(20px) rotate(180deg); }
    75% { transform: translateY(-10px) rotate(270deg); }
}

.menu-container {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.logo-section {
    margin-bottom: 3rem;
}

.game-logo {
    font-family: 'Fredoka', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 0px #ff6b6b, 4px 4px 0px #4ecdc4;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logo-fruit {
    font-size: 2rem;
    animation: rotate 3s ease-in-out infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(360deg); }
}

.game-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* Botones del menú */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.menu-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    border: none;
    border-radius: 25px;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 60px;
}

.menu-btn.primary {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    transform: scale(1.05);
}

.menu-btn.secondary {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
}

.menu-btn:active {
    transform: scale(0.95);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Estadísticas del jugador */
.player-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: white;
    font-weight: 700;
}

.stat-icon {
    font-size: 1.5rem;
}

/* Pantalla del juego */
#game-screen {
    padding: 0;
    justify-content: flex-start;
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 50%, #FFE4B5 100%);
}

/* HUD del juego */
.game-hud {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.level-info, .moves-info, .score-info {
    text-align: center;
    color: white;
}

.level-label, .moves-label, .score-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
}

.level-number, .moves-number, .score-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.objectives-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 0.75rem;
    text-align: center;
}

.objective-item {
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.objective-icon {
    font-size: 1.2rem;
}

/* Área de juego */
.game-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.board-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
}

/* Celdas del tablero */
.cell {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cell:active {
    transform: scale(0.95);
}

.cell.selected {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    box-shadow: 0 0 0 3px #ff6b6b, inset 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: pulse 0.6s ease-in-out infinite alternate;
}

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

/* Frutas */
.fruit {
    font-size: 1.8rem;
    transition: all 0.2s ease;
    cursor: pointer;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.fruit:hover {
    transform: scale(1.1);
}

.fruit.strawberry::before { content: '🍓'; }
.fruit.orange::before { content: '🍊'; }
.fruit.grape::before { content: '🍇'; }
.fruit.lemon::before { content: '🍋'; }
.fruit.kiwi::before { content: '🥝'; }
.fruit.blueberry::before { content: '🫐'; }
.fruit.apple::before { content: '🍎'; }
.fruit.pineapple::before { content: '🍍'; }

/* Power-ups */
.fruit.striped {
    position: relative;
}

.fruit.striped::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, #fff, #ffdd59, #fff);
    border-radius: 2px;
    transform: translateY(-50%);
    box-shadow: 0 0 8px rgba(255, 221, 89, 0.8);
}

.fruit.wrapped {
    position: relative;
}

.fruit.wrapped::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    right: 15%;
    bottom: 15%;
    border: 3px solid #ff6b6b;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.8);
}

.fruit.color-bomb {
    background: radial-gradient(circle, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
    background-size: 200% 200%;
    animation: colorBombPulse 1s ease-in-out infinite;
    border-radius: 50%;
}

@keyframes colorBombPulse {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}

/* Barra de power-ups */
.powerups-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
}

.powerup-item {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.powerup-item:active {
    transform: scale(0.9);
}

.powerup-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.powerup-count {
    font-size: 0.8rem;
    font-weight: 700;
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #ff6b6b;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botones de acción */
.action-buttons {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
}

.action-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: scale(0.9);
}

/* Modales */
.modal-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 350px;
}

.modal-title {
    font-family: 'Fredoka', cursive;
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1rem;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

/* Pantalla de victoria */
.victory-stars {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.star {
    font-size: 3rem;
    opacity: 0.3;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.star.earned {
    opacity: 1;
    transform: scale(1);
    animation: starEarn 0.6s ease-out;
}

@keyframes starEarn {
    0% { transform: scale(0.5) rotate(-180deg); opacity: 0.3; }
    50% { transform: scale(1.2) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.victory-stats {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
    font-weight: 600;
}

/* Pantalla de derrota */
.defeat-message {
    color: #666;
    margin: 1rem 0;
}

.extra-moves-offer {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    border-radius: 15px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.moves-icon {
    font-size: 1.5rem;
}

.moves-text {
    font-weight: 600;
}

.moves-cost {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 0.5rem;
    font-weight: 700;
}

/* Efectos de partículas */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.particle {
    position: absolute;
    font-size: 1.5rem;
    pointer-events: none;
    animation: particleFloat 1s ease-out forwards;
}

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

/* Animaciones de cascada */
.cell.falling {
    animation: fallDown 0.3s ease-in-out;
}

@keyframes fallDown {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

.cell.exploding {
    animation: explode 0.4s ease-out forwards;
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); }
    100% { transform: scale(0); opacity: 0; }
}

/* Animaciones de Power-ups */
@keyframes striped-glow {
    0% { 
        transform: scale(1); 
        filter: brightness(1) saturate(1);
        box-shadow: 0 0 0 rgba(255, 107, 107, 0);
    }
    50% { 
        transform: scale(1.1); 
        filter: brightness(1.5) saturate(1.5);
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
    }
    100% { 
        transform: scale(1); 
        filter: brightness(1.2) saturate(1.2);
        box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
    }
}

@keyframes wrapped-glow {
    0% { 
        transform: scale(1) rotate(0deg); 
        filter: brightness(1) saturate(1);
        box-shadow: 0 0 0 rgba(78, 205, 196, 0);
    }
    50% { 
        transform: scale(1.1) rotate(5deg); 
        filter: brightness(1.5) saturate(1.5);
        box-shadow: 0 0 20px rgba(78, 205, 196, 0.8);
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        filter: brightness(1.2) saturate(1.2);
        box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
    }
}

@keyframes color-bomb-explode {
    0% { 
        transform: scale(1); 
        filter: brightness(1);
        opacity: 1;
    }
    30% { 
        transform: scale(1.3); 
        filter: brightness(2) hue-rotate(180deg);
        opacity: 1;
    }
    60% { 
        transform: scale(1.5); 
        filter: brightness(3) hue-rotate(360deg);
        opacity: 0.8;
    }
    100% { 
        transform: scale(0); 
        filter: brightness(0);
        opacity: 0;
    }
}

/* Power-up estados visuales */
.fruit.striped-horizontal {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        transparent 20%, 
        transparent 80%, 
        rgba(255, 255, 255, 0.8) 100%);
    animation: striped-pulse 2s ease-in-out infinite;
}

.fruit.striped-vertical {
    background: linear-gradient(0deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        transparent 20%, 
        transparent 80%, 
        rgba(255, 255, 255, 0.8) 100%);
    animation: striped-pulse 2s ease-in-out infinite;
}

.fruit.wrapped {
    border: 3px solid rgba(78, 205, 196, 0.8);
    box-shadow: 
        inset 0 0 10px rgba(78, 205, 196, 0.3),
        0 0 15px rgba(78, 205, 196, 0.5);
    animation: wrapped-shimmer 1.5s ease-in-out infinite;
}

.fruit.color-bomb {
    background: radial-gradient(circle, 
        rgba(249, 202, 36, 0.9) 0%, 
        rgba(255, 107, 107, 0.8) 50%, 
        rgba(69, 183, 209, 0.9) 100%);
    box-shadow: 0 0 20px rgba(249, 202, 36, 0.8);
    animation: color-bomb-pulse 1s ease-in-out infinite;
}

@keyframes striped-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

@keyframes wrapped-shimmer {
    0%, 100% { 
        box-shadow: 
            inset 0 0 10px rgba(78, 205, 196, 0.3),
            0 0 15px rgba(78, 205, 196, 0.5);
    }
    50% { 
        box-shadow: 
            inset 0 0 20px rgba(78, 205, 196, 0.6),
            0 0 25px rgba(78, 205, 196, 0.8);
    }
}

@keyframes color-bomb-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(249, 202, 36, 0.8);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(249, 202, 36, 1);
    }
}

/* Obstáculos */
.obstacle-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 15px;
    z-index: 2;
}

/* Hielo */
.obstacle-overlay.ice {
    background: linear-gradient(45deg, 
        rgba(173, 216, 230, 0.7) 0%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(173, 216, 230, 0.7) 100%);
    border: 2px solid rgba(135, 206, 235, 0.8);
    box-shadow: 
        inset 0 0 10px rgba(255, 255, 255, 0.5),
        0 0 8px rgba(135, 206, 235, 0.6);
    animation: ice-shimmer 2s ease-in-out infinite;
}

.obstacle-overlay.ice.health-2 {
    border-width: 3px;
    box-shadow: 
        inset 0 0 15px rgba(255, 255, 255, 0.7),
        0 0 12px rgba(135, 206, 235, 0.8);
}

@keyframes ice-shimmer {
    0%, 100% { 
        filter: brightness(1);
        transform: scale(1);
    }
    50% { 
        filter: brightness(1.2);
        transform: scale(1.02);
    }
}

/* Cadenas */
.obstacle-overlay.chains {
    background: repeating-linear-gradient(
        45deg,
        rgba(105, 105, 105, 0.8) 0px,
        rgba(105, 105, 105, 0.8) 3px,
        rgba(169, 169, 169, 0.6) 3px,
        rgba(169, 169, 169, 0.6) 6px
    );
    border: 2px solid #696969;
    box-shadow: 
        inset 0 0 5px rgba(0, 0, 0, 0.5),
        0 0 6px rgba(105, 105, 105, 0.7);
    animation: chain-rattle 1.5s ease-in-out infinite;
}

@keyframes chain-rattle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1deg); }
    75% { transform: rotate(-1deg); }
}

/* Chocolate */
.obstacle-overlay.chocolate {
    background: radial-gradient(circle, 
        rgba(139, 69, 19, 0.9) 0%,
        rgba(160, 82, 45, 0.8) 50%,
        rgba(101, 67, 33, 0.9) 100%);
    border: 2px solid #8B4513;
    box-shadow: 
        inset 0 0 8px rgba(139, 69, 19, 0.7),
        0 0 6px rgba(139, 69, 19, 0.5);
    animation: chocolate-drip 3s ease-in-out infinite;
}

@keyframes chocolate-drip {
    0%, 100% { 
        border-radius: 15px;
        transform: scaleY(1);
    }
    50% { 
        border-radius: 15px 15px 20px 20px;
        transform: scaleY(1.05);
    }
}

/* Piedra */
.obstacle-overlay.stone {
    background: linear-gradient(135deg, 
        rgba(128, 128, 128, 0.9) 0%,
        rgba(169, 169, 169, 0.8) 30%,
        rgba(105, 105, 105, 0.9) 70%,
        rgba(128, 128, 128, 0.9) 100%);
    border: 3px solid #696969;
    box-shadow: 
        inset 0 0 10px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(105, 105, 105, 0.6);
    animation: stone-pulse 2s ease-in-out infinite;
}

.obstacle-overlay.stone.health-2 {
    border-width: 4px;
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(105, 105, 105, 0.8);
}

@keyframes stone-pulse {
    0%, 100% { 
        filter: brightness(1);
    }
    50% { 
        filter: brightness(0.9);
    }
}

/* Estados de obstáculos dañados */
.obstacle-overlay.health-1 {
    opacity: 0.7;
    animation-duration: 1s;
}

/* Efectos de destrucción de obstáculos */
.obstacle-breaking {
    animation: obstacle-break 0.4s ease-out forwards;
}

@keyframes obstacle-break {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% { 
        transform: scale(0);
        opacity: 0;
    }
}

/* Créditos del Desarrollador */
.developer-credits {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 70%,
        transparent 100%
    );
    padding: 10px 20px 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.developer-name {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.8),
        0 0 8px rgba(78, 205, 196, 0.5);
    margin: 0;
    letter-spacing: 0.5px;
    animation: developer-glow 3s ease-in-out infinite;
}

@keyframes developer-glow {
    0%, 100% { 
        text-shadow: 
            0 1px 2px rgba(0, 0, 0, 0.8),
            0 0 8px rgba(78, 205, 196, 0.5);
    }
    50% { 
        text-shadow: 
            0 1px 2px rgba(0, 0, 0, 0.8),
            0 0 12px rgba(78, 205, 196, 0.8),
            0 0 20px rgba(78, 205, 196, 0.4);
    }
}

/* Responsive para créditos */
@media (max-width: 480px) {
    .developer-name {
        font-size: 0.75rem;
    }
    
    .developer-credits {
        padding: 8px 15px 12px;
    }
}

/* Ocultar créditos durante el gameplay activo */
#game-screen.active ~ .developer-credits {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

#game-screen.active ~ .developer-credits:hover {
    opacity: 1;
}

/* Responsividad */
@media (max-height: 700px) {
    .game-title { font-size: 2rem; }
    .game-logo { font-size: 1.8rem; }
    .menu-btn { padding: 0.8rem 1.2rem; min-height: 50px; }
    .fruit { font-size: 1.5rem; }
    .modal-container { padding: 1.5rem; }
}

@media (max-width: 350px) {
    .board-container { padding: 5px; gap: 1px; }
    .fruit { font-size: 1.4rem; }
    .powerup-item { width: 50px; height: 50px; }
    .action-btn { width: 45px; height: 45px; }
}

/* Efectos táctiles mejorados */
.cell:active,
.menu-btn:active,
.powerup-item:active,
.action-btn:active {
    transform: scale(0.95);
}

/* Prevenir zoom en double-tap */
button, .cell, .fruit, .powerup-item {
    touch-action: manipulation;
}

/* Pantalla de mapa de niveles */
.levels-header {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:active {
    transform: scale(0.9);
}

.levels-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.world-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.world-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.world-nav-btn:active {
    transform: scale(0.9);
}

.world-name {
    color: white;
    font-weight: 600;
    min-width: 150px;
    text-align: center;
}

.world-info {
    padding: 2rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%);
    position: relative;
    overflow: hidden;
}

.world-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background-size: cover;
    background-position: center;
}

.world-description {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.world-progress {
    position: relative;
    z-index: 1;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    height: 8px;
    margin: 0.5rem 0;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #4ecdc4, #45b7d1);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    padding: 2rem 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.level-item {
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.level-item.unlocked {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.level-item.current {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    animation: pulse 1s ease-in-out infinite alternate;
}

.level-item.completed {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.level-item.locked {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.level-item:active:not(.locked) {
    transform: scale(0.9);
}

.level-number {
    font-size: 1.2rem;
    line-height: 1;
}

.level-stars {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.star {
    font-size: 0.8rem;
    opacity: 0.3;
}

.star.earned {
    opacity: 1;
}

/* Mejorar el contraste en pantallas pequeñas */
@media (max-width: 320px) {
    .hud-top {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .level-number, .moves-number, .score-number {
        font-size: 1.2rem;
    }
    
    .levels-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Pantalla de tienda */
.shop-header {
    background: linear-gradient(135deg, #f9ca24, #f0932b);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.shop-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.coins-display {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 700;
}

.coin-icon {
    font-size: 1.2rem;
}

.shop-content {
    padding: 1rem;
    max-height: 80vh;
    overflow-y: auto;
}

.shop-section {
    margin-bottom: 2rem;
}

.section-title {
    color: #333;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.shop-item {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.shop-item:active {
    transform: scale(0.95);
}

.item-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.item-name {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
}

.item-description {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f9ca24;
    margin-bottom: 0.75rem;
}

.buy-btn {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.buy-btn:active {
    transform: scale(0.95);
}

.buy-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Pantalla de configuraciones */
.settings-header {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.settings-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.settings-content {
    padding: 1rem;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.setting-label {
    font-weight: 600;
    color: #333;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4ecdc4;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.volume-slider {
    width: 120px;
    margin: 0 10px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    font-size: 3rem;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-details {
    flex: 1;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
}

.profile-level {
    color: #666;
    margin-bottom: 0.5rem;
}

.exp-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.exp-fill {
    background: linear-gradient(90deg, #4ecdc4, #45b7d1);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #4ecdc4;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.settings-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    border: none;
    border-radius: 10px;
    padding: 1rem;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.settings-btn:active {
    transform: scale(0.95);
}

.btn-icon {
    font-size: 1.2rem;
}