:root {
    --primary-blue: #43A1D5; /* Celeste Argentina */
    --primary-blue-dark: #2c729c;
    --white: #FFFFFF;
    --gold: #D4AF37;
    --gold-light: #F3E5AB;
    --dark-bg: #111827; /* Dark mode base */
    --text-dark: #1F2937;
    --text-light: #F9FAFB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    font-family: 'Outfit', sans-serif;
}

/* Background stadium container */
#stadium-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    background-image: url('images/stadium.png');
    background-size: cover;
    background-position: center;
    pointer-events: none;
    filter: blur(3px);
    transform: scale(1.05); /* Evita que el blur deje bordes transparentes en los extremos */
}

/* Oscurecer un POCO el fondo para que el texto sea legible, pero mantener lo llamativo */
#stadium-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3); /* Overlay suave */
}

.container {
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    height: 100%;
    padding: 1rem 1rem; /* Reducido para móviles */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

@media (min-width: 768px) {
    .container {
        padding: 1.5rem 2rem;
    }
}

.header {
    text-align: center;
    margin-bottom: 0.5rem;
    margin-top: 3.5rem; /* Separación aún más amplia del margen superior */
}

.title {
    font-family: 'Anton', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(67, 161, 213, 0.5);
    line-height: 1.1;
    
    background: radial-gradient(circle, #FFEE58 0%, #ffffff 35%, #43A1D5 85%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gold-text {
    /* Mantenemos la clase por si se usa en HTML, pero hereda el degradado */
    color: inherit;
    -webkit-text-fill-color: inherit;
}

.subtitle {
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    color: #FFEE58; /* Amarillo pastel más brillante */
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); /* Asegura legibilidad */
}

/* Packs Grid */
.packs-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 arriba, 2 abajo */
    gap: 1rem; /* Separación más ajustada para celular */
    perspective: 1000px;
    width: 100%;
    max-width: 1100px;
    flex-grow: 1;
    align-content: center;
}

@media (min-width: 768px) {
    .packs-container {
        grid-template-columns: repeat(4, 1fr); /* 4 en una fila en desktop */
        gap: 2.5rem;
    }
}

/* Card Styles */
.pack-card {
    width: 100%;
    max-width: 140px; /* Tamaño ideal y controlado para celulares */
    aspect-ratio: 2 / 3;
    background: transparent;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    justify-self: center;
}

@media (min-width: 768px) {
    .pack-card {
        height: 44vh; /* En desktop se basa en el alto de la pantalla */
        width: auto;
        max-width: 280px;
    }
}

.pack-card:hover:not(.flipped) {
    transform: translateY(-10px) scale(1.05);
}

.pack-card.flipped {
    transform: rotateY(180deg);
    cursor: default;
}

.pack-card.inactive {
    opacity: 0.5;
    pointer-events: none;
    transform: scale(0.95);
    transition: all 0.5s ease;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    overflow: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

/* Front of the pack */
.card-front {
    background-image: url('images/sobre.png?v=3') !important;
    background-size: 100% 100% !important; /* Estira la imagen para cubrir exactamente toda la card */
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Back of the pack (Prize) */
.card-back {
    background: #ffffff !important;
    transform: rotateY(180deg) translateZ(1px); /* translateZ evita el renderizado borroso en navegadores móviles */
    -webkit-transform: rotateY(180deg) translateZ(1px);
    border: 3px solid var(--gold);
    color: var(--text-dark) !important;
    padding: 1.2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribuye el contenido para evitar desbordes */
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.prize-icon {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
}

.prize-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-blue-dark);
    margin-bottom: 0.2rem;
}

.prize-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #b8860b; /* Dorado oscuro para mejor contraste sobre fondo blanco */
    margin-bottom: 1rem;
    line-height: 1.2;
}

.canjear-btn {
    font-family: 'Anton', sans-serif;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(67, 161, 213, 0.4);
    width: 100%;
}

.canjear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 161, 213, 0.6);
}

/* Glassmorphism Classes */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(5px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: radial-gradient(circle, #FFEE58 0%, #ffffff 35%, #43A1D5 85%) !important;
    padding: 3rem 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    position: relative;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--gold);
    color: var(--text-dark) !important;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: black;
}

.modal-header h2 {
    color: #b8860b; /* Color del reverso del premio (dorado oscuro) */
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-family: 'Anton', sans-serif;
    letter-spacing: 1px;
}

.prize-highlight {
    font-size: 1.5rem;
    font-weight: 800;
    color: #b8860b; /* Dorado oscuro */
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.1);
}

.modal-instruction {
    color: #1f2937;
    margin-bottom: 2rem;
    line-height: 1.5;
    font-weight: 600;
}

.input-group {
    margin-bottom: 1.5rem;
}

input[type="email"] {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 30px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

input[type="email"]:focus {
    border-color: var(--primary-blue-dark);
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 30px;
    border: none;
    background: linear-gradient(90deg, var(--gold), #b8962e);
    color: #000;
    font-family: 'Anton', sans-serif;
    letter-spacing: 1px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.hidden {
    display: none !important;
}

/* Success message styles */
#success-message {
    animation: fadeIn 0.5s ease forwards;
}

.check-icon {
    width: 60px;
    height: 60px;
    background: #10B981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem auto;
}

#reset-btn {
    background: transparent;
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

#reset-btn:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

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

/* Footer & Terms and conditions */
.footer {
    margin-top: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 900px;
    text-align: center;
}

.terms-text {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.5;
    font-weight: 300;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Mobile-only overrides (cell phones under 768px wide) */
@media (max-width: 767px) {
    .container {
        padding: 0.8rem 0.6rem;
    }
    .title {
        font-size: 3.2rem; /* Título más grande en celular */
        letter-spacing: 0.5px;
    }
    .subtitle {
        font-size: 0.95rem; /* Subtítulo ligeramente más grande para acompañar */
    }
    .packs-container {
        gap: 0.4rem; /* Separación mínima para ganar espacio vertical */
    }
    .pack-card {
        max-width: 44vw;
        max-height: 29vh; /* Limita la altura para asegurar que los términos y condiciones se vean sin scroll */
    }
    /* Evitar desbordes del contenido interno de la card en móviles */
    .card-back {
        padding: 0.6rem !important;
    }
    .prize-icon {
        font-size: 1.8rem !important;
        margin-bottom: 0.2rem !important;
    }
    .prize-title {
        font-size: 0.8rem !important;
        margin-bottom: 0.2rem !important;
    }
    .prize-value {
        font-size: 1.05rem !important;
        margin-bottom: 0.5rem !important;
        line-height: 1.1 !important;
    }
    .canjear-btn {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.9rem !important;
    }
}
