/* ══════════════════════════════════════════
   Lucky Wheel v2 — Premium Dark-Glass UI
   ══════════════════════════════════════════ */

/* ── Theme Variables ── */
:root {
    --lw-bg: #0b0f1a;
    --lw-bg2: #111827;
    --lw-surface: rgba(255, 255, 255, 0.04);
    --lw-surface-hover: rgba(255, 255, 255, 0.08);
    --lw-glass: rgba(255, 255, 255, 0.06);
    --lw-glass-border: rgba(255, 255, 255, 0.1);
    --lw-text: #f1f5f9;
    --lw-text2: #94a3b8;
    --lw-text3: #64748b;
    --lw-accent1: #6366f1;
    --lw-accent2: #ec4899;
    --lw-accent3: #8b5cf6;
    --lw-gold: #fbbf24;
    --lw-success: #10b981;
    --lw-danger: #ef4444;
    --lw-radius: 16px;
    --lw-glow: 0 0 40px rgba(99, 102, 241, 0.15);
}

/* ── Page Wrapper ── */
.lw-page {
    background: var(--lw-bg);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
    color: var(--lw-text);
}

.lw-page *,
.lw-page *::before,
.lw-page *::after {
    box-sizing: border-box;
}

/* Reset main-content spacing from layout */
.main-content:has(.lw-page) {
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide distracting UI elements on lucky wheel page */
body:has(.lw-page) .floating-actions,
body:has(.lw-page) .back-to-top {
    display: none !important;
}

/* ── Dark footer when on Lucky Wheel page ── */
/* Override landing.css CSS vars to force dark theme on footer */
body:has(.lw-page) {
    --lp-footer-bg: #0b0f1a;
    --lp-footer-text: #94a3b8;
    --lp-footer-heading: #f1f5f9;
    --lp-footer-border: rgba(255, 255, 255, 0.08);
    --lp-primary: #6366f1;
}

body:has(.lw-page) .footer-lp {
    background: #0b0f1a !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body:has(.lw-page) .footer-lp,
body:has(.lw-page) .footer-lp p,
body:has(.lw-page) .footer-lp li,
body:has(.lw-page) .footer-lp span {
    color: #94a3b8;
}

body:has(.lw-page) .footer-lp a {
    color: #94a3b8;
}

body:has(.lw-page) .footer-lp h4 {
    color: #f1f5f9 !important;
}

body:has(.lw-page) .footer-lp a:hover {
    color: #818cf8 !important;
}

body:has(.lw-page) .footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}

body:has(.lw-page) .footer-bottom p,
body:has(.lw-page) .footer-bottom-links a {
    color: #64748b !important;
}

body:has(.lw-page) .footer-bottom-links a:hover {
    color: #94a3b8 !important;
}

body:has(.lw-page) .footer-grid {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

body:has(.lw-page) .footer-logo-icon {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

body:has(.lw-page) .footer-logo-icon svg {
    stroke: #818cf8 !important;
}

body:has(.lw-page) .footer-logo-text {
    color: #f1f5f9 !important;
}

body:has(.lw-page) .footer-cert-badge {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body:has(.lw-page) .footer-cert-badge svg {
    stroke: #64748b !important;
}

body:has(.lw-page) .footer-social a {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body:has(.lw-page) .footer-social a:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #818cf8 !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

body:has(.lw-page) .footer-col ul li a {
    color: #94a3b8 !important;
}

body:has(.lw-page) .footer-col ul li a:hover {
    color: #818cf8 !important;
}

/* ── Particles Background ── */
.lw-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.lw-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--lw-accent1);
    opacity: 0.15;
    animation: lw-float linear infinite;
}

@keyframes lw-float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 0.15;
    }

    90% {
        opacity: 0.15;
    }

    100% {
        transform: translateY(-20px) scale(1);
        opacity: 0;
    }
}

/* ── Toolbar ── */
.lw-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(11, 15, 26, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--lw-glass-border);
}

.lw-toolbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.lw-toolbar-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lw-toolbar-badge {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--lw-accent1), var(--lw-accent2));
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.lw-toolbar h1 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Program name — subtitle below main title */
.lw-program-name {
    display: none;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--lw-gold);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.lw-toolbar-right {
    display: flex;
    gap: 6px;
}

