*{
		box-sizing: border-box;
		margin:0;
		padding:0;
		outline: none;
}
body{
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100vh;
		overflow: hidden;
		background:url(./assets/bg.webp) no-repeat center center fixed;
		background-size: cover;
		background-position: center;
}

.container {
    position: relative;
    width: 395px;                 
    min-height: 50px;             
    margin: 0 auto 20px auto;     
    display: flex;
    align-items: center;          
    justify-content: center;      
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 5px 10px;
    overflow: hidden;  /* penting supaya border rapi */
    z-index: 1;
}

.logo-container {
		position: absolute;
		top: 20px; /* Posisi di atas wheel */
		left: 50%;
		transform: translateX(-50%);
		text-align: center;
		z-index: 1000;
}

.electric-border {
  position: relative;
  display: inline-block;
  margin: 10px auto;
  padding: 0;
  border-radius: 25px;
  overflow: visible;
  
  /* Custom properties untuk animasi */
  --border-radius: 25px;
  --border-width: 4px;
  --inset: 4px;
}

/* Rotating gradient border - PERBAIKAN DI SINI */
.electric-border::before {
  content: '';
  position: absolute;
  inset: calc(var(--inset) * -1);
  border-radius: var(--border-radius);
  padding: var(--border-width);
  background: 
    conic-gradient(
      from var(--angle, 0deg), /* Ubah angle lewat animasi */
      #00f5ff 0deg,
      #00d4ff 60deg,
      #0099ff 120deg,
      #00d4ff 180deg,
      #00f5ff 240deg,
      #00d4ff 300deg,
      #00f5ff 360deg
    );
  animation: borderRotate 4s linear infinite;
  z-index: -1;
  
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Glow effect */
.electric-border::after {
  content: '';
  position: absolute;
  inset: calc(var(--inset) * -1);
  border-radius: var(--border-radius);
  background: 
    conic-gradient(
      from var(--angle, 0deg),
      rgba(0, 245, 255, 0.6) 0deg,
      rgba(0, 212, 255, 0.4) 60deg,
      rgba(0, 153, 255, 0.2) 120deg,
      rgba(0, 212, 255, 0.4) 180deg,
      rgba(0, 245, 255, 0.6) 240deg,
      rgba(0, 212, 255, 0.4) 300deg,
      rgba(0, 245, 255, 0.6) 360deg
    );
  animation: borderRotate 4s linear infinite;
  filter: blur(15px);
  opacity: 0.8;
  z-index: -2;
}

.logo {
  position: relative;
  border-radius: calc(var(--border-radius) - 4px);
  padding: 9px;
  z-index: 1;
  box-shadow: 
    inset 0 2px 10px rgba(0, 0, 0, 0.8),
    0 4px 20px rgba(0, 0, 0, 0.5);
}

.logo img {
  width: 220px;
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
}

/* Animation - PERBAIKAN DI SINI: Ubah CSS variable bukan transform */
@keyframes borderRotate {
  0% {
    --angle: 0deg;
  }
  100% {
    --angle: 360deg;
  }
}

/* Pause on hover */
.electric-border:hover::before,
.electric-border:hover::after {
  animation-play-state: paused;
}

.mainbox {
    position: relative;
    width: 365px;
    height: 365px;
    margin-top:100px;
    left: -0.5%;  /* Letakkan di tengah */
    bottom: -14px;
			 
}

.mainbox:after {
		position: absolute;
		content:"";
		width:105%;
		height: 105%;
		background: url(./assets/arrow.png) no-repeat center center;
		background-size: 110%; /* Perbesar ukuran arrow */
		background-position: center -19px; /* Atur posisi gambar secara vertikal */
		left: 51%;	/* Letakkan di tengah */
		top: 49%;		/* Letakkan di tengah */
		transform: translate(-50%, -50%) rotate(90deg); /* Sesuaikan transformasi */
			
}

.spin {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		width: 160px;
		height: 160px;
		border-radius: 50%;
		background: url(./assets/button.png) no-repeat center center;
		background-size: 130%; /* Perbesar ukuran arrow */
		background-position: center -19px; /* Atur posisi gambar secara vertikal */
		cursor: pointer;
		box-shadow: 0 5px 20px #000;
		z-index: 1000;
}

.spin:active {
		width: 70px;
		height: 70px;
		box-shadow: 0 3px 15px #000;
		transform: translate(-50%, -50%) scale(0.95); /* Kecilkan saat ditekan */
}

.mainbox.animate:after{
		animation:animateArrow 0.7s ease infinite;
}
audio{
		display:none;
}
@keyframes animateArrow{
		50%{
				right: -50px;
		}
}

footer {
		position: absolute;
		bottom: 18px;
		left: 50%;
		transform: translateX(-50%);
		text-align: center;
		font-size: 14px;
		color: white;
		font-family: Arial, sans-serif;
}

.box-wrapper {
  transform: translateY(-6px)
}
.box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 373px;
    height: 379px; /* samakan dengan width agar perfect square */
    margin: 0 auto;
    transform-origin: center center; /* titik putar di tengah */
}

