/* ==========================================================================
   motion-sync v2.6 — research-informed 2026 redesign
   Source: deep-research 2026-06-13 (game-y is still current but evolution
   is neo-brutal flat shadows + restrained palette + spring physics)
   ========================================================================== */

/* ---------- 0. Brand palette + fluid type scale ---------- */
:root {
  /* Fluid type — required: BM strings are 15-25% longer than English */
  --v2-fs-body:       clamp(1rem, 0.95rem + 0.5vw, 1.125rem);
  --v2-fs-step-title: clamp(1.125rem, 1.05rem + 0.8vw, 1.375rem);
  --v2-fs-page-title: clamp(1.625rem, 1.4rem + 1.6vw, 2.125rem);
  --v2-fs-cta:        clamp(1.125rem, 1rem + 0.8vw, 1.375rem);

  /* Restrained palette — research-recommended: 1 accent + warm dark + neutrals
     instead of pink/blue/orange tri-color */
  --v2-accent:        var(--rojak-orange);   /* warm orange = primary action */
  --v2-accent-deep:   #c2410c;   /* offset shadow */
  --v2-accent-soft:   #ffedd5;
  --v2-step-neutral:  #e7ede4;   /* sticker shadow for non-action steps */
  --v2-step-neutral-deep: #94a3a0;
  --v2-ink:           #062413;   /* warm dark, not pure black */
  --v2-ink-soft:      #475569;
  --v2-bg-1:          #fff4e6;
  --v2-bg-2:          #fdfaf3;
  --v2-bg-3:          #f0fdf4;
  --v2-card:          #ffffff;
  --v2-gold:          #facc15;
  --v2-success:       #16a34a;
}

/* @supports fallback: if color-mix not available (iOS Safari <16.4),
   computed shadows fall back to hand-picked darker shades */
@supports not (color: color-mix(in oklch, red, blue)) {
  :root {
    --v2-shadow-accent: var(--v2-accent-deep);
    --v2-shadow-neutral: var(--v2-step-neutral-deep);
  }
}
@supports (color: color-mix(in oklch, red, blue)) {
  :root {
    --v2-shadow-accent: color-mix(in oklch, var(--v2-accent) 70%, var(--v2-ink));
    --v2-shadow-neutral: color-mix(in oklch, var(--v2-step-neutral) 60%, var(--v2-ink));
  }
}

/* Spring easing — overshoots slightly, mimicking SwiftUI spring physics */
:root {
  --v2-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --v2-ease-snap: cubic-bezier(0.5, 0, 0, 1);
}

/* ---------- 1. Background: cream→peach→mint gradient ---------- */
body.v2 {
  background:
    radial-gradient(circle at 15% 0%, rgba(252, 231, 243, 0.45) 0%, transparent 50%),
    radial-gradient(circle at 85% 100%, rgba(186, 230, 253, 0.35) 0%, transparent 50%),
    linear-gradient(180deg, var(--v2-bg-1) 0%, var(--v2-bg-2) 30%, var(--v2-bg-3) 100%) fixed;
  min-height: 100vh;
  color: var(--v2-ink);
  font-family: var(--font-body);
  font-size: var(--v2-fs-body);
}

body.v2 .page {
  max-width: 540px;
  padding: 12px 16px 100px;
}

/* ---------- 2. Topbar — softer, less utilitarian ---------- */
body.v2 .topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(15, 41, 24, 0.06);
}
body.v2 .topbar-back { color: var(--v2-ink); font-weight: 800; font-size: 14px; }

body.v2 .credits-chip {
  background: var(--v2-card);
  border: 2px solid var(--v2-ink);
  color: var(--v2-ink);
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  /* Neo-brutal flat offset, not soft drop */
  box-shadow: 3px 3px 0 var(--v2-ink);
}
body.v2 .credits-chip-icon { color: var(--v2-accent); font-size: 18px; }

/* ---------- 3. Title + 3-dot progress indicator (replaces rainbow bar) ---------- */
body.v2 .page-title {
  font-size: var(--v2-fs-page-title);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 18px 0 4px;
  color: var(--v2-ink);
}
body.v2 .page-sub, body.v2 .acceptable-use-note { display: none; }

/* Repurpose the existing .v2-progress wrapper as a dot indicator.
   JS keeps writing to #v2-progress-fill width — we read that width and map it
   to active dots via a CSS calc + custom property approach. */