.lw-tb-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--lw-surface);
    color: var(--lw-text2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.lw-tb-btn:hover {
    background: var(--lw-surface-hover);
    color: var(--lw-text);
    border-color: var(--lw-glass-border);
}

.lw-tb-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--lw-accent1);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ── Main Layout ── */
.lw-main {
    position: relative;
    z-index: 1;
    padding: 40px 0 80px;
}

.lw-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.lw-grid {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 48px;
    align-items: start;
}

/* ── Wheel Column ── */
.lw-wheel-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 80px;
}

.lw-wheel-stage {
    position: relative;
    width: 420px;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ══════════════════════════════════
   FULLSCREEN — Premium Game Show Mode
   ══════════════════════════════════ */

/* Spotlight — absolute, no layout impact */
.lw-spotlight {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* History panel — hidden by default */
.lw-fs-right { display: none; }

/* ── Fullscreen page wrapper — CSS Grid layout ── */
.lw-page.fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99990;
    overflow: hidden;
    display: grid;
    grid-template:
        "header header" auto
        "main   side  " 1fr
        / 1fr 280px;
    background:
        radial-gradient(ellipse 70% 60% at 40% 55%, rgba(99,102,241,0.10) 0%, transparent 65%),
        radial-gradient(ellipse 40% 35% at 75% 45%, rgba(139,92,246,0.07) 0%, transparent 55%),
        #07090f;
}

.lw-page.fullscreen .lw-spotlight {
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 60% 55% at 38% 55%,
        rgba(251,191,36,0.07) 0%,
        rgba(99,102,241,0.07) 40%,
        transparent 70%);
    animation: lw-spotlight-pulse 4s ease-in-out infinite;
    z-index: 0;
}

@keyframes lw-spotlight-pulse {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1; }
}

/* Grid area: header */
.lw-page.fullscreen .lw-toolbar {
    grid-area: header;
    position: relative;
    z-index: 10;
    background: rgba(7, 9, 15, 0.92);
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
}

/* Grid area: main — holds the wheel centered */
.lw-page.fullscreen .lw-main {
    grid-area: main;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 0;
}

.lw-page.fullscreen .lw-container {
    width: 100%;
    height: 100%;
    max-width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
}

.lw-page.fullscreen .lw-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
}

.lw-page.fullscreen .lw-panels-col { display: none; }

.lw-page.fullscreen .lw-wheel-col {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Wheel sizing — fits inside main area (minus 80px toolbar, minus 280px side) */
.lw-page.fullscreen .lw-wheel-stage {
    width:  min(calc(100vh - 96px), calc(100vw - 316px), 680px);
    height: min(calc(100vh - 96px), calc(100vw - 316px), 680px);
}

.lw-page.fullscreen .lw-canvas-wrap,
.lw-page.fullscreen #lw-canvas {
    width:  min(calc(100vh - 118px), calc(100vw - 338px), 618px);
    height: min(calc(100vh - 118px), calc(100vw - 338px), 618px);
}

.lw-page.fullscreen .lw-spin-btn {
    width:  clamp(72px, 10vw, 100px);
    height: clamp(72px, 10vw, 100px);
}

.lw-page.fullscreen .lw-spin-inner {
    width:  clamp(62px, 8.8vw, 88px);
    height: clamp(62px, 8.8vw, 88px);
}

.lw-page.fullscreen .lw-spin-text {
    font-size: clamp(0.65rem, 1.4vw, 0.9rem);
    letter-spacing: 2px;
}


.lw-page.fullscreen .lw-leds {
    width:  min(calc(100vh - 88px), calc(100vw - 308px), 700px);
    height: min(calc(100vh - 88px), calc(100vw - 308px), 700px);
}


/* Grid area: side — history panel */
.lw-page.fullscreen .lw-fs-right {
    grid-area: side;
    display: flex;
    flex-direction: column;
    padding: 20px 14px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.25) transparent;
    background: rgba(255,255,255,0.025);
    border-left: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
}

/* Panel title */
.lw-fs-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--lw-text3);
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}


/* Prize entries in fullscreen panel */
.lw-fs-prize-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lw-fs-prize-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s;
    cursor: default;
}

.lw-fs-prize-item:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateX(2px);
}

