/* ============================================================
   Our First Trip — styles
   Aesthetic: warm film-photo travel journal
   ============================================================ */

:root {
  --paper:     #f4ead9;
  --paper-2:   #ecdfc9;
  --card:      #fffdf7;
  --ink:       #2c2420;
  --ink-soft:  #7a6a5b;
  --ink-faint: #a89786;
  --accent:    #c1512b;   /* sunset terracotta */
  --accent-2:  #e0894a;   /* warm amber */
  --rose:      #b06b73;   /* dusty rose */
  --line:      rgba(44, 36, 32, 0.14);
  --shadow:    0 22px 45px -24px rgba(74, 45, 24, 0.55);
  --shadow-sm: 0 8px 20px -14px rgba(74, 45, 24, 0.5);
  --r:         14px;
}

* { box-sizing: border-box; }

/* the HTML "hidden" attribute must always win over display rules below */
[hidden] { display: none !important; }

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

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 78% -8%, rgba(224, 137, 74, 0.20), transparent 60%),
    radial-gradient(900px 500px at 10% 4%, rgba(176, 107, 115, 0.14), transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px clamp(18px, 5vw, 64px);
  backdrop-filter: blur(6px);
  background: linear-gradient(var(--paper), rgba(244, 234, 217, 0.4));
}

.back {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, background 0.18s ease;
}
.back:hover { transform: translateX(-3px); background: #fff; }
.back-arrow { font-size: 1.1rem; line-height: 1; }

.crumbs {
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs .sep { margin: 0 8px; color: var(--ink-faint); }

/* ---------- preview banner ---------- */
.preview-banner {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff8ef;
  text-align: center;
  padding: 10px 18px;
  font-size: 0.86rem;
}
.preview-banner code {
  background: rgba(255,255,255,0.22);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.82em;
}

/* ---------- layout ---------- */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px clamp(18px, 5vw, 64px) 80px;
}

/* ---------- hero ---------- */
.hero {
  padding: clamp(24px, 6vw, 60px) 0 clamp(30px, 5vw, 50px);
  text-align: center;
  position: relative;
}
.hero .eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}
.hero h1 {
  font-family: "Fraunces", serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero p {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  color: var(--ink-soft);
  max-width: 30ch;
  margin: 0 auto;
}
.hero .rule {
  width: 62px;
  height: 2px;
  background: var(--accent);
  margin: 26px auto 0;
  border-radius: 2px;
}

/* ---------- destinations grid ---------- */
.section-label {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 500;
  margin: 8px 0 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: clamp(20px, 3vw, 38px);
}

/* soft "love words" behind the home screen */
.love-bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
  animation: fade 1.2s ease both;
}
.love-bg span {
  position: absolute;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  transform: rotate(var(--r, 0deg));
  animation: driftWord 8s ease-in-out infinite;
}
@keyframes driftWord {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-9px) rotate(var(--r, 0deg)); }
}
/* keep all page content above the words */
main, .foot { position: relative; z-index: 1; }

/* place card — like a taped-down photo postcard */
.place-card {
  position: relative;
  background: var(--card);
  border-radius: 6px;
  padding: 12px 12px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: center;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s ease;
  animation: rise 0.6s both;
}
.place-card:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
  box-shadow: 0 30px 55px -22px rgba(74, 45, 24, 0.6);
}
.place-card .thumb {
  aspect-ratio: 4 / 5;
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper-2);
}
.place-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.place-card .name {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 12px;
}
.place-card .name .pin { color: var(--accent); margin-right: 4px; }

/* ---------- place → two folders ---------- */
.place-head {
  text-align: center;
  padding: 10px 0 34px;
}
.place-head h2 {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 3.6rem);
  margin: 0;
  letter-spacing: -0.02em;
}
.place-head span { color: var(--ink-soft); font-size: 0.95rem; }
.place-teaser {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 14px auto 0;
}
.rev-desc {
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 2px 0 8px;
}

