﻿:root {
    --white: #ffffff;
    --text: #0f172a;
    --text-soft: #475569;
    --muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --navy: #0f172a;
    --navy-mid: #1e293b;
    --blue: #1e3a5f;
    --purple: #1e3a5f;
    --major: #1e3a5f;
    --minor: #1e40af;
    --accent: var(--major);
    --gold: #c9a227;
    --gold-light: #f5ecd6;
    --gold-dark: #8a6f1e;
    --rose-gold: #e8b4b8;
    --rose-gold-dark: #b76e79;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-glass: rgba(255, 255, 255, 0.82);
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 12px 40px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
    --radius: 12px;
    --radius-lg: 16px;
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --bg-image: url('/ACCCbg.jpg');
    --bg-fallback: #070d18;
    --bg-overlay: linear-gradient(
        108deg,
        rgba(7, 13, 24, 0.36) 0%,
        rgba(7, 13, 24, 0.12) 24%,
        rgba(7, 13, 24, 0.03) 44%,
        transparent 52%,
        rgba(255, 252, 245, 0.08) 64%,
        rgba(255, 252, 245, 0.3) 84%,
        rgba(255, 250, 240, 0.65) 100%
    );
    --bg-image-filter: saturate(1.08) contrast(1.05) brightness(0.6);
    --theme-transition: background 0.7s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.5s ease;
    --party-gold: #d4af37;
    --party-purple: #a855f7;
    --party-pink: #ec4899;
    --danger: #9f1239;
    --danger-hover: #881337;
    --theme-primary: var(--major);
    --theme-secondary: var(--gold);
    --theme-glow-a: rgba(212, 175, 55, 0.45);
    --theme-glow-b: rgba(30, 58, 95, 0.5);
    --theme-glow-c: rgba(201, 162, 39, 0.25);
    --wheel-pointer-color: #fbbf24;
    --wheel-pointer-glow: rgba(251, 191, 36, 0.95);
    --wheel-ring-color: rgba(252, 211, 77, 0.75);
    --wheel-ring-glow-a: rgba(201, 162, 39, 0.32);
    --wheel-ring-glow-b: rgba(30, 58, 95, 0.38);
    --wheel-canvas-glow: rgba(30, 58, 95, 0.16);
    --panel-bg: rgba(255, 252, 245, 0.9);
    --panel-border: rgba(212, 175, 55, 0.38);
    --panel-glow: rgba(30, 58, 95, 0.1);
    --panel-heading-border: linear-gradient(90deg, #1e3a5f, #d4af37, #1e3a5f);
    --table-header-bg: linear-gradient(135deg, #0f2744 0%, #1e3a5f 45%, #8a6f1e 100%);
    --btn-spin-primary: linear-gradient(135deg, #1e3a5f 0%, #0f2744 50%, #152238 100%);
    --btn-spin-primary-shadow: rgba(30, 58, 95, 0.4);
    --btn-spin-secondary: linear-gradient(135deg, #d4af37 0%, #c9a227 50%, #8a6f1e 100%);
    --btn-spin-secondary-shadow: rgba(201, 162, 39, 0.4);
    --btn-spin-accent: linear-gradient(135deg, #f0d875 0%, #c9a227 45%, #8a6f1e 100%);
    --btn-spin-accent-shadow: rgba(184, 149, 47, 0.45);
    --btn-stop-bg: linear-gradient(135deg, #7f1d1d 0%, #9f1239 55%, #881337 100%);
    --btn-stop-shadow: rgba(127, 29, 29, 0.35);
    --btn-reset-bg: linear-gradient(180deg, rgba(255, 252, 245, 0.98) 0%, rgba(245, 236, 214, 0.95) 100%);
    --btn-reset-border: rgba(212, 175, 55, 0.45);
    --btn-reset-color: var(--navy);
    --indicator-glow: 0 0 12px rgba(201, 162, 39, 0.5);
    --nav-hover-accent: var(--gold);
    --confetti-opacity: 0.06;
    --sparkle-opacity: 0.24;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-fallback);
    transition: var(--theme-transition);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -4;
    background-color: var(--bg-fallback);
    background-image: var(--bg-image);
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: var(--bg-image-filter);
    transform: scale(1.008);
    transition: filter 0.8s ease, background-color 0.8s ease;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-overlay);
    pointer-events: none;
    transition: background 0.8s ease;
}

/* ── Major: Grand Gala — premium flagship draw (rich, easy on the eyes) ── */
body[data-raffle="major"] {
    --accent: var(--gold);
    --bg-fallback: #0a1220;
    --bg-overlay: linear-gradient(
        108deg,
        rgba(7, 13, 24, 0.32) 0%,
        rgba(30, 58, 95, 0.12) 24%,
        rgba(201, 162, 39, 0.05) 40%,
        rgba(7, 13, 24, 0.04) 52%,
        rgba(255, 252, 245, 0.12) 66%,
        rgba(255, 252, 245, 0.38) 86%,
        rgba(255, 250, 240, 0.72) 100%
    );
    --bg-image-filter: saturate(1.06) contrast(1.04) brightness(0.62) sepia(0.03);
    --theme-glow-a: rgba(212, 175, 55, 0.38);
    --theme-glow-b: rgba(30, 58, 95, 0.42);
    --theme-glow-c: rgba(159, 18, 57, 0.14);
    --wheel-pointer-color: #e8c547;
    --wheel-pointer-glow: rgba(232, 197, 71, 0.9);
    --wheel-ring-color: rgba(232, 197, 71, 0.85);
    --wheel-ring-glow-a: rgba(212, 175, 55, 0.48);
    --wheel-ring-glow-b: rgba(59, 130, 246, 0.32);
    --wheel-canvas-glow: rgba(212, 175, 55, 0.22);
    --panel-bg: rgba(255, 252, 245, 0.94);
    --panel-border: rgba(212, 175, 55, 0.38);
    --panel-glow: rgba(30, 58, 95, 0.1);
    --panel-heading-border: linear-gradient(90deg, #1e3a5f, #c9a227, #9f1239, #1e3a5f);
    --table-header-bg: linear-gradient(135deg, #0f2744 0%, #1e3a5f 42%, #8a6f1e 100%);
    --btn-spin-primary: linear-gradient(135deg, #1e3a5f 0%, #0f2744 55%, #152238 100%);
    --btn-spin-primary-shadow: rgba(15, 39, 68, 0.38);
    --btn-spin-secondary: linear-gradient(135deg, #e8c547 0%, #c9a227 50%, #8a6f1e 100%);
    --btn-spin-secondary-shadow: rgba(201, 162, 39, 0.38);
    --btn-spin-accent: linear-gradient(135deg, #be123c 0%, #9f1239 50%, #881337 100%);
    --btn-spin-accent-shadow: rgba(127, 29, 29, 0.32);
    --indicator-glow: 0 0 12px rgba(201, 162, 39, 0.45);
    --nav-hover-accent: var(--gold);
    --confetti-opacity: 0.05;
    --sparkle-opacity: 0.22;
}

/* ── Minor: calmer supporting draw ── */
body[data-raffle="minor"] {
    --accent: #94a3b8;
    --bg-fallback: #0a1220;
    --bg-overlay: linear-gradient(
        108deg,
        rgba(10, 18, 32, 0.48) 0%,
        rgba(30, 58, 95, 0.18) 26%,
        rgba(148, 163, 184, 0.03) 42%,
        rgba(10, 18, 32, 0.08) 54%,
        rgba(255, 252, 245, 0.06) 68%,
        rgba(255, 252, 245, 0.28) 88%,
        rgba(248, 250, 252, 0.58) 100%
    );
    --bg-image-filter: saturate(0.92) contrast(1.02) brightness(0.5) hue-rotate(-4deg);
    --theme-primary: #475569;
    --theme-secondary: #94a3b8;
    --theme-glow-a: rgba(148, 163, 184, 0.14);
    --theme-glow-b: rgba(59, 130, 246, 0.16);
    --theme-glow-c: rgba(100, 116, 139, 0.12);
    --wheel-pointer-color: #fde047;
    --wheel-pointer-glow: rgba(253, 224, 71, 0.85);
    --wheel-ring-color: rgba(96, 165, 250, 0.65);
    --wheel-ring-glow-a: rgba(59, 130, 246, 0.35);
    --wheel-ring-glow-b: rgba(250, 204, 21, 0.28);
    --wheel-canvas-glow: rgba(59, 130, 246, 0.2);
    --panel-bg: rgba(248, 250, 252, 0.88);
    --panel-border: rgba(148, 163, 184, 0.32);
    --panel-glow: rgba(30, 58, 95, 0.05);
    --panel-heading-border: linear-gradient(90deg, #64748b, #94a3b8, #64748b);
    --table-header-bg: linear-gradient(135deg, #334155 0%, #475569 55%, #64748b 100%);
    --btn-spin-primary: linear-gradient(135deg, #475569 0%, #334155 55%, #1e293b 100%);
    --btn-spin-primary-shadow: rgba(51, 65, 85, 0.28);
    --btn-spin-secondary: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 50%, #64748b 100%);
    --btn-spin-secondary-shadow: rgba(100, 116, 139, 0.22);
    --btn-spin-accent: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 45%, #64748b 100%);
    --btn-spin-accent-shadow: rgba(100, 116, 139, 0.22);
    --indicator-glow: 0 0 8px rgba(100, 116, 139, 0.35);
    --nav-hover-accent: #64748b;
    --confetti-opacity: 0.02;
    --sparkle-opacity: 0.14;
    --gold-light: #f1f5f9;
    --gold-dark: #64748b;
}

/* Premium raffle atmosphere */
.party-scene {
    position: fixed;
    inset: 0;
    z-index: -3;
    overflow: hidden;
    pointer-events: none;
}

.party-mesh {
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background:
        radial-gradient(ellipse 80% 60% at 20% 0%, var(--theme-glow-a), transparent 55%),
        radial-gradient(ellipse 70% 55% at 85% 15%, var(--theme-glow-b), transparent 50%),
        radial-gradient(ellipse 60% 50% at 50% 100%, var(--theme-glow-c), transparent 60%);
    transition: opacity 0.8s ease;
}

.party-aurora {
    position: absolute;
    inset: -20% -10%;
    opacity: 0.1;
    background: conic-gradient(
        from 220deg at 30% 40%,
        transparent 0deg,
        var(--theme-glow-a) 40deg,
        transparent 80deg,
        var(--theme-glow-b) 140deg,
        transparent 200deg,
        var(--theme-glow-c) 280deg,
        transparent 360deg
    );
    filter: blur(60px);
    animation: aurora-drift 20s ease-in-out infinite alternate;
}

body[data-raffle="major"] .party-mesh {
    opacity: 0.2;
}

body[data-raffle="major"] .party-aurora {
    opacity: 0.12;
    background: conic-gradient(
        from 200deg at 25% 35%,
        transparent 0deg,
        rgba(212, 175, 55, 0.22) 50deg,
        transparent 100deg,
        rgba(30, 58, 95, 0.28) 180deg,
        transparent 260deg,
        rgba(159, 18, 57, 0.1) 320deg,
        transparent 360deg
    );
    animation-duration: 22s;
}

body[data-raffle="minor"] .party-mesh {
    opacity: 0.1;
}

body[data-raffle="minor"] .party-aurora {
    background: conic-gradient(
        from 190deg at 35% 38%,
        transparent 0deg,
        rgba(212, 175, 55, 0.12) 55deg,
        transparent 110deg,
        rgba(37, 99, 235, 0.16) 185deg,
        transparent 265deg,
        rgba(30, 58, 95, 0.14) 320deg,
        transparent 360deg
    );
    opacity: 0.08;
    animation-duration: 24s;
}

.party-bokeh {
    position: absolute;
    inset: 0;
    opacity: 0.28;
    animation: bokeh-pulse 8s ease-in-out infinite alternate;
    transition: background 0.8s ease, opacity 0.8s ease;
}

body[data-raffle="major"] .party-bokeh {
    opacity: 0.26;
    background:
        radial-gradient(ellipse 42% 32% at 10% 15%, rgba(232, 197, 71, 0.18), transparent 68%),
        radial-gradient(ellipse 38% 36% at 92% 10%, rgba(30, 58, 95, 0.24), transparent 70%),
        radial-gradient(ellipse 48% 40% at 82% 90%, rgba(201, 162, 39, 0.1), transparent 72%),
        radial-gradient(ellipse 40% 38% at 6% 85%, rgba(15, 39, 68, 0.2), transparent 70%),
        radial-gradient(ellipse 52% 48% at 48% 42%, rgba(159, 18, 57, 0.06), transparent 75%);
}

body[data-raffle="minor"] .party-bokeh {
    opacity: 0.16;
    background:
        radial-gradient(ellipse 40% 30% at 12% 18%, rgba(148, 163, 184, 0.12), transparent 68%),
        radial-gradient(ellipse 38% 34% at 90% 12%, rgba(100, 116, 139, 0.14), transparent 70%),
        radial-gradient(ellipse 44% 38% at 80% 88%, rgba(148, 163, 184, 0.08), transparent 72%),
        radial-gradient(ellipse 36% 34% at 8% 82%, rgba(71, 85, 105, 0.16), transparent 70%),
        radial-gradient(ellipse 48% 44% at 50% 44%, rgba(100, 116, 139, 0.06), transparent 75%);
}

.party-sparkles {
    position: absolute;
    inset: 0;
    opacity: var(--sparkle-opacity);
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1.5px 1.5px at 25% 65%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 40% 15%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 55% 80%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 70% 35%, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(1.5px 1.5px at 85% 70%, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1px 1px at 95% 25%, rgba(255, 255, 255, 0.7), transparent);
    background-size: 100% 100%;
    animation: sparkle-twinkle 6s ease-in-out infinite alternate;
}

body[data-raffle="major"] .party-sparkles {
    animation-duration: 7s;
    background-image:
        radial-gradient(1.5px 1.5px at 12% 18%, rgba(212, 175, 55, 0.65), transparent),
        radial-gradient(1px 1px at 28% 72%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(1.5px 1.5px at 45% 28%, rgba(30, 58, 95, 0.4), transparent),
        radial-gradient(1px 1px at 62% 88%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1.5px 1.5px at 78% 42%, rgba(201, 162, 39, 0.5), transparent),
        radial-gradient(1px 1px at 90% 15%, rgba(255, 255, 255, 0.4), transparent);
}

body[data-raffle="minor"] .party-sparkles {
    background-image:
        radial-gradient(1px 1px at 14% 20%, rgba(148, 163, 184, 0.45), transparent),
        radial-gradient(1px 1px at 30% 62%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1px 1px at 46% 14%, rgba(203, 213, 225, 0.4), transparent),
        radial-gradient(1px 1px at 60% 90%, rgba(148, 163, 184, 0.3), transparent),
        radial-gradient(1px 1px at 76% 40%, rgba(255, 255, 255, 0.32), transparent),
        radial-gradient(1px 1px at 88% 72%, rgba(100, 116, 139, 0.35), transparent);
    animation-duration: 9s;
}

.party-confetti {
    position: absolute;
    inset: -10%;
    opacity: 0;
    background-size: 280px 200px;
    animation: none;
    transition: opacity 0.8s ease;
}

body[data-raffle="major"] .party-confetti {
    opacity: var(--confetti-opacity);
    animation: confetti-float 32s linear infinite;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #c9a227, transparent),
        radial-gradient(2px 2px at 40px 70px, #1e3a5f, transparent),
        radial-gradient(1.5px 1.5px at 50px 160px, #9f1239, transparent),
        radial-gradient(2px 2px at 90px 40px, #d4af37, transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.5px 1.5px at 160px 120px, #8a6f1e, transparent),
        radial-gradient(2px 2px at 200px 50px, #e8c547, transparent),
        radial-gradient(2px 2px at 250px 140px, #334155, transparent);
}

body[data-raffle="minor"] .party-confetti {
    background-image:
        radial-gradient(2px 2px at 20px 30px, #d4af37, transparent),
        radial-gradient(2px 2px at 40px 70px, #1e40af, transparent),
        radial-gradient(1.5px 1.5px at 50px 160px, #2563eb, transparent),
        radial-gradient(2px 2px at 90px 40px, #c9a227, transparent),
        radial-gradient(2px 2px at 130px 80px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 160px 120px, #1e3a5f, transparent),
        radial-gradient(2px 2px at 200px 50px, #d4af37, transparent),
        radial-gradient(2px 2px at 250px 140px, #3b82f6, transparent);
    animation-duration: 30s;
}

.party-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 84% at 50% 46%, transparent 50%, rgba(0, 0, 0, 0.28) 100%);
    opacity: 0.5;
}

body[data-raffle="major"] .party-vignette {
    background:
        radial-gradient(ellipse 88% 82% at 48% 44%, transparent 50%, rgba(7, 13, 24, 0.28) 100%);
    opacity: 0.38;
}

body[data-raffle="minor"] .party-vignette {
    background:
        radial-gradient(ellipse 88% 82% at 48% 44%, transparent 46%, rgba(10, 18, 32, 0.42) 100%);
    opacity: 0.58;
}

.party-shine {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.01) 42%,
        rgba(255, 255, 255, 0.04) 50%,
        rgba(255, 255, 255, 0.01) 58%,
        transparent 100%
    );
    animation: none;
}

@keyframes aurora-drift {
    from { transform: rotate(0deg) scale(1); opacity: 0.28; }
    to { transform: rotate(8deg) scale(1.06); opacity: 0.42; }
}

@keyframes sparkle-twinkle {
    from { opacity: calc(var(--sparkle-opacity) * 0.7); }
    to { opacity: var(--sparkle-opacity); }
}

@keyframes bokeh-pulse {
    from { opacity: 0.85; transform: scale(1); }
    to { opacity: 1; transform: scale(1.04); }
}

@keyframes confetti-float {
    from { transform: translateY(0); }
    to { transform: translateY(-120px); }
}

@keyframes shine-sweep {
    0%, 100% { opacity: 0.4; transform: translateX(-30%); }
    50% { opacity: 0.9; transform: translateX(30%); }
}

/* Top-right corner: music + fullscreen */
.app-toolbar {
    position: fixed;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    pointer-events: none;
}

.app-toolbar > * {
    pointer-events: auto;
}

.btn-audio,
.btn-fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 10px;
    background: var(--surface-glass);
    backdrop-filter: blur(10px);
    color: var(--navy);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-audio .audio-icon {
    display: block;
}

.btn-audio .audio-off {
    display: none;
}

.btn-audio.is-muted .audio-on {
    display: none;
}

.btn-audio.is-muted .audio-off {
    display: block;
}

.btn-audio:hover,
.btn-fullscreen:hover {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.btn-fullscreen .fs-icon {
    display: block;
}

.btn-fullscreen .fs-icon-exit {
    display: none;
}

.btn-fullscreen.is-fullscreen-active .fs-icon-enter {
    display: none;
}

.btn-fullscreen.is-fullscreen-active .fs-icon-exit {
    display: block;
}

:fullscreen .app-toolbar,
html.is-fullscreen .app-toolbar {
    top: 0.5rem;
    right: 0.5rem;
}

.page {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 3rem 2.25rem;
    position: relative;
    z-index: 1;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.68fr);
    gap: 1rem 1.5rem;
    width: 100%;
    max-width: 1380px;
    height: 100%;
    max-height: calc(100vh - 2.75rem);
    align-items: center;
}

.wheel-watermark {
    position: absolute;
    left: 0.5rem;
    bottom: 1.5rem;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    letter-spacing: 0.2em;
    color: rgba(15, 23, 42, 0.06);
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

@media (min-width: 901px) {
    .wheel-outer {
        width: min(760px, calc(100vh - 7rem), 64vw);
        height: min(760px, calc(100vh - 7rem), 64vw);
    }
}

@media (max-width: 900px) {
    .wheel-watermark {
        display: none;
    }

    body {
        height: auto;
        overflow: auto;
    }

    body::before,
    body::after,
    .party-scene,
    .party-mesh,
    .party-aurora,
    .party-bokeh,
    .party-sparkles,
    .party-confetti,
    .party-vignette,
    .party-shine {
        position: absolute;
        min-height: 100%;
    }

    .party-confetti,
    .party-aurora {
        animation: none;
    }

    .page {
        height: auto;
        max-height: none;
        overflow: visible;
        padding: 1rem;
    }

    .layout {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .panel-column {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .panel-stack {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .table-wrap {
        flex: none;
        max-height: min(50vh, 420px);
    }

    .nav-arrow { display: none; }
}

/* Nav arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: var(--surface-glass);
    backdrop-filter: blur(8px);
    color: var(--muted);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-arrow:hover {
    color: var(--navy);
    border-color: var(--nav-hover-accent);
    background: var(--white);
}

.nav-prev { left: 1.25rem; }
.nav-next { right: 1.25rem; }

/* Bottom indicator */
.raffle-indicator {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-soft);
    padding: 0.45rem 1.1rem;
    background: var(--panel-bg);
    backdrop-filter: blur(10px) saturate(1.02);
    -webkit-backdrop-filter: blur(10px) saturate(1.02);
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-sm), 0 0 24px var(--panel-glow);
    transition: background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

body[data-raffle="major"] #raffle-indicator-label {
    color: #8a6f1e;
}

body[data-raffle="minor"] #raffle-indicator-label {
    color: #64748b;
}

body[data-raffle="major"] .wheel-outer::before {
    animation: wheel-ring-glow 3.6s ease-in-out infinite alternate;
}

body[data-raffle="major"] .raffle-indicator {
    box-shadow: var(--shadow-sm), 0 0 16px var(--panel-glow);
    border-color: rgba(212, 175, 55, 0.32);
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-strong);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.indicator-dot.major.active {
    background: var(--major);
    box-shadow: var(--indicator-glow);
    transform: scale(1.2);
}

.indicator-dot.minor.active {
    background: var(--minor);
    box-shadow: var(--indicator-glow);
    transform: scale(1.2);
}

/* Wheel */
.wheel-column {
    position: relative;
    display: flex;
    justify-content: center;
    align-self: center;
}

.wheel-column::before {
    content: '';
    position: absolute;
    inset: 8% 4%;
    border-radius: 50%;
    background: radial-gradient(ellipse 72% 68% at 50% 48%, rgba(255, 252, 245, 0.14), transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.wheel-stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wheel-pointer {
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 28px solid var(--wheel-pointer-color);
    margin-bottom: -6px;
    z-index: 5;
    filter: drop-shadow(0 0 8px var(--wheel-pointer-glow)) drop-shadow(0 3px 6px rgba(15, 23, 42, 0.35));
    transition: border-top-color 0.6s ease, filter 0.6s ease;
}

.wheel-outer {
    position: relative;
    width: min(640px, 90vw, calc(100vh - 8rem));
    height: min(640px, 90vw, calc(100vh - 8rem));
}

.wheel-outer::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 3px solid var(--wheel-ring-color);
    background: transparent;
    pointer-events: none;
    z-index: 1;
    box-shadow:
        0 0 18px var(--wheel-ring-glow-a),
        0 0 32px var(--wheel-ring-glow-b),
        0 0 48px color-mix(in srgb, var(--wheel-ring-glow-b) 40%, transparent);
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.wheel-outer.spinning::before {
    animation: wheel-ring-glow 0.9s ease-in-out infinite alternate;
}

@keyframes wheel-ring-glow {
    from {
        box-shadow:
            0 0 20px var(--wheel-ring-glow-a),
            0 0 32px var(--wheel-ring-glow-b);
    }
    to {
        box-shadow:
            0 0 36px var(--wheel-ring-glow-a),
            0 0 52px var(--wheel-ring-glow-b);
    }
}

#wheel-canvas {
    display: block;
    position: relative;
    z-index: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow:
        var(--shadow-lg),
        0 0 32px var(--wheel-canvas-glow),
        0 0 64px var(--wheel-ring-glow-b),
        0 0 0 3px rgba(15, 23, 42, 0.35);
    transform-origin: 50% 50%;
    backface-visibility: hidden;
    transition: box-shadow 0.6s ease, filter 0.6s ease;
    filter: brightness(1.06) saturate(1.1);
}

body[data-raffle="major"] #wheel-canvas {
    filter: brightness(1.1) saturate(1.14);
    box-shadow:
        var(--shadow-lg),
        0 0 36px var(--wheel-canvas-glow),
        0 0 56px var(--wheel-ring-glow-b),
        0 0 0 2px rgba(232, 197, 71, 0.5);
}

body[data-raffle="minor"] #wheel-canvas {
    filter: brightness(1.08) saturate(1.12);
    box-shadow:
        var(--shadow-lg),
        0 0 32px var(--wheel-canvas-glow),
        0 0 52px var(--wheel-ring-glow-b),
        0 0 0 3px rgba(96, 165, 250, 0.48);
}

.wheel-outer.spinning #wheel-canvas {
    will-change: transform;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42%;
    height: 42%;
    background: linear-gradient(165deg, #0f2744 0%, #1e293b 52%, #0f172a 100%);
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.48);
    box-shadow:
        0 12px 40px rgba(8, 18, 36, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 8px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
    pointer-events: none;
    z-index: 2;
    transition: border-color 0.6s ease, background 0.6s ease, box-shadow 0.6s ease;
}

body[data-raffle="major"] .wheel-center {
    background: linear-gradient(165deg, #1e3a5f 0%, #0f2744 48%, #0a1628 100%);
    border-color: rgba(212, 175, 55, 0.48);
    box-shadow:
        0 12px 40px rgba(8, 18, 36, 0.42),
        0 0 18px rgba(201, 162, 39, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 8px rgba(0, 0, 0, 0.22);
}

body[data-raffle="minor"] .wheel-center {
    background: linear-gradient(165deg, #1e293b 0%, #0f172a 52%, #020617 100%);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow:
        0 12px 40px rgba(8, 18, 36, 0.5),
        0 0 24px rgba(37, 99, 235, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.wheel-stand {
    position: relative;
    width: min(220px, 45vw);
    height: 80px;
    margin-top: -10px;
}

.wheel-stand::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%);
    width: min(200px, 52vw);
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(15, 23, 42, 0.28), transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.stand-leg {
    position: absolute;
    bottom: 0;
    width: 12px;
    height: 72px;
    background: linear-gradient(180deg, #94a3b8 0%, #475569 55%, #334155 100%);
    border-radius: 3px;
    box-shadow: inset 1px 0 rgba(255, 255, 255, 0.25);
}

.stand-left {
    left: 22px;
    transform: rotate(-16deg);
    transform-origin: bottom center;
}

.stand-right {
    right: 22px;
    transform: rotate(16deg);
    transform-origin: bottom center;
}

.stand-leg::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 170px;
    height: 8px;
    background: linear-gradient(180deg, #64748b, #334155);
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
}

.wheel-badge {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.18) 0%, rgba(15, 39, 68, 0.88) 100%);
    color: #e8c547;
    font-size: clamp(0.5rem, 1.1vmin, 0.65rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
    border: 1px solid rgba(201, 162, 39, 0.28);
    transition: background 0.6s ease, border-color 0.6s ease;
}

body[data-raffle="minor"] .wheel-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(15, 23, 42, 0.9) 100%);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.35);
}

.wheel-prize {
    display: none !important;
}

.wheel-sub {
    font-size: clamp(0.55rem, 1.6vmin, 0.8rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fde047;
    margin-top: 0.2rem;
}

body[data-raffle="minor"] .wheel-sub {
    color: #93c5fd;
}

body[data-raffle="major"] .wheel-sub {
    color: #e8c547;
}

.wheel-pool {
    font-size: clamp(0.48rem, 1.2vmin, 0.65rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.2rem;
    letter-spacing: 0.03em;
}

.wheel-status {
    font-size: clamp(0.5rem, 1.3vmin, 0.7rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.62);
    margin-top: 0.25rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.wheel-winner {
    display: none;
    font-size: clamp(1.2rem, 5.8vmin, 2.75rem);
    font-weight: 800;
    color: #fff;
    margin-top: 0.15rem;
    line-height: 1.05;
    letter-spacing: -0.01em;
    word-break: break-word;
    max-width: 96%;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.wheel-center.show-winner .wheel-winner {
    display: block;
    color: #fef08a;
}

body[data-raffle="minor"] .wheel-center.show-winner .wheel-winner {
    color: #fef08a;
}

.wheel-center.show-winner .wheel-prize,
.wheel-center.show-winner .wheel-sub {
    font-size: clamp(0.5rem, 1.4vmin, 0.72rem);
}

.wheel-center.show-winner .wheel-status {
    font-size: clamp(0.45rem, 1.1vmin, 0.62rem);
    margin-top: 0.15rem;
}

/* Fullscreen: fixed viewport, no scrollbars, compact */
html.is-fullscreen,
html:fullscreen {
    overflow: hidden;
    height: 100%;
    width: 100%;
}

html.is-fullscreen body,
html:fullscreen body {
    overflow: hidden;
    height: 100%;
    width: 100%;
    background-color: var(--bg-fallback);
}

html.is-fullscreen body::before,
html:fullscreen body::before,
html.is-fullscreen body::after,
html:fullscreen body::after {
    position: fixed;
    inset: 0;
}

html.is-fullscreen .page,
html:fullscreen .page {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
    overflow: hidden;
    padding: 0.5rem 3rem 1.75rem;
    align-items: stretch;
    justify-content: center;
}

html.is-fullscreen .layout,
html:fullscreen .layout {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    max-width: 100%;
    gap: 0.5rem 1rem;
    align-items: center;
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
}

html.is-fullscreen .wheel-column,
html:fullscreen .wheel-column {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

html.is-fullscreen .wheel-stage,
html:fullscreen .wheel-stage {
    transform: scale(1);
}

html.is-fullscreen .wheel-outer,
html:fullscreen .wheel-outer {
    width: min(calc(100dvh - 5rem), 74vw, 880px);
    height: min(calc(100dvh - 5rem), 74vw, 880px);
}

html.is-fullscreen .wheel-stand,
html:fullscreen .wheel-stand {
    width: min(160px, 28vw);
    height: 50px;
    margin-top: -6px;
}

html.is-fullscreen .stand-leg,
html:fullscreen .stand-leg {
    height: 44px;
    width: 10px;
}

html.is-fullscreen .stand-leg::after,
html:fullscreen .stand-leg::after {
    width: 120px;
    height: 7px;
}

html.is-fullscreen .panel-column,
html:fullscreen .panel-column {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: calc(100vh - 2rem);
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    padding: 2.5rem 0.5rem 0.5rem;
}

html.is-fullscreen .panel-stack,
html:fullscreen .panel-stack {
    max-width: 420px;
    height: 100%;
    max-height: 100%;
}

html.is-fullscreen .table-heading,
html:fullscreen .table-heading {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

html.is-fullscreen .table-wrap,
html:fullscreen .table-wrap {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

html.is-fullscreen .panel-footer,
html:fullscreen .panel-footer {
    flex-shrink: 0;
}

html.is-fullscreen .prize-table,
html:fullscreen .prize-table {
    font-size: 0.8rem;
}

html.is-fullscreen .prize-table th,
html:fullscreen .prize-table th {
    padding: 0.4rem 0.5rem;
}

html.is-fullscreen .prize-table td,
html:fullscreen .prize-table td {
    padding: 0.35rem 0.5rem;
}

html.is-fullscreen .control-bar,
html:fullscreen .control-bar {
    margin-top: 0.45rem;
    gap: 0.35rem;
    flex-shrink: 0;
}

html.is-fullscreen .control-group,
html:fullscreen .control-group {
    gap: 0.35rem;
}

html.is-fullscreen .btn,
html:fullscreen .btn {
    min-height: 2.35rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.68rem;
}

html.is-fullscreen .setup-drawer,
html:fullscreen .setup-drawer {
    margin-top: 0.4rem;
    flex-shrink: 0;
}

html.is-fullscreen .setup-drawer summary,
html:fullscreen .setup-drawer summary {
    padding: 0.4rem 0.65rem;
    font-size: 0.75rem;
}

html.is-fullscreen .setup-drawer[open] .setup-body,
html:fullscreen .setup-drawer[open] .setup-body {
    max-height: min(28vh, 240px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 0.65rem 0.5rem;
}

html.is-fullscreen .setup-layout,
html:fullscreen .setup-layout {
    gap: 0.45rem;
    padding-top: 0.45rem;
}

html.is-fullscreen .setup-input-wrap textarea,
html:fullscreen .setup-input-wrap textarea {
    min-height: 3.25rem;
    max-height: 4rem;
}

html.is-fullscreen .db-note,
html:fullscreen .db-note {
    margin-top: 0.25rem;
    font-size: 0.65rem;
    flex-shrink: 0;
}

html.is-fullscreen .raffle-indicator,
html:fullscreen .raffle-indicator {
    bottom: 0.35rem;
    font-size: 0.75rem;
}

html.is-fullscreen .nav-arrow,
html:fullscreen .nav-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
}

/* Panel â€” scrollable results, fixed footer for controls + manage */
.panel-column {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    padding: 2.5rem 0.5rem 0.5rem;
}

.panel-stack {
    width: 100%;
    max-width: 440px;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 1.25rem 1.35rem 1rem;
    background: var(--panel-bg);
    backdrop-filter: blur(14px) saturate(1.04);
    -webkit-backdrop-filter: blur(14px) saturate(1.04);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow:
        var(--shadow-md),
        0 0 32px var(--panel-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
    transition: background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

.table-heading {
    text-align: center;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid transparent;
    border-image: var(--panel-heading-border) 1;
    transition: border-image 0.6s ease;
}

.winner-total {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
}

.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.table-wrap::-webkit-scrollbar {
    width: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-wrap::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.prize-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.prize-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.prize-table thead tr {
    background: var(--table-header-bg);
    transition: background 0.6s ease;
}

.prize-table th {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    padding: 0.55rem 0.6rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.prize-table th:last-child { border-right: none; }

.prize-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
    color: var(--text);
}

.prize-table .th-num,
.prize-table .td-num {
    width: 2.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--gold-dark);
}

.td-prize-name {
    font-weight: 600;
    color: var(--text-soft);
    text-align: left;
}

.td-winner {
    text-align: left;
    font-weight: 700;
    color: var(--navy);
}

.prize-main-row td:first-child {
    font-weight: 700;
    color: var(--navy);
}

.table-input {
    width: 100%;
    border: 1px dashed var(--border);
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    font-family: var(--font);
    font-size: 0.85rem;
    text-align: center;
    background: #fafafa;
}

.table-input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(184, 149, 47, 0.15);
}

.winners-summary {
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
}

.winner-row .td-prize-name {
    max-width: 40%;
}

.winner-row:nth-child(odd) td {
    background: #ffffff;
}

.winner-row:nth-child(even) td {
    background: #faf8f4;
}

.winner-row.just-won td {
    background: var(--gold-light) !important;
    animation: winner-flash 1.1s ease;
}

@keyframes winner-flash {
    0% { background: #e0c878; }
    55% { background: #f5ecd6; }
    100% { background: var(--gold-light); }
}

.empty-row td {
    padding: 0;
    border-bottom: none;
}

.winners-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.5rem 1rem 1.75rem;
    text-align: center;
}

.winners-empty-icon {
    display: flex;
    color: rgba(201, 162, 39, 0.55);
}

.winners-empty-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy);
}

.winners-empty-desc {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-soft);
    line-height: 1.45;
    max-width: 16rem;
}

.panel-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.6) 0%, var(--panel-bg) 100%);
}

/* Controls â€” premium responsive draw actions */
.control-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.control-group {
    display: grid;
    gap: 0.45rem;
    width: 100%;
}

.control-group-spins {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-group-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-bar-secondary {
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.75rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: var(--font);
    font-size: clamp(0.68rem, 1.8vw, 0.78rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.15s ease,
        filter 0.25s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.15);
}

.btn-spin {
    width: 100%;
    color: var(--white);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 4px 14px var(--btn-spin-primary-shadow);
}

.btn-spin-10 {
    background: var(--btn-spin-primary);
}

.btn-spin-10:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 6px 18px var(--btn-spin-primary-shadow);
}

.btn-spin-20 {
    background: rgba(255, 252, 245, 0.92);
    color: var(--gold-dark);
    text-shadow: none;
    border-color: rgba(201, 162, 39, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 3px 12px rgba(201, 162, 39, 0.14);
}

.btn-spin-20:hover:not(:disabled) {
    background: rgba(245, 236, 214, 0.95);
    color: var(--navy);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 5px 16px rgba(201, 162, 39, 0.2);
}

.btn-spin-50 {
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-soft);
    text-shadow: none;
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 2px 10px rgba(15, 23, 42, 0.06);
}

.btn-spin-50:hover:not(:disabled) {
    background: rgba(248, 250, 252, 0.95);
    color: var(--navy);
    border-color: rgba(100, 116, 139, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 4px 14px rgba(15, 23, 42, 0.08);
}

.btn-stop {
    width: 100%;
    background: var(--btn-stop-bg);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.16);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 4px 14px var(--btn-stop-shadow);
}

.btn-stop:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 6px 18px var(--btn-stop-shadow);
}

.btn-stop.is-resume {
    background: linear-gradient(135deg, #14532d 0%, #15803d 55%, #166534 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 14px rgba(20, 83, 45, 0.35);
}

.btn-stop.is-resume:hover:not(:disabled) {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 6px 18px rgba(20, 83, 45, 0.4);
}

.btn-reset {
    width: 100%;
    flex-direction: row;
    background: var(--btn-reset-bg);
    color: var(--btn-reset-color);
    border: 1px solid var(--btn-reset-border);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 2px 10px rgba(15, 23, 42, 0.06);
}

.btn-reset:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--navy);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 4px 14px rgba(15, 23, 42, 0.08);
}

.reset-icon {
    font-size: 1.05rem;
    line-height: 1;
    opacity: 0.85;
}

@media (max-width: 520px) {
    .control-group-spins {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .btn-spin-50 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .btn {
        min-height: 2.85rem;
    }
}

.btn-outline {
    background: var(--white);
    color: var(--navy);
    border: 1px solid var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--navy);
    color: var(--navy);
}

.btn-export-full {
    width: 100%;
    max-width: 200px;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.btn-import { cursor: pointer; }

/* Setup drawer â€” premium manage panel */
.setup-drawer {
    margin-top: 0;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, rgba(255, 252, 248, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    overflow: hidden;
}

.setup-drawer summary {
    list-style: none;
    cursor: pointer;
}

.setup-drawer summary::-webkit-details-marker { display: none; }

.setup-drawer-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    color: var(--navy);
    transition: background 0.2s ease;
}

.setup-drawer-summary:hover {
    background: rgba(255, 255, 255, 0.55);
}

.setup-drawer-summary-main {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.setup-drawer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--theme-primary) 0%, color-mix(in srgb, var(--theme-primary) 70%, var(--gold) 30%) 100%);
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--theme-glow-b);
}

.setup-drawer-titles {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.setup-drawer-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.setup-drawer-sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.setup-drawer-chevron {
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--navy);
    border-bottom: 2px solid var(--navy);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-right: 0.15rem;
    opacity: 0.65;
}

.setup-drawer[open] .setup-drawer-chevron {
    transform: rotate(-135deg);
    margin-top: 0.2rem;
}

.setup-body {
    padding: 0 0.65rem 0.7rem;
    border-top: 1px solid var(--border);
    max-height: min(32vh, 280px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.setup-body::-webkit-scrollbar { width: 7px; }

.setup-body::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.5);
    border-radius: 4px;
}

.setup-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8, #64748b);
    border-radius: 4px;
}

.setup-layout {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-top: 0.65rem;
}

.setup-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    position: relative;
}

.setup-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--theme-primary), var(--gold), var(--theme-primary));
    opacity: 0.85;
}

.setup-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem 0.5rem;
    flex-wrap: wrap;
}

.setup-card-head-compact {
    padding-bottom: 0.35rem;
}

.setup-card-head-left {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.setup-card-head-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.setup-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    flex-shrink: 0;
    color: #fff;
}

.setup-card-icon-prize {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
    box-shadow: 0 3px 10px rgba(201, 162, 39, 0.35);
}

.setup-card-icon-roster {
    background: linear-gradient(135deg, var(--theme-primary) 0%, color-mix(in srgb, var(--theme-primary) 80%, #3b82f6 20%) 100%);
    box-shadow: 0 3px 10px var(--theme-glow-b);
}

.setup-card-icon-tools {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 3px 10px rgba(51, 65, 85, 0.25);
}

.setup-card-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.setup-card-desc {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    margin-top: 0.12rem;
    line-height: 1.35;
}

.setup-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--navy);
    background: var(--gold-light);
    border: 1px solid rgba(201, 162, 39, 0.35);
}

.setup-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.setup-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    background: #f1f5f9;
    border: 1px solid var(--border);
}

.setup-stat strong {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}

.setup-stat-accent {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.08) 0%, rgba(201, 162, 39, 0.12) 100%);
    border-color: rgba(201, 162, 39, 0.3);
}

.setup-stat-accent strong {
    color: var(--gold-dark);
}

.setup-input-wrap {
    padding: 0 0.7rem 0.65rem;
}

.setup-input-wrap textarea {
    width: 100%;
    min-height: 6.5rem;
    max-height: 10rem;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font-family: var(--font);
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.setup-input-wrap textarea::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.setup-input-wrap textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
    background: #fff;
}

.setup-card-head-prizes {
    border-bottom: 1px solid rgba(201, 162, 39, 0.15);
    padding-bottom: 0.55rem;
    margin-bottom: 0.15rem;
}

.setup-badge-prize {
    background: linear-gradient(135deg, #fff 0%, var(--gold-light) 100%);
    min-width: 1.85rem;
    height: 1.85rem;
    font-size: 0.78rem;
}

.prizes-add-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0 0.65rem 0.55rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    margin-bottom: 0.45rem;
}

.prizes-add-qty {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 0 0 auto;
}

.prizes-add-qty-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.prizes-add-qty-input {
    width: 4.25rem;
    height: 2.35rem;
    padding: 0 0.5rem;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: var(--navy);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prizes-add-qty-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.prizes-add-bar .btn-setup-add {
    flex: 1 1 auto;
    min-height: 2.35rem;
    padding: 0.45rem 0.85rem;
}

.prizes-list {
    padding: 0 0.65rem 0.7rem;
    max-height: 16rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 162, 39, 0.45) transparent;
}

.prizes-list::-webkit-scrollbar {
    width: 5px;
}

.prizes-list::-webkit-scrollbar-thumb {
    background: rgba(201, 162, 39, 0.45);
    border-radius: 999px;
}

.prizes-list-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.45rem;
    align-items: stretch;
}

.prize-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.prize-col:focus-within {
    border-color: rgba(201, 162, 39, 0.55);
    box-shadow:
        0 4px 14px rgba(15, 23, 42, 0.08),
        0 0 0 3px rgba(201, 162, 39, 0.12);
    transform: translateY(-1px);
}

.prize-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.prize-col-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background: linear-gradient(145deg, var(--theme-primary) 0%, color-mix(in srgb, var(--theme-primary) 70%, var(--gold) 30%) 100%);
    box-shadow: 0 2px 6px var(--theme-glow-b);
}

.prize-col-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.prize-col-delete:hover {
    background: #fff1f2;
    color: var(--danger);
}

.prize-col-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.prize-col-label {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.prize-row-name {
    width: 100%;
    min-height: 2.35rem;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0.4rem 0.45rem;
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--navy);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prize-row-name::placeholder {
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.72rem;
}

.prize-row-name:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.15);
}

.prizes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px dashed rgba(201, 162, 39, 0.45);
    border-radius: 12px;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245, 236, 214, 0.45) 0%, transparent 70%),
        linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.prizes-empty-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold-light) 0%, #fff 100%);
    color: var(--gold-dark);
    box-shadow: 0 4px 14px rgba(201, 162, 39, 0.2);
}

.prizes-empty-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: 0.01em;
}

.prizes-empty-desc {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.45;
    max-width: 18rem;
}

/* Setup action buttons */
.btn-setup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.25rem;
    padding: 0.4rem 0.65rem;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease,
        color 0.2s ease;
    background: #fff;
    color: var(--navy);
}

.btn-setup:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--gold);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.btn-setup:active:not(:disabled) {
    transform: translateY(0);
}

.btn-setup svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.btn-setup-add {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #fff;
    border-color: rgba(138, 111, 30, 0.5);
    box-shadow: 0 3px 12px rgba(201, 162, 39, 0.35);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.btn-setup-add:hover:not(:disabled) {
    filter: brightness(1.05);
    border-color: var(--gold-dark);
    color: #fff;
}

.btn-setup-upload {
    width: 100%;
    font-size: 0.62rem;
    padding: 0.32rem 0.45rem;
    min-height: 1.85rem;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.btn-setup-remove {
    width: 100%;
    font-size: 0.62rem;
    padding: 0.32rem 0.45rem;
    min-height: 1.85rem;
    color: var(--danger);
    border-color: rgba(159, 18, 57, 0.25);
    background: linear-gradient(180deg, #fff 0%, #fff5f7 100%);
}

.btn-setup-remove:hover:not(:disabled) {
    border-color: var(--danger);
    color: var(--danger-hover);
    background: #fff1f2;
}

.setup-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0 0.65rem 0.65rem;
}

.setup-tools-grid .btn-setup {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 3.5rem;
    padding: 0.55rem 0.5rem;
    text-align: left;
    width: 100%;
}

.btn-setup-text {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
}

.btn-setup-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.btn-setup-hint {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--muted);
    line-height: 1.2;
}

.btn-setup-import {
    cursor: pointer;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.06) 0%, #fff 100%);
    border-color: rgba(30, 58, 95, 0.2);
}

.btn-setup-import:hover {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.1) 0%, #fff 100%);
}

.btn-setup-export {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.12) 0%, #fff 100%);
    border-color: rgba(201, 162, 39, 0.35);
}

