:root {
  --bg: #f6f1e7;
  --paper: #fffdf8;
  --ink: #1f2a24;
  --muted: #6b726c;
  --line: #e3dccd;
  --pine: #1e4d3a;
  --pine-soft: #e3ece6;
  --berry: #b3263e;
  --berry-soft: #f6e1e4;
  --gold: #c99a3b;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(31 42 36 / 0.06), 0 8px 24px rgb(31 42 36 / 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Inter", system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 32px 16px 64px; }

header { text-align: center; margin-bottom: 28px; }
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--berry);
}
h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600; font-size: clamp(32px, 9vw, 44px); line-height: 1.05;
  margin: 8px 0 10px; letter-spacing: -0.02em;
}
.sub { color: var(--muted); margin: 0; }

.progress {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; margin: 0 auto 24px; width: fit-content; font-size: 14px;
}
.dots { display: flex; gap: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--pine); }

.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.panel h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 22px; margin: 0 0 4px; }
.panel p.hint { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.tag {
  position: relative;
  appearance: none; border: 1px solid var(--line); background: var(--paper);
  border-radius: 12px; padding: 16px 12px 16px 30px; text-align: left;
  font: 600 17px/1.2 "Inter", system-ui, sans-serif; color: var(--ink);
  cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  animation: pop 0.25s ease both;
}
.tag::before {
  content: ""; position: absolute; left: 12px; top: 50%; translate: 0 -50%;
  width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--gold);
}
.tag:hover { border-color: var(--pine); background: var(--pine-soft); }
.tag:active { transform: scale(0.97); }
.tag:disabled { cursor: default; color: var(--muted); background: transparent; }
.tag:disabled::before { border-color: var(--line); }
.tag:disabled:hover { border-color: var(--line); }
.tag small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); text-decoration: none; margin-top: 2px; }

.leaving { animation: leave 0.35s ease forwards; }

@keyframes pop { from { opacity: 0; transform: translateY(4px); } }
@keyframes leave { to { opacity: 0; transform: scale(0.85); } }

.reveal { text-align: center; padding: 36px 20px; }
.reveal .label { color: var(--muted); font-size: 14px; letter-spacing: 0.04em; }
.reveal .who {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: clamp(44px, 14vw, 64px); line-height: 1; color: var(--berry);
  margin: 10px 0 14px; animation: rise 0.6s cubic-bezier(.2,.8,.2,1) both;
}
.reveal .note { color: var(--muted); font-size: 14px; margin: 0; }
.gift { font-size: 44px; animation: wiggle 0.8s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 60% { transform: rotate(8deg); } }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.chip {
  font-size: 13px; padding: 4px 10px; border-radius: 999px;
  background: var(--pine-soft); color: var(--pine); font-weight: 600;
}

.btn {
  appearance: none; border: 0; border-radius: 10px; padding: 12px 18px;
  font: 600 15px "Inter", system-ui, sans-serif; cursor: pointer;
}
.btn.primary { background: var(--berry); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.small { padding: 6px 10px; font-size: 13px; }

dialog {
  border: 0; border-radius: var(--radius); padding: 24px; width: min(92vw, 380px);
  background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / 0.25); text-align: center;
}
dialog::backdrop { background: rgb(31 42 36 / 0.45); }
dialog h3 { font-family: "Fraunces", Georgia, serif; font-size: 24px; margin: 0 0 6px; }
dialog p { color: var(--muted); margin: 0 0 20px; }
dialog .actions { display: flex; gap: 10px; justify-content: center; }

.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.toast.show { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 12px 0; }
footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 28px; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
td, th { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
td.dim { color: var(--muted); }
input[type=password] {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; margin-bottom: 12px;
}

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