/* =============================
   ANIMAL EXPLORER - NATURE QUEST STYLE
   Pixel art - Paleta natural: madera, pasto, bellotas
   Basado en pruebasJuegosMundos (game, ganar, guia)
   Sin tonos fosforescentes
   ============================= */

:root {
    /* Madera */
    --wood-dark: #5d4037;
    --wood-medium: #8d6e63;
    --wood-light: #d7ccc8;
    
    /* Pasto y naturaleza */
    --grass-vibrant: #7cb342;
    --grass-light: #a5d6a7;
    --grass-grid: #81c784;
    --bush-dark: #689f38;
    --leaf-green: #2e7d32;
    
    /* Acentos */
    --acorn-gold: #ffb300;
    --acorn-gold-hover: #ffa000;
    --sky-soft: #e3f2fd;
    
    /* Bordes pixel (marron oscuro) */
    --pixel-border: #3e2723;
    --pixel-border-size: 4px;
    --pixel-border-size-sm: 2px;
    
    /* Texto */
    --text-wood: #5d4037;
    --text-amber: #fef3c7;
    --text-white: #ffffff;
}

/* Bordes pixel - estilo videojuego retro */
.pixel-border {
    box-shadow: 
        0 calc(-1 * var(--pixel-border-size)) 0 0 var(--pixel-border),
        0 var(--pixel-border-size) 0 0 var(--pixel-border),
        calc(-1 * var(--pixel-border-size)) 0 0 0 var(--pixel-border),
        var(--pixel-border-size) 0 0 0 var(--pixel-border);
}

.pixel-border-sm {
    box-shadow: 
        0 -2px 0 0 var(--pixel-border),
        0 2px 0 0 var(--pixel-border),
        -2px 0 0 0 var(--pixel-border),
        2px 0 0 0 var(--pixel-border);
}

/* Textura de pergamino para paneles */
.scroll-texture {
    background-color: #f5f5dc;
    background-image: repeating-linear-gradient(
        0deg, transparent, transparent 1px, rgba(0, 0, 0, 0.03) 1px, rgba(0, 0, 0, 0.03) 2px
    );
}

/* Panel de madera */
.wooden-panel {
    background-color: var(--wood-medium);
    border: 4px solid var(--wood-dark);
}

/* Body - Nature Quest - Sin fosforescentes (Polypane safe-area) */
body.pixel-theme {
    --primary-color: #7cb342;
    --accent-color: #ffb300;
    --dark-bg: #a5d6a7;
    --light-text: #3e2723;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(env(safe-area-inset-top) + 0.5rem);
    padding-right: calc(env(safe-area-inset-right) + 0.5rem);
    padding-bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
    padding-left: calc(env(safe-area-inset-left) + 0.5rem);
    background-color: var(--grass-light);
    background-image: radial-gradient(var(--grass-grid) 2px, transparent 2px);
    background-size: 32px 32px;
    color: var(--text-wood);
    font-family: 'Quicksand', 'Press Start 2P', sans-serif;
}

/* Ocultar fondos fosforescentes del style.css base */
body.pixel-theme::before,
body.pixel-theme::after,
body.pixel-theme .game-container::before {
    display: none !important;
}

/* Tipografía pixel */
.pixel-font {
    font-family: 'Press Start 2P', cursive;
}

/* Bloques de comando - Azul para movimiento, verde para recoger (Nature Quest) */
.command-block.pixel-block {
    background: #3b82f6;
    border: 2px solid var(--wood-dark);
    color: var(--text-white);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 0.5em 0.75em;
    cursor: grab;
    transition: transform 0.15s ease;
    image-rendering: pixelated;
}

.command-block.pixel-block:hover {
    transform: scale(1.05);
}

.command-block.pixel-block.collect-block {
    background: #10b981;
    color: var(--text-white);
}

/* Secuencia de código - Estilo Explorer's Recipe */
.code-sequence.pixel-sequence {
    background: var(--wood-light);
    border: 2px solid var(--wood-dark);
    min-height: 5em;
    padding: 0.75em;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Drop zone con animación al arrastrar */
.code-sequence .drop-zone.pixel-drop {
    color: #795548;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    min-height: 4em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(93, 64, 55, 0.4);
    border-radius: 0.25em;
    transition: all 0.2s ease;
}

.code-sequence.drag-active .drop-zone.pixel-drop,
.code-sequence.drag-over .drop-zone.pixel-drop {
    border-color: var(--grass-vibrant);
    background: rgba(124, 179, 66, 0.1);
    animation: drop-pulse 1s ease-in-out infinite;
}

@keyframes drop-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 179, 66, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(124, 179, 66, 0); }
}

