/* =========================================================
   PASTEL BOOTH — style.css
   Palet: kuning, pink, ungu, biru, hijau (semua soft)
   ========================================================= */
:root {
  --yellow: #fff1a8;
  --pink: #ffd3e5;
  --purple: #e1d4ff;
  --blue: #cfe8ff;
  --green: #d2f4da;

  --yellow-d: #f5d96b;
  --pink-d: #ff9ec4;
  --purple-d: #b79cff;
  --blue-d: #86c3ff;
  --green-d: #7fd99a;

  --ink: #5a4a6e;
  --ink-soft: #8c7da0;
  --card: rgba(255, 255, 255, 0.74);
  --shadow: 0 12px 40px rgba(150, 120, 190, 0.22);
  --radius: 28px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: "Fredoka", system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(120deg, var(--yellow), var(--pink), var(--purple), var(--blue), var(--green), var(--yellow));
  background-size: 400% 400%;
  animation: bgshift 24s ease infinite;
  padding-bottom: 40px;
}
@keyframes bgshift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- blobs ---------- */
.bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: 0.55; animation: floaty 14s ease-in-out infinite; }
.b1 { width: 320px; height: 320px; background: var(--yellow-d); top: -80px; left: -60px; }
.b2 { width: 260px; height: 260px; background: var(--pink-d); top: 30%; right: -80px; animation-delay: -3s; }
.b3 { width: 300px; height: 300px; background: var(--purple-d); bottom: -100px; left: 20%; animation-delay: -6s; }
.b4 { width: 220px; height: 220px; background: var(--blue-d); top: 55%; left: -70px; animation-delay: -9s; }
.b5 { width: 240px; height: 240px; background: var(--green-d); top: 8%; right: 28%; animation-delay: -12s; }
@keyframes floaty {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.12); }
}

header, main, .foot { position: relative; z-index: 1; }

/* ---------- header ---------- */
.top { text-align: center; padding: 28px 16px 8px; }
.logo {
  margin: 0;
  font-family: "Pacifico", cursive;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--ink);
  text-shadow: 3px 3px 0 #fff, 6px 6px 0 var(--pink);
}
.tagline { margin: 6px 0 14px; color: var(--ink-soft); }
.steps { display: inline-flex; gap: 8px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; justify-content: center; }
.steps li { padding: 6px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.6); font-size: 0.9rem; color: var(--ink-soft); transition: 0.25s; }
.steps li.on { background: #fff; color: var(--ink); box-shadow: 0 4px 14px rgba(183, 156, 255, 0.4); transform: translateY(-2px); }

/* ---------- layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 12px 16px; }
.screen { display: none; }
.screen.active { display: block; animation: pop 0.45s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.cam-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 20px; align-items: start; }

.card {
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

h3 { margin: 18px 0 8px; font-size: 1rem; font-weight: 600; }
h3:first-child { margin-top: 0; }
.small { font-size: 0.8rem; color: var(--ink-soft); margin: 8px 0 0; line-height: 1.4; }
.center { text-align: center; }

/* ---------- viewfinder ---------- */
.viewfinder {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border: 6px solid #fff;
  box-shadow: 0 8px 24px rgba(150, 120, 190, 0.3);
}
.viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewfinder video.mirror { transform: scaleX(-1); }
.tint { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; }
.countdown {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: "Pacifico", cursive; font-size: clamp(5rem, 18vw, 9rem); color: #fff;
  text-shadow: 0 6px 0 var(--pink-d), 0 0 40px rgba(255, 255, 255, 0.8);
  pointer-events: none;
}
.countdown.pop { animation: cd 0.9s ease; }
@keyframes cd { 0% { transform: scale(0.3); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 0.85; } }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.shot-badge {
  position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, 0.9);
  border-radius: 999px; padding: 4px 14px; font-size: 0.9rem; display: none;
}
.shot-badge.show { display: block; }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: rgba(255, 255, 255, 0.78); }
.cam-msg[hidden] { display: none; }