.lw-fs-prize-item.out {
    opacity: 0.25;
    filter: grayscale(0.8);
}

.lw-fs-pi-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.lw-fs-pi-emoji {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.lw-fs-pi-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--lw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lw-fs-pi-qty {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--lw-accent1);
    white-space: nowrap;
    flex-shrink: 0;
}

.lw-fs-pi-qty.low  { background: rgba(239,68,68,0.15); color: var(--lw-danger); }
.lw-fs-pi-qty.inf  { background: rgba(16,185,129,0.15); color: var(--lw-success); }

/* History in fullscreen panel */
.lw-fs-history {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.lw-fs-h-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.025);
    animation: lw-fs-slide-in 0.35s ease;
}

@keyframes lw-fs-slide-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

.lw-fs-h-emoji { font-size: 1rem; }
.lw-fs-h-name  { flex: 1; color: var(--lw-text); font-weight: 500; }
.lw-fs-h-time  { font-size: 0.68rem; color: var(--lw-text3); }

.lw-fs-empty {
    color: var(--lw-text3);
    font-size: 0.8rem;
    text-align: center;
    padding: 16px 0;
}

/* ── Fullscreen: shake animation on spin ── */
@keyframes lw-fs-shake {
    0%,100% { transform: none; }
    15%  { transform: translateX(-4px) rotate(-0.4deg); }
    30%  { transform: translateX(4px)  rotate(0.4deg); }
    45%  { transform: translateX(-3px) rotate(-0.3deg); }
    60%  { transform: translateX(3px)  rotate(0.3deg); }
    75%  { transform: translateX(-2px); }
    90%  { transform: translateX(2px); }
}

.lw-page.fullscreen.shaking {
    animation: lw-fs-shake 0.5s ease;
}

/* ── Fullscreen: winner flash overlay ── */
.lw-fs-winner-flash {
    position: fixed;
    inset: 0;
    z-index: 99980;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(251,191,36,0.25) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.lw-fs-winner-flash.active {
    opacity: 1;
    animation: lw-flash 0.8s ease-out forwards;
}

@keyframes lw-flash {
    0%   { opacity: 0.9; }
    100% { opacity: 0; }
}

.lw-neon-ring { display: none; }

/* LEDs */
.lw-leds {
    position: absolute;
    width: 410px;
    height: 410px;
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
}

.lw-led {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.5;
}

.lw-led.a {
    background: var(--lw-gold);
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.5);
}

.lw-led.b {
    background: var(--lw-accent2);
    box-shadow: 0 0 5px rgba(236, 72, 153, 0.5);
}

.lw-led.on {
    transform: scale(1.7);
    opacity: 1;
}

.lw-led.a.on {
    box-shadow: 0 0 10px 3px rgba(251, 191, 36, 0.9), 0 0 20px rgba(251, 191, 36, 0.5);
}

.lw-led.b.on {
    box-shadow: 0 0 10px 3px rgba(236, 72, 153, 0.9), 0 0 20px rgba(236, 72, 153, 0.5);
}

/* Canvas */
.lw-canvas-wrap {
    position: relative;
    width: 380px;
    height: 380px;
    z-index: 3;
}

#lw-canvas {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.18),
        0 0 0 8px rgba(99, 102, 241, 0.25),
        0 0 0 14px rgba(251, 191, 36, 0.08),
        0 0 50px rgba(99, 102, 241, 0.2),
        0 0 100px rgba(139, 92, 246, 0.12);
}

/* Pointer */
.lw-pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 44px;
    z-index: 10;
}

.lw-pointer svg {
    width: 100%;
    height: 100%;
}

.lw-pointer.bounce {
    animation: lw-ptr-bounce 0.15s ease;
}

@keyframes lw-ptr-bounce {
    0% {
        transform: translateX(-50%) rotate(0);
    }

    50% {
        transform: translateX(-50%) rotate(8deg);
    }

    100% {
        transform: translateX(-50%) rotate(0);
    }
}

/* Spin Button */
/* ── Spin Button — Nổi bật ── */
.lw-spin-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    width: 100px;
    height: 100px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}


/* Pulsing glow behind the button */
.lw-spin-btn::before {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, transparent 70%);
    animation: lw-glow-pulse 1.8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lw-glow-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.15); }
}

