/* srup.net — vivid neon palette (pink → purple) — fun, modern, high-energy.
   Logo tetap sirup-merah, header background dark untuk kontras maksimal. */
:root {
  --bg: #0a0a0f;
  --surface: #15151d;
  --surface-2: #1f1f2a;
  --border: #2a2a38;
  --text: #ececf1;
  --muted: #8a8a99;
  --accent: #ff3399;        /* hot pink */
  --accent-2: #6633ff;      /* electric purple */
  --accent-3: #f4b800;      /* gold accent (premium tap) */
  --accent-4: #00bfa6;      /* teal (success cue) */
  --grad: linear-gradient(135deg, #ff3399, #6633ff);
  --grad-gold: linear-gradient(135deg, #f4b800, #ff6b35);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; padding-bottom: calc(72px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* header */
.hdr {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; background: rgba(10,10,15,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.logo { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 18px; }
.logo small { color: var(--muted); font-weight: 500; }
.logo .dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--grad);
  box-shadow: 0 0 14px rgba(255,51,153,.7);
}
.hdr-nav {
  display: none;
}

/* hamburger button — visible on desktop only */
.hamburger {
  display: none;
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
  width: 42px; height: 42px; padding: 0; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.hamburger span {
  display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform 200ms;
}

/* drawer */
.drawer {
  position: fixed; inset: 0; z-index: 200;
}
.drawer-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.5);
  opacity: 0; transition: opacity 250ms;
}
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(320px, 80vw); background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 250ms ease;
  padding: 24px 20px; display: flex; flex-direction: column; gap: 16px;
}
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-close {
  align-self: flex-end; background: transparent; border: 0; color: var(--text);
  font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 12px;
}
.drawer nav { display: flex; flex-direction: column; gap: 4px; }
.drawer nav a {
  padding: 14px 16px; border-radius: 12px; color: var(--text); font-size: 16px; font-weight: 600;
}
.drawer nav a:hover { background: var(--surface-2); }
.drawer nav a.active { background: var(--surface-2); color: var(--accent); }

/* main */
.main { max-width: 720px; margin: 0 auto; padding: 16px; }

/* hero */
.hero {
  padding: 36px 4px 24px; text-align: center; position: relative;
}
.hero::before {
  /* tropical sunset glow background */
  content: ''; position: absolute; inset: -40px -40px auto -40px; height: 200px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,107,53,.12), transparent 60%);
  pointer-events: none; z-index: -1;
}
.hero h1 { margin: 0 0 12px; font-size: clamp(28px, 6vw, 40px); line-height: 1.1; letter-spacing: -.02em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--muted); margin: 0 0 20px; font-size: 17px; }
.hero .hint { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* Hero phone form */
.hero-form { max-width: 460px; margin: 0 auto; }
.hero-row {
  display: flex; gap: 8px; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px; padding-left: 16px;
}
.hero-row input[type="tel"] {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 8px;
  background: transparent; border: 0; color: var(--text); font-size: 16px;
}
.hero-row input[type="tel"]:focus { outline: none; }
.hero-row input[type="tel"]::placeholder { color: var(--muted); }
.hero-row .cta { padding: 10px 22px; min-height: 44px; font-size: 14px; }
.hint.ok { color: #00bfa6; }
.hint.warn { color: #f4b800; }
.hint.bad, .hint.err { color: #ff5e7a; }

/* === Hero compact (smaller, more room for builder) === */
.hero.compact { padding: 24px 0 16px; }
.hero.compact h1 { font-size: clamp(24px, 5vw, 32px); }
.hero.compact .lead { font-size: 15px; margin-bottom: 12px; }

/* === One-page builder === */
.builder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  margin: 0 auto;
}
.builder-row {
  display: grid; grid-template-columns: 1fr; gap: 20px;
  margin-bottom: 16px;
}
@media (min-width: 600px) {
  .builder-row { grid-template-columns: auto 1fr; align-items: start; }
}

.photo-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.photo-frame {
  position: relative; cursor: pointer;
  width: 200px; height: 200px;
  border-radius: 50%; overflow: hidden;
  border: 4px solid var(--surface-2);
  transition: border-color 200ms, transform 200ms;
  background: var(--surface-2);
}
.photo-frame:hover { border-color: var(--accent); transform: scale(1.02); }
.photo-frame img {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-edit {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff; padding: 8px; font-size: 12px; font-weight: 600;
  text-align: center;
}

.phone-block { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.phone-row, .otp-row {
  display: flex; gap: 6px; align-items: stretch;
}
.phone-row input, .otp-row input {
  flex: 1; min-width: 0; padding: 12px 14px; min-height: 48px; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text);
}
.phone-row input:focus, .otp-row input:focus { outline: none; border-color: var(--accent); }

.btn-otp {
  flex: 0 0 auto; padding: 0 14px; min-height: 48px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.btn-otp:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-otp:disabled { opacity: .6; cursor: not-allowed; }

.otp-row { margin-top: 8px; }
.otp-row input { letter-spacing: .4em; text-align: center; font-weight: 700; font-size: 20px; }

.picker-h { font-size: 14px; color: var(--muted); margin: 8px 0 10px; font-weight: 600; }

/* Style picker: horizontal scroll on mobile, grid on desktop */
.style-grid {
  display: flex; gap: 8px; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
  padding: 4px 2px;
  margin-bottom: 16px;
}
.style-grid::-webkit-scrollbar { display: none; }
.style-grid > .style-card {
  flex: 0 0 130px; scroll-snap-align: start;
}
@media (min-width: 600px) {
  .style-grid {
    display: grid; overflow: visible; padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    margin-bottom: 20px;
  }
  .style-grid > .style-card { flex: unset; }
}
.style-card {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface-2); border: 2px solid var(--border); border-radius: 12px;
  padding: 6px; cursor: pointer; transition: all 150ms;
}
.style-card:hover { border-color: rgba(255,51,153,.5); }
.style-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgba(255,51,153,.3);
  background: linear-gradient(180deg, rgba(255,51,153,.1), var(--surface-2));
}
.style-card.selected::after {
  content: '✓'; position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  box-shadow: 0 2px 8px rgba(255,51,153,.5);
}
.style-thumb {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #2f2540, #15151d 80%);
  display: flex; align-items: center; justify-content: center;
}
.style-thumb img { width: 100%; height: 100%; object-fit: contain; }
.style-card strong { display: block; font-size: 12px; text-align: center; padding: 0 2px; }

.cta-big {
  width: 100%; padding: 16px 24px; font-size: 17px; min-height: 54px;
  border-radius: 14px;
}

.status-line {
  text-align: center; margin: 12px 0 0; min-height: 18px;
}
.price-tag {
  text-align: center; margin: 8px 0 0;
  color: var(--muted); font-size: 12px;
}
.price-tag strong { color: var(--text); }

/* === Profile page === */
.profile h1 { margin: 16px 0 12px; }
.profile-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; margin-bottom: 12px;
}
.ref-card { background: linear-gradient(135deg, rgba(255,51,153,.06), rgba(102,51,255,.06)); border-color: var(--accent); }
.ref-card h2 { margin: 0 0 6px; font-size: 18px; }
.ref-card .hint { margin-bottom: 14px; line-height: 1.5; }
.profile-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--border);
}
.profile-row:last-of-type { border-bottom: none; }
.profile-row .lbl { color: var(--muted); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.profile-row strong { font-size: 15px; }
.ref-h { margin: 16px 0 8px; font-size: 14px; color: var(--muted); }
.copy-row {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.copy-row input {
  flex: 1; padding: 8px 12px; min-height: 40px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: ui-monospace, monospace;
}

/* === Sample sticker grid (legacy) — keep for /galeri === */
.sample-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.sample-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 8px; cursor: pointer; transition: transform 150ms, border-color 150ms;
  text-align: left; font: inherit; color: inherit;
}
.sample-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.sample-card:active { transform: scale(.98); }
.sample-thumb {
  aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #2f2540, #15151d 80%);
  display: flex; align-items: center; justify-content: center;
}
.sample-thumb img { width: 100%; height: 100%; object-fit: contain; }
.sample-meta { padding: 0 4px; }
.sample-meta strong { display: block; font-size: 14px; }
.sample-meta small { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; }

/* Popup modal */
.popup { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.popup[hidden] { display: none !important; }
.gen-overlay[hidden] { display: none !important; }
.drawer[hidden] { display: none !important; }
.popup-bd { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); opacity: 0; transition: opacity 250ms; }
.popup-card {
  position: relative; max-width: 420px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 24px 20px; text-align: center;
  transform: scale(.92); opacity: 0; transition: transform 250ms cubic-bezier(.2,.8,.2,1.1), opacity 200ms;
}
.popup.open .popup-bd { opacity: 1; }
.popup.open .popup-card { transform: scale(1); opacity: 1; }
.popup-close {
  position: absolute; top: 8px; right: 12px;
  background: transparent; border: 0; color: var(--muted);
  font-size: 28px; cursor: pointer; line-height: 1;
}
.popup-card img {
  width: 80%; max-width: 320px; aspect-ratio: 1; object-fit: contain;
  margin: 0 auto 16px; border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, #2f2540, #15151d 80%);
}
.popup-card h3 { margin: 0 0 6px; font-size: 22px; }
.popup-card p { margin: 4px 0 12px; color: var(--muted); }
.popup-actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin-top: 16px;
}

