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

/* Предотвращение зума на iOS при фокусе на input */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="tel"],
    input[type="email"] {
        font-size: 16px !important;
    }
}

.wheel-of-fortune-page {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 20px;
    padding-top: 150px;
}

.wheel-of-fortune-page .container {
    text-align: center;
    max-width: 800px;
    width: 100%;
    position: relative;
}

.wheel-wrapper {
    position: relative;
    width: 600px;
    height: 600px;
    margin: 0 auto 40px;
    max-width: 90vw;
    max-height: 90vw;
}

/* Увеличенное колесо для попапа */
.wheel-popup .wheel-wrapper {
    width: 100%;
    max-width: 700px;
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto 30px;
}

.wheel-popup .wheel-outer {
    width: 100%;
    height: 100%;
    position: relative;
}

.wheel-popup #wheelPopupCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.wheel-outer {
    position: relative;
    width: 100%;
    height: 100%;
}

.arrow {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid #fbbf24;
    z-index: 100;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.arrow::after {
    content: '';
    position: absolute;
    top: -30px;
    left: -12px;
    width: 24px;
    height: 24px;
    background: #dc2626;
    border-radius: 50%;
    border: 3px solid #fbbf24;
}

#wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 
        0 0 0 8px #1e293b,
        0 0 0 12px #fbbf24,
        0 20px 40px rgba(0, 0, 0, 0.6);
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #ffffff, #cbd5e1);
    border-radius: 50%;
    box-shadow: 
        0 0 0 4px #fbbf24,
        0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

/* Форма */
.wheel-form-container {
    margin-bottom: 30px;
}

.wheel-form {
    background: rgba(30, 41, 59, 0.9);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.wheel-form-title {
    font-size: 28px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 8px;
}

.wheel-form-subtitle {
    font-size: 16px;
    color: #cbd5e1;
    margin-bottom: 24px;
}

.wheel-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.wheel-form label {
    display: block;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.wheel-form input[type="text"],
.wheel-form input[type="tel"],
.wheel-form input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px; /* Минимум 16px для предотвращения зума на iOS */
    border: 2px solid #334155;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.wheel-form input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.spin-button,
#wheelSpinBtn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    border: none;
    padding: 18px 48px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 0 30px rgba(251, 191, 36, 0.5),
        0 10px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
    position: relative;
    z-index: 10;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.wheel-of-fortune-page #wheelSpinBtn {
    max-width: 400px;
    width: auto;
    min-width: 300px;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 0 40px rgba(251, 191, 36, 0.7),
        0 15px 30px rgba(0, 0, 0, 0.5);
}

.spin-button:active:not(:disabled) {
    transform: translateY(0);
}

.spin-button:disabled,
#wheelSpinBtn:disabled,
#wheelPopupSpinBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result {
    margin-top: 30px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.result-text {
    font-size: 18px;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.result-prize {
    font-size: 24px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 12px;
}

.result-code {
    font-size: 16px;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
}

.note {
    margin-top: 20px;
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
}

.note p {
    margin-bottom: 8px;
}

.note p:first-child {
    color: #fbbf24;
    font-weight: 600;
    font-style: normal;
}

@media (max-width: 768px) {
    .wheel-of-fortune-page {
        padding: 15px;
        padding-top: 120px;
    }
    
    .wheel-of-fortune-page .container {
        max-width: 100%;
    }
    
    .wheel-wrapper {
        width: 90vw;
        height: 90vw;
        max-width: 400px;
        max-height: 400px;
        margin: 0 auto 30px;
    }
    
    .wheel-popup .wheel-wrapper {
        width: 95vw;
        height: 95vw;
        max-width: 500px;
        max-height: 500px;
        margin: 0 auto 20px;
    }

    .spin-button,
    #wheelSpinBtn {
        padding: 16px 32px;
        font-size: 16px;
        min-width: 280px;
        max-width: 90%;
    }
    
    .wheel-of-fortune-page #wheelSpinBtn {
        min-width: 280px;
        max-width: 90%;
    }

    .center-circle {
        width: 60px;
        height: 60px;
    }
    
    .arrow {
        border-left-width: 15px;
        border-right-width: 15px;
        border-top-width: 25px;
        top: -12px;
    }
    
    .arrow::after {
        width: 20px;
        height: 20px;
        top: -25px;
        left: -10px;
        border-width: 2px;
    }
    
    #wheel {
        box-shadow: 
            0 0 0 6px #1e293b,
            0 0 0 9px #fbbf24,
            0 15px 30px rgba(0, 0, 0, 0.6);
    }
    
    .wheel-form {
        padding: 20px 15px;
        max-width: 100%;
    }
    
    .wheel-form-title {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .wheel-form-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .wheel-popup {
        padding: 20px 15px;
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .wheel-popup-content {
        padding: 0;
    }
    
    .result {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .result-text {
        font-size: 16px;
    }
    
    .result-prize {
        font-size: 20px;
        margin-top: 10px;
    }
    
    .note {
        font-size: 12px;
        padding: 15px;
        margin: 20px 0;
    }
    
    .wheel-prize-note {
        font-size: 11px;
        padding: 0 15px;
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .wheel-of-fortune-page {
        padding: 8px;
        padding-top: 90px;
    }
    
    .wheel-wrapper {
        width: 92vw;
        height: 92vw;
        max-width: 320px;
        max-height: 320px;
        margin: 0 auto 20px;
    }
    
    .wheel-popup .wheel-wrapper {
        width: 92vw;
        height: 92vw;
        max-width: 350px;
        max-height: 350px;
        margin: 0 auto 15px;
    }

    .spin-button,
    #wheelSpinBtn {
        padding: 16px 20px;
        font-size: 15px;
        min-width: 90%;
        max-width: 90%;
        letter-spacing: 0.5px;
        margin: 20px auto;
    }
    
    .wheel-of-fortune-page #wheelSpinBtn {
        min-width: 90%;
        max-width: 90%;
    }

    .center-circle {
        width: 45px;
        height: 45px;
    }
    
    .arrow {
        border-left-width: 10px;
        border-right-width: 10px;
        border-top-width: 18px;
        top: -8px;
    }
    
    .arrow::after {
        width: 16px;
        height: 16px;
        top: -18px;
        left: -8px;
    }
    
    #wheel {
        box-shadow: 
            0 0 0 4px #1e293b,
            0 0 0 7px #fbbf24,
            0 8px 16px rgba(0, 0, 0, 0.6);
    }
    
    .wheel-form {
        padding: 20px 12px;
        margin: 10px;
    }
    
    .wheel-form-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .wheel-form-subtitle {
        font-size: 13px;
        margin-bottom: 18px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .form-group input {
        padding: 12px 14px;
        font-size: 16px; /* Важно для iOS, чтобы не было зума */
    }
    
    .wheel-popup {
        padding: 15px 8px;
        border-radius: 12px;
        max-width: 98vw;
        max-height: 98vh;
    }
    
    .wheel-popup-close {
        width: 30px;
        height: 30px;
        top: 10px;
        right: 10px;
        font-size: 18px;
    }
    
    .wheel-popup-content {
        padding: 0;
    }
    
    .wheel-form-overlay .wheel-form {
        max-width: 98%;
        padding: 18px 12px;
    }
    
    #wheelPopupSpinBtn {
        margin-top: 15px;
        font-size: 15px;
        padding: 14px 20px;
        min-width: 90%;
        max-width: 90%;
    }
    
    .result {
        padding: 15px 10px;
        margin: 15px 0;
    }
    
    .result-text {
        font-size: 14px;
    }
    
    .result-prize {
        font-size: 18px;
        margin-top: 8px;
    }
    
    .note {
        font-size: 11px;
        padding: 12px 10px;
        margin: 15px 0;
    }
    
    .wheel-prize-note {
        font-size: 10px;
        padding: 0 10px;
        margin-top: 12px;
        line-height: 1.4;
    }
}

/* Дополнительная адаптация для очень маленьких экранов */
@media (max-width: 360px) {
    .wheel-of-fortune-page {
        padding: 5px;
        padding-top: 80px;
    }
    
    .wheel-wrapper {
        width: 90vw;
        height: 90vw;
        max-width: 300px;
        max-height: 300px;
        margin: 0 auto 15px;
    }
    
    .wheel-popup .wheel-wrapper {
        width: 90vw;
        height: 90vw;
        max-width: 320px;
        max-height: 320px;
    }

    .spin-button,
    #wheelSpinBtn {
        padding: 14px 18px;
        font-size: 14px;
        min-width: 95%;
        max-width: 95%;
        margin: 15px auto;
    }
    
    .center-circle {
        width: 40px;
        height: 40px;
    }
    
    .arrow {
        border-left-width: 9px;
        border-right-width: 9px;
        border-top-width: 16px;
        top: -7px;
    }
    
    .arrow::after {
        width: 14px;
        height: 14px;
        top: -16px;
        left: -7px;
    }
    
    .wheel-form {
        padding: 18px 10px;
    }
    
    .wheel-form-title {
        font-size: 18px;
    }
    
    .wheel-form-subtitle {
        font-size: 12px;
    }
    
    .form-group input {
        padding: 11px 12px;
    }
    
    .wheel-popup {
        padding: 12px 6px;
    }
    
    .wheel-form-overlay .wheel-form {
        padding: 15px 10px;
    }
    
    #wheelPopupSpinBtn {
        font-size: 14px;
        padding: 12px 18px;
    }
    
    .result {
        padding: 12px 8px;
    }
    
    .result-text {
        font-size: 13px;
    }
    
    .result-prize {
        font-size: 16px;
    }
    
    .wheel-prize-note {
        font-size: 9px;
        padding: 0 8px;
    }
}