.lw-spin-inner {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fde68a, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 3px rgba(251, 191, 36, 0.4),
        0 6px 28px rgba(245, 158, 11, 0.55),
        0 12px 48px rgba(245, 158, 11, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 4px rgba(0, 0, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

/* Shine sweep animation */
.lw-spin-inner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 255, 0.45) 50%,
        transparent 70%
    );
    animation: lw-shine 3s ease-in-out infinite;
    border-radius: 50%;
}

@keyframes lw-shine {
    0%, 60%, 100% { left: -75%; opacity: 0; }
    20%            { left: 125%; opacity: 1; }
}

.lw-spin-btn:hover:not(:disabled) .lw-spin-inner {
    transform: scale(1.1);
    box-shadow:
        0 0 0 4px rgba(251, 191, 36, 0.6),
        0 8px 36px rgba(245, 158, 11, 0.7),
        0 16px 60px rgba(245, 158, 11, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.lw-spin-btn:active:not(:disabled) .lw-spin-inner {
    transform: scale(0.92);
}

.lw-spin-btn:disabled {
    cursor: not-allowed;
}

.lw-spin-btn:disabled .lw-spin-inner {
    background: linear-gradient(145deg, #475569, #334155);
    box-shadow: none;
    filter: brightness(0.6);
}

.lw-spin-btn:disabled::before {
    animation: none;
    opacity: 0.15;
}

.lw-spin-btn:disabled .lw-spin-inner::after {
    display: none;
}

.lw-spin-text {
    position: relative;
    font-size: 0.88rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(255, 255, 255, 0.3);
}


/* ── Panels Column ── */
.lw-panels-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tabs */
.lw-tabs {
    display: flex;
    background: var(--lw-glass);
    border: 1px solid var(--lw-glass-border);
    border-radius: var(--lw-radius);
    padding: 4px;
    gap: 4px;
}

.lw-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--lw-text2);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.lw-tab:hover {
    color: var(--lw-text);
}

.lw-tab.active {
    background: var(--lw-accent1);
    color: #fff;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

/* Tab Panels */
.lw-tab-panel {
    display: none;
    animation: lw-fadeIn 0.3s ease;
}

.lw-tab-panel.active {
    display: block;
}

@keyframes lw-fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prize Grid */
.lw-prize-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.lw-prize-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--lw-glass);
    border: 1px solid var(--lw-glass-border);
    border-radius: 12px;
    transition: all 0.2s;
    position: relative;
}

.lw-prize-card:hover {
    background: var(--lw-surface-hover);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.lw-prize-card.out-of-stock {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(0.7);
}

.lw-prize-card .lw-pc-emoji {
    font-size: 1.6rem;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.lw-prize-card .lw-pc-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--lw-text);
}

.lw-prize-card .lw-pc-desc {
    font-size: 0.75rem;
    color: var(--lw-text3);
    margin-top: 2px;
    line-height: 1.4;
}

.lw-pc-qty {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--lw-accent1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    white-space: nowrap;
}

.lw-pc-qty.low {
    background: rgba(239, 68, 68, 0.15);
    color: var(--lw-danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.lw-pc-qty.unlimited {
    background: rgba(16, 185, 129, 0.15);
    color: var(--lw-success);
    border-color: rgba(16, 185, 129, 0.2);
}

/* Custom Tab */
.lw-custom-section {
    background: var(--lw-glass);
    border: 1px solid var(--lw-glass-border);
    border-radius: var(--lw-radius);
    padding: 20px;
    margin-bottom: 12px;
}

.lw-custom-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--lw-text);
}

.lw-add-prize-form,
.lw-program-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lw-program-hint {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: var(--lw-text3);
}

.lw-input {
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--lw-glass-border);
    border-radius: 10px;
    color: var(--lw-text);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.lw-input:focus {
    border-color: var(--lw-accent1);
}

.lw-input-sm {
    max-width: 70px;
    min-width: 60px;
    flex: 0;
    text-align: center;
}

.lw-color-input {
    width: 42px;
    height: 42px;
    border: 2px solid var(--lw-glass-border);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    padding: 2px;
}

.lw-btn-add {
    padding: 10px 18px;
    background: var(--lw-accent1);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.lw-btn-add:hover {
    background: var(--lw-accent3);
    transform: translateY(-1px);
}

/* Custom prize list */
.lw-custom-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lw-custom-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.85rem;
}

.lw-custom-item .lw-ci-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.lw-custom-item .lw-ci-emoji {
    font-size: 1.1rem;
}

.lw-custom-item .lw-ci-name {
    flex: 1;
    color: var(--lw-text);
    font-weight: 500;
}

.lw-custom-item .lw-ci-del,
.lw-custom-item .lw-ci-edit {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--lw-text3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.lw-custom-item .lw-ci-del:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--lw-danger);
}

