/* Secret Santa: phone-first, one column. Wider screens get the same column, centred. */

:root {
  --bg: #f7f1e6;
  --card: #fffdf8;
  --ink: #1d2a24;
  --muted: #5d6b64;
  --line: #e2d8c6;
  --green: #1f5c43;
  --green-ink: #ffffff;
  --red: #a3241d;
  --soft: #eef4ef;
  --warn-bg: #fdf1df;
  --warn-ink: #7a4a00;
  --radius: 14px;
  --tap: 46px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101a16;
    --card: #18251f;
    --ink: #edf2ee;
    --muted: #a4b3ab;
    --line: #2b3b33;
    --green: #3f9a72;
    --green-ink: #06140e;
    --red: #f08b83;
    --soft: #1f3028;
    --warn-bg: #33270f;
    --warn-ink: #f3cf8b;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.page {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1rem 1rem calc(5rem + env(safe-area-inset-bottom));
}

.loading {
  color: var(--muted);
  text-align: center;
  padding-top: 3rem;
}

.masthead {
  text-align: center;
  padding: 1.25rem 0 0.5rem;
}

/* The painting's night sky shows in the banner's box until the file arrives. */
.masthead .banner {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #14213d;
  margin-bottom: 0.9rem;
}

.spot {
  display: block;
  height: 6.5rem;
  width: auto;
  margin: 0 auto 0.6rem;
}

.card.with-art {
  text-align: center;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0.4rem 0 0.2rem;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
}

p {
  margin: 0 0 0.75rem;
}

.sub {
  color: var(--muted);
  margin: 0;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.card > :last-child {
  margin-bottom: 0;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.9rem;
  margin: 0;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.reveal {
  border-color: var(--green);
  text-align: center;
}

.reveal .label {
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.reveal .who {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--green);
  margin-bottom: 0.9rem;
  overflow-wrap: anywhere;
}

.wishlist {
  text-align: left;
  background: var(--soft);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wishlist.empty {
  color: var(--muted);
}

.reveal .wishlist {
  margin-bottom: 0.6rem;
}

.reveal button {
  margin: 0.2rem 0 0.7rem;
}

.card > .row {
  margin-bottom: 0.6rem;
}

a {
  color: var(--green);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.field {
  margin-bottom: 0.85rem;
}

input[type="text"],
textarea,
select {
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

textarea.short {
  min-height: 5.5rem;
}

:is(input, textarea, select, button, a):focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

button {
  min-height: var(--tap);
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--green-ink);
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 10px;
  cursor: pointer;
}

button.quiet {
  color: var(--green);
  background: transparent;
  border-color: var(--line);
}

button.danger {
  color: var(--red);
  background: transparent;
  border-color: var(--red);
}

button.wide {
  width: 100%;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.row.between {
  justify-content: space-between;
}

.count {
  color: var(--muted);
  font-size: 0.9rem;
}

.people,
.pairs {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.people li,
.pairs li {
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}

.people li:first-child,
.pairs li:first-child {
  border-top: 0;
  padding-top: 0;
}

.person-name {
  font-weight: 700;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.3rem 0 0.6rem;
}

.chip {
  font-size: 0.82rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
}

.chip.off {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.people button,
.pairs button {
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  font-size: 0.92rem;
}

.pairs li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.pair-pick {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 30rem) {
  .pair-pick {
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
  }
}

.note {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 6px 24px rgb(0 0 0 / 25%);
  z-index: 10;
}

.toast.bad {
  background: var(--red);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .toast.bad {
    color: #1a0b0a;
  }
}

[hidden] {
  display: none !important;
}
