/* Колесо удачи */

.header-wheel-link {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    padding: 4px;
}

.header-wheel-link:hover {
    color: var(--color-primary);
}

.header-wheel-link .nav-text {
    margin-left: 4px;
}

.header-wheel-link .wheel-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    border: 1.5px solid var(--bg-primary);
    animation: wheel-badge-pulse 2s infinite;
}

.header-wheel-link.wheel-used .wheel-badge {
    display: none;
}

.header-wheel-link.wheel-used {
    opacity: 0.4;
    pointer-events: none;
}

@keyframes wheel-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.lucky-wheel-trigger {
    display: none;
}

/* Модалка */

.lucky-wheel-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.35s ease;
    overscroll-behavior: none;
}

.lucky-wheel-modal.active {
    display: flex;
    opacity: 1;
}

.lucky-wheel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 24, 0.55);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    z-index: -1;
}

/* Контейнер */

.lucky-wheel-container {
    position: relative;
    text-align: center;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(20, 15, 40, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 24px;
    padding: 16px 20px 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(139, 92, 246, 0.08);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lucky-wheel-container::-webkit-scrollbar {
    display: none;
}

.lucky-wheel-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 37px;
    height: 37px;
    border: none;
    border-radius: 0;
    background: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.2s ease;
    line-height: 1;
    padding: 0;
}

.lucky-wheel-close:hover {
    color: rgba(255, 255, 255, 0.7);
    color: rgba(255, 255, 255, 0.8);
}

/* Заголовки */

.lucky-wheel-title {
    font-family: var(--font-family-heading);
    font-size: clamp(1.2rem, 4.5vw, 1.7rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 2px 0;
    line-height: 1.2;
    padding: 0 32px;
}

.lucky-wheel-subtitle {
    font-size: clamp(0.78rem, 2.2vw, 0.88rem);
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    line-height: 1.5;
    max-width: 280px;
}

/* Колесо — квадрат через aspect-ratio */

.lucky-wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 290px;
    aspect-ratio: 1 / 1;
    margin: 20px auto 10px;
    flex-shrink: 0;
}

.lucky-wheel-canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.12));
    will-change: transform;
}

/* Указатель */

.lucky-wheel-pointer {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-top: 26px solid #10b981;
    filter: drop-shadow(0 4px 10px rgba(16, 185, 129, 0.5));
}

.lucky-wheel-modal.active .lucky-wheel-pointer {
    animation: pointer-glow 1.5s ease-in-out infinite;
}

@keyframes pointer-glow {
    0%, 100% { filter: drop-shadow(0 4px 10px rgba(16, 185, 129, 0.5)); }
    50% { filter: drop-shadow(0 4px 18px rgba(16, 185, 129, 0.85)); }
}

/* Кнопка */

.btn-lucky-spin {
    width: 100%;
    max-width: 240px;
    padding: 12px 24px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    font-family: var(--font-family-base);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.3);
    flex-shrink: 0;
}

.btn-lucky-spin::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer-spin 2.5s infinite;
}

@keyframes shimmer-spin {
    0% { left: -100%; }
    100% { left: 100%; }
}

.btn-lucky-spin:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    background: rgba(139, 92, 246, 0.3);
}

.btn-lucky-spin:disabled::after {
    animation: none;
}

.btn-lucky-spin:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.45);
}

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

.lucky-wheel-rule {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 6px;
}

/* Результат */

.lucky-wheel-result {
    margin-top: 8px;
    padding: 10px 16px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 14px;
    display: none;
    width: 100%;
    max-width: 240px;
}

.lucky-wheel-result.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.lucky-wheel-result-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-success);
    margin-bottom: 2px;
}

.lucky-wheel-result-code {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 2px;
}

.lucky-wheel-result-private {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.lucky-wheel-result-desc {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

/* Кнопка «Забрать скидку» */

.btn-lucky-claim {
    display: none;
    width: 100%;
    margin-top: 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: var(--font-family-heading, system-ui, sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-lucky-claim:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-lucky-claim:active {
    transform: translateY(0) scale(1);
}

.lucky-wheel-result.show .btn-lucky-claim {
    display: block;
}

/* Комбо лейбл */

.lucky-wheel-result-combo {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-primary, #a855f7);
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 8px;
    padding: 4px 10px;
    margin: 4px 0 2px;
    display: inline-block;
}

/* Инфо-блок под колесом */

.lucky-wheel-info {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
    max-width: 260px;
}

.lucky-wheel-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1.4;
    padding: 3px 0;
}

.lw-info-icon {
    font-size: 0.72rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

/* Десктоп */

@media (min-width: 769px) {
    .lucky-wheel-container {
        max-width: 480px;
        padding: 24px 32px 20px;
        border-radius: 28px;
    }

    .lucky-wheel-wrapper {
        max-width: 340px;
        margin: 14px auto 16px;
    }

    .lucky-wheel-title {
        font-size: 1.8rem;
    }

    .lucky-wheel-subtitle {
        font-size: 0.92rem;
        max-width: 340px;
    }

    .btn-lucky-spin {
        max-width: 280px;
        padding: 16px 28px;
        font-size: 1.05rem;
        border-radius: 16px;
    }

    .lucky-wheel-pointer {
        border-left-width: 15px;
        border-right-width: 15px;
        border-top-width: 30px;
        top: -5px;
    }

    .lucky-wheel-result {
        max-width: 280px;
    }
}

@media (min-width: 1024px) {
    .lucky-wheel-container {
        max-width: 540px;
        padding: 26px 34px 22px;
        border-radius: 30px;
    }

    .lucky-wheel-wrapper {
        max-width: 400px;
        margin: 16px auto 18px;
    }

    .lucky-wheel-subtitle {
        max-width: 380px;
    }

    .btn-lucky-spin {
        max-width: 300px;
    }

    .lucky-wheel-result {
        max-width: 300px;
    }
}

@media (min-width: 1200px) {
    .lucky-wheel-container {
        max-width: 580px;
        padding: 28px 38px 24px;
    }

    .lucky-wheel-wrapper {
        max-width: 440px;
        margin: 18px auto 20px;
    }

    .lucky-wheel-subtitle {
        max-width: 420px;
    }
}

/* Мобильный */

@media (max-width: 420px) {
    .lucky-wheel-container {
        padding: 14px 14px 10px;
        border-radius: 20px;
    }

    .lucky-wheel-wrapper {
        max-width: 250px;
        margin: 8px auto 10px;
    }

    .lucky-wheel-pointer {
        border-left-width: 11px;
        border-right-width: 11px;
        border-top-width: 22px;
        top: -3px;
    }

    .lucky-wheel-title {
        padding: 0 28px;
    }
}

@media (max-width: 360px) {
    .lucky-wheel-wrapper {
        max-width: 220px;
        margin: 8px auto 10px;
    }

    .lucky-wheel-container {
        padding: 12px 10px 8px;
    }

    .lucky-wheel-pointer {
        border-left-width: 9px;
        border-right-width: 9px;
        border-top-width: 18px;
    }
}

@media (max-height: 640px) {
    .lucky-wheel-wrapper {
        max-width: min(240px, 36vh);
        margin: 6px auto 8px;
    }

    .lucky-wheel-container {
        padding: 10px 12px 8px;
    }

    .lucky-wheel-title {
        font-size: 1.1rem;
    }

    .lucky-wheel-subtitle {
        font-size: 0.76rem;
    }
}

@media (max-height: 500px) {
    .lucky-wheel-wrapper {
        max-width: min(180px, 30vh);
        margin: 4px auto 6px;
    }

    .btn-lucky-spin {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}
