:root {
    --orange: #ff7a1a;
    --orange-deep: #e85f00;
    --orange-soft: #fff4e9;
    --ink: #20242a;
    --muted: #7c848e;
    --line: #eceef2;
    --bg: #fffaf4;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

.page { min-height: 100vh; padding-bottom: 70px; }

.hero {
    padding: 30px 22px 46px;
    background: linear-gradient(140deg, #ff8a2b 0%, #ff6a00 55%, #f25c05 100%);
    color: #fff;
    border-radius: 0 0 26px 26px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, .12);
    border-radius: 50%;
    right: -70px;
    top: -80px;
}
.logo { font-size: 24px; font-weight: 700; letter-spacing: 2px; }
.sub { font-size: 13px; opacity: .9; margin-top: 6px; letter-spacing: 1px; }
.hero-badge {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    font-size: 12px;
}

main { padding: 0 16px; margin-top: -22px; }

.step { display: none; }
.step.active { display: block; animation: rise .3s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card {
    background: #fff;
    border-radius: 18px;
    padding: 22px 18px;
    box-shadow: 0 12px 30px rgba(255, 122, 26, .1);
}
.card + .card { margin-top: 14px; }
.card.center { text-align: center; }

h2 {
    font-size: 19px;
    margin: 0 0 8px;
    font-weight: 700;
}
.desc { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: #d63b3b; font-size: 13px; min-height: 18px; margin: 8px 0 0; }

input {
    width: 100%;
    border: 1px solid #e3e6eb;
    background: #fbfbfc;
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 15px;
    outline: none;
    font-family: inherit;
    color: var(--ink);
}
input:focus { border-color: var(--orange); background: #fff; box-shadow: 0 0 0 3px rgba(255, 122, 26, .12); }

#invite-code {
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 6px;
}

button {
    border: 0;
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.primary {
    width: 100%;
    margin-top: 16px;
    color: #fff;
    background: linear-gradient(135deg, #ff9a3c, #ff6a00);
    box-shadow: 0 10px 22px rgba(255, 106, 0, .28);
}
.primary:disabled { opacity: .55; box-shadow: none; }
.ghost {
    background: #fff;
    color: var(--orange-deep);
    border: 1px solid #ffd2ad;
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
}
.ghost:disabled { color: #b9bec6; border-color: #e6e8ec; }

.prize-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 14px;
}
.prize-item {
    background: #fff;
    border-radius: 14px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 8px 18px rgba(255, 122, 26, .07);
    font-size: 12px;
    color: #5c636d;
}
.prize-item img {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    margin: 0 auto 6px;
    background: var(--orange-soft);
}
.prize-item .ph {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: var(--orange-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    font-size: 22px;
}

.quiz-list .q {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
}
.q-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid #eef0f3;
    margin-bottom: 8px;
    background: #fcfcfd;
    font-size: 14px;
}
.opt input { width: auto; margin: 2px 0 0; }
.opt.checked { border-color: #ffc79b; background: var(--orange-soft); }

.wheel-wrap {
    position: relative;
    width: 78vw;
    max-width: 320px;
    margin: 10px auto 4px;
    aspect-ratio: 1 / 1;
}
.wheel-wrap canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 30px rgba(255, 122, 26, .22), inset 0 0 0 6px #fff;
    transform: rotate(0deg);
}
.pointer {
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 18px solid var(--orange-deep);
    z-index: 3;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .15));
}

.queue {
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    background: var(--orange-soft);
    border: 1px dashed #ffc79b;
}
.queue-no { font-size: 15px; }
.queue-no b { font-size: 26px; color: var(--orange-deep); letter-spacing: 2px; }

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }

.result-icon { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.result-prize { font-size: 17px; font-weight: 700; color: var(--orange-deep); margin: 4px 0 14px; }
.result-prize img {
    width: 110px;
    height: 110px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    margin: 10px auto;
    background: var(--orange-soft);
}

.code-box {
    background: linear-gradient(160deg, #fff8f1, #fff);
    border: 1px dashed #ffc79b;
    border-radius: 16px;
    padding: 16px 12px;
    margin: 8px 0 14px;
}
.code-label { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.verify-code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--orange-deep);
    margin: 8px 0 10px;
    word-break: break-all;
}
.result-tip { font-size: 13px; color: var(--muted); }
.hidden { display: none !important; }

.bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    text-align: center;
    z-index: 10;
}
.bottom-bar button {
    background: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    text-decoration: underline;
    padding: 4px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 26, .5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 20;
    padding: 0;
}
.modal-panel {
    background: #fff;
    width: 100%;
    max-width: 560px;
    border-radius: 20px 20px 0 0;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
    max-height: 82vh;
    overflow-y: auto;
}
.modal-panel h3 { margin: 0 0 12px; font-size: 17px; }
.modal-panel ol { padding-left: 20px; color: #444b54; font-size: 13px; }
.modal-panel ol li { margin-bottom: 8px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%);
    background: rgba(30, 32, 36, .88);
    color: #fff;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 20px;
    z-index: 30;
    max-width: 80vw;
    text-align: center;
}
