/* ==========================================================
   幸运大转盘 · 温暖可爱主题 v2.0
   奶油底 + 珊瑚橙 + 马卡龙糖果色
   全部图标为内联 SVG（无 emoji）
   ========================================================== */

:root {
    /* 底色 */
    --cream: #FFF8F1;
    --cream-2: #FFEFE3;
    --paper: #FFFFFF;
    --ink: #4A3B33;
    --ink-soft: #907D72;
    --ink-faint: #B9A99E;

    /* 主色：珊瑚蜜桃 */
    --coral: #FF8A65;
    --coral-d: #F0704A;
    --coral-l: #FFC3AC;

    /* 糖果辅助色 */
    --sun: #FFCF5C;
    --mint: #8FD9C0;
    --sky: #93C9EC;
    --lilac: #C6B7F0;
    --rose: #FFA7BE;

    /* 阴影与线 */
    --shadow-s: 0 6px 16px -8px rgba(203, 120, 86, .35);
    --shadow-m: 0 16px 36px -16px rgba(203, 120, 86, .42);
    --shadow-l: 0 28px 64px -24px rgba(173, 96, 62, .45);
    --shadow-in: inset 0 -3px 0 rgba(0, 0, 0, .06);
    --line: rgba(203, 120, 86, .16);

    --radius: 28px;
    --radius-s: 18px;

    --font-round: "PingFang SC", "Yuanti SC", "YouYuan", "HarmonyOS Sans SC",
                  "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}

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

html, body { overflow-x: clip; }

body {
    font-family: var(--font-round);
    color: var(--ink);
    background:
        radial-gradient(58% 42% at 82% -6%, rgba(255, 207, 92, .42) 0%, transparent 62%),
        radial-gradient(52% 40% at 8% 4%, rgba(255, 167, 190, .36) 0%, transparent 60%),
        radial-gradient(70% 45% at 50% 108%, rgba(143, 217, 192, .34) 0%, transparent 65%),
        linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 34px 18px 56px;
    -webkit-font-smoothing: antialiased;
}

/* 通用 SVG 图标 */
.ic {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.14em;
    flex-shrink: 0;
}

/* ---------------- 顶部标题 ---------------- */
.hero {
    position: relative;
    max-width: 460px;
    margin: 0 auto 26px;
    text-align: center;
    padding: 6px 10px 0;
}

.hero-stars {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--sun);
}
.hero-stars .ic { width: 18px; height: 18px; }
.hero-stars .ic:nth-child(2) { color: var(--rose); width: 22px; height: 22px; margin-top: -4px; }
.hero-stars .ic:nth-child(3) { color: var(--mint); }

.hero h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.4;
    color: #3D2E27;
}

.hero h1 em {
    font-style: normal;
    color: #F0704A;
}

.hero p {
    margin-top: 10px;
    font-size: 13.5px;
    color: var(--ink-soft);
    letter-spacing: .02em;
}

.hero-notice {
    margin-top: 16px;
    padding: 11px 16px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #8A6238;
    background: #FFF6E2;
    border: 1.5px dashed rgba(255, 183, 94, .75);
    border-radius: var(--radius-s);
    text-align: left;
}

/* ---------------- 模式切换 ---------------- */
.tabs {
    display: flex;
    gap: 8px;
    max-width: 460px;
    margin: 0 auto 22px;
    padding: 6px;
    background: #FFFFFF;
    border-radius: 999px;
    box-shadow: var(--shadow-s), var(--shadow-in);
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .03em;
    cursor: pointer;
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), background .22s, color .22s;
}
.tab .ic { width: 17px; height: 17px; }

.tab.is-active {
    color: #fff;
    background: linear-gradient(150deg, var(--coral), var(--coral-d));
    box-shadow: 0 8px 18px -8px var(--coral-d), inset 0 -2px 0 rgba(0, 0, 0, .1);
}
.tab:active { transform: scale(.95); }

/* ---------------- 转盘 ---------------- */
.panel { max-width: 460px; margin: 0 auto; }
.panel[hidden] { display: none !important; }

.wheel-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-top: 12px;
}