.v2-progress {
  margin: 4px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.v2-progress-track {
  display: flex;
  gap: 8px;
  flex: 0;
  height: auto;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  position: relative;
}
/* Render 3 dots using ::before/::after on the track + a single dot via fill */
.v2-progress-track::before,
.v2-progress-track::after,
.v2-progress-fill {
  display: block;
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(15, 41, 24, 0.15);
  border: 2px solid var(--v2-ink);
  box-shadow: 2px 2px 0 var(--v2-ink);
  transition: background-color 250ms var(--v2-ease-spring), transform 250ms var(--v2-ease-spring);
}
/* The fill becomes the FIRST dot. We use its width % set by JS to color the dots. */
.v2-progress-fill {
  width: 14px !important;  /* override the legacy JS that sets width:% */
  background: var(--v2-accent);
  transform: scale(1.1);
}
/* Use data attribute on the text "1/3" to color the appropriate dots */
.v2-progress[data-done="1"] .v2-progress-track::before { background: var(--v2-accent); transform: scale(1.1); }
.v2-progress[data-done="2"] .v2-progress-track::before,
.v2-progress[data-done="2"] .v2-progress-track::after { background: var(--v2-accent); transform: scale(1.1); }
.v2-progress[data-done="3"] .v2-progress-track::before,
.v2-progress[data-done="3"] .v2-progress-track::after { background: var(--v2-success); transform: scale(1.1); }
.v2-progress[data-done="3"] .v2-progress-fill { background: var(--v2-success); }

.v2-progress-text {
  font-weight: 800;
  font-size: 13px;
  color: var(--v2-ink-soft);
  white-space: nowrap;
}

/* ---------- 4. Mode tabs — neo-brutal sticker, restrained palette ---------- */
body.v2 .mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 6px;
  padding: 0;
  background: transparent;
}
body.v2 .mode-tab {
  position: relative;
  background: var(--v2-card);
  border: 2.5px solid var(--v2-ink);
  border-radius: 18px;
  padding: 18px 12px 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms var(--v2-ease-spring), box-shadow 120ms var(--v2-ease-spring);
  box-shadow: 5px 5px 0 var(--v2-ink);
}
body.v2 .mode-tab:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--v2-ink);
}
body.v2 .mode-tab.is-active {
  background: var(--v2-accent-soft);
  box-shadow: 5px 5px 0 var(--v2-accent-deep);
  transform: translate(-1px, -1px);
}
body.v2 .mode-tab-emoji {
  font-size: 38px;
  margin: 0 0 6px;
  line-height: 1;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.12));
}
body.v2 .mode-tab-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--v2-ink);
  letter-spacing: -0.01em;
}
body.v2 .mode-tab-sub { display: none; }
body.v2 .mode-tab-body { width: 100%; }
body.v2 .mode-tab-pill {
  display: inline-block;
  font-size: 9px;
  padding: 3px 7px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
  border: 2px solid var(--v2-ink);
  box-shadow: 2px 2px 0 var(--v2-ink);
}

/* Mode explainer — kraft-paper style note */
body.v2 .mode-explainer {
  background: rgba(255, 255, 255, 0.8);
  border: 2px dashed var(--v2-ink);
  border-radius: 14px;
  padding: 10px 14px;
  margin: 12px 0 6px;
  font-size: 13.5px;
  text-align: center;
  font-weight: 600;
  color: var(--v2-ink);
}
body.v2 .mode-explainer strong { display: none; }

/* ---------- 5. Step cards — restrained palette: orange = action, others = neutral ---------- */
body.v2 .step-card {
  position: relative;
  background: var(--v2-card);
  border: 2.5px solid var(--v2-ink);
  border-radius: 22px;
  padding: 22px 18px 18px;
  margin: 18px 0;
  /* Single flat offset shadow (neo-brutal) — not stacked drop shadows */
  box-shadow: 6px 6px 0 var(--v2-ink);
}

/* Step 3 (Generate) gets the warm orange identity — it's the action */
body.v2 .step-card.v2-generate {
  background: var(--v2-accent-soft);
  border-color: var(--v2-ink);
  box-shadow: 6px 6px 0 var(--v2-accent-deep);
}

body.v2 .step-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--v2-fs-step-title);
  font-weight: 900;
  color: var(--v2-ink);
  margin-bottom: 14px;
}

