:root {
    --bg: #eef0f4;
    --ink: #1f2532;
    --ink-soft: #5b6475;
    --accent: #cc1f8f;
    --accent-dark: #8a1662;
    --panel: rgba(255, 255, 255, 0.9);
    --line: rgba(31, 37, 45, 0.14);
    --glow: rgba(204, 31, 143, 0.22);
    --radius: 18px;
    --shadow: 0 16px 42px rgba(30, 40, 60, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    background:
        radial-gradient(circle at 12% 8%, #f3d4e8 0, transparent 38%),
        radial-gradient(circle at 86% 12%, #d5e6fb 0, transparent 35%),
        linear-gradient(180deg, #f7f8fa 0%, var(--bg) 100%);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(0, 0, 0, 0.03) 0.55px, transparent 0.55px);
    background-size: 3px 3px;
    opacity: 0.2;
    z-index: 0;
}

.bg-orb {
    position: fixed;
    width: 24rem;
    height: 24rem;
    border-radius: 999px;
    filter: blur(56px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
    animation: float 9s ease-in-out infinite;
}

.orb-a {
    background: #efb8db;
    top: -8rem;
    left: -6rem;
}

.orb-b {
    background: #b9d7f7;
    right: -8rem;
    bottom: -9rem;
    animation-delay: -3s;
}

.layout {
    position: relative;
    z-index: 1;
    max-width: 980px;
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    display: grid;
    gap: 1rem;
}

.topbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.eyebrow {
    margin: 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.72rem;
    color: #9b2d76;
}

h1,
h2 {
    font-family: 'Sora', sans-serif;
    margin: 0;
    line-height: 1.12;
}

h1 {
    margin-top: 0.3rem;
    font-size: clamp(1.75rem, 4.8vw, 2.6rem);
}

.hero-subtitle {
    margin: 0.55rem 0 0;
    color: #556078;
    font-size: clamp(0.98rem, 2.2vw, 1.12rem);
    line-height: 1.45;
    max-width: 36ch;
}

h2 {
    font-size: clamp(1.2rem, 3.3vw, 1.58rem);
}

.ghost-link {
    text-decoration: none;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.75);
    transition: transform 160ms ease, background 160ms ease;
    font-weight: 600;
}

.ghost-link:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.card {
    background:
        linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.72)) padding-box,
        linear-gradient(120deg, rgba(204, 31, 143, 0.24), rgba(95, 162, 207, 0.24)) border-box;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.2rem;
    width: min(100%, 920px);
    margin-inline: auto;
    position: relative;
    overflow: clip;
}

.card::after {
    content: '';
    position: absolute;
    inset: auto -18% -62% auto;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(204, 31, 143, 0.14), transparent 70%);
    pointer-events: none;
}

.muted {
    color: var(--ink-soft);
    margin-bottom: 1rem;
}

.grid-form,
.admin-form {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-form .btn-primary {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 0.34rem;
    font-weight: 600;
}

input[type='number'] {
    width: 100%;
    border: 1px solid #ccd4da;
    border-radius: 12px;
    padding: 0.74rem 0.86rem;
    font: inherit;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

input[type='number']:focus {
    outline: 2px solid var(--glow);
    border-color: var(--accent);
}

.switch-row {
    grid-template-columns: 1fr auto;
    align-items: center;
}

input[type='checkbox'] {
    width: 3rem;
    height: 1.6rem;
    appearance: none;
    border-radius: 999px;
    position: relative;
    border: 1px solid #d0d8dd;
    background: #e6edf1;
    cursor: pointer;
    transition: background 150ms ease;
}

input[type='checkbox']::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: transform 150ms ease;
}

input[type='checkbox']:checked {
    background: #e7b9d6;
}

input[type='checkbox']:checked::after {
    transform: translateX(1.36rem);
}

.btn-primary {
    border: none;
    border-radius: 12px;
    padding: 0.86rem 1rem;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(120deg, var(--accent), #e33ea4);
    box-shadow: 0 10px 25px rgba(204, 31, 143, 0.3);
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 90%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-18deg);
    transition: left 320ms ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(204, 31, 143, 0.38);
}

.btn-primary:hover::after {
    left: 130%;
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.status {
    min-height: 1.5rem;
    font-weight: 600;
    color: #44505e;
}

.status.error {
    color: #9c2e1d;
}

.status.success {
    color: #236a58;
}

.roulette-wrap {
    margin: 1.1rem 0 0.6rem;
    position: relative;
    display: grid;
    place-items: center;
    padding: 1.05rem 0.9rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #dbe6f9, #c8d9f3);
    border: 1px solid rgba(96, 136, 176, 0.28);
}

.roulette-pointer {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 19px solid var(--ink);
    z-index: 3;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.roulette-wheel {
    --wheel-rotation: 0deg;
    width: min(78vw, 320px);
    aspect-ratio: 1;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    border: 10px solid #fff;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.16), 0 0 0 14px rgba(255, 255, 255, 0.28), inset 0 0 0 2px rgba(255, 255, 255, 0.45);
    background:
        conic-gradient(
            from -20deg,
            #cc1f8f 0deg 20deg,
            #f4bf4d 20deg 40deg,
            #4f8fd0 40deg 60deg,
            #f3d468 60deg 80deg,
            #d54c9f 80deg 100deg,
            #79afd9 100deg 120deg,
            #e56bb3 120deg 140deg,
            #83c0e8 140deg 160deg,
            #f8c760 160deg 180deg,
            #b73a88 180deg 200deg,
            #f0d26b 200deg 220deg,
            #5f9fd5 220deg 240deg,
            #e260ac 240deg 260deg,
            #79b4e1 260deg 280deg,
            #f5cc66 280deg 300deg,
            #cd4697 300deg 320deg,
            #86bee7 320deg 340deg,
            #f2d684 340deg 360deg
        );
    transform: rotate(var(--wheel-rotation));
    transition: transform 5.2s cubic-bezier(0.15, 0.95, 0.2, 1);
}

.roulette-wheel::after {
    content: '';
    position: absolute;
    inset: 7%;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

.roulette-wheel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 35%, rgba(0, 0, 0, 0.08));
    pointer-events: none;
}

.wheel-center {
    position: absolute;
    inset: 30%;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(24, 30, 40, 0.84);
    border: 5px solid rgba(255, 255, 255, 0.72);
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 800;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
}

.roulette-wheel.spinning .wheel-center {
    animation: pulse-center 340ms ease-in-out infinite;
}

.roulette-track-shell {
    margin-top: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(249, 251, 255, 0.9);
    padding: 0.72rem;
    width: 100%;
    overflow: hidden;
}

.roulette-track {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 11.5rem;
    max-height: 14.5rem;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.roulette-sequence {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.1rem;
    white-space: normal;
}

.seq-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    padding: 0.42rem 0.56rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #394655;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(36, 55, 72, 0.14);
}

.seq-num.is-winner {
    color: #fff;
    background: linear-gradient(120deg, var(--accent), #f04fb3);
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(204, 31, 143, 0.35);
}

.seq-num.is-live {
    border-color: #e3a9d0;
    background: #fff3fb;
    color: #922160;
}

.confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9;
}

.confetti {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 16px;
    border-radius: 2px;
    background: hsl(var(--h), 88%, 58%);
    opacity: 0;
    animation: confetti-pop var(--dur) ease-out var(--delay) forwards;
}

.result {
    margin-top: 0.9rem;
    border-top: 1px dashed var(--line);
    padding-top: 0.9rem;
}

.result .muted {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.hidden {
    display: none;
}

.winner-number {
    margin: 0;
    font-family: 'Sora', sans-serif;
    font-size: clamp(2.2rem, 8vw, 4.2rem);
    font-weight: 800;
    color: var(--accent-dark);
    text-shadow: 0 10px 24px rgba(204, 31, 143, 0.27);
}

.content-card h3 {
    margin: 1.1rem 0 0.45rem;
    font-family: 'Sora', sans-serif;
    font-size: 1.05rem;
    color: #2a3040;
}

.content-card p {
    margin: 0 0 0.8rem;
    color: #3f4758;
    line-height: 1.55;
}

.content-list {
    margin: 0.1rem 0 1rem;
    padding-left: 1.1rem;
    color: #3f4758;
}

.content-list li {
    margin-bottom: 0.45rem;
    line-height: 1.45;
}

.site-footer {
    position: relative;
    z-index: 1;
    margin-top: 0.4rem;
    border-top: 1px solid rgba(68, 78, 94, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.82));
}

.footer-inner {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 1.4rem 1rem 2.2rem;
}

.footer-layout {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) 2.1fr;
    gap: 1.5rem;
    align-items: start;
}

.footer-brand {
    max-width: 430px;
}

.footer-logo {
    margin: 0 0 0.85rem;
    font-family: 'Sora', sans-serif;
    font-size: 1.85rem;
    line-height: 1.1;
    color: #222935;
}

.footer-lead {
    margin: 0 0 0.5rem;
    color: #3f4758;
    line-height: 1.45;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.3rem;
}

.footer-stack {
    display: grid;
    gap: 1.2rem;
}

.footer-grid h4 {
    margin: 0 0 0.5rem;
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    color: #26304a;
}

.footer-grid ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-grid li {
    margin-bottom: 0.35rem;
    color: #505b6f;
    font-size: 0.94rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.config-grid article {
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem;
}

.value {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.reveal {
    animation: rise 420ms ease both;
}

.delay-1 {
    animation-delay: 90ms;
}

.delay-2 {
    animation-delay: 170ms;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(18px);
    }
}

@keyframes pulse-center {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes confetti-pop {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.45);
    }
}

@media (max-width: 760px) {
    .layout {
        padding: 1rem 0.7rem 2rem;
    }

    .card {
        padding: 0.95rem;
    }

    .topbar {
        align-items: start;
        flex-direction: column;
    }

    .grid-form {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .roulette-track {
        min-height: 12rem;
        max-height: 15.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-layout {
        grid-template-columns: 1fr;
        gap: 0.95rem;
    }
}
