:root {
    --sky: #63b8ed;
    --deep: #262070;
    --ink: #1f2333;
    --muted: #707586;
    --line: #e9ebf2;
    --pink: #d84c7a;
    --gold: #e6b76b;
    --violet: #766fee;
    --green: #69bd73;
    --red: #f1777a;
    --hero-from: #66bdf1;
    --hero-to: #63b8ed;
    --hero-image: none;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--deep);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    width: min(480px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--deep);
    position: relative;
    overflow-x: hidden;
}

.mini-topbar {
    height: 92px;
    padding: 30px 22px 12px;
    background: #fff;
    display: grid;
    grid-template-columns: 44px 1fr 88px;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.mini-topbar strong {
    text-align: center;
    font-size: 19px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--deep);
}

.brand-logo {
    max-height: 42px;
    max-width: 100%;
    object-fit: contain;
    vertical-align: middle;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    font-size: 34px;
    line-height: 1;
    color: #111;
}

.topbar-menu {
    justify-self: end;
    min-width: 76px;
    height: 34px;
    border: 1px solid #f0f0f0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111;
    font-size: 18px;
    background: #fff;
}

.page {
    background: var(--sky);
    min-height: calc(100vh - 92px);
    padding: 0 15px 32px;
}

.hero {
    height: 385px;
    margin: 0 -15px;
    padding: 20px 15px 0;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 74%, rgba(255,255,255,.9) 0 34px, transparent 35px),
        radial-gradient(circle at 80% 77%, rgba(255,255,255,.8) 0 22px, transparent 23px),
        linear-gradient(160deg, var(--hero-from), var(--hero-to));
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    opacity: .88;
    z-index: 0;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.coin-pill {
    position: absolute;
    left: 15px;
    top: 20px;
    height: 42px;
    min-width: 118px;
    border-radius: 999px;
    background: rgba(34, 80, 120, .45);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px 0 42px;
    font-size: 21px;
    font-weight: 800;
}

.coin-avatar {
    position: absolute;
    left: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: #8e96a6;
    border: 2px solid rgba(255,255,255,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 9px;
    line-height: 1.15;
    padding: 5px;
}

.music-dot {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.55);
    background: #263c55;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}

.hero-mark {
    width: 100%;
    position: absolute;
    left: 0;
    top: 145px;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0,0,0,.08);
}

.hero-mark p {
    margin: 0;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 900;
    transform: rotate(-9deg);
    opacity: .9;
}

.hero-mark h1 {
    margin: -2px 0 2px;
    font-size: 48px;
    line-height: 1.05;
    font-weight: 1000;
}

.hero-mark span {
    display: inline-block;
    padding: 3px 12px;
    background: #fff055;
    color: #2f63aa;
    font-size: 12px;
    font-weight: 900;
    transform: rotate(8deg);
}

.hero-palms {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 42px;
    height: 76px;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    color: #3b9b61;
    font-size: 54px;
    opacity: .95;
}

.hero-palms span:nth-child(1),
.hero-palms span:nth-child(4) {
    color: #fff;
    font-size: 44px;
    opacity: .82;
}

.joined-count {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 64px;
    margin: 0;
    color: rgba(255,255,255,.9);
    font-size: 18px;
    text-align: center;
}

.joined-count strong {
    font-weight: 500;
}

.side-actions {
    position: fixed;
    z-index: 12;
    right: calc(50% - min(240px, 50%) + 18px);
    top: 355px;
    display: grid;
    gap: 13px;
}

.side-actions button {
    width: 72px;
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 900;
    text-shadow: 0 2px 2px rgba(26, 20, 80, .32);
    display: grid;
    justify-items: center;
    gap: 2px;
}

.side-actions span {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 26px;
    background: linear-gradient(160deg, var(--violet), var(--pink));
    border: 2px solid rgba(255,255,255,.85);
    box-shadow: 0 6px 16px rgba(38, 32, 112, .35);
}

.side-actions em {
    font-style: normal;
    font-size: 13px;
    letter-spacing: .5px;
}

.ticker {
    margin-top: -38px;
    height: 52px;
    border-radius: 999px;
    background: rgba(46, 126, 180, .72);
    color: #fff;
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    padding: 0 18px;
    font-size: 18px;
    position: relative;
    z-index: 3;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.95);
    padding: 22px 1px 18px;
    font-size: 17px;
}

.summary-row button {
    border: 1px solid rgba(255,255,255,.75);
    color: #fff;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    padding: 8px 14px;
    min-width: 118px;
}

.card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 10px 28px rgba(31, 35, 51, .12);
}

.page-footer {
    text-align: center;
    color: rgba(255, 255, 255, .85);
    font-size: 13px;
    padding: 8px 0 4px;
    letter-spacing: .5px;
}

.section-head {
    min-height: 48px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
}

.section-head h2,
.info-card h2,
.gifts-card h2 {
    margin: 0;
    font-size: 22px;
    text-align: center;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #111;
    font-size: 16px;
    white-space: nowrap;
}

.check-line input {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    accent-color: var(--deep);
}

