/* File: inline_style.css (v2)
   Fokus: tampilan lebih modern + mobile friendly + animasi halus.
*/

:root{
  --bg0:#050514;
  --bg1:#07091a;
  --txt:#ecf1ff;
  --muted:rgba(236,241,255,.78);
  --card:rgba(255,255,255,.10);
  --border:rgba(255,255,255,.14);

  /* brand-ish: light blue */
  --accent:#6aa7ff;
  --accent2:#a855f7;
  --success:#22c55e;

  --shadow: 0 18px 60px rgba(0,0,0,.48);
  --radius: 26px;
  --max: 980px;
}

/* fallback timer (kalau dipakai di file lain) */
#timer{
  color: var(--accent);
  font-size: clamp(40px, 10vw, 72px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  text-shadow: 0 0 16px rgba(106,167,255,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Inter,Ubuntu,"Helvetica Neue",Arial,sans-serif;
  color: var(--txt);
  background:
    radial-gradient(1200px 700px at 10% 0%, rgba(106,167,255,.34), transparent 55%),
    radial-gradient(900px 600px at 95% 20%, rgba(168,85,247,.30), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 70%, #03030f);
  overflow-x:hidden;
}

/* soft glow */
body::before{
  content:"";
  position:fixed;
  inset:-40px;
  background:
    radial-gradient(600px 220px at 50% -40px, rgba(255,255,255,.10), transparent 70%);
  pointer-events:none;
  z-index:0;
}

.page{
  position:relative;
  z-index:1;
  min-height:100dvh;
  padding:
    max(18px, env(safe-area-inset-top))
    14px
    max(22px, env(safe-area-inset-bottom));
  display:flex;
  justify-content:center;
  align-items:flex-start;
}

.wrap{
  width:min(var(--max), 100%);
  margin:0 auto;
}

.hero{
  text-align:center;
  padding: 14px 10px 8px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid var(--border);
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight:700;
  letter-spacing:.2px;
}

.dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(34,197,94,.16);
}

.hero h1{
  margin: 16px 0 8px;
  font-size: clamp(26px, 5vw, 46px);
  line-height:1.05;
  letter-spacing:.2px;
}

.hero .sub{
  margin:0 auto;
  max-width: 50ch;
  color: var(--muted);
  font-size: clamp(14px, 2.2vw, 17px);
  line-height:1.55;
}

.game{ margin: 18px auto 0; }
.hint{
  text-align:center;
  margin: 0 0 14px;
  color: var(--muted);
  font-weight:700;
}

/* GRID */
.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 auto;
}

@media (min-width: 640px){
  .grid{ gap: 18px; }
}

/* CARD */
.card{
  position:relative;
  border-radius: 22px;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  overflow:hidden;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transform: translateZ(0);
}

.card::before{
  content:"";
  position:absolute;
  inset:-1px;
  background:
    radial-gradient(260px 190px at 25% 22%, rgba(106,167,255,.46), transparent 60%),
    radial-gradient(300px 220px at 80% 40%, rgba(168,85,247,.34), transparent 62%);
  opacity:.95;
}

/* Shine */
.card::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(110deg, transparent 0 42%, rgba(255,255,255,.22) 50%, transparent 58% 100%);
  transform: translateX(-140%) rotate(10deg);
  opacity:0;
}

@media (hover:hover){
  .card:hover{ transform: translateY(-2px) scale(1.01); }
  .card:hover::after{
    opacity:1;
    transform: translateX(140%) rotate(10deg);
    transition: transform 900ms ease, opacity 280ms ease;
  }
}

.card:active{ transform: translateY(1px) scale(.99); }

.cardInner{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 12px;
}

/* Ripple FX */
.rippleFx{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
}

.rippleFx::before{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:12px;
  height:12px;
  border-radius:999px;
  background: rgba(255,255,255,.55);
  transform: translate(-50%,-50%) scale(0);
  opacity:0;
}

.card.ripple .rippleFx::before{
  animation: ripple .62s ease-out;
}

@keyframes ripple{
  0%{ transform: translate(-50%,-50%) scale(0); opacity:.85; }
  60%{ opacity:.28; }
  100%{ transform: translate(-50%,-50%) scale(28); opacity:0; }
}

