/* ================================================
   Furry Roulette — Styles
   Чистый CSS, без фреймворков и библиотек.
   Тема: неоновый минимализм на темном фоне.
   ================================================ */

/* === Reset & Custom Properties === */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Фон */
    --bg-primary: #0b0b1a;
    --bg-card: rgba(18, 18, 45, 0.75);

    /* Текст */
    --text-main: #e8e8f4;
    --text-muted: #7a7a9e;

    /* Неоновые акценты */
    --neon-purple: #b44aff;
    --neon-cyan: #4ae8ff;
    --neon-pink: #ff4a8a;

    /* Радиусы и отступы */
    --radius-lg: 20px;
    --radius-full: 50%;
}

/* === Body & Background === */

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    /* Тонкие «звездочки» на фоне */
    background-image:
        radial-gradient(1.5px 1.5px at 10% 15%, rgba(255, 255, 255, 0.12) 50%, transparent 100%),
        radial-gradient(1px 1px at 25% 55%, rgba(255, 255, 255, 0.08) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 45% 80%, rgba(255, 255, 255, 0.10) 50%, transparent 100%),
        radial-gradient(1px 1px at 65% 25%, rgba(255, 255, 255, 0.07) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 80% 65%, rgba(255, 255, 255, 0.09) 50%, transparent 100%),
        radial-gradient(1px 1px at 90% 10%, rgba(255, 255, 255, 0.06) 50%, transparent 100%),
        radial-gradient(1px 1px at 55% 40%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
}

/* Анимированное фоновое свечение */
.bg-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 30% 40%, rgba(180, 74, 255, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 70% 60%, rgba(74, 232, 255, 0.05) 0%, transparent 45%);
    animation: bgRotate 40s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes bgRotate {
    to {
        transform: rotate(360deg);
    }
}

/* === Container === */

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    padding: 2.5rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* === Header === */

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

.title {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Неоновое свечение заголовка */
    filter: drop-shadow(0 0 18px rgba(180, 74, 255, 0.35));
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 400;
}

/* === Main === */

.main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* === Wheel Section === */

.wheel-section {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.wheel-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
}

/* Внешнее кольцо */
.wheel-outer-ring {
    position: absolute;
    inset: -6px;
    border-radius: var(--radius-full);
    border: 3px solid rgba(180, 74, 255, 0.25);
    pointer-events: none;
    animation: ringGlow 3s ease-in-out infinite;
}

@keyframes ringGlow {
    0%, 100% {
        border-color: rgba(180, 74, 255, 0.2);
        box-shadow: 0 0 15px rgba(180, 74, 255, 0.1), inset 0 0 15px rgba(180, 74, 255, 0.05);
    }
    50% {
        border-color: rgba(74, 232, 255, 0.3);
        box-shadow: 0 0 25px rgba(74, 232, 255, 0.15), inset 0 0 25px rgba(74, 232, 255, 0.08);
    }
}

/* Указатель (стрелка вверху) */
.pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid var(--neon-cyan);
    z-index: 10;
    filter:
        drop-shadow(0 0 8px rgba(74, 232, 255, 0.9))
        drop-shadow(0 0 20px rgba(74, 232, 255, 0.4));
    transition: filter 0.3s;
}

/* Контейнер вращения колеса */
.wheel-inner {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow:
        0 0 25px rgba(180, 74, 255, 0.2),
        0 0 50px rgba(180, 74, 255, 0.08);
    will-change: transform;
}

#wheel-svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* === Spin Button === */

.spin-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 3.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    outline: none;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 20px rgba(180, 74, 255, 0.35);
    margin-bottom: 2rem;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.spin-button:hover:not(:disabled) {
    transform: scale(1.06);
    box-shadow: 0 0 35px rgba(180, 74, 255, 0.55);
}

.spin-button:active:not(:disabled) {
    transform: scale(0.97);
    box-shadow: 0 0 15px rgba(180, 74, 255, 0.4);
}

.spin-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* Пульсация кнопки в idle-состоянии */
.spin-button::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    z-index: -1;
    opacity: 0;
    animation: btnPulse 2.5s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.35;
        transform: scale(1.12);
    }
}

.spin-button:disabled::after {
    animation: none;
    opacity: 0;
}

.spin-button__text {
    position: relative;
    z-index: 1;
}

/* === Result === */

.result {
    width: 100%;
    max-width: 360px;
    opacity: 0;
    transform: translateY(24px) scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    visibility: hidden;
}

.result.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(180, 74, 255, 0.25);
    border-radius: var(--radius-lg);
    padding: 2rem 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.result.visible .result-card {
    animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }
    60% {
        transform: scale(1.04);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-icon {
    font-size: 2.8rem;
    margin-bottom: 0.25rem;
    animation: none;
}

.result.visible .result-icon {
    animation: iconBounce 0.6s ease-out 0.2s both;
}

@keyframes iconBounce {
    0% {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.3) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.result-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.result-name {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    transition: color 0.4s ease, text-shadow 0.4s ease;
}

.result-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--text-muted), transparent);
    margin: 0.75rem auto;
    border-radius: 1px;
}

.result-color {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.color-swatch {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.color-name {
    transition: color 0.4s ease;
}

/* === Footer === */

.footer {
    margin-top: auto;
    padding: 1.5rem 0 0.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* === Responsive === */

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem 1rem;
    }

    .title {
        font-size: 2.1rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .wheel-wrapper {
        width: 280px;
        height: 280px;
    }

    .spin-button {
        padding: 0.85rem 2.8rem;
        font-size: 1.15rem;
    }

    .result-name {
        font-size: 1.8rem;
    }
}

@media (max-width: 360px) {
    .title {
        font-size: 1.8rem;
    }

    .wheel-wrapper {
        width: 240px;
        height: 240px;
    }

    .spin-button {
        padding: 0.75rem 2.2rem;
        font-size: 1.05rem;
    }

    .result-card {
        padding: 1.5rem 1.25rem;
    }

    .result-name {
        font-size: 1.5rem;
    }
}

/* === Accessibility: Reduced Motion === */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .bg-glow {
        animation: none;
    }
}