.loading {
    min-height: 160px;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.date-row {
    background: #f0f0f2;
    color: #5e626d;
    font-size: 20px;
    padding: 9px 15px;
}

.match-row {
    min-height: 116px;
    display: grid;
    grid-template-columns: 80px 1fr 62px 74px;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f2f6;
}

.match-row:last-child {
    border-bottom: 0;
}

.match-time {
    font-size: 28px;
    font-weight: 900;
    color: #050505;
}

.team-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    font-size: 18px;
}

.team-flag {
    width: 34px;
    display: inline-flex;
    justify-content: center;
    font-size: 24px;
}

.result-col {
    color: #979aa3;
    text-align: center;
    border-right: 1px solid #f0f0f2;
    font-size: 18px;
}

.result-col strong {
    display: block;
    color: #111;
    font-weight: 500;
    min-height: 34px;
}

.guess-link {
    border: 0;
    background: transparent;
    color: var(--deep);
    font-size: 18px;
    font-weight: 700;
    min-width: 58px;
}

.guess-link.done {
    color: #8a8d99;
    font-size: 15px;
}

.info-card,
.gifts-card {
    padding: 24px;
}

.info-card h2,
.gifts-card h2 {
    text-align: left;
    color: #4e5361;
    margin-bottom: 26px;
}

.gift-preview {
    display: grid;
    gap: 16px;
    margin-bottom: 26px;
}

.prize-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 18px;
    align-items: center;
}