.folders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(20px, 4vw, 40px);
  max-width: 760px;
  margin: 0 auto;
}
.folder-card {
  position: relative;
  background: var(--card);
  border-radius: var(--r);
  padding: 26px;
  min-height: 230px;
  cursor: pointer;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  animation: rise 0.6s both;
}
.folder-card:hover { transform: translateY(-6px); box-shadow: 0 32px 55px -24px rgba(74,45,24,.6); }
/* stacked photo peeking out of the folder */
.folder-card .stack {
  position: absolute;
  top: -26px; right: -18px;
  width: 150px; height: 150px;
  border-radius: 8px;
  transform: rotate(9deg);
  box-shadow: var(--shadow-sm);
  background-size: cover;
  background-position: center;
  border: 6px solid var(--card);
}
.folder-card .stack.two { top: 6px; right: 34px; transform: rotate(-7deg); opacity: 0.9; }
.folder-card .flabel {
  font-family: "Fraunces", serif;
  font-size: 1.7rem;
  font-weight: 500;
  position: relative;
  z-index: 2;
}
.folder-card .fhint { color: var(--ink-soft); font-size: 0.92rem; position: relative; z-index: 2; }
.folder-card .fcount {
  margin-top: 10px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  position: relative; z-index: 2;
}

/* ---------- folder → thumbnails ---------- */
.masonry {
  columns: 3 240px;
  column-gap: clamp(12px, 2vw, 20px);
}
.masonry .tile {
  break-inside: avoid;
  margin-bottom: clamp(12px, 2vw, 20px);
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  padding: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.5s both;
}
.masonry .tile:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow); }
.masonry .tile img,
.masonry .tile .demo {
  width: 100%;
  display: block;
  border-radius: 2px;
}

.masonry .tile { position: relative; }
.masonry .tile .tag {
  position: absolute; top: 12px; left: 12px;
  background: rgba(28,20,16,0.62); color: #fff;
  font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px; backdrop-filter: blur(3px);
}

/* "See more photos" */
.more-wrap { text-align: center; padding: 34px 0 10px; }
.more-btn {
  font-family: "Instrument Sans", sans-serif; font-size: 0.95rem; font-weight: 600;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 26px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, background 0.2s ease;
}
.more-btn:hover:not(:disabled) { transform: translateY(-2px); background: #fff; }
.more-btn:disabled { opacity: 0.6; cursor: default; }
.more-note { color: var(--ink-faint); font-size: 0.78rem; font-style: italic; margin-top: 8px; }

.lb-credit {
  position: absolute; bottom: 24px; left: 24px;
  color: rgba(255,255,255,0.7); font-size: 0.78rem;
  text-decoration: none; max-width: 60vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-credit:hover { color: #fff; text-decoration: underline; }

/* gradient placeholder "photos" for preview mode */
.demo {
  aspect-ratio: var(--ar, 3/4);
  background: linear-gradient(140deg, hsl(var(--h,20) 55% 62%), hsl(calc(var(--h,20) + 40) 60% 48%));
}

/* ---------- states ---------- */
.status {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-soft);
  font-family: "Fraunces", serif;
  font-size: 1.15rem;
}
.status .spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.9s linear infinite;
}
.status.err {
  max-width: 520px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: left;
  padding: 28px 30px;
}
.status.err h3 { font-family: "Fraunces", serif; margin: 0 0 10px; color: var(--accent); }
.status.err code { background: var(--paper-2); padding: 1px 6px; border-radius: 5px; }

/* ---------- footer ---------- */
.foot {
  text-align: center;
  padding: 40px 20px 60px;
  color: var(--ink-faint);
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 0.95rem;
}
.foot-mark { color: var(--rose); margin-right: 8px; }

/* soft music toggle */
.music-btn {
  position: fixed; top: 16px; right: 16px; z-index: 41;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--accent);
  font-size: 1.05rem; cursor: pointer; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.music-btn:hover { transform: scale(1.08); animation-play-state: paused; }
.music-btn.on { background: var(--accent); color: #fff; animation: musicPulse 1.8s ease-in-out infinite; }
@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193,81,43,0.4); }
  50%      { box-shadow: 0 0 0 10px rgba(193,81,43,0); }
}