/* Bloques colocados en secuencia */
.code-sequence .placed-command.pixel-block {
    background: #3b82f6;
}

.code-sequence .placed-command.collect-block {
    background: #10b981;
}

/* Header - Ocultar glow fosforescente */
.pixel-theme .game-header::before {
    display: none !important;
}

/* Título Animal Explorer - Pixel font, sin degradado fosforescente */
.pixel-theme .logo-section h1 {
    font-family: 'Press Start 2P', cursive !important;
    font-size: 1rem !important;
    background: none !important;
    -webkit-text-fill-color: var(--wood-dark) !important;
    color: var(--wood-dark) !important;
    text-shadow: 2px 2px 0 var(--wood-light);
}

.pixel-theme .animal-emoji,
.pixel-theme .logo-section .animal-emoji {
    font-size: 1.5rem;
    filter: none;
    animation: none;
}

/* Loader con animal */
.animal-loader {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Header - Panel de madera (Nature Quest) */
.game-header.pixel-header {
    background: var(--wood-medium);
    border: 4px solid var(--wood-dark);
    color: var(--text-amber);
    padding: 1em;
}

.game-header.pixel-header .logo-section h1 {
    font-family: 'Press Start 2P', cursive;
    color: var(--text-white);
}

.game-header.pixel-header .control-btn {
    background: var(--wood-dark);
    border: 2px solid var(--pixel-border);
    color: var(--text-white);
}

.game-header.pixel-header .control-btn.primary-btn {
    background: var(--grass-vibrant);
}

.game-header.pixel-header .control-btn.secondary-btn {
    background: var(--acorn-gold);
    color: var(--text-wood);
}

/* Controles - Estilo Nature Quest */
.control-btn.pixel-btn {
    background: var(--wood-dark);
    border: 2px solid var(--pixel-border);
    color: var(--text-white);
    font-family: 'Press Start 2P', cursive;
}

.control-btn.pixel-btn:hover {
    background: var(--pixel-border);
}

.control-btn.play-btn.pixel-btn {
    background: var(--grass-vibrant);
}

.control-btn.play-btn.pixel-btn:hover {
    background: var(--bush-dark);
}

.control-btn.clear-btn.pixel-btn {
    background: #b91c1c;
}

.control-btn.clear-btn.pixel-btn:hover {
    background: #991b1b;
}

.control-btn.reset-btn.pixel-btn {
    background: var(--acorn-gold);
    color: var(--text-wood);
}

.control-btn.reset-btn.pixel-btn:hover {
    background: var(--acorn-gold-hover);
}

/* =============================
   LAYOUT - Responsive (Polypane rules)
   Mobile-first, ems, flexbox
   ============================= */

/* Layout 4 columnas responsive - Mobile first */
body.pixel-theme .game-container {
    overflow: auto;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

.game-main-pixel {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "commands" "drag" "map" "annotations";
    flex: 1;
    overflow: hidden;
    min-height: 0;
    gap: 1em;
    padding: 1em;
    max-width: 100%;
}

/* Col 1: Menu comandos */
.col-commands,
.command-panel-pixel {
    grid-area: commands;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: #f5f5dc;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0,0,0,0.03) 1px, rgba(0,0,0,0.03) 2px);
    border: 2px solid var(--wood-dark);
    border-radius: 0.5em;
    padding: 1em;
    overflow-y: auto;
}

.command-panel-pixel .commands-panel-title,
.commands-panel-title {
    font-size: 0.5rem;
    color: var(--text-wood);
    margin-bottom: 1em;
    text-align: center;
    padding-bottom: 0.5em;
    border-bottom: 2px solid rgba(93, 64, 55, 0.3);
}

.command-blocks {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

/* Col 2: Arrastra aquí - drop zone */
.col-drag.code-sequence-container {
    grid-area: drag;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1em;
    background: var(--wood-medium);
    border: 4px solid var(--wood-dark);
    border-radius: 0.25em;
}

.draft-hint {
    font-size: 0.85rem;
    color: var(--text-amber);
    font-style: italic;
    margin-bottom: 0.5em;
    opacity: 0.9;
}

.code-sequence-container .code-sequence-title,
.code-sequence-title {
    font-size: 0.5rem;
    color: var(--text-amber);
    margin-bottom: 0.25em;
}

/* Controles de ejecución - centrados y con espacio (responsive) */
.execution-controls-pixel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em 1em;
    padding: 1em 0.5em 0.5em;
    margin-top: auto;
    justify-content: center;
    align-items: center;
}

/* Botón Ejecutar - evitar que se corte el texto */
.control-btn.play-btn.pixel-btn {
    min-width: 8.5em;
    padding: 0.6em 1em;
    font-size: 0.5rem;
}

.control-btn.reset-btn.pixel-btn {
    min-width: 8em;
    padding: 0.6em 1em;
}

.control-btn.icon-only.pixel-btn {
    min-width: 2.5em;
    min-height: 2.5em;
}

.code-sequence.pixel-sequence {
    flex: 1;
    min-height: 5em;
    overflow-y: auto;
}

/* Col 3: Mapa */
.col-map.game-canvas-container {
    grid-area: map;
    min-width: 0;
    flex: 1;
}

.game-canvas-pixel {
    width: 100%;
    height: 100%;
    min-height: 18em;
    background: var(--grass-grid);
    border: 8px solid var(--wood-dark);
    border-radius: 0.25em;
    overflow: hidden;
    position: relative;
}

/* Badge Mundo·Nivel - depuración (M=mundo, N=nivel) */
.live-world-badge,
#map-level-badge {
    position: absolute;
    top: 1em;
    left: 1em;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.35em 0.6em;
    border-radius: 0.25em;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: white;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5em;
    border: 2px solid rgba(255,255,255,0.3);
}

.live-world-badge::before {
    content: '';
    width: 0.5em;
    height: 0.5em;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
}

/* Col 4: Datos extras - anotaciones */
.col-annotations.annotations-panel,
.annotations-panel {
    grid-area: annotations;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1em;
    background-color: #f5f5dc;
    border-left: 4px solid var(--wood-dark);
    padding: 1em;
    overflow-y: auto;
}

.annotations-title {
    font-size: 0.5rem;
    color: var(--text-wood);
}

.annotations-narrative {
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-wood);
}

