/* wheel.css — НОВОГОДНЯЯ ВЕРСИЯ (ФИНАЛ + ДИНАМИКА) */

:root {
    --newyear-primary: #4A7AB0;
    --newyear-secondary: #6A9AD0;
    --newyear-accent: #8AB5E0;
    --newyear-light: #A9D9F8;
    --newyear-ice: rgba(224, 255, 255, 0.9);
    --newyear-dark: rgba(20, 30, 50, 0.95);
    --gold-glow: #ffd700;
}

body {
    background: linear-gradient(180deg, #141e32 0%, #192841 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: auto;
    position: relative;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

/* КОНТЕЙНЕР КОЛЕСА */
/* wheel.css */

.wheel-main-wrapper {
    position: relative;
    width: 310px;  /* Чуть больше самого колеса */
    height: 310px;
    margin: 40px auto; /* Центрируем всю конструкцию на странице */
    
    /* ФЛЕКС — это спасет центровку */
    display: flex;
    justify-content: center;
    align-items: center;
    
    background: rgba(40, 60, 100, 0.2);
    border-radius: 50%;
    border: 2px solid rgba(138, 181, 224, 0.3);
    box-shadow: 0 0 25px rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
}

/* САМО КОЛЕСО */
/* wheel.css — ФИНАЛЬНЫЙ ФИКС РАЗМЕРОВ И ГЕОМЕТРИИ */

.wheel {
    /* Убираем лишние margin, если они были */
    margin: 0; 
    width: 293px;
    height: 293px;
    border-radius: 50%;
    border: 6px solid var(--newyear-light);
    position: relative;
    overflow: hidden;
    transition: transform 10s cubic-bezier(0.1, 0, 0, 1);
    background: #1a2a45;
    /* Убеждаемся, что колесо не смещается */
    flex-shrink: 0; 
}

.segment {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform-origin: 50% 50%;
    /* Идеальный треугольник для 6 секторов (точно 60 градусов) */
    clip-path: polygon(50% 50%, 21% 0, 79% 0); 
    background-color: var(--segment-color);
    transform: rotate(calc(var(--offset-angle) * 1deg));
    display: flex;
    justify-content: center;
}

/* Контейнер для контента внутри треугольника */
/* Обращаемся напрямую к картинкам и тексту внутри сегмента */
.segment img, 
.segment span {
    position: absolute !important;
    /* Регулируй это число: чем оно больше, тем ниже призы */
    top: 25px !important; 
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Если есть картинка, чуть корректируем её положение */
.segment-img {
    margin-bottom: 0;
}

.segment-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
    margin-bottom: 2px;
}

.segment span {
    color: white;
    font-weight: 900;
    font-size: 16px; /* Чуть меньше шрифт */
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
    white-space: nowrap;
}

/* СТРЕЛКА С ЭФФЕКТОМ "ТЯЖЕСТИ" */
.wheel-arrow {
    position: absolute;
    top: -5px; 
    left: 50%;
    transform-origin: top center; 
    transform: translateX(-50%) rotate(0deg);
    
    /* Плавность возврата: cubic-bezier делает отскок "вкусным" и пружинистым */
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 35px solid var(--newyear-ice);
    z-index: 100;
    filter: drop-shadow(0 0 10px var(--newyear-light));
    pointer-events: none;
    will-change: transform;
}

/* КНОПКА ЗАПУСКА */
.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--newyear-ice), var(--newyear-light));
    border-radius: 50%;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    color: var(--newyear-dark);
    cursor: pointer;
    border: 4px solid var(--newyear-primary);
    box-shadow: 0 0 30px var(--newyear-light);
    transition: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wheel-center:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.wheel-center:active {
    transform: translate(-50%, -50%) scale(0.9);
}

