/* ============================================================
   RifaOnline — Neumorphism (amarillo + aqua)
   ============================================================ */
:root {
    --bg: #e4eaf0;
    --bg-light: #ecf1f6;
    --shadow-light: #ffffff;
    --shadow-dark: #bec7d1;
    --text: #1a2833;
    --text-soft: #566472;
    --text-muted: #97a2ae;

    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --accent-dark: #0891b2;
    --accent-yellow: #facc15;
    --accent-yellow-light: #fde047;
    --accent-yellow-dark: #eab308;

    --raise-sm: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
    --raise: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    --raise-lg: 10px 10px 24px var(--shadow-dark), -10px -10px 24px var(--shadow-light);
    --raise-xl: 14px 14px 32px var(--shadow-dark), -14px -14px 32px var(--shadow-light);
    --inset-sm: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
    --inset: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

 
body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 15% 10%, rgba(6, 182, 212, 0.06), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(250, 204, 21, 0.06), transparent 40%);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* COMPONENTES BASE */
.neu-raised { background: var(--bg); box-shadow: var(--raise); border-radius: 1rem; }
.neu-raised-sm { background: var(--bg); box-shadow: var(--raise-sm); border-radius: 0.75rem; }
.neu-raised-lg { background: var(--bg); box-shadow: var(--raise-lg); border-radius: 1.5rem; }
.neu-inset { background: var(--bg); box-shadow: var(--inset); border-radius: 1rem; }
.neu-inset-sm { background: var(--bg); box-shadow: var(--inset-sm); border-radius: 0.75rem; }

/* HEADER */
.neu-header {
    background: var(--bg);
    box-shadow: 0 6px 16px rgba(190, 199, 209, 0.6), 0 1px 0 0 var(--shadow-light) inset;
}

/* LOGO */
.logo-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent));
    box-shadow:
        3px 3px 8px rgba(8, 145, 178, 0.35),
        -2px -2px 6px rgba(255, 255, 255, 0.7),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}
.logo-link:hover .logo-badge {
    transform: translateY(-2px) rotate(-4deg);
    box-shadow:
        5px 8px 16px rgba(8, 145, 178, 0.4),
        -2px -2px 6px rgba(255, 255, 255, 0.8),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

/* NAV */
.nav-link {
    position: relative;
    padding: 6px 0;
    color: var(--text-soft);
    transition: color 0.3s ease;
    text-decoration: none;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-yellow), var(--accent));
    border-radius: 999px;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; left: 0; }

/* BOTONES */
.btn-neu {
    background: var(--bg);
    box-shadow: var(--raise-sm);
    color: var(--text);
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-neu:hover { box-shadow: var(--raise); transform: translateY(-1px); }
.btn-neu:active { box-shadow: var(--inset-sm); transform: translateY(0); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent));
    color: #0a2530;
    border-radius: 0.75rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow:
        4px 4px 12px rgba(6, 182, 212, 0.35),
        -2px -2px 6px rgba(255, 255, 255, 0.7),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow:
        6px 8px 20px rgba(6, 182, 212, 0.45),
        -2px -2px 6px rgba(255, 255, 255, 0.8),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}
.btn-accent:active {
    transform: translateY(0);
    box-shadow:
        inset 3px 3px 8px rgba(8, 145, 178, 0.5),
        inset -1px -1px 4px rgba(255, 255, 255, 0.2);
}

/* TABLERO */
.board-stage {
    position: relative;
    background: var(--bg);
    border-radius: 2rem;
    box-shadow:
        14px 14px 32px var(--shadow-dark),
        -14px -14px 32px var(--shadow-light),
        0 0 0 1px rgba(6, 182, 212, 0.10),
        0 24px 60px rgba(6, 182, 212, 0.10);
    padding: 2rem;
    transition: box-shadow 0.6s ease;
}
@media (max-width: 640px) {
    .board-stage { padding: 1.25rem; border-radius: 1.5rem; }
}
.board-stage::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 1.5rem;
    border: 1px solid rgba(6, 182, 212, 0.07);
    pointer-events: none;
}