.annotations-code-preview {
    font-family: 'Quicksand', monospace;
    font-size: 0.9rem;
    color: var(--wood-dark);
    background: rgba(255, 255, 255, 0.5);
    padding: 0.75em;
    border-radius: 0.25em;
}

.annotations-tip {
    background: rgba(124, 179, 66, 0.2);
    border-left: 4px solid var(--grass-vibrant);
    padding: 0.75em;
    font-family: 'Quicksand', sans-serif;
    color: var(--leaf-green);
}

.annotations-concept {
    background: rgba(255, 179, 0, 0.15);
    padding: 0.75em;
    font-family: 'Quicksand', sans-serif;
    color: var(--wood-dark);
}

/* Mensajes del juego - paleta Nature Quest, mayor legibilidad */
.pixel-theme .message-bubble {
    background: #f5f5dc !important;
    border: 3px solid var(--wood-dark) !important;
    color: var(--wood-dark) !important;
    font-family: 'Quicksand', sans-serif !important;
    font-size: 1rem !important;
}

.pixel-theme .message-bubble p {
    color: var(--wood-dark) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

.pixel-theme .message-avatar,
.pixel-theme .nano-avatar {
    font-size: 1.75rem !important;
}

/* Modales Objetivo y Mundos - Nature Quest */
.pixel-theme #objective-modal .modal-content,
.pixel-theme #worlds-modal .modal-content,
.pixel-theme .worlds-modal-content {
    background: linear-gradient(180deg, #f5f5dc 0%, #e8dcc4 100%) !important;
    border: 4px solid var(--wood-dark) !important;
    color: var(--wood-dark) !important;
}

.pixel-theme #objective-modal h2,
.pixel-theme #worlds-modal h2 {
    font-family: 'Press Start 2P', cursive !important;
    font-size: 0.75rem !important;
    color: var(--wood-dark) !important;
}

.pixel-theme #objective-modal h3,
.pixel-theme #objective-modal p,
.pixel-theme #worlds-modal p {
    color: var(--wood-dark) !important;
    font-size: 1rem !important;
}

