main {
    position: relative;
    min-height: calc(100vh - 90px);
    padding: clamp(32px, 5vw, 56px) 20px clamp(72px, 10vw, 108px);
    background-color: #000;
    overflow: hidden;
    isolation: isolate;
}

main::before,
main::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

main::before {
    z-index: -2;
    background: #000;
}

main::after {
    z-index: -1;
    opacity: 0;
}

.wheel-container {
    width: min(100%, 1240px);
    margin: 0 auto;
    display: grid;
    gap: 32px;
}

.wheel-hero {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    display: grid;
    gap: 14px;
}

.wheel-kicker,
.spin-info-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(35, 255, 242, 0.28);
    background: rgba(35, 255, 242, 0.12);
    color: var(--button-color);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.wheel-kicker {
    justify-self: center;
}

.wheel-container h1 {
    margin: 0;
    color: white;
    font-size: clamp(2.3rem, 1.7rem + 2vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.wheel-hero p {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.78);
}

.wheel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 380px);
    gap: 28px;
    align-items: center;
}

.wheel-stage,
.spin-info-container,
#my-dialog {
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(145deg, rgba(13, 17, 24, 0.92), rgba(6, 8, 12, 0.82));
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
}

.wheel-stage {
    position: relative;
    padding: clamp(24px, 4vw, 38px);
}

.wheel-stage::before,
.spin-info-container::before,
#my-dialog::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.fortune-wheel {
    position: relative;
    display: grid;
    place-items: center;
    padding: clamp(32px, 5vw, 46px) 18px 16px;
}

.fortune-wheel::before {
    content: "";
    position: absolute;
    inset: 12% 14%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(35, 255, 242, 0.2), rgba(35, 255, 242, 0) 62%);
    filter: blur(12px);
    opacity: 0.9;
    pointer-events: none;
}

.wheel-shell {
    position: relative;
    width: min(100%, 540px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.wheel-shell::before,
.wheel-shell::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.wheel-shell::before {
    inset: -18px;
    background:
        radial-gradient(circle, rgba(35, 255, 242, 0.14), rgba(35, 255, 242, 0) 62%),
        radial-gradient(circle at 65% 80%, rgba(255, 161, 71, 0.15), rgba(255, 161, 71, 0) 34%);
    filter: blur(10px);
    z-index: 0;
}

.wheel-shell::after {
    inset: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 24px 50px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.wheel {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 34%),
        repeating-conic-gradient(
            from calc(var(--segment-angle) / -2),
            #11d6ff 0deg var(--segment-angle),
            #34e3a4 var(--segment-angle) calc(var(--segment-angle) * 2),
            #ffc854 calc(var(--segment-angle) * 2) calc(var(--segment-angle) * 3),
            #ff8e62 calc(var(--segment-angle) * 3) calc(var(--segment-angle) * 4),
            #ff5c89 calc(var(--segment-angle) * 4) calc(var(--segment-angle) * 5),
            #756bff calc(var(--segment-angle) * 5) calc(var(--segment-angle) * 6)
        );
    box-shadow:
        0 28px 45px rgba(0, 0, 0, 0.34),
        inset 0 0 0 12px rgba(255, 255, 255, 0.08),
        inset 0 22px 32px rgba(255, 255, 255, 0.12),
        inset 0 -26px 42px rgba(0, 0, 0, 0.28);
    transform: rotate(0deg);
    will-change: transform;
}

.wheel::before,
.wheel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.wheel::before {
    inset: 16px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 0 0 10px rgba(5, 8, 13, 0.08);
}

.wheel::after {
    inset: 0;
    background: repeating-conic-gradient(
        from calc(var(--segment-angle) / -2),
        rgba(255, 255, 255, 0.5) 0deg 1deg,
        rgba(255, 255, 255, 0) 1deg var(--segment-angle)
    );
    mix-blend-mode: overlay;
    opacity: 0.75;
}

.ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform: rotate(calc(var(--segment-angle) / -2));
}

.label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    display: flex;
    justify-content: center;
    transform-origin: 50% 100%;
    transform: rotate(calc(var(--rotation) + (var(--segment-angle) / 2)));
    user-select: none;
}