/* Step numbers: all same orange (action color) — identity from number, not color */
body.v2 .step-num {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--v2-card);
  border: 2.5px solid var(--v2-ink);
  color: var(--v2-ink);
  font-size: 22px;
  font-weight: 900;
  flex-shrink: 0;
  /* Flat offset shadow */
  box-shadow: 3px 3px 0 var(--v2-ink);
}
body.v2 .step-card.v2-generate .step-num {
  background: var(--v2-accent);
  color: #fff;
  border-color: var(--v2-ink);
  box-shadow: 3px 3px 0 var(--v2-ink);
}

/* ---------- 6. Upload zones — calmer, single accent on focus ---------- */
body.v2 .upload-zone {
  border-radius: 18px;
  border: 2.5px dashed var(--v2-ink);
  min-height: 220px;
  background: #fafdf8;
  transition: transform 200ms var(--v2-ease-spring), background-color 150ms var(--v2-ease-snap);
}
body.v2 .upload-zone:hover,
body.v2 .upload-zone.drag-over {
  background: var(--v2-accent-soft);
  transform: scale(1.005);
}
body.v2 .upload-zone.has-file {
  border-style: solid;
  border-color: var(--v2-success);
  background: #f0fdf4;
  animation: v2Pop 0.4s var(--v2-ease-spring);
}
@keyframes v2Pop {
  0%   { transform: scale(0.95); }
  60%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

body.v2 .upload-zone-prompt { padding: 28px 18px; }
body.v2 .upload-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: var(--v2-card);
  border: 2.5px solid var(--v2-ink);
  color: var(--v2-ink);
  box-shadow: 3px 3px 0 var(--v2-ink);
}
body.v2 .upload-icon svg { width: 40px; height: 40px; }
body.v2 .upload-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--v2-ink);
  margin-top: 4px;
}
body.v2 .upload-hint {
  font-size: 12.5px;
  color: var(--v2-ink-soft);
  margin-top: 6px;
  line-height: 1.45;
  max-width: 340px;
}

/* ---------- 7. Generate button — chunky neo-brutal, NO sparkle emoji ---------- */
body.v2 #generate-btn,
body.v2 .generate-btn {
  width: 100%;
  min-height: 72px;
  font-size: var(--v2-fs-cta);
  font-weight: 900;
  border-radius: 22px;
  background: var(--v2-accent);
  color: #fff;
  border: 2.5px solid var(--v2-ink);
  box-shadow: 6px 6px 0 var(--v2-ink);
  margin-top: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 120ms var(--v2-ease-spring), box-shadow 120ms var(--v2-ease-spring);
}
/* NO ::after sparkle emoji — research-flagged as 2023-24 AI app cliché */
body.v2 #generate-btn:not([disabled]):hover {
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 var(--v2-ink);
}
body.v2 #generate-btn:not([disabled]):active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--v2-ink);
}
body.v2 #generate-btn[disabled] {
  background: #d4d4d8;
  color: #fff;
  cursor: not-allowed;
  box-shadow: 3px 3px 0 #71717a;
}

/* ---------- 8. Accordion: Pilihan lain ---------- */
.v2-advanced {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px dashed rgba(15, 41, 24, 0.15);
}
.v2-advanced summary {
  font-size: 14px;
  font-weight: 800;
  color: var(--v2-ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 2px solid var(--v2-ink);
  box-shadow: 3px 3px 0 var(--v2-ink);
  transition: transform 120ms var(--v2-ease-spring), box-shadow 120ms var(--v2-ease-spring);
}
.v2-advanced summary::after { content: " ▾"; transition: transform 0.2s; margin-left: auto; }
.v2-advanced[open] summary::after { transform: rotate(180deg); }
.v2-advanced summary::-webkit-details-marker { display: none; }
.v2-advanced summary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--v2-ink);
}

/* Nested cards inside accordion become inline */
body.v2 .v2-advanced .step-card {
  background: transparent;
  border: 0;
  padding: 12px 0;
  margin: 8px 0;
  box-shadow: none;
}
body.v2 .v2-advanced .step-num {
  width: 24px; height: 24px; font-size: 12px; box-shadow: none;
  background: var(--v2-step-neutral) !important;
  border-width: 2px;
}
body.v2 .v2-advanced .step-label { font-size: 13px; color: var(--v2-ink-soft); }

/* ---------- 9. Hasil gallery polish ---------- */
body.v2 .hasil-gallery {
  background: var(--v2-card);
  border: 2.5px solid var(--v2-ink);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 4px 4px 0 var(--v2-ink);
  margin: 12px 0 16px;
}
body.v2 .hasil-header { margin-bottom: 8px; }
body.v2 .hasil-title { font-size: 14px; font-weight: 800; color: var(--v2-ink); }
body.v2 .hasil-count {
  background: var(--v2-gold);
  color: var(--v2-ink);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  border: 2px solid var(--v2-ink);
}

