:root,
[data-theme="default"] {
  --bg1: #ffd1dc;
  --bg2: #ffe5b4;
  --accent: #ff4d6d;
  --accent2: #ff8e53;
  --ink: #3d2c3a;
  --heart: rgba(255, 77, 109, 0.55);
}
[data-theme="ocean"] {
  --bg1: #a1c4fd;
  --bg2: #c2e9fb;
  --accent: #2e86de;
  --accent2: #48dbfb;
  --ink: #1e3a52;
  --heart: rgba(46, 134, 222, 0.55);
}
[data-theme="sunset"] {
  --bg1: #ffafbd;
  --bg2: #ffc3a0;
  --accent: #e84118;
  --accent2: #fbc531;
  --ink: #4a2c1f;
  --heart: rgba(232, 65, 24, 0.55);
}
[data-theme="mint"] {
  --bg1: #a8edea;
  --bg2: #d4fc79;
  --accent: #11998e;
  --accent2: #38ef7d;
  --ink: #1f3d35;
  --heart: rgba(17, 153, 142, 0.55);
}
[data-theme="lavender"] {
  --bg1: #d4b4f5;
  --bg2: #fbc2eb;
  --accent: #8e44ad;
  --accent2: #c77dff;
  --ink: #321a3f;
  --heart: rgba(142, 68, 173, 0.55);
}

html, body {
  transition: background-color .35s ease, color .35s ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  overflow-x: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------- Floating background hearts ---------- */
.heart {
  position: fixed;
  pointer-events: none;
  user-select: none;
  animation: float ease-in-out infinite;
  color: var(--heart);
  z-index: 0;
  will-change: transform, opacity;
}
@keyframes float {
  0%   { transform: translate(0, 110vh) rotate(0deg) scale(.9);   opacity: 0; }
  8%   { opacity: 1; }
  25%  { transform: translate(calc(var(--drift, 0px) *  1), 75vh) rotate(90deg)  scale(1.05); }
  50%  { transform: translate(calc(var(--drift, 0px) * -1), 50vh) rotate(180deg) scale(.95); }
  75%  { transform: translate(calc(var(--drift, 0px) *  1), 25vh) rotate(270deg) scale(1.05); }
  92%  { opacity: 1; }
  100% { transform: translate(0, -15vh) rotate(360deg) scale(.9); opacity: 0; }
}

/* ---------- Card ---------- */
.card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  text-align: center;
  position: relative;
  z-index: 1;
}

h1 { font-size: 28px; margin: 0 0 6px; font-weight: 800; }
h2 { font-size: 26px; margin: 8px 0 14px; }
p  { line-height: 1.55; }

/* ---------- Creator form ---------- */
form { display: grid; gap: 14px; text-align: left; }

label.field {
  font-size: 13px;
  font-weight: 700;
  color: #6b5664;
  display: block;
  margin-bottom: 6px;
}
.req { color: #e63946; margin-left: 2px; }
.counter {
  float: right;
  font-weight: 500;
  color: #a89099;
  font-size: 12px;
}

input[type="text"],
input[type="date"],
input[type="time"],
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(255, 77, 109, 0.2);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  transition: border-color .15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }

.file-drop {
  border: 2px dashed rgba(255, 77, 109, 0.45);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  background: rgba(255, 255, 255, 0.55);
  display: block;
}
.file-drop:hover, .file-drop.dragover {
  background: rgba(255, 77, 109, 0.08);
  border-color: var(--accent);
}
.file-drop input { display: none; }

.preview {
  margin-top: 10px;
  width: 130px;
  height: 130px;
  border-radius: 12px;
  object-fit: cover;
  display: none;
}
.preview.show { display: inline-block; }

button {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  box-shadow: 0 8px 24px rgba(255, 77, 109, 0.45);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 77, 109, 0.55); }
.btn-primary:active { transform: translateY(0); }

.link-output { margin-top: 18px; text-align: left; }
.link-result {
  margin-top: 8px;
  padding: 12px;
  background: #fff7f7;
  border-radius: 12px;
  word-break: break-all;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-height: 110px;
  overflow-y: auto;
  border: 1px solid rgba(255, 77, 109, 0.2);
  color: #555;
}
.copy-btn {
  margin-top: 10px;
  background: white;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 10px 20px;
  font-size: 14px;
}
.copy-btn:hover { background: rgba(255, 77, 109, 0.06); }

.hint { font-size: 12px; color: #888; margin-top: 10px; }
.error { color: #c0392b; font-size: 14px; min-height: 1em; }

/* ---------- Viewer ---------- */
.girl-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  animation: pulse 2.6s ease-in-out infinite;
  margin-bottom: 18px;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

.ask {
  font-size: 30px;
  font-weight: 800;
  margin: 4px 0 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.details {
  background: rgba(255, 255, 255, 0.75);
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-size: 16px;
  line-height: 1.7;
}
.details .row { display: flex; justify-content: space-between; gap: 14px; }
.details .label { font-weight: 700; color: var(--accent); }

.note { font-style: italic; color: #6b5664; margin: 0 0 22px; }

/* ---------- Answer buttons ---------- */
/* This is the "arena" the No button dodges inside.
   The Yes button stays centered; the No button is positioned
   absolutely within this box, so it physically cannot leave. */
.answer-buttons {
  position: relative;
  min-height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-yes {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-size: 20px;
  padding: 18px 40px;
  box-shadow: 0 8px 24px rgba(255, 77, 109, 0.5);
  animation: wiggle 3.5s ease-in-out infinite;
}
@keyframes wiggle {
  0%, 92%, 100% { transform: rotate(0deg); }
  94% { transform: rotate(-3deg); }
  96% { transform: rotate(3deg); }
  98% { transform: rotate(-2deg); }
}
.btn-yes:hover { transform: scale(1.08); animation: none; }

/* The runaway "No" — positioned absolutely WITHIN .answer-buttons,
   so it can never leave that little arena. */
.btn-no {
  background: white;
  color: #888;
  border: 2px solid #ddd;
  font-size: 16px;
  padding: 14px 28px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left .18s ease-out, top .18s ease-out;
}

/* ---------- Confirmation ---------- */
.confirmation { display: none; }
.confirmation.show { display: block; animation: bounceIn 0.6s ease; }
@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.check { font-size: 72px; margin-bottom: 8px; }

/* ---------- Confetti ---------- */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 100;
}

/* ---------- Advanced settings ---------- */
details.advanced {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
}
details.advanced summary {
  cursor: pointer;
  font-weight: 700;
  color: #6b5664;
  font-size: 14px;
  padding: 2px 0;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary::before {
  content: '▸';
  color: var(--accent);
  font-size: 12px;
  transition: transform .15s ease;
  display: inline-block;
}
details.advanced[open] summary::before { transform: rotate(90deg); }
.advanced-body { margin-top: 14px; display: grid; gap: 14px; }

/* ---------- Theme picker ---------- */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}
.theme-swatch {
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 8px 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #6b5664;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.theme-swatch:hover { transform: translateY(-2px); }
.theme-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.swatch-preview {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.swatch-preview.t-default  { background: linear-gradient(135deg, #ffd1dc, #ffe5b4); }
.swatch-preview.t-ocean    { background: linear-gradient(135deg, #a1c4fd, #c2e9fb); }
.swatch-preview.t-sunset   { background: linear-gradient(135deg, #ffafbd, #ffc3a0); }
.swatch-preview.t-mint     { background: linear-gradient(135deg, #a8edea, #d4fc79); }
.swatch-preview.t-lavender { background: linear-gradient(135deg, #d4b4f5, #fbc2eb); }
