/* kartu-gosok.css — adaptasi dikadoin.id dari Franslee/lucky-card (MIT) */

:root {
  --bg: #fffafc;
  --frame: #ffafcc;
  --frame-dark: #f78fb3;
  --pink: #ffd6e4;
  --pink-lt: #ffedf4;
  --konten: #ffe9f1;
  --teks: #b5657f;
  --aksen1: #ff8fab;
  --aksen2: #f76b9c;
  --aksen3: #ffb3c9;
  --aksen4: #ffc8dd;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--teks);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

/* ---------- Watermark diagonal (di bawah konten, tidak menutupi area gosok) ---------- */
#watermark {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 46px 60px;
  padding: 40px;
}

#watermark span {
  display: inline-block;
  transform: rotate(-28deg);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 2px;
  color: rgba(247, 107, 156, 0.10);
  white-space: nowrap;
  user-select: none;
}

#watermark.off { display: none; }

/* ---------- Layout halaman ---------- */
.page {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 18px 40px;
  text-align: center;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.badge {
  display: inline-block;
  background: var(--aksen1);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(247, 107, 156, 0.35);
}

.badge.small {
  font-size: 12px;
  font-weight: 600;
  background: var(--pink);
  color: var(--teks);
  box-shadow: none;
}

.tier-btn {
  border: 2px solid var(--frame);
  background: #fff;
  color: var(--teks);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.tier-btn:active { transform: scale(0.96); }

.gift-title {
  margin: 8px 0 4px;
  font-size: 30px;
  color: var(--teks);
}

.subtitle {
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--teks);
  opacity: 0.9;
}

/* ---------- Bingkai kartu gosok ---------- */
.card-frame {
  background: #fff;
  border: 4px solid var(--frame);
  border-radius: 22px;
  padding: 22px 16px 14px;
  box-shadow: 0 8px 24px rgba(247, 143, 179, 0.25);
}

#scratch {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 210px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid var(--frame-dark);
  background: var(--pink); /* terlihat sesaat sebelum gambar cover terpasang */
  touch-action: none; /* cegah scroll saat menggosok di HP */
  -webkit-user-select: none;
  user-select: none;
}

#cover { position: absolute; top: 0; left: 0; }

#card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  background: var(--konten);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.prize-emoji { font-size: 44px; line-height: 1; }

.prize-text {
  font-size: 21px;
  font-weight: 800;
  color: var(--aksen2);
}

.prize-msg {
  font-size: 14px;
  line-height: 1.5;
  color: var(--teks);
}

.hint {
  margin: 12px 0 4px;
  font-size: 13px;
  color: var(--teks);
  opacity: 0.85;
}

/* ---------- Selebrasi ---------- */
.celebration {
  margin-top: 22px;
  background: var(--pink-lt);
  border: 3px dashed var(--frame-dark);
  border-radius: 20px;
  padding: 22px 18px;
  animation: pop 0.45s ease;
}

.celebration.hidden { display: none; }

@keyframes pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.celebrate-emoji { font-size: 52px; }

.celebration h2 {
  margin: 6px 0;
  color: var(--aksen2);
  font-size: 24px;
}

.celebration p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

.footbar { margin-top: 26px; }

/* ---------- Confetti overlay ---------- */
#confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}
