*{box-sizing:border-box}

:root{
  --primary:#ffc400;
  --secondary:#9d0000;
  --accent:#ff2d2d;
  --background:#070707;
  --gold:#ffd45a;
  --gold-light:#fff2a6;
  --gold-dark:#9a5800;
  --red:#b40000;
  --red-dark:#650000;
}

html,
body{
  margin:0;
  min-height:100%;
  background-color:#050505;
}

body{
  min-height:100vh;
  color:#fff;
  font-family:Arial,Helvetica,sans-serif;

  background-color:#050505;
  background-image:url('./bg-custom.webp');
  background-position:center top;
  background-size:cover;
  background-repeat:no-repeat;
  background-attachment:fixed;

  overflow-x:hidden;
  position:relative;
}

body::before,
body::after{
  display:none !important;
  content:none !important;
}

@keyframes goldAura{
  from{transform:translate3d(-2%,-1%,0)}
  to{transform:translate3d(2%,1%,0)}
}

@keyframes sparkMove{
  from{background-position:0 0,40px 30px}
  to{background-position:170px 140px,-130px 185px}
}

button,input{
  font:inherit;
}

button{
  cursor:pointer;
}

.site-header{
  width:100%;
  min-height:105px;
  margin:0;
  padding:14px 95px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  z-index:5;
  background:
    linear-gradient(90deg,rgba(0,0,0,.94),rgba(34,18,0,.84),rgba(0,0,0,.94));
  border-bottom:2px solid rgba(255,196,0,.78);
  box-shadow:
    0 8px 30px rgba(0,0,0,.55),
    0 0 26px rgba(255,196,0,.16);
}

.logo-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
}