/* ---------- 10. Tips, privacy strip, footnote ---------- */
body.v2 [class*="tips"], body.v2 [id*="tips"] {
  font-size: 12.5px;
  color: var(--v2-ink);
  background: #fffbeb;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  border: 2px dashed var(--v2-ink);
  font-weight: 500;
}
body.v2 .privacy-strip {
  background: transparent;
  font-size: 11.5px;
  color: var(--v2-ink-soft);
  padding: 4px 0;
  border: 0;
  margin-top: 6px;
}
.v2-footnote {
  font-size: 12px;
  color: var(--v2-ink-soft);
  text-align: center;
  margin: 26px 0 8px;
  line-height: 1.6;
  font-weight: 500;
}
.v2-footnote a { color: var(--v2-accent); text-decoration: none; font-weight: 700; }

/* ---------- 11. Reactive mascot — idle wobble, cheer at 3/3 ---------- */
.v2-mascot-tip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--v2-card);
  border: 2.5px solid var(--v2-ink);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 24px 0 12px;
  box-shadow: 5px 5px 0 var(--v2-ink);
}
.v2-mascot-emoji {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  animation: v2MascotWobble 2.5s ease-in-out infinite;
  transform-origin: 50% 80%;
}
@keyframes v2MascotWobble {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(4deg); }
}
/* When the progress bar reaches 3/3, mascot cheers */
.v2-progress[data-done="3"] ~ * .v2-mascot-emoji,
body.v2[data-progress="3"] .v2-mascot-emoji {
  animation: v2MascotCheer 0.6s var(--v2-ease-spring) 3;
}
@keyframes v2MascotCheer {
  0%   { transform: translateY(0)   scale(1)   rotate(0); }
  30%  { transform: translateY(-14px) scale(1.15) rotate(-8deg); }
  60%  { transform: translateY(0)   scale(1.05) rotate(8deg); }
  100% { transform: translateY(0)   scale(1)   rotate(0); }
}

.v2-mascot-text {
  font-size: 13.5px;
  color: var(--v2-ink);
  font-weight: 600;
  line-height: 1.45;
}

/* ---------- 12. Accessibility — prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body.v2 *,
  body.v2 .mode-tab,
  body.v2 #generate-btn,
  body.v2 .step-card,
  body.v2 .upload-zone,
  body.v2 .v2-mascot-emoji,
  body.v2 .v2-advanced summary {
    transition: none !important;
    animation: none !important;
  }
  body.v2 .upload-zone:hover { transform: none; }
}

/* ---------- 13. Mobile tweaks ---------- */
@media (max-width: 540px) {
  body.v2 .page { padding: 8px 14px 100px; }
  body.v2 .step-card { padding: 18px 14px 14px; margin: 14px 0; box-shadow: 4px 4px 0 var(--v2-ink); }
  body.v2 .step-card.v2-generate { box-shadow: 4px 4px 0 var(--v2-accent-deep); }
  body.v2 #generate-btn { min-height: 66px; }
  body.v2 .upload-icon { width: 70px; height: 70px; }
  body.v2 .upload-icon svg { width: 34px; height: 34px; }
}

body.v2 { scroll-behavior: smooth; }

/* ==========================================================================
   v2.7 additions — fixes A, D, E for funnel drop-off
   ========================================================================== */

/* FIX E: framing guide for video upload */
body.v2 .framing-guide {
  background: #fffbeb;
  border: 2px dashed #fde68a;
  border-radius: 14px;
  padding: 12px 14px 14px;
  margin: 12px 0 10px;
}
body.v2 .framing-guide-title {
  font-size: 13px;
  font-weight: 800;
  color: #78350f;
  margin-bottom: 10px;
  text-align: center;
}
body.v2 .framing-guide-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
body.v2 .framing-tile {
  text-align: center;
  background: #fff;
  border-radius: 10px;
  padding: 10px 6px 8px;
  border: 2px solid;
}
body.v2 .framing-tile-ok { border-color: var(--v2-success); }
body.v2 .framing-tile-bad { border-color: #f87171; opacity: 0.85; }
body.v2 .framing-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
}
body.v2 .framing-label {
  font-size: 11.5px;
  font-weight: 900;
  margin-bottom: 2px;
}
body.v2 .framing-tile-ok .framing-label { color: #14532d; }
body.v2 .framing-tile-bad .framing-label { color: #7f1d1d; }
body.v2 .framing-desc {
  font-size: 10.5px;
  color: var(--v2-ink-soft);
  line-height: 1.35;
}

/* FIX D: idle-pulse animation on upload zone after mode select */
body.v2 .upload-zone.idle-pulse {
  animation: idlePulse 1.4s ease-in-out infinite;
  border-color: var(--v2-accent);
}
@keyframes idlePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.50);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  body.v2 .upload-zone.idle-pulse { animation: none; }
}

