/* LOTBA - Tu mejor jugada - Estilos CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: #00BFFF;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* =================================
   FONDOS DINÁMICOS
================================= */

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.background-mobile,
.background-desktop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.3s ease;
}

/* Fondo para móviles (vertical) */
@media (max-width: 768px) {
    .background-mobile {
        display: block;
        /* Imagen PNG vertical desde carpeta imagenes */
        background-image: url('imagenes/FondoCel.png');
    }
    .background-desktop {
        display: none;
    }
}

/* Fondo para escritorio (horizontal) */
@media (min-width: 769px) {
    .background-desktop {
        display: block;
        /* Imagen PNG horizontal desde carpeta imagenes */
        background-image: url('imagenes/FOndopc.png');
    }
    .background-mobile {
        display: none;
    }
}

/* =================================
   CUADRADOS ANIMADOS SOLO EN COSTADOS
================================= */

.animated-squares {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.square {
    position: absolute;
    border-radius: 8px;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.shape {
    position: absolute;
    font-size: 24px;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =================================
   COSTADO IZQUIERDO - MÁS COLORES
================================= */

.square-left-1 {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #FF1493, #FF69B4); /* Fucsia intenso */
    top: 8%;
    left: 2%;
    animation: floatLeft1 6s ease-in-out infinite;
}

.square-left-2 {
    width: 45px;
    height: 45px;
    background: linear-gradient(45deg, #9400D3, #8A2BE2); /* Violeta */
    top: 25%;
    left: 1%;
    animation: floatLeft2 7s ease-in-out infinite;
}

.square-left-3 {
    width: 55px;
    height: 55px;
    background: linear-gradient(45deg, #FF4500, #FF6347); /* Naranja-rojo */
    top: 45%;
    left: 3%;
    animation: floatLeft3 8s ease-in-out infinite;
}

.square-left-4 {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #FF1493, #C71585); /* Fucsia profundo */
    top: 65%;
    left: 1.5%;
    animation: floatLeft4 5.5s ease-in-out infinite;
}

.square-left-5 {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #FFD700, #FFA500); /* Dorado */
    top: 80%;
    left: 2.5%;
    animation: floatLeft5 6.5s ease-in-out infinite;
}

.square-left-6 {
    width: 48px;
    height: 48px;
    background: linear-gradient(45deg, #E6007E, #FF1493); /* Rosa shocking */
    top: 15%;
    left: 0.5%;
    animation: floatLeft6 7.5s ease-in-out infinite;
}

.square-left-7 {
    width: 35px;
    height: 35px;
    background: linear-gradient(45deg, #00CED1, #40E0D0); /* Turquesa */
    top: 55%;
    left: 0.8%;
    animation: floatLeft7 5.8s ease-in-out infinite;
}

/* =================================
   COSTADO DERECHO - MÁS COLORES
================================= */

.square-right-1 {
    width: 58px;
    height: 58px;
    background: linear-gradient(45deg, #FF1493, #FF69B4); /* Fucsia intenso */
    top: 12%;
    right: 2%;
    animation: floatRight1 6.2s ease-in-out infinite;
}

.square-right-2 {
    width: 42px;
    height: 42px;
    background: linear-gradient(45deg, #8A2BE2, #9370DB); /* Violeta claro */
    top: 28%;
    right: 1%;
    animation: floatRight2 7.2s ease-in-out infinite;
}

.square-right-3 {
    width: 52px;
    height: 52px;
    background: linear-gradient(45deg, #FF4500, #FF8C00); /* Naranja */
    top: 48%;
    right: 3%;
    animation: floatRight3 8.2s ease-in-out infinite;
}

.square-right-4 {
    width: 46px;
    height: 46px;
    background: linear-gradient(45deg, #FF1493, #C71585); /* Fucsia profundo */
    top: 68%;
    right: 1.5%;
    animation: floatRight4 5.3s ease-in-out infinite;
}

.square-right-5 {
    width: 38px;
    height: 38px;
    background: linear-gradient(45deg, #FFD700, #DAA520); /* Dorado oscuro */
    top: 85%;
    right: 2.5%;
    animation: floatRight5 6.8s ease-in-out infinite;
}

.square-right-6 {
    width: 44px;
    height: 44px;
    background: linear-gradient(45deg, #E6007E, #FF1493); /* Rosa shocking */
    top: 18%;
    right: 0.5%;
    animation: floatRight6 7.8s ease-in-out infinite;
}

.square-right-7 {
    width: 36px;
    height: 36px;
    background: linear-gradient(45deg, #00CED1, #48D1CC); /* Turquesa medio */
    top: 58%;
    right: 0.8%;
    animation: floatRight7 5.6s ease-in-out infinite;
}

/* =================================
   FORMAS ESPECIALES
================================= */

.trebol-1 {
    top: 20%;
    left: 4%;
    color: #32CD32;
    text-shadow: 0 0 10px #32CD32;
    animation: floatTrebol1 4s ease-in-out infinite;
}

.trebol-2 {
    top: 70%;
    right: 4%;
    color: #228B22;
    text-shadow: 0 0 10px #228B22;
    animation: floatTrebol2 5s ease-in-out infinite;
}

.trebol-3 {
    bottom: 20%;
    left: 5%;
    color: #00FF00;
    text-shadow: 0 0 10px #00FF00;
    animation: floatTrebol3 4.5s ease-in-out infinite;
}

.luna-1 {
    top: 35%;
    left: 6%;
    color: #FFD700;
    text-shadow: 0 0 15px #FFD700;
    animation: floatLuna1 6s ease-in-out infinite;
}

.luna-2 {
    bottom: 35%;
    right: 6%;
    color: #FFA500;
    text-shadow: 0 0 15px #FFA500;
    animation: floatLuna2 7s ease-in-out infinite;
}

/* =================================
   ANIMACIONES COSTADO IZQUIERDO
================================= */

@keyframes floatLeft1 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(-30px) translateX(10px) rotate(180deg); }
}

@keyframes floatLeft2 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(25px) translateX(15px) rotate(90deg); }
}

@keyframes floatLeft3 {
    0%, 100% { transform: translateY(0px) translateX(0px) scale(1); }
    50% { transform: translateY(-20px) translateX(8px) scale(1.2); }
}

@keyframes floatLeft4 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(35px) translateX(12px) rotate(-90deg); }
}

@keyframes floatLeft5 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(-25px) translateX(18px) rotate(270deg); }
}

@keyframes floatLeft6 {
    0%, 100% { transform: translateY(0px) translateX(0px) scale(1); }
    50% { transform: translateY(20px) translateX(10px) scale(0.8); }
}

@keyframes floatLeft7 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(-15px) translateX(20px) rotate(45deg); }
}

/* =================================
   ANIMACIONES COSTADO DERECHO
================================= */

@keyframes floatRight1 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(-25px) translateX(-12px) rotate(-180deg); }
}

@keyframes floatRight2 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(30px) translateX(-8px) rotate(-90deg); }
}

