:root {
  --cream: #faf5ec;
  --paper: #fffdf7;
  --ink: #33302a;
  --muted: #7a6f5f;
  --terra: #b85c38;
  --terra-dark: #96482b;
  --olive: #606c38;
  --sage: #a3b18a;
  --sage-light: #dde5cf;
  --sand: #ede4d3;
  --line: rgba(96, 108, 56, 0.18);
  --shadow: 0 10px 30px -18px rgba(51, 48, 42, 0.45);
  --serif: "Fraunces", Georgia, serif;
  --body: "Lora", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }

a { color: var(--terra); }

/* ---------- banner + toast ---------- */

.banner {
  max-width: 680px;
  margin: 20px auto 0;
  padding: 14px 22px;
  background: var(--sage-light);
  border: 1px solid var(--sage);
  border-radius: 14px;
  text-align: center;
}

.banner.warn { background: #f6e3d3; border-color: var(--terra); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  z-index: 60;
  max-width: min(92vw, 560px);
  text-align: center;
}

.toast.err { background: var(--terra-dark); }

/* ---------- hero ---------- */

.hero {
  text-align: center;
  padding: 72px 20px 28px;
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 12px;
  color: var(--olive);
  margin: 0 0 18px;
}

.names {
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 1.1;
  font-weight: 700;
}

.names .amp { font-style: italic; font-weight: 500; color: var(--terra); }

.when { font-size: 19px; margin: 18px 0 0; color: var(--ink); }
.when .dot { color: var(--terra); }

.countdown {
  display: inline-block;
  margin: 14px 0 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 14px;
  color: var(--olive);
}

.intro { max-width: 560px; margin: 22px auto 0; color: var(--muted); font-style: italic; }

.sprig { display: block; margin: 34px auto 0; width: 200px; }
.sprig.small { width: 130px; opacity: 0.85; margin-top: 0; }

/* ---------- layout ---------- */

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }

.section-title { font-size: 2rem; text-align: center; margin: 56px 0 6px; }

.section-hint { text-align: center; color: var(--muted); margin: 0 0 28px; }

/* ---------- cash fund ---------- */

.cash-funds { display: grid; gap: 28px; }

.cash-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px clamp(20px, 5vw, 48px);
  box-shadow: var(--shadow);
  text-align: center;
}

.cash-card h2 { font-size: 1.7rem; }

.cash-card .cash-desc { color: var(--muted); max-width: 520px; margin: 8px auto 22px; }

.progress {
  height: 12px;
  background: var(--sand);
  border-radius: 999px;
  overflow: hidden;
  max-width: 520px;
  margin: 0 auto;
}

.progress .bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--olive), var(--sage));
  transition: width 0.6s ease;
}

.raised { font-size: 15px; color: var(--olive); margin: 10px 0 26px; }
.raised strong { font-family: var(--serif); font-size: 17px; }

.amount-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 18px; }

