/* ===== CARGA DE FUENTES ===== */
@font-face {
    font-family: 'BirdCharms';
    src: url('fonts/BirdCharmsSans-Regular.woff2') format('woff2'),
         url('fonts/BirdCharmsSans-Regular.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}

/* ===== VARIABLES ===== */
:root {
    --bg-color: #1a1a1a;
    --ticket-bg: #f5ede4;
    --ink-color: #1a1a1a;
    --pink-accent: #eeacba; 
    --warning-red: #c41e3a;
    --font-mono: 'Courier New', Courier, monospace; 
    --font-hand: 'BirdCharms', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    font-family: var(--font-mono);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px; /* Un poco más de espacio arriba/abajo para los stickers */
    overflow-x: hidden; /* Evita scroll horizontal */
}

/* ===== CLASES DE UTILIDAD DE COLOR ===== */
.accent-pink { color: var(--pink-accent) !important; }
.warning-red { color: var(--warning-red) !important; }

/* ===== LOADER "SOBRE/TELÓN" ===== */
.envelope-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.curtain {
    position: absolute;
    left: 0;
    width: 100%;
    height: 51%;
    background-color: var(--ticket-bg);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    transition: transform 1.2s cubic-bezier(0.7, 0, 0.3, 1);
    z-index: 2;
}

.top-curtain { top: 0; border-bottom: 2px solid var(--pink-accent); }
.bottom-curtain { bottom: 0; border-top: 2px solid var(--pink-accent); }

.loader-messagebox {
    z-index: 3;
    text-align: center;
    color: var(--ink-color);
    transition: opacity 0.5s ease;
}

.shhh-text {
    font-family: var(--font-hand);
    font-size: 4rem;
    color: var(--pink-accent);
    animation: gentlePulse 1.5s ease-in-out infinite alternate;
}

.shhh-subtext {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: -10px;
}

.envelope-loader.open .top-curtain { transform: translateY(-100%); }
.envelope-loader.open .bottom-curtain { transform: translateY(100%); }
.envelope-loader.open .loader-messagebox { opacity: 0; }


/* ===== TICKET CONTAINER ===== */
.ticket-container {
    background-color: var(--ticket-bg);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    color: var(--ink-color);
    width: 100%;
    max-width: 380px;
    padding: 30px 25px;
    position: relative;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(238, 172, 186, 0.4);
    
    clip-path: polygon(
        0% 0%, 100% 0%, 100% 100%, 
        95% 98%, 90% 100%, 85% 98%, 80% 100%, 75% 98%, 70% 100%, 
        65% 98%, 60% 100%, 55% 98%, 50% 100%, 45% 98%, 40% 100%, 
        35% 98%, 30% 100%, 25% 98%, 20% 100%, 15% 98%, 10% 100%, 
        5% 98%, 0% 100%
    );
    
    animation: slideUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s backwards;
    /* IMPORTANTE: Esto permite que los stickers se salgan del borde si es necesario */
    overflow: visible; 
}

/* ===== STICKERS FLOTANTES ===== */
.floating-sticker {
    position: absolute;
    z-index: 10;
    
    /* Blanco y negro + Sombra */
    filter: grayscale(100%) drop-shadow(5px 5px 4px rgba(0,0,0,0.3));
    
    /* Animación suave */
    animation: stickerFloat 4s ease-in-out infinite alternate;
    
    /* Sin bordes ni fondos extra, solo la foto */
    border: none;
    background: transparent;
}

/* --- AQUÍ SE AJUSTA LA POSICIÓN --- */

/* Sticker Alondra (Arriba Derecha) */
.sticker-alondra {
    width: 170px;  /* Tamaño */
    
    /* Coordenadas */
    top: 420px;    /* Qué tan arriba (número negativo = se sale del ticket hacia arriba) */
    right: -30px;  /* Qué tan a la derecha (número negativo = se sale hacia afuera) */
    
    transform: rotate(10deg);
}

/* Sticker Gato (Abajo Izquierda) */
.sticker-cat {
    width: 100px;  /* Tamaño */
    
    /* Coordenadas */
    bottom: 40px;  /* Qué tan abajo en el ticket */
    left: -15px;   /* Qué tan a la izquierda (negativo = se sale hacia afuera) */
    
    transform: rotate(-5deg);
    animation-delay: 1.5s;
}


/* ===== RESTO DEL TICKET ===== */
.punch-hole {
    width: 15px;
    height: 15px;
    background-color: var(--bg-color);
    border-radius: 50%;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid var(--pink-accent);
}

.header {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.blink {
    font-weight: bold;
    animation: blinker 1.5s linear infinite;
}

.date-issued { opacity: 0.6; margin-top: 4px; }

.dashed-line {
    border: none;
    border-top: 2px dashed var(--ink-color);
    margin: 20px 0;
    opacity: 0.2;
}

.title-section { text-align: center; }

.label {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.5;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 5px;
}

h1.floating-title {
    font-family: var(--font-hand);
    font-size: 3.8rem;
    line-height: 0.85;
    margin: 15px 0;
    text-transform: uppercase;
    transform: rotate(-2deg);
    color: var(--pink-accent);
    text-shadow: 2px 2px 0px rgba(0,0,0,0.05); 
    animation: float 3s ease-in-out infinite;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.detail-item { display: flex; flex-direction: column; }
.detail-item:first-child { grid-column: span 2; }

.value {
    font-weight: bold;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.sub-value { font-size: 0.8rem; opacity: 0.7; margin-top: 2px; }

.countdown-box {
    text-align: center;
    margin: 25px 0;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 15px 10px;
    background: rgba(238, 172, 186, 0.1); 
}

.timer-label {
    font-size: 0.6rem;
    letter-spacing: 2px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.timer-numbers {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.btn {
    text-decoration: none;
    padding: 16px;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: all 0.3s;
    border: 1px solid var(--ink-color);
}

.btn.primary {
    background-color: var(--ink-color);
    color: var(--ticket-bg);
}

.btn.primary:hover {
    background-color: var(--pink-accent); 
    border-color: var(--pink-accent);
    color: var(--ink-color);
}

.btn.secondary {
    background-color: transparent;
    color: var(--ink-color);
}

.btn.secondary:hover { 
    background-color: rgba(238, 172, 186, 0.2); 
}

.barcode-section { text-align: center; margin-top: 35px; }
.admit-one { font-size: 0.7rem; letter-spacing: 5px; margin-bottom: 5px; }

.barcode {
    height: 40px;
    width: 80%;
    margin: 0 auto 10px auto;
    background: repeating-linear-gradient(
        90deg,
        var(--ink-color),
        var(--ink-color) 2px,
        transparent 2px,
        transparent 5px,
        var(--pink-accent) 5px, 
        var(--pink-accent) 7px,
        transparent 7px,
        transparent 10px
    );
    opacity: 0.8;
}

.serial { font-size: 0.55rem; letter-spacing: 2px; opacity: 0.6; }

/* ===== ANIMACIONES KEYFRAMES ===== */
@keyframes slideUp {
    from { transform: translateY(100px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes blinker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes float {
    0% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(-2deg); }
    100% { transform: translateY(0px) rotate(-2deg); }
}

@keyframes gentlePulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

@keyframes stickerFloat {
    0% { transform: translateY(0) rotate(var(--rot)); }
    100% { transform: translateY(-8px) rotate(var(--rot)); }
}