/* === GLOBAL === */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: url('assets/images/bg.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden; /* hanya hidden horizontal biar vertikal tetap bisa scroll */
}

/* --- Struktur Utama --- */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

/* --- Wheel Section (Sudah diperbaiki agar presisi tengah) --- */
.wheel-container {
  position: relative;
  width: 90vw;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 60px;
}

#wheel {
  width: 86%;
  height: auto;
  border-radius: 50%;
  transform-origin: center center;
  transition: transform 5s cubic-bezier(0.33, 1, 0.68, 1);
  z-index: 2;
  background: transparent;
}

.wheel-frame {
  position: absolute;
  top: 45%;
  left: 49%;
  width: 153%;
  height: auto;
  transform: translate(-50%, -47%);
  pointer-events: none;
  z-index: 3;
  animation: frameGlow 2s ease-in-out infinite alternate;
}

/* === Mobile Adjustment === */
@media (max-width: 600px) {
  .wheel-container {
    width: 85vw;
    max-width: 300px;
    margin-top: 40px;
  }

  #wheel {
    width: 90%;
  }

  .wheel-frame {
    top: 50%;
    left: 50%;
    width: 200%;
    transform: translate(-50%, -48%);
  }

  .form-container {
    width: 85%;
    margin-top: 20px;
  }
}


@keyframes frameGlow {
  from { filter: drop-shadow(0 0 10px rgba(255, 120, 0, 0.6)); }
  to   { filter: drop-shadow(0 0 40px rgba(255, 200, 50, 1)); }
}

/* --- Form Section --- */
.form-container {
  background: linear-gradient(180deg, #410101 8.04%, #790101 64.01%, #310101 104.64%);
  padding: 25px;
  border-radius: 20px;
  width: 90%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 0 10px rgb(255 255 255), 0 0 20px rgb(255 254 244), 0 0 40px rgb(235 255 48 / 2%), 0 0 80px rgb(229 247 50 / 0%);
  color: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

/* efek 3D berkilau pinggir */
.form-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.2), transparent 70%),
              radial-gradient(circle at bottom right, rgba(255, 0, 255, 0.15), transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.logo {
  width: 300px;
  margin-bottom: 10px;
}

h3 {
  color: white;
  font-size: 18px;
  margin-bottom: 15px;
  text-shadow: 0 0 10px #fff;
  text-align: center;
}

input {
  width: 100%;
  padding: 12px;
  margin: 6px 0;
  border-radius: 25px;
  border: none;
  outline: none;
  text-align: center;
  font-size: 15px;
  background: #fff;
  font-weight: 500;
}

/* Tombol Umum */
button {
  border: none;
  border-radius: 25px;
  padding: 12px 20px;
  margin: 10px 0;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

/* Tombol SPIN di form */
#spinTrigger {
  background: linear-gradient(90deg, #ffc400, #c0b30085, #df7802, #b4b400, #e2e602);
  background-size: 500% 500%;
  color: white;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: none;
  border-radius: 30px;
  width: 100%;
  padding: 14px 24px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(185, 0, 185, 0.8), 0 0 50px rgba(255, 255, 0, 0.6);
  animation: flashyMove 3s linear infinite, pulse 1.2s ease-in-out infinite;
}

@keyframes flashyMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Baris tombol Hadiah & Riwayat */
.button-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

#hadiahBtn, #riwayatBtn {
  flex: 1;
  background: white;
  color: black;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#backBtn {
  background: linear-gradient(180deg, #802626 8.04%, #ff0000 64.01%, #802626 104.64%);
  color: white;
  font-weight: 600;
  width: 60%;
  margin-top: 10px;
}

#backBtn:hover {
  background: linear-gradient(180deg, #ffee00 8.04%, #9e9b00 64.01%, #464700 104.64%);
}

/* --- Fireworks Canvas --- */
#fireworks-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- MOBILE FIX --- */
@media (max-width: 600px) {
  .wheel-container {
    width: 300px;
    margin-top: 118px;
  }

  #wheel {
    width: 113%;
  }

  .wheel-frame {
    transform: translate(-50%, -50%);
  }

  .form-container {
    width: 85%;
    margin-top: 150px;
    margin-bottom: 30px;
  }

  h3 {
    font-size: 15px;
  }

  input, button {
    font-size: 13px;
  }
}

/* --- DESKTOP --- */
@media (min-width: 768px) {
  .container {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 120px;
  }

  .wheel-container {
    width: 580px;
    max-width: none;
    margin-right: 40px;
  }

  .form-container {
    width: 400px;
    margin-left: 20px;
  }
}

/* --- Tombol WhatsApp --- */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 20px;
  left: 20px;
  background-color: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

.whatsapp-float img {
  width: 100px;
  height: 100px;
  filter: none;
}

/* === POPUP RIWAYAT PEMENANG === */
.riwayat-popup {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  animation: fadeIn 0.3s ease-in-out;
}

.riwayat-content {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 20px;
  padding: 25px 30px;
  width: 90%;
  max-width: 450px;
  color: #fff;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.3);
  text-align: center;
  animation: popupUp 0.3s ease-out;
}

@keyframes popupUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.riwayat-content h2 {
  color: #ffeb7f;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 18px;
  text-shadow: 0 0 10px rgba(255, 220, 130, 0.8);
}

/* === TABLE STYLE === */
.riwayat-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.riwayat-table thead {
  background: linear-gradient(90deg, #640101, #5e0000);
}

.riwayat-table th, .riwayat-table td {
  padding: 10px 12px;
  text-align: center;
  font-size: 15px;
}

.riwayat-table th {
  color: #ffffff;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.riwayat-table tbody tr {
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease;
}

.riwayat-table tbody tr:hover {
  background: rgba(255, 215, 0, 0.2);
}

.riwayat-table td {
  color: #fff;
  font-weight: 500;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* === TOMBOL TUTUP === */
#tutupRiwayat {
  background: linear-gradient(90deg, #ffcc00, #ff8800);
  border: none;
  border-radius: 25px;
  padding: 8px 20px;
  font-weight: 600;
  cursor: pointer;
  color: #000;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  transition: 0.2s ease-in-out;
}

#tutupRiwayat:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 220, 100, 0.9);
}
/* === ANIMASI PUTAR RODA === */
#wheel-rotator {
  position: relative;
  width: 100%;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: center center;
  transition: transform 5s cubic-bezier(0.33, 1, 0.68, 1);
}
