:root {
  --bg: #131315;
  --card: #1c1c1f;
  --card-dim: #18181a;
  --well: #26262a;
  --well-dim: #202024;
  --line: rgba(255, 255, 255, 0.08);
  --line-dim: rgba(255, 255, 255, 0.05);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f3ee;
  --text-dim: #a9a7a0;
  --muted: #8e8c86;
  --faint: #6e6c66;
  --gold: #c9a45c;
  --gold-tint: rgba(201, 164, 92, 0.1);
  --gold-line: rgba(201, 164, 92, 0.35);
  --bday: #ed93b1;
  --bday-line: #d4537e;
  --bday-tint: rgba(212, 83, 126, 0.15);
  --xmas: #85b7eb;
  --xmas-tint: rgba(55, 138, 221, 0.15);
  --danger: #e24b4a;
  --danger-line: rgba(226, 75, 74, 0.4);
  --radius: 12px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.125rem 4rem;
}

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 6px;
}

.title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.subtitle { font-size: 13px; color: var(--muted); margin: 0; }

.filters { display: flex; gap: 8px; margin-bottom: 1.5rem; }

.pill {
  font: 500 13px/1 inherit;
  font-family: inherit;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  border: 0.5px solid var(--line-strong);
  cursor: pointer;
}

.pill.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.list { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1.125rem;
}

.card.claimed { background: var(--card-dim); border-color: var(--line-dim); }
.card.mine { border-color: var(--gold-line); }

.card-row { display: flex; gap: 14px; align-items: flex-start; }

.thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background: var(--well);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
  overflow: hidden;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card.claimed .thumb { background: var(--well-dim); color: var(--muted); opacity: 0.6; }

.card-main { flex: 1; min-width: 0; }

.card-title { font-size: 15px; font-weight: 500; margin: 0 0 3px; }
.card.claimed .card-title { color: var(--text-dim); }

.card-link { font-size: 13px; color: var(--muted); margin: 0; }
.card-link a { color: inherit; text-decoration: none; }
.card-link a:hover { color: var(--text-dim); }
.card.claimed .card-link { color: var(--faint); }

.price { font-size: 15px; font-weight: 500; white-space: nowrap; }
.card.claimed .price { color: var(--faint); font-weight: 400; text-decoration: line-through; }

.claim-btn {
  width: 100%;
  margin-top: 14px;
  font: 500 14px/1 inherit;
  font-family: inherit;
  padding: 11px;
  border-radius: 10px;
  background: transparent;
  color: var(--gold);
  border: 0.5px solid var(--gold);
  cursor: pointer;
}

.claim-btn:hover { background: var(--gold-tint); }

.claim-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 12px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
}

.card.mine .claim-state { background: var(--gold-tint); color: var(--gold); }
.claim-state .who { flex: 1; }
.card:not(.mine) .claim-state .who { color: var(--text); }
.card.claimed:not(.mine) .claim-state .who { color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-bday { background: var(--bday-tint); color: var(--bday); }
.badge-xmas { background: var(--xmas-tint); color: var(--xmas); }

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--gold);
  flex-shrink: 0;
}

.ico { width: 16px; height: 16px; flex-shrink: 0; }
.ico-lg { width: 22px; height: 22px; display: block; margin: 0 auto 6px; }
.thumb .ico { width: 26px; height: 26px; }

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  border: 0.5px solid var(--line-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover { color: var(--text); border-color: var(--text-dim); }
.icon-btn.danger { color: var(--danger); border-color: var(--danger-line); }
.icon-btn.bare { border: none; width: 26px; height: 26px; }
.card-actions { display: flex; gap: 6px; }

.btn {
  font: 500 14px/1 inherit;
  font-family: inherit;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-gold { background: var(--gold); color: var(--bg); }
.btn-gold:hover { background: #d4b370; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-block { width: 100%; }
.btn-block + .btn-block { margin-top: 8px; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

.status {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--card);
  border: 0.5px solid var(--line);
  color: var(--text-dim);
  margin: 0 0 1rem;
}

.status.error { border-color: var(--danger-line); color: var(--danger); }

.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 3rem 0; }

.hidden { display: none !important; }

.dialog {
  background: var(--card);
  color: var(--text);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  width: min(320px, calc(100vw - 2rem));
}

.dialog::backdrop { background: rgba(0, 0, 0, 0.55); }

.dialog-item { display: flex; gap: 12px; align-items: center; margin-bottom: 1.25rem; }
.dialog-item .thumb { width: 48px; height: 48px; }
.dialog-item p { margin: 0; }
.dialog-item .name { font-size: 15px; font-weight: 500; }
.dialog-item .sub { font-size: 13px; color: var(--muted); }

.dialog-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 1.25rem;
}

.dialog-question { font-size: 14px; margin: 0 0 10px; }

.occasion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1.25rem;
}

.occasion {
  font: 500 13px/1.2 inherit;
  font-family: inherit;
  padding: 14px 8px;
  border-radius: var(--radius);
  background: transparent;
  border: 0.5px solid var(--line-strong);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}

.occasion-bday.selected { background: var(--bday-tint); border: 1.5px solid var(--bday-line); color: var(--bday); }
.occasion-xmas.selected { background: var(--xmas-tint); border: 1.5px solid var(--xmas); color: var(--xmas); }

.dialog-hint { font-size: 12px; color: var(--faint); text-align: center; margin: 10px 0 0; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field small { color: var(--faint); }

.field input {
  width: 100%;
  font: 400 15px/1 inherit;
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 0.5px solid var(--line-strong);
  color: var(--text);
}

.field input:focus { outline: none; border-color: var(--gold); }

.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.25rem; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .card { transition: border-color 0.15s ease; }
}
