:root {
    --bg: #080713;
    --panel: rgba(18, 16, 38, 0.88);
    --panel-solid: #121026;
    --gold: #ffd86b;
    --gold-deep: #f0a92d;
    --pink: #ff4ca6;
    --violet: #8d5cff;
    --cyan: #45dcff;
    --text: #ffffff;
    --muted: #b9b4d1;
    --line: rgba(255, 255, 255, 0.11);
    --symbol-height: clamp(88px, 24vw, 126px);
    --page-width: 720px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background:
        radial-gradient(circle at 50% -10%, rgba(141, 92, 255, 0.34), transparent 38%),
        radial-gradient(circle at 100% 35%, rgba(255, 76, 166, 0.18), transparent 32%),
        linear-gradient(180deg, #0d0a1f 0%, #080713 52%, #05040d 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    opacity: 0.28;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    font: inherit;
}

.ambient {
    position: fixed;
    z-index: -2;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    filter: blur(95px);
    pointer-events: none;
}

.ambient-one {
    top: 15%;
    left: -190px;
    background: rgba(69, 220, 255, 0.17);
}

.ambient-two {
    right: -210px;
    bottom: 5%;
    background: rgba(255, 76, 166, 0.17);
}

.page-shell {
    width: min(100%, var(--page-width));
    min-height: 100vh;
    margin: 0 auto;
    padding: env(safe-area-inset-top) 18px env(safe-area-inset-bottom);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand > .brand-logo {
    display: block;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    max-width: 38px !important;
    min-height: 38px;
    max-height: 38px !important;
    flex: 0 0 38px;
    object-fit: contain;
    border: 1px solid rgba(255, 216, 107, 0.55);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(240, 169, 45, 0.24);
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.topbar-tag {
    padding: 7px 10px;
    border: 1px solid rgba(141, 92, 255, 0.4);
    border-radius: 999px;
    color: #d5c9ff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    background: rgba(141, 92, 255, 0.09);
}

.main-content {
    padding: 38px 0 28px;
}

.hero {
    margin-bottom: 28px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.3px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 9vw, 54px);
    line-height: 1.08;
    letter-spacing: -2px;
    background: linear-gradient(180deg, #ffffff 15%, #d8d2f4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 12px 40px rgba(141, 92, 255, 0.18);
}

.hero-copy {
    max-width: 470px;
    margin: 15px auto 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
}

.slot-machine {
    position: relative;
    padding: 20px 18px 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 216, 107, 0.3);
    border-radius: 30px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.06), transparent 35%),
        linear-gradient(180deg, rgba(33, 28, 63, 0.96), rgba(13, 11, 29, 0.98));
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(255, 216, 107, 0.12);
}

.slot-machine::before {
    content: "";
    position: absolute;
    top: -120px;
    left: 50%;
    width: 360px;
    height: 210px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: rgba(141, 92, 255, 0.22);
    filter: blur(55px);
    pointer-events: none;
}

.machine-crown {
    position: absolute;
    top: 10px;
    left: 50%;
    display: flex;
    gap: 16px;
    transform: translateX(-50%);
}

.machine-crown span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 12px rgba(255, 216, 107, 0.95);
    animation: crownBlink 1.4s ease-in-out infinite alternate;
}

.machine-crown span:nth-child(2),
.machine-crown span:nth-child(4) {
    animation-delay: .35s;
}

.machine-crown span:nth-child(3) {
    animation-delay: .7s;
}

.machine-display {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    min-width: 120px;
    margin: 10px auto 17px;
    padding: 8px 15px;
    border: 1px solid rgba(69, 220, 255, 0.28);
    border-radius: 9px;
    color: var(--cyan);
    font-family: "Courier New", monospace;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    background: rgba(2, 13, 25, 0.68);
    box-shadow: inset 0 0 18px rgba(69, 220, 255, 0.07);
}

