/* ==========================================================================
   MASCOTAS VIRTUALES - CSS DE ESTILOS Y ANIMACIONES PREMIUM
   ========================================================================== */

:root {
    --bg-app: radial-gradient(circle, #2c3e50 0%, #0f171e 100%);
    --font-ui: 'Outfit', sans-serif;
    --font-retro: 'Press Start 2P', monospace;
    
    /* Colores por Defecto (Classic Retro Green) */
    --console-color-1: #4caf50;
    --console-color-2: #1b5e20;
    --console-border: #388e3c;
    --console-glow: rgba(76, 175, 80, 0.4);
    
    /* Botones de la Carcasa */
    --btn-casing: #e0e0e0;
    --btn-casing-active: #9e9e9e;
    
    /* Estados del HUD y Barras */
    --health: #e57373;
    --hunger: #ffb74d;
    --fun: #64b5f6;
    --energy: #ffd54f;
    --clean: #81c784;
    --affection: #f06292;
    
    /* Bordes y Sombras */
    --radius-casing: 40px;
    --radius-screen: 16px;
    --shadow-premium: 0 10px 30px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.2);
}

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

body {
    font-family: var(--font-ui);
    background: var(--bg-app);
    color: #ffffff;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#app-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ==========================================================================
   PANTALLA DE SELECCIÓN
   ========================================================================== */
#selection-screen {
    width: 100%;
    max-width: 800px;
    display: none;
}

#selection-screen.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.selection-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
}

.selection-card h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ff8a00 0%, #da1b60 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #b0bec5;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.name-input-group {
    max-width: 400px;
    margin: 0 auto 30px auto;
    text-align: left;
}

.name-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
    font-size: 1.05rem;
}

.name-input-group input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 1.1rem;
    font-family: var(--font-ui);
    transition: all 0.3s;
}

.name-input-group input:focus {
    outline: none;
    border-color: #ff8a00;
    box-shadow: 0 0 12px rgba(255, 138, 0, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
}

.pet-grid::-webkit-scrollbar {
    width: 6px;
}
.pet-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.pet-select-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 20px 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.pet-select-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
}

.pet-select-item.selected {
    background: rgba(255, 138, 0, 0.15);
    border-color: #ff8a00;
    box-shadow: 0 0 15px rgba(255, 138, 0, 0.25);
}

.pet-select-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.pet-select-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.pet-element {
    font-size: 0.8rem;
    color: #90a4ae;
}

/* ==========================================================================
   PANTALLA DE JUEGO (CONSOLA TAMAGOTCHI)
   ========================================================================== */
#game-screen {
    width: 100%;
    display: none;
    justify-content: center;
}

#game-screen.active {
    display: flex;
    animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.console-wrapper {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 30px;
    align-items: center;
    width: 100%;
    max-width: 950px;
}

@media (max-width: 820px) {
    .console-wrapper {
        grid-template-columns: 1fr;
        justify-items: center;
    }
}

/* CARCASA FÍSICA */
.tamagotchi-body {
    width: 100%;
    max-width: 400px;
    height: 520px;
    background: linear-gradient(135deg, var(--console-color-1) 0%, var(--console-color-2) 100%);
    border: 12px solid var(--console-border);
    border-radius: 180px 180px 140px 140px;
    box-shadow: var(--shadow-premium), 0 0 40px var(--console-glow);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    border-bottom-width: 20px;
}

/* Marca superior */
.console-header-brand {
    font-family: var(--font-retro);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    margin-top: 15px;
    text-shadow: 0 2px 2px rgba(0,0,0,0.5);
}