@keyframes floatRight3 {
    0%, 100% { transform: translateY(0px) translateX(0px) scale(1); }
    50% { transform: translateY(-18px) translateX(-15px) scale(1.3); }
}

@keyframes floatRight4 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(22px) translateX(-10px) rotate(90deg); }
}

@keyframes floatRight5 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(-28px) translateX(-18px) rotate(-270deg); }
}

@keyframes floatRight6 {
    0%, 100% { transform: translateY(0px) translateX(0px) scale(1); }
    50% { transform: translateY(18px) translateX(-12px) scale(0.9); }
}

@keyframes floatRight7 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(-22px) translateX(-20px) rotate(-45deg); }
}

/* =================================
   ANIMACIONES FORMAS ESPECIALES
================================= */

@keyframes floatTrebol1 {
    0%, 100% { transform: translateY(0px) scale(1) rotate(0deg); }
    50% { transform: translateY(-20px) scale(1.2) rotate(180deg); }
}

@keyframes floatTrebol2 {
    0%, 100% { transform: translateY(0px) scale(1) rotate(0deg); }
    50% { transform: translateY(15px) scale(1.1) rotate(-90deg); }
}

@keyframes floatTrebol3 {
    0%, 100% { transform: translateY(0px) scale(1) rotate(0deg); }
    50% { transform: translateY(-25px) scale(1.3) rotate(270deg); }
}

