/* Lucky Spin - Fixed ratio layout (375×812 design base, 1x) */

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

@font-face {
    font-family: 'RedHatDisplay';
    src: url('../font/RedHatDisplay-Regular.otf') format('opentype');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'RedHatDisplay';
    src: url('../font/RedHatDisplay-Medium.otf') format('opentype');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'RedHatDisplay';
    src: url('../font/RedHatDisplay-Bold.otf') format('opentype');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'OPPOSans';
    src: url('../font/OPPOSans4-Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
}

html, body {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Page container: fixed 375×812 */
.page {
    position: relative;
    width: 375px;
    height: 812px;
    background: url('../lucky/wheel/bg.png') no-repeat center / cover;
    overflow: hidden;
    transform-origin: center center;
}

/* Logo - ObjC: section_6 left:118/2=59, top:56/2=28, w:40/2=20, h:32/2=16 — but design shows larger */
.logo {
    position: absolute;
    top: 28px;
    left: 20px;
    height: 16px;
    width: auto;
}

/* Title - ObjC: (44.5, 97.5, 286, 43), font RedHatDisplay-Bold 37px 
   Gradient: ObjC CSS shows 360deg from rgba(21,100,215) to rgba(252,253,252) 
   360deg = bottom to top, so bottom is blue, top is white */
.title {
    position: absolute;
    left: 44.5px;
    top: 97.5px;
    width: 286px;
    height: 43px;
    font-size: 37px;
    font-weight: 700;
    font-family: 'RedHatDisplay', sans-serif;
    text-align: center;
    text-transform: uppercase;
    line-height: 43px;
    background: linear-gradient(0deg, rgba(21,100,215,1) 0%, rgba(200,220,252,1) 40%, rgba(252,253,252,1) 70%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* Wheel stage */
.wheel-stage {
    position: absolute;
    left: 25px;
    top: 172px;
    width: 326px;
    height: 378px;
}

.wheel-wrapper {
    position: relative;
    width: 326px;
    height: 326px;
    z-index: 2;
}

.wheel-spin {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform-origin: 49.6% 48.1%;
}
.wheel-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 326px;
    height: 326px;
    object-fit: contain;
}

/* Pointer */
.pointer {
    position: absolute;
    top: 48.1%;
    left: 49.6%;
    transform: translate(-50%, -58%);
    width: 82px;
    height: auto;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.1s;
}
.pointer:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Prize elements - polar coordinate positioning
   Center=(50%,50%), angles clockwise from top */
.prize-img {
    position: absolute;
    object-fit: contain;
    pointer-events: none;
}
.prize-lbl {
    position: absolute;
    font-size: 10px;
    color: #000;
    font-family: 'OPPOSans', sans-serif;
    font-weight: 500;
    text-align: center;
    pointer-events: none;
    line-height: 12px;
    white-space: nowrap;
}

/* Sector 0: Conspicuous Bag - 0 deg */
.lbl-0 {
    left: 50.0%;
    top: 13.0%;
    transform: translate(-50%, -50%) rotate(0deg);
}
.img-0 {
    left: 50.2%;
    top: 22.1%;
    width: 36px;
    height: 48px;
    transform: translate(-50%, -50%) rotate(0deg);
}

/* Sector 1: Panda Keychain - 72 deg */
.lbl-1 {
    left: 83.0%;
    top: 37.2%;
    transform: translate(-50%, -50%) rotate(72deg);
}
.img-1 {
    left: 74.1%;
    top: 40.0%;
    width: 42px;
    height: 42px;
    transform: translate(-50%, -50%) rotate(72deg);
}

/* Sector 2: Pony Mystery Box - 144 deg */
.lbl-2 {
    left: 70.2%;
    top: 76.6%;
    transform: translate(-50%, -50%) rotate(144deg);
}
.img-2 {
    left: 64.4%;
    top: 69.5%;
    width: 38px;
    height: 37px;
    transform: translate(-50%, -50%) rotate(144deg);
}

/* Sector 3: U-shaped neck pillow - 216 deg */
.lbl-3 {
    left: 29.4%;
    top: 76.9%;
    transform: translate(-50%, -50%) rotate(216deg);
}
.img-3 {
    left: 35.8%;
    top: 69.6%;
    width: 60px;
    height: 54px;
    transform: translate(-50%, -50%) rotate(216deg);
}

/* Sector 4: Waterproof toiletry bag - 288 deg */
.lbl-4 {
    left: 17.3%;
    top: 37.2%;
    transform: translate(-50%, -50%) rotate(288deg);
}
.img-4 {
    left: 26.6%;
    top: 40.4%;
    width: 43px;
    height: 50px;
    transform: translate(-50%, -50%) rotate(288deg);
}

/* Stand - overlaps with wheel bottom */
.stand {
    position: absolute;
    top: 265px;
    left: 50%;
    transform: translateX(-50%);
    width: 257px;
    height: 101px;
    pointer-events: none;
    z-index: 1;
}

/* Action buttons - ObjC absolute positions on page */
.action-buttons {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.action-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    font-family: 'RedHatDisplay', sans-serif;
    color: #050A18;
    background: linear-gradient(180deg, #cde2ff 0%, #eaf5ff 100%);
    box-shadow: 0 4px 0 rgba(116,141,185,0.6), 0 6px 12px rgba(0,0,0,0.15);
    transition: all 0.2s;
    pointer-events: auto;
}
.btn-rules {
    left: 85px;
    top: 588.5px;
    width: 205px;
    height: 44px;
}
.btn-records {
    left: 87px;
    top: 658.5px;
    width: 201px;
    height: 44px;
}
.action-btn img {
    width: 18px;
    height: 18px;
}
.action-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(116,141,185,0.6);
}

/* Result modal */
.result-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.result-content {
    background: #fff;
    border-radius: 10px;
    width: 320px;
    height: 522px;
    position: relative;
    text-align: center;
    overflow: visible;
}
.confetti-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px;
    height: 198px;
    object-fit: contain;
    pointer-events: none;
}
.result-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 37px;
    color: rgba(0,40,170,1);
    font-size: 26px;
    font-weight: 600;
    line-height: 30.5px;
    white-space: nowrap;
    font-family: 'RedHatDisplay', sans-serif;
}
.result-prize-img {
    position: absolute;
    top: 93px;
    left: 50%;
    transform: translateX(-50%);
    width: 74.5px;
    height: 77.5px;
    object-fit: contain;
}
.result-prize {
    position: absolute;
    top: 198px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    color: #050A18;
    font-weight: 400;
    line-height: 22px;
    white-space: nowrap;
    font-family: 'RedHatDisplay', sans-serif;
}
.prize-highlight { color: rgba(0,40,170,1); }
.result-code { display: none; }
.result-qr-wrap {
    position: absolute;
    top: 231px;
    left: 50%;
    transform: translateX(-50%);
}
.result-qr { width: 144px; height: 145px; display: none; }
.qr-check-overlay {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 58px;
    height: 58px;
}
.result-instruction {
    position: absolute;
    top: 383px;
    left: 50%;
    transform: translateX(-50%);
    width: 285px;
    font-size: 14px;
    color: #050A18;
    line-height: 22px;
    text-align: center;
    font-family: 'RedHatDisplay', sans-serif;
}
.result-btn {
    position: absolute;
    top: 443px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(133,174,233,1) 0%, rgba(15,59,133,1) 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    width: 270px;
    height: 50px;
    font-size: 18px;
    cursor: pointer;
    font-family: 'RedHatDisplay', sans-serif;
}

/* Rules modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 20px 25px 36px;
    width: 320px;
}
.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    text-align: center;
    font-family: 'RedHatDisplay', sans-serif;
    line-height: 22px;
}
.modal-rules { margin-top: 22px; }
.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 22px;
}
.rule-item:first-child { margin-top: 0; }
.rule-dot {
    width: 7px; height: 7px; min-width: 7px;
    background: #050A18;
    border-radius: 50%;
    margin-top: 8px;
}
.rule-text {
    font-size: 16px;
    color: #050A18;
    line-height: 22px;
    font-family: 'RedHatDisplay', sans-serif;
    font-weight: 400;
}
.modal-close {
    background: linear-gradient(180deg, rgba(133,174,233,1) 0%, rgba(15,59,133,1) 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    width: 270px;
    height: 50px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    margin: 22px auto 0;
    display: block;
    font-family: 'RedHatDisplay', sans-serif;
}

/* Scale .page to fit viewport */
@media (max-aspect-ratio: 375/812) {
    .page { transform: scale(calc(100vw / 375)); transform-origin: top center; }
    body { align-items: flex-start; }
}
@media (min-aspect-ratio: 375/812) {
    .page { transform: scale(calc(100vh / 812)); transform-origin: center center; }
}