/* Agujero de llavero */
.console-keychain-hole {
    position: absolute;
    top: 10px;
    right: 50px;
    width: 20px;
    height: 20px;
    background: #0f171e;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

/* PANTALLA LCD */
.lcd-screen-container {
    width: 100%;
    height: 260px;
    background-color: #a4c2a8; /* Verde fósforo clásico */
    border: 10px solid #2d3748;
    border-radius: var(--radius-screen);
    box-shadow: inset 0 8px 10px rgba(0,0,0,0.6), 0 2px 4px rgba(255,255,255,0.4);
    padding: 8px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Efecto retro de scanlines */
.lcd-screen-container::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.12) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 10;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
}

/* HUD Retro de la Pantalla */
.screen-hud {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-retro);
    font-size: 0.5rem;
    color: #1a202c;
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
    padding-bottom: 4px;
    margin-bottom: 6px;
}

#hud-name {
    text-transform: uppercase;
}

/* Banner de eventos */
.screen-event-banner {
    background: rgba(0, 0, 0, 0.15);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.72rem;
    color: #1a202c;
    padding: 4px 6px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 6px;
    line-height: 1.2;
    min-height: 24px;
}

/* Viewport de la Mascota */
.pet-viewport {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}

/* Elemento del render */
#pet-render-area {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pet-render-area svg {
    max-width: 110px;
    max-height: 110px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

/* Luces de Alerta del LCD */
.screen-indicators {
    position: absolute;
    bottom: 6px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.indicator-icon {
    font-size: 0.8rem;
    opacity: 0.8;
}

.indicator-icon.hide {
    display: none;
}

/* BOTONES DE LA CARCASA */
.console-buttons-area {
    display: flex;
    justify-content: space-between;
    width: 80%;
    margin-top: 15px;
    margin-bottom: 10px;
}

.console-btn {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #f5f5f5 0%, var(--btn-casing) 100%);
    border: 3px solid #757575;
    border-radius: 50%;
    font-family: var(--font-retro);
    font-size: 0.8rem;
    font-weight: bold;
    color: #424242;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3), inset 0 2px 2px rgba(255,255,255,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.05s, box-shadow 0.05s;
    outline: none;
}

.console-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4), inset 0 1px 2px rgba(0,0,0,0.2);
    background: var(--btn-casing-active);
}

/* Modificaciones especiales para la carcasa por botón (Botón B en el centro es más alto) */
.btn-action-b {
    width: 55px;
    height: 55px;
    margin-top: -6px;
}

.buttons-guide {
    display: flex;
    justify-content: space-between;
    width: 90%;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}

/* ==========================================================================
   SKINS (TEMAS DE CONSOLA)
   ========================================================================== */

/* Tema Cyberpunk Neon */
.tamagotchi-body.skin-cyber {
    --console-color-1: #212529;
    --console-color-2: #03001e;
    --console-border: #ff007f;
    --console-glow: rgba(255, 0, 127, 0.5);
    --btn-casing: #00ffff;
    --btn-casing-active: #008b8b;
}
.tamagotchi-body.skin-cyber .console-btn {
    color: #2b002b;
    border-color: #ff007f;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Tema Bubblegum */
.tamagotchi-body.skin-bubblegum {
    --console-color-1: #ff80ab;
    --console-color-2: #ff4081;
    --console-border: #f50057;
    --console-glow: rgba(245, 0, 87, 0.4);
    --btn-casing: #ffffff;
    --btn-casing-active: #ffccd5;
}
.tamagotchi-body.skin-bubblegum .console-btn {
    border-color: #f50057;
}

/* Tema Madera/Bosque */
.tamagotchi-body.skin-forest {
    --console-color-1: #8d6e63;
    --console-color-2: #4e342e;
    --console-border: #3e2723;
    --console-glow: rgba(141, 110, 99, 0.3);
    --btn-casing: #d7ccc8;
    --btn-casing-active: #a1887f;
}
.tamagotchi-body.skin-forest .console-btn {
    border-color: #3e2723;
}

/* ==========================================================================
   DOCK DE ACCIONES MODERNO
   ========================================================================== */
.dock-container {
    width: 100%;
}

.dock-actions-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .dock-actions-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

.dock-btn {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.dock-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.25);
}

