.lucky-wheel-section {
    position: relative;
    padding: 72px 24px;
    content-visibility: auto;
    contain-intrinsic-size: 620px;
}

.lucky-wheel-panel {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 500px);
    gap: 32px;
    align-items: center;
    border: 1px solid rgba(83, 220, 255, .22);
    border-radius: 28px;
    padding: 34px;
    background:
        linear-gradient(135deg, rgba(83, 220, 255, .12), rgba(123, 97, 255, .10) 44%, rgba(56, 241, 194, .08)),
        rgba(5, 8, 22, .78);
    box-shadow: 0 30px 100px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
    overflow: hidden;
}

.lucky-wheel-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(83, 220, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(83, 220, 255, .05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(120deg, transparent, #000 18%, #000 75%, transparent);
    pointer-events: none;
}

.lucky-wheel-copy,
.lucky-wheel-visual {
    position: relative;
    z-index: 1;
}

.lucky-wheel-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px 12px;
    border: 1px solid rgba(83, 220, 255, .26);
    border-radius: 999px;
    color: #9fe9ff;
    background: rgba(83, 220, 255, .08);
    font-size: 13px;
    font-weight: 700;
}

.lucky-wheel-copy h2 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.1;
    color: #f3f8ff;
}

.lucky-wheel-copy p {
    max-width: 620px;
    margin: 0 0 18px;
    color: #a9bcda;
    font-size: 16px;
    line-height: 1.8;
}

.lucky-wheel-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.lucky-wheel-status {
    color: #8df5d3;
    font-size: 13px;
    font-weight: 700;
}

.btn-lucky {
    border: 1px solid rgba(83, 220, 255, .45);
    background: linear-gradient(135deg, #53dcff 0%, #38f1c2 52%, #ffd166 100%);
    color: #041018;
    font-weight: 900;
    box-shadow: 0 0 24px rgba(83, 220, 255, .24);
}

.btn-lucky:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(83, 220, 255, .34);
}

.lucky-wheel-mini {
    position: relative;
    width: min(360px, 90%);
    aspect-ratio: 1;
    margin-left: auto;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(83, 220, 255, .25), transparent 48%),
        conic-gradient(from 0deg, #53dcff, #7b61ff, #38f1c2, #ffb86b, #53dcff);
    padding: 18px;
    box-shadow: 0 0 34px rgba(83, 220, 255, .20), 0 0 70px rgba(123, 97, 255, .14);
}

.lucky-wheel-mini::before {
    content: '';
    position: absolute;
    inset: 44px;
    border-radius: 50%;
    background: #050816;
    box-shadow: inset 0 0 30px rgba(83, 220, 255, .22);
}

.lucky-wheel-mini::after {
    content: 'AI';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #eaf2ff;
    font-size: 42px;
    font-weight: 900;
    text-shadow: 0 0 22px rgba(83, 220, 255, .8);
}

.lucky-wheel-modal {
    position: fixed;
    top: 78px;
    right: 22px;
    left: auto;
    bottom: auto;
    z-index: 1000000;
    display: none;
    padding: 0;
}

.lucky-wheel-modal.is-open { display: block; }

.lucky-wheel-dialog {
    position: relative;
    width: min(680px, calc(100vw - 32px));
    max-height: min(82vh, 760px);
    overflow: auto;
    border: 1px solid rgba(83, 220, 255, .32);
    border-radius: 22px;
    background:
        radial-gradient(circle at 20% 0%, rgba(83, 220, 255, .18), transparent 35%),
        radial-gradient(circle at 90% 10%, rgba(123, 97, 255, .18), transparent 32%),
        #070c1a;
    color: #eaf2ff;
    box-shadow: 0 40px 140px rgba(0, 0, 0, .7);
}

.lucky-wheel-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
}

.lucky-wheel-dialog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 26px;
    align-items: center;
}

.lucky-wheel-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 320px;
}

.lucky-wheel-stage canvas {
    width: min(320px, 74vw);
    height: min(320px, 74vw);
}

.lucky-wheel-pointer {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 34px solid #38f1c2;
    filter: drop-shadow(0 0 10px rgba(56, 241, 194, .8));
    z-index: 2;
}

.lucky-wheel-info h3 {
    margin: 0 0 10px;
    font-size: 28px;
}

.lucky-wheel-info p {
    color: #a9bcda;
    line-height: 1.8;
}

.lucky-wheel-result {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid rgba(83, 220, 255, .25);
    border-radius: 16px;
    background: rgba(83, 220, 255, .08);
}

.lucky-wheel-code {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #050816;
    border: 1px dashed rgba(56, 241, 194, .6);
    color: #8df5d3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .08em;
}

@media (max-width: 900px) {
    .lucky-wheel-panel { grid-template-columns: 1fr; }
    .lucky-wheel-modal { top: 72px; left: 12px; right: 12px; }
    .lucky-wheel-dialog { width: 100%; max-height: 82vh; }
    .lucky-wheel-mini { margin: 0 auto; }
    .lucky-wheel-stage { min-height: 300px; }
}

@media (max-width: 640px) {
    .lucky-wheel-section { padding: 52px 16px; }
    .lucky-wheel-panel { padding: 24px; border-radius: 22px; }
    .lucky-wheel-modal {
        inset: 0;
        width: 100%;
        height: 100%;
        background: rgba(2, 6, 15, .86);
        overflow: hidden;
    }
    html.aics-lucky-open,
    body.aics-lucky-open {
        width: 100%;
        height: 100%;
        overflow: hidden !important;
        overscroll-behavior: none !important;
        touch-action: none;
    }
    .lucky-wheel-dialog {
        width: 100%;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(22px + env(safe-area-inset-bottom));
        touch-action: pan-y;
    }
    .lucky-wheel-close {
        position: fixed;
        top: calc(12px + env(safe-area-inset-top));
        right: calc(14px + env(safe-area-inset-right));
        z-index: 3;
        background: rgba(5, 8, 22, .82);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .lucky-wheel-dialog-grid {
        padding: calc(70px + env(safe-area-inset-top)) 18px 24px;
    }
    .lucky-wheel-stage {
        min-height: min(74vw, 320px);
    }
    .lucky-wheel-stage canvas {
        width: min(78vw, 320px);
        height: min(78vw, 320px);
    }
    .lucky-wheel-info h3 {
        font-size: 24px;
    }
    body.aics-lucky-open #aics-widget-btn,
    body.aics-lucky-open #aics-widget-container {
        display: none !important;
    }
}
