/* Family Secret Santa — warm cream, deep green, cranberry, gold. Phone-first. */
:root {
  --cream: #FBF6EE;
  --ink: #2B2620;
  --green: #14532D;
  --green-soft: #1F6F43;
  --cranberry: #A61C3C;
  --gold: #D9A441;
  --card: #FFFDF8;
  --line: #E8DCC8;
  --muted: #7A6F60;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}
#app { max-width: 560px; margin: 0 auto; padding: 0 14px; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.error { color: var(--cranberry); min-height: 1.2em; }
.big-text { font-size: 1.15em; font-weight: 600; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 2px 8px;
}
.topbar .title { font-size: 1.35em; font-weight: 800; color: var(--green); }
.whoami { font-size: 0.9em; color: var(--muted); text-align: right; }
.whoami button { margin-left: 6px; }

h2 { color: var(--green); margin: 14px 0 10px; }
h3 { margin: 4px 0 8px; color: var(--green); }

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 2px 8px rgba(43, 38, 32, 0.05);
}
.card.mission { border-color: var(--gold); background: #FFF9EA; }
.steps { margin: 10px 0 2px; padding-left: 22px; }
.steps li { margin: 6px 0; }

.countdowns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.countdown { text-align: center; margin: 0; }
.cd-num { font-size: 3em; font-weight: 900; color: var(--cranberry); line-height: 1; }
.cd-num.small { font-size: 2.2em; color: var(--green-soft); }
.cd-label { font-size: 0.9em; color: var(--muted); margin-top: 6px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-card { margin: 0; display: flex; flex-direction: column; }
.mini-card p { flex: 1; }
@media (max-width: 420px) { .grid2, .countdowns { grid-template-columns: 1fr; } }

.rules { list-style: none; padding: 0; margin: 0; }
.rules li { padding: 7px 0 7px 28px; position: relative; border-bottom: 1px dashed var(--line); }
.rules li:last-child { border-bottom: none; }
.rules li::before { content: "🎄"; position: absolute; left: 0; }

.top3, .leaderboard { list-style: none; padding: 0; margin: 0; }
.top3 li, .leaderboard li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 4px; border-bottom: 1px dashed var(--line);
}
.top3 li:last-child, .leaderboard li:last-child { border-bottom: none; }
.lb-name { font-weight: 700; }
.lb-meta { color: var(--muted); font-size: 0.85em; }
.lb-points { font-weight: 800; color: var(--cranberry); }
.today-dot { color: var(--green-soft); font-size: 0.8em; font-weight: 700; }

button {
  font: inherit; cursor: pointer; border-radius: 999px;
  border: 2px solid var(--green); background: transparent; color: var(--green);
  padding: 10px 18px; font-weight: 700;
}
button.primary { background: var(--green); color: #fff; border-color: var(--green); }
button.primary:disabled { opacity: 0.45; cursor: not-allowed; }
button.big { width: 100%; padding: 14px; font-size: 1.05em; margin-top: 8px; }
button.ghost { border-color: var(--line); color: var(--muted); }
button.danger { background: var(--cranberry); border-color: var(--cranberry); color: #fff; }
button.link { border: none; padding: 2px 6px; color: var(--green-soft); }
button:active { transform: scale(0.98); }

input[type="text"], input[type="password"], textarea {
  font: inherit; width: 100%; padding: 12px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  margin: 6px 0;
}
textarea { min-height: 64px; resize: vertical; }
label.q { display: block; margin: 14px 0 2px; font-weight: 700; color: var(--green); }
label.check { display: flex; gap: 10px; align-items: center; margin: 10px 0; font-weight: 600; }
label.check input { width: 22px; height: 22px; accent-color: var(--green); }
.file-btn {
  display: inline-block; background: var(--gold); color: var(--ink);
  padding: 12px 20px; border-radius: 999px; font-weight: 800; cursor: pointer;
}

.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.name-grid button { padding: 14px 8px; font-size: 1.05em; background: #fff; }
.name-grid button.claimed { opacity: 0.55; }
.pin-row { display: flex; gap: 10px; align-items: stretch; }
.pin-row input { flex: 1; text-align: center; font-size: 1.3em; letter-spacing: 0.4em; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--green); display: flex; justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); z-index: 10;
}
.tabbar .tab {
  background: transparent; border: none; color: #DCEBDD;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 1.25em; padding: 4px 8px;
}
.tabbar .tab span { font-size: 0.5em; font-weight: 700; }
.tabbar .tab.active { color: #fff; background: rgba(255,255,255,0.15); }

.post { margin: 14px 0; }
.post img { width: 100%; border-radius: 12px; display: block; }
.post .post-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9em; }
.post .caption { margin: 8px 0; }
.post .prompt-line { color: var(--green-soft); font-size: 0.9em; font-style: italic; }
.day-head { margin: 20px 0 4px; color: var(--cranberry); }
.like-btn.liked { background: var(--cranberry); border-color: var(--cranberry); color: #fff; }

.dossier {
  border: 3px dashed var(--gold); background: #FFF9EA;
  border-radius: var(--radius); padding: 18px; margin: 12px 0;
}
.dossier .giftee { font-size: 1.6em; font-weight: 900; color: var(--cranberry); text-align: center; }
.dossier dt { font-weight: 700; color: var(--green); margin-top: 12px; }
.dossier dd { margin: 2px 0 0; }
.present { font-size: 4em; text-align: center; padding: 20px 0; cursor: pointer; }

.opt-btn { display: block; width: 100%; text-align: left; margin: 8px 0; background: #fff; }
.opt-btn.right { background: var(--green); color: #fff; border-color: var(--green); }
.opt-btn.wrong { background: var(--cranberry); color: #fff; border-color: var(--cranberry); }
.fact { background: #FFF9EA; border-radius: 12px; padding: 10px 12px; margin-top: 10px; }

.admin-list { list-style: none; padding: 0; margin: 0; }
.admin-list li { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px dashed var(--line); }
.badge { font-size: 0.8em; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.badge.done { background: var(--green); color: #fff; }
.badge.waiting { background: var(--line); color: var(--muted); }
.danger-zone { border-color: var(--cranberry); }