.dock-btn.active-choice {
    background: #ff8a00;
    box-shadow: 0 0 15px rgba(255, 138, 0, 0.4);
    border-color: #ffb300;
}

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

.btn-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e0e0e0;
}

/* Submenús */
.submenu-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 20px;
    animation: slideDown 0.3s cubic-bezier(0.1, 0.8, 0.3, 1);
}

.submenu-container.hide {
    display: none;
}

.submenu-container h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #ff8a00;
}

.submenu-items {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.item-btn {
    flex: 1;
    min-width: 110px;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s;
}

.item-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* PANEL DE ESTADOS */
.stats-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    width: 100%;
}

.stats-panel h3 {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
    color: #fff;
    display: flex;
    justify-content: space-between;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px;
    margin-bottom: 20px;
}

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-bar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-bar-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #cfd8dc;
}

.progress-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.progress-bar.health { background: var(--health); }
.progress-bar.hunger { background: var(--hunger); }
.progress-bar.fun { background: var(--fun); }
.progress-bar.energy { background: var(--energy); }
.progress-bar.clean { background: var(--clean); }
.progress-bar.affection { background: var(--affection); }

.progress-value {
    font-size: 0.75rem;
    font-weight: bold;
    text-align: right;
    color: #eceff1;
}

.stats-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #b0bec5;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}

.stats-footer span b {
    color: white;
}

/* ==========================================================================
   MODALES
   ========================================================================== */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: slideUp 0.3s cubic-bezier(0.1, 0.8, 0.3, 1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: #b0bec5;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ff3d00;
}

.modal-body {
    padding: 24px;
}

/* SECCIÓN MINIJUEGOS */
.minigame-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.minigame-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.25);
}

.minigame-card h3 {
    color: #ff8a00;
    font-size: 1.2rem;
}

.minigame-card p {
    font-size: 0.9rem;
    color: #cfd8dc;
    line-height: 1.4;
}

.minigame-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 16px;
    border-radius: 12px;
}

#game-arena {
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: #0f172a;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

#game-canvas {
    background-color: #1e293b;
    max-width: 100%;
    display: block;
}

.game-instructions {
    text-align: center;
    font-size: 0.85rem;
    color: #90a4ae;
    margin-top: 10px;
}

/* Grid para Memoria de Cartas */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin: 15px auto;
}

.cards-grid.hide {
    display: none;
}

.card {
    height: 70px;
    background-color: #334155;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
    transform-style: preserve-3d;
}

.card.flipped {
    background-color: #475569;
    transform: rotateY(180deg);
}

.card.matched {
    background-color: #059669;
    cursor: default;
    visibility: visible;
}

/* SECCIÓN TIENDA */
.shop-wallet {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffd54f;
    margin-bottom: 20px;
    text-align: center;
    background: rgba(255, 213, 79, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 213, 79, 0.3);
}

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

.shop-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.shop-item-icon {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.shop-item h3 {
    font-size: 1.1rem;
    color: #fff;
}

.shop-item p {
    font-size: 0.8rem;
    color: #90a4ae;
    line-height: 1.3;
}

.shop-item button {
    width: 100%;
    margin-top: 8px;
}

/* Carcasas Shop */
.skin-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 4px solid #fff;
}

