@font-face {
    font-family: "Montserrat Alternates";
    src: url("fonts/MontserratAlternates-Regular.otf") format("opentype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Montserrat";
    src: url("fonts/Montserrat-Bold.otf") format("opentype");
    font-weight: 700;
    font-display: swap;
}

* { box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #111316;
    color: #fff;
    font-family: "Montserrat Alternates", Arial, sans-serif;
}

button { font: inherit; }

.stage {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(ellipse 690px 760px at 50% 55%, rgba(84, 24, 28, .22), transparent 75%),
        linear-gradient(135deg, #16191d 0%, #0a0b0d 64%, #181a1e 100%);
}

.container {
    width: 1080px;
    height: 1920px;
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;
    transform: scale(var(--stage-scale, 1));
    transform-origin: center;
    background:
        linear-gradient(90deg, transparent 5%, rgba(255,255,255,.055) 5.1%, transparent 5.2%, transparent 94.8%, rgba(255,255,255,.055) 94.9%, transparent 95%),
        radial-gradient(ellipse at 50% 86%, rgba(167, 27, 35, .13), transparent 55%);
}

.container::before {
    content: "";
    position: absolute;
    width: 1400px;
    height: 1400px;
    border: 1px solid rgba(255,255,255,.045);
    border-radius: 50%;
    left: -160px;
    top: 510px;
    pointer-events: none;
}

.header {
    position: absolute;
    top: 170px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 10;
    user-select: none;
    touch-action: manipulation;
}

.brand-logo {
    width: 880px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
}

.header-rule {
    width: 76px;
    height: 4px;
    margin: 35px auto 75px;
    background: #d8232f;
}

h1 {
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 58px;
    line-height: 1.17;
    letter-spacing: .015em;
    margin: 0;
}

h1 span { color: #e52b37; }

.wheel-container {
    position: absolute;
    top: 640px;
    left: 0;
    width: 100%;
    height: 1030px;
    display: flex;
    justify-content: center;
    align-items: center;
    --wheel-size: 1030px;
}

.wheel-wrapper {
    position: relative;
    width: var(--wheel-size);
    height: var(--wheel-size);
    flex: 0 0 auto;
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255,255,255,.12), 0 28px 80px rgba(0,0,0,.6), 0 0 70px rgba(192,25,37,.16);
    transition: transform 5s cubic-bezier(.17,.67,.12,.99);
}

.wheel-overlay { display: block; width: 100%; height: 100%; }
.wheel-label { font-family: "Montserrat", Arial, sans-serif; font-weight: 700; fill: #fff; text-anchor: middle; letter-spacing: 0; }
.wheel-label--on-light { fill: #111316; }
.wheel-label--long { font-size: 24px; }
.wheel-label--short { font-size: 30px; }
.wheel-label--medium { font-size: 28px; }
.wheel-label--large { font-size: 38px; }

.prize-arrow {
    position: absolute;
    z-index: 25;
    top: -31px;
    left: 50%;
    transform: translateX(-50%);
    width: 78px;
    height: 105px;
    filter: drop-shadow(0 7px 7px rgba(0,0,0,.7));
    pointer-events: none;
}

.prize-arrow::before {
    content: "";
    position: absolute;
    top: 0;
    left: 5px;
    width: 68px;
    height: 88px;
    background: #e32936;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    border-radius: 6px;
}

.prize-arrow::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 13px;
    width: 52px;
    height: 64px;
    background: #f66a72;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.spin-button {
    position: absolute;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 210px;
    height: 210px;
    padding: 0;
    border: 7px solid #d52b35;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 25%, #4a4d53, #191c20 65%);
    color: white;
    box-shadow: inset 0 0 0 5px #0f1013, 0 9px 24px rgba(0,0,0,.65);
    cursor: pointer;
    touch-action: manipulation;
    transition: filter .2s, transform .2s;
}

.spin-button:active { transform: scale(.96); }
.spin-button:disabled { cursor: default; filter: brightness(.75); }
.spin-button-icon {
    display: block;
    width: 142px;
    height: auto;
    margin: auto;
    pointer-events: none;
}

.footer-logo {
    position: absolute;
    bottom: 130px;
    left: 50%;
    width: 290px;
    height: auto;
    transform: translateX(-50%);
}

.instruction {
    position: absolute;
    bottom: 79px;
    width: 100%;
    text-align: center;
    color: #9b9da1;
    font-size: 19px;
    letter-spacing: .2em;
}

.result {
    position: absolute;
    z-index: 30;
    left: 50%;
    bottom: 62px;
    width: 860px;
    min-height: 142px;
    padding: 23px 38px 28px;
    transform: translate(-50%, 18px);
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-align: center;
    background: rgba(15,17,20,.96);
    border: 1px solid rgba(255,255,255,.23);
    border-top: 5px solid #e12b36;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,.7);
    transition: opacity .35s, transform .35s;
}

.result.show { opacity: 1; transform: translate(-50%, 0); }
.result-prefix { color: #e92c38; font-size: 19px; letter-spacing: .24em; }
.result-text { font-family: "Montserrat", Arial, sans-serif; font-size: 38px; line-height: 1.15; text-wrap: balance; }

.fullscreen-button, .cache-button {
    position: absolute;
    z-index: 50;
    top: 18px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 8px;
    background: rgba(0,0,0,.25);
    color: #8f9296;
    font-size: 22px;
    cursor: pointer;
}

.fullscreen-button { left: 18px; }
.cache-button { right: 18px; }
.version-tag {
    position: absolute;
    z-index: 50;
    right: 16px;
    bottom: 12px;
    color: #e4e4e4;
    background: rgba(0,0,0,.72);
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 12px;
    letter-spacing: .06em;
    pointer-events: none;
}

.standby[hidden] { display: none; }
.standby {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow: hidden;
    background: #111316;
    color: #fff;
    touch-action: manipulation;
}
.standby-image {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.standby.has-image .standby-image { display: block; }
.standby.has-image .standby-fallback { display: none; }
.standby-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.standby-fallback img { width: 720px; max-width: 78vw; height: auto; }
.standby-fallback p { margin-top: 44px; font-family: "Montserrat", Arial, sans-serif; font-size: 34px; letter-spacing: .06em; }
.standby-hint {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 18px 12px 22px;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
    text-align: center;
    font-size: 18px;
    letter-spacing: .08em;
}
.standby.has-image .standby-hint { display: block; }

@media (max-width: 480px) {
    .standby-fallback p { font-size: 24px; }
    .standby-hint { font-size: 14px; }
}

.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
