/* ═══════════════════════════════════════════════
   BOXPOINT ROULETTE - STYLES
   ═══════════════════════════════════════════════ */

:root {
    --gold: #FFD200;
    --gold-dark: #CCAD00;
    --gold-light: #FFE24D;
    --black: #0a0a0a;
    --card-bg: rgba(13, 13, 13, 0.85);
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, sans-serif;
    background: #020202;
    color: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body {
    background: linear-gradient(135deg, #050505 0%, #151000 50%, #050505 100%);
    background-size: 200% 200%;
    animation: premiumBgShift 15s ease infinite;
    overflow-x: hidden;
}

@keyframes premiumBgShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ═══════════════════════════════════════════════
   LAYOUT - MOBILE FIRST VERTICAL STACK
   ═══════════════════════════════════════════════ */

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1rem 1rem 2rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    gap: 1rem;
    touch-action: pan-y;
}

.roulette-body {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ── Logo ── */
.logo-top {
    width: 100%;
    text-align: center;
    padding: 0.5rem 0;
}
.brand-logo-mobile {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 2px 10px rgba(255,210,0,0.15));
}

/* ── Fullscreen Kiosk Button ── */
.btn-fullscreen-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: 0.2s;
    backdrop-filter: blur(8px);
}
.btn-fullscreen-toggle:active {
    background: rgba(255,255,255,0.15);
    transform: scale(0.95);
}
.btn-fullscreen-toggle svg { width: 22px; height: 22px; }

/* ═══════════════════════════════════════════════
   ROULETTE
   ═══════════════════════════════════════════════ */

.roulette-wrapper {
    position: relative;
    width: 100%;
    /* Hacer la ruleta mucho más grande en teléfonos verticales */
    max-width: 500px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#rouletteCanvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.7),
        0 0 40px rgba(255,210,0,0.08);
    transition: filter 0.8s, transform 0.8s cubic-bezier(0.16,1,0.3,1);
    -webkit-user-drag: none; /* prevent drag ghost image */
    will-change: transform;
    backface-visibility: hidden;
}
#rouletteCanvas.spinning {
    transform: scale(1.022);
    box-shadow: 0 0 35px rgba(255,210,0,0.65), 0 0 90px rgba(255,180,0,0.3), 0 12px 45px rgba(0,0,0,0.7);
}

/* Pointer */
.roulette-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
    width: 44px;
    z-index: 20;
    /* Efecto metálico/sombra de alta gama */
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.9)) drop-shadow(0 0 6px rgba(255,210,0,0.4));
    transform-origin: 50% 10%; /* swing from top */
    will-change: transform;
}
.roulette-pointer.bounce {
    animation: pointerTick 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pointerTick {
    0% { transform: translateX(-50%) rotate(0); }
    42% { transform: translateX(-50%) rotate(24deg); }
    100% { transform: translateX(-50%) rotate(0); }
}

/* ═══════════════════════════════════════════════
   CONTROLS (Power Meter + Button)
   ═══════════════════════════════════════════════ */

.controls-box {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,210,0,0.1);
    border-radius: 20px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.moto-cockpit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    zoom: 1;
    position: relative;
}

.rpm-gauge {
    position: relative;
    width: 260px;
    height: 150px;
    display: flex;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, #1e1e1e, #0a0a0a 60%, #050505);
    border-radius: 130px 130px 12px 12px;
    border: 3px solid #2a2a2a;
    border-bottom: 2px solid #111;
    box-shadow: 
        inset 0 8px 20px rgba(0,0,0,0.95), 
        inset 0 2px 5px rgba(255,255,255,0.08),
        0 15px 40px rgba(0,0,0,0.9),
        0 0 0 1px #000;
}
.rpm-gauge::after {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; height: 45%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent);
    border-radius: 130px 130px 0 0;
    pointer-events: none;
}
/* Redline glow indicator */
.rpm-gauge::before {
    content: '';
    position: absolute;
    top: -2px; right: 15px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ff3b30;
    box-shadow: 0 0 6px #ff3b30, 0 0 12px rgba(255,59,48,0.4);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}
.rpm-gauge.redline::before {
    opacity: 1;
    animation: redlineBlink 0.3s infinite alternate;
}
@keyframes redlineBlink {
    0% { opacity: 0.6; box-shadow: 0 0 6px #ff3b30; }
    100% { opacity: 1; box-shadow: 0 0 12px #ff3b30, 0 0 20px rgba(255,59,48,0.5); }
}
.gauge-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(0,0,0,0.7));
    z-index: 2;
}
.gauge-fill {
    transition: stroke-dashoffset 0.08s linear;
}
.rpm-text {
    position: absolute;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    z-index: 2;
}
.rpm-text span {
    font-size: 2.4rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255,255,255,0.4);
    transition: color 0.15s;
    font-variant-numeric: tabular-nums;
}
.rpm-gauge.redline .rpm-text span {
    color: #ff4444;
    text-shadow: 0 0 15px rgba(255,59,48,0.6);
}
.rpm-text small {
    font-size: 0.75rem;
    font-weight: 700;
    color: #666;
    letter-spacing: 0.18em;
}

.moto-handlebar {
    display: flex;
    align-items: center;
    position: relative;
    width: 320px;
    height: 90px;
    cursor: grab;
    user-select: none;
    touch-action: none;
    margin-bottom: 2.5rem;
    will-change: transform;
}
.moto-handlebar:active { cursor: grabbing; }

.moto-handlebar.tremble {
    animation: engineTremble 0.06s infinite;
}

@keyframes engineTremble {
    0% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-2px, 1.5px) rotate(-0.8deg); }
    40% { transform: translate(2px, -2px) rotate(0.8deg); }
    60% { transform: translate(-1.5px, -1px) rotate(-0.5deg); }
    80% { transform: translate(1.5px, 2px) rotate(0.5deg); }
    100% { transform: translate(0.5px, -0.5px) rotate(0deg); }
}