/* draw attention while the music is OFF */
.music-btn:not(.on) { animation: musicNudge 2.8s ease-in-out infinite, musicRing 2.8s ease-out infinite; }
@keyframes musicNudge {
  0%, 86%, 100% { transform: scale(1) rotate(0); }
  90% { transform: scale(1.14) rotate(-10deg); }
  94% { transform: scale(1.14) rotate(10deg); }
  98% { transform: scale(1.05) rotate(0); }
}
@keyframes musicRing {
  0%       { box-shadow: 0 0 0 0 rgba(193,81,43,0.5); }
  70%, 100% { box-shadow: 0 0 0 15px rgba(193,81,43,0); }
}
.music-tip {
  position: fixed; top: 27px; right: 70px; z-index: 41;
  background: var(--ink); color: var(--paper);
  font-family: "Instrument Sans", sans-serif; font-size: 0.8rem;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  animation: tipBob 1.5s ease-in-out infinite;
}
.music-tip::after {
  content: ""; position: absolute; right: -5px; top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent; border-left-color: var(--ink);
}
@keyframes tipBob { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(28, 20, 16, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade 0.25s ease;
}
.lb-stage {
  max-width: 92vw;
  max-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-stage img,
.lb-stage .demo {
  max-width: 92vw;
  max-height: 84vh;
  width: auto; height: auto;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: fade 0.28s ease;
}
.lb-stage .demo { width: min(70vw, 520px); }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
}
.lb-nav:hover { background: rgba(255,255,255,0.25); }
.lb-prev { left: clamp(10px, 3vw, 40px); }
.lb-next { right: clamp(10px, 3vw, 40px); }
.lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-next:hover { transform: translateY(-50%) translateX(3px); }

.lb-close {
  position: absolute;
  top: 22px; right: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease;
}
.lb-close:hover { background: rgba(255,255,255,0.28); }

.lb-count {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

/* ---------- animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .masonry { columns: 2 140px; }
  .lb-nav { width: 46px; height: 46px; font-size: 1.6rem; }
  .topbar { padding: 14px 18px; }
}

/* ============================================================
   THE MISSION — floating launcher, humorous gate, and form
   ============================================================ */

/* ---- floating launcher that drifts around the screen ---- */
.launcher {
  position: fixed;
  top: 78%; left: 6%;
  z-index: 40;
  width: 62px; height: 62px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent));
  box-shadow: 0 12px 30px -8px rgba(193,81,43,0.7), 0 0 0 0 rgba(193,81,43,0.5);
  color: #fff;
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  animation: drift 28s ease-in-out infinite, halo 2.4s ease-out infinite;
}
.launcher:hover, .launcher:focus-visible { animation-play-state: paused, running; transform: scale(1.12); outline: none; }
.launcher .l-inner { animation: bob 3s ease-in-out infinite; display: block; }
.launcher .l-tip {
  position: absolute;
  right: 74px; top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.78rem;
  font-family: "Instrument Sans", sans-serif;
  padding: 6px 11px;
  border-radius: 999px;
  opacity: 0.9;
  pointer-events: none;
}
.launcher .l-tip::after {
  content: ""; position: absolute; right: -5px; top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent; border-left-color: var(--ink);
}

@keyframes drift {
  0%   { top: 78%; left: 6%; }
  20%  { top: 20%; left: 16%; }
  40%  { top: 62%; left: 80%; }
  60%  { top: 26%; left: 50%; }
  80%  { top: 72%; left: 74%; }
  100% { top: 78%; left: 6%; }
}
@keyframes bob { 0%,100% { transform: translateY(-2px) rotate(-6deg); } 50% { transform: translateY(3px) rotate(8deg); } }
@keyframes halo {
  0%   { box-shadow: 0 12px 30px -8px rgba(193,81,43,0.7), 0 0 0 0 rgba(193,81,43,0.45); }
  100% { box-shadow: 0 12px 30px -8px rgba(193,81,43,0.7), 0 0 0 22px rgba(193,81,43,0); }
}
@media (prefers-reduced-motion: reduce) {
  .launcher { animation: none; top: auto; bottom: 24px; left: auto; right: 24px; }
}

/* ---- shared modal shell ---- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(28,20,16,0.55);
  backdrop-filter: blur(5px);
  animation: fade 0.25s ease;
}
.modal-card {
  background:
    radial-gradient(600px 300px at 80% -10%, rgba(224,137,74,0.18), transparent 60%),
    var(--card);
  border-radius: 20px;
  box-shadow: 0 40px 90px -30px rgba(60,35,18,0.7);
  width: 100%;
  animation: pop 0.35s cubic-bezier(.2,.9,.3,1.2) both;
  position: relative;
}
@keyframes pop { from { opacity: 0; transform: scale(0.9) translateY(14px); } to { opacity: 1; } }

.modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-soft); font-size: 0.95rem; cursor: pointer;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--paper-2); }

/* ---- humorous gate ---- */
.gate-card { max-width: 440px; text-align: center; padding: 44px 34px 34px; }
.gate-emoji { font-size: 3rem; display: block; margin-bottom: 14px; animation: bob 2.4s ease-in-out infinite; }
.gate-text {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: 1.4rem; line-height: 1.3; margin: 0 0 26px;
}
.gate-btns { display: flex; flex-direction: column; gap: 12px; }
.btn {
  font-family: "Instrument Sans", sans-serif; font-size: 1rem; font-weight: 600;
  padding: 13px 22px; border-radius: 12px; cursor: pointer; border: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px var(--accent); }