.btn-setup-export:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.2) 0%, #fff 100%);
}

.btn-setup-clear {
    background: linear-gradient(180deg, #fff 0%, #fef2f2 100%);
    border-color: rgba(159, 18, 57, 0.2);
    color: var(--danger);
}

.btn-setup-clear:hover:not(:disabled) {
    border-color: var(--danger);
    background: #fff1f2;
}

@media (max-width: 720px) {
    .setup-tools-grid {
        grid-template-columns: 1fr;
    }

    .setup-tools-grid .btn-setup {
        flex-direction: row;
        align-items: center;
        min-height: 2.75rem;
    }

    .setup-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .setup-card-head-right {
        justify-content: flex-end;
    }

    .setup-stats {
        width: 100%;
    }

    .prizes-list {
        max-height: 12rem;
    }

    .prizes-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .prizes-add-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .prizes-add-bar .btn-setup-add {
        width: 100%;
    }
}

.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.photo-upload {
    display: flex;
    gap: 0.75rem;
}

.photo-preview {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--white);
    flex-shrink: 0;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    font-size: 0.7rem;
    color: var(--muted);
}

.photo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.db-note {
    margin: 0;
    font-size: 0.65rem;
    color: var(--muted);
    text-align: right;
    flex-shrink: 0;
    flex-shrink: 0;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal-overlay[hidden] { display: none; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.65rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.modal h3 {
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--navy);
    letter-spacing: 0.02em;
}

.modal p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.draw-results-inner ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.4rem;
    margin: 1rem 0;
    max-height: 240px;
    overflow-y: auto;
}