.pixel-theme .hint-section {
    background: rgba(255, 179, 0, 0.15) !important;
    border: 2px solid var(--acorn-gold) !important;
}

.pixel-theme .optimal-moves {
    background: rgba(124, 179, 66, 0.2) !important;
    border: 2px solid var(--grass-vibrant) !important;
}

/* =============================
   RESPONSIVE - 4 columnas en desktop
   min-width (Polypane #5), ems (#4)
   ============================= */

@media (min-width: 48em) {
    .game-main-pixel {
        grid-template-columns: minmax(8em, 12em) minmax(12em, 1fr) minmax(16em, 2fr) minmax(10em, 16em);
        grid-template-rows: 1fr;
        grid-template-areas: "commands drag map annotations";
        gap: 1em;
    }
    
    .col-commands { max-width: 14em; }
    .col-map { min-height: 24em; }
    
    /* En escritorio, controles de ejecución con más espacio y centrados */
    .execution-controls-pixel {
        gap: 1em 1.25em;
        padding: 1.25em 0.75em 0.75em;
        justify-content: center;
    }
}

@media (min-width: 64em) {
    .game-main-pixel {
        grid-template-columns: 12em minmax(14em, 1fr) minmax(20em, 2.5fr) minmax(12em, 18em);
    }

}

/* Móvil: ocultar anotaciones + comandos y área arrastrar más grandes (touch) */
@media (max-width: 30em) {
    .game-main-pixel {
        grid-template-areas: "commands" "drag" "map";
    }
    
    .col-annotations.annotations-panel {
        display: none;
    }
    

    .col-map.game-canvas-container {
        min-height: min(50vh, 20em);
    }

    
    /* Comandos más grandes en móvil para lectura y tacto */
    .command-block.pixel-block {
        font-size: 0.7rem;
        padding: 0.75em 1em;
        min-height: 2.75rem; /* ~44px área táctil */
    }
    
    .command-blocks {
        gap: 0.6em;
    }
    
    /* Área "Arrastra comandos aquí" más alta y legible */
    .code-sequence .drop-zone.pixel-drop {
        min-height: 5.5em;
        font-size: 1.05rem;
        padding: 0.75em;
    }
    
    .code-sequence.pixel-sequence {
        min-height: 6em;
    }
    
    /* Botones de ejecución más grandes en móvil */
    .execution-controls-pixel {
        gap: 0.6em;
        padding: 1em 0.25em 0.5em;
    }
    
    .control-btn.play-btn.pixel-btn,
    .control-btn.reset-btn.pixel-btn {
        min-height: 2.75rem;
        padding: 0.7em 1em;
        font-size: 0.6rem;
    }
    
    .control-btn.icon-only.pixel-btn {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }
}


/* ==========================================================================
   AJUSTE MÓVIL: Scroll liberado y elementos legibles
========================================================================== */
@media (max-width: 30em) {
    /* Permitimos que el body y el contenedor crezcan según el contenido */
    body, .game-container {
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto !important;
    }

    .game-main-pixel {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding: 10px;
        height: auto !important; /* Libera el alto fijo */
    }

    /* Ocultar panel lateral innecesario en móvil */
    .col-annotations.annotations-panel {
        display: none;
    }

    /* 1. COMANDOS: En dos columnas para que no ocupen tanto espacio vertical */
    .col-commands.command-panel-pixel {
        min-height: auto;
        padding: 1rem;
    }

    .command-blocks {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2 columnas */
        gap: 10px;
    }

    .command-block.pixel-block {
        font-size: 0.8rem;
        padding: 12px 8px;
        min-height: 3.5rem; /* Tamaño ideal para dedos */
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* 2. RECETA (Drop Zone): Más alta para ver la lista */
    .col-drag.code-sequence-container {
        min-height: 250px;
        display: flex;
        flex-direction: column;
    }

    .code-sequence.pixel-sequence {
        flex-grow: 1;
        min-height: 150px;
        border: 2px dashed #8d6e63;
        background: rgba(0,0,0,0.03);
        margin: 10px 0;
    }

    /* 3. MAPA (Phaser): Altura fija para evitar que se aplaste */
    .col-map.game-canvas-container {
        min-height: 350px !important;
        height: 350px !important;
        width: 100%;
    }

    /* 4. BOTONES DE CONTROL: Grandes y fáciles de presionar */
    .execution-controls-pixel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 1rem 0;
    }

    .control-btn.pixel-btn {
        min-height: 3.5rem;
        width: 100%;
        font-size: 0.7rem !important;
        margin: 0;
    }

    /* Botón de borrar (basura) ocupa toda la fila arriba de los otros */
    .clear-btn.icon-only {
        grid-column: span 2;
        min-height: 2.5rem;
    }
}