.display-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.reels {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
    overflow: hidden;
    border: 1px solid rgba(255, 216, 107, 0.5);
    border-radius: 20px;
    background: linear-gradient(180deg, #5b3a12, #c78c30 4%, #3a210a 7%, #20150b 94%, #b7791f 97%, #50300c);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.35),
        inset 0 0 0 1px rgba(255, 240, 178, 0.17);
}

.reel-window {
    position: relative;
    height: var(--symbol-height);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 13px;
    background:
        linear-gradient(180deg, rgba(0,0,0,.18), transparent 22%, transparent 78%, rgba(0,0,0,.22)),
        linear-gradient(180deg, #faf8ff, #ebe8f7);
    box-shadow:
        inset 0 12px 18px rgba(31, 22, 57, 0.12),
        inset 0 -12px 18px rgba(31, 22, 57, 0.12);
}

.reel-window::before,
.reel-window::after {
    content: "";
    position: absolute;
    z-index: 3;
    left: 0;
    width: 100%;
    height: 24%;
    pointer-events: none;
}

.reel-window::before {
    top: 0;
    background: linear-gradient(180deg, rgba(22, 16, 40, 0.24), transparent);
}

.reel-window::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(22, 16, 40, 0.24), transparent);
}

.reel-track {
    width: 100%;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.reel-item {
    display: grid;
    width: 100%;
    height: var(--symbol-height);
    padding: clamp(8px, 2.5vw, 14px);
    place-items: center;
}

.reel-item img {
    display: block;
    width: 100%;
    max-width: 132px;
    max-height: calc(var(--symbol-height) - 20px);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.reel-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border-radius: 10px;
    color: #3b2a69;
    font-size: clamp(14px, 4vw, 21px);
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(145deg, rgba(141,92,255,.12), rgba(255,76,166,.08));
}

.reel-placeholder-initial {
    color: rgba(78, 51, 132, 0.6);
    font-size: clamp(38px, 12vw, 62px);
    font-weight: 800;
    background: radial-gradient(circle, rgba(141,92,255,.12), rgba(255,76,166,.04) 68%, transparent 70%);
}

.spin-button {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(100%, 330px);
    min-height: 58px;
    margin: 21px auto 0;
    padding: 0 24px;
    overflow: hidden;
    place-items: center;
    border: 0;
    border-radius: 17px;
    cursor: pointer;
    color: #311700;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #fff0a5 0%, #ffd45d 42%, #f0a42a 100%);
    box-shadow:
        0 13px 30px rgba(240, 164, 42, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -3px 0 rgba(137, 70, 0, 0.25);
    transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.spin-button:active:not(:disabled) {
    transform: translateY(2px) scale(0.99);
}

.spin-button:disabled {
    cursor: not-allowed;
    opacity: .72;
    filter: saturate(.72);
}

.spin-button-shine {
    position: absolute;
    top: -80%;
    left: -35%;
    width: 28%;
    height: 250%;
    transform: rotate(25deg);
    background: rgba(255,255,255,.58);
    filter: blur(2px);
    animation: buttonShine 3.3s ease-in-out infinite;
}

.spin-button-text {
    position: relative;
    z-index: 1;
    font-size: 17px;
}

.slot-status {
    position: relative;
    z-index: 1;
    min-height: 20px;
    margin: 13px 0 0;
    color: #aea8c8;
    font-size: 12px;
    text-align: center;
}

.slot-machine.is-spinning .machine-display {
    color: var(--pink);
    border-color: rgba(255, 76, 166, 0.35);
    box-shadow: inset 0 0 18px rgba(255, 76, 166, 0.09);
}

.slot-machine.is-spinning .reel-window {
    box-shadow:
        inset 0 16px 22px rgba(31, 22, 57, 0.2),
        inset 0 -16px 22px rgba(31, 22, 57, 0.2),
        0 0 18px rgba(141, 92, 255, 0.16);
}

.tips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    padding: 16px 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: #aaa4c3;
    font-size: 11px;
    background: rgba(255,255,255,.025);
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.tip-number {
    color: var(--gold);
    font-family: "Courier New", monospace;
    font-size: 10px;
    font-weight: 800;
}

.tip-line {
    width: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
}

.footer {
    padding: 0 0 24px;
    color: #68627f;
    font-size: 11px;
    text-align: center;
}

.modal {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: grid;
    padding: 22px;
    visibility: hidden;
    place-items: center;
    opacity: 0;
    transition: opacity .22s ease, visibility .22s ease;
}

.modal.is-open {
    visibility: visible;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 2, 10, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    padding: 34px 24px 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 216, 107, 0.32);
    border-radius: 28px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(141,92,255,.22), transparent 38%),
        linear-gradient(180deg, #1a1734, #100e22);
    box-shadow: 0 30px 90px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.1);
    transform: translateY(18px) scale(.96);
    transition: transform .28s cubic-bezier(.2,.85,.25,1.12);
}

.modal.is-open .modal-card {
    transform: translateY(0) scale(1);
}

.modal-card::before {
    content: "";
    position: absolute;
    top: -120px;
    left: 50%;
    width: 280px;
    height: 190px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: rgba(255, 76, 166, 0.15);
    filter: blur(48px);
    pointer-events: none;
}

.modal-close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    cursor: pointer;
    color: #c8c2dd;
    font-size: 24px;
    line-height: 1;
    background: rgba(255,255,255,.055);
}