/* Попап колеса фортуны */
.wheel-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wheel-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.wheel-popup {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 20px;
    padding: 40px 20px;
    max-width: 900px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .wheel-popup {
        padding: 20px 15px;
        border-radius: 15px;
        max-width: 95vw;
    }
}

@media (max-width: 480px) {
    .wheel-popup {
        padding: 15px 10px;
        border-radius: 12px;
        max-width: 98vw;
    }
}

.wheel-popup-overlay.active .wheel-popup {
    transform: scale(1);
}

.wheel-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.wheel-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.wheel-popup-content {
    text-align: center;
}

/* Колесо с блюром */
.wheel-blurred {
    filter: blur(5px);
    pointer-events: none;
    transition: filter 0.3s ease;
}

/* Форма поверх колеса */
.wheel-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.wheel-of-fortune-page .wheel-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.wheel-form-overlay.active {
    display: flex;
}

.wheel-form-overlay .wheel-form {
    background: rgba(30, 41, 59, 0.95);
    max-width: 400px;
    width: 90%;
}

/* Фиксированная кнопка */
.wheel-fixed-button {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 60px;
    height: 200px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: none;
    border-radius: 15px 0 0 15px;
    cursor: pointer;
    box-shadow: -5px 0 20px rgba(251, 191, 36, 0.5);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    padding: 20px 10px;
}

