* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --grad: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --accent: #764ba2;
    --gold: #f1c40f;
}
body {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    background: #1b1035;
    background-image: radial-gradient(circle at 20% 20%, #3a1c71 0%, transparent 55%),
                      radial-gradient(circle at 80% 80%, #2575fc 0%, transparent 55%),
                      linear-gradient(135deg, #1b1035, #241447);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #fff;
    overflow-x: hidden;
}

/* floating orbs */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-orbs span {
    position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5;
    animation: float 12s ease-in-out infinite;
}
.bg-orbs span:nth-child(1){ width:260px;height:260px;background:#e74c3c;top:-60px;left:-40px; }
.bg-orbs span:nth-child(2){ width:220px;height:220px;background:#f1c40f;bottom:-50px;right:-30px;animation-delay:3s; }
.bg-orbs span:nth-child(3){ width:180px;height:180px;background:#2ecc71;top:40%;right:10%;animation-delay:6s; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-30px)} }

.wheel-app {
    position: relative; z-index: 1;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 28px;
    padding: 34px 28px 40px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
    max-width: 540px;
    width: 100%;
}

/* brand / logo */
.brand { margin-bottom: 22px; }
.brand-logo {
    width: 88px; height: 88px; object-fit: contain;
    border-radius: 20px; margin: 0 auto 12px; display: block;
    background: rgba(255,255,255,.12);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.brand-logo.placeholder {
    display: flex; align-items: center; justify-content: center; font-size: 46px;
}
.brand h1 {
    font-size: 28px; font-weight: 800; letter-spacing: .5px;
    background: linear-gradient(90deg,#fff,#ffe9a8);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { color: rgba(255,255,255,.75); margin-top: 6px; font-size: 14px; }

/* step 1: user input */
.user-step { margin-bottom: 10px; }
.field { display: flex; gap: 10px; }
.field input {
    flex: 1; padding: 14px 18px; font-size: 16px; font-family: inherit;
    border: 2px solid rgba(255,255,255,.25); border-radius: 14px;
    background: rgba(255,255,255,.1); color: #fff; outline: none;
    transition: border .2s;
}
.field input::placeholder { color: rgba(255,255,255,.5); }
.field input:focus { border-color: var(--gold); }
.field input:disabled { opacity: .7; }

.btn-primary {
    padding: 14px 24px; font-size: 15px; font-weight: 700; font-family: inherit;
    border: none; border-radius: 14px; cursor: pointer; color: #1b1035;
    background: linear-gradient(135deg,#ffe259,#ffa751);
    box-shadow: 0 6px 18px rgba(255,167,81,.4);
    transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(255,167,81,.55); }
.btn-primary:disabled { opacity: .6; cursor: default; transform: none; }

.check-msg { margin-top: 14px; font-size: 15px; min-height: 20px; padding: 0 6px; line-height: 1.5; }
.check-msg.error { color: #ff9a9a; }
.check-msg.success { color: #8ff0b4; }

/* pemenang terbaru */
.winners {
    margin: 18px 0 4px; text-align: left;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px; padding: 14px 16px;
}
.winners-title { font-weight: 700; font-size: 14px; color: #ffe9a8; margin-bottom: 10px; text-align: center; }
.winners-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.winners-list li {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: rgba(255,255,255,.07); border-radius: 10px; padding: 9px 12px;
    font-size: 14px; animation: slideIn .4s ease both;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.w-user { font-weight: 700; letter-spacing: 1px; color: #fff; }
.w-prize {
    font-weight: 600; color: #8ff0b4; font-size: 13px;
    background: rgba(46,204,113,.15); padding: 3px 10px; border-radius: 20px;
    white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis;
}

/* step 2: wheel */
.wheel-stage {
    max-height: 0; opacity: 0; overflow: hidden;
    transition: max-height .5s ease, opacity .5s ease, margin .4s;
}
.wheel-stage.show { max-height: 760px; opacity: 1; margin-top: 20px; }
.welcome { font-size: 16px; margin-bottom: 14px; color: #ffe9a8; }

.wheel-container { position: relative; display: inline-block; }
.pointer {
    position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; z-index: 6;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 30px solid var(--gold);
    filter: drop-shadow(0 3px 4px rgba(0,0,0,.4));
}
canvas {
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgba(255,255,255,.12), 0 14px 40px rgba(0,0,0,.5);
    background: #241447;
}
.spin-btn {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 96px; height: 96px; border-radius: 50%;
    border: 5px solid #fff;
    background: radial-gradient(circle at 30% 30%, #ff6a6a, #c0392b);
    color: #fff; font-size: 18px; font-weight: 800; font-family: inherit;
    cursor: pointer; z-index: 5;
    box-shadow: 0 6px 18px rgba(0,0,0,.4);
    transition: transform .15s;
}
.spin-btn:hover:not(:disabled) { transform: translate(-50%,-50%) scale(1.08); }
.spin-btn:disabled { background: #7a7a8a; cursor: not-allowed; }
.spin-btn.spinning { animation: pulse .6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{transform:translate(-50%,-50%) scale(1)} 50%{transform:translate(-50%,-50%) scale(1.06)} }

/* result line */
.result { margin-top: 20px; font-size: 16px; min-height: 22px; padding: 10px; border-radius: 12px; line-height: 1.5; }
.result.win { background: rgba(46,204,113,.18); color: #b6f5cd; }
.result.error { background: rgba(231,76,60,.18); color: #ffb3b3; }
.result.lose { background: rgba(149,165,166,.22); color: #dfe6e9; }

.page-footer { position: relative; z-index: 1; margin-top: 22px; font-size: 13px; color: rgba(255,255,255,.55); }

/* win modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 50; display: none;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
    padding: 20px;
}
.modal-overlay.show { display: flex; animation: fade .3s; }
@keyframes fade { from{opacity:0} to{opacity:1} }
.modal-card {
    position: relative; overflow: hidden;
    background: linear-gradient(160deg,#2a1a52,#3a1c71);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 24px; padding: 36px 30px; text-align: center;
    max-width: 380px; width: 100%;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
    animation: pop .4s cubic-bezier(.17,.89,.32,1.28);
}
@keyframes pop { from{transform:scale(.7);opacity:0} to{transform:scale(1);opacity:1} }
.trophy { font-size: 60px; margin-bottom: 8px; }
.modal-card h2 {
    font-size: 26px; margin-bottom: 6px;
    background: linear-gradient(90deg,#ffe259,#ffa751);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.win-user { color: rgba(255,255,255,.7); font-size: 14px; margin-bottom: 14px; }
.win-prize {
    font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 22px;
    padding: 14px; border-radius: 14px;
    background: rgba(255,255,255,.1); border: 1px dashed var(--gold);
}
/* tampilan kalah: nada abu, tanpa aksen emas */
.modal-card.lose-card { background: linear-gradient(160deg,#30323a,#3a3d47); }
.modal-card.lose-card h2 {
    background: linear-gradient(90deg,#dfe6e9,#b2bec3);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.win-prize.lose-prize {
    font-size: 18px; font-weight: 600; color: #dfe6e9;
    border: 1px dashed rgba(255,255,255,.3); background: rgba(255,255,255,.06);
    line-height: 1.5;
}
.modal-card .btn-primary { width: 100%; }
.claim-btn { text-decoration: none; margin-bottom: 10px; }
.btn-ghost {
    width: 100%; padding: 12px; font-size: 14px; font-weight: 600; font-family: inherit;
    border: 1px solid rgba(255,255,255,.3); border-radius: 14px; cursor: pointer;
    background: transparent; color: rgba(255,255,255,.85); text-decoration: none; display: block;
    transition: background .15s;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* claim page */
.claim-box { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
    border-radius: 18px; padding: 24px; margin-top: 10px; }
.claim-line { color: rgba(255,255,255,.65); font-size: 13px; margin-top: 12px; }
.claim-val { font-size: 22px; font-weight: 800; color: #ffe9a8; }

/* confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
    position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
    animation: drop 1.8s linear forwards;
}
@keyframes drop { to { top: 110%; opacity: 0; } }

@media (max-width: 480px) {
    .field { flex-direction: column; }
    canvas { width: 320px; height: 320px; }
    .brand h1 { font-size: 24px; }
}