/* КНОПКА НАЗАД */
.back-link {
    margin-top: 50px;
    background: rgba(106, 154, 208, 0.1);
    color: var(--newyear-light);
    border: 2px solid var(--newyear-accent);
    padding: 12px 25px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.back-link:hover {
    background: var(--newyear-secondary);
    color: white;
}

/* КРАСИВОЕ МОДАЛЬНОЕ ОКНО */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 20, 35, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-overlay.show-modal {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, #1a2a45, #0a1423);
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    border: 2px solid var(--newyear-accent);
    box-shadow: 0 0 50px rgba(74, 122, 176, 0.4);
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show-modal .modal-content {
    transform: scale(1);
}

#modal-prize-image img {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 20px var(--newyear-light));
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#modal-text {
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin: 10px 0;
}

.close-btn {
    margin-top: 25px;
    padding: 12px 40px;
    background: var(--newyear-light);
    color: var(--newyear-dark);
    border: none;
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    background: #fff;
    box-shadow: 0 0 20px #fff;
}

/* --- ОБНОВЛЕННАЯ СЕКЦИЯ ПРИЗОВ --- */
.prizes-section {
    margin-top: 50px;
    padding: 0 15px 100px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Красивый заголовок */
.section-header {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Ровно 2 колонки */
    gap: 15px;
}

.prize-card {
    position: relative;
    background: #1a243a; /* Темный фон как на фото */
    border-radius: 20px;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1); /* Базовая рамка */
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Блик в верхнем левом углу */
.prize-card::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    filter: blur(8px);
    pointer-events: none;
}

/* Контейнер для картинки и текста в ряд */
.prize-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.prize-header img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 5px;
}

.prize-info-text {
    display: flex;
    flex-direction: column;
}

.p-name {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.p-value {
    color: #8c96a5;
    font-size: 13px;
}

/* Плашка редкости */
.rarity-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.chance-label {
    color: #5c6675;
    font-size: 11px;
    font-weight: 600;
}

/* --- ЦВЕТНЫЕ РАМКИ ПО РЕДКОСТИ --- */

/* ЛЕГЕНДАРНЫЙ (Зеленый) */
.legendary {
    border-color: #4CAF50 !important;
    box-shadow: inset 0 0 15px rgba(76, 175, 80, 0.1);
}
.legendary .rarity-tag { background: #4CAF50; color: #fff; }

/* РЕДКИЙ (Золотистый) */
.rare {
    border-color: #FFD700 !important;
    box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.1);
}
.rare .rarity-tag { background: #FFD700; color: #000; }

/* НЕОБЫЧНЫЙ (Синий) */
.uncommon {
    border-color: #2196F3 !important;
    box-shadow: inset 0 0 15px rgba(33, 150, 243, 0.1);
}
.uncommon .rarity-tag { background: #2196F3; color: #fff; }

/* Специальный стиль для иконки монеты */
.coin-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    font-size: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Анимация пульсации для монет, чтобы привлекали внимание */
.coin-card:hover .coin-icon {
    transform: scale(1.1) rotate(10deg);
    transition: 0.3s;
}

/* Если хочешь сделать карточку золотой (Legendary) */
.coin-card.legendary .coin-icon {
    background: linear-gradient(135deg, #fff, #ffd700);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* Увеличение звезд в карточках призов Колеса Удачи */
.prizes-grid .coin-card .stars-icon {
    width: 23px !important;
    height: 23px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 5px !important;
    transform: scale(1.5); /* Увеличение в 1.5 раза */
}

.wheel-title {
    text-align: center;
    margin: -10px auto 10px; /* -10px поднимает вверх */
    width: 100%;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(169, 217, 248, 0.7);
}

/* УВЕЛИЧЕНИЕ НАДПИСЕЙ В КАРТОЧКАХ МОНЕТ */
.prize-card.coin-card .p-name {
    font-size: 16px !important;  /* Увеличиваем сумму */
    font-weight: 900 !important;
}

/* Стиль для заблокированной кнопки */
.wheel-center.disabled,
.wheel-center:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none; /* Запрещает любые события мыши */
    filter: grayscale(80%);
    background: #cccccc; /* Серый фон */
    border-color: #999999; /* Темно-серая рамка */
    box-shadow: none;
    transform: translate(-50%, -50%) scale(1); /* Убираем эффект наведения */
}

/* Убираем эффекты при наведении на заблокированную кнопку */
.wheel-center.disabled:hover,
.wheel-center:disabled:hover {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: none;
}