.skin-preview.default {
    background: linear-gradient(135deg, #4caf50 0%, #1b5e20 100%);
    border-color: #388e3c;
}

.skin-preview.cyber {
    background: linear-gradient(135deg, #212529 0%, #03001e 100%);
    border-color: #ff007f;
}

.skin-preview.bubblegum {
    background: linear-gradient(135deg, #ff80ab 0%, #ff4081 100%);
    border-color: #f50057;
}

.skin-preview.forest {
    background: linear-gradient(135deg, #8d6e63 0%, #4e342e 100%);
    border-color: #3e2723;
}

/* SOUND TOGGLE BUTTON */
#sound-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 8px 16px;
    color: white;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(5px);
    z-index: 100;
}

#sound-toggle.muted {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
}

/* ==========================================================================
   BOTONES GENERALES
   ========================================================================== */
.btn-primary {
    background: linear-gradient(135deg, #ff8a00 0%, #e52d27 100%);
    border: none;
    color: white;
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(229, 45, 39, 0.35);
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 45, 39, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background: #555;
    color: #888;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-danger-sm {
    background: #ef5350;
    border: none;
    color: white;
    font-family: var(--font-ui);
    font-weight: bold;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger-sm:hover {
    background: #d32f2f;
}

/* ==========================================================================
   PARTÍCULAS Y ESTRUCTURAS FLOTANTES
   ========================================================================== */
.poop-item {
    position: absolute;
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
    animation: floatUpDown 2s infinite ease-in-out;
}

.heart-particle {
    position: absolute;
    color: #e91e63;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 50;
    animation: floatHeart 1.2s forwards ease-out;
}

.chew-particle {
    position: absolute;
    font-size: 0.8rem;
    pointer-events: none;
    animation: floatScatter 0.8s forwards ease-out;
}

.sparkle-particle {
    position: absolute;
    color: #ffeb3b;
    font-size: 1.2rem;
    pointer-events: none;
    animation: floatScatter 1s forwards ease-out;
}

/* ==========================================================================
   ANIMACIONES CLAVE DE LA MASCOTA
   ========================================================================== */

/* Respiración Normal */
.pet-breathing {
    animation: petBreathe 3s infinite ease-in-out;
    transform-origin: bottom center;
}

@keyframes petBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03, 0.97) translateY(2px); }
}

/* Salto de Felicidad */
.pet-jumping {
    animation: petJump 0.6s infinite ease-out;
    transform-origin: bottom center;
}

@keyframes petJump {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(0.96, 1.05) translateY(-20px); }
}

/* Trote del Gimnasio */
.pet-running {
    animation: petRun 0.4s infinite linear;
}

@keyframes petRun {
    0%, 100% { transform: translateX(-5px) rotate(-3deg); }
    50% { transform: translateX(5px) rotate(3deg) translateY(-4px); }
}

/* Temblor cuando está Sucio */
.pet-shivering {
    animation: petShiver 0.2s infinite linear;
}

@keyframes petShiver {
    0%, 100% { transform: translateX(-1px) rotate(-1deg); }
    50% { transform: translateX(1px) rotate(1deg); }
}

/* Huevo Wobble al tocarlo */
.egg-wobbling {
    animation: eggWobble 0.5s ease-out;
    transform-origin: bottom center;
}

@keyframes eggWobble {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-10deg); }
    40% { transform: rotate(12deg); }
    60% { transform: rotate(-6deg); }
    80% { transform: rotate(4deg); }
}

/* Aleteo de Mariposa / Fénix */
.wing-flutter-left {
    animation: flutterLeft 0.5s infinite ease-in-out;
    transform-origin: right center;
}

.wing-flutter-right {
    animation: flutterRight 0.5s infinite ease-in-out;
    transform-origin: left center;
}

@keyframes flutterLeft {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(0.2); }
}

@keyframes flutterRight {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(0.2); }
}

/* Corazones Flotantes */
@keyframes floatHeart {
    0% { transform: translateY(0) scale(0.5) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-70px) scale(1.2) rotate(15deg); opacity: 0; }
}

/* Partículas Dispersas (Comida/Sparkles) */
@keyframes floatScatter {
    0% { transform: translate(0, 0) scale(0.8); opacity: 1; }
    100% { transform: translate(var(--dx, 20px), var(--dy, -20px)) scale(0.4) rotate(45deg); opacity: 0; }
}

/* Movimiento de caca */
@keyframes floatUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Transiciones de Menú y Páginas */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