.wheel-fixed-button.visible {
    display: flex;
}

.wheel-fixed-button:hover {
    transform: translateY(-50%) translateX(-5px);
    box-shadow: -8px 0 30px rgba(251, 191, 36, 0.7);
}

.wheel-fixed-button svg {
    width: 35px;
    height: 35px;
    fill: #000;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: -5px 0 20px rgba(251, 191, 36, 0.5);
    }
    50% {
        box-shadow: -8px 0 30px rgba(251, 191, 36, 0.8);
    }
}

/* Адаптивность для фиксированной кнопки */
@media (max-width: 768px) {
    .wheel-fixed-button {
        width: 50px;
        height: 150px;
        border-radius: 12px 0 0 12px;
    }
    
    .wheel-fixed-button svg {
        width: 28px;
        height: 28px;
    }
    
    .wheel-fixed-button span {
        font-size: 10px;
        margin-top: 8px;
    }
}

/* Сноска о призах */
.wheel-prize-note {
    margin-top: 20px;
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}

.wheel-prize-note strong {
    color: #fbbf24;
    font-style: normal;
}

/* Анимация привлечения внимания */
@keyframes attention-spin {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(90deg);
    }
    50% {
        transform: rotate(180deg);
    }
    75% {
        transform: rotate(270deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.wheel-attention-spin {
    animation: attention-spin 2s ease-in-out;
}

/* Дополнительная адаптация для мобильных устройств */
@media (max-width: 768px) {
    .wheel-of-fortune-page #wheelSpinBtn {
        min-width: 280px;
        max-width: 90%;
    }
    
    .center-circle {
        width: 60px;
        height: 60px;
        box-shadow: 
            0 0 0 3px #fbbf24,
            0 3px 10px rgba(0, 0, 0, 0.5);
    }
    
    .wheel-popup-content {
        padding: 0;
    }
    
    .wheel-form-overlay .wheel-form {
        max-width: 95%;
        padding: 20px 15px;
    }
    
    #wheelPopupSpinBtn {
        margin-top: 15px;
        font-size: 16px;
        padding: 14px 28px;
    }
}

@media (max-width: 480px) {
    .wheel-of-fortune-page #wheelSpinBtn {
        min-width: 260px;
        max-width: 95%;
    }
    
    .center-circle {
        width: 50px;
        height: 50px;
        box-shadow: 
            0 0 0 2px #fbbf24,
            0 2px 8px rgba(0, 0, 0, 0.5);
    }
    
    .wheel-form-overlay .wheel-form {
        max-width: 98%;
        padding: 15px 10px;
    }
    
    #wheelPopupSpinBtn {
        margin-top: 12px;
        font-size: 14px;
        padding: 12px 24px;
    }
}

