:root {
  color-scheme: dark;
  --pine: #0b1f1a;
  --pine-2: #12302a;
  --card: #163a32;
  --card-edge: rgba(244, 226, 187, .14);
  --cream: #f8f1e1;
  --muted: #b6c4b6;
  --gold: #e8c170;
  --gold-deep: #c99a45;
  --berry: #d9534f;
  --serif: ui-serif, "New York", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(70rem 36rem at 85% -10%, rgba(232, 193, 112, .17), transparent 60%),
    radial-gradient(60rem 40rem at -10% 10%, rgba(44, 122, 96, .35), transparent 60%),
    var(--pine);
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }

.snow {
  position: fixed;
  inset: -100vh 0 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 140px, #fff, transparent),
    radial-gradient(2px 2px at 170px 60px, #fff, transparent),
    radial-gradient(1px 1px at 240px 200px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 310px 110px, #fff, transparent);
  background-size: 360px 260px;
  animation: fall 26s linear infinite;
}
@keyframes fall { to { transform: translateY(100vh); } }
@media (prefers-reduced-motion: reduce) { .snow { animation: none; } }

.eyebrow {
  margin: 0 0 .4rem;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.star {
  display: inline-block;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--gold);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
}
.error { color: #ffb4a8; margin: .75rem 0 0; }

/* Sign in */
.signin {
  position: relative;
  max-width: 34rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.signin h1 { font-size: clamp(2.3rem, 7vw, 3.5rem); line-height: 1.06; margin: .25rem 0 1rem; }
.lede { color: var(--muted); font-size: 1.1rem; line-height: 1.5; margin: 0 0 2rem; }
.apple-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 3rem;
  padding: 0 1.75rem;
  border-radius: .75rem;
  background: #fff;
  color: #000;
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: none;
}
.apple-button svg { width: 1rem; height: 1.2rem; }
.fineprint { color: var(--muted); font-size: .85rem; margin-top: 2rem; }

/* App */
.app {
  position: relative;
  max-width: 76rem;
  margin: 0 auto;
  padding: max(2rem, env(safe-area-inset-top)) 1rem 4rem;
}
@media (min-width: 700px) { .app { padding-inline: 2rem; } }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.top h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0; }

.top-actions { display: flex; align-items: center; gap: .5rem; }
.share-button {
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border: 1px solid var(--gold);
  border-radius: 99px;
  background: none;
  color: var(--gold);
  font: 600 .95rem var(--sans);
  cursor: pointer;
}
.dialog-copy { color: var(--muted); line-height: 1.45; margin: 0 0 1rem; }
#share-url { margin-bottom: 1rem; }
.shared-grid { margin-top: 1.5rem; }
.shared-empty { padding: 5rem 1rem; text-align: center; color: var(--muted); }
.menu { position: relative; }
.menu summary {
  list-style: none;
  cursor: pointer;
  width: 2.75rem;
  height: 2.75rem;
  line-height: 2.6rem;
  text-align: center;
  font-size: 1.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute;
  right: 0;
  top: 3.2rem;
  z-index: 5;
  min-width: 12rem;
  padding: .4rem;
  border: 1px solid var(--card-edge);
  border-radius: .9rem;
  background: var(--pine-2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.menu-panel button, .menu-panel a {
  display: block;
  width: 100%;
  padding: .65rem .75rem;
  border: 0;
  border-radius: .55rem;
  background: none;
  color: var(--cream);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-panel button:hover, .menu-panel a:hover { background: rgba(255, 255, 255, .07); }
.danger { color: #ffb4a8 !important; }

.add {
  display: flex;
  gap: .5rem;
  margin-top: 1.5rem;
  padding: .4rem;
  border: 1px solid var(--card-edge);
  border-radius: 1rem;
  background: rgba(255, 255, 255, .06);
}
.add:focus-within { border-color: var(--gold); }
.add input {
  flex: 1;
  min-width: 0;
  padding: 0 .75rem;
  border: 0;
  outline: 0;
  background: none;
  color: var(--cream);
  font-size: 1rem;
}
.add input::placeholder { color: var(--muted); }
.add button, .primary {
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border: 0;
  border-radius: .7rem;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #231a08;
  font: 600 .95rem var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.add button:disabled { opacity: .6; cursor: progress; }

.filters { display: flex; gap: .4rem; margin: 1.25rem 0; overflow-x: auto; }
.filters button {
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--card-edge);
  border-radius: 99px;
  background: none;
  color: var(--muted);
  font: 500 .9rem var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.filters button.active { background: var(--cream); border-color: var(--cream); color: var(--pine); }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
}
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; } }

.wish {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--card-edge);
  border-radius: 1.1rem;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  transition: transform .18s ease, box-shadow .18s ease;
  animation: rise .35s ease;
}
.wish:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0, 0, 0, .34); }
@keyframes rise { from { transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .wish { animation: none; transition: none; } }

.wish.bought .photo { background: var(--pine-2); }
.wish.bought .photo img, .wish.bought .photo .placeholder { filter: grayscale(.8); opacity: .55; }
.wish.bought .wish-title { color: var(--muted); }

.photo {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: #fbf8f1;
}
.photo img { width: 100%; height: 100%; object-fit: contain; display: block; padding: .6rem; }
.placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1d4a3f, #12302a);
}
.ribbon {
  position: absolute;
  top: .6rem;
  left: .6rem;
  padding: .25rem .55rem;
  border-radius: 99px;
  background: var(--berry);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}
.wish-body { display: flex; flex: 1; flex-direction: column; gap: .3rem; padding: .8rem; }
.wish-store { color: var(--muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wish-title {
  margin: 0;
  font: 600 1rem/1.25 var(--serif);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.wish-note { color: var(--muted); font-size: .82rem; margin: 0; overflow-wrap: anywhere; }
.wish-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .15rem; margin-top: auto; padding-top: .4rem; }
.wish-price { flex: 1 0 100%; min-height: 1.3em; color: var(--gold); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon {
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 1.05rem;
  cursor: pointer;
}
.icon:hover { background: rgba(255, 255, 255, .08); color: var(--cream); }
.icon.on { color: var(--gold); }

.empty { padding: 4rem 1rem; text-align: center; }
.empty h2 { font-size: 1.7rem; margin: .5rem 0; }
.empty p { color: var(--muted); margin: 0; }

dialog {
  width: min(28rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--card-edge);
  border-radius: 1.2rem;
  background: var(--pine-2);
  color: var(--cream);
}
dialog::backdrop { background: rgba(3, 10, 8, .65); backdrop-filter: blur(4px); }
dialog h2 { margin: 0 0 1rem; }
dialog label { display: block; margin-bottom: .8rem; color: var(--muted); font-size: .85rem; }
dialog input, dialog textarea {
  display: block;
  width: 100%;
  margin-top: .3rem;
  padding: .65rem .75rem;
  border: 1px solid var(--card-edge);
  border-radius: .65rem;
  background: rgba(255, 255, 255, .06);
  color: var(--cream);
  font: 1rem var(--sans);
}
.editor-actions { display: flex; align-items: center; gap: .4rem; }
.editor-actions span { flex: 1; }
.editor-actions .danger, .quiet {
  min-height: 2.75rem;
  padding: 0 .8rem;
  border: 0;
  background: none;
  color: var(--cream);
  font: 500 .95rem var(--sans);
  cursor: pointer;
}

/* Privacy and support pages */
.doc { position: relative; max-width: 42rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; line-height: 1.6; }
.doc h1 { font-size: 2.4rem; margin: 0 0 1rem; }
.doc h2 { margin-top: 2rem; }
.doc p, .doc li { color: #dfe6da; }
