:root {
  --pink: #e0497a; --deep: #c2255c; --ink: #5c2333; --soft: #b76e88;
  --bg1: #fff6f3; --bg2: #ffe4ee; --line: #ffd3e0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Segoe UI', Tahoma, system-ui, sans-serif;
  background: linear-gradient(180deg, var(--bg2), var(--bg1) 40%);
  color: var(--ink); min-height: 100vh;
}
#app { max-width: 560px; margin: 0 auto; padding: 0 16px 120px; }
.loading { text-align: center; padding: 120px 0; font-size: 40px; color: var(--pink); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.2); opacity: .6; } }

/* hero */
.hero { text-align: center; padding: 64px 8px 24px; }
.hero .hearts { color: var(--pink); letter-spacing: 8px; font-size: 14px; }
.hero h1 { font-size: 30px; font-weight: 800; color: var(--deep); margin: 14px 0 4px; }
.hero .names { font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 8px; }
.hero .greet { margin-top: 18px; font-size: 18px; font-weight: 700; color: var(--pink); }
.hero .greet .guest { color: var(--deep); }
.hero .when { margin-top: 10px; font-size: 15px; color: var(--soft); font-weight: 700; }

/* countdown */
.count { display: flex; gap: 8px; justify-content: center; margin: 22px 0 6px; direction: rtl; }
.count .cell { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; min-width: 62px; padding: 10px 6px; text-align: center; box-shadow: 0 6px 16px rgba(224,73,122,.12); }
.count .num { font-size: 22px; font-weight: 800; color: var(--deep); }
.count .lbl { font-size: 11px; color: var(--soft); font-weight: 700; }
.count .done { grid-column: 1/-1; }

/* cards */
.card { background: #fff; border: 1.5px solid var(--line); border-radius: 22px; padding: 20px; margin-top: 18px; box-shadow: 0 10px 26px rgba(224,73,122,.12); }
.card h2 { color: var(--deep); font-size: 19px; font-weight: 800; text-align: center; margin-bottom: 14px; }

/* story */
.moment { margin-top: 14px; }
.moment img { width: 100%; border-radius: 16px; display: block; }
.moment .cap { text-align: center; font-size: 14px; font-weight: 700; color: var(--soft); margin-top: 8px; }
.empty-note { text-align: center; color: var(--soft); font-size: 14px; padding: 8px 0; }

/* song */
.song { display: flex; align-items: center; gap: 12px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 999px; padding: 11px 14px; margin-top: 18px; box-shadow: 0 10px 26px rgba(224,73,122,.18); }
.song .play { width: 42px; height: 42px; border: none; border-radius: 50%; background: linear-gradient(135deg,#ff8fab,#e0497a);
  color: #fff; font-size: 14px; cursor: pointer; flex-shrink: 0; }
.song .meta { flex: 1; min-width: 0; }
.song .st { font-size: 14px; font-weight: 800; color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .ss { font-size: 11px; color: var(--soft); }
.song.playing .play { animation: pulse 1.4s infinite; }
#ytbox { margin-top: 14px; border-radius: 18px; overflow: hidden; }
#ytbox iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }

/* venue */
.venue p { text-align: center; font-size: 16px; font-weight: 700; }
.venue .mapbtn { display: block; text-align: center; margin-top: 12px; background: linear-gradient(135deg,#ff8fab,#e0497a);
  color: #fff; text-decoration: none; font-weight: 800; border-radius: 14px; padding: 13px; font-size: 15px; }

/* rsvp */
.rsvp p.q { text-align: center; font-size: 17px; font-weight: 800; color: var(--deep); }
.rsvp .who { margin-top: 12px; }
.rsvp .btns { display: flex; gap: 10px; margin-top: 14px; }
.rsvp .btns button { flex: 1; }
.rsvp .thanks { text-align: center; color: var(--deep); font-weight: 800; margin-top: 14px; font-size: 15px; }

.footer { text-align: center; margin-top: 26px; color: var(--soft); font-weight: 700; font-size: 15px; }

/* buttons + inputs */
.btn { border: none; border-radius: 14px; padding: 13px; font-family: inherit; font-size: 15px; font-weight: 800;
  cursor: pointer; background: linear-gradient(135deg,#ff8fab,#e0497a); color: #fff; box-shadow: 0 8px 20px rgba(224,73,122,.3); }
.btn:active { transform: scale(.97); }
.btn-ghost { background: #fff; color: var(--deep); border: 2px solid #ffb3c6; box-shadow: none; }
input { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; font-family: inherit;
  font-size: 15px; color: var(--ink); background: #fff; text-align: right; }
input:focus { outline: none; border-color: var(--pink); }

/* edit pill */
.topbar { position: fixed; top: 0; right: 0; left: 0; z-index: 70; display: flex; justify-content: flex-start; padding: 10px 16px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.pill { border: none; border-radius: 999px; padding: 10px 22px; font-family: inherit; font-size: 14px; font-weight: 800;
  color: var(--deep); background: rgba(255,255,255,.94); border: 1.5px solid #ffb3c6; box-shadow: 0 8px 22px rgba(224,73,122,.25); cursor: pointer; }
.pill.on { background: linear-gradient(135deg,#ff8fab,#e0497a); color: #fff; }

/* edit affordances */
.ed-row { display: flex; gap: 8px; margin-top: 10px; }
.mini { border: none; border-radius: 10px; padding: 8px 12px; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
  background: #fff; color: var(--deep); border: 1.5px solid #ffb3c6; }
.mini.danger { color: #fff; background: var(--pink); border-color: var(--pink); }
.rsvp-item { display: flex; justify-content: space-between; padding: 9px 4px; border-bottom: 1px dashed var(--line); font-size: 14px; font-weight: 700; }
.rsvp-item .yes { color: #1c9b57; } .rsvp-item .no { color: var(--pink); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(60,15,32,.5); z-index: 60; display: flex; align-items: flex-end; }
.modal { background: var(--bg1); border-radius: 26px 26px 0 0; width: 100%; padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0,0,0,.2); max-height: 88vh; overflow-y: auto; }
.modal h3 { color: var(--deep); font-size: 18px; font-weight: 800; margin-bottom: 14px; text-align: center; }
.modal .field { margin-bottom: 12px; }
.modal .field label { display: block; font-size: 13px; font-weight: 800; color: var(--soft); margin-bottom: 5px; }
.modal .row { display: flex; gap: 10px; margin-top: 10px; position: sticky; bottom: 0; background: var(--bg1); padding-top: 10px; }
.modal .row .btn { flex: 1; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.chk input { width: auto; }
.toast { position: fixed; top: 18px; right: 50%; transform: translateX(50%); background: var(--ink); color: #fff; padding: 10px 20px;
  border-radius: 999px; font-size: 13px; font-weight: 700; z-index: 80; box-shadow: 0 10px 24px rgba(0,0,0,.25); animation: drop .25s ease-out; }
@keyframes drop { from { transform: translate(50%,-30px); opacity: 0; } }
