:root {
    --bg: #0a0d12;
    --panel: #11151b;
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f4f7fb;
    --text-secondary: rgba(244, 247, 251, 0.68);
    --button-bg: #f4f7fb;
    --button-text: #0a0d12;
    --accent-cyan: rgba(125, 232, 255, 0.18);
    --accent-blue: rgba(106, 145, 255, 0.2);
    --accent-violet: rgba(214, 143, 255, 0.18);
    --spin-duration: 6200ms;
}

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

html {
    color-scheme: dark;
}

body {
    min-height: 100vh;
    font-family: "Inter", "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text-primary);
    background:
        radial-gradient(circle at 50% -10%, rgba(214, 243, 255, 0.12), transparent 28%),
        linear-gradient(180deg, #070b12 0%, #0a101a 45%, #070b11 100%);
    position: relative;
    overflow-x: hidden;
}

/* 背景使用会场主视觉的冰蓝、霓虹青和粉紫做辉光叠层。 */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: 0;
    background:
        radial-gradient(circle at 50% 6%, rgba(209, 239, 255, 0.16), transparent 20%),
        radial-gradient(circle at 18% 22%, var(--accent-violet), transparent 20%),
        radial-gradient(circle at 82% 18%, var(--accent-cyan), transparent 18%),
        radial-gradient(circle at 72% 64%, var(--accent-blue), transparent 24%),
        radial-gradient(circle at 24% 78%, rgba(120, 255, 216, 0.1), transparent 18%);
    filter: blur(18px);
    opacity: 0.95;
}

body::after {
    z-index: 0;
    background-image:
        linear-gradient(rgba(123, 230, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 230, 255, 0.07) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 24%);
    background-size: 36px 36px, 36px 36px, 100% 100%;
    mask-image: radial-gradient(circle at 50% 24%, black 34%, transparent 88%);
    opacity: 0.28;
}

body.modal-open {
    overflow: hidden;
}

a,
button {
    -webkit-tap-highlight-color: transparent;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 28rem);
    min-height: 100vh;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.hero,
.wheel-shell,
.modal-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 1.5rem;
    background:
        linear-gradient(180deg, rgba(24, 31, 44, 0.98) 0%, rgba(16, 22, 32, 0.98) 100%);
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.hero::before,
.wheel-shell::before,
.modal-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 0%, rgba(156, 220, 255, 0.06), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 18%);
}

.hero::after,
.wheel-shell::after,
.modal-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(122, 149, 200, 0.06);
}

.hero > *,
.wheel-shell > *,
.modal-panel > * {
    position: relative;
    z-index: 1;
}

.hero {
    padding: 1.25rem;
    text-align: center;
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 4%, rgba(205, 236, 255, 0.24), transparent 20%),
        radial-gradient(circle at 18% 18%, rgba(201, 130, 255, 0.14), transparent 20%),
        radial-gradient(circle at 82% 18%, rgba(98, 224, 255, 0.14), transparent 18%),
        linear-gradient(180deg, rgba(24, 32, 47, 0.98) 0%, rgba(14, 20, 30, 0.98) 100%);
}

.hero::before {
    background:
        radial-gradient(circle at 50% 2%, rgba(170, 229, 255, 0.22), transparent 18%),
        radial-gradient(circle at 50% 22%, rgba(108, 184, 255, 0.12), transparent 26%),
        linear-gradient(90deg, transparent 0%, rgba(120, 205, 255, 0.16) 12%, transparent 20%, transparent 80%, rgba(191, 136, 255, 0.14) 88%, transparent 100%),
        linear-gradient(rgba(115, 181, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(115, 181, 255, 0.07) 1px, transparent 1px),
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 4px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px, 28px 28px, 100% 100%;
    opacity: 1;
}

.hero::after {
    box-shadow:
        inset 0 0 0 1px rgba(122, 149, 200, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    background:
        linear-gradient(90deg, rgba(130, 201, 255, 0.18) 0 2px, transparent 2px 14%, rgba(130, 201, 255, 0.18) 14% 16%, transparent 16% 84%, rgba(180, 140, 255, 0.16) 84% 86%, transparent 86% 98%, rgba(180, 140, 255, 0.16) 98% 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 16%, rgba(255, 255, 255, 0.03) 16% 17%, transparent 17% 83%, rgba(255, 255, 255, 0.03) 83% 84%, transparent 84% 100%),
        radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.1), transparent 22%);
    opacity: 0.9;
}