.draw-results-inner li {
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

/* Screen-reader only (live regions, etc.) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 3rem;
    right: 1.5rem;
    padding: 0.75rem 1.1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    z-index: 200;
}

.toast.success { border-left: 4px solid var(--gold); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--navy); }

@media (prefers-reduced-motion: reduce) {
    .party-bokeh,
    .party-aurora,
    .party-sparkles,
    .party-confetti,
    .party-shine,
    .wheel-outer.spinning::before,
    .winner-row.just-won td {
        animation: none;
    }

    body,
    body::before,
    body::after,
    .wheel-pointer,
    .wheel-outer::before,
    #wheel-canvas,
    .wheel-center,
    .wheel-badge,
    .panel-stack,
    .table-heading,
    .prize-table thead tr,
    .btn-spin,
    .btn-stop,
    .btn-reset {
        transition: none;
    }
}

/* Operator sign-in gate */
.login-gate {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(8, 18, 36, 0.42);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.login-gate[hidden] {
    display: none !important;
}

body.login-required .page,
body.login-required .app-toolbar,
body.login-required .raffle-indicator {
    filter: blur(5px) brightness(0.92);
    pointer-events: none;
    user-select: none;
}

.login-card {
    width: min(100%, 24rem);
    padding: 2.25rem 2rem 2rem;
    border-radius: 1.15rem;
    text-align: center;
    background: linear-gradient(
        165deg,
        #fffdf8 0%,
        #f8fafc 55%,
        #f1f5f9 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow:
        0 28px 70px rgba(8, 18, 36, 0.38),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

.login-card::before {
    content: '';
    display: block;
    width: 3.25rem;
    height: 4px;
    margin: 0 auto 1.35rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold-dark), #16a34a, var(--gold));
}

.login-card-head {
    margin-bottom: 1.5rem;
}

.login-title {
    margin: 0 0 0.65rem;
    font-size: clamp(1.35rem, 4vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--navy);
    line-height: 1.2;
}

.login-desc {
    margin: 0 auto;
    max-width: 18rem;
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.55;
}

.login-config-error,
.login-error {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.55rem;
    font-size: 0.88rem;
    line-height: 1.4;
    text-align: center;
}

.login-config-error {
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.login-error {
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.login-form {
    display: grid;
    gap: 0.7rem;
    text-align: center;
}

.login-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.login-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(15, 39, 68, 0.14);
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    text-align: center;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) inset;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.login-input:focus {
    outline: none;
    border-color: rgba(22, 163, 74, 0.55);
    box-shadow:
        0 0 0 3px rgba(22, 163, 74, 0.14),
        0 1px 2px rgba(15, 23, 42, 0.04) inset;
}

.login-submit {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.92rem 1.25rem;
    border: none;
    border-radius: 0.7rem;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 42%, #15803d 100%);
    box-shadow:
        0 10px 28px rgba(22, 163, 74, 0.38),
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 -1px 0 rgba(0, 0, 0, 0.08) inset;
    transition: transform 0.18s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.login-submit:hover {
    filter: brightness(1.04);
    box-shadow:
        0 14px 34px rgba(22, 163, 74, 0.46),
        0 1px 0 rgba(255, 255, 255, 0.26) inset,
        0 -1px 0 rgba(0, 0, 0, 0.08) inset;
    transform: translateY(-1px);
}

.login-submit:active {
    transform: translateY(0);
    filter: brightness(0.98);
    box-shadow:
        0 6px 18px rgba(22, 163, 74, 0.32),
        0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.login-submit:focus-visible {
    outline: 2px solid rgba(22, 163, 74, 0.65);
    outline-offset: 3px;
}
