/* GLOBAL */
* { box-sizing: border-box; }
body {
  background: url("https://rtpsupervegas88.xyz/bacground-box.jpg") center/cover no-repeat fixed,
              linear-gradient(135deg, #1a1a1a, #2c2c54);
  font-family: 'Poppins', sans-serif;
  color: #fff; margin: 0; padding: 0; text-align: center;
}
.hidden { display: none !important; }
.container { max-width: 650px; margin: auto; padding: 20px; }

/* TITLE */
.title {
  font-size: 2.8rem; font-weight: 800; margin: 18px 0 8px;
  background: linear-gradient(270deg, gold, orange, red, gold);
  background-size: 600% 600%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: glowText 8s linear infinite;
}
.subtitle { font-size: 1.1rem; margin-bottom: 25px; color: #eee; }
@keyframes glowText {
  0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* FORM */
.form-box { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 25px; }
.form-box input {
  width: 86%; padding: 14px; font-size: 1rem; text-align: center;
  border-radius: 12px; outline: none; color: #fff;
  background: rgba(255,255,255,0.05); border: 2px solid transparent;
  background-image: linear-gradient(#111,#111), linear-gradient(90deg, gold, orange, red);
  background-origin: border-box; background-clip: padding-box, border-box;
  animation: borderRun 6s linear infinite;
}
.form-box input:focus { box-shadow: 0 0 20px rgba(255,215,0,0.9); }
.form-box button {
  width: 88%; padding: 14px; font-size: 1.2rem; font-weight: bold;
  border-radius: 12px; cursor: pointer; color: #000; border: none;
  background: linear-gradient(90deg, gold, orange, red, gold);
  background-size: 200% 200%; animation: buttonGlow 4s linear infinite;
  box-shadow: 0 0 25px rgba(255,215,0,0.6); transition: transform .25s, filter .2s;
}
.form-box button:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.05); }
@keyframes borderRun { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes buttonGlow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

/* BOX BINTANG 5 */
.box-wrapper { margin: 40px auto; }
.mystery-box {
  width: 220px; height: 220px; margin: auto; position: relative; border-radius: 20px;
  background: rgba(255,255,255,0.07);
  border: 4px solid transparent;
  background-image: linear-gradient(#1a1a1a,#1a1a1a),
                    linear-gradient(90deg, gold, orange, red, gold);
  background-origin: border-box; background-clip: padding-box, border-box;
  animation: borderShine 6s linear infinite;
  box-shadow: 0 0 40px rgba(255,215,0,0.6);
  perspective: 900px;
}
@keyframes borderShine { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.base, .lid { background: linear-gradient(135deg, gold, orange); border-radius: 12px; }
.base { width: 200px; height: 150px; position: absolute; bottom: 0; left: 10px; }
.lid {
  width: 200px; height: 65px; position: absolute; top: -20px; left: 10px;
  transform-origin: bottom; transition: transform .7s ease; transform-style: preserve-3d;
}
.mystery-box.open .lid { transform: rotateX(160deg); }
.glow {
  position: absolute; width: 100%; height: 100%; top: -30px; left: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255,255,0,0.85), transparent 70%);
  border-radius: 50%; opacity: 0; transition: opacity .5s;
}
.glow.show { opacity: 1; animation: pulse 1s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity:.6; } 100% { transform: scale(1.2); opacity:.9; } }

/* Loading + Shake */
.loading { margin-top: 8px; pointer-events: none; }
.spinner {
  margin: 10px auto; border: 5px solid rgba(255,255,255,0.2);
  border-top: 5px solid gold; border-radius: 50%; width: 52px; height: 52px;
  animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.mystery-box.loading { animation: shake .8s infinite; }
@keyframes shake {
  0% { transform: translateX(0); } 25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); } 75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* RESULT */
.result-card { background: rgba(0,0,0,0.6); padding: 20px; border-radius: 12px; margin: 16px auto 0; width: 88%; }
.result-card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.debug { font-size: .82rem; color: #ff8080; white-space: pre-wrap; }

/* OVERLAYS */
.overlay { position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; z-index: 999; }
.overlay.hidden { display: none !important; }
.overlay-content { padding: 50px; border-radius: 20px; text-align: center; max-width: 85%; }
.overlay-content h1 { font-size: 3.2rem; margin-bottom: 10px; }
.overlay-content p { font-size: 1.4rem; }
.overlay-content.winner {
  background: linear-gradient(135deg, gold, orange, red);
  color: white; box-shadow: 0 0 50px rgba(255,215,0,0.9);
}
.overlay-content.zonk {
  background: linear-gradient(135deg, #222, #111);
  color: #ff4444; box-shadow: 0 0 40px rgba(255,0,0,0.7);
}