.wheel-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #FFFFFF;
    padding: 8px;
    border: 1px solid #EEE8E3;
    box-shadow: 0 4px 18px -10px rgba(0, 0, 0, .15);
}

#wheelCanvas, #decideCanvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #FFF9F3;
    position: relative;
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    line-height: 0;
}
.wheel-pointer svg { width: 22px; height: 28px; }

@keyframes pointerBob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(3px); }
}

/* 中心按钮：白色 + 凸起 + 微微悬浮 */
.wheel-start {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26%;
    aspect-ratio: 1 / 1;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    font-family: inherit;
    color: #F0704A;
    background: #FFFFFF;
    /* 外阴影 = 悬浮感；内阴影 = 凸起（顶部亮、底部暗） */
    box-shadow:
        0 10px 24px -8px rgba(0, 0, 0, .30),
        0 3px 8px -4px rgba(0, 0, 0, .12),
        inset 0 2px 2px #FFFFFF,
        inset 0 -6px 12px rgba(203, 120, 86, .13);
    transition: transform .16s;
}
/* 按钮顶部的凸起高光 */
.wheel-start::before {
    content: "";
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: 36%;
    height: 22%;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 2px 5px rgba(203, 120, 86, .18);
}
.wheel-start:active { transform: translate(-50%, -50%) scale(.94); }
.wheel-start .start-main {
    position: relative;
    z-index: 1;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .05em;
    margin-top: 8px;
}
.wheel-start .start-sub {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .28em;
    opacity: .8;
}

.wheel-start:disabled { filter: saturate(.55) brightness(1.03); cursor: not-allowed; }

.wheel-start.is-spinning { animation: candyPulse .9s ease-in-out infinite; }
@keyframes candyPulse {
    0%, 100% { box-shadow: 0 10px 20px -8px rgba(240, 112, 74, .75), inset 0 -5px 0 rgba(0, 0, 0, .1), 0 0 0 6px #fff; }
    50% { box-shadow: 0 14px 26px -8px rgba(240, 112, 74, .9), inset 0 -5px 0 rgba(0, 0, 0, .1), 0 0 0 11px rgba(255, 255, 255, .7); }
}

.wheel-tip {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.wheel-tip .ic { width: 15px; height: 15px; color: var(--sun); }

/* ---------------- 决定模式面板 ---------------- */
.decide-panel {
    padding: 20px;
    background: var(--paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow-m), var(--shadow-in);
}

.decide-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom: 12px;
}
.decide-label .ic { width: 15px; height: 15px; color: var(--rose); }

.tag-box { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px 7px 14px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: #7A4A2E;
    background: linear-gradient(140deg, #FFF1E6, #FFE3D3);
    border: 1.5px solid rgba(255, 160, 120, .5);
    animation: tagPop .28s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes tagPop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.tag button {
    width: 19px;
    height: 19px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 138, 101, .28);
    color: #C25A32;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tag button:active { transform: scale(.9); }

.decide-input-row { display: flex; gap: 9px; }

.decide-input {
    flex: 1;
    min-width: 0;
    padding: 13px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--line);
    background: #FFFBF7;
    color: var(--ink);
    font-family: inherit;
    font-size: 14.5px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.decide-input::placeholder { color: var(--ink-faint); }
.decide-input:focus {
    border-color: var(--coral-l);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 138, 101, .14);
}

.btn-add, .btn-clear, .btn-go, .modal-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    letter-spacing: .03em;
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), filter .18s;
}
.btn-add:active, .btn-clear:active, .btn-go:active, .modal-btn:active { transform: scale(.96); }