/* BOLETOS */
.ticket-available {
    background: var(--bg);
    box-shadow: var(--raise-sm);
    color: var(--text);
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ticket-available:hover {
    box-shadow:
        4px 4px 10px var(--shadow-dark),
        -4px -4px 10px var(--shadow-light),
        0 0 0 1px rgba(6, 182, 212, 0.3);
    color: var(--accent-dark);
    transform: translateY(-2px);
}
.ticket-available:active { box-shadow: var(--inset-sm); transform: translateY(0); }

.ticket-selected {
    background: linear-gradient(135deg, var(--accent-yellow-light), var(--accent));
    color: #0a2530;
    border-radius: 0.75rem;
    font-weight: 800;
    box-shadow:
        inset 3px 3px 8px rgba(8, 145, 178, 0.4),
        inset -2px -2px 6px rgba(255, 255, 255, 0.4),
        0 0 0 2px rgba(6, 182, 212, 0.35),
        0 6px 16px rgba(6, 182, 212, 0.35);
    animation: ticketPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ticketPop {
    0% { transform: scale(0.9); }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.ticket-sold {
    background: var(--bg);
    box-shadow: var(--inset-sm);
    color: var(--text-muted);
    border-radius: 0.75rem;
    cursor: not-allowed;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 5px,
        rgba(6, 182, 212, 0.06) 5px,
        rgba(6, 182, 212, 0.06) 10px
    );
}

/* SIDEBAR */
.board-sidebar {
    background: var(--bg);
    border-radius: 1.25rem;
    box-shadow: var(--raise);
    padding: 1.25rem;
}

/* INPUTS */
.neu-input {
    background: var(--bg);
    box-shadow: var(--inset-sm);
    border: none;
    color: var(--text);
    border-radius: 0.75rem;
    transition: box-shadow 0.3s ease;
    font-family: inherit;
}
.neu-input::placeholder { color: var(--text-muted); }
.neu-input:focus {
    outline: none;
    box-shadow: var(--inset), 0 0 0 2px rgba(6, 182, 212, 0.28);
}

/* MODALES */
.neu-modal {
    background: var(--bg);
    border-radius: 1.75rem;
    box-shadow:
        20px 20px 50px rgba(190, 199, 209, 0.9),
        -20px -20px 50px rgba(255, 255, 255, 0.9),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* FLOATING BAR */
#floating-bar {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

/* SLIDER */
.carousel-viewport {
    position: relative;
    overflow: hidden;
}
.carousel-track {
    display: flex;
    height: 100%;
    transform: translateX(0%);
    transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
}
.carousel-slide {
    height: 100%;
    flex-shrink: 0;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
}

#carousel-title,
#carousel-desc {
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.carousel-text-switching {
    opacity: 0 !important;
    transform: translateY(10px);
}

#thumb-0, #thumb-1, #thumb-2 {
    transition: box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s ease,
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.autoplay-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-yellow), var(--accent));
    border-radius: 0 999px 999px 0;
    transition: width 0.3s linear;
    z-index: 5;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); border-radius: 999px; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--shadow-light), var(--shadow-dark));
    border-radius: 999px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-yellow-light), var(--accent-light));
}

::selection { background: rgba(6, 182, 212, 0.3); color: var(--accent-dark); }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 8px;
}

.badge-live-dot { animation: pulseSoft 2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.font-mono { font-variant-numeric: tabular-nums; }

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 15% 10%, rgba(6, 182, 212, 0.08), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(250, 204, 21, 0.08), transparent 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#preloader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: preloaderFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes preloaderFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Logo con animación */
.preloader-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow:
        0 12px 32px rgba(6, 182, 212, 0.35),
        inset 0 2px 0 0 rgba(255, 255, 255, 0.4);
    animation: preloaderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.preloader-logo svg {
    width: 42px;
    height: 42px;
    animation: preloaderSpin 3s linear infinite;
}

@keyframes preloaderPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 12px 32px rgba(6, 182, 212, 0.35), inset 0 2px 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 16px 40px rgba(6, 182, 212, 0.5), inset 0 2px 0 0 rgba(255, 255, 255, 0.5);
    }
}

@keyframes preloaderSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Texto */
.preloader-text {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
    display: flex;
    gap: 0;
}

.preloader-text-accent {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Barra de progreso */
.preloader-bar {
    width: 200px;
    height: 4px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.preloader-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-yellow), var(--accent));
    border-radius: 999px;
    transition: width 0.3s ease;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

/* Tagline */
.preloader-tagline {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0;
    animation: preloaderTaglineFade 1.5s ease-in-out infinite;
}

@keyframes preloaderTaglineFade {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}