:root {
    color-scheme: dark;
    --bg-1: #07111f;
    --bg-2: #111827;
    --card: rgba(15, 23, 42, 0.74);
    --stroke: rgba(255, 255, 255, 0.1);
    --text: rgba(255, 255, 255, 0.96);
    --muted: rgba(255, 255, 255, 0.7);
    --accent: #ff4d6d;
    --accent-2: #ff9f1c;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(255, 77, 109, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(255, 159, 28, 0.16), transparent 28%),
        linear-gradient(160deg, var(--bg-1), var(--bg-2));
    overflow: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
    pointer-events: none;
}

body::before {
    top: -120px;
    left: -120px;
    background: #ff4d6d;
}

body::after {
    right: -140px;
    bottom: -140px;
    background: #ff9f1c;
}
canvas {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}
.confetti-canvas,
.confetti-canvas * {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}
canvas {
    background: transparent !important;
}

canvas.confetti-canvas {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}
.app {
    width: min(100%, 430px);
    padding: 24px 20px 20px;
    border-radius: 28px;
    background: var(--card);
    border: 1px solid var(--stroke);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    text-align: center;
    position: relative;
    z-index: 1;
    transform: translateY(-20px);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ef4444;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.title {
    margin: 8px 0 8px;
    font-size: clamp(28px, 5vw, 38px);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.subtitle {
    margin: 0 auto 18px;
    max-width: 30ch;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.wheel-frame {
    position: relative;
    width: min(82vw, 340px);
    aspect-ratio: 1;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
}

.pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 26px solid #ffd166;
    filter: drop-shadow(0 2px 8px rgba(255, 209, 102, 0.55));
}

.pointer::after {
    content: "";
    position: absolute;
    left: -6px;
    top: -24px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff3bf;
    box-shadow: 0 0 16px rgba(255, 243, 191, 0.7);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    background: #0f172a;
    box-shadow:
        inset 0 0 0 10px rgba(255, 255, 255, 0.06),
        0 18px 50px rgba(0, 0, 0, 0.45);

    transform-origin: 50% 50%;
    will-change: transform;

    /* лёгкое визуальное усиление */
    transform: scale(1.05);
}

button {
    position: relative;
    width: 100%;
    padding: 18px 18px;
    border: 0;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 30px rgba(255, 77, 109, 0.22);
    transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

button:active {
    transform: translateY(1px) scale(0.99);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
    filter: none;
    box-shadow: none;
}

.result {
    min-height: 28px;
    margin-top: 14px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.95);
}

.cooldown {
    min-height: 20px;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.66);
}

.footer-note {
    margin-top: -25px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 380px) {
    .app {
        padding: 20px 16px 16px;
        border-radius: 24px;
    }

    .wheel-frame {
        width: min(82vw, 300px);
    }

    button {
        padding: 13px 16px;
        border-radius: 14px;
    }
}