/* Modal victoria - Estilo ganar/screen */
.pixel-theme #victory-modal .modal-content {
    background: linear-gradient(180deg, #FFB347 0%, #FFCC33 100%);
    border: 6px solid var(--pixel-border);
    color: var(--wood-dark);
}

.pixel-theme #victory-modal h2 {
    font-family: 'Press Start 2P', cursive;
    color: var(--text-white);
    text-shadow: 4px 4px 0 var(--wood-dark);
}

.pixel-theme #victory-modal .control-btn.primary-btn {
    background: #4CAF50;
    border: 4px solid var(--pixel-border);
}

/* Botón cerrar modales - mayor tamaño y márgenes */
.pixel-theme .modal .close,
.pixel-theme .commands-modal-close {
    font-size: 1.5rem !important;
    width: 2em !important;
    height: 2em !important;
    line-height: 1.8 !important;
    padding: 0.25em !important;
    margin: 0.5em !important;
    color: var(--wood-dark) !important;
    background: rgba(255,255,255,0.2) !important;
    border-radius: 0.25em !important;
}

.pixel-theme .modal .close:hover,
.pixel-theme .commands-modal-close:hover {
    background: rgba(0,0,0,0.2) !important;
}

.pixel-theme #victory-modal .control-btn.secondary-btn {
    background: #FF9800;
    border: 4px solid var(--pixel-border);
}

/* Loader con tema natural */
.pixel-theme .loader-container {
    background: var(--grass-light);
}

/* Modal de login - cristal esmerilado cálido (glassmorphism) sobre el bosque */
.pixel-theme .user-modal-content {
    background:
        linear-gradient(158deg, rgba(255, 255, 255, 0.72) 0%, rgba(250, 246, 231, 0.56) 45%, rgba(240, 233, 209, 0.48) 100%) !important;
    border: 3px solid rgba(255, 253, 244, 0.72) !important;
    color: #2b1d12 !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    backdrop-filter: blur(20px) saturate(1.5);
    box-shadow:
        0 26px 64px rgba(3, 10, 6, 0.5),
        0 4px 16px rgba(3, 10, 6, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.16) !important;
}


.pixel-theme .user-modal-content h2 {
    color: #2b1d12 !important;
    font-family: 'Press Start 2P', cursive !important;
    font-size: 0.9rem !important;
    line-height: 1.7 !important;
    text-shadow: none !important;
}

.pixel-theme .user-modal-content p {
    color: #2b1d12 !important;
}

.pixel-theme .user-modal-content label {
    color: #2b1d12 !important;
}

.pixel-theme .user-modal-content input {
    border: 2px solid var(--wood-dark) !important;
    background: #fff !important;
    color: var(--wood-dark) !important;
    font-size: 1rem !important;
    border-radius: 0 !important;
}
.pixel-theme .user-modal-content input::placeholder {
    color: var(--wood-medium) !important;
    opacity: 1 !important;
}

.pixel-theme .user-modal-content input:focus {
    border-color: var(--leaf-green) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.4) !important;
}

.pixel-theme .user-modal-content .primary-btn {
    background: var(--grass-vibrant) !important;
    border: 3px solid var(--pixel-border) !important;
    color: var(--pixel-border) !important;
    border-radius: 0 !important;
    text-shadow: none !important;
    box-shadow: 0 6px 16px rgba(3, 10, 6, 0.35) !important;
}

.pixel-theme .user-modal-content .primary-btn:hover,
.pixel-theme .user-modal-content .primary-btn:focus-visible {
    background: var(--leaf-green) !important;
    color: var(--text-amber) !important;
    box-shadow: 0 10px 22px rgba(3, 10, 6, 0.45) !important;
}