.site-logo{
  display:block;
  width:auto;
  max-width:min(440px,66vw);
  max-height:82px;
  object-fit:contain;
  filter:
    drop-shadow(0 2px 0 #5d3000)
    drop-shadow(0 0 13px rgba(255,196,0,.70));
}

.logo-badge{
  width:52px;
  height:52px;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#4d2100;
  font-size:27px;
  background:linear-gradient(145deg,#fff5b5,#ffb800);
  border:4px solid #ffe889;
  box-shadow:0 0 28px rgba(255,196,0,.70);
}

.logo-text{
  color:#ffd45a;
  font-weight:1000;
  letter-spacing:2px;
  font-size:clamp(22px,3vw,34px);
  text-shadow:
    0 3px 0 #6d2600,
    0 0 18px rgba(255,196,0,.74);
}

.music-button{
  position:absolute;
  right:24px;
  top:50%;
  transform:translateY(-50%);
  border:1px solid rgba(255,212,90,.58);
  color:#fff3b0;
  border-radius:999px;
  padding:10px 15px;
  background:rgba(40,20,0,.72);
  font-weight:900;
  letter-spacing:.8px;
  backdrop-filter:blur(12px);
  box-shadow:
    0 0 18px rgba(255,196,0,.20),
    inset 0 1px rgba(255,255,255,.12);
}

.music-button.playing{
  color:#2d1000;
  background:linear-gradient(135deg,#fff0a3,#ffb000);
  box-shadow:0 0 28px rgba(255,196,0,.65);
}

.announcement{
  position:relative;
  z-index:4;
  text-align:center;
  padding:11px 20px;
  color:#2b1200;
  font-weight:1000;
  background:linear-gradient(90deg,#c37800,#fff0a0,#ffbd18,#fff0a0,#c37800);
  border-block:2px solid #fff0a0;
  box-shadow:0 8px 24px rgba(0,0,0,.38);
}

.page-shell{
  width:min(1160px,calc(100% - 28px));
  margin:28px auto 34px;
  position:relative;
  z-index:3;
}

.game-section{
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(310px,.75fr);
  align-items:center;
  gap:35px;
}

.wheel-stage{
  width:min(650px,100%);
  aspect-ratio:1;
  position:relative;
  margin:auto;
  filter:
    drop-shadow(0 28px 36px rgba(0,0,0,.65))
    drop-shadow(0 0 26px rgba(255,196,0,.36));
}

.wheel-stage::before{
  content:"";
  position:absolute;
  inset:5%;
  border-radius:50%;
  z-index:0;
  background:
    radial-gradient(circle,rgba(255,196,0,.32),rgba(155,0,0,.14) 45%,transparent 72%);
  filter:blur(13px);
  animation:wheelAura 3s ease-in-out infinite alternate;
}

@keyframes wheelAura{
  from{transform:scale(.96);opacity:.64}
  to{transform:scale(1.05);opacity:1}
}

#wheel{
  display:block;
  width:100%;
  height:100%;
  position:relative;
  z-index:2;
}

.light-ring{
  position:absolute;
  inset:2.4%;
  border-radius:50%;
  z-index:1;
  background:
    repeating-conic-gradient(
      from 0deg,
      #fff5b5 0 2deg,
      #ffc400 2deg 4deg,
      #17100a 4deg 7deg
    );
  box-shadow:
    0 0 24px rgba(255,212,90,.74),
    0 0 68px rgba(255,150,0,.46);
}

.pointer{
  position:absolute;
  z-index:5;
  left:50%;
  top:-2%;
  transform:translateX(-50%);
  width:0;
  height:0;
  border-left:28px solid transparent;
  border-right:28px solid transparent;
  border-top:78px solid #fff0a0;
  filter:
    drop-shadow(0 5px 0 #9c5500)
    drop-shadow(0 0 15px #ffd45a)
    drop-shadow(0 0 25px rgba(255,80,0,.45));
}

.wheel-hub{
  position:absolute;
  z-index:4;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:18%;
  aspect-ratio:1;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle,#fffbd7 0 15%,#ffd45a 18% 48%,#8d4700 52% 65%,#ffe88c 68%);
  border:5px solid #fff0a0;
  box-shadow:
    0 0 30px rgba(0,0,0,.72),
    0 0 32px rgba(255,196,0,.78),
    inset 0 0 14px rgba(255,255,255,.78);
}

.wheel-hub span{
  font-size:clamp(28px,5vw,58px);
  color:#fff8ca;
  text-shadow:0 3px 0 #7c3b00;
}

.form-card,
.history-card{
  background:
    linear-gradient(155deg,rgba(24,17,10,.94),rgba(4,4,4,.92));
  border:1px solid rgba(255,212,90,.46);
  box-shadow:
    0 24px 65px rgba(0,0,0,.58),
    0 0 32px rgba(255,196,0,.13),
    inset 0 1px rgba(255,255,255,.12);
  backdrop-filter:blur(18px);
}

.form-card{
  border-radius:25px;
  padding:27px;
  position:relative;
  overflow:hidden;
}

.form-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(135deg,rgba(255,196,0,.08),transparent 34%),
    radial-gradient(circle at 100% 0,rgba(180,0,0,.18),transparent 35%);
}

.form-card > *{
  position:relative;
  z-index:1;
}

.form-card label{
  display:block;
  margin:13px 0 8px;
  font-weight:900;
  font-size:14px;
  color:#ffe8a0;
}

.input-shell{
  height:55px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 14px;
  background:rgba(0,0,0,.70);
  border:1px solid rgba(255,212,90,.32);
  border-radius:11px;
  transition:.2s;
}

.input-shell:focus-within{
  border-color:#ffc400;
  box-shadow:
    0 0 0 3px rgba(255,196,0,.14),
    0 0 20px rgba(255,196,0,.17);
}

.input-shell input{
  width:100%;
  height:100%;
  border:0;
  outline:0;
  background:transparent;
  color:#fff;
  font-weight:800;
}

.input-shell input::placeholder{
  color:#a89472;
}

.spin-button,
.terms-button,
.modal-primary{
  width:100%;
  border:0;
  border-radius:11px;
  font-weight:1000;
  letter-spacing:.5px;
}

.spin-button{
  margin-top:21px;
  padding:17px;
  color:#321200;
  background:linear-gradient(#fff2a5,#ffc400 48%,#e87900);
  border:2px solid #fff0a0;
  box-shadow:
    0 7px 0 #843400,
    0 12px 24px rgba(0,0,0,.42),
    0 0 24px rgba(255,196,0,.32);
  transition:.16s;
}

.spin-button:hover{
  transform:translateY(-2px);
  filter:brightness(1.08);
}

.spin-button:active{
  transform:translateY(5px);
  box-shadow:0 2px 0 #843400;
}

.spin-button:disabled{
  cursor:not-allowed;
  filter:grayscale(.55);
  transform:none;
}

.terms-button{
  margin-top:13px;
  padding:14px;
  color:#fff;
  background:linear-gradient(135deg,#6f0000,#d00000);
  border:1px solid rgba(255,212,90,.45);
  box-shadow:0 0 20px rgba(180,0,0,.28);
}

.form-note{
  text-align:center;
  color:#bfae91;
  font-size:13px;
  line-height:1.55;
  margin:18px 0 0;
}

.history-card{
  margin-top:40px;
  border-radius:24px;
  padding:22px;
}

.history-title{
  display:flex;
  align-items:center;
  gap:13px;
  margin-bottom:16px;
}

.history-title h2{
  margin:0;
  font-size:24px;
  color:#fff2a8;
}

.history-title p{
  margin:4px 0 0;
  color:#bfae91;
}

.medal{
  width:54px;
  height:54px;
  border-radius:15px;
  display:grid;
  place-items:center;
  font-size:30px;
  background:linear-gradient(145deg,#fff2a5,#e98a00);
  box-shadow:
    0 8px 18px rgba(0,0,0,.35),
    0 0 22px rgba(255,196,0,.34);
}

.table-wrap{
  overflow:auto;
  border-radius:14px;
}

table{
  width:100%;
  border-collapse:collapse;
  min-width:570px;
  background:rgba(0,0,0,.62);
}

th,
td{
  text-align:left;
  padding:15px 17px;
  border-bottom:1px solid rgba(255,255,255,.09);
}

th{
  color:#321400;
  background:linear-gradient(90deg,#d78c00,#fff0a2,#d78c00);
  text-transform:uppercase;
  font-size:12px;
  letter-spacing:.7px;
}

td{
  color:#eee5d5;
}

td strong{
  color:#ffe681;
}

tbody tr:hover{
  background:rgba(255,196,0,.07);
}

.empty-row td{
  text-align:center;
  color:#a89472;
}

footer{
  position:relative;
  z-index:3;
  text-align:center;
  padding:12px 20px 35px;
  color:#9f8b69;
  font-size:13px;
}

.modal{
  position:fixed;
  z-index:50;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(0,0,0,.88);
  backdrop-filter:blur(9px);
  opacity:0;
  visibility:hidden;
  transition:.22s;
}

.modal.open{
  opacity:1;
  visibility:visible;
}

.modal-card{
  width:min(500px,100%);
  position:relative;
  text-align:center;
  border-radius:23px;
  padding:32px;
  background:linear-gradient(155deg,#2f1700,#070707);
  border:2px solid #ffc400;
  box-shadow:
    0 0 0 5px rgba(255,255,255,.05),
    0 25px 80px rgba(0,0,0,.72),
    0 0 42px rgba(255,196,0,.25);
  transform:scale(.92);
  transition:.22s;
}

.modal.open .modal-card{
  transform:scale(1);
}

.modal-card h2{
  font-size:clamp(25px,5vw,38px);
  margin:4px 0 14px;
  color:#fff2a6;
  text-shadow:
    0 3px 0 #753000,
    0 0 18px rgba(255,196,0,.45);
}

.modal-card p,
.terms-content{
  line-height:1.65;
  color:#eee2ce;
}

.modal-icon,
.result-confetti{
  font-size:65px;
}

.modal-close{
  position:absolute;
  right:14px;
  top:12px;
  width:38px;
  height:38px;
  border-radius:50%;
  border:1px solid rgba(255,212,90,.42);
  background:rgba(0,0,0,.55);
  color:#fff;
  font-size:25px;
}

.modal-primary{
  padding:14px 18px;
  margin-top:16px;
  color:#331400;
  background:linear-gradient(#fff1a0,#ffc400);
  box-shadow:0 5px 0 #843400;
}

.terms-content{
  text-align:left;
  white-space:normal;
  max-height:52vh;
  overflow:auto;
  padding:15px;
  background:rgba(0,0,0,.35);
  border-radius:12px;
}

.result-prize{
  font-weight:1000;
  font-size:clamp(36px,8vw,68px);
  color:#fff0a0;
  text-shadow:
    0 4px 0 #8b3500,
    0 0 25px #ffc400;
  margin:8px 0;
}

.claim-code{
  font-family:monospace;
  padding:10px;
  border-radius:10px;
  background:rgba(0,0,0,.42);
}

.toast{
  position:fixed;
  z-index:100;
  left:50%;
  bottom:24px;
  transform:translate(-50%,30px);
  max-width:min(440px,calc(100% - 30px));
  padding:13px 18px;
  border-radius:12px;
  background:#a90000;
  color:#fff;
  border:1px solid rgba(255,212,90,.48);
  box-shadow:0 12px 30px rgba(0,0,0,.55);
  opacity:0;
  visibility:hidden;
  transition:.22s;
  font-weight:800;
  text-align:center;
}

.toast.show{
  opacity:1;
  visibility:visible;
  transform:translate(-50%,0);
}

.toast.info{
  background:#8a5200;
}

@media(max-width:850px){
  .game-section{
    grid-template-columns:1fr;
  }

  .form-card{
    width:min(600px,100%);
    margin:auto;
  }

  .wheel-stage{
    width:min(620px,100%);
  }
}

@media(max-width:520px){
  .site-header{
    min-height:82px;
    padding:12px 65px 12px 12px;
  }

  .logo-wrap{
    width:100%;
    justify-content:center;
  }

  .site-logo{
    max-width:72vw;
    max-height:62px;
  }

  .logo-badge{
    width:43px;
    height:43px;
  }

  .logo-text{
    font-size:21px;
  }

  .music-button{
    right:9px;
    padding:9px 11px;
  }

  .music-button span{
    display:none;
  }

  .page-shell{
    width:min(100% - 16px,1160px);
    margin-top:18px;
  }

  .game-section{
    gap:17px;
  }

  .wheel-stage{
    width:104%;
    margin-left:-2%;
  }

  .pointer{
    border-left-width:18px;
    border-right-width:18px;
    border-top-width:52px;
  }

  .form-card{
    padding:18px;
    border-radius:18px;
  }

  .history-card{
    padding:12px;
    margin-top:25px;
    border-radius:18px;
  }

  .history-title h2{
    font-size:20px;
  }

  .modal-card{
    padding:25px 19px;
  }
}

/* ===== PNG hadiah pada popup hasil ===== */
.result-card{
  position:relative;
  overflow:hidden;
}

.result-prize-image{
  display:none;
  width:min(180px,48vw);
  height:min(180px,48vw);
  object-fit:contain;
  margin:8px auto 16px;
  padding:8px;
  border-radius:22px;
  background:radial-gradient(circle at 50% 35%,rgba(255,255,255,.18),rgba(255,255,255,.04));
  border:1px solid rgba(255,212,90,.35);
  box-shadow:
    0 12px 30px rgba(0,0,0,.34),
    0 0 30px rgba(255,196,0,.12);
}

@media(max-width:520px){
  .result-prize-image{
    width:min(145px,46vw);
    height:min(145px,46vw);
    margin-bottom:12px;
  }
}
