/* ============================================
   ROULETTE - Игра "Колесо Фортуны"
   ============================================ */

/* ========== ПЛАТФОРМО-ЗАВИСИМЫЕ ПОЗИЦИИ ========== */

/* По умолчанию */
#roulette-screen {
    padding-top: calc(1rem + 25px) !important;
    min-height: 100vh;
    background: 
        url('../assets/bg-roulette.svg') center top / cover no-repeat fixed,
        linear-gradient(180deg, #1a0a0a 0%, #2a1515 50%, #150808 100%) !important;
}

#roulette-screen header {
    top: 25px !important;
    background: transparent !important;
}

/* Убираем расширенный фон у шапки рулетки */
#roulette-screen header::before { display: none !important; }

/* Отключаем верхнюю тёмную полосу экрана рулетки */
#roulette-screen::before { display: none !important; }

#roulette-info-btn {
    top: 70px !important;
}

/* iOS: настройка позиций для рулетки */
html[data-platform="ios"] #roulette-screen {
    padding-top: calc(1rem + 90px) !important;
}

html[data-platform="ios"] #roulette-screen header {
    top: 90px !important;
}

html[data-platform="ios"] #roulette-info-btn {
    top: 100px !important;
}

/* Android: настройка позиций для рулетки */
html[data-platform="android"] #roulette-screen {
    padding-top: calc(1rem + 90px) !important;
}

html[data-platform="android"] #roulette-screen header {
    top: 70px !important;
}

html[data-platform="android"] #roulette-info-btn {
    top: 70px !important;
}

/* ========== КОНТЕЙНЕР КОЛЕСА ========== */

.wheel-container {
    position: relative;
    width: 340px;
    height: 340px;
    padding: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(252, 211, 77, 0.35), rgba(17, 24, 39, 0.95));
    box-shadow: 0 25px 50px rgba(0,0,0,0.7), 0 0 45px rgba(251, 191, 36, 0.45), inset 0 0 30px rgba(0,0,0,0.3);
    animation: wheel-container-pulse 3s ease-in-out infinite;
}

@keyframes wheel-container-pulse {
    0%, 100% { box-shadow: 0 25px 50px rgba(0,0,0,0.7), 0 0 45px rgba(251, 191, 36, 0.45), inset 0 0 30px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 25px 50px rgba(0,0,0,0.7), 0 0 60px rgba(251, 191, 36, 0.6), inset 0 0 30px rgba(0,0,0,0.3); }
}

.wheel-container::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    pointer-events: none;
    box-shadow: inset 0 0 20px rgba(251, 191, 36, 0.2);
}

/* ========== КОЛЕСО ========== */

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid rgba(255,255,255,0.18);
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.15), rgba(0,0,0,0.9));
    box-shadow: inset 0 0 35px rgba(0,0,0,0.8), inset 0 0 60px rgba(251, 191, 36, 0.15);
    transition: transform 5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.wheel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255,255,255,0.08) 0deg,
        transparent 1deg,
        rgba(0,0,0,0.15) 2deg,
        transparent 3deg
    );
    pointer-events: none;
    z-index: 0;
}

.wheel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(0,0,0,0.4) 70%, transparent 85%);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

/* ========== СЕКТОРЫ КОЛЕСА ========== */

.wheel-sector {
    position: absolute;
    width: 50%;
    height: 50%;
    top: 0;
    left: 50%;
    transform-origin: 0 100%;
    pointer-events: none;
    z-index: 1;
}

.wheel-sector .sector-content {
    width: 100%;
    height: 100%;
    clip-path: polygon(0% 100%, 100% 0%, 100% 100%);
    border-right: 5px solid var(--sector-accent, rgba(255,255,255,0.45));
    border-bottom: 2px solid rgba(255,255,255,0.12);
    padding: 8px 8px 8px 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: inset 0 0 35px rgba(0,0,0,0.4), inset -5px -5px 20px rgba(0,0,0,0.3);
    text-shadow: 0 3px 8px rgba(0,0,0,0.8), 0 0 10px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.wheel-sector .sector-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.15) 0%, 
        transparent 30%, 
        rgba(0,0,0,0.2) 70%, 
        rgba(0,0,0,0.4) 100%
    );
    pointer-events: none;
}

.wheel-sector .sector-symbol {
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
    position: relative;
    z-index: 2;
}

.wheel-sector .sector-value {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
}