.moto-switch {
    width: 65px;
    height: 110px;
    background: linear-gradient(135deg, #2a2a2a, #151515, #0a0a0a);
    border-radius: 12px 0 0 12px;
    box-shadow: 
        inset 2px 2px 5px rgba(255,255,255,0.15), 
        inset -5px 0 15px rgba(0,0,0,0.9), 
        10px 15px 25px rgba(0,0,0,0.9);
    position: relative;
    z-index: 10;
    border: 1px solid #333;
    border-right: 4px solid #050505;
    display: flex;
    justify-content: center;
    align-items: center;
}
.moto-switch::after, .moto-switch::before {
    content: '';
    position: absolute;
    width: 10px; height: 10px;
    background: radial-gradient(circle, #555 30%, #111 80%);
    border-radius: 50%;
    right: 8px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.3), 0 1px 1px rgba(0,0,0,1);
}
.moto-switch::before { top: 12px; }
.moto-switch::after { bottom: 12px; }

.moto-button-red {
    width: 32px;
    height: 44px;
    background: linear-gradient(145deg, #e60000, #990000);
    border-radius: 4px;
    box-shadow: 
        inset 1px 1px 3px #ff9999, 
        inset -2px -2px 6px #4d0000, 
        0 4px 6px rgba(0,0,0,0.8), 
        0 1px 1px rgba(255,255,255,0.2);
    border: 1px solid #1a0000;
    position: relative;
}
.moto-button-red::after {
    content: '✖';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    opacity: 0.6;
}

.moto-grip-wrapper {
    width: 210px;
    height: 88px;
    position: relative;
    overflow: hidden;
    background: #040404;
    border-top: 2px solid #181818;
    border-bottom: 2px solid #000;
    box-shadow: 
        0 15px 35px rgba(0,0,0,0.95), 
        inset 0 0 20px rgba(0,0,0,1);
    z-index: 5;
}
.moto-grip {
    width: 100%;
    height: 400%;
    position: absolute;
    top: 0;
    left: 0;
    /* Diamond Knurling grip pattern */
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 5px,
            rgba(40,40,40,0.8) 5px,
            rgba(40,40,40,0.8) 6px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 5px,
            rgba(40,40,40,0.8) 5px,
            rgba(40,40,40,0.8) 6px
        ),
        linear-gradient(to bottom, #0e0e0e, #080808);
    transform: translateY(-37.5%);
    transition: transform 0.05s linear;
}
.moto-shading {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.06) 0%,
        rgba(255,255,255,0.22) 12%,
        rgba(255,255,255,0.04) 28%,
        transparent 48%,
        rgba(0,0,0,0.6) 72%,
        rgba(0,0,0,0.95) 100%
    );
    pointer-events: none;
    z-index: 6;
    box-shadow: 
        inset 18px 0 30px rgba(0,0,0,0.95), 
        inset -18px 0 30px rgba(0,0,0,0.95);
}

.moto-bar-end {
    width: 40px;
    height: 75px;
    /* Metal Anodizado Dorado/Bronce (Contrapeso Racing) */
    background: linear-gradient(to bottom, #d4af37 0%, #aa8011 15%, #443000 45%, #110c00 80%, #000000 100%);
    border-radius: 0 14px 14px 0;
    z-index: 10;
    box-shadow: 
        inset 3px 0 10px rgba(255,255,255,0.5), 
        inset -5px 0 15px rgba(0,0,0,0.9), 
        10px 10px 20px rgba(0,0,0,0.8);
    border-left: 4px solid #111;
    position: relative;
}
.moto-bar-end::before {
    /* Corte hueco para el tornillo central */
    content: '';
    position: absolute;
    top: 50%; right: -2px;
    width: 12px; height: 35px;
    background: linear-gradient(to right, #000, #222, #000);
    transform: translateY(-50%);
    border-radius: 6px 0 0 6px;
    box-shadow: inset 2px 0 5px #000;
}
.moto-bar-end::after {
    /* Reflejo de luz especular */
    content: '';
    position: absolute;
    top: 8px; left: 5px; right: 8px; height: 10px;
    background: rgba(255,255,255,0.4);
    border-radius: 10px;
    filter: blur(2px);
}

.moto-instruction {
    position: absolute;
    bottom: -42px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,210,0,0.7);
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-align: center;
    animation: bounceDown 1.8s ease-in-out infinite;
    text-shadow: 0 1px 8px rgba(255,210,0,0.2);
}
@keyframes bounceDown {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
    50% { transform: translate(-50%, 6px); opacity: 1; }
}

.btn-spin {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    border: none;
    border-radius: 14px;
    color: #0a0a0a;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-shadow: 0 6px 20px rgba(255,210,0,0.25);
    transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
    will-change: transform;
    position: relative;
    overflow: hidden;
}
.btn-spin::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: skewX(-18deg);
    animation: casinoShine 2.2s ease-in-out infinite;
}
.btn-spin:active {
    transform: scale(0.965);
    box-shadow: 0 3px 10px rgba(255,210,0,0.3);
}
@keyframes casinoShine {
    0%, 60% { left: -120%; }
    100% { left: 180%; }
}

/* ═══════════════════════════════════════════════
   LAST WINNER BAR
   ═══════════════════════════════════════════════ */

.last-winner-bar {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,210,0,0.2);
    border-radius: 100px;
    z-index: 50;
    animation: slideUp 0.5s cubic-bezier(0.34,1.56,0.64,1);
    max-width: 90%;
}