@keyframes floatLuna1 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(-30px) translateX(15px) rotate(45deg); }
}

@keyframes floatLuna2 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(25px) translateX(-15px) rotate(-45deg); }
}

/* =================================
   ANIMACIÓN MÁGICA DE BÚSQUEDA - NUEVOS CUADRADOS
================================= */

/* FASE 1: Todos los cuadrados y formas se mueven al centro */
.searching .square,
.searching .shape {
    animation: moveToCenter 1s ease-in-out forwards;
    z-index: 1000;
}

@keyframes moveToCenter {
    0% {
        /* Mantener posición original */
    }
    100% {
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) scale(0.8) rotate(360deg);
    }
}

/* FASE 2: Explosión y movimiento caótico */
.searching.phase-2 .square,
.searching.phase-2 .shape {
    animation: chaosMovement 2s ease-in-out infinite;
}

@keyframes chaosMovement {
    0% {
        transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
    }
    25% {
        transform: translate(calc(-50% + 150px), calc(-50% - 120px)) scale(1.4) rotate(90deg);
    }
    50% {
        transform: translate(calc(-50% - 180px), calc(-50% + 100px)) scale(0.5) rotate(180deg);
    }
    75% {
        transform: translate(calc(-50% + 120px), calc(-50% + 150px)) scale(1.6) rotate(270deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8) rotate(360deg);
    }
}

/* FASE 3: Regreso a posiciones originales */
.searching.phase-3 .square-left-1 { animation: returnToLeft1 1.5s ease-out forwards; }
.searching.phase-3 .square-left-2 { animation: returnToLeft2 1.5s ease-out forwards; }
.searching.phase-3 .square-left-3 { animation: returnToLeft3 1.5s ease-out forwards; }
.searching.phase-3 .square-left-4 { animation: returnToLeft4 1.5s ease-out forwards; }
.searching.phase-3 .square-left-5 { animation: returnToLeft5 1.5s ease-out forwards; }
.searching.phase-3 .square-left-6 { animation: returnToLeft6 1.5s ease-out forwards; }
.searching.phase-3 .square-left-7 { animation: returnToLeft7 1.5s ease-out forwards; }

.searching.phase-3 .square-right-1 { animation: returnToRight1 1.5s ease-out forwards; }
.searching.phase-3 .square-right-2 { animation: returnToRight2 1.5s ease-out forwards; }
.searching.phase-3 .square-right-3 { animation: returnToRight3 1.5s ease-out forwards; }
.searching.phase-3 .square-right-4 { animation: returnToRight4 1.5s ease-out forwards; }
.searching.phase-3 .square-right-5 { animation: returnToRight5 1.5s ease-out forwards; }
.searching.phase-3 .square-right-6 { animation: returnToRight6 1.5s ease-out forwards; }
.searching.phase-3 .square-right-7 { animation: returnToRight7 1.5s ease-out forwards; }

.searching.phase-3 .trebol-1 { animation: returnToTrebol1 1.5s ease-out forwards; }
.searching.phase-3 .trebol-2 { animation: returnToTrebol2 1.5s ease-out forwards; }
.searching.phase-3 .trebol-3 { animation: returnToTrebol3 1.5s ease-out forwards; }

@keyframes returnToLeft1 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 8%; left: 2%; transform: none; }
}

@keyframes returnToLeft2 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 25%; left: 1%; transform: none; }
}

@keyframes returnToLeft3 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 45%; left: 3%; transform: none; }
}

@keyframes returnToLeft4 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 65%; left: 1.5%; transform: none; }
}

@keyframes returnToLeft5 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 80%; left: 2.5%; transform: none; }
}

@keyframes returnToLeft6 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 15%; left: 0.5%; transform: none; }
}

@keyframes returnToLeft7 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 55%; left: 0.8%; transform: none; }
}