.btn-primary:hover { background: #a8431f; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--paper-2); }

.countdown {
  font-family: "Fraunces", serif;
  font-size: 5rem; font-weight: 600; color: var(--accent);
  line-height: 1; margin: 10px 0;
  animation: pop 0.4s ease;
}

/* ---- the form ---- */
.form-card {
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 40px clamp(22px, 5vw, 40px) 30px;
}
.form-card h2 {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: clamp(1.8rem, 5vw, 2.4rem); margin: 0 0 4px;
}
.form-card .lede { color: var(--ink-soft); margin: 0 0 26px; }

.field { margin-bottom: 30px; }
.field > label, .field .flab {
  display: flex; align-items: baseline; gap: 8px;
  font-family: "Fraunces", serif; font-size: 1.15rem; font-weight: 500;
  margin-bottom: 6px;
}
.field .flab .num {
  font-size: 0.75rem; font-weight: 700; color: #fff; background: var(--accent);
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-family: "Instrument Sans", sans-serif;
}
.field .sub { color: var(--ink-faint); font-size: 0.85rem; margin: -2px 0 12px 30px; }

/* priority reorder list */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rank-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
}
.rank-item.dragging { opacity: 0.5; }
.rank-item.over { box-shadow: 0 0 0 2px var(--accent); }
.rank-badge {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: "Fraunces", serif; transition: background 0.3s;
}
.rank-item:first-child .rank-badge { background: var(--accent); }
.rank-name { flex: 1; font-weight: 500; }
.rank-handle { color: var(--ink-faint); cursor: grab; font-size: 1.1rem; }
.rank-moves { display: flex; flex-direction: column; gap: 2px; }
.rank-moves button {
  width: 28px; height: 22px; border: 1px solid var(--line); background: var(--card);
  border-radius: 6px; cursor: pointer; color: var(--ink-soft); line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.rank-moves button:hover:not(:disabled) { background: var(--accent); color: #fff; }
.rank-moves button:disabled { opacity: 0.3; cursor: default; }

/* generic add-a-thing rows */
.adder { display: flex; gap: 8px; }
.adder input {
  flex: 1; font-family: inherit; font-size: 0.95rem;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink);
}
.adder input:focus { outline: none; border-color: var(--accent); }
.adder .add {
  border: none; background: var(--ink); color: var(--paper);
  border-radius: 10px; padding: 0 16px; font-weight: 600; cursor: pointer;
}
.adder .add:hover { background: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  padding: 7px 8px 7px 13px; border-radius: 999px; font-size: 0.9rem;
  animation: pop 0.3s ease;
}
.chip button {
  border: none; background: var(--paper-2); color: var(--ink-soft);
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer; line-height: 1;
}
.chip button:hover { background: var(--accent); color: #fff; }
.empty-note { color: var(--ink-faint); font-size: 0.85rem; margin-top: 10px; font-style: italic; }

.note-box {
  width: 100%; box-sizing: border-box;
  font-family: "Instrument Sans", sans-serif; font-size: 0.95rem;
  padding: 11px 13px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); resize: vertical;
}
.note-box:focus { outline: none; border-color: var(--accent); }

.adder-range { flex-wrap: wrap; align-items: center; }
.adder-range input[type="date"] { flex: 1 1 130px; min-width: 0; }
.adder-range .to { color: var(--ink-soft); font-size: 0.9rem; padding: 0 2px; }
.field-error { color: var(--accent); font-weight: 600; font-size: 0.86rem; margin-top: 10px; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* budget dual range */
.budget-readout {
  font-family: "Fraunces", serif; font-size: 1.5rem; color: var(--accent);
  text-align: center; margin-bottom: 6px;
}
.range-wrap { position: relative; height: 42px; }
.range-wrap .track {
  position: absolute; top: 19px; left: 0; right: 0; height: 5px;
  background: var(--paper-2); border-radius: 5px;
}
.range-wrap .fill {
  position: absolute; top: 19px; height: 5px;
  background: var(--accent); border-radius: 5px;
}
.range-wrap input[type="range"] {
  position: absolute; top: 8px; left: 0; width: 100%; height: 26px;
  margin: 0; background: none; -webkit-appearance: none; pointer-events: none;
}
.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto;
  width: 26px; height: 26px; border-radius: 50%; cursor: grab;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 4px 10px -3px rgba(60,35,18,0.5);
}
.range-wrap input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 22px; height: 22px; border-radius: 50%; cursor: grab;
  background: #fff; border: 3px solid var(--accent);
}