.lw-custom-item .lw-ci-edit:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--lw-accent1);
}

.lw-ci-qty {
    font-size: 0.72rem;
    color: var(--lw-text3);
    flex-shrink: 0;
}

/* Inline edit row */
.lw-edit-row {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 8px;
    margin: -2px 0 4px;
    flex-wrap: wrap;
    animation: lw-edit-in 0.18s ease;
}

.lw-edit-row.open {
    display: flex;
}

@keyframes lw-edit-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lw-ei-name {
    flex: 1;
    min-width: 110px;
    font-size: 0.82rem !important;
    padding: 5px 9px !important;
    height: 32px !important;
}

.lw-ei-qty {
    width: 72px;
    font-size: 0.82rem !important;
    padding: 5px 9px !important;
    height: 32px !important;
}

.lw-ei-save,
.lw-ei-cancel {
    height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    border: none;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.lw-ei-save {
    background: var(--lw-accent1);
    color: #fff;
}

.lw-ei-save:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.lw-ei-cancel {
    background: transparent;
    color: var(--lw-text3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lw-ei-cancel:hover {
    color: var(--lw-text);
    border-color: rgba(255, 255, 255, 0.22);
}

/* Theme options */
.lw-theme-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lw-theme-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--lw-glass-border);
    border-radius: 10px;
    color: var(--lw-text2);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lw-theme-btn span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}

.lw-theme-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.lw-theme-btn.active {
    border-color: var(--lw-accent1);
    background: rgba(99, 102, 241, 0.1);
    color: var(--lw-text);
}

/* Switch */
.lw-switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--lw-text2);
    font-size: 0.85rem;
    cursor: pointer;
}

.lw-switch-label input {
    display: none;
}

.lw-switch {
    width: 40px;
    height: 22px;
    background: var(--lw-text3);
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
}

.lw-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.lw-switch-label input:checked+.lw-switch {
    background: var(--lw-accent1);
}

.lw-switch-label input:checked+.lw-switch::after {
    transform: translateX(18px);
}

.lw-actions-row {
    margin-top: 12px;
}

.lw-btn-danger {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: var(--lw-danger);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lw-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* History */
.lw-history-list {
    background: var(--lw-glass);
    border: 1px solid var(--lw-glass-border);
    border-radius: var(--lw-radius);
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.lw-empty-state {
    text-align: center;
    padding: 32px 0;
    color: var(--lw-text3);
    font-size: 0.9rem;
}

.lw-h-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    transition: background 0.2s;
}

.lw-h-item+.lw-h-item {
    margin-top: 4px;
}

.lw-h-item:hover {
    background: var(--lw-surface);
}

.lw-h-item .lw-h-emoji {
    font-size: 1.4rem;
}

.lw-h-item .lw-h-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--lw-text);
}

.lw-h-item .lw-h-time {
    font-size: 0.75rem;
    color: var(--lw-text3);
}

/* Rules */
.lw-rules-box {
    background: var(--lw-glass);
    border: 1px solid var(--lw-glass-border);
    border-radius: var(--lw-radius);
    padding: 0;
}

.lw-rules-box summary {
    padding: 14px 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lw-text2);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.lw-rules-box summary:hover {
    color: var(--lw-text);
}

.lw-rules-box summary::-webkit-details-marker {
    display: none;
}

.lw-rules-box summary::after {
    content: '▸';
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 0.7rem;
}

.lw-rules-box details[open] summary::after {
    transform: rotate(90deg);
}

.lw-rules-box ul {
    list-style: none;
    padding: 0 20px 16px;
    margin: 0;
}