.lw-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.1em;
}
.lw-name {
    font-size: 1.1rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 30px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ═══════════════════════════════════════════════
   CELEBRATION MODAL
   ═══════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    align-items: flex-start; /* Evitar que el flexbox corte la parte superior en pantallas chicas */
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow-y: auto; /* Permitir deslizamiento vertical si el contenido excede la pantalla */
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-overlay.casino-win-active {
    animation: casinoBackdropFlash 0.9s ease-out;
}

.modal-box {
    text-align: center;
    width: 100%;
    max-width: 420px;
    margin: auto; /* Centrar vertical y horizontalmente respetando el flex-start de la caja contenedora */
    position: relative;
    animation: zoomIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
.modal-overlay.casino-win-active .modal-box {
    animation: casinoWinPop 0.75s cubic-bezier(0.2, 0.95, 0.25, 1.08) both;
}

@keyframes zoomIn {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 10px rgba(255,210,0,0.15));
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}
.modal-overlay.casino-win-active .modal-title {
    animation: neonPulse 0.95s ease-in-out 2;
}

.modal-prize {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,210,0,0.25);
    border-radius: 16px;
    display: inline-block;
    width: 100%;
    animation: prizePulse 1.5s infinite alternate;
    word-break: break-word;
    overflow-wrap: break-word;
}
.modal-overlay.casino-win-active .modal-prize {
    animation: prizePulse 1.2s infinite alternate, jackpotGlow 0.85s ease-in-out 2;
}
.modal-overlay.casino-win-active .modal-logo {
    animation: logoGlowPulse 1.1s ease-in-out 2;
}
.modal-overlay.casino-win-active #qrContainer {
    animation: jackpotSlideUp 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
@keyframes prizePulse {
    0% { box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 0 0 rgba(255,210,0,0.3); }
    100% { box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 0 15px rgba(255,210,0,0); border-color: rgba(255,210,0,0.8); }
}

/* Sparkles Confetti Explosion */
.sparkle-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: explodeOut cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes explodeOut {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0); }
    50% { opacity: 1; transform: translate(calc(var(--tx) * 0.8), calc(var(--ty) * 0.8)) scale(1.5); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}
@keyframes casinoBackdropFlash {
    0% { background: rgba(0,0,0,0.98); }
    25% { background: rgba(45,24,0,0.88); }
    48% { background: rgba(30,18,0,0.92); }
    100% { background: rgba(0,0,0,0.92); }
}
@keyframes casinoWinPop {
    0% { transform: scale(0.78) translateY(18px); opacity: 0; }
    45% { transform: scale(1.06) translateY(-4px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes neonPulse {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(255,210,0,0)); }
    50% { filter: drop-shadow(0 0 24px rgba(255,210,0,0.95)); }
}
@keyframes jackpotGlow {
    0% {
        box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 0 rgba(255,210,0,0);
        border-color: rgba(255,210,0,0.3);
        transform: scale(0.98);
    }
    55% {
        box-shadow: 0 14px 36px rgba(0,0,0,0.6), 0 0 34px rgba(255,210,0,0.6);
        border-color: rgba(255,235,140,0.95);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 10px 30px rgba(0,0,0,0.55), 0 0 16px rgba(255,210,0,0.35);
        border-color: rgba(255,210,0,0.55);
        transform: scale(1);
    }
}
@keyframes logoGlowPulse {
    0%, 100% {
        filter: drop-shadow(0 4px 10px rgba(255,210,0,0.15));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 8px 20px rgba(255,230,120,0.65));
        transform: scale(1.05);
    }
}
@keyframes jackpotSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════ */

/* Roulette page toast (top-right slide in) */
.roulette-body .toast-notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    left: auto;
    bottom: auto;
    background: rgba(5,5,5,0.9);
    border: 1px solid rgba(255,255,255,0.1);
    border-left: 3px solid var(--gold);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.68,-0.6,0.32,1.6);
    z-index: 3000;
    opacity: 1;
    pointer-events: auto;
}
.roulette-body .toast-notification.show {
    transform: translateX(0);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — LARGER SCREENS
   ═══════════════════════════════════════════════ */

@media (min-width: 500px) {
    .roulette-wrapper { max-width: 450px; }
    .controls-box { max-width: 450px; }
    .brand-logo-mobile { width: 200px; }
    .modal-title { font-size: 3.5rem; }
}

@media (min-width: 768px) {
    .roulette-wrapper { max-width: 520px; }
    .controls-box { max-width: 520px; }
    .main-content { justify-content: center; }
}

@media (min-width: 1024px) {
    /* ── Public Roulette Desktop Layout ── */
    .main-content {
        flex-direction: row;
        justify-content: center;
        gap: 4rem;
        padding: 4rem;
    }
    .logo-top {
        position: absolute;
        top: 2rem;
        left: 2rem;
        width: auto;
    }
    .roulette-wrapper {
        max-width: min(800px, 85vh);
    }
    .controls-box {
        max-width: 450px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .moto-cockpit {
        zoom: 1.25;
    }
}

@media (min-width: 1400px) {
    .roulette-wrapper {
        max-width: min(1000px, 90vh);
    }
    .controls-box {
        max-width: 500px;
    }
    .moto-cockpit {
        zoom: 1.45;
    }
}

/* Ajustes dinámicos para pantallas pequeñas o de poca altura */
@media (max-width: 400px), (max-height: 800px) {
    .main-content {
        padding: 0.5rem 0.5rem 1.5rem;
        gap: 0.5rem;
    }
    .moto-cockpit {
        zoom: 0.85;
    }
}

@media (max-width: 360px), (max-height: 680px) {
    .modal-title { font-size: 2.2rem; }
    .modal-prize { font-size: 1.6rem; }
    .brand-logo-mobile { width: 130px; }
    .moto-cockpit {
        zoom: 0.75;
    }
}

@media (max-height: 600px) {
    .main-content {
        padding-top: 0;
        gap: 0;
    }
    .logo-top {
        padding: 0.25rem 0;
    }
    .moto-cockpit {
        zoom: 0.65;
    }
    .modal-box {
        zoom: 0.7; /* Encoger el cartel para que quepa */
    }
}

/* ── Mobile Landscape Layout (Desktop style but scaled) ── */
@media (orientation: landscape) and (max-height: 600px) {
    .main-content {
        flex-direction: row;
        justify-content: space-evenly; /* Separar ruleta de controles al máximo */
        align-items: center;
        gap: 1rem;
        padding: 0.5rem;
    }
    .logo-top {
        position: absolute;
        top: 0.5rem;
        left: 0.5rem;
        width: auto;
    }
    .brand-logo-mobile {
        width: 100px; /* Logo más pequeño para no robar espacio */
    }
    .roulette-wrapper {
        max-width: min(650px, 95vh); /* ¡Hacer la ruleta GIGANTE en horizontal! (hasta 95% del alto) */
    }
    .controls-box {
        max-width: 320px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .moto-cockpit {
        zoom: 0.65;
    }
    .modal-overlay.active {
        align-items: center; /* Centrar verticalmente en landscape */
    }
    .modal-box {
        zoom: 0.8 !important; 
        max-width: 85vw;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 1.5rem;
        align-items: center;
        text-align: left;
        padding: 1.5rem 2rem;
    }
    .modal-logo { display: none; }
    .modal-title { grid-column: 1; grid-row: 1; font-size: 2.4rem; margin: 0;}
    .modal-prize { grid-column: 1; grid-row: 2; font-size: 1.8rem; margin: 0; text-align: left;}
    #btnCloseCelebration { grid-column: 1; grid-row: 3; max-width: 250px; margin: 0;}
    #qrContainer { grid-column: 2; grid-row: 1 / span 3; margin: 0 !important;}
}

/* ═══════════════════════════════════════════════
   SHARED: GLASSMORPHISM FOR ADMIN/LOGIN
   ═══════════════════════════════════════════════ */

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid rgba(255,210,0,0.15);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
    position: relative;
    overflow: hidden;
}
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,210,0,0.4), transparent);
    z-index: 1;
}