.wheel-sector .sector-label {
    font-size: 0.65rem;
    opacity: 0.9;
    letter-spacing: 0.12em;
    position: relative;
    z-index: 2;
}

/* Редкость секторов */
.wheel-sector[data-rarity="rare"] .sector-content {
    border-right-color: rgba(96, 165, 250, 0.95);
    box-shadow: inset 0 0 35px rgba(96, 165, 250, 0.15), inset -5px -5px 20px rgba(0,0,0,0.3);
}

.wheel-sector[data-rarity="epic"] .sector-content {
    border-right-color: rgba(217, 70, 239, 0.95);
    box-shadow: inset 0 0 35px rgba(217, 70, 239, 0.2), inset -5px -5px 20px rgba(0,0,0,0.3);
}

.wheel-sector[data-rarity="legendary"] .sector-content {
    border-right-color: #facc15;
    box-shadow: 0 0 30px rgba(250, 204, 21, 0.5), inset 0 0 40px rgba(250, 204, 21, 0.25), inset -5px -5px 20px rgba(0,0,0,0.3);
    animation: legendary-pulse 2s ease-in-out infinite;
}

@keyframes legendary-pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(250, 204, 21, 0.5), inset 0 0 40px rgba(250, 204, 21, 0.25), inset -5px -5px 20px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 0 45px rgba(250, 204, 21, 0.7), inset 0 0 50px rgba(250, 204, 21, 0.35), inset -5px -5px 20px rgba(0,0,0,0.3); }
}

.wheel-sector.glow .sector-content::after {
    content: '';
    position: absolute;
    top: 5%;
    right: 5%;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    animation: sector-glow 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes sector-glow {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

/* ========== УКАЗАТЕЛЬ ========== */

.wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 38px solid #ff5f6d;
    filter: drop-shadow(0 12px 20px rgba(0,0,0,0.7)) drop-shadow(0 0 15px rgba(255, 95, 109, 0.6));
    z-index: 10;
    animation: pointer-bounce 1.5s ease-in-out infinite;
    will-change: transform;
}

@keyframes pointer-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

.wheel-pointer::before {
    content: '';
    position: absolute;
    top: -28px;
    left: -12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffe29f 0%, rgba(255,255,255,0) 70%);
    opacity: 0.95;
    animation: pointer-glow 1.5s ease-in-out infinite;
}

@keyframes pointer-glow {
    0%, 100% { opacity: 0.95; box-shadow: 0 0 10px rgba(255, 226, 159, 0.6); }
    50% { opacity: 1; box-shadow: 0 0 20px rgba(255, 226, 159, 0.9); }
}

.wheel-pointer::after {
    content: '';
    position: absolute;
    top: -34px;
    left: -5px;
    width: 10px;
    height: 18px;
    border-radius: 5px;
    background: linear-gradient(180deg, #fff, rgba(255,255,255,0));
    box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

/* ========== ЦЕНТР КОЛЕСА ========== */

.wheel-hub {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 30% 30%, #fff7e6, #fbbf24 40%, #b45309 100%);
    box-shadow: inset 0 0 25px rgba(0,0,0,0.5), 0 0 35px rgba(251, 191, 36, 0.6), 0 0 50px rgba(251, 191, 36, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    animation: hub-rotate 20s linear infinite;
}

@keyframes hub-rotate {
    from { filter: hue-rotate(0deg) brightness(1); }
    to { filter: hue-rotate(360deg) brightness(1.1); }
}

.wheel-hub::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        rgba(251, 191, 36, 0.4) 0deg,
        transparent 10deg,
        rgba(251, 191, 36, 0.4) 20deg,
        transparent 30deg
    );
    animation: hub-spin 3s linear infinite;
    z-index: -1;
}

@keyframes hub-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.wheel-hub::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: inset 0 0 15px rgba(255,255,255,0.3);
}

.wheel-hub-inner {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #f6c343 50%, #fbbf24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c2d12;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.3);
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
    text-align: center;
    line-height: 1.05;
}

.wheel-hub-inner .hub-text { 
    display: block; 
    width: 100%; 
}
.wheel-hub-inner .hub-text.multiline { 
    white-space: normal; 
}

/* ========== МОДАЛЬНОЕ ОКНО ПРИЗОВ ========== */

#roulette-info-modal .prize-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#roulette-info-modal .prize-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