.lw-rules-box li {
    padding: 6px 0 6px 20px;
    position: relative;
    font-size: 0.82rem;
    color: var(--lw-text3);
    line-height: 1.6;
}

.lw-rules-box li::before {
    content: '›';
    position: absolute;
    left: 4px;
    color: var(--lw-accent1);
    font-weight: bold;
}

/* ── Result Modal ── */
/* ── Result Modal ── */
.lw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(14px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lw-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lw-modal {
    --modal-color: #6366f1;
    background: #0d1117;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    max-width: 400px;
    width: 92%;
    text-align: center;
    position: relative;
    transform: scale(0.8) translateY(32px);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 32px 80px rgba(0,0,0,0.6),
        0 0 60px color-mix(in srgb, var(--modal-color) 20%, transparent);
    overflow: hidden;
}

.lw-modal-overlay.active .lw-modal {
    transform: scale(1) translateY(0);
}

/* Colored top strip */
.lw-modal-strip {
    height: 5px;
    width: 100%;
    background: var(--modal-color);
    opacity: 0.9;
}

.lw-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    color: var(--lw-text3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}
.lw-modal-close:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

/* Prize color icon circle */
.lw-modal-icon-wrap {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px auto 0;
    animation: lw-icon-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 0.1s;
}

@keyframes lw-icon-pop {
    0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
    60%  { transform: scale(1.15) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.lw-modal-icon {
    font-size: 2.8rem;
    line-height: 1;
}

/* Body */
.lw-modal-body {
    padding: 20px 32px 0;
}

.lw-modal-sublabel {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--lw-text3);
    margin: 0 0 10px;
    animation: lw-modal-fade-up 0.4s ease both;
    animation-delay: 0.2s;
}

.lw-modal-prize {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.15;
    letter-spacing: -0.5px;
    animation: lw-modal-fade-up 0.4s ease both;
    animation-delay: 0.28s;
}

.lw-modal-desc {
    font-size: 0.88rem;
    color: var(--lw-text2);
    margin: 0 0 4px;
    line-height: 1.6;
    animation: lw-modal-fade-up 0.4s ease both;
    animation-delay: 0.34s;
}

@keyframes lw-modal-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Actions */
.lw-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 24px 32px 28px;
    animation: lw-modal-fade-up 0.4s ease both;
    animation-delay: 0.4s;
}

.lw-modal-btn {
    flex: 1;
    padding: 12px 20px;
    background: var(--modal-color);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.lw-modal-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.lw-modal-btn-ghost {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255,255,255,0.06);
    color: var(--lw-text2);
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.lw-modal-btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Confetti */
.lw-modal-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.lw-confetti {
    position: absolute;
    border-radius: 2px;
    animation: lw-confetti-drop 2.5s ease-out forwards;
    opacity: 0;
}

@keyframes lw-confetti-drop {
    0%   { opacity: 1; transform: translateY(-20px) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translateY(450px) rotate(900deg) scale(0.4); }
}

/* ── Themes ── */
.lw-page[data-theme="sunset"] {
    --lw-accent1: #f59e0b;
    --lw-accent2: #ef4444;
    --lw-accent3: #f97316;
}

.lw-page[data-theme="ocean"] {
    --lw-accent1: #0891b2;
    --lw-accent2: #3b82f6;
    --lw-accent3: #06b6d4;
}

.lw-page[data-theme="forest"] {
    --lw-accent1: #10b981;
    --lw-accent2: #84cc16;
    --lw-accent3: #14b8a6;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .lw-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .lw-wheel-col {
        position: static;
    }

    .lw-prize-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .lw-toolbar {
        padding: 10px 16px;
    }

    .lw-toolbar h1 {
        font-size: 1rem;
    }

    .lw-toolbar-badge {
        display: none;
    }

    .lw-wheel-stage {
        width: 320px;
        height: 320px;
    }

    .lw-canvas-wrap,
    #lw-canvas {
        width: 290px;
        height: 290px;
    }

    .lw-leds {
        width: 310px;
        height: 310px;
    }

    .lw-spin-btn {
        width: 76px;
        height: 76px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .lw-spin-inner {
        width: 66px;
        height: 66px;
    }

    .lw-spin-text {
        font-size: 0.72rem;
        letter-spacing: 2px;
    }

    .lw-tabs {
        overflow-x: auto;
    }

    .lw-tab {
        font-size: 0.78rem;
        padding: 8px 10px;
    }

    .lw-modal-body {
        padding: 16px 20px 0;
    }

    .lw-modal-actions {
        padding: 20px 20px 24px;
        flex-direction: column;
    }

    .lw-modal-prize {
        font-size: 1.6rem;
    }
}

/* ══════════════════════════════════════════
   SESSION MODE — read-only lock
   ══════════════════════════════════════════ */

/* Hide the Tùy chỉnh toolbar button entirely */
.lw-session-mode #lw-customize-toggle { display: none !important; }

/* Hide the entire Tùy chỉnh tab button in the tab bar */
.lw-session-mode .lw-tab[data-tab="custom"] { display: none !important; }

/* Hide the add-prize form */
.lw-session-mode .lw-add-prize-form { display: none !important; }

/* Show a read-only notice above prize list in customize tab */
.lw-session-mode .lw-custom-section::before {
    content: '🔒 Chế độ xem — không thể chỉnh sửa';
    display: block;
    background: rgba(251,191,36,.08);
    border: 1px solid rgba(251,191,36,.25);
    color: #fbbf24;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* ══════════════════════════════════════════
   SESSION / SHARE SYSTEM
   ══════════════════════════════════════════ */

/* ── Session badge in toolbar ── */
.lw-session-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .3px;
    white-space: nowrap;
    margin-right: 4px;
}
.lw-session-badge svg { flex-shrink: 0; }
.lw-session-spins { opacity: .75; }

/* ── Live dot — realtime connection indicator ── */
.lw-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
    flex-shrink: 0;
    transition: background 0.3s;
}
.lw-live-dot.connected {
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: lw-live-pulse 1.8s ease-out infinite;
}
@keyframes lw-live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70%  { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ── Share button in Customize tab ── */
.lw-share-section p.lw-program-hint {
    color: var(--lw-text2);
    font-size: 0.82rem;
    margin: 0 0 12px;
    line-height: 1.5;
}
.lw-btn-share {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.lw-btn-share:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.7);
    color: #a5b4fc;
}

