/* ==========================================================================
   OOREDOO 5G VILLAGE — TIRAGE AU SORT
   Design: Ooredoo Moderne — Épuré & Minimaliste
   Color Palette: Deep charcoal base, Ooredoo red accents, clean whites
   ========================================================================== */

:root {
    /* Brand Core */
    --r-red: #ED1C24;
    --r-red-dark: #C41920;
    --r-red-light: #FF4952;
    --r-red-glow: rgba(237, 28, 36, 0.25);
    --r-red-subtle: rgba(237, 28, 36, 0.08);

    /* Neutrals */
    --r-bg: #0C0F16;
    --r-surface: #13161F;
    --r-surface-2: #1A1E2A;
    --r-surface-3: #222735;
    --r-border: rgba(255, 255, 255, 0.07);
    --r-border-hover: rgba(255, 255, 255, 0.14);

    /* Typography */
    --r-text: #F1F3F8;
    --r-text-2: #A0AAC0;
    --r-text-3: #6B7590;

    /* Accents */
    --r-green: #22C55E;
    --r-gold: #F59E0B;
    --r-gold-light: #FCD34D;

    /* Layout */
    --r-card-h: 76px;
    --r-radius: 16px;
    --r-radius-lg: 24px;
    --r-radius-xl: 32px;
}

/* ===== PAGE CONTAINER ===== */
.raffle-container {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 1.25rem 5rem;
    position: relative;
    z-index: 10;
}

/* ===== TOP BAR ===== */
.raffle-topbar {
    display: flex;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--r-border);
}

.raffle-brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.raffle-brand-badge {
    background: var(--r-red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ===== HERO ===== */
.raffle-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.raffle-title {
    font-size: clamp(1.75rem, 4.5vw, 2.8rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: #fff;
}

.raffle-subtitle {
    font-size: 1rem;
    color: var(--r-text-2);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.55;
    font-weight: 500;
}

/* ===== CARD PANEL ===== */
.raffle-card {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-lg);
    padding: 2rem 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    transition: border-color 0.3s ease;
}

.raffle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--r-red);
    border-radius: 0 0 3px 3px;
    opacity: 0.9;
}

/* ===== STAGE CARD (SLOT MACHINE) ===== */
.raffle-stage-card {
    text-align: center;
    padding: 2rem 1.25rem 1.5rem;
}

.stage-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--r-red-subtle);
    border: 1px solid rgba(237, 28, 36, 0.2);
    color: var(--r-red-light);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    border-radius: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

/* ===== SLOT CHASSIS ===== */
.slot-chassis {
    max-width: 560px;
    margin: 0 auto 2rem;
    position: relative;
    border-radius: var(--r-radius);
    background: var(--r-bg);
    border: 1px solid var(--r-border);
    overflow: hidden;
}

/* Reticle — thin elegant highlight */
.slot-target-reticle {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: var(--r-card-h);
    transform: translateY(-50%);
    border-top: 2px solid var(--r-red);
    border-bottom: 2px solid var(--r-red);
    background: linear-gradient(90deg, rgba(237,28,36,0.06) 0%, rgba(237,28,36,0.02) 50%, rgba(237,28,36,0.06) 100%);
    z-index: 5;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
}

.slot-target-reticle::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--r-red);
    box-shadow: 0 0 8px var(--r-red-glow);
    animation: reticlePulse 2s infinite ease-in-out;
}

.slot-target-reticle::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--r-red);
    box-shadow: 0 0 8px var(--r-red-glow);
    animation: reticlePulse 2s infinite ease-in-out 0.3s;
}

@keyframes reticlePulse {
    0%, 100% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* Vignettes */
.slot-vignette-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 72px;
    background: linear-gradient(to bottom, var(--r-bg) 0%, transparent 100%);
    z-index: 6;
    pointer-events: none;
}

.slot-vignette-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 72px;
    background: linear-gradient(to top, var(--r-bg) 0%, transparent 100%);
    z-index: 6;
    pointer-events: none;
}

/* Viewport */
.slot-viewport {
    height: calc(var(--r-card-h) * 3);
    position: relative;
    overflow: hidden;
}

/* ===== STANDBY SCREEN ===== */
.slot-standby-screen {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--r-bg);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem;
    gap: 1rem;
}

.slot-standby-screen.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.slot-standby-emblem {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--r-red-subtle);
    border: 1px solid rgba(237, 28, 36, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    animation: emblemFloat 3s infinite ease-in-out;
}