.box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center center; /* titik putar gambar di tengah */
}




/* =======================
   RESPONSIVE: SEMUA HP
   ======================= */
@media (max-width: 768px) {

  /* Layout kolom dari atas ke bawah */
  body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background-attachment: scroll !important;
  }

  /* LOGO – sedikit turun dari atas */
  .logo-container {
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    margin: 32px auto 0 auto !important;
    text-align: center !important;
  }

  .logo {
    width: auto !important;
    margin: 0 auto !important;
    display: inline-block !important;
  }

  .logo img {
    width: clamp(170px, 52vw, 240px) !important;
    height: auto !important;
  }

  /* TEKS THAILAND */
  .container {
    position: static !important;
    width: 90vw !important;
    max-width: 480px !important;
    height: auto !important;
    font-size: clamp(13px, 3.6vw, 17px) !important;
    margin: 10px auto 0 auto !important;
    text-align: center !important;
  }

  /* WHEEL – lebih ke tengah layar */
  .mainbox {
    position: relative !important;
    width: min(94vw, 380px) !important;
    height: min(94vw, 380px) !important;
    margin: 36px auto 0 auto !important;
    left: 0 !important;
    bottom: 0 !important;
  }

  .box {
    width: 102% !important;
    height: 100% !important;
  }

  /* TOMBOL SPIN */
  .spin {
    width: 40vw !important;
    height: 40vw !important;
    min-width: 130px !important;
    min-height: 130px !important;
    max-width: 180px !important;
    max-height: 180px !important;
    background-size: contain !important;
    background-position: center center !important;
  }

  /* FOOTER tetap di bawah */
  footer {
    position: static !important;
    width: 100% !important;
    text-align: center !important;
    font-size: clamp(10px, 2.9vw, 12px) !important;
    margin-top: auto !important;   /* dorong ke paling bawah */
    margin-bottom: 12px !important;
    padding: 0 !important;
    left: auto !important;
    transform: none !important;
  }
}

/* =======================
   RESPONSIVE: HP KECIL
   (iPhone 13/14/15, SE, dll)
   ======================= */
@media (max-width: 430px) {

  /* LOGO – lebih kecil & lebih dekat ke atas */
  .logo-container {
    margin: 20px auto 0 auto !important;
  }

  .logo img {
    width: clamp(140px, 45vw, 200px) !important;
  }

  /* TEKS THAILAND – font lebih kecil */
  .container {
    width: 92vw !important;
    font-size: clamp(12px, 3.3vw, 15px) !important;
    margin: 8px auto 0 auto !important;
    line-height: 1.4 !important;
  }

  /* WHEEL – ukuran lebih kecil */
  .mainbox {
    width: min(88vw, 320px) !important;
    height: min(88vw, 320px) !important;
    margin: 24px auto 0 auto !important;
  }

  /* TOMBOL SPIN – lebih kecil */
  .spin {
    width: 38vw !important;
    height: 38vw !important;
    min-width: 110px !important;
    min-height: 110px !important;
    max-width: 150px !important;
    max-height: 150px !important;
  }

  /* FOOTER – font lebih kecil */
  footer {
    font-size: clamp(9px, 2.6vw, 11px) !important;
    margin-bottom: 10px !important;
  }
}

/* =======================
   RESPONSIVE: HP SANGAT KECIL
   (iPhone SE, layar < 375px)
   ======================= */
@media (max-width: 375px) {

  /* LOGO – paling kecil */
  .logo-container {
    margin: 16px auto 0 auto !important;
  }

  .logo img {
    width: clamp(120px, 42vw, 180px) !important;
  }

  /* TEKS THAILAND – lebih compact */
  .container {
    width: 94vw !important;
    font-size: clamp(11px, 3.1vw, 14px) !important;
    margin: 6px auto 0 auto !important;
    line-height: 1.35 !important;
  }

  /* WHEEL – ukuran minimal */
  .mainbox {
    width: min(85vw, 280px) !important;
    height: min(85vw, 280px) !important;
    margin: 18px auto 0 auto !important;
  }

  /* TOMBOL SPIN – ukuran minimal */
  .spin {
    width: 35vw !important;
    height: 35vw !important;
    min-width: 95px !important;
    min-height: 95px !important;
    max-width: 130px !important;
    max-height: 130px !important;
  }

  /* FOOTER – paling kecil */
  footer {
    font-size: clamp(8px, 2.4vw, 10px) !important;
    margin-bottom: 8px !important;
  }
}