/* FIX B: email-when-ready toggle above Generate button */
body.v2 .email-notify-toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: #fff;
  border: 2px solid var(--v2-ink);
  border-radius: 14px;
  margin: 12px 0 4px;
  box-shadow: 3px 3px 0 var(--v2-ink);
  cursor: pointer;
  user-select: none;
}
body.v2 .email-notify-toggle input[type=checkbox] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin: 1px 0 0;
  accent-color: var(--v2-accent);
  cursor: pointer;
}
body.v2 .email-notify-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.v2 .email-notify-text strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--v2-ink);
}
body.v2 .email-notify-sub {
  font-size: 12px;
  color: var(--v2-ink-soft);
  font-weight: 500;
  line-height: 1.4;
}

/* ==========================================================================
   v2.8 — Post-gen celebration screen
   ========================================================================== */

/* Bigger, more celebratory SIAP badge */
body.v2 .done-badge {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  padding: 14px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%);
  color: #fff;
  border: 2.5px solid var(--v2-ink);
  box-shadow: 5px 5px 0 var(--v2-ink);
  display: inline-block;
  margin: 0 auto 18px;
}

/* Done actions: stack vertically + give them more presence */
body.v2 .done-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 8px;
}
body.v2 .done-actions .btn {
  width: 100%;
  min-height: 56px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 16px;
  border: 2.5px solid var(--v2-ink);
  box-shadow: 4px 4px 0 var(--v2-ink);
  transition: transform 120ms var(--v2-ease-spring), box-shadow 120ms var(--v2-ease-spring);
}
body.v2 .done-actions .btn-share-tiktok {
  background: #000;
  color: #fff;
  /* TikTok-y accent on the shadow */
  box-shadow: 4px 4px 0 #ec4899;
}
body.v2 .done-actions .btn-share-tiktok:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #ec4899;
}
body.v2 .done-actions .btn-primary {
  background: var(--v2-accent);
  color: #fff;
}
body.v2 .done-actions .btn-ghost {
  background: var(--v2-card);
  color: var(--v2-ink);
}
body.v2 .done-actions .btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--v2-ink);
}

/* CSS-only confetti rain — fires once per session */
.celebration-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.celebration-confetti::before,
.celebration-confetti::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 10% -10%, #ec4899 6px, transparent 7px),
    radial-gradient(circle at 25% -10%, #ff6b00 5px, transparent 6px),
    radial-gradient(circle at 40% -10%, #38bdf8 6px, transparent 7px),
    radial-gradient(circle at 55% -10%, #facc15 5px, transparent 6px),
    radial-gradient(circle at 70% -10%, #16a34a 6px, transparent 7px),
    radial-gradient(circle at 85% -10%, #a855f7 5px, transparent 6px);
  background-repeat: no-repeat;
  animation: confettiFall 2.8s linear forwards;
}
.celebration-confetti::after {
  animation-delay: 0.4s;
  background-image:
    radial-gradient(circle at 15% -10%, #facc15 5px, transparent 6px),
    radial-gradient(circle at 35% -10%, #ec4899 6px, transparent 7px),
    radial-gradient(circle at 50% -10%, #16a34a 5px, transparent 6px),
    radial-gradient(circle at 65% -10%, #ff6b00 6px, transparent 7px),
    radial-gradient(circle at 80% -10%, #38bdf8 5px, transparent 6px),
    radial-gradient(circle at 92% -10%, #a855f7 6px, transparent 7px);
}
@keyframes confettiFall {
  0%   { transform: translateY(-10vh) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .celebration-confetti { display: none; }
}

/* ==========================================================================
   v2.8 — Account page referral hero card
   ========================================================================== */
.referral-hero {
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  border: 2.5px solid var(--v2-ink);
  border-radius: 18px;
  padding: 18px;
  margin: 14px 0;
  box-shadow: 5px 5px 0 var(--v2-ink);
  position: relative;
}
.referral-hero-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c2410c;
  margin-bottom: 4px;
}
.referral-hero-link {
  font-size: 18px;
  font-weight: 800;
  color: var(--v2-ink);
  word-break: break-all;
  line-height: 1.3;
  margin: 4px 0 10px;
}
.referral-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 12px;
}
.referral-hero-stat {
  background: rgba(255,255,255,0.7);
  border: 2px solid var(--v2-ink);
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
}
.referral-hero-stat-num {
  font-size: 20px;
  font-weight: 900;
  color: var(--v2-ink);
}
.referral-hero-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #6b7066;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.referral-hero-actions {
  display: flex;
  gap: 8px;
}
.referral-hero-actions button {
  flex: 1;
  background: var(--v2-ink);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 100ms var(--v2-ease-spring);
}
.referral-hero-actions button:active { transform: translateY(2px); }
.referral-hero-tip {
  font-size: 12px;
  color: #7c2d12;
  font-weight: 600;
  margin: 10px 0 0;
  line-height: 1.4;
}

/* ==========================================================================
   Support bot button — opens Telegram bot with auto-auth handoff
   ========================================================================== */
.support-bot-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--v2-card);
  border: 2.5px solid var(--v2-ink);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 14px 0 12px;
  box-shadow: 5px 5px 0 var(--v2-ink);
  cursor: pointer;
  text-align: left;
  transition: transform 120ms var(--v2-ease-spring), box-shadow 120ms var(--v2-ease-spring);
  font-family: inherit;
}
.support-bot-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--v2-ink);
}
.support-bot-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--v2-ink);
}
.support-bot-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.support-bot-emoji {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.10));
}
.support-bot-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.support-bot-text strong {
  font-size: 15px;
  font-weight: 900;
  color: var(--v2-ink);
}
.support-bot-sub {
  font-size: 12px;
  color: var(--v2-ink-soft);
  font-weight: 500;
  line-height: 1.4;
}