.brand-logo-main {
    max-width: 320px;
    width: 100%; height: auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8));
}

/* ═══════════════════════════════════════════════
   TYPOGRAPHY & BUTTONS (shared)
   ═══════════════════════════════════════════════ */

h1, h2, h3 { font-family: 'Outfit', sans-serif; }

.text-gradient-gold {
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

button { outline: none; }

.btn-primary {
    position: relative; padding: 1rem 2rem;
    background: var(--gold);
    border: none; border-radius: 12px; color: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; font-size: 1.05rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    gap: 0.75rem; cursor: pointer; transition: all 0.2s;
}
.btn-primary:hover { background: var(--gold-light); transform: scale(1.02); }
.btn-primary:active { transform: scale(0.98); opacity: 0.8; }
.w-100 { width: 100%; }

.btn-secondary {
    padding: 0.8rem 1.5rem;
    background: rgba(118, 118, 128, 0.24);
    border: none;
    border-radius: 10px; color: #fff; cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; font-size: 0.9rem; font-weight: 500;
    transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(118, 118, 128, 0.35); }

/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */

.login-body {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: radial-gradient(circle at top left, #1a1a1a, #050505 60%);
    position: relative; overflow: hidden;
}
.login-body::before {
    content: ''; position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255,210,0,0.03) 0%, transparent 60%);
    animation: slowRotate 30s linear infinite; pointer-events: none;
}
.login-wrapper { width: 100%; max-width: 440px; padding: 1.5rem; z-index: 10; animation: floatingCard 0.8s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes floatingCard { from { opacity: 0; transform: translateY(40px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.login-card { padding: 2.5rem 1.75rem; text-align: center; border-radius: 28px; }
.login-header h1 { font-size: 2.2rem; font-weight: 900; letter-spacing: 0.2em; background: linear-gradient(135deg, var(--gold-light), var(--gold)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-top: 1.5rem; margin-bottom: 0.2rem; }
.login-header p { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.4em; color: #888; text-transform: uppercase; }
.login-subtitle { margin-top: 1.5rem; margin-bottom: 2rem; font-size: 0.9rem; color: #aaa; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 1.5rem; }
.form-group { margin-bottom: 1.75rem; text-align: left; }
.form-group label { display: block; font-size: 0.8rem; color: #aaa; margin-bottom: 0.5rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper svg { position: absolute; left: 1.25rem; width: 18px; height: 18px; color: #666; transition: color 0.25s; }
.input-wrapper input { width: 100%; padding: 1.1rem 1rem 1.1rem 3.2rem; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; color: #fff; font-family: inherit; font-size: 1rem; outline: none; transition: all 0.3s cubic-bezier(0.16,1,0.3,1); box-shadow: inset 0 2px 5px rgba(0,0,0,0.6); }
.input-wrapper input:focus { background: rgba(10,10,10,0.9); border-color: var(--gold); box-shadow: inset 0 2px 5px rgba(0,0,0,0.6), 0 0 15px rgba(255,210,0,0.2); transform: translateY(-1px); }
.input-wrapper input:focus + svg { color: var(--gold); }
.error-msg { color: #ff3b30; font-size: 0.85rem; font-weight: 500; margin-bottom: 1.5rem; min-height: 20px; }


/* ═══════════════════════════════════════════════
   ADMIN PANEL — APPLE CRM PREMIUM v3
   ═══════════════════════════════════════════════ */

.mobile-first-admin {
    background: #0c0c10;
    background-image:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255,210,0,0.025), transparent 60%);
    background-attachment: fixed;
    padding-bottom: 90px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #e5e5ea;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.01em;
}

/* ── Loader ── */
.admin-loader {
    position: fixed; inset: 0; background: rgba(9,9,15,0.97);
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    z-index: 9999; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1.25rem;
    transition: opacity 0.5s;
}
.admin-loader p { font-family: 'Outfit'; color: var(--gold); font-weight: 600; letter-spacing: 0.15em; font-size: 0.82rem; }
.loader-spinner {
    width: 34px; height: 34px; border: 2.5px solid rgba(255,210,0,0.1);
    border-top-color: var(--gold); border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5,0,0.5,1) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slowRotate { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast-notification {
    position: fixed; bottom: 100px; left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(28,28,34,0.95); backdrop-filter: blur(24px);
    border: 1px solid rgba(52,199,89,0.25); border-radius: 14px;
    padding: 0.85rem 1.3rem; z-index: 9000;
    display: flex; align-items: center; gap: 0.6rem;
    font-weight: 600; font-size: 0.85rem; color: #fff;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1), opacity 0.4s;
    opacity: 0; pointer-events: none;
}
.toast-notification.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Top Bar ── */
.admin-top-bar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(12,12,16,0.82);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.top-bar-left { display: flex; align-items: center; gap: 0.7rem; }
.top-bar-logo { height: 26px; width: auto; filter: drop-shadow(0 1px 4px rgba(255,210,0,0.15)); }
.top-bar-title {
    font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.85rem;
    letter-spacing: 0.12em; color: rgba(255,255,255,0.85);
}
.top-bar-right { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn-header {
    background: transparent; border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px; transition: all 0.2s;
}
.icon-btn-header svg { width: 16px; height: 16px; }
.icon-btn-header:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.icon-btn-header:active { transform: scale(0.92); opacity: 0.7; }

/* ── Tabs ── */
.admin-main { flex: 1; position: relative; width: 100%; max-width: 720px; margin: 0 auto; z-index: 1; }
.tab-pane { display: none; padding: 0 1.25rem 1.5rem; }
.tab-pane.active { display: block; animation: tabIn 0.45s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes tabIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ── Tab Hero ── */
.tab-hero {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 1.75rem; padding: 1.75rem 1.5rem 0; gap: 1rem; flex-wrap: wrap;
}
.tab-title {
    font-family: 'Outfit', sans-serif; font-size: 1.65rem; font-weight: 700;
    margin-bottom: 0.25rem; letter-spacing: -0.025em; color: #fff; line-height: 1.2;
}
.tab-subtitle { font-size: 0.8rem; color: rgba(255,255,255,0.32); line-height: 1.55; font-weight: 400; }
.tab-pane .percentage-dashboard { margin-top: 0; }

/* ── Unified Card Base ── */
.prize-item, .analytic-card, .setting-item, .history-item, .contact-item, .stock-card {
    background: rgba(255,255,255,0.028);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s ease;
    position: relative; overflow: hidden;
}
.prize-item:hover, .setting-item:hover,
.history-item:hover, .contact-item:hover, .stock-card:hover {
    background: rgba(255,255,255,0.045);
    border-color: rgba(255,255,255,0.08);
}
.analytic-card:hover {
    background: rgba(255,255,255,0.045);
    border-color: rgba(255,255,255,0.08);
}

/* ── Percentage Dashboard ── */
.percentage-dashboard {
    background: rgba(255,255,255,0.028);
    border-radius: 16px; padding: 1.15rem 1.35rem; margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.05);
}
.percentage-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
#totalPercentage { font-family: 'Outfit'; font-size: 1.6rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.percentage-status { font-weight: 600; font-size: 0.65rem; padding: 0.25rem 0.75rem; border-radius: 50px; text-transform: uppercase; letter-spacing: 0.08em; }
.percentage-status.ok { background: rgba(52,199,89,0.08); color: #30d158; border: 1px solid rgba(52,199,89,0.15); }
.percentage-status.error { background: rgba(255,59,48,0.08); color: #ff453a; border: 1px solid rgba(255,59,48,0.15); }
.percentage-bar { width: 100%; height: 3px; background: rgba(255,255,255,0.04); border-radius: 10px; overflow: hidden; }
.percentage-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); border-radius: 10px; transition: width 0.5s ease; }
.percentage-fill.over { background: linear-gradient(90deg, #cc2200, #ff453a); }
.percentage-fill.under { background: rgba(255,210,0,0.25); }

/* ── Prize Cards ── */
.prize-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.prize-item {
    display: flex; flex-direction: column; gap: 0.8rem;
    padding: 1.15rem 1.25rem; border-radius: 14px;
    animation: fadeSlideUp 0.35s ease forwards; opacity: 0;
}
.prize-item-content { display: flex; gap: 1rem; align-items: flex-start; }
.product-image-upload {
    width: 68px; height: 68px; border-radius: 16px;
    background: rgba(255,210,0,0.03); border: 1.5px dashed rgba(255,210,0,0.2);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; flex-shrink: 0; cursor: pointer;
    transition: all 0.25s;
}
.product-image-upload:hover { border-color: rgba(255,210,0,0.6); background: rgba(255,210,0,0.06); transform: scale(1.03); }
.product-image-upload img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; z-index: 1; border-radius: 14px; }
.product-image-upload svg.upload-icon { width: 22px; height: 22px; color: rgba(255,210,0,0.3); }
.product-image-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.product-details { display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.product-row { display: flex; gap: 0.5rem; align-items: center; }

/* ── Inputs ── */
.prize-name-input, .prize-percentage-input {
    width: 100%; padding: 0.7rem 0.9rem;
    background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; color: #f0f0f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 0.9rem; font-weight: 500; outline: none; transition: all 0.2s ease;
}
.prize-name-input:focus, .prize-percentage-input:focus {
    background: rgba(255,255,255,0.05); border-color: rgba(255,210,0,0.35);
    box-shadow: 0 0 0 2px rgba(255,210,0,0.06);
}
.prize-color-picker {
    width: 40px; height: 40px; flex-shrink: 0; border: none;
    border-radius: 12px; cursor: pointer; background: transparent; padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4); transition: 0.2s;
}
.prize-color-picker:hover { transform: scale(1.1); }
.prize-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.prize-color-picker::-webkit-color-swatch { border-radius: 12px; border: 2px solid rgba(255,255,255,0.15); }

.btn-remove-prize {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
    color: #666; cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: all 0.2s; font-size: 0.85rem;
}
.btn-remove-prize:hover { background: rgba(255,59,48,0.15); color: #ff3b30; border-color: rgba(255,59,48,0.3); }
.btn-remove-prize:active { transform: scale(0.9); }

/* ── Frequency Input ── */
.prize-frequency-wrapper {
    display: flex; align-items: center; gap: 0.5rem; flex: 1;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px; padding: 0.45rem 0.75rem; transition: 0.25s;
}
.prize-frequency-wrapper:focus-within {
    border-color: rgba(255,210,0,0.4); box-shadow: 0 0 0 3px rgba(255,210,0,0.08);
}
.freq-prefix { font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.3); white-space: nowrap; }
.prize-frequency-input {
    width: 65px; padding: 0.45rem 0.3rem; background: transparent;
    border: none; color: var(--gold); font-family: 'Outfit', sans-serif;
    font-size: 1.05rem; font-weight: 800; text-align: center; outline: none;
}
.prize-frequency-input::-webkit-inner-spin-button { opacity: 0.4; }
.freq-real-pct { font-size: 0.72rem; color: rgba(255,255,255,0.2); font-weight: 500; font-style: italic; padding-left: 2px; }

/* Product Image in Modal */
.modal-product-image-container { width: 100%; display: flex; justify-content: center; margin-bottom: 1.5rem; margin-top: -0.5rem; }
.modal-product-image {
    width: 140px; height: 140px; object-fit: cover; border-radius: 20px;
    border: 2px solid var(--gold); box-shadow: 0 10px 30px rgba(255,210,0,0.3);
}

/* ── Add Prize Button ── */
.btn-add-prize {
    padding: 0.75rem 1.4rem; max-width: fit-content; margin: 1.25rem auto;
    background: rgba(255,210,0,0.04); border: 1.5px dashed rgba(255,210,0,0.2);
    border-radius: 14px; color: var(--gold); font-weight: 700;
    font-family: 'Outfit', sans-serif; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.btn-add-prize:hover { background: rgba(255,210,0,0.08); border-color: rgba(255,210,0,0.4); transform: translateY(-2px); }
.btn-add-prize:active { transform: scale(0.97); }
.btn-add-prize svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Action Buttons ── */
.tab-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; padding-bottom: 100px; }
.tab-actions .btn-fab-primary { width: 100%; border-radius: 14px; }
.btn-fab-primary {
    flex: 1; padding: 0.9rem; border-radius: 12px; border: none;
    background: var(--gold);
    color: #000; font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-weight: 700; font-size: 0.88rem;
    display: flex; justify-content: center; align-items: center; gap: 0.5rem;
    cursor: pointer; transition: all 0.2s ease; letter-spacing: 0.02em;
}
.btn-fab-primary:hover { filter: brightness(1.08); }
.btn-fab-primary:active { transform: scale(0.98); opacity: 0.9; }

.btn-setting {
    padding: 0.65rem 1.15rem; border-radius: 10px; font-size: 0.82rem;
    font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7); font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}
.btn-setting:hover { background: rgba(255,255,255,0.1); color: #fff; }
.btn-setting-danger { background: rgba(255,59,48,0.1); color: #ff453a; border-color: rgba(255,59,48,0.15); }
.btn-setting-danger:hover { background: rgba(255,59,48,0.18); color: #ff6b6b; }

.btn-preview-roulette {
    display: flex; align-items: center; gap: 0.45rem;
    padding: 0.55rem 1.1rem; border-radius: 10px; font-size: 0.78rem;
    font-weight: 700; color: var(--gold); background: rgba(255,210,0,0.06);
    border: 1px solid rgba(255,210,0,0.15); text-decoration: none;
    transition: all 0.25s; white-space: nowrap;
}
.btn-preview-roulette:hover {
    background: rgba(255,210,0,0.12); transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,210,0,0.15);
}

/* ── Analytics Dashboard ── */
.analytics-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 2rem; }
.analytic-card {
    border-radius: 14px; padding: 1rem 1.1rem;
    display: flex; flex-direction: row; align-items: center; gap: 0.8rem;
    text-align: left;
}
.an-icon {
    width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.an-icon svg { width: 18px; height: 18px; }
.an-data { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.an-label { font-size: 0.62rem; color: rgba(255,255,255,0.3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.an-value { font-family: 'Outfit'; font-size: 1.5rem; font-weight: 700; color: #fff; letter-spacing: -0.015em; line-height: 1.15; }

/* Section headers */
.section-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-subtitle { font-family: 'Outfit'; font-size: 0.85rem; font-weight: 700; color: rgba(255,255,255,0.25); text-transform: uppercase; letter-spacing: 0.12em; }

/* ── Settings ── */
.settings-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.setting-item {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    border-radius: 14px; padding: 1rem 1.15rem;
}
.setting-item.danger-zone { background: rgba(255,59,48,0.04); border-color: rgba(255,59,48,0.1); }
.setting-item.danger-zone:hover { border-color: rgba(255,59,48,0.2); }
.setting-info { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.setting-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.setting-icon svg { width: 19px; height: 19px; }
.st-title { font-weight: 600; font-size: 0.93rem; color: #e5e5ea; }
.st-desc { font-size: 0.76rem; color: rgba(255,255,255,0.3); line-height: 1.45; }

/* ── History ── */
.history-list { display: flex; flex-direction: column; gap: 0.4rem; }
.history-item {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.9rem 1.15rem; border-radius: 14px;
    animation: fadeSlideUp 0.4s cubic-bezier(0.16,1,0.3,1) forwards; opacity: 0;
}
.history-number {
    width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px;
    background: rgba(255,210,0,0.06); color: rgba(255,210,0,0.6);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-family: 'Outfit'; font-size: 0.72rem;
    border: 1px solid rgba(255,210,0,0.1);
}
.history-color { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.history-prize-name { flex: 1; font-weight: 600; font-size: 0.92rem; color: rgba(255,255,255,0.85); }
.history-time { font-size: 0.74rem; color: rgba(255,255,255,0.2); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── Contacts ── */
.contacts-container { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.contact-item {
    display: flex; flex-direction: column; gap: 0.7rem;
    padding: 1.1rem 1.2rem; border-radius: 16px;
    animation: fadeSlideUp 0.4s cubic-bezier(0.16,1,0.3,1) forwards; opacity: 0;
}
.contact-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 0.6rem; }
.contact-name { font-family: 'Outfit'; font-size: 1.02rem; font-weight: 700; color: #fff; }
.contact-date { font-size: 0.7rem; color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.04); padding: 0.25rem 0.65rem; border-radius: 20px; font-weight: 500; }
.contact-body { display: flex; flex-direction: column; gap: 0.4rem; }
.cb-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; }
.cb-label { color: rgba(255,255,255,0.25); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.cb-link { color: #58a6ff; text-decoration: none; font-weight: 600; font-size: 0.85rem; transition: color 0.2s; }
.cb-link:hover { color: #79bbff; }

/* ── Bottom Nav ── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(66px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(12,12,16,0.88);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; justify-content: space-around; align-items: center;
    padding-left: 0.25rem; padding-right: 0.25rem; z-index: 100;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: transparent; border: none; text-decoration: none;
    color: rgba(255,255,255,0.3); height: 100%; flex: 1; gap: 0.25rem;
    cursor: pointer; transition: color 0.25s ease; position: relative;
}
.nav-item svg { width: 20px; height: 20px; transition: color 0.25s ease; }
.nav-item span { font-size: 0.6rem; font-weight: 500; letter-spacing: 0.01em; }
.nav-item.active { color: var(--gold); }
.nav-item.active span { font-weight: 600; }
.nav-item:active { opacity: 0.5; }

/* ── Stock Module ── */
.stock-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-top: 0.5rem; }
@media (min-width: 500px) { .stock-grid { grid-template-columns: 1fr 1fr; } }

.stock-card {
    border-radius: 14px; padding: 1.1rem 1.2rem;
    animation: fadeSlideUp 0.35s ease forwards; opacity: 0;
}
.stock-card-out { background: rgba(255,59,48,0.06) !important; border-color: rgba(255,59,48,0.12) !important; }
.stock-card-low { background: rgba(255,149,0,0.06) !important; border-color: rgba(255,149,0,0.12) !important; }
.stock-card-header { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.stock-card-color { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.15); }
.stock-card-name { font-weight: 700; font-size: 1rem; flex: 1; min-width: 0; word-break: break-word; color: #fff; }
.stock-badge-out {
    font-size: 0.6rem; font-weight: 800; background: rgba(255,59,48,0.15);
    color: #ff3b30; padding: 0.2rem 0.55rem; border-radius: 20px;
    letter-spacing: 0.08em; border: 1px solid rgba(255,59,48,0.25);
}
.stock-badge-low {
    font-size: 0.6rem; font-weight: 800; background: rgba(255,165,0,0.12);
    color: #ff9500; padding: 0.2rem 0.55rem; border-radius: 20px;
    letter-spacing: 0.08em; border: 1px solid rgba(255,165,0,0.25);
}
.stock-card-body { display: flex; flex-direction: column; gap: 0.5rem; }
.stock-controls { display: flex; align-items: center; gap: 0.6rem; }
.stock-controls.hidden { display: none; }
.stock-toggle { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.82rem; color: #aaa; user-select: none; }
.stock-toggle input { cursor: pointer; width: 16px; height: 16px; accent-color: var(--gold); }
.stock-btn {
    width: 38px; height: 38px; border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03); color: #fff;
    font-size: 1.2rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; line-height: 1;
}
.stock-btn:hover { background: rgba(255,210,0,0.08); border-color: rgba(255,210,0,0.25); color: var(--gold); }
.stock-btn:active { transform: scale(0.9); }
.stock-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.stock-btn-minus:hover:not(:disabled) { background: rgba(255,59,48,0.1); border-color: rgba(255,59,48,0.25); color: #ff3b30; }
.stock-count {
    font-family: 'Outfit', sans-serif; font-size: 1.4rem; font-weight: 700;
    min-width: 48px; text-align: center;
    color: #fff; background: transparent; border: none; outline: none;
    -moz-appearance: textfield;
}
.stock-count::-webkit-inner-spin-button, .stock-count::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.prize-stock-input { width: 60px; padding: 0.4rem; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; color: #fff; font-family: inherit; font-size: 0.9rem; text-align: center; }
.prize-stock-input:focus { border-color: var(--gold); outline: none; }

/* ── Sidebar (Desktop) ── */
.admin-sidebar { display: none; }
.top-bar-right { display: flex; align-items: center; gap: 0.5rem; }

@media (min-width: 1024px) {
    .admin-top-bar { display: none; }
    .bottom-nav { display: none; }

    .admin-sidebar {
        display: flex; flex-direction: column;
        position: fixed; top: 0; left: 0; bottom: 0; width: 250px;
        background: rgba(12,12,18,0.92);
        backdrop-filter: blur(48px) saturate(180%);
        border-right: 1px solid rgba(255,255,255,0.06);
        z-index: 200;
    }
    .sidebar-brand {
        display: flex; align-items: center; gap: 0.8rem;
        padding: 1.75rem 1.35rem 1.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .sidebar-logo { height: 30px; width: auto; filter: drop-shadow(0 2px 10px rgba(255,210,0,0.25)); }
    .sidebar-brand-text { display: flex; flex-direction: column; gap: 0.15rem; }
    .sidebar-brand-name {
        font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1rem;
        letter-spacing: 0.06em; color: #fff;
    }
    .sidebar-brand-sub { font-size: 0.6rem; color: rgba(255,255,255,0.25); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }

    .sidebar-nav { flex: 1; padding: 1rem 0.8rem; display: flex; flex-direction: column; gap: 0.2rem; }
    .sidebar-link {
        display: flex; align-items: center; gap: 0.85rem; border-radius: 11px;
        padding: 0.7rem 0.95rem; background: transparent; border: none;
        color: rgba(255,255,255,0.35); font-size: 0.86rem; font-weight: 500;
        cursor: pointer; transition: all 0.2s; text-align: left;
        font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
        position: relative;
    }
    .sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
    .sidebar-link:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.04); }
    .sidebar-link.active {
        color: #fff; background: rgba(255,255,255,0.055);
        border: 1px solid rgba(255,255,255,0.08);
    }
    .sidebar-link.active::before {
        content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
        width: 2.5px; border-radius: 0 2px 2px 0;
        background: var(--gold);
    }
    .sidebar-footer { padding: 1rem 0.8rem; border-top: 1px solid rgba(255,255,255,0.05); }
    .sidebar-logout { color: rgba(255,255,255,0.25); }
    .sidebar-logout:hover { color: #ff453a; background: rgba(255,59,48,0.06); }

    .admin-main { margin-left: 250px; max-width: 880px; padding: 0.5rem 2.5rem 2rem; }
    .tab-hero { padding: 2rem 0 0; }
    .tab-pane { padding: 0 0 2rem; }
    .tab-actions { padding-bottom: 2rem; }
    .prize-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
    .analytics-dashboard { grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
    .stock-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════════════════════════════════════════
   QR VERIFICATION MODULE
   ═══════════════════════════════════════════════ */

.scanner-container { margin-top: 0.5rem; }
.qr-scanner-box {
    display: none; width: 100%; max-width: 400px; margin: 0 auto 1.5rem;
    border-radius: 20px; overflow: hidden;
    border: 2px solid rgba(255,210,0,0.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.qr-scanner-box video, .qr-scanner-box canvas, .qr-scanner-box img { border-radius: 18px; width: 100%; height: auto; }
.scanner-controls { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.manual-token-input {
    background: rgba(18,18,24,0.6); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 18px; padding: 1.2rem; margin-bottom: 1.5rem;
}

/* Claim Result Card */
.claim-result-card { animation: fadeSlideUp 0.5s cubic-bezier(0.16,1,0.3,1) forwards; }
.claim-card {
    background: rgba(18,18,24,0.8); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 22px;
    padding: 2rem; text-align: center; position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.35);
}
.claim-card-error { border-color: rgba(255,59,48,0.15); }
.claim-status-badge {
    position: absolute; top: 1rem; right: 1rem;
    font-size: 0.62rem; font-weight: 800; padding: 0.3rem 0.8rem;
    border-radius: 20px; letter-spacing: 0.1em; text-transform: uppercase;
}
.claim-icon-circle {
    width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid;
}
.claim-prize-name {
    font-family: 'Outfit'; font-size: 1.5rem; font-weight: 900;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}
.claim-details {
    background: rgba(0,0,0,0.25); border-radius: 16px; padding: 1rem;
    display: flex; flex-direction: column; gap: 0.55rem;
}
.claim-detail-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.88rem; }
.cdl { color: rgba(255,255,255,0.3); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.cdv { color: #fff; font-weight: 600; }

.claim-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.btn-claim-confirm {
    width: 100%; padding: 1rem; border-radius: 14px; border: none;
    background: linear-gradient(135deg, #00E676, #00C853);
    color: #000; font-family: 'Outfit'; font-weight: 800; font-size: 1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    box-shadow: 0 6px 24px rgba(0,200,83,0.25); transition: all 0.25s;
}
.btn-claim-confirm:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,200,83,0.35); }
.btn-claim-confirm:active { transform: translateY(0); }
.btn-claim-reject {
    width: 100%; padding: 0.85rem; border-radius: 12px;
    background: transparent; border: 1px solid rgba(255,59,48,0.2);
    color: #ff3b30; font-family: 'Outfit'; font-weight: 700; font-size: 0.88rem;
    cursor: pointer; transition: 0.2s;
}
.btn-claim-reject:hover { background: rgba(255,59,48,0.08); }

/* ═══════════════════════════════════════════════
   VERIFY MODE TOGGLE
   ═══════════════════════════════════════════════ */
.verify-mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.verify-mode-btn {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
    padding: 0.9rem 0.7rem; border-radius: 14px; cursor: pointer;
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.3); transition: all 0.25s; text-align: center;
}
.verify-mode-btn span { font-weight: 600; font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.verify-mode-btn small { font-size: 0.65rem; color: rgba(255,255,255,0.2); line-height: 1.35; }
.verify-mode-btn:hover { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); }
.verify-mode-btn.active {
    border-color: rgba(255,210,0,0.25); background: rgba(255,210,0,0.05);
    color: var(--gold); box-shadow: 0 0 20px rgba(255,210,0,0.05);
}
.verify-mode-btn.active span { color: var(--gold); }
.verify-mode-btn.active small { color: rgba(255,255,255,0.35); }

/* ═══════════════════════════════════════════════
   KEYFRAMES & SAFEGUARDS
   ═══════════════════════════════════════════════ */
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-10px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

@media (max-width: 375px) {
    .login-wrapper { padding: 1rem; }
    .login-card { padding: 2rem 1.25rem; border-radius: 20px; }
    .brand-logo-main { max-width: 180px; }
    .input-wrapper input { padding: 1rem 0.5rem 1rem 2.8rem; font-size: 0.9rem; }
    .login-subtitle { font-size: 0.8rem; letter-spacing: 0.05em; margin-bottom: 1.5rem; }
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