@keyframes returnToRight1 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 12%; right: 2%; left: auto; transform: none; }
}

@keyframes returnToRight2 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 28%; right: 1%; left: auto; transform: none; }
}

@keyframes returnToRight3 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 48%; right: 3%; left: auto; transform: none; }
}

@keyframes returnToRight4 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 68%; right: 1.5%; left: auto; transform: none; }
}

@keyframes returnToRight5 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 85%; right: 2.5%; left: auto; transform: none; }
}

@keyframes returnToRight6 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 18%; right: 0.5%; left: auto; transform: none; }
}

@keyframes returnToRight7 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 58%; right: 0.8%; left: auto; transform: none; }
}

@keyframes returnToTrebol1 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 20%; left: 4%; transform: none; }
}

@keyframes returnToTrebol2 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { top: 70%; right: 4%; left: auto; transform: none; }
}

@keyframes returnToTrebol3 {
    from { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    to { bottom: 20%; left: 5%; top: auto; transform: none; }
}

/* =================================
   CONTENEDOR PRINCIPAL
================================= */

.main-container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* =================================
   LOGO HEADER MEJORADO PARA MÓVIL
================================= */

.logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px 0;
    margin-bottom: 25px;
    position: relative;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    max-width: 500px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo-18 {
    max-width: 80px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    opacity: 0.9;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* =================================
   SECCIONES PRIORIZADAS
================================= */

.priority-section {
    order: 1; /* Los números van primero */
    margin-bottom: 40px;
    border: 3px solid #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
    animation: priorityGlow 2s ease-in-out infinite alternate;
}

@keyframes priorityGlow {
    from { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    to { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6); }
}

.priority-title {
    font-size: 28px;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: titlePulse 1.5s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.secondary-section {
    order: 2; /* La interpretación va después */
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.secondary-title {
    font-size: 22px;
    color: #87CEEB;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.input-section {
    margin-bottom: 40px;
    margin-top: 20px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.dream-group {
    grid-column: 1 / -1;
}

.input-group {
    position: relative;
}

.input-field {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.input-field:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 0 3px rgba(255, 215, 0, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.dream-input {
    min-height: 120px;
    resize: vertical;
}

/* =================================
   BOTÓN PRINCIPAL
================================= */

.button-container {
    text-align: center;
    margin-top: 30px;
}

.interpret-btn {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 6px 20px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.interpret-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(255, 215, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.interpret-btn:active {
    transform: translateY(-1px);
}

.interpret-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =================================
   SECCIÓN DE NÚMEROS
================================= */

.numbers-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.6s ease-out;
}

.section-title {
    text-align: center;
    font-size: 26px;
    margin-bottom: 25px;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.number-card {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    text-align: center;
    overflow: hidden;
}

.number-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
}

.game-logo {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
}

.logo-img-game {
    max-height: 45px;
    max-width: 200px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.number-card:hover .logo-img-game {
    transform: scale(1.05);
}

.game-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.game-numbers {
    font-size: 22px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* =================================
   SECCIÓN DE INTERPRETACIÓN
================================= */

.interpretation-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.6s ease-out;
}

.interpretation-text {
    font-size: 18px;
    line-height: 1.8;
    color: white;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* =================================
   SECCIÓN DE RESULTADOS COMPACTA
================================= */

.results-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: smoothSlideIn 0.5s ease-out;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-title {
    font-size: 24px;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.dream-summary {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    margin-bottom: 20px;
}

/* =================================
   BOTÓN NUEVO SUEÑO
================================= */

.new-dream-section {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-top: 20px;
}

.new-dream-btn {
    background: linear-gradient(45deg, #32CD32, #228B22);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(50, 205, 50, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.new-dream-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 205, 50, 0.4);
    background: linear-gradient(45deg, #228B22, #32CD32);
}

.new-dream-btn:active {
    transform: translateY(0);
}

/* =================================
   NOTIFICACIONES
================================= */

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 10px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    background: linear-gradient(45deg, #4CAF50, #45a049);
}

.notification.error {
    background: linear-gradient(45deg, #f44336, #d32f2f);
}

.notification.info {
    background: linear-gradient(45deg, #2196F3, #1976D2);
}

/* =================================
   ESTADOS DE LA PÁGINA
================================= */

/* Estado inicial - formulario visible */
.page-state-form .input-section {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.page-state-form .results-section {
    display: none;
}

/* Estado resultados - formulario oculto */
.page-state-results .input-section {
    display: none;
}

.page-state-results .results-section {
    display: block;
    animation: slideInUp 0.6s ease-out;
}

/* =================================
   ANIMACIONES
================================= */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes smoothSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* =================================
   RESPONSIVE MEJORADO PARA MÓVIL
================================= */

@media (max-width: 768px) {
    .logo-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 10px 0;
        margin-bottom: 20px;
    }
    
    .logo-container {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .logo-img {
        max-width: 250px; /* Más pequeño en móvil */
    }
    
    .logo-18 {
        max-width: 45px; /* Más pequeño en móvil */
        align-self: flex-end;
        margin-right: 10px;
    }
    
    /* Inputs mejorados para móvil */
    .input-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 5px;
    }
    
    .input-field {
        padding: 14px 16px;
        font-size: 16px; /* Evita zoom en iOS */
        border-radius: 10px;
        min-height: 50px; /* Altura mínima touch-friendly */
    }
    
    .dream-input {
        min-height: 100px; /* Más compacto */
        max-height: 150px; /* Limitar altura máxima */
    }
    
    .main-container {
        padding: 10px 15px;
    }
    
    /* Botón mejorado */
    .interpret-btn {
        width: 100%;
        padding: 16px 20px;
        font-size: 16px;
        margin-top: 15px;
    }
    
    /* Secciones más compactas */
    .numbers-section,
    .interpretation-section,
    .results-section {
        padding: 20px 15px;
        margin-bottom: 15px;
        border-radius: 15px;
    }
    
    .section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .priority-title {
        font-size: 22px;
    }
    
    .secondary-title {
        font-size: 18px;
    }
    
    /* Grid de números más compacto */
    .numbers-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .number-card {
        padding: 15px;
        border-radius: 12px;
    }
    
    .game-numbers {
        font-size: 18px;
    }
    
    .logo-img-game {
        max-height: 35px;
    }
    
    /* Notificaciones mejoradas */
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        width: 100%;
        text-align: center;
        font-size: 14px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        max-width: 200px; /* Aún más pequeño */
    }
    
    .logo-18 {
        max-width: 35px;
    }
    
    .input-field {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .dream-input {
        min-height: 80px;
        max-height: 120px;
    }
    
    .interpret-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .main-container {
        padding: 8px 12px;
    }
    
    .numbers-section,
    .interpretation-section,
    .results-section {
        padding: 15px 12px;
    }
}

/* Responsive logo sizes para desktop */
@media (min-width: 1200px) {
    .logo-img {
        max-width: 600px; /* Aún más grande en pantallas grandes */
    }
    .logo-18 {
        max-width: 90px;
    }
}

/* =================================
   MEJORAS ADICIONALES PARA TÁCTIL
================================= */

@media (hover: none) and (pointer: coarse) {
    /* Estilos específicos para dispositivos táctiles */
    
    .input-field:focus {
        transform: none; /* Eliminar movimiento en móvil */
        border-color: #FFD700;
        box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
    }
    
    .interpret-btn:hover {
        transform: none; /* Eliminar hover en móvil */
    }
    
    .interpret-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .number-card:hover {
        transform: none; /* Eliminar hover en móvil */
    }
    
    /* Mejorar área de toque */
    .new-dream-btn {
        min-height: 48px;
        padding: 16px 24px;
    }
}

/* =================================
   TRANSICIONES SUAVES
================================= */

.input-section,
.results-section {
    transition: all 0.4s ease-in-out;
}

/* Estado cuando se muestran resultados */
.page-state-results .main-container {
    transform: none;
    transition: transform 0.3s ease;
}

/* Animación escalonada para las tarjetas */
.number-card:nth-child(1) { animation-delay: 0.1s; }
.number-card:nth-child(2) { animation-delay: 0.2s; }
.number-card:nth-child(3) { animation-delay: 0.3s; }
.number-card:nth-child(4) { animation-delay: 0.4s; }
.number-card:nth-child(5) { animation-delay: 0.5s; }
.number-card:nth-child(6) { animation-delay: 0.6s; }

/* =================================
   MODO BÚSQUEDA ACTIVA
================================= */

.searching {
    transition: all 0.3s ease;
}

.searching .square {
    animation-duration: 0.5s !important;
}

.searching .input-field {
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}
/* =================================
   MEJORAS PARA MÓVIL E iOS - VERSIÓN CORREGIDA
   AGREGAR AL FINAL DE TU styles.css
================================= */

/* ===== OPTIMIZACIONES ESPECÍFICAS POR DISPOSITIVO ===== */

/* iOS iPhone/iPad */
.ios-device {
    -webkit-overflow-scrolling: touch;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden; /* Propiedad estándar */
    -webkit-perspective: 1000;
    perspective: 1000px; /* Propiedad estándar */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0); /* Propiedad estándar */
}

.ios-device * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.ios-device input,
.ios-device textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Android Chrome */
.android-device {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

.android-device input,
.android-device textarea,
.android-device button {
    touch-action: manipulation;
}

/* Móvil genérico */
.mobile-device {
    overflow-x: hidden;
}

.mobile-device .square {
    transform: scale(0.8);
    will-change: transform;
}

/* ===== MEJORAS EN EL LOGO HEADER ===== */

.logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
    /* Mejoras para móvil */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden; /* Propiedad estándar */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Mejorar rendimiento en móvil */
    -webkit-transform: translateZ(0);
    transform: translateZ(0); /* Propiedad estándar */
}

.logo-img {
    max-width: 500px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    /* Optimizaciones para móvil */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden; /* Propiedad estándar */
}

.logo-18 {
    max-width: 80px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    opacity: 0.9;
    /* Optimizaciones para móvil */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden; /* Propiedad estándar */
}

/* ===== ESTADOS DE LA PÁGINA MEJORADOS ===== */

/* Estado inicial - formulario visible */
.page-state-form .input-section {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
    /* Optimización para móvil */
    will-change: opacity, transform;
}

.page-state-form .results-section {
    display: none;
}

/* Estado resultados - formulario oculto */
.page-state-results .input-section {
    display: none;
}

.page-state-results .results-section {
    display: block;
    animation: slideInUp 0.6s ease-out;
    /* Optimización para móvil */
    will-change: opacity, transform;
}

/* ===== SECCIÓN DE RESULTADOS MEJORADA ===== */

.results-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    /* Mejoras para móvil */
    will-change: opacity, transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden; /* Propiedad estándar */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
    /* Optimización para móvil */
    will-change: transform;
}

.results-title {
    font-size: 24px;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    /* Animación suave para móvil */
    animation: titlePulse 2s ease-in-out infinite;
}

.dream-summary {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    margin-bottom: 20px;
    /* Mejorar legibilidad en móvil */
    line-height: 1.4;
}

/* ===== BOTÓN NUEVO SUEÑO MEJORADO ===== */

.new-dream-section {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-top: 20px;
    /* Optimización para móvil */
    will-change: transform;
}

.new-dream-btn {
    background: linear-gradient(45deg, #32CD32, #228B22);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(50, 205, 50, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    /* Mejoras para móvil */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    will-change: transform, box-shadow;
    min-height: 44px; /* Tamaño mínimo táctil */
    min-width: 200px;
}

.new-dream-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 205, 50, 0.4);
    background: linear-gradient(45deg, #228B22, #32CD32);
}

.new-dream-btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* ===== LOGOS DE JUEGOS MEJORADOS ===== */

.game-logo {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    /* Optimización para móvil */
    will-change: transform;
}

.logo-img-game {
    max-height: 45px;
    max-width: 200px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    /* Mejoras para móvil */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden; /* Propiedad estándar */
}

.number-card {
    /* Mejoras existentes más optimizaciones */
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden; /* Propiedad estándar */
    transition: all 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.number-card:hover .logo-img-game {
    transform: scale(1.05);
}

/* Fallback para cuando no carga la imagen */
.game-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    /* Optimización para móvil */
    will-change: transform;
}

/* ===== RESPONSIVE MEJORADO ===== */

/* Tamaños de logo responsive mejorados */
@media (min-width: 1200px) {
    .logo-img {
        max-width: 600px;
    }
    .logo-18 {
        max-width: 90px;
    }
}

@media (max-width: 768px) {
    .logo-img {
        max-width: 350px;
    }
    .logo-18 {
        max-width: 60px;
    }
    
    /* Optimizaciones específicas para móvil */
    .results-section {
        padding: 20px;
        border-radius: 15px;
    }
    
    .results-title {
        font-size: 20px;
    }
    
    .dream-summary {
        font-size: 14px;
    }
    
    .new-dream-btn {
        width: 100%;
        max-width: 300px;
        padding: 18px 20px;
        font-size: 15px;
    }
    
    /* Mejorar números en móvil */
    .numbers-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .number-card {
        padding: 15px;
    }
    
    .game-numbers {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        max-width: 280px;
    }
    .logo-18 {
        max-width: 50px;
    }
    
    .logo-container {
        gap: 10px;
    }
    
    .results-section {
        padding: 15px;
        margin: 0 10px 20px 10px;
    }
    
    .results-title {
        font-size: 18px;
    }
    
    .dream-summary {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .new-dream-btn {
        padding: 16px 15px;
        font-size: 14px;
        min-width: 250px;
    }
}

/* ===== OPTIMIZACIONES DE PERFORMANCE PARA MÓVIL ===== */

/* Reducir animaciones en móviles de baja potencia */
@media (prefers-reduced-motion: reduce) {
    .square,
    .shape,
    .number-card,
    .logo-img,
    .logo-18 {
        animation: none !important;
        transition: none !important;
    }
}

/* Optimizaciones para pantallas de alta densidad */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img,
    .logo-18,
    .logo-img-game {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== MEJORAS EN TRANSICIONES ===== */

/* Transición suave para cambio de estado */
.input-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
}

/* Animación de entrada para resultados */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Pulso suave para el título */
@keyframes titlePulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.02); 
        opacity: 0.9; 
    }
}

/* ===== MEJORAS EN NOTIFICACIONES PARA MÓVIL ===== */

.notification {
    /* Mejoras existentes más optimizaciones móvil */
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden; /* Propiedad estándar */
    /* Mejor tamaño táctil para móvil */
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        z-index: 9999;
    }
    
    .notification {
        width: 100%;
        margin-bottom: 5px;
        border-radius: 8px;
        font-size: 14px;
        padding: 12px 15px;
    }
}

/* ===== SCROLL SUAVE MEJORADO ===== */

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Mejorar scroll en iOS */
.ios-device {
    -webkit-overflow-scrolling: touch;
}

/* ===== MODO OSCURO AUTOMÁTICO (OPCIONAL) ===== */

@media (prefers-color-scheme: dark) {
    .results-section,
    .new-dream-section {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .dream-summary {
        color: rgba(255, 255, 255, 0.8);
    }
}

/* ===== INDICADORES DE DISPOSITIVO (PARA DEBUGGING) ===== */

/* Indicador visual de dispositivo (solo para desarrollo) */
.ios-device::before {
    content: "🍎 iOS";
    position: fixed;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    z-index: 9999;
    pointer-events: none;
}

.android-device::before {
    content: "🤖 Android";
    position: fixed;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    z-index: 9999;
    pointer-events: none;
}

.mobile-device::before {
    content: "📱 Móvil";
    position: fixed;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    z-index: 9999;
    pointer-events: none;
}

/* Ocultar indicadores en producción */
/* 
Descomenta estas líneas para ocultar los indicadores de dispositivo:
.ios-device::before,
.android-device::before,
.mobile-device::before {
    display: none;
}
*/