.btn-add {
    padding: 0 20px;
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    background: linear-gradient(150deg, var(--mint), #6FC9AC);
    box-shadow: 0 8px 16px -8px #6FC9AC, inset 0 -3px 0 rgba(0, 0, 0, .08);
}

.decide-actions { display: flex; gap: 10px; margin-top: 16px; }

.btn-clear {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px;
    border-radius: 15px;
    font-size: 14px;
    color: var(--ink-soft);
    background: #F7F0EA;
    box-shadow: inset 0 -3px 0 rgba(203, 120, 86, .1);
}
.btn-clear .ic { width: 15px; height: 15px; }

.btn-go {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px;
    border-radius: 15px;
    color: #fff;
    font-size: 15px;
    background: linear-gradient(150deg, var(--coral), var(--coral-d));
    box-shadow: 0 12px 22px -10px var(--coral-d), inset 0 -3px 0 rgba(0, 0, 0, .1);
}
.btn-go .ic { width: 17px; height: 17px; }
.btn-go:disabled { filter: saturate(.4) opacity(.65); cursor: not-allowed; box-shadow: none; }

.wheel-wrap--small { width: 80%; margin: 26px auto 0; }

/* ---------------- 弹窗 ---------------- */
/* 关键修复：display:flex 会覆盖 HTML hidden 属性，必须显式声明 */
.modal[hidden] { display: none !important; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
    background: rgba(90, 65, 54, .38);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn .24s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    position: relative;
    width: 100%;
    max-width: 330px;
    padding: 34px 26px 26px;
    text-align: center;
    background: var(--paper);
    border-radius: 32px;
    box-shadow: var(--shadow-l), var(--shadow-in);
    animation: cardPop .5s cubic-bezier(.34, 1.56, .64, 1);
    overflow: hidden;
}
@keyframes cardPop {
    from { transform: scale(.6) translateY(16px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 7px;
    background: linear-gradient(90deg, var(--rose), var(--sun), var(--mint), var(--sky), var(--lilac));
}

.modal-emoji { display: flex; justify-content: center; margin-bottom: 12px; color: var(--sun); }
.modal-emoji .ic { width: 46px; height: 46px; filter: drop-shadow(0 6px 10px rgba(255, 207, 92, .5)); animation: starSpin 3.4s linear infinite; }
@keyframes starSpin { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.08); } }

.modal-kicker { font-size: 13.5px; color: var(--ink-soft); font-weight: 700; letter-spacing: .05em; }

.modal-prize {
    margin: 12px 0 24px;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.35;
    color: #C2552F;
    text-shadow: 0 2px 0 #FFE7D6;
    overflow-wrap: anywhere;
}

.modal-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 17px;
    color: #fff;
    font-size: 15.5px;
    background: linear-gradient(150deg, var(--coral), var(--coral-d));
    box-shadow: 0 14px 26px -12px var(--coral-d), inset 0 -3px 0 rgba(0, 0, 0, .1);
}
.modal-btn .ic { width: 17px; height: 17px; }

/* ---------------- 撒花画布 ---------------- */
.fx-canvas { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
/* ---------------- 多转盘切换 ---------------- */
.wheel-switch {
    display: flex;
    gap: 8px;
    max-width: 460px;
    margin: 0 auto 18px;
    flex-wrap: wrap;
    justify-content: center;
}
.wheel-switch a {
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #907D72;
    background: #fff;
    border: 1px solid #FFE3D3;
}
.wheel-switch a.on {
    color: #fff;
    background: #FF7A59;
    border-color: #FF7A59;
}

/* ---------------- 最近中奖 ---------------- */
.recent {
    margin-top: 20px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #FFE3D3;
    border-radius: 18px;
}
.recent h2 {
    font-size: 13px;
    font-weight: 600;
    color: #907D72;
    margin-bottom: 10px;
}
.recent-list { display: flex; flex-direction: column; gap: 9px; }
.recent-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.recent-item .p { font-weight: 600; color: #C2552F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .t { color: #B9A99E; font-size: 12px; flex-shrink: 0; }
.recent-empty { font-size: 12.5px; color: #B9A99E; }

/* ---------------- 页脚小字 ---------------- */
.foot-note {
    max-width: 460px;
    margin: 30px auto 0;
    text-align: center;
    font-size: 12px;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.foot-note .ic { width: 13px; height: 13px; color: var(--rose); }

@media (max-width: 390px) {
    body { padding: 26px 14px 46px; }
    .hero h1 { font-size: 26px; }
    .start-main { font-size: 15px; }
    .tab { font-size: 13px; padding: 11px 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .wheel-pointer, .modal-emoji .ic { animation: none; }
}