@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');

:root {
    --bg-color: #0f172a;
    --wheel-border: #1e293b;
    --text-color: #ffffff;
    --btn-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --btn-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
    --gold: #f1c40f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
}

header {
    text-align: center;
    margin-top: 20px;
    z-index: 10;
}

header h1 {
    font-size: 26px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

header p {
    font-size: 14px;
    opacity: 0.7;
    margin-top: 5px;
}

.spin-counter {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.counter-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #cbd5e1;
    font-weight: 700;
}

.counter-value {
    font-size: 16px;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
}

.counter-value.zero {
    color: #ef4444;
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

/* --- КОЛЕСО --- */
.wheel-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* Обод колеса */
.wheel-wrapper::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    border: 8px solid var(--wheel-border);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    z-index: 0;
    pointer-events: none;
}

.wheel {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1);
    background: conic-gradient(
        #e74c3c 0deg 72deg,
        #2980b9 72deg 144deg,
        #f39c12 144deg 216deg,
        #8e44ad 216deg 288deg,
        #27ae60 288deg 360deg
    );
    z-index: 1;
}

/* --- СЕГМЕНТЫ С ТЕКСТОМ --- */
.segment {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 50%;
    transform-origin: bottom center;

    transform: rotate(calc((var(--i) - 1) * 72deg + 36deg));
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.segment .text {
    margin-top: 35px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    line-height: 1.2;
    transform: rotate(0deg);
    white-space: nowrap;
}

/* Центральная точка */
.center-circle {
    position: absolute;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Стрелка */
.stopper {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 40px;
    background: var(--gold);
    clip-path: polygon(100% 0, 50% 100%, 0 0);
    z-index: 10;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}

/* --- УПРАВЛЕНИЕ --- */
.controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    z-index: 10;
}

.result-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.result-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#result-area {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 12px;
    width: 100%;
}

#statusTitle {
    color: var(--gold);
    font-size: 18px;
    margin-bottom: 4px;
}

/* Кнопка */
.main-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: var(--btn-gradient);
    box-shadow: var(--btn-shadow);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}

.main-btn:active {
    transform: scale(0.96);
}

.main-btn:disabled {
    opacity: 0.6;
    filter: grayscale(0.8);
    cursor: default;
}