.chip {
  font-family: var(--body);
  font-size: 16px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover { border-color: var(--olive); }

.chip.active { background: var(--olive); border-color: var(--olive); color: var(--cream); }

.custom-amount {
  max-width: 200px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-amount span { color: var(--muted); }

.custom-amount input {
  width: 110px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  font-family: var(--body);
  font-size: 16px;
}

.cash-fields { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 20px; }

.cash-fields input {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  font-family: var(--body);
  font-size: 16px;
}

.messages { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 10px; }

.messages li {
  font-style: italic;
  color: var(--muted);
  font-size: 15px;
}

.messages li::before { content: "“"; color: var(--terra); }
.messages li::after { content: "”"; color: var(--terra); }
.messages .msg-name { font-style: normal; color: var(--olive); }

/* ---------- gift grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.gift {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.gift-img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--sage-light), var(--sand));
  display: flex;
  align-items: center;
  justify-content: center;
}

.gift-img img { width: 100%; height: 100%; object-fit: cover; }

.gift-img .placeholder-emoji { font-size: 52px; filter: saturate(0.75); }

.gift-img .cat-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid var(--line);
  color: var(--olive);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
}

.gifted-badge {
  position: absolute;
  inset: 0;
  background: rgba(163, 177, 138, 0.82);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.gifted-badge small { font-family: var(--body); font-size: 14px; font-style: italic; }

.gift-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }

.gift-body h3 { font-size: 1.2rem; margin-bottom: 4px; }

.gift-body .desc { color: var(--muted); font-size: 15px; flex: 1; margin: 4px 0 14px; }

.gift-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.price { font-family: var(--serif); font-size: 1.15rem; color: var(--terra); white-space: nowrap; }

.store-link { font-size: 14px; text-decoration: none; border-bottom: 1px dotted var(--terra); }
.store-link:hover { color: var(--terra-dark); }

.gift .btn { width: 100%; margin-top: 12px; }

/* ---------- buttons ---------- */

.btn {
  font-family: var(--body);
  font-size: 16px;
  background: var(--terra);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 11px 26px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease;
}

.btn:hover { background: var(--terra-dark); }

.btn:disabled { opacity: 0.55; cursor: default; }

.btn-outline {
  background: transparent;
  color: var(--olive);
  border: 1.5px solid var(--olive);
}

.btn-outline:hover { background: var(--sage-light); }

.btn-sm { padding: 7px 16px; font-size: 14px; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn-ghost:hover { background: var(--sand); }

/* ---------- dialogs ---------- */

.dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  padding: 30px clamp(22px, 5vw, 38px);
  max-width: 480px;
  width: calc(100vw - 40px);
  box-shadow: 0 24px 70px -20px rgba(51, 48, 42, 0.5);
}

.dialog::backdrop { background: rgba(51, 48, 42, 0.5); backdrop-filter: blur(3px); }

.dialog h3 { font-size: 1.45rem; margin-bottom: 4px; }

.dialog-sub { color: var(--muted); font-size: 15px; margin: 0 0 18px; }

.dialog label { display: block; font-size: 14px; color: var(--olive); margin-bottom: 14px; }

.dialog input, .dialog textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
}

.dialog input:focus, .dialog textarea:focus { outline: 2px solid var(--sage); border-color: var(--sage); }

.opt { color: var(--muted); font-weight: 400; font-style: italic; }

.dialog menu { display: flex; justify-content: flex-end; gap: 12px; margin: 20px 0 0; padding: 0; }

.qr-dialog { text-align: center; }

.qr-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: inline-block;
  margin: 6px 0 16px;
}

.qr-box svg { display: block; width: 220px; height: 220px; }

.qr-link { margin-bottom: 12px; }

.qr-wait { font-size: 14px; color: var(--muted); font-style: italic; }
.qr-wait.done { color: var(--olive); font-style: normal; font-weight: 500; }

/* ---------- footer ---------- */

.footer { text-align: center; padding: 30px 20px 48px; color: var(--muted); }
.footer p { margin: 8px 0 0; }
.admin-link { font-size: 13px; }
.admin-link a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--muted); }

/* ---------- admin ---------- */

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 20px;
}

.admin-top h1 { font-size: 1.5rem; }

.admin-top nav { display: flex; align-items: center; gap: 16px; }

.admin-main { max-width: 1080px; margin: 0 auto; padding: 0 20px 64px; display: grid; gap: 24px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px clamp(18px, 4vw, 34px);
  box-shadow: var(--shadow);
}

.card h2 { font-size: 1.35rem; margin-bottom: 18px; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-head h2 { margin: 0; }

.login-card { max-width: 420px; margin: 8vh auto 0; }

.login-card label { display: block; font-size: 14px; color: var(--olive); margin-bottom: 16px; }

.login-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  font-family: var(--body);
  font-size: 16px;
}

.err { color: var(--terra-dark); font-size: 14px; margin: 0 0 12px; }
.saved { color: var(--olive); font-size: 14px; margin-left: 10px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }

.settings-grid label { display: block; font-size: 13px; color: var(--olive); }

.settings-grid input, .settings-grid textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  font-family: var(--body);
  font-size: 15px;
}

.span2 { grid-column: span 2; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }

.form-grid label { display: block; font-size: 13px; color: var(--olive); }

.form-grid input, .form-grid textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  font-family: var(--body);
  font-size: 15px;
}

.form-grid .check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); }
.form-grid .check input { width: auto; margin: 0; }

.table-wrap { overflow-x: auto; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; }

.admin-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--olive);
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--line);
}

.admin-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

.admin-table tr:last-child td { border-bottom: none; }

.status-pill {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill.completed { background: var(--sage-light); color: var(--olive); }
.status-pill.pending { background: #f6e3d3; color: var(--terra-dark); }
.status-pill.refunded { background: var(--sand); color: var(--muted); }

.muted { color: var(--muted); font-size: 13px; }
.nowrap { white-space: nowrap; }

@media (max-width: 640px) {
  .settings-grid, .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
  .gift-foot { flex-wrap: wrap; }
}