/* ==========================================================================
   Prominent "Tak pasti pilih mode mana?" link + Floating help bubble
   ========================================================================== */
body.v2 .mode-beza-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  border: 2.5px solid var(--v2-accent);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 0 0 14px;
  text-decoration: none;
  color: var(--v2-ink);
  box-shadow: 4px 4px 0 var(--v2-accent-deep);
  transition: transform 120ms var(--v2-ease-spring), box-shadow 120ms var(--v2-ease-spring);
}
body.v2 .mode-beza-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--v2-accent-deep);
}
body.v2 .mode-beza-link:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--v2-accent-deep);
}
body.v2 .mode-beza-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.10));
}
body.v2 .mode-beza-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.v2 .mode-beza-text strong {
  font-size: 14px;
  font-weight: 900;
  color: var(--v2-ink);
}
body.v2 .mode-beza-sub {
  font-size: 11.5px;
  color: var(--v2-ink-soft);
  font-weight: 500;
  line-height: 1.35;
}
body.v2 .mode-beza-arrow {
  font-size: 18px;
  font-weight: 900;
  color: var(--v2-accent);
  flex-shrink: 0;
}

/* Floating help bubble — bottom-right, always visible */
.help-bubble {
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--v2-accent);
  color: #fff;
  border: 2.5px solid var(--v2-ink);
  box-shadow: 4px 4px 0 var(--v2-ink), 0 8px 24px rgba(249, 115, 22, 0.35);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 999;
  font-size: 28px;
  line-height: 1;
  transition: transform 120ms var(--v2-ease-spring), box-shadow 120ms var(--v2-ease-spring);
}
.help-bubble:hover {
  transform: translate(-1px, -1px) scale(1.05);
  box-shadow: 5px 5px 0 var(--v2-ink), 0 10px 28px rgba(249, 115, 22, 0.4);
}
.help-bubble:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--v2-ink);
}
.help-bubble-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid var(--v2-accent);
  opacity: 0;
  animation: helpPulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes helpPulse {
  0%   { opacity: 0.7; transform: scale(0.85); }
  100% { opacity: 0;   transform: scale(1.35); }
}
.help-bubble-tooltip {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: var(--v2-card);
  border: 2px solid var(--v2-ink);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--v2-ink);
  white-space: nowrap;
  box-shadow: 3px 3px 0 var(--v2-ink);
  display: none;
}
.help-bubble:hover .help-bubble-tooltip {
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .help-bubble-pulse { animation: none; opacity: 0; }
}
@media (max-width: 480px) {
  .help-bubble { width: 56px; height: 56px; bottom: 14px; right: 14px; font-size: 26px; }
  .help-bubble-tooltip { display: none !important; }
}
