/* ======================================== */
/* ===== PALETA MINIMALISTA PASTEL (v2) ==== */
/* ======================================== */
:root {
    --text-dark: #312c27;
    --text-light: #ffffff;
    --pastel-red: #db3c41;
    --pastel-yellow: #ffd670;
    --sky-blue: #70d6ff;
}

/* ======================================== */
/* ============== ESTILOS GENERALES ======== */
/* ======================================== */
body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-image: url('fondo.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.page-background { display: none; }

/* ======================================== */
/* ===== PANEL DE BIENVENIDA (GATE) ====== */
/* ======================================== */
.gate-wrapper {
    position: relative;
    width: 90%;
    max-width: 400px;
    /* 1. AÑADIMOS LA ANIMACIÓN DE LEVITACIÓN AQUÍ */
    animation: levitate 6s ease-in-out infinite;
}

.gate-container {
    background-color: var(--pastel-red);
    padding: 30px;
    padding-top: 60px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.card-logo {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: #fff;
    padding: 10px; box-sizing: border-box;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}
.gate-container h2, .gate-container p { color: var(--text-light); }
.gate-container h2 { font-family: 'Orbitron', sans-serif; margin: 0 0 10px 0; }
.gate-container p { opacity: 0.9; }
.gate-container input { width: 100%; padding: 12px; border-radius: 8px; border: none; background: rgba(0,0,0,0.1); color: var(--text-light); box-sizing: border-box; margin: 15px 0; text-align: center; font-size: 1.2em; }
.gate-container input::placeholder { color: rgba(255, 255, 255, 0.6); }
.gate-container input:focus { outline: 2px solid var(--sky-blue); }
.gate-container button { padding: 12px 25px; border: none; border-radius: 8px; background-color: var(--pastel-yellow); color: var(--text-dark); font-weight: bold; cursor: pointer; transition: transform 0.2s; }
.gate-container button:hover { transform: scale(1.05); }
.error-message { color: var(--text-dark); font-weight: bold; min-height: 1.2em; }

/* ======================================== */
/* ===== TARJETA DE LEALTAD (ACTUALIZADA) ========== */
/* ======================================== */
#pinGate { display: none; }
#loyaltyCard {
    display: none;
    /* 2. AÑADIMOS LA MISMA ANIMACIÓN DE LEVITACIÓN AQUÍ */
    animation: levitate 6s ease-in-out infinite;
}

.loyalty-card { width: 100%; max-width: 380px; text-align: center; perspective: 1500px; }
.loyalty-card-inner {
    position: relative;
    width: 100%;
    
    /* === LA LÍNEA MÁGICA QUE SOLUCIONA TODO === */
    aspect-ratio: 380 / 300; /* Proporción ancho/alto. ¡Puedes ajustar el 520! */

    transition: transform 0.8s;
    transform-style: preserve-3d;
    border-radius: 18px;
}
.loyalty-card .card-logo { z-index: 1; }
.loyalty-card-front, .loyalty-card-back { width: 100%; height: 100%; border-radius: 20px; backface-visibility: hidden; box-sizing: border-box; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.loyalty-card-front { background-color: var(--pastel-red); color: var(--text-light); }
.loyalty-card-front header { padding: 20px; padding-top: 70px; position: relative; }
.header-text h1, .header-text p { color: var(--text-light); }
.header-text h1 { font-family: 'Orbitron', sans-serif; font-size: 1.2em; margin: 0; }
.header-text p { opacity: 0.8; margin: 5px 0 0; }
.spots-container { display: flex; justify-content: space-around; padding: 25px 30px; }
.scratch-spot { position: relative; width: 50px; height: 50px; border-radius: 50%; background: rgba(0,0,0,0.1); box-shadow: inset 0 2px 4px rgba(0,0,0,0.15); display: flex; justify-content: center; align-items: center; }
.spot-cover { display: none; }
.scratch-spot.is-scratched { background-color: var(--pastel-yellow); }
.spot-prize { width: 70%; height: 70%; opacity: 0; transform: scale(0.3); transition: all 0.5s ease-out; }
.scratch-spot.is-scratched .spot-prize { opacity: 1; transform: scale(1); }
.scratch-spot.disabled { background: rgba(0,0,0,0.1); cursor: not-allowed; }
.loyalty-card-back {
    /* --- Estructura y Posición --- */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* --- Flexbox para alinear contenido --- */
    display: flex;
    flex-direction: column;
    align-items: center;

    /* === ¡AQUÍ ESTÁ EL CAMBIO MÁGICO! === */
    justify-content: flex-start; /* Esto mueve todo el contenido hacia arriba */

    /* --- Espaciado Interno (Padding) --- */
    padding: 60px 20px 20px 20px; 
    box-sizing: border-box;

    /* --- Estilos Visuales y de Animación --- */
    background: var(--pastel-red);
    color: var(--text-light);
    border-radius: 20px;
    transform: rotateY(180deg);
    backface-visibility: hidden;
}

/* ASEGÚRATE DE TENER TAMBIÉN ESTA REGLA PARA EL TEXTO PEQUEÑO */
.loyalty-card-back small {
    margin-top: 5px; /* Crea una separación con la caja del premio */
    font-size: 0.9em;
    opacity: 0.9;
    text-align: center; /* Asegura que esté centrado si el texto ocupa más de una línea */
}

.prize-highlight {
    font-size: 1.8em; /* <-- MÁS PEQUEÑO */
    font-weight: bold;
    margin: 15px 0;
    padding: 10px 20px; /* <-- CAJA MÁS PEQUEÑA */
    border-radius: 10px;
    background-color: var(--pastel-yellow);
    color: var(--text-dark);
    line-height: 1.2;
}

.loyalty-card.is-flipped .loyalty-card-inner { transform: rotateY(180deg); }

@media (max-width: 600px) {
    .gate-wrapper, .loyalty-card { width: 100%; max-width: none; }
    .card-logo { width: 80px; height: 80px; top: -40px; }
    .gate-container { padding: 20px; padding-top: 50px; }
    .loyalty-card-front { padding-top: 0; }
}

.loyalty-card-front footer {
    /* Sin fondo - texto integrado a la tarjeta */
    background: none;
    color: var(--text-light); /* Texto blanco para que contraste con el fondo rojo */
    
    /* Padding reducido para mejor integración */
    padding: 0 20px 20px 20px; /* Solo padding lateral y abajo */
    font-size: 0.75em;
    text-align: center;
    opacity: 0.9; /* Ligeramente transparente para suavizar */
}
/* ======================================== */
/* ============== 3. ANIMACIÓN DE LEVITACIÓN ============== */
/* ======================================== */
@keyframes levitate {
    0% {
        transform: translateY(0px) rotateY(-2deg);
    }
    50% {
        transform: translateY(-15px) rotateY(2deg);
    }
    100% {
        transform: translateY(0px) rotateY(-2deg);
    }
}


.main-footer {
    /* --- LA MAGIA ESTÁ AQUÍ --- */
    position: absolute; /* Lo sacamos del flujo normal de la página */
    bottom: 0;          /* Lo anclamos a la parte de abajo */
    width: 100%;        /* Hacemos que ocupe todo el ancho */

    /* --- ESTILOS VISUALES --- */
    background-color: transparent; /* Hacemos el fondo transparente */
    padding: 30px 20px;            /* Espacio para que no quede pegado al borde */
    text-align: center;            /* Centra el logo horizontalmente */
    z-index: 10;                   /* Nos aseguramos de que esté por encima del fondo */
}

/* El enlace que envuelve la imagen */
.creator-credit {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Efecto de zoom al pasar el ratón */
.creator-credit:hover {
    transform: scale(1.05);
}

/* Estilos para tu imagen/logo */
.creator-logo {
    display: block;
    height: auto;
    max-width: 180px; /* Puedes ajustar este tamaño si quieres */
}

.loyalty-card-back h2 {
    margin-top: -5px;  /* Sube el título 15 píxeles */
    margin-bottom: 5px; /* Reduce el espacio debajo de él */
}

/* Esta regla controlará el texto "Has ganado:" */
.loyalty-card-back p {
    margin-top: 0;      /* Quita cualquier espacio superior por defecto */
    margin-bottom: 10px;/* Define el espacio antes de la caja del premio */
}

/* Esta regla reemplaza la que ya tenías para "Muestra esta pantalla..." */
.loyalty-card-back small {
    margin-top: 25px; /* Empuja el texto hacia abajo, separándolo del premio */
    font-size: 0.9em;
    opacity: 0.9;
    text-align: center;
}