/* TEXT */
.klik{
  font-size: clamp(18px, 4vw, 32px);
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(236,241,255,.92);
  text-shadow: 0 12px 26px rgba(0,0,0,.45);
}

.pct{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: clamp(28px, 8vw, 56px);
  font-weight: 900;
  color: rgba(236,241,255,.34);
  opacity:0;
  transform: scale(.94);
  transition: opacity .4s ease, transform .55s cubic-bezier(.2,.9,.2,1);
  text-shadow: 0 10px 22px rgba(0,0,0,.38);
}

.reveal .klik{
  opacity:0;
  transform: translateY(10px) scale(.98);
  transition: opacity .25s ease, transform .25s ease;
}

.reveal .pct{
  opacity:1;
  transform: scale(1);
}

.is-50{
  border-color: rgba(34,197,94,.45);
  box-shadow: 0 20px 70px rgba(34,197,94,.14), var(--shadow);
  animation: pop .85s cubic-bezier(.2,.9,.2,1) both;
}

.is-50 .pct{
  color: rgba(34,197,94,1);
  filter: drop-shadow(0 10px 22px rgba(34,197,94,.22));
}

@keyframes pop{
  0%{ transform: scale(.94); }
  40%{ transform: scale(1.06); }
  70%{ transform: scale(.99); }
  100%{ transform: scale(1); }
}

/* RESULT PANEL */
.result{
  margin: 22px 0 0;
  opacity:0;
  pointer-events:none;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s ease;
}

.result.show{
  opacity:1;
  pointer-events:auto;
  transform: translateY(0);
}

.panel{
  position:relative;
  border-radius: var(--radius);
  padding: 18px 14px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow:hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.checkWrap{ display:flex; justify-content:center; margin-top: 6px; }

.check{
  width:92px;
  height:92px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:56px;
  font-weight:900;
  color:#fff;
  background: linear-gradient(135deg, rgba(106,167,255,.90), rgba(168,85,247,.88));
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}

.resultTitle{
  text-align:center;
  margin: 14px 0 6px;
  font-size: clamp(18px, 3.8vw, 24px);
  line-height:1.25;
}

#prizeText{
  color: var(--success);
  text-shadow: 0 10px 18px rgba(34,197,94,.18);
}

.resultDesc{
  text-align:center;
  margin: 0 auto 14px;
  max-width: 56ch;
  color: var(--muted);
  line-height:1.55;
}

/* BUTTONS */
.cta{
  display:block;
  width:min(520px, 100%);
  margin: 8px auto 10px;
  border:0;
  cursor:pointer;
  padding: 14px 16px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: .4px;
  color:#0b1026;
  background: linear-gradient(90deg, rgba(106,167,255,.95), rgba(168,85,247,.92));
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
  transition: transform .12s ease, filter .12s ease;
}

.cta:active{ transform: translateY(1px) scale(.99); }
@media(hover:hover){ .cta:hover{ transform: translateY(-1px); filter: brightness(1.04); } }

.ghost{
  display:block;
  width:min(520px, 100%);
  margin: 0 auto 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--txt);
  padding: 12px 16px;
  font-weight: 800;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease;
}
.ghost:active{ transform: translateY(1px) scale(.99); }
@media(hover:hover){ .ghost:hover{ background: rgba(255,255,255,.10); } }

.legal{
  margin: 8px 6px 4px;
  text-align:center;
  color: rgba(236,241,255,.62);
  font-size: 12px;
  line-height:1.45;
}

/* CONFETTI */
.confetti{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
}

.confetti i{
  position:absolute;
  width:8px;
  height:10px;
  background: hsl(var(--h) 80% 55%);
  left:var(--x);
  top:-12px;
  transform: rotate(calc(var(--r)*1deg));
  border-radius:2px;
  animation: fall calc(900ms + var(--d)*1ms) ease-out forwards;
  opacity:.9;
}

@keyframes fall{
  to{
    transform: translateY(560px) rotate(calc(var(--r)*3deg));
    opacity:0;
  }
}

/* REDUCE MOTION */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