.shutter-row { display: flex; justify-content: center; margin: 18px 0 8px; }
.shutter {
  font: inherit; font-size: 1.15rem; font-weight: 600; color: #fff; cursor: pointer;
  border: 5px solid #fff; border-radius: 999px; padding: 14px 40px;
  background: linear-gradient(135deg, var(--pink-d), var(--purple-d));
  box-shadow: 0 8px 22px rgba(183, 156, 255, 0.55); transition: transform 0.15s, box-shadow 0.15s;
}
.shutter:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 28px rgba(183, 156, 255, 0.65); }
.shutter:active { transform: scale(0.96); }
.shutter.stop { background: linear-gradient(135deg, var(--ink-soft), var(--ink)); }

/* ---------- slots ---------- */
.slots { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.slot {
  position: relative; width: 108px; aspect-ratio: 4 / 3; padding: 0; cursor: pointer; overflow: hidden;
  border-radius: 14px; border: 3px dashed var(--purple-d); background: rgba(255, 255, 255, 0.6);
  font: inherit; color: var(--ink-soft); transition: transform 0.15s;
}
.slot:hover { transform: translateY(-3px) rotate(-1.5deg); }
.slot.filled { border-style: solid; border-color: #fff; box-shadow: 0 4px 12px rgba(150, 120, 190, 0.3); }
.slot canvas { width: 100%; height: 100%; display: block; }
.slot .n { position: absolute; left: 6px; top: 4px; background: #fff; border-radius: 999px; font-size: 0.7rem; padding: 0 7px; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  font: inherit; font-size: 0.85rem; color: var(--ink); cursor: pointer; white-space: nowrap;
  border: 2px solid transparent; border-radius: 999px; padding: 7px 14px;
  background: var(--yellow); transition: transform 0.12s, border-color 0.12s;
}
.chip:nth-child(5n + 2) { background: var(--pink); }
.chip:nth-child(5n + 3) { background: var(--purple); }
.chip:nth-child(5n + 4) { background: var(--blue); }
.chip:nth-child(5n + 5) { background: var(--green); }
.chip:hover { transform: translateY(-2px); }
.chip.on { border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.chip .mini { margin-right: 8px; vertical-align: middle; }

.mini { display: inline-grid; gap: 2px; width: 14px; }
.mini i { display: block; height: 4px; background: var(--ink); border-radius: 1px; opacity: 0.65; }
.mini.grid { grid-template-columns: 1fr 1fr; width: 20px; }
.mini.grid i { height: 6px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; border: 2px solid #fff;
  border-radius: 999px; padding: 9px 18px; background: linear-gradient(135deg, var(--yellow), var(--pink));
  box-shadow: 0 4px 14px rgba(150, 120, 190, 0.25); transition: transform 0.12s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: rgba(255, 255, 255, 0.75); }
.btn.big { font-weight: 600; padding: 12px 22px; background: linear-gradient(135deg, var(--pink-d), var(--purple-d)); color: #fff; }
.side .btn.big { width: 100%; margin-top: 14px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

.input {
  font: inherit; color: var(--ink); width: 100%; border: 2px solid #fff; border-radius: 16px;
  padding: 10px 14px; background: rgba(255, 255, 255, 0.85); outline: none; margin-top: 6px;
}
.input:focus { border-color: var(--purple-d); }
.row .input { flex: 1; margin-top: 0; min-width: 0; }

/* ---------- switch ---------- */
.switch { display: flex; align-items: center; gap: 10px; margin-top: 16px; cursor: pointer; font-size: 0.9rem; }
.switch input { display: none; }
.switch .slider { position: relative; width: 44px; height: 24px; border-radius: 999px; background: #fff; border: 2px solid var(--purple); transition: 0.2s; flex: none; }
.switch .slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--purple-d); transition: 0.2s; }
.switch input:checked + .slider { background: var(--pink); border-color: var(--pink-d); }
.switch input:checked + .slider::after { transform: translateX(20px); background: var(--pink-d); }

.range { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.9rem; margin-top: 8px; }
.range input { flex: 1; accent-color: var(--purple-d); }
.color-pick { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.color-pick input { width: 40px; height: 32px; border: 0; background: none; padding: 0; cursor: pointer; }

/* ---------- editor ---------- */
.preview-card { display: grid; justify-items: center; }
.preview-wrap {
  padding: 14px; border-radius: 22px; background: repeating-conic-gradient(#fff 0% 25%, #fbf5ff 0% 50%) 0 0 / 22px 22px;
  max-width: 100%; display: flex; justify-content: center;
}
#stage { max-width: 100%; max-height: 78vh; width: auto; height: auto; border-radius: 6px; box-shadow: 0 10px 30px rgba(90, 74, 110, 0.25); cursor: default; }
#stage.grab { cursor: grab; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { font: inherit; font-size: 0.85rem; cursor: pointer; border: 2px solid transparent; border-radius: 999px; padding: 7px 14px; background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.tab.on { background: #fff; border-color: var(--purple-d); box-shadow: 0 3px 0 var(--purple-d); }
.tabpanel { display: none; max-height: 56vh; overflow: auto; padding-right: 4px; }
.tabpanel.active { display: block; }

.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme { font: inherit; font-size: 0.75rem; cursor: pointer; padding: 0; border: 3px solid #fff; border-radius: 16px; overflow: hidden; background: #fff; color: var(--ink); transition: transform 0.12s; }
.theme:hover { transform: translateY(-2px); }
.theme .sw { display: block; height: 46px; }
.theme span.name { display: block; padding: 4px 2px; }
.theme.on { border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.emoji-grid button { font-size: 1.5rem; cursor: pointer; border: 2px solid #fff; border-radius: 14px; background: rgba(255, 255, 255, 0.8); padding: 4px 0; transition: transform 0.12s; }
.emoji-grid button:hover { transform: scale(1.18) rotate(-6deg); background: var(--yellow); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 2px dashed rgba(183, 156, 255, 0.5); }
.actions .big { flex: 1; }

/* ---------- toast & confetti ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 20;
  background: #fff; color: var(--ink); border-radius: 999px; padding: 10px 22px; box-shadow: var(--shadow); transition: 0.3s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; }

.foot { text-align: center; font-size: 0.8rem; color: var(--ink-soft); margin-top: 18px; padding: 0 16px; }

/* ---------- print ---------- */
#printImg { display: none; }
@media print {
  body > *:not(#printImg) { display: none !important; }
  body { background: #fff; animation: none; }
  #printImg { display: block; max-width: 100%; max-height: 100vh; margin: 0 auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cam-grid, .edit-grid { grid-template-columns: 1fr; }
  .tabpanel { max-height: none; }
  #stage { max-height: 70vh; }
}

/* ---------- Rating & Ulasan ---------- */
.feedback-card {
  max-width: 680px;
  margin: 24px auto 0;
  text-align: center;
}
.feedback-card h3 {
  margin-bottom: 4px;
}
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.star-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.star-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: #dcd3e8;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
  padding: 0 4px;
}
.star-btn:hover,
.star-btn.active {
  color: #ffbe3b;
  transform: scale(1.18);
}
.textarea {
  resize: vertical;
  font-family: inherit;
  min-height: 80px;
}
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  text-align: left;
}
.fb-item {
  background: #fff8fc;
  border: 2px solid #f3dff0;
  border-radius: 16px;
  padding: 12px 14px;
}
.fb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.fb-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-stars {
  color: #ffbe3b;
  letter-spacing: 2px;
}
.fb-del {
  background: #ffe3ee;
  border: none;
  border-radius: 999px;
  color: #a14b72;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.fb-del:hover {
  background: #ffc6dd;
  transform: scale(1.06);
}
.fb-msg {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
}