.pixel-theme .user-modal-content .primary-btn:focus-visible {
    outline: 3px solid var(--acorn-gold);
    outline-offset: 3px;
}

/* ============ Login: chips de código y algoritmos a la deriva ============ */
.user-modal .login-floaters {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.user-modal .floater {
    --o: 0.36;
    position: absolute;
    left: var(--x);
    top: var(--y);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6em 0.75em;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    line-height: 1;
    white-space: nowrap;
    color: #8ff0a8;
    background: rgba(8, 22, 36, 0.62);
    border: 2px solid rgba(123, 190, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(8, 22, 36, 0.4), 0 8px 18px rgba(0, 0, 0, 0.28);
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: floater-drift var(--d, 28s) ease-in-out var(--delay, 0s) infinite;
}

.user-modal .floater i {
    font-size: 0.95rem;
}

.user-modal .floater-a { --x: 12%; --y: 20%; --d: 26s; --delay: -6s;  --tilt: -2deg; }
.user-modal .floater-b { --x: 24%; --y: 68%; --d: 32s; --delay: -18s; --tilt: 3deg;  --o: 0.32; }
.user-modal .floater-c { --x: 7%;  --y: 46%; --d: 29s; --delay: -11s; --tilt: 2deg;  --o: 0.38; }
.user-modal .floater-d { --x: 88%; --y: 24%; --d: 34s; --delay: -3s;  --tilt: -3deg; --o: 0.34; }
.user-modal .floater-e { --x: 78%; --y: 62%; --d: 27s; --delay: -21s; --tilt: -2deg; }
.user-modal .floater-f { --x: 92%; --y: 48%; --d: 31s; --delay: -9s;  --tilt: 2deg;  --o: 0.3;  }
.user-modal .floater-g { --x: 17%; --y: 86%; --d: 36s; --delay: -14s; --tilt: -1deg; --o: 0.4;  }
.user-modal .floater-h { --x: 71%; --y: 87%; --d: 30s; --delay: -24s; --tilt: 3deg;  --o: 0.34; }
.user-modal .floater-i { --x: 46%; --y: 8%;  --d: 33s; --delay: -16s; --tilt: -3deg; --o: 0.34; }

@keyframes floater-drift {
    0% {
        transform: translate(-50%, -50%) translateY(16px) rotate(var(--tilt, 0deg));
        opacity: 0;
    }
    14% {
        opacity: var(--o);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-16px) rotate(calc(var(--tilt, 0deg) * -1));
    }
    86% {
        opacity: var(--o);
    }
    100% {
        transform: translate(-50%, -50%) translateY(16px) rotate(var(--tilt, 0deg));
        opacity: 0;
    }
}

/* Pantallas cortas: el formulario cabe sin recortes */
@media (max-height: 660px) {
    .pixel-theme .user-modal-content {
        padding: 22px 24px 20px !important;
    }

    .pixel-theme .user-modal-content p {
        margin-bottom: 16px !important;
    }

    .pixel-theme .user-modal-content .form-group {
        margin-bottom: 14px !important;
    }

    .pixel-theme .user-modal-content .form-actions {
        margin-top: 18px !important;
    }
}

/* Móvil: solo los chips que quedan fuera de la tarjeta */
@media (max-width: 640px) {
    .user-modal .floater-b,
    .user-modal .floater-c,
    .user-modal .floater-d,
    .user-modal .floater-e,
    .user-modal .floater-f {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .user-modal .floater {
        animation: none !important;
        opacity: var(--o);
    }
}

/* Overrides página principal - eliminar estilos viejos fosforescentes */
.pixel-theme .game-container {
    background: transparent;
}

.pixel-theme .stat-item,
.pixel-theme .control-group {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0.25em;
}

.pixel-theme .control-group {
    border: 1px solid rgba(93, 64, 55, 0.3);
}

/* Asegurar que nada se corte - overflow */
.pixel-theme .game-container,
.pixel-theme main {
    overflow-x: hidden;
}

.pixel-theme .col-commands,
.pixel-theme .col-drag,
.pixel-theme .col-map,
.pixel-theme .col-annotations {
    overflow-x: hidden;
}