.modal-badge {
    position: relative;
    display: inline-flex;
    margin-bottom: 14px;
    padding: 6px 10px;
    border: 1px solid rgba(69,220,255,.26);
    border-radius: 999px;
    color: var(--cyan);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1.8px;
    background: rgba(69,220,255,.06);
}

.modal-logo-wrap {
    position: relative;
    display: grid;
    width: 124px;
    height: 94px;
    margin: 0 auto 10px;
    padding: 10px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 22px;
    background: linear-gradient(145deg, #fff, #e9e5f5);
    box-shadow: 0 16px 40px rgba(0,0,0,.24);
}

.modal-logo-wrap img {
    display: block;
    width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.modal-card h2 {
    position: relative;
    margin: 6px 0 10px;
    font-size: 27px;
    letter-spacing: -0.8px;
}

.modal-message {
    position: relative;
    min-height: 48px;
    padding: 13px 15px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    color: #d7d2e8;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
    background: rgba(255,255,255,.035);
}

.modal-actions {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.action-button {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 800;
    transition: transform .16s ease, filter .16s ease;
}

.action-button:active {
    transform: scale(.98);
}

.action-web {
    border: 1px solid rgba(255,255,255,.14);
    color: #f5f3ff;
    background: rgba(255,255,255,.075);
}

.action-app {
    color: #2d1700;
    background: linear-gradient(180deg, #ffe98f, #f1b43c);
    box-shadow: 0 10px 24px rgba(240,169,45,.18);
}

.action-icon {
    font-size: 18px;
    line-height: 1;
}

.modal-note {
    margin: 13px 0 0;
    color: #77718f;
    font-size: 10px;
}

.toast {
    position: fixed;
    z-index: 80;
    left: 50%;
    bottom: calc(28px + env(safe-area-inset-bottom));
    max-width: calc(100% - 40px);
    padding: 11px 16px;
    visibility: hidden;
    opacity: 0;
    transform: translate(-50%, 12px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    background: rgba(18, 16, 38, .94);
    box-shadow: 0 12px 35px rgba(0,0,0,.35);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.toast.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, 0);
}

@keyframes crownBlink {
    from { opacity: .28; transform: scale(.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes buttonShine {
    0%, 36% { left: -40%; opacity: 0; }
    48% { opacity: .8; }
    66%, 100% { left: 125%; opacity: 0; }
}

@media (min-width: 560px) {
    .page-shell {
        padding-left: 26px;
        padding-right: 26px;
    }

    .slot-machine {
        padding: 24px 28px 25px;
    }

    .reels {
        gap: 12px;
        padding: 11px;
    }

    .tips {
        gap: 18px;
        font-size: 12px;
    }

    .tip-line {
        width: 42px;
    }
}

@media (max-width: 390px) {
    .page-shell {
        padding-left: 13px;
        padding-right: 13px;
    }

    .main-content {
        padding-top: 28px;
    }

    .slot-machine {
        padding-left: 12px;
        padding-right: 12px;
        border-radius: 24px;
    }

    .tips {
        gap: 6px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .tip-item {
        gap: 4px;
        font-size: 10px;
    }

    .tip-line {
        width: 10px;
    }

    .modal-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