.label span {
    position: absolute;
    top: 34%;
    left: 50%;
    display: block;
    width: clamp(106px, 18vw, 154px);
    padding-left: 20px;
    transform: translateX(-50%) rotate(90deg);
    color: white;
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.12;
    text-align: center;
    text-shadow:
        0 2px 6px rgba(0, 0, 0, 0.58),
        0 0 12px rgba(6, 10, 16, 0.18);
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.spin {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    width: clamp(124px, 20vw, 152px);
    height: clamp(124px, 20vw, 152px);
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff2b1 0%, #ffc44d 40%, #ff8a3d 100%);
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.35),
        inset 0 8px 18px rgba(255, 255, 255, 0.48),
        inset 0 -16px 24px rgba(164, 48, 0, 0.28);
    color: #2d1600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.spin::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px solid rgba(120, 44, 0, 0.18);
    pointer-events: none;
}

.spin__label {
    position: relative;
    z-index: 1;
    font-size: clamp(1rem, 0.9rem + 0.6vw, 1.35rem);
    font-weight: 800;
}

.spin__hint {
    position: relative;
    z-index: 1;
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.72;
}

.spin:hover {
    transform: translate(-50%, -50%) scale(1.04);
    box-shadow:
        0 24px 42px rgba(0, 0, 0, 0.4),
        inset 0 8px 18px rgba(255, 255, 255, 0.48),
        inset 0 -16px 24px rgba(164, 48, 0, 0.28);
}

.spin:active {
    transform: translate(-50%, -50%) scale(0.98);
}

.spin:disabled {
    cursor: default;
    color: rgba(45, 22, 0, 0.58);
    filter: grayscale(0.15) saturate(0.72);
    box-shadow:
        0 12px 20px rgba(0, 0, 0, 0.25),
        inset 0 8px 18px rgba(255, 255, 255, 0.36),
        inset 0 -12px 20px rgba(164, 48, 0, 0.18);
}

.spin:hover:disabled,
.spin:active:disabled {
    transform: translate(-50%, -50%);
}

.arrow {
    position: absolute;
    top: -4px;
    left: 50%;
    z-index: 5;
    width: 78px;
    height: 116px;
    transform: translateX(-50%);
    filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.24));
}

.arrow::before,
.arrow::after {
    content: "";
    position: absolute;
}

.arrow::before {
    inset: 0;
    clip-path: polygon(50% 0%, 86% 40%, 67% 40%, 67% 100%, 33% 100%, 33% 40%, 14% 40%);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff7b6 0%, #ffcb55 42%, #ff8b37 100%);
    box-shadow:
        inset 0 6px 12px rgba(255, 255, 255, 0.35),
        inset 0 -8px 16px rgba(171, 52, 0, 0.24);
}

.arrow::after {
    left: 50%;
    top: 52px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffe6a3;
    box-shadow: 0 0 0 8px rgba(255, 230, 163, 0.22);
    transform: translateX(-50%);
}

.fortune-wheel.is-spinning .arrow {
    animation: arrow-tick 0.14s linear infinite alternate;
}

.wheel-status {
    max-width: 520px;
    margin: 10px auto 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.5;
}

.spin-info-container {
    position: relative;
    display: grid;
    align-content: start;
    gap: 18px;
    padding: clamp(24px, 3vw, 34px);
}

.spin-info-kicker {
    justify-self: start;
}

.spin-info-container h2 {
    margin: 0;
    color: white;
    font-size: clamp(1.5rem, 1vw, 2rem);
    line-height: 1.05;
}

