
/* ============================================================ */
/* v11: HIDE the floating .lw-toast-wrap "MASUKKAN..." button   */
/* (it overlapped layout in earlier turn - form already visible) */
/* ============================================================ */
.lw-toast-wrap {
  display: none !important;
}

/* ============================================================ */
/* v11: WELCOME BANNER BIRU (di atas form)                      */
/* ============================================================ */
.lw-welcome-banner {
  background: linear-gradient(180deg, #00A7ED 0%, #0577b0 100%);
  color: #fff;
  padding: 13px 18px;
  border-radius: 30px;
  margin: 0 0 16px 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,167,237,0.35);
}
.lw-welcome-banner b { color: #fffd00; font-weight: 800; }

@media (max-width: 768px) {
  .lw-welcome-banner { font-size: 12px; padding: 11px 14px; }
}

/* ===================================================
   Lucky Wheel (Spin1) — Styles
   File: /lucky-wheel/style.css
   =================================================== */

.lw-wrap{
  max-width: 1300px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  min-height: 60vh;
}
.lw-row{
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;  /* v11: lebih balanced */
  gap: 50px;
  align-items: center;
}
.lw-col-wheel, .lw-col-form {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lw-col-wheel, .lw-col-form{ min-width: 0; }

.lw-logo-mob{
  display: none;
  width: 200px;
  margin: 0 auto 18px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.55));
  animation: lw-shake-v 3s infinite linear;
}
.lw-logo-web{
  width: 70%;
  max-width: 280px;
  margin: 0 auto 18px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.55));
  animation: lw-shake-v 3s infinite linear;
}

.wheelContainer{
  position: relative;
  width: 100%;
  max-width: 620px;  /* v11: lebih besar (was 580px) */
  margin: 0 auto;
  display: block !important;  /* v11: always show, no fade-in delay */
  overflow: visible;
}
.wheelSVG{
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 32px rgba(212,175,55,0.18));
}
.wheelOutline{ filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.65)); }

.lw-toast-wrap{
  position: relative;
  margin-top: -40px;
}
.toast{
  background: linear-gradient(180deg, #d4af37 0%, #a08220 100%);
  color: #1a1a0a;
  border-radius: 30px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.55);
  padding: 10px 20px;
  text-align: center;
  font-weight: 800;
  visibility: hidden;
  position: relative;
  margin: 12px auto;
  max-width: 90%;
}
.toast.vsb{ visibility: visible; }
.toast p{ margin: 0; font-size: 18px; line-height: 1.3; }

#ticket{
  background: linear-gradient(180deg, #141414 0%, #0d0d0d 100%);
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 30px 26px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(212,175,55,0.18);
}
.ticket-container{ text-align: center; }

.ticket-container input{
  width: 100%;
  padding: 13px 18px;
  margin-bottom: 12px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  background: #0a0a0a;
  color: #f4f4f4;
  text-align: center;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, background .15s;
}
.ticket-container input:focus{
  border-color: #d4af37;
  background: #111;
}

.lw-form-row{
  display: flex;
  gap: 10px;
  margin: 12px 0;
}
.lw-form-col{ flex: 1; }