/* ── Share modal ── */
.lw-share-modal {
    width: min(440px, 92vw) !important;
    padding: 0 !important;
    background: #141826 !important;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px !important;
    overflow: hidden;
}

.lw-share-modal-body {
    padding: 36px 28px 32px;
    text-align: center;
}

/* Spinner */
.lw-sm-spinner {
    width: 38px; height: 38px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: lw-spin-anim .7s linear infinite;
    margin: 0 auto 14px;
}
@keyframes lw-spin-anim { to { transform: rotate(360deg); } }

#lw-sm-loading p { color: var(--lw-text2); font-size: 0.9rem; margin: 0; }

/* Success */
.lw-sm-icon { font-size: 2.8rem; margin-bottom: 10px; line-height: 1; }

#lw-sm-success h3 {
    color: var(--lw-text);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 6px;
}
.lw-sm-hint {
    color: var(--lw-text2);
    font-size: 0.84rem;
    margin: 0 0 16px;
}

.lw-sm-link-box {
    display: flex;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 6px 6px 6px 12px;
    margin-bottom: 12px;
}
.lw-sm-link-box input {
    flex: 1;
    background: none;
    border: none;
    color: #a5b4fc;
    font-size: 0.82rem;
    outline: none;
    font-family: monospace;
    min-width: 0;
}
.lw-sm-link-box button {
    flex-shrink: 0;
    width: 34px; height: 34px;
    border-radius: 8px;
    background: rgba(99,102,241,.2);
    border: 1px solid rgba(99,102,241,.4);
    color: #818cf8;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.lw-sm-link-box button:hover { background: rgba(99,102,241,.4); }

.lw-sm-room-id {
    color: var(--lw-text2);
    font-size: 0.82rem;
    margin: 0 0 8px;
}
.lw-sm-room-id strong { color: #fbbf24; font-size: 1rem; letter-spacing: 1.5px; }

.lw-sm-note {
    color: var(--lw-text3);
    font-size: 0.75rem;
    margin: 0;
    line-height: 1.5;
}

/* Error */
#lw-sm-error p { color: #fca5a5; font-size: 0.9rem; margin: 8px 0 0; }