.spin-counter {
    display: grid;
    gap: 4px;
    padding: 22px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.spin-counter__value {
    color: white;
    font-size: clamp(2.8rem, 2.4rem + 1.2vw, 4rem);
    font-weight: 800;
    line-height: 1;
}

.spin-counter__label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.spin-info-note {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
    line-height: 1.6;
}

.spin-info-container button {
    justify-self: start;
    min-width: 220px;
    padding: 14px 20px;
    border: 1px solid rgba(35, 255, 242, 0.45);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(35, 255, 242, 0.15), rgba(84, 140, 255, 0.18));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.spin-info-container button:hover {
    background: linear-gradient(135deg, rgba(35, 255, 242, 0.24), rgba(84, 140, 255, 0.24));
    box-shadow: 0 12px 28px rgba(35, 255, 242, 0.16);
    transform: translateY(-2px);
}

.spin-info-container button:active {
    transform: translateY(0);
}

.lost-time {
    margin: 0;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: var(--button-color);
    line-height: 1.5;
}

.spin-benefits {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.spin-benefits li {
    position: relative;
    padding-left: 24px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.55;
}

.spin-benefits li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #23fff2, #ffb24d);
    box-shadow: 0 0 0 6px rgba(35, 255, 242, 0.08);
}

#my-dialog {
    position: relative;
    width: min(100%, 1200px);
    min-width: 290px;
    padding: clamp(22px, 3vw, 34px);
    color: white;
    font-size: 1.0625rem;
    margin: 15px auto 0;
}

#my-dialog h2 {
    margin: 0 0 10px;
    text-align: center;
    font-size: clamp(1.25rem, 2vw, 2rem);
}

#my-dialog p {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.65;
}

#my-dialog ol {
    margin: 0;
    padding-left: 22px;
    display: grid;
    gap: 12px;
    color: rgba(255, 255, 255, 0.88);
}

#my-dialog li {
    line-height: 1.6;
}

#my-dialog a {
    color: var(--button-color);
    text-decoration: none;
}

#my-dialog a:hover {
    text-decoration: underline;
}

@keyframes arrow-tick {
    from {
        transform: translateX(-50%) rotate(0deg);
    }

    to {
        transform: translateX(-50%) rotate(8deg);
    }
}

@media screen and (max-width: 1023px) {
    .wheel-layout {
        grid-template-columns: 1fr;
    }

    .spin-info-container button {
        justify-self: stretch;
    }

    .wheel-shell {
        width: min(100%, 480px);
    }
    .arrow {
        height: 100px;
    }
}

@media screen and (max-width: 700px) {
    .wheel-stage,
    .spin-info-container,
    #my-dialog {
        border-radius: 24px;
    }

    .fortune-wheel {
        padding-top: 24px;
    }

    .wheel-shell {
        width: min(100%, 400px);
    }

    .label span {
        top: 31%;
        width: clamp(80px, 24vw, 118px);
        padding-left: 30px;
        font-size: 1rem;
    }

    .spin {
        width: 112px;
        height: 112px;
    }

    .spin__hint {
        display: none;
    }

    .arrow {
        top: 2px;
        width: 68px;
        height: 102px;
    }

    .wheel-status {
        font-size: 0.95rem;
    }
}

@media screen and (max-width: 550px) {
    main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .wheel-container {
        gap: 24px;
    }

    .wheel-hero p {
        font-size: 1rem;
    }

    .wheel-stage,
    .spin-info-container,
    #my-dialog {
        padding: 20px 16px;
    }

    .wheel-shell {
        width: min(100%, 360px);
    }

    .spin-counter {
        padding: 18px 16px;
    }

    .spin-info-container button {
        min-width: 0;
        width: 100%;
    }

    #my-dialog {
        font-size: 1rem;
    }
    .label span {
        padding-left: 12px;
        font-size: 0.875rem;
    }
    .fortune-wheel {
        padding: 12px;
    }
}

@media screen and (max-width: 390px) {
    .wheel-shell {
        width: min(100%, 310px);
    }

    .label span {
        top: 29%;
        width: 72px;
        font-size: 0.6875rem;
    }

    .spin {
        width: 98px;
        height: 98px;
    }

    .spin__label {
        font-size: 0.92rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fortune-wheel.is-spinning .arrow {
        animation: none;
    }

    .spin,
    .spin-info-container button {
        transition: none;
    }
}