/* submit + thank-you */
.form-submit {
  width: 100%; margin-top: 8px; font-size: 1.05rem; padding: 15px;
  border-radius: 14px;
}
.thanks { text-align: center; padding: 46px 30px; }
.thanks .big { font-size: 3rem; display: block; margin-bottom: 12px; animation: bob 2.4s ease-in-out infinite; }
.thanks h2 { font-family: "Fraunces", serif; font-weight: 500; margin: 0 0 8px; }
.thanks p { color: var(--ink-soft); margin: 0 0 24px; }
.summary {
  text-align: left; background: var(--paper); border-radius: 14px;
  padding: 20px 22px; margin-bottom: 22px; font-size: 0.93rem; line-height: 1.7;
}
.summary b { font-family: "Fraunces", serif; }
.summary ol, .summary ul { margin: 4px 0 14px; padding-left: 22px; }
.summary .row + .row { margin-top: 12px; }

/* ---- on-screen finale (result → proposal → love) ---- */
.finale {
  min-height: 72vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 30px 20px 90px;
}
.finale .thanks, .finale .propose, .finale .love-final { max-width: 620px; width: 100%; }
.finale .thanks { padding: 0; }
.finale-btn { margin-top: 26px; }

.propose .big { font-size: 3rem; display: block; margin-bottom: 16px; animation: bob 2.4s ease-in-out infinite; }
.propose-text {
  font-family: "Fraunces", serif; font-weight: 400;
  font-size: clamp(1.3rem, 3.2vw, 1.9rem); line-height: 1.5; color: var(--ink);
}
.propose-love { display: block; margin-top: 16px; color: var(--accent); font-style: italic; font-weight: 500; }
.propose-btns { display: flex; gap: 16px; margin-top: 32px; justify-content: center; flex-wrap: wrap; position: relative; min-height: 56px; }
#yesBtn { transition: transform 0.28s cubic-bezier(.2,.9,.3,1.4); transform-origin: center; }
.runaway {
  position: fixed !important;
  z-index: 48;
  background: var(--card);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  box-shadow: 0 12px 28px -10px rgba(74, 45, 24, 0.6);
  transform: rotate(var(--nr, 0deg));
  transition: top 0.35s ease, left 0.35s ease, transform 0.35s ease;
}
.runaway:hover { background: var(--accent); color: #fff; }

.love-final { position: relative; z-index: 2; }
.love-huge {
  font-family: "Fraunces", serif; font-weight: 600;
  font-size: clamp(2.1rem, 8vw, 5rem); line-height: 1.05; color: var(--accent);
  animation: pop 0.6s cubic-bezier(.2,.9,.3,1.4) both, lovePulse 2.4s ease-in-out 0.6s infinite;
}
@keyframes lovePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.love-sub { font-family: "Fraunces", serif; font-style: italic; color: var(--rose); font-size: 1.2rem; margin-top: 10px; }
.back-link {
  margin-top: 30px; background: none; border: none; cursor: pointer;
  color: var(--ink-soft); font-family: "Instrument Sans", sans-serif; font-size: 0.9rem; text-decoration: underline;
}
.back-link:hover { color: var(--accent); }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.confetti span {
  position: absolute; top: -12vh;
  animation-name: confettiFall; animation-timing-function: ease-in; animation-fill-mode: forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(120vh) rotate(var(--cr, 360deg)); opacity: 0.9; }
}

.hearts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.hearts span {
  position: absolute; bottom: -12vh; color: var(--rose); opacity: 0.8;
  animation-name: floatUp; animation-timing-function: linear; animation-iteration-count: infinite;
}
@keyframes floatUp {
  from { transform: translateY(0) rotate(0); opacity: 0.85; }
  to   { transform: translateY(-122vh) rotate(35deg); opacity: 0; }
}
