:root {
  --primary: #002e1c;
  --pine: #14452f;
  --gold: #775a00;
  --gold-bright: #fece57;
  --gold-soft: #ffdf98;
  --gold-line: #e7dec8;
  --berry: #570008;
  --berry-soft: #ffdad7;
  --ok-soft: #bbeecf;
  --surface: #fff8f3;
  --c-lowest: #fff;
  --c-low: #faf2eb;
  --c: #f4ede6;
  --c-high: #eee7e0;
  --text: #1e1b17;
  --muted: #414943;
  --outline: #717973;
  --error: #ba1a1a;
  --shadow: 0 12px 32px -4px rgba(45, 30, 8, .08), 0 2px 6px 0 rgba(45, 30, 8, .04);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font: 16px/1.6 var(--sans);
  color: var(--text);
  background: var(--surface) radial-gradient(ellipse at 50% 0, rgba(254, 206, 87, .18), transparent 60%) no-repeat;
}
[hidden] { display: none !important; }
a { color: var(--pine); font-weight: 600; }

.ms {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  flex-shrink: 0;
}
.fill { font-variation-settings: "FILL" 1; }
.gold-icon { color: var(--gold); }
.w100 { width: 100%; }

/* Header */
.topbar {
  background: var(--pine);
  color: #fff;
  padding: 1rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, .25);
}
.topbar-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; }
.logo {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: var(--gold-bright);
  display: grid; place-items: center;
  box-shadow: 0 0 18px rgba(254, 206, 87, .25);
}
.logo .ms { font-size: 26px; }
.brand { flex: 1; min-width: 0; }
.brand-title { font: 600 1.4rem/1.2 var(--serif); margin: 0; overflow-wrap: anywhere; }
.brand-sub {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-bright); display: flex; align-items: center; gap: .4rem;
}
.brand-sub::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-bright); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--c); color: var(--pine);
}
.topbar .icon-btn { background: rgba(0, 0, 0, .25); color: #fff; }
.icon-btn:hover { filter: brightness(.95); }
.icon-btn.danger { background: var(--berry-soft); color: var(--berry); }

/* Layout */
main { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 3rem; display: flex; flex-direction: column; gap: 1.25rem; }
.narrow { max-width: 480px; }
.card {
  background: var(--c-lowest);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card.tinted { background: var(--c-low); box-shadow: none; border: 1px solid var(--gold-line); }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.section-title { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 0; }
.section-title h2 { font: 600 1.35rem/1.3 var(--serif); color: var(--primary); margin: 0; flex: 1; }
.card h3 { display: flex; align-items: center; gap: .6rem; font: 600 1.05rem/1.4 var(--sans); margin: 0 0 1rem; }
.chip-icon {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold);
}
.chip-icon.green { background: var(--ok-soft); color: var(--pine); }
h1 { font: 600 2rem/1.25 var(--serif); color: var(--primary); margin: .5rem 0; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: 0 0 1.25rem; }
.small { font-size: .85rem; color: var(--muted); }
.glow { position: absolute; border-radius: 50%; filter: blur(30px); pointer-events: none; }
.glow.a { width: 140px; height: 140px; top: -50px; right: -50px; background: rgba(255, 223, 152, .6); }
.glow.b { width: 120px; height: 120px; bottom: -40px; left: -40px; background: rgba(187, 238, 207, .45); }

/* Badges & pills */
.badges { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .8rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--c-high); color: var(--gold);
}
.badge.dark { background: var(--pine); color: #fff; text-transform: none; letter-spacing: 0; font-size: .8rem; }
.badge.dark .ms { color: var(--gold-soft); font-size: 16px; }
.badge.ok { background: var(--ok-soft); color: var(--pine); text-transform: none; letter-spacing: 0; }
.badge.bad { background: var(--berry-soft); color: var(--berry); text-transform: none; letter-spacing: 0; }
.pill {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; background: var(--c); color: var(--muted);
}
.pill.berry { background: var(--berry-soft); color: #410004; }
.hello { background: var(--gold-soft); color: #251a00; font-weight: 700; padding: .45rem 1rem; border-radius: 999px; margin-bottom: 1rem; }

/* Notes */
.note {
  display: flex; gap: .6rem; align-items: flex-start;
  margin: 0;
  background: var(--c); border-radius: .75rem; padding: .9rem 1rem;
  font-size: .9rem; color: var(--muted); text-align: left;
}
.note .ms { color: var(--pine); }
.note.gold { background: var(--c-low); justify-content: center; align-items: center; font-weight: 600; }
.note.gold .ms { color: var(--gold); }
.note.berry { background: var(--berry-soft); color: var(--berry); font-weight: 600; }
.note.berry .ms { color: var(--berry); }
.note.ok { background: #e6f4ea; color: var(--pine); font-weight: 600; align-items: center; }
.error {
  margin: 0;
  display: flex; gap: .5rem; align-items: center;
  background: #ffdad6; color: #93000a; border-radius: .75rem; padding: .8rem 1rem; font-weight: 600;
}

/* Buttons */
.btn {
  font: 600 1rem/1.2 var(--sans);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.2rem;
  border: 0; border-radius: .5rem; cursor: pointer;
  background: var(--primary); color: #fff;
  transition: transform .1s, filter .15s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(.98); }
.btn .ms { color: var(--gold-soft); }
.btn.block { width: 100%; }
.btn.hero {
  min-height: 56px; font-size: 1.1rem;
  background: linear-gradient(110deg, #2f6a4c, var(--primary) 55%);
  box-shadow: 0 8px 20px -3px rgba(0, 46, 28, .35);
}
.btn.big { min-height: 60px; font: 600 1.3rem/1.2 var(--serif); }
.btn.gold { background: var(--gold-soft); color: #251a00; }
.btn.gold .ms { color: #251a00; }
.btn.soft { background: var(--c); color: var(--pine); }
.btn.soft .ms { color: var(--pine); }
.btn.soft:hover { filter: none; background: var(--c-high); }
.btn.danger { background: var(--berry); }
.btn.danger .ms { color: #fff; }
.btn.text { background: none; color: var(--muted); min-height: auto; padding: .4rem; font-size: .9rem; }
.btn.text .ms { color: inherit; }
.btn.sm { min-height: 40px; font-size: .88rem; padding: .5rem .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions > .btn { flex: 1 1 150px; }

/* Forms */
label { display: block; font-size: .9rem; font-weight: 600; margin: .9rem 0 .35rem; }
input, select {
  width: 100%;
  font: 500 1rem var(--sans); color: var(--text);
  background: var(--c-low);
  border: 1px solid transparent; border-radius: .5rem;
  padding: .8rem 1rem; min-height: 48px;
}
input::placeholder { color: var(--outline); }
input:focus, select:focus { border-color: var(--gold); background: #fff; }
.money { display: flex; align-items: center; gap: .5rem; background: var(--c-low); border-radius: .5rem; padding: 0 1rem; }
.money input { background: none; padding-left: 0; font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.money .cur { font-weight: 700; color: var(--gold); font-size: 1.2rem; }
.money .code { font-size: .75rem; font-weight: 700; color: var(--outline); }
form .btn.block { margin-top: 1.25rem; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }

/* Participants */
.list { display: flex; flex-direction: column; gap: .75rem; }
.person { background: var(--c-lowest); border-radius: 1rem; padding: 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .75rem; }
.person-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--pine); color: var(--gold-soft);
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem;
}
.who { flex: 1; min-width: 0; }
.who-name { font-weight: 600; font-size: 1.05rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.who-sub { font-size: .82rem; color: var(--muted); display: flex; gap: .25rem; align-items: center; }
.who-sub .ms { font-size: 16px; }
.gives {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--c); border-radius: .5rem; padding: .4rem .75rem;
  font-size: .8rem; color: var(--muted);
}
.gives strong { color: var(--primary); font-size: 1rem; }
.gives .ms { font-size: 16px; color: var(--pine); }
.bubble { background: var(--c-low); border-radius: .75rem; padding: .75rem; font-size: .85rem; color: var(--muted); }
.bubble-head { display: flex; align-items: center; gap: .3rem; color: var(--gold); font-size: .75rem; font-weight: 700; margin-bottom: .25rem; }
.bubble-head .ms { font-size: 16px; }
.bubble p { margin: 0; font-style: italic; overflow-wrap: anywhere; user-select: all; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.empty { text-align: center; color: var(--muted); padding: 1.5rem; border: 2px dashed var(--gold-line); border-radius: 1rem; }

/* Verification */
.checks { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.checks li { display: flex; gap: .5rem; align-items: center; background: var(--c-lowest); border-radius: .5rem; padding: .5rem .75rem; font-size: .9rem; }
.checks .ms { color: var(--pine); }
.checks li.bad .ms { color: var(--error); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1rem; }
.stat { background: var(--c-lowest); border-radius: .75rem; padding: .75rem; text-align: center; }
.stat b { display: block; font: 700 1.6rem/1.2 var(--serif); color: var(--primary); }
.stat span { font-size: .8rem; color: var(--muted); }

/* Reveal */
.gift-circle {
  width: 84px; height: 84px; border-radius: 50%; position: relative;
  background: var(--c-low); color: var(--primary);
  display: grid; place-items: center; margin-bottom: 1rem;
  box-shadow: inset 0 2px 6px rgba(45, 30, 8, .08);
}
.gift-circle .ms { font-size: 44px; }
.gift-circle .spark { position: absolute; top: -4px; right: -6px; font-size: 22px; color: var(--gold); animation: bounce 1.6s infinite; }
.reveal-strip { position: absolute; inset: 0 0 auto; height: 8px; background: linear-gradient(90deg, var(--gold-bright), var(--gold), var(--pine)); }
.eyebrow { color: var(--gold); font-weight: 700; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; margin: 1rem 0 .5rem; }
.name-box {
  width: 100%; background: var(--c-low); border-radius: 1rem; padding: 1.25rem 1rem; margin: .5rem 0 1rem;
  box-shadow: 0 0 0 1px #d4af37, 0 8px 24px -2px rgba(212, 175, 55, .25);
}
.recipient { font: 700 2.4rem/1.15 var(--serif); color: var(--primary); overflow-wrap: anywhere; animation: pop .9s cubic-bezier(.2, 1.4, .4, 1) both; }
.budget-row { width: 100%; display: flex; align-items: center; gap: .75rem; background: var(--c); border-radius: .75rem; padding: .9rem 1rem; text-align: left; margin-bottom: .75rem; }
.budget-row .avatar { width: 38px; height: 38px; }
.budget-row small { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.budget-row b { color: var(--primary); }
.state-in { animation: fadeUp .5s ease-out both; }
.suspense-gift { width: 120px; height: 120px; margin: 1rem 0 1.5rem; }
.suspense-gift .ms { font-size: 64px; }
.suspense-gift.l1 { animation: shake .5s ease-in-out infinite; }
.suspense-gift.l2 { animation: shake .25s ease-in-out infinite; box-shadow: 0 0 0 6px rgba(254, 206, 87, .35); }
.suspense-gift.l3 { animation: shake .12s linear infinite; box-shadow: 0 0 0 12px rgba(254, 206, 87, .5), 0 0 40px rgba(254, 206, 87, .8); }
.suspense-gift.burst { animation: burst .45s ease-in forwards; }
.suspense-text { font: 600 1.35rem/1.3 var(--serif); color: var(--primary); min-height: 2.6em; margin: 0 0 1rem; }
.suspense-text.count { font-size: 3.2rem; color: var(--gold); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.suspense-bar { width: 100%; height: 8px; background: var(--c); border-radius: 999px; overflow: hidden; }
.suspense-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-bright), var(--gold), var(--pine)); transition: width 4.6s cubic-bezier(.5, 0, .9, .6); }
.suspense-bar.go span { width: 100%; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-9deg) scale(1.03); }
  75% { transform: rotate(9deg) scale(1.03); }
}
@keyframes burst { to { transform: scale(1.8); opacity: 0; } }
.footer { text-align: center; font-size: .8rem; color: var(--outline); }
.footer b { color: var(--gold); }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti span { position: absolute; top: -24px; animation: fall linear forwards; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: var(--pine); color: #fff; padding: .7rem 1.2rem; border-radius: 999px;
  font-weight: 600; box-shadow: var(--shadow); z-index: 60; animation: fadeUp .25s ease-out both;
}

@keyframes pop { 0% { opacity: 0; transform: scale(.5); } 100% { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translate(var(--tx, 0), 10px); } to { opacity: 1; transform: translate(var(--tx, 0), 0); } }
.toast { --tx: -50%; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}
@media (max-width: 520px) {
  h1 { font-size: 1.7rem; }
  .card { padding: 1.25rem; border-radius: 1.25rem; }
  .edit-grid { grid-template-columns: 1fr; }
  .recipient { font-size: 2rem; }
}