.prize-thumb {
    height: 88px;
    border: 1px solid #eceef4;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 48px;
    color: var(--c, var(--gold));
    background: linear-gradient(145deg, #fbfbff, #f2f2fa);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.prize-row strong {
    display: block;
    font-size: 21px;
    margin-bottom: 4px;
}

.prize-row p,
.rule-block p {
    margin: 0;
    color: #555b68;
    font-size: 18px;
    line-height: 1.65;
    white-space: pre-line;
}

.rule-block {
    margin-top: 22px;
}

.rule-block h3 {
    display: inline-block;
    margin: 0 0 10px;
    padding: 0 8px;
    min-width: 86px;
    height: 28px;
    line-height: 28px;
    font-size: 20px;
    color: #111;
    background: linear-gradient(#fff, #f1f1f6);
    border-radius: 8px;
    box-shadow: -8px 8px 0 rgba(226, 226, 232, .75);
}

.brand-text {
    color: var(--deep) !important;
}

.gift-list {
    min-height: 210px;
}

.gift-list.empty {
    display: grid;
    place-items: center;
    color: #8f929a;
    text-align: center;
}

.empty-box {
    font-size: 86px;
    filter: grayscale(1);
    opacity: .34;
}

.gift-item {
    border: 1px solid #eef0f6;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    background: #fff;
}

.gift-item header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.gift-item strong {
    font-size: 18px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f3efff;
    color: var(--deep);
    font-size: 13px;
    white-space: nowrap;
}

.status-badge.redeemed,
.status-badge.expired {
    background: #f1f2f5;
    color: #898e99;
}

.code-line {
    margin-top: 10px;
    border-radius: 8px;
    background: #fff8ec;
    color: #8b5612;
    padding: 10px 12px;
    font-size: 17px;
    font-weight: 900;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.code-line button {
    border: 0;
    background: transparent;
    color: var(--deep);
    font-weight: 800;
}

.gift-meta {
    margin: 8px 0 0;
    color: #707586;
    font-size: 14px;
    line-height: 1.5;
}

.back-top {
    position: fixed;
    right: calc(50% - min(240px, 50%) + 24px);
    bottom: 90px;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: rgba(110, 112, 120, .62);
    color: #fff;
    font-size: 32px;
    z-index: 10;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 18px;
}

.modal.show {
    display: flex;
}

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

.modal-panel {
    width: min(430px, 100%);
    max-height: min(86vh, 720px);
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    position: relative;
    z-index: 1;
    box-shadow: 0 18px 70px rgba(0,0,0,.35);
}

.modal-panel.small {
    padding: 26px;
}

.modal-panel h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    color: #9da1aa;
    font-size: 42px;
    line-height: 1;
    position: absolute;
    right: 16px;
    top: 14px;
}

.muted {
    color: var(--muted);
    line-height: 1.6;
}

.form-stack {
    display: grid;
    gap: 14px;
}

.form-stack label {
    display: grid;
    gap: 7px;
    color: #383d4b;
    font-weight: 700;
}

.form-stack input {
    width: 100%;
    border: 1px solid #dfe2ea;
    border-radius: 8px;
    min-height: 46px;
    padding: 0 13px;
}

.primary-btn,
.ghost-btn {
    min-height: 50px;
    border-radius: 999px;
    border: 1px solid var(--deep);
    padding: 0 20px;
    font-size: 18px;
    font-weight: 800;
}

.primary-btn {
    background: linear-gradient(135deg, var(--deep), var(--violet));
    color: #fff;
    box-shadow: 0 8px 20px rgba(38, 32, 112, .28);
}

.ghost-btn {
    background: #eeeafa;
    color: var(--deep);
}

.match-dialog {
    padding-top: 72px;
}

.match-dialog h2 {
    position: absolute;
    top: 18px;
    left: 22px;
    right: 70px;
    font-size: 26px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deadline-row {
    background: #fff0f5;
    color: var(--pink);
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    font-size: 18px;
}

.notify-btn {
    border: 1px solid var(--pink);
    border-radius: 999px;
    color: var(--pink);
    background: transparent;
    min-height: 34px;
    padding: 0 14px;
}

.vs-box {
    display: grid;
    grid-template-columns: 1fr 90px 1fr;
    align-items: center;
    padding: 34px 30px 20px;
}

.team-side {
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
    font-size: 18px;
}

.team-side span {
    font-size: 58px;
    line-height: 1;
}

.team-side strong {
    font-weight: 500;
}

.vs-text {
    text-align: center;
    font-size: 48px;
    font-weight: 500;
}

.percent-bar {
    display: flex;
    height: 28px;
    margin: 0 22px 28px;
    border-radius: 999px;
    overflow: hidden;
    background: #eef0f6;
}

.percent-seg {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    overflow: hidden;
    transition: width .2s ease;
}

.percent-seg.home { background: var(--violet); }
.percent-seg.draw { background: var(--green); }
.percent-seg.away { background: var(--red); }

.pick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 22px 28px;
}

.pick-actions.two {
    grid-template-columns: repeat(2, 1fr);
}

.pick-actions button {
    min-height: 52px;
    border-radius: 999px;
    border: 1px solid #858bd7;
    color: var(--violet);
    background: #fff;
    font-size: 18px;
    position: relative;
}

.pick-actions button.draw-pick {
    color: var(--green);
    border-color: #8ac893;
}

.pick-actions button[disabled] {
    color: #a7aab2;
    border-color: #e4e6eb;
    background: #f8f8f9;
    cursor: not-allowed;
}

.picked-tag {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 999px;
    padding: 2px 9px;
    background: var(--pink);
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
}

.match-reward {
    min-height: 58px;
    background: #f1f1f2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 18px;
}

.match-reward strong {
    color: var(--pink);
    font-weight: 500;
}

.confirm-dialog {
    padding: 36px 24px;
    text-align: center;
}

.confirm-dialog p {
    margin: 0 0 28px;
    color: #555b68;
    font-size: 21px;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.draw-dialog {
    padding: 26px 22px 24px;
}

.draw-dialog h2 {
    padding-right: 58px;
}

.wheel-wrap {
    width: 260px;
    height: 260px;
    margin: 22px auto 18px;
    position: relative;
    display: grid;
    place-items: center;
}

.wheel-pointer {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    color: #d84c7a;
    z-index: 2;
    font-size: 32px;
}

.wheel {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 8px solid #fff;
    box-shadow: 0 0 0 8px #ffe9b2, 0 15px 40px rgba(38, 32, 112, .25);
    background: conic-gradient(#756cf2 0 25%, #ef6f8e 25% 50%, #59bf72 50% 75%, #f2b86c 75% 100%);
    position: relative;
    transition: transform 2.2s cubic-bezier(.18,.84,.18,1);
}

.wheel::after {
    content: "抽";
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #fff;
    color: var(--deep);
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 900;
    position: absolute;
    inset: 0;
    margin: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,.16);
}

.chance-list {
    display: grid;
    gap: 8px;
    max-height: 116px;
    overflow-y: auto;
    margin-bottom: 14px;
}

.chance-item {
    border: 1px solid #eceef5;
    border-radius: 8px;
    padding: 9px 10px;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    align-items: center;
    color: #4b5060;
}

.draw-btn {
    width: 100%;
}

.draw-result {
    margin-top: 14px;
}

.result-card {
    border-radius: 8px;
    background: #fff8ec;
    padding: 13px;
    color: #745019;
    line-height: 1.6;
}

.list-dialog {
    padding: 26px 22px;
}

.list-dialog h2 {
    padding-right: 58px;
    margin-bottom: 20px;
}

.guess-item {
    border: 1px solid #eceef5;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.guess-item strong {
    display: block;
    margin-bottom: 6px;
}

.guess-item p {
    margin: 0;
    color: #6f7481;
    line-height: 1.55;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(16px);
    max-width: min(360px, calc(100% - 36px));
    min-height: 42px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(31, 35, 51, .92);
    color: #fff;
    z-index: 70;
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.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;
}

@media (max-width: 390px) {
    .mini-topbar {
        grid-template-columns: 38px 1fr 74px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .mini-topbar strong {
        font-size: 17px;
    }

    .hero-mark h1 {
        font-size: 40px;
    }

    .match-row {
        grid-template-columns: 68px 1fr 50px 58px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .match-time {
        font-size: 23px;
    }

    .team-line,
    .guess-link {
        font-size: 16px;
    }

    .team-flag {
        width: 28px;
        font-size: 20px;
    }

    .section-head h2,
    .info-card h2,
    .gifts-card h2 {
        font-size: 20px;
    }

    .check-line {
        font-size: 14px;
    }

    .pick-actions {
        gap: 8px;
    }
}
