:root {
    --bg: #1a1a1a;
    --modal-bg: #ffffff;
    --accent: #ff004f;
    --accent-dark: #d0003f;
    --fade: rgba(0, 0, 0, 0.6);
    --text-main: #111;
    --text-muted: #666;
    --wheel-size: min(80vw, 420px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    background: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--fade);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    animation: fadeIn 0.4s ease;
}

.modal {
    background: var(--modal-bg);
    border-radius: 20px;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.25);
    max-width: 540px;
    width: 100%;
    overflow: hidden;
    transform: translateY(20px);
    animation: riseUp 0.6s ease forwards;
}

.modal-header,
.modal-footer {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
}

.modal-icon {
    font-size: 32px;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--accent);
}

.lottery-container {
    padding: 0 24px 24px;
    text-align: center;
}

.lottery-title {
    font-size: 24px;
    margin-bottom: 8px;
}

.lottery-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.wheel-container {
    position: relative;
    margin: 0 auto;
    width: var(--wheel-size);
    height: var(--wheel-size);
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    transition: transform 5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    background: conic-gradient(
        from -22.5deg,
        #ff004f 0deg 45deg,
        #ff7b00 45deg 90deg,
        #ff1f1f 90deg 135deg,
        #ffb500 135deg 180deg,
        #ff004f 180deg 225deg,
        #ff7b00 225deg 270deg,
        #ff1f1f 270deg 315deg,
        #ffb500 315deg 360deg
    );
}

.wheel::after {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), transparent 60%);
}

.wheel-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center;
    transform: translate(-50%, -50%) rotate(calc(45deg * var(--index))) translateY(calc(var(--wheel-size) * -0.34));
    width: 120px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.wheel-label span {
    display: inline-block;
    transform: rotate(calc(-45deg * var(--index)));
}

.wheel-pointer {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 50px;
    background: var(--accent);
    clip-path: polygon(50% 0, 0% 100%, 100% 100%);
    z-index: 2;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fff5f5, #ffd7d7);
    border-radius: 50%;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.1);
    display: grid;
    place-items: center;
    z-index: 1;
}

.wheel-center-text {
    font-size: 42px;
}

.prize-result {
    margin-top: 24px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 0, 79, 0.08);
    color: var(--accent);
    font-weight: 600;
    display: none;
}

.modal-button {
    flex: 1;
    margin: 0 6px;
    padding: 14px 0;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.modal-button:active {
    transform: scale(0.97);
}

.modal-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.claim-button {
    background: #ffa502;
}

.content {
    text-align: center;
    color: #fff;
    padding: 24px;
    animation: reveal 0.5s ease forwards;
}

.image-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.prank-image {
    width: min(80vw, 320px);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(255, 0, 79, 0.4);
}

.message p {
    font-size: 24px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.back-button {
    margin-top: 24px;
    border: none;
    padding: 12px 38px;
    border-radius: 30px;
    background: linear-gradient(135deg, #ff004f, #ff7b00);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(255, 0, 79, 0.35);
}

.audio-tip {
    margin: 12px 0 0;
    font-size: 16px;
    color: #ffe0e9;
}

.audio-tip button {
    margin-left: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
    background: rgba(255, 0, 79, 0.65);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.audio-tip button:hover {
    background: rgba(255, 0, 79, 0.85);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes riseUp {
    to {
        transform: translateY(0);
    }
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 520px) {
    .modal {
        border-radius: 16px;
    }

    .modal-title span {
        font-size: 18px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 12px;
    }

    .modal-button {
        width: 100%;
        margin: 0;
    }
}