.hero .top-logo,
.hero .hero-title,
.hero .hero-subtitle {
    position: relative;
    z-index: 2;
}

.top-logo {
    width: min(100%, 15rem);
    display: block;
    margin: 0 auto 1rem;
    border-radius: 0.9rem;
    filter:
        drop-shadow(0 0 14px rgba(183, 224, 255, 0.18))
        drop-shadow(0 0 28px rgba(88, 164, 255, 0.12));
}

.hero-title {
    font-size: clamp(1.6rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.hero-subtitle,
.limit-tip,
.status-message,
.summary-value,
.summary-location,
.modal-notice {
    color: var(--text-secondary);
}

.hero-subtitle {
    margin-top: 0.6rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.wheel-shell {
    padding: 1.25rem 1rem;
    text-align: center;
}

.limit-tip {
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.wheel-stage {
    display: grid;
    place-items: center;
    margin-bottom: 1.25rem;
}

.wheel-container {
    position: relative;
    width: min(100%, 18rem);
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 0.45rem;
    background: #0b1016;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.pointer {
    position: absolute;
    top: -0.8rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2rem;
    height: 3rem;
    z-index: 2;
}

.pointer::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 0.8rem solid transparent;
    border-right: 0.8rem solid transparent;
    border-top: 1.4rem solid var(--text-primary);
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    transition: transform var(--spin-duration) cubic-bezier(0.16, 0.9, 0.18, 1);
    will-change: transform;
}

.wheel-center {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #0f141b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.action-btn {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 0.95rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--button-text);
    background: var(--button-bg);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.action-btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-message {
    min-height: 1.4rem;
    margin-top: 0.8rem;
    font-size: 0.88rem;
}

.result-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.summary-line,
.result-line {
    margin-top: 0.55rem;
    font-size: 0.94rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.summary-line:first-child,
.result-line:first-child {
    margin-top: 0;
}

.summary-inline-label,
.result-inline-label {
    color: rgba(244, 247, 251, 0.72);
    font-weight: 600;
}

.summary-inline-value,
.result-inline-value {
    color: var(--text-secondary);
}

.summary-inline-value-strong,
.result-inline-value-strong {
    color: var(--text-primary);
    font-weight: 700;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
}

.footer-arrow {
    position: relative;
    width: 2.1rem;
    height: 0.75rem;
    flex: 0 0 auto;
}

.footer-arrow::before,
.footer-arrow::after {
    content: "";
    position: absolute;
    top: 50%;
}

.footer-arrow::before {
    left: 0;
    width: 1.45rem;
    height: 2px;
    transform: translateY(-50%);
    background: rgba(244, 247, 251, 0.55);
    border-radius: 999px;
}

.footer-arrow::after {
    right: 0.1rem;
    width: 0.5rem;
    height: 0.5rem;
    border-top: 2px solid rgba(244, 247, 251, 0.55);
    border-right: 2px solid rgba(244, 247, 251, 0.55);
    transform: translateY(-50%) rotate(45deg);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.68);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 26rem);
    padding: 1.25rem;
}

.modal-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.task-result {
    margin-bottom: 1rem;
}

.result-card {
    text-align: left;
}

.modal-notice {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --spin-duration: 2600ms;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    #wheelCanvas {
        transition-duration: var(--spin-duration) !important;
    }
}