/* === Topup modal === */
.topup-card { max-width: 380px; }
.topup-icon { font-size: 48px; line-height: 1; margin: 4px 0 8px; }
.topup-card h3 { margin: 4px 0 6px; font-size: 22px; color: var(--accent); }
.topup-tiers {
  display: grid; gap: 8px; grid-template-columns: 1fr 1fr 1fr;
  margin: 16px 0;
}
.tier-btn {
  background: var(--surface-2); border: 2px solid var(--border); border-radius: 12px;
  padding: 10px 4px; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  font: inherit;
}
.tier-btn strong { font-size: 14px; }
.tier-btn small { color: var(--muted); font-size: 11px; }
.select-input {
  width: 100%; padding: 12px 14px; min-height: 44px; font-size: 15px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); margin-bottom: 12px;
  font-family: inherit;
}
.select-input:focus { outline: none; border-color: var(--accent); }

.builder-modal { max-width: 420px; text-align: left; }
.builder-modal h3 { text-align: center; }
.builder-modal .hint { text-align: center; }
.builder-modal .lbl { display: block; margin: 8px 0 4px; font-size: 12px; }

/* Special "custom" sticker card highlight */
.style-card[data-slug="custom"] .style-thumb {
  background: linear-gradient(135deg, #ff3399, #6633ff);
  position: relative;
}
.style-card[data-slug="custom"] .style-thumb img { display: none; }
.style-card[data-slug="custom"] .style-thumb::after {
  content: '🎨'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
}

.tier-btn.selected {
  border-color: var(--accent); background: linear-gradient(180deg, rgba(255,51,153,.15), var(--surface-2));
  box-shadow: 0 0 0 2px var(--accent);
}
.topup-qr-area {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.topup-qr {
  display: flex; justify-content: center;
  margin: 8px 0;
}
.topup-qr img { border-radius: 12px; background: #fff; padding: 8px; }
.qr-placeholder {
  width: 200px; height: 200px;
  background: var(--surface-2); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
}

/* === Photo cropper section (top of builder) === */
.photo-section {
  margin-bottom: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.cropper {
  width: 100%; max-width: 280px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.cropper-frame {
  position: relative; width: 100%; aspect-ratio: 1;
  border-radius: 14px; overflow: hidden;
  background: var(--surface-2);
  border: 2px solid var(--border);
  touch-action: none; user-select: none;
}
.cropper-frame img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover;
  transform-origin: center;
  transition: transform 60ms ease-out;
  pointer-events: none;
}
.cropper-frame.dragging img { transition: none; }
.cropper-mask {
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(255,51,153,.5);
}
.cropper-hint {
  font-size: 11px; color: var(--muted); text-align: center; margin: 0;
}
.photo-actions {
  display: flex; gap: 8px; justify-content: center;
}
.btn-flat {
  padding: 6px 14px; min-height: 36px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px; cursor: pointer; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-flat:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* === Mobile compact (≤520px) === */
@media (max-width: 520px) {
  .main { padding: 8px; }
  body { padding-bottom: calc(64px + var(--safe-bottom)); }
  .builder { padding: 10px; border-radius: 14px; }
  .hero.compact { padding: 8px 0 4px; }
  .hero.compact h1 { font-size: 18px; margin: 0 0 2px; line-height: 1.1; }
  .hero.compact .lead { font-size: 11px; margin: 0 0 6px; }

  .photo-section { margin-bottom: 8px; gap: 4px; }
  .cropper { max-width: 220px; gap: 2px; }
  .cropper-hint { font-size: 10px; }
  .btn-flat { padding: 4px 10px; min-height: 32px; font-size: 12px; }

  /* Phone block — STACK vertically so input + button each take FULL width, no overflow */
  .phone-block { gap: 6px; margin-bottom: 8px; }
  .phone-block .lbl { font-size: 10px; margin: 0; letter-spacing: .03em; }
  .phone-row, .otp-row { display: flex; flex-direction: column; gap: 4px; }
  .phone-row input, .otp-row input {
    width: 100%; padding: 9px 12px; min-height: 40px; font-size: 14px;
    box-sizing: border-box;
  }
  .btn-otp {
    width: 100%; padding: 9px; min-height: 38px; font-size: 13px;
    box-sizing: border-box;
  }
  .otp-row input { font-size: 18px; letter-spacing: .35em; text-align: center; }

  /* Style picker compact */
  .picker-h { font-size: 11px; margin: 0 0 4px; }
  .style-grid > .style-card { flex: 0 0 88px; }
  .style-card { padding: 4px; gap: 2px; }
  .style-card strong { font-size: 10px; line-height: 1.1; }

  /* CTA full-width, always inside viewport */
  .cta-big { padding: 12px 12px; font-size: 14px; min-height: 46px; box-sizing: border-box; }
  .price-tag { margin: 6px 0 0; }
  .price-tag small { font-size: 10px; line-height: 1.2; display: block; }

  /* Modals tight */
  .topup-tiers { grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
  .tier-btn { padding: 6px 2px; }
  .tier-btn strong { font-size: 11px; }
  .tier-btn small { font-size: 9px; }
  .popup-card { padding: 14px 10px; max-width: 95vw; }
  .popup-card img { width: 60%; }

  .sec-faq { margin-top: 12px; }
  .sec-faq h2 { font-size: 16px; }
}

/* Fold 3 cover (≤320px) — extreme compact */
@media (max-width: 320px) {
  .builder { padding: 8px; }
  .cropper { max-width: 180px; }
  .style-grid > .style-card { flex: 0 0 80px; }
  .style-card strong { font-size: 9px; }
  .topup-tiers { grid-template-columns: 1fr; }
  .tier-btn { flex-direction: row; justify-content: space-between; padding: 8px 12px; }
  .hero.compact h1 { font-size: 16px; }
  .hero.compact .lead { font-size: 10px; }
  .cta-big { font-size: 13px; padding: 10px; }
  .price-tag small { font-size: 9px; }
}

.cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; min-height: 48px;
  background: var(--grad); color: #fff !important; border: 0; border-radius: 999px;
  font-weight: 700; font-size: 16px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,51,153,.35);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.cta:active { transform: scale(.97); }
.cta:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; }

/* sections */
.sec { margin: 32px 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.sec-h h2 { margin: 0; font-size: 20px; }
.sec-link { color: var(--accent); font-size: 13px; }

/* template grid */
.tpl-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.tpl-card, .tpl-pick {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px; transition: transform 200ms, border-color 200ms;
}
.tpl-card:active, .tpl-pick:active { transform: scale(.98); }
.tpl-card strong, .tpl-pick strong { font-size: 14px; }
.tpl-card small, .tpl-pick small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.tpl-thumb, .tpl-pick-thumb {
  aspect-ratio: 1; border-radius: 10px;
  background: var(--surface-2);
  position: relative; overflow: hidden;
}
.tpl-thumb img, .tpl-pick-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl-pick { cursor: pointer; }
.tpl-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-pick:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }

/* fallback gradient thumbnails — Indonesian sunset spectrum */
.tpl-fallback { width: 100%; height: 100%; }
.tpl-fallback.tpl-ghibli { background: linear-gradient(135deg, #ffd700, #ff6b35); }
.tpl-fallback.tpl-pixar { background: linear-gradient(135deg, #ff6b35, #e91e63); }
.tpl-fallback.tpl-anime { background: linear-gradient(135deg, #e91e63, #9c27b0); }
.tpl-fallback.tpl-disney { background: linear-gradient(135deg, #00bfa6, #ff6b35); }
.tpl-fallback.tpl-lego { background: linear-gradient(135deg, #f4b800, #e91e63); }
.tpl-fallback.tpl-funko { background: linear-gradient(135deg, #ff6b35, #f4b800); }
.tpl-fallback.tpl-watercolor { background: linear-gradient(135deg, #00bfa6, #00538a); }
.tpl-fallback.tpl-cyberpunk { background: linear-gradient(135deg, #e91e63, #6a1b9a); }
.tpl-fallback.tpl-southpark { background: linear-gradient(135deg, #f4b800, #ff6b35); }
.tpl-fallback.tpl-comic { background: linear-gradient(135deg, #ff5252, #f4b800); }
.tpl-fallback.tpl-pixel { background: linear-gradient(135deg, #00bfa6, #6a1b9a); }
.tpl-fallback.tpl-clay { background: linear-gradient(135deg, #f4b800, #c0392b); }

/* horizontal popular scroll + arrow buttons */
.carousel { position: relative; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 24px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  transition: opacity 200ms;
}
.carousel-arrow:hover { background: var(--surface-2); }
.carousel-arrow:disabled { opacity: .3; cursor: not-allowed; }
.carousel-prev { left: -8px; }
.carousel-next { right: -8px; }

.pop-scroll {
  display: flex; gap: 10px; overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.pop-scroll::-webkit-scrollbar { display: none; }
.pop-card {
  flex: 0 0 auto; width: 120px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 8px; scroll-snap-align: start;
}
.pop-card img { aspect-ratio: 1; border-radius: 10px; }
.pop-card small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.empty-pop { color: var(--muted); padding: 20px; text-align: center; font-size: 13px; }

/* FAQ */
.sec-faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.sec-faq summary { font-weight: 600; cursor: pointer; }
.sec-faq p { margin: 8px 0 0; color: var(--muted); }

/* create */
.create h1 { margin: 16px 0; font-size: 28px; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
}
.step h3 { margin: 0 0 10px; font-size: 16px; color: var(--muted); }
.step.active h3 { color: var(--accent); }
.tpl-pick-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.upload-row {
  display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap;
}
.upload-row > * { flex: 1 1 240px; }
.drop {
  display: flex; align-items: center; justify-content: center;
  min-height: 180px;
  border: 2px dashed var(--border); border-radius: 14px;
  padding: 24px; text-align: center; cursor: pointer;
  transition: border-color 200ms, background 200ms;
}
.drop:hover { border-color: var(--accent); background: var(--surface-2); }
.drop.dragover { border-color: var(--accent); background: var(--surface-2); }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.drop-empty svg { width: 36px; height: 36px; }
.drop-empty strong { color: var(--text); }

.photo-preview {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px;
}
.photo-preview img {
  width: 100%; max-width: 220px; aspect-ratio: 1; object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(255,51,153,.15);
}
.photo-preview .ghost { width: 100%; }

/* compare original ↔ result */
.result-compare {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 16px 0; flex-wrap: wrap;
}
.result-compare figure {
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.result-compare img {
  width: 200px; height: 200px; border-radius: 16px; object-fit: cover;
  background: #fff;
}
.result-compare #result-img {
  box-shadow: 0 12px 40px rgba(255,51,153,.3);
}
.result-compare figcaption {
  color: var(--muted); font-size: 12px;
}
.result-arrow {
  font-size: 32px; color: var(--accent); font-weight: 700;
}

/* generating overlay */
.gen-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10,10,15,.85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gen-card {
  position: relative; width: 320px; max-width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 16px; text-align: center;
}
.gen-card img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px;
  filter: brightness(.7);
}
.gen-shimmer {
  position: absolute; top: 16px; left: 16px; right: 16px; aspect-ratio: 1;
  border-radius: 14px;
  background: linear-gradient(110deg, transparent 30%, rgba(255,51,153,.3) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.gen-progress {
  margin-top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.gen-progress strong { font-size: 16px; }
.gen-progress small { color: var(--muted); }
.gen-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--surface-2); border-top-color: var(--accent);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress bar */
.progress-bar {
  position: relative;
  width: 100%; height: 12px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 0%;
  background: var(--grad);
  border-radius: 999px;
  transition: width 350ms cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 0 12px rgba(255,51,153,.5);
}
.progress-pct {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; font-weight: 700; color: #fff;
  text-shadow: 0 0 4px rgba(0,0,0,.6);
}
.gen-elapsed { color: var(--muted); font-size: 11px; margin-top: 2px; }

input[type="tel"] {
  width: 100%; padding: 14px 16px; min-height: 48px; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text);
}
input[type="tel"]:focus { outline: none; border-color: var(--accent); }
.quota { margin-top: 8px; font-size: 13px; color: var(--muted); }
.quota.ok { color: #00bfa6; }      /* teal — fresh */
.quota.warn { color: #f4b800; }    /* gold — caution */
.quota.bad { color: #e91e63; }     /* magenta — alert */

.status { margin-top: 12px; color: var(--muted); font-size: 14px; min-height: 20px; }

/* result */
.result {
  margin-top: 24px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
}
.result-anim {
  display: flex; justify-content: center;
  margin: 16px 0;
}
.result-anim img {
  width: 280px; height: 280px; border-radius: 20px;
  box-shadow: 0 12px 40px rgba(255,51,153,.25);
  background: #fff;
}
.actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 16px 0;
}

/* prompt box */
.prompt-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin: 12px 0;
}
.prompt-box header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.prompt-box textarea, .prompt-box pre {
  width: 100%; min-height: 80px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: #0a0a0f; color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px; resize: vertical; line-height: 1.5;
}
.prompt-box pre { white-space: pre-wrap; word-break: break-word; margin: 0; }

/* transparency / templates page */
.trans h1 { margin: 16px 0 8px; }
.trans .lead { color: var(--muted); }
.prompt-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.prompt-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px;
}
.prompt-card h3 { margin: 0 0 4px; }
.prompt-card .meta { color: var(--muted); font-size: 12px; margin: 8px 0; }
.prompt-block { position: relative; margin: 8px 0; background: #0a0a0f; border-radius: 10px; padding: 10px; border: 1px solid var(--border); }
.prompt-block strong { display: block; font-size: 12px; color: var(--accent); margin-bottom: 6px; }
.prompt-block .copy { position: absolute; top: 8px; right: 8px; }
.prompt-block pre { margin: 0; font-size: 13px; white-space: pre-wrap; word-break: break-word; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cta-sm { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 13px; }

/* gallery */
.tabs { display: flex; gap: 8px; margin: 16px 0; }
.tab {
  flex: 1; padding: 10px; min-height: 44px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--muted); cursor: pointer; font-weight: 600;
}
.tab.active {
  background: var(--surface-2); color: var(--text);
  border-color: var(--accent-3);
  box-shadow: inset 0 -2px 0 var(--accent-3);
}
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.g-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 8px; transition: transform 200ms;
}
.g-card:active { transform: scale(.97); }
.g-card img { aspect-ratio: 1; border-radius: 10px; }
.g-card small { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* single */
.single { text-align: center; }
.single-anim { display: flex; justify-content: center; margin: 16px 0; }
.single-anim img {
  width: 280px; height: 280px; border-radius: 20px; background: #fff;
  box-shadow: 0 12px 40px rgba(102,51,255,.25);
}

/* bottom nav */
.botnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-around;
  padding: 6px 0 calc(6px + var(--safe-bottom));
  background: rgba(10,10,15,.92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.botnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px; color: var(--muted); font-size: 11px; min-height: 48px;
  transition: color 200ms;
}
.botnav a svg { width: 22px; height: 22px; }
.botnav a.active { color: var(--accent); }
.botnav-cta {
  position: relative;
}
.botnav-cta::before {
  content: ''; position: absolute; inset: 4px 16px;
  background: var(--grad); border-radius: 999px; z-index: -1; opacity: .15;
}

/* === RESPONSIVE: mobile vs desktop nav patterns === */
/* Desktop (≥768px): hamburger menu, NO bottom nav, arrow buttons on carousel */
@media (min-width: 768px) {
  body { padding-bottom: 32px; }
  .botnav { display: none; }
  .hamburger { display: flex; }
  .main { max-width: 960px; padding: 24px; }
  .carousel-arrow { display: flex; }
  .hero { padding: 64px 0 32px; }
  .hero h1 { font-size: 48px; }
  .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .single-anim img, .result-anim img { width: 360px; height: 360px; }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* light mode (rare here, but supported) */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa; --surface: #fff; --surface-2: #f0f0f5;
    --border: #e0e0e8; --text: #1a1a25; --muted: #6a6a78;
  }
}