@keyframes emblemFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.slot-standby-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--r-text-3);
}

/* ===== TRACK ===== */
.slot-track {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: none;
    flex-direction: column;
    will-change: transform;
    transform: translateY(0);
}

.slot-track.is-active {
    display: flex;
}

/* ===== SLOT ITEMS ===== */
.slot-item {
    height: var(--r-card-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s ease;
}

.slot-item-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-align: left;
}

.slot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.slot-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.slot-phone {
    font-size: 0.8rem;
    color: var(--r-text-3);
    font-weight: 500;
}

.slot-badge-score {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--r-green);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.slot-track.is-fast-rolling .slot-item {
    filter: blur(1.2px);
}

/* ===== BIG DRAW BUTTON ===== */
.btn-big-draw {
    position: relative;
    background: var(--r-red);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 1rem 2.5rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.btn-big-draw::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.btn-big-draw:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--r-red-glow);
}

.btn-big-draw:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-big-draw:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-big-draw:disabled {
    background: var(--r-surface-3);
    color: var(--r-text-3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== SUSPENSE OPTIONS ===== */
.draw-options-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: var(--r-text-3);
}

.suspense-radios {
    display: inline-flex;
    background: var(--r-surface-2);
    border: 1px solid var(--r-border);
    border-radius: 10px;
    padding: 0.15rem;
    gap: 0.15rem;
}

.suspense-option {
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--r-text-3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.suspense-option:hover {
    color: var(--r-text-2);
}

.suspense-option.active {
    background: var(--r-red);
    color: #fff;
}

/* ==========================================================================
   WINNER MODAL
   ========================================================================== */
.winner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 15, 22, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.winner-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

#confetti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

.winner-card-showcase {
    position: relative;
    z-index: 10001;
    max-width: 480px;
    width: 100%;
    background: var(--r-surface);
    border: 1px solid var(--r-border-hover);
    border-radius: var(--r-radius-xl);
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.winner-overlay.is-active .winner-card-showcase {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Crown */
.winner-crown-wrapper {
    width: 72px;
    height: 72px;
    margin: -4.5rem auto 1rem;
    background: var(--r-red);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 12px 32px var(--r-red-glow);
    animation: crownFloat 3s infinite ease-in-out;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(-2deg); }
}

.winner-super-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--r-red-light);
    margin-bottom: 0.4rem;
}

.winner-fullname {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.winner-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 1.25rem 0;
    background: var(--r-surface-2);
    padding: 1rem;
    border-radius: var(--r-radius);
    border: 1px solid var(--r-border);
}

.winner-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.winner-detail-label {
    font-size: 0.7rem;
    color: var(--r-text-3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.winner-detail-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.winner-phone-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-reveal-phone {
    background: none;
    border: none;
    color: var(--r-text-3);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.15rem;
    transition: color 0.2s ease;
}

.btn-reveal-phone:hover {
    color: var(--r-red);
}

/* Winner Actions */
.winner-actions-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.btn-winner-primary {
    background: var(--r-red);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-winner-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--r-red-glow);
}

.btn-winner-secondary-group {
    display: flex;
    gap: 0.5rem;
}

.btn-winner-sub {
    flex: 1;
    background: var(--r-surface-2);
    border: 1px solid var(--r-border);
    color: var(--r-text-2);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn-winner-sub:hover {
    color: #fff;
    border-color: var(--r-border-hover);
    background: var(--r-surface-3);
}

/* ==========================================================================
   HISTORY SECTION
   ========================================================================== */
.history-section {
    margin-top: 2.5rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--r-text);
}

.chip-btn {
    background: var(--r-surface-2);
    border: 1px solid var(--r-border);
    color: var(--r-text-3);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.chip-btn:hover {
    color: var(--r-text);
    border-color: var(--r-border-hover);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item-card {
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.history-item-card:hover {
    border-color: var(--r-border-hover);
    background: var(--r-surface-2);
}

.history-item-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.history-item-meta {
    font-size: 0.75rem;
    color: var(--r-text-3);
    margin-top: 0.15rem;
}

.history-badge {
    background: var(--r-red-subtle);
    color: var(--r-red-light);
    border: 1px solid rgba(237, 28, 36, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.btn-history-detail {
    background: var(--r-surface-2);
    border: 1px solid var(--r-border);
    color: var(--r-text-2);
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-history-detail:hover {
    background: var(--r-red-subtle);
    border-color: rgba(237, 28, 36, 0.3);
    color: #fff;
}

/* ==========================================================================
   PIN AUTHENTICATION
   ========================================================================== */
.pin-screen-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.pin-card {
    max-width: 380px;
    width: 100%;
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.pin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--r-red);
    border-radius: 0 0 3px 3px;
}

.pin-lock-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 14px;
    background: var(--r-red-subtle);
    border: 1px solid rgba(237, 28, 36, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.pin-title {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff;
    margin-bottom: 0.4rem;
}

.pin-subtitle {
    font-size: 0.88rem;
    color: var(--r-text-2);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.raffle-input {
    background: var(--r-bg);
    border: 1px solid var(--r-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

.raffle-input:focus {
    border-color: var(--r-red);
    box-shadow: 0 0 0 3px var(--r-red-subtle);
}

.raffle-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.btn-validate-filter {
    background: var(--r-red);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    height: 48px;
    white-space: nowrap;
}

.btn-validate-filter:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--r-red-glow);
}

.btn-validate-filter:active {
    transform: translateY(0);
}

.pin-error-message {
    min-height: 22px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #EF4444;
    margin-bottom: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pin-error-message.is-visible {
    opacity: 1;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.shake-animation {
    animation: shakeError 0.4s ease-in-out;
}

/* Session indicators */
.session-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--r-green);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-lock-session {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #F87171;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-lock-session:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
}

/* ==========================================================================
   DETAIL MODAL
   ========================================================================== */
.detail-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 15, 22, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.detail-modal-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.detail-card-box {
    max-width: 460px;
    width: 100%;
    background: var(--r-surface);
    border: 1px solid var(--r-border-hover);
    border-radius: var(--r-radius-lg);
    padding: 2rem 1.75rem;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    position: relative;
    transform: scale(0.95) translateY(12px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-modal-overlay.is-active .detail-card-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.detail-badge-order {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--r-red-subtle);
    border: 1px solid rgba(237, 28, 36, 0.2);
    color: var(--r-red-light);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-winner-name {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.detail-info-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--r-surface-2);
    border: 1px solid var(--r-border);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--r-border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row-label {
    font-size: 0.8rem;
    color: var(--r-text-3);
    font-weight: 600;
}

.detail-row-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ==========================================================================
   FILTER ELEMENTS (LEGACY COMPAT)
   ========================================================================== */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-heading {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip-btn.active {
    background: var(--r-red);
    color: #fff;
    border-color: var(--r-red);
}

.filter-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

@media (max-width: 800px) {
    .filter-inputs-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 550px) {
    .filter-inputs-grid {
        grid-template-columns: 1fr;
    }
    .raffle-container {
        padding: 1.25rem 1rem 4rem;
    }
    .raffle-stage-card {
        padding: 1.5rem 0.75rem 1rem;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--r-text-3);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.raffle-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--r-surface-2);
    border-radius: 12px;
    border: 1px solid var(--r-border);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pool-counter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--r-red-subtle);
    border: 1px solid rgba(237, 28, 36, 0.15);
    color: #fff;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
}

.pool-counter-badge strong {
    color: var(--r-red-light);
    font-size: 1rem;
}

.period-indicator {
    color: var(--r-text-3);
    font-size: 0.8rem;
}

.period-indicator strong {
    color: var(--r-text-2);
}

.status-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon-toggle {
    background: var(--r-surface-2);
    border: 1px solid var(--r-border);
    color: var(--r-text-3);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.btn-icon-toggle:hover {
    color: var(--r-text);
    border-color: var(--r-border-hover);
}

.btn-icon-toggle.active {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
    color: var(--r-green);
}

/* Empty State */
.slot-empty-state {
    height: calc(var(--r-card-h) * 3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    gap: 0.75rem;
    color: var(--r-text-3);
}

.slot-empty-icon {
    font-size: 2.2rem;
    opacity: 0.6;
}

/* Keypad (PIN compat) */
.pin-dots-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    transition: all 0.2s ease;
}

.pin-dot.is-filled {
    background: var(--r-red);
    border-color: var(--r-red-light);
    transform: scale(1.15);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 260px;
    margin: 0 auto 1.25rem;
}

.pin-key {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--r-surface-2);
    border: 1px solid var(--r-border);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    user-select: none;
}

.pin-key:hover {
    background: var(--r-surface-3);
    border-color: var(--r-border-hover);
}

.pin-key:active {
    background: var(--r-red);
    border-color: var(--r-red);
    transform: scale(0.95);
}

.pin-key-backspace {
    font-size: 1rem;
    color: var(--r-text-2);
}

.slot-standby-count-pill {
    display: none;
}

/* ==========================================================================
   FILE UPLOAD & PARTICIPANTS IMPORT
   ========================================================================== */
.upload-screen-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 4rem;
}

.upload-card {
    max-width: 680px;
    width: 100%;
    background: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-lg);
    padding: 2.25rem 2rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
}

.upload-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--r-red);
    border-radius: 0 0 3px 3px;
}

.upload-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.upload-icon-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 18px;
    background: var(--r-red-subtle);
    border: 1px solid rgba(237, 28, 36, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    box-shadow: 0 8px 24px var(--r-red-glow);
}

.upload-title {
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    font-size: 0.92rem;
    color: var(--r-text-2);
    line-height: 1.55;
    max-width: 520px;
    margin: 0 auto;
}

/* Column Spec Info */
.upload-spec-box {
    background: var(--r-surface-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.upload-spec-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--r-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.upload-spec-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.upload-spec-tag {
    background: rgba(237, 28, 36, 0.12);
    border: 1px solid rgba(237, 28, 36, 0.3);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.upload-spec-tag span.col-code {
    background: var(--r-red);
    color: #fff;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.72rem;
}

/* Dropzone */
.upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 18px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
    border-color: var(--r-red);
    background: rgba(237, 28, 36, 0.06);
    box-shadow: 0 0 32px var(--r-red-glow);
    transform: translateY(-2px);
}

.upload-drop-icon {
    font-size: 2.75rem;
    margin-bottom: 0.75rem;
    display: inline-block;
    transition: transform 0.2s ease;
}

.upload-dropzone:hover .upload-drop-icon {
    transform: scale(1.12);
}

.upload-drop-text-primary {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.35rem;
}

.upload-drop-text-secondary {
    font-size: 0.85rem;
    color: var(--r-text-3);
    margin-bottom: 1.25rem;
}

.upload-browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--r-surface-3);
    color: #fff;
    border: 1px solid var(--r-border-hover);
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    transition: all 0.2s ease;
    pointer-events: none;
}

.upload-dropzone:hover .upload-browse-btn {
    background: var(--r-red);
    border-color: var(--r-red);
    box-shadow: 0 4px 16px var(--r-red-glow);
}

/* Preview Box */
.upload-preview-box {
    margin-top: 1.5rem;
    background: var(--r-surface-2);
    border: 1px solid var(--r-border-hover);
    border-radius: 16px;
    padding: 1.5rem;
    animation: fadeInPreview 0.35s ease forwards;
}

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

.preview-file-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--r-border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.preview-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.preview-file-icon {
    font-size: 1.75rem;
}

.preview-file-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
}

.preview-file-meta {
    font-size: 0.78rem;
    color: var(--r-text-3);
}

.preview-badge-success {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--r-green);
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

/* Preview Table */
.preview-table-container {
    max-height: 220px;
    overflow-y: auto;
    border-radius: 10px;
    background: var(--r-bg);
    border: 1px solid var(--r-border);
    margin-bottom: 1.25rem;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}

.preview-table th {
    background: var(--r-surface-3);
    color: var(--r-text-2);
    font-weight: 700;
    padding: 0.65rem 0.85rem;
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--r-border);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    z-index: 2;
}

.preview-table td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--r-text);
}

.preview-table tr:last-child td {
    border-bottom: none;
}

.preview-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.preview-table .col-badge-b {
    color: #FF6B72;
    font-weight: 700;
}

.preview-table .col-badge-c {
    color: #60A5FA;
    font-weight: 700;
}

/* Actions in Preview */
.upload-actions-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-start-draw {
    flex: 2;
    min-width: 220px;
    background: var(--r-red);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.9rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 24px var(--r-red-glow);
    transition: all 0.2s ease;
}

.btn-start-draw:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(237, 28, 36, 0.4);
    background: #ff2830;
}

.btn-change-file {
    flex: 1;
    min-width: 130px;
    background: var(--r-surface-3);
    color: var(--r-text-2);
    border: 1px solid var(--r-border-hover);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-change-file:hover {
    background: var(--r-border-hover);
    color: #fff;
}

/* Top bar file badge */
.topbar-file-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--r-text);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-topbar-change {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(237, 28, 36, 0.12);
    border: 1px solid rgba(237, 28, 36, 0.3);
    color: #fff;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-topbar-change:hover {
    background: var(--r-red);
    box-shadow: 0 4px 12px var(--r-red-glow);
}