.lw-submit{
  width: 100%;
  font-size: 16px;
  background: linear-gradient(180deg, #f5d77e, #d4af37 60%, #a08220);
  color: #1a1a0a;
  padding: 11px 18px;
  border: 0;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(212,175,55,0.25);
  transition: filter .15s, transform .12s;
  margin-bottom: 6px;
}
.lw-submit:hover{ filter: brightness(1.08); }
.lw-submit:active{ transform: scale(.98); }
.lw-submit:disabled{ opacity: 0.6; cursor: wait; }

.lw-spin-btn{
  width: 100%;
  padding: 16px 22px;
  margin: 10px 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #ff5757 0%, #c81212 100%);
  color: #fff;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(200,18,18,0.45), 0 0 0 2px #d4af37;
  animation: lw-pulse 1.6s ease-in-out infinite;
}
.lw-spin-btn:hover{ filter: brightness(1.1); }
.lw-spin-btn.d-none{ display: none; }

.lw-err{
  display: block;
  color: #ffb84d;
  font-size: 12.5px;
  text-align: center;
  margin: 4px 0;
  min-height: 18px;
}

/* CONFETTI overlay */
.lw-confetti-wrap{
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 5;
}
.lw-confetti{
  position: absolute;
  top: 0;
  width: 50%;
  opacity: 1;
  transition: opacity .25s;
}
#confetti1{ left: 0; }
#confetti2{ right: 0; }
.lw-confetti.hidden{ opacity: 0; }

/* HISTORY POPUP */
.lw-popup-container{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lw-popup-body{
  width: 100%;
  max-width: 400px;
  height: 70vh;
  max-height: 600px;
  background: #131313;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  color: #f4f4f4;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.65);
}
.lw-popup-close{
  cursor: pointer;
  width: 32px;
  height: 32px;
  background: #d4af37;
  color: #1a1a0a;
  border-radius: 50%;
  position: absolute;
  top: -10px;
  right: -10px;
  font-weight: 900;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.lw-popup-header{
  background: linear-gradient(180deg, #d4af37, #a08220);
  color: #1a1a0a;
  padding: 14px 18px;
  text-align: center;
}
.lw-popup-header h6{
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.lw-popup-scroll{
  height: calc(100% - 48px);
  overflow-y: auto;
  padding: 4px 0;
}
.lw-popup-scroll table{
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.lw-popup-scroll th{
  background: #1a1a1a;
  padding: 8px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #d4af37;
  text-align: left;
}
.lw-popup-scroll td{
  padding: 8px;
  border-bottom: 1px solid #1f1f1f;
  color: #ddd;
}
.lw-level-tag{
  text-transform: capitalize;
  background: #d4af37;
  color: #1a1a0a;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

/* Prize popup table */
.lw-prize-modal{ text-align: left; }
.lw-prize-intro{
  font-size: 12.5px;
  color: #bbb;
  text-align: center;
  margin-bottom: 12px;
}
.lw-prize-table{
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
}
.lw-prize-table th{
  background: linear-gradient(180deg, #d4af37, #a08220);
  color: #1a1a0a;
  padding: 8px;
  font-size: 12px;
  text-align: center;
  font-weight: 800;
}
.lw-prize-table td{
  padding: 6px 8px;
  text-align: center;
  font-size: 11.5px;
  border: 1px solid #1f1f1f;
  color: #ddd;
}

/* SHAKE animation */
@keyframes lw-shake-v {
  0% { transform: translate(0, 0); }
  31% { transform: translate(0, 5%); }
  45% { transform: translate(0, -3%); }
  59% { transform: translate(0, 2%); }
  73% { transform: translate(0, -1.2%); }
  87% { transform: translate(0, 0.7%); }
  100% { transform: translate(0, -0.5%); }
}
@keyframes lw-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(200,18,18,0.45), 0 0 0 2px #d4af37; }
  50%     { transform: scale(1.04); box-shadow: 0 12px 32px rgba(200,18,18,0.7),  0 0 0 3px #f5d77e; }
}

/* RESPONSIVE */
@media (max-width: 880px){
  .lw-row{
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .lw-logo-mob{ display: block; }
  .lw-logo-web{ display: none; }
  .lw-wrap{ padding: 18px 14px 40px; }
  #ticket{ padding: 24px 18px; }
  .lw-spin-btn{ font-size: 18px; padding: 14px 18px; letter-spacing: 2px; }
  .wheelContainer{ max-width: 90vw; }
}
@media (max-width: 480px){
  .ticket-container input{ font-size: 15px; padding: 11px 14px; }
  .lw-submit{ font-size: 14px; padding: 10px 14px; }
}

/* ============================================================ */
/* CRITICAL MOBILE OVERLAP FIX — PORTED FROM ORIGINAL SPIN1 INLINE STYLE */
/* Source: themes/front/mzdspin/layout/header.php inline <style>          */
/* ============================================================ */
@media only screen and (max-width: 768px) {
  /* Body tidak fixed height — biar bisa scroll vertical */
  html, body {
    width: 100% !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  /* v11: Wheel mobile lebih besar (was 326px → 380px) + center */
  .wheelContainer{
    margin-top: 30px;
    width: 100%;
    max-width: 380px;
    left: auto !important;
    transform: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    position: relative;
  }

  /* SVG wheel — fit mobile */
  .wheelSVG {
    position: relative !important;
    width: 100% !important;
    height: auto;
    left: 0 !important;
    transform: none !important;
  }

  /* KRITIS — Push form ke bawah supaya tidak overlap dengan wheel */
  /* Wheel di atas berukuran ~360px, butuh ~420px margin-top */
  #redeem_container {
    margin-top: 60px !important;   /* Tidak perlu 420px karena layout grid sudah stacked */
    margin-bottom: 100px;
    width: 100%;
  }

  /* Ticket container scaling untuk mobile */
  .ticket-container {
    margin-top: 20px;
    transform: scale(0.95);
    text-align: center;
    max-width: 100%;
  }

  /* Toast (intro message "MASUKKAN USERNAME...") — TARUH DI ATAS form, BUKAN absolute */
  .toast {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: 0 !important;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    margin: 12px 0;
    text-align: center;
  }

  .lw-toast-wrap{
    position: relative !important;
    width: 100%;
    margin: 0 !important;
  }

  /* Logo mob vs web */
  .lw-logo-mob { display: block !important; margin-top: 16px !important; }
  .lw-logo-web { display: none !important; }

  /* Grid: stack vertical */
  .lw-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  /* Form fields lebih compact */
  .ticket-container input{
    font-size: 14px;
    padding: 12px 16px;
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Desktop: pastikan toast TIDAK rendering sebagai overlay yang block form */
@media only screen and (min-width: 769px) {
  .toast {
    position: relative !important;
    transform: none !important;
    background: linear-gradient(180deg, rgba(0,167,237,0.95), rgba(0,87,180,0.95));
    border-radius: 14px;
    padding: 8px 12px;
    margin: 0 0 12px 0;
  }
  .toast p {
    color: #fffd00;
    font-size: 16px;
    line-height: 22px;
    margin: 0;
    font-weight: 800;
  }
  .lw-toast-wrap{
    position: relative;
    margin-bottom: 14px;
  }
}

/* v19: Specs final */
.wheelContainer .wheelSVG,
.wheelContainer svg.wheelSVG {
  width: 150% !important;
  height: 150% !important;
  margin-left: 250px !important;
  margin-top: -20px !important;
  display: block !important;
  overflow: visible;
}
.wheelContainer {
  display: block !important;
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  overflow: visible;
}
.pegContainer, g.pegContainer, .peg, path.peg {
  opacity: 0 !important;
  fill: transparent !important;
  visibility: hidden !important;
}
#redeem_container #ticket {
  background: linear-gradient(180deg, rgba(20,20,20,0.55) 0%, rgba(10,10,10,0.55) 100%) !important;
  border: 1px solid rgba(212,175,55,0.30) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
html, body { height: 100%; }
body.lw-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  margin: 0;
  touch-action: pan-x pan-y;
  -ms-content-zooming: none;
}
body.lw-page .lw-wrap { flex: 1 0 auto; }
body.lw-page .sp-footer, body.lw-page footer { flex-shrink: 0; margin-top: auto; }

/* v19: Fix history popup close button position */
.lw-popup-container { overflow: visible !important; }
.lw-popup-content { overflow: visible !important; }
.lw-popup-close {
  top: 10px !important;
  right: 10px !important;
  z-index: 100 !important;
}

@media only screen and (max-width: 768px) {
  .wheelContainer .wheelSVG,
  .wheelContainer svg.wheelSVG {
    width: 125% !important;
    height: 125% !important;
    margin-left: -40px !important;
    margin-top: -10px !important;
  }
  #redeem_container {
    margin-top: -40px !important;
    margin-bottom: 0 !important;
    width: 100% !important;
  }
}
