/* Family Gift Hub — festive but tidy */

:root {
  --pine: #0e3b2c;
  --pine-2: #16533e;
  --holly: #1d7a4c;
  --holly-dark: #135a37;
  --holly-soft: #e2f3e8;
  --berry: #c41e3a;
  --berry-dark: #961530;
  --berry-soft: #fde7ea;
  --gold: #e9b949;
  --gold-dark: #b8862a;
  --gold-soft: #fdf3da;
  --cream: #fbf5ea;
  --paper: #ffffff;
  --ink: #2a1f17;
  --muted: #7a6858;
  --line: #ecdfca;
  --shadow: 0 1px 2px rgba(42, 31, 23, .06), 0 10px 28px rgba(42, 31, 23, .08);
  --radius: 18px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Mountains of Christmas', 'Nunito', cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23ecdcc0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M30 18v24M19.6 24l20.8 12M19.6 36l20.8-12'/%3E%3Cpath d='M118 96v18M109 100.5l18 9M109 109.5l18-9'/%3E%3C/g%3E%3Ccircle cx='86' cy='40' r='2' fill='%23ecdcc0'/%3E%3Ccircle cx='40' cy='120' r='2.5' fill='%23ecdcc0'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
}
a { color: var(--holly); }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }

.boot { min-height: 100vh; display: grid; place-items: center; font-size: 64px; background: var(--pine); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---------- header ---------- */

.topbar {
  position: relative;
  background: radial-gradient(1200px 200px at 50% -60px, #1f6b4f 0%, transparent 70%), linear-gradient(180deg, var(--pine) 0%, var(--pine-2) 100%);
  color: #fff;
  overflow: hidden;
}
.topbar-inner {
  position: relative;
  z-index: 2;
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 20px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  color: var(--gold);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  white-space: nowrap;
}
.logo-tree { font-size: 30px; filter: drop-shadow(0 0 8px rgba(233, 185, 73, .5)); }
.usermenu { display: flex; align-items: center; gap: 8px; }
.me-chip {
  display: flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none; font-weight: 800;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  transition: background .15s;
}
.me-chip:hover { background: rgba(255, 255, 255, .18); }
.btn-ghost-light { background: transparent; color: rgba(255, 255, 255, .85); border: 2px solid rgba(255, 255, 255, .25); }
.btn-ghost-light:hover { border-color: var(--gold); color: #fff; }

.nav {
  position: relative;
  z-index: 2;
  max-width: 1160px;
  margin: 0 auto;
  padding: 10px 20px 0;
  display: flex;
  gap: 4px;
}
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 12px;
  color: rgba(255, 255, 255, .8);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  border-radius: 14px 14px 0 0;
  transition: background .15s, color .15s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.active { background: var(--cream); color: var(--pine); }
.nav-icon { font-size: 18px; }
.label-short { display: none; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--berry); color: #fff;
  font-size: 12px; font-weight: 900; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 2px var(--pine);
}
.nav a.active .badge { box-shadow: 0 0 0 2px var(--cream); }

/* string of lights along the bottom of the header */
.lights {
  position: absolute; left: 0; right: 0; top: 0; z-index: 1;
  height: 30px; display: flex; gap: 22px; padding: 0 12px;
  pointer-events: none; overflow: hidden;
}
.lights::before {
  content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 20px;
  border-bottom: 2px solid rgba(0, 0, 0, .35); border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.lights i {
  position: relative; top: 9px; flex: none;
  width: 9px; height: 14px; border-radius: 50% 50% 45% 45%;
  background: var(--berry); box-shadow: 0 2px 12px 2px var(--berry);
  animation: twinkle 2.2s ease-in-out infinite;
}
.lights i::before { content: ''; position: absolute; top: -4px; left: 2px; width: 5px; height: 5px; background: #2b2b2b; border-radius: 2px; }
.lights i:nth-child(4n+2) { background: var(--gold); box-shadow: 0 2px 12px 2px var(--gold); }
.lights i:nth-child(4n+3) { background: #3fbf7f; box-shadow: 0 2px 12px 2px #3fbf7f; }
.lights i:nth-child(4n+4) { background: #5fa8ff; box-shadow: 0 2px 12px 2px #5fa8ff; }
.page-lights { display: none; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* snow */
.snow { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.snow i { position: absolute; top: -10px; border-radius: 50%; background: #fff; animation: fall linear infinite; }
@keyframes fall { to { transform: translate3d(30px, 110vh, 0); } }

/* ---------- page layout ---------- */

.page { max-width: 1160px; margin: 0 auto; padding: 30px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-family: var(--display); font-size: 44px; line-height: 1.05; color: var(--pine); }
.sub { color: var(--muted); font-weight: 600; margin-top: 4px; max-width: 640px; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); font-weight: 700; font-size: 18px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; padding: 0 20px 40px; }
.stack { display: grid; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 800; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.span-all { grid-column: 1 / -1; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card h2 { font-size: 19px; font-weight: 900; display: flex; align-items: center; gap: 8px; color: var(--pine); }
.card h2 .emoji { font-size: 22px; }
.card-link { font-weight: 800; text-decoration: none; font-size: 14px; white-space: nowrap; }
.card-link:hover { text-decoration: underline; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .big { font-size: 52px; display: block; margin-bottom: 6px; }
.empty h3 { color: var(--ink); font-size: 20px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ---------- buttons, chips, inputs ---------- */

.btn {
  font-weight: 800; font-size: 15px; line-height: 1.2;
  border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none; white-space: nowrap;
  transition: transform .08s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--berry); color: #fff; box-shadow: 0 3px 0 var(--berry-dark); }
.btn-primary:hover { background: #d42644; }
.btn-primary:active { box-shadow: 0 1px 0 var(--berry-dark); }
.btn-green { background: var(--holly); color: #fff; box-shadow: 0 3px 0 var(--holly-dark); }
.btn-green:hover { background: #22895a; }
.btn-green:active { box-shadow: 0 1px 0 var(--holly-dark); }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 3px 0 var(--gold-dark); }
.btn-gold:hover { background: #f0c65e; }
.btn-ghost { background: var(--paper); color: var(--pine); border: 2px solid var(--line); padding: 9px 16px; }
.btn-ghost:hover { border-color: var(--holly); }
.btn-ghost.is-on { border-color: var(--holly); background: var(--holly-soft); }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }
.btn-ghost.btn-sm { padding: 5px 11px; }
.btn-lg { padding: 15px 26px; font-size: 17px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 4px 6px; color: var(--muted); font-weight: 700; font-size: 13.5px; cursor: pointer; border-radius: 8px; }
.link-btn:hover { color: var(--berry); background: var(--berry-soft); }
.icon-btn { background: var(--cream); border: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--muted); }
.icon-btn:hover { background: var(--line); color: var(--ink); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--cream); color: var(--muted); white-space: nowrap;
}
.chip-must { background: var(--berry-soft); color: var(--berry-dark); }
.chip-love { background: var(--gold-soft); color: #87600f; }
.chip-nice { background: var(--holly-soft); color: #165c3a; }
.chip-dark { background: var(--pine); color: var(--gold); }

.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-tabs button, .pill-tabs a {
  border: 2px solid var(--line); background: var(--paper); color: var(--ink);
  font-weight: 800; font-size: 14px; padding: 6px 14px; border-radius: 999px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.pill-tabs .on { border-color: var(--pine); background: var(--pine); color: #fff; }

.field { display: grid; gap: 6px; }
.field > span, .label { font-weight: 800; font-size: 14px; }
.field small { color: var(--muted); font-weight: 600; }
.input, .field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  padding: 10px 13px; border: 2px solid var(--line); border-radius: 12px; background: #fffdf9;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 80px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--holly); box-shadow: 0 0 0 4px rgba(29, 122, 76, .15); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { background: var(--berry-soft); color: var(--berry-dark); font-weight: 700; padding: 10px 14px; border-radius: 12px; margin: 0 22px 12px; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 800; font-size: 14px; background: #fffdf9;
}
.seg input:checked + span { border-color: var(--pine); background: var(--pine); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.person-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.person-pick label { position: relative; }
.person-pick input { position: absolute; opacity: 0; pointer-events: none; }
.person-pick span {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 800; background: #fffdf9;
}
.person-pick input:checked + span { border-color: var(--holly); background: var(--holly-soft); }
.person-pick input:checked + span::after { content: '✓'; color: var(--holly); font-weight: 900; }
.person-pick input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.person-pick input:disabled + span { opacity: .45; cursor: not-allowed; }

.toggle { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--holly); }

/* ---------- avatars ---------- */

.avatar {
  --c: var(--holly);
  width: 40px; height: 40px; flex: none;
  border-radius: 50%; display: inline-grid; place-items: center; font-size: 21px; line-height: 1;
  background: color-mix(in srgb, var(--c) 16%, white);
  border: 2.5px solid var(--c);
}
.avatar-xs { width: 26px; height: 26px; font-size: 14px; border-width: 2px; }
.avatar-sm { width: 32px; height: 32px; font-size: 17px; border-width: 2px; }
.avatar-lg { width: 64px; height: 64px; font-size: 34px; border-width: 3px; }
.avatar-xl { width: 92px; height: 92px; font-size: 50px; border-width: 4px; }
.person { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -8px; }

/* ---------- dashboard ---------- */

.hero {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 28px 30px;
  background: linear-gradient(135deg, var(--berry) 0%, #a5172f 100%);
  color: #fff; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.hero::before { content: ''; position: absolute; top: 0; bottom: 0; right: 150px; width: 26px; background: var(--gold); opacity: .9; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 26px; margin-top: -13px; background: var(--gold); opacity: .9; display: none; }
.hero-text { position: relative; z-index: 1; }
.hero h1 { font-family: var(--display); font-size: 46px; line-height: 1.05; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.hero p { font-weight: 700; opacity: .92; margin-top: 6px; font-size: 17px; }
.hero .hero-alerts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero-alert { background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; font-weight: 800; padding: 7px 14px; border-radius: 999px; font-size: 14px; }
.hero-alert:hover { background: rgba(255, 255, 255, .26); }
button.hero-alert { border: 0; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }

/* ---------- intro video ---------- */

.intro {
  position: fixed; inset: 0; z-index: 300;
  background: radial-gradient(900px 500px at 50% 30%, #16533e 0%, #071a12 100%);
  display: grid; place-items: center; padding: 16px;
  animation: intro-in .35s ease-out;
  transition: opacity .45s ease;
}
.intro.out { opacity: 0; pointer-events: none; }
@keyframes intro-in { from { opacity: 0; } }
.intro-frame { position: relative; width: min(100%, 1280px, calc((100vh - 32px) * 16 / 9)); }
.intro-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 22px; background: #071426; box-shadow: 0 30px 90px rgba(0, 0, 0, .55), 0 0 0 4px rgba(233, 185, 73, .35); }
.intro-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.intro-btn {
  border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff;
  font: inherit; font-weight: 800; font-size: 15px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
}
.intro-btn:hover { border-color: var(--gold); background: rgba(255, 255, 255, .16); }
.intro-play {
  position: absolute; left: 50%; top: calc(50% - 26px); transform: translate(-50%, -50%);
  border: 0; background: var(--berry); color: #fff; font: inherit; font-weight: 900; font-size: 20px;
  padding: 16px 28px; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 0 var(--berry-dark), 0 18px 40px rgba(0, 0, 0, .4);
}
.intro-play:hover { background: #d42644; }

/* medium screens: keep the menu on one line */
@media (min-width: 761px) and (max-width: 1080px) {
  .label-long { display: none; }
  .label-short { display: inline; }
  .nav a { padding: 10px 12px 12px; }
}
.countdown {
  position: relative; z-index: 1;
  background: var(--cream); color: var(--pine); border-radius: 20px; padding: 14px 22px; text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .15); min-width: 150px; margin-right: 60px;
}
.countdown b { display: block; font-size: 52px; font-weight: 900; line-height: 1; color: var(--berry); letter-spacing: -.02em; }
.countdown span { font-weight: 800; font-size: 14px; }
.bow { position: absolute; z-index: 2; right: 120px; top: -6px; font-size: 54px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.2)); }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { flex: 1; min-width: 90px; background: var(--cream); border-radius: 14px; padding: 10px 14px; }
.stat b { display: block; font-size: 24px; font-weight: 900; color: var(--pine); line-height: 1.1; }
.stat span { font-size: 13px; font-weight: 700; color: var(--muted); }

.mini-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--cream); border-radius: 12px; font-weight: 700; font-size: 14.5px; }
.mini-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shop-table { width: 100%; border-collapse: collapse; }
.shop-table td { padding: 10px 8px; border-top: 1px dashed var(--line); vertical-align: middle; }
.shop-table tr:first-child td { border-top: 0; }
.shop-table .gift-name { font-weight: 800; }
.shop-table .num { text-align: right; font-weight: 900; color: var(--holly); white-space: nowrap; }
.shop-table tr.done .gift-name { text-decoration: line-through; color: var(--muted); }
.check { width: 22px; height: 22px; accent-color: var(--holly); cursor: pointer; }
.shop-total { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; background: var(--holly-soft); border-radius: 14px; font-weight: 800; color: var(--holly-dark); }

.people-list { display: grid; gap: 8px; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; }
.person-row:hover { background: var(--cream); }
.person-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.person-row .grow { flex: 1; min-width: 0; }
.person-row .name { font-weight: 800; }
.progress { height: 8px; background: var(--cream); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; border-radius: 999px; background: repeating-linear-gradient(45deg, var(--berry) 0 8px, #e0485f 8px 16px); }

.status-box { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--cream); margin-bottom: 14px; }
.status-box .big { font-size: 40px; line-height: 1; }
.status-box b { display: block; font-size: 17px; }

/* ---------- gift cards ---------- */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.items { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.item {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.item:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(42, 31, 23, .06), 0 16px 34px rgba(42, 31, 23, .12); }
.item::before { content: ''; height: 7px; flex: none; }
.item.p1::before { background: repeating-linear-gradient(-45deg, var(--berry) 0 10px, #fff 10px 20px); }
.item.p2::before { background: repeating-linear-gradient(-45deg, var(--gold) 0 10px, #fff 10px 20px); }
.item.p3::before { background: repeating-linear-gradient(-45deg, var(--holly) 0 10px, #fff 10px 20px); }
.item-img { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(160deg, #fdf8ef, #f6ecda); display: grid; place-items: center; font-size: 56px; overflow: hidden; }
.item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-img.no-img { aspect-ratio: auto; height: 130px; }
.claim-ribbon {
  position: absolute; top: 14px; right: -36px; transform: rotate(35deg);
  background: var(--holly); color: #fff; font-weight: 900; font-size: 12px; letter-spacing: .04em;
  padding: 4px 40px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); text-transform: uppercase;
}
.item.is-mine .claim-ribbon { background: var(--gold); color: var(--ink); }
.item-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.item-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.item-title { font-size: 17px; font-weight: 900; line-height: 1.25; overflow-wrap: anywhere; }
.item-price { font-weight: 900; color: var(--holly); font-size: 17px; white-space: nowrap; }
.item-details { font-size: 14px; color: var(--muted); font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.item-link { font-size: 14px; font-weight: 800; text-decoration: none; align-self: flex-start; overflow-wrap: anywhere; }
.item-link:hover { text-decoration: underline; }
.item-actions { margin-top: auto; padding-top: 6px; display: grid; gap: 8px; }
.item-actions .row { gap: 6px; }
.claim-note { font-size: 13.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.claim-note.good { color: var(--holly-dark); }
.list-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.person-header { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.person-header .who-text { flex: 1 1 200px; min-width: 0; }
.person-header h2 { font-family: var(--display); font-size: 38px; color: var(--pine); line-height: 1; }
.santa-flag { background: var(--gold-soft); color: #87600f; border: 2px dashed var(--gold); font-weight: 800; padding: 6px 14px; border-radius: 999px; font-size: 14px; }

.tip-list { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-weight: 600; }

/* ---------- messages ---------- */

.chat { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; min-height: 560px; }
.threads { padding: 10px; display: flex; flex-direction: column; gap: 2px; align-self: start; }
.thread {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
  text-decoration: none; color: inherit;
}
.thread:hover { background: var(--cream); }
.thread.on { background: var(--holly-soft); }
.thread .grow { flex: 1; min-width: 0; }
.thread .name { font-weight: 800; display: flex; justify-content: space-between; gap: 6px; }
.thread .preview { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread.unread .preview { color: var(--ink); font-weight: 800; }
.convo { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.convo-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.convo-head b { font-size: 18px; }
.convo-body { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 60vh; min-height: 320px; background: #fffdf9; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble time { display: block; font-size: 11px; opacity: .65; margin-top: 3px; font-weight: 700; }
.bubble.them { align-self: flex-start; background: var(--cream); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--holly); color: #fff; border-bottom-right-radius: 6px; }
.bubble.notice { align-self: center; background: var(--gold-soft); color: #6b4c0d; text-align: center; max-width: 92%; border-radius: 14px; }
.split-card { align-self: stretch; max-width: 460px; border: 2px dashed var(--gold); background: var(--gold-soft); border-radius: 18px; padding: 14px; }
.split-card.me { align-self: flex-end; }
.split-card .title { font-weight: 900; display: flex; gap: 8px; align-items: center; }
.split-card .gift { font-size: 17px; font-weight: 900; margin: 6px 0 2px; }
.split-card .note { font-weight: 600; margin: 6px 0; white-space: pre-wrap; }
.split-status { font-weight: 800; font-size: 13.5px; }
.composer { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: var(--paper); }
.composer textarea { flex: 1; resize: none; height: 50px; font: inherit; font-size: 16px; line-height: 1.4; padding: 12px 14px; overflow-y: auto; border: 2px solid var(--line); border-radius: 16px; }
.composer textarea:focus { outline: none; border-color: var(--holly); }
.private-note { font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 0 18px 10px; background: var(--paper); }

/* ---------- Secret Santa ---------- */

.envelope-wrap { text-align: center; padding: 10px 0 4px; }
.envelope { position: relative; width: 300px; max-width: 100%; height: 200px; margin: 120px auto 20px; cursor: pointer; border: 0; background: none; padding: 0; display: block; }
.envelope .env-back { position: absolute; inset: 0; background: var(--berry-dark); border-radius: 10px; }
.envelope .letter {
  position: absolute; left: 16px; right: 16px; top: 14px; height: 170px; z-index: 2;
  background: #fff; border-radius: 8px; padding: 18px 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px;
  transition: transform .7s cubic-bezier(.2, .9, .3, 1.2) .35s;
}
.envelope .letter small { font-weight: 800; color: var(--muted); font-size: 13px; }
.envelope .letter strong { font-family: var(--display); font-size: 40px; color: var(--berry); line-height: 1; }
.envelope .env-front {
  position: absolute; inset: 0; z-index: 3; border-radius: 10px;
  background: var(--berry);
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
}
.envelope .flap {
  position: absolute; left: 0; right: 0; top: 0; height: 120px; z-index: 4;
  background: #ab1a35; clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .45s ease, z-index 0s .2s;
}
.envelope .seal {
  position: absolute; z-index: 5; left: 50%; top: 92px; width: 54px; height: 54px; margin-left: -27px;
  background: var(--gold); border-radius: 50%; display: grid; place-items: center; font-size: 28px;
  box-shadow: 0 3px 0 var(--gold-dark); transition: opacity .2s;
}
.envelope.open .flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .seal { opacity: 0; }
.envelope.open .letter { transform: translateY(-120px); }
.envelope:not(.open):hover .seal { transform: scale(1.06); }
.tap-hint { font-weight: 800; color: var(--muted); animation: pulse 1.4s ease-in-out infinite; display: inline-block; }

.santa-target { text-align: center; }
.santa-target .who { display: inline-flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.santa-target .who b { font-family: var(--display); font-size: 48px; color: var(--berry); line-height: 1; }
.santa-facts { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 16px; }
.suggestions { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.suggestions button { border: 2px dashed var(--line); background: #fffdf9; border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.suggestions button:hover { border-color: var(--gold); background: var(--gold-soft); }
.qa { display: grid; gap: 10px; }
.qa-item { padding: 12px 14px; border-radius: 14px; background: var(--cream); }
.qa-item .q { font-weight: 800; }
.qa-item .a { margin-top: 4px; font-weight: 600; color: var(--holly-dark); }
.qa-item .a.waiting { color: var(--muted); font-style: italic; }
.qa-item form { display: flex; gap: 8px; margin-top: 8px; }
.qa-item form input { flex: 1; min-width: 0; }
.pairs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pair { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--cream); border-radius: 16px; font-weight: 800; }
.pair .arrow { color: var(--berry); font-size: 20px; }
.rule-list { display: grid; gap: 6px; margin: 10px 0; }
.rule { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--cream); border-radius: 12px; font-weight: 700; }
.rule .grow { flex: 1; }

/* ---------- White Elephant ---------- */

.turn-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--pine) 0%, #1c6247 100%); color: #fff;
  border-radius: 24px; padding: 22px 24px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.turn-banner .grow { flex: 1; min-width: 220px; }
.turn-banner h2 { font-family: var(--display); font-size: 40px; line-height: 1.05; color: var(--gold); }
.turn-banner p { font-weight: 700; opacity: .9; margin-top: 4px; }
.turn-banner .avatar { box-shadow: 0 0 0 6px rgba(233, 185, 73, .3); animation: glow 1.6s ease-in-out infinite; }
.turn-banner.robbed { background: linear-gradient(135deg, var(--berry) 0%, #8e1129 100%); }
.turn-banner.robbed h2 { color: #fff; }
@keyframes glow { 50% { box-shadow: 0 0 0 12px rgba(233, 185, 73, .12); } }

.order-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.order-step { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px; text-align: center; font-weight: 800; font-size: 13px; position: relative; }
.order-step .num { position: absolute; top: -2px; left: 8px; background: var(--paper); border: 2px solid var(--line); border-radius: 999px; font-size: 11px; width: 20px; height: 20px; line-height: 16px; z-index: 1; }
.order-step.done { opacity: .55; }
.order-step.now .avatar { box-shadow: 0 0 0 4px var(--gold); }
.order-step.now { color: var(--berry); }

.pile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: var(--cream); }
.pile .presents { font-size: 34px; letter-spacing: -6px; }
.pile b { font-size: 20px; }

.gift-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.egift { position: relative; background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.egift .label { font-weight: 900; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.egift .holder { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.steal-dots { display: flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.steal-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.steal-dots i.on { background: var(--berry); }
.egift.frozen { background: linear-gradient(160deg, #eef7ff, #dcecfb); border-color: #a9cdf0; }
.egift.frozen .frost { position: absolute; top: 10px; right: 12px; font-size: 13px; font-weight: 900; color: #2f6f9f; }
.egift.mine { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.egift .btn { margin-top: auto; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.log li { padding: 8px 12px; border-radius: 12px; background: var(--cream); font-weight: 700; font-size: 14px; }
.log li:first-child { background: var(--gold-soft); }
.results { display: grid; gap: 10px; }
.result { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--cream); }
.result .grow { flex: 1; min-width: 0; }
.result .gift-label { font-weight: 900; font-size: 17px; overflow-wrap: anywhere; }
.award { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--gold-soft); border: 2px dashed var(--gold); margin-bottom: 14px; }
.award .big { font-size: 40px; }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-weight: 600; }
.host-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-radius: 16px; border: 2px dashed var(--line); background: var(--paper); }
.host-bar .label { margin-right: auto; color: var(--muted); }

/* ---------- account / admin ---------- */

.avatar-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-pick button { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: #fffdf9; font-size: 24px; cursor: pointer; }
.avatar-pick button.on { border-color: var(--holly); background: var(--holly-soft); box-shadow: 0 0 0 3px rgba(29, 122, 76, .2); }
.acct-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.acct-row:first-child { border-top: 0; }
.acct-row .grow { flex: 1; min-width: 140px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; background: var(--gold-soft); color: #6b4c0d; padding: 3px 10px; border-radius: 8px; font-size: 14px; user-select: all; }
.code-big { display: block; text-align: center; font-size: 24px; padding: 14px; margin: 12px 0; }

/* ---------- sign in ---------- */

.login {
  position: relative; min-height: 100vh; overflow: hidden;
  background: radial-gradient(900px 500px at 50% 0%, #1f6b4f 0%, transparent 70%), linear-gradient(180deg, var(--pine) 0%, #0a2c21 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 16px;
}
.login-card {
  position: relative; z-index: 2; width: 100%; max-width: 560px;
  background: var(--cream); border-radius: 28px; padding: 32px 28px; text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.login-card::before { content: '🎀'; position: absolute; top: -34px; left: 50%; transform: translateX(-50%); font-size: 56px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
.login-card h1 { font-family: var(--display); font-size: 50px; color: var(--berry); line-height: 1; margin-top: 8px; }
.login-card .sub { margin: 8px auto 22px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.who {
  border: 2px solid var(--line); background: var(--paper); border-radius: 20px; padding: 14px 8px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 900; font-size: 16px; color: var(--ink);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.who:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 8px 18px rgba(42, 31, 23, .12); }
.who small { font-size: 11.5px; font-weight: 800; color: var(--muted); }
.login-form { display: grid; gap: 14px; text-align: left; margin-top: 4px; }
.login-who { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 6px; }
.login-who b { font-family: var(--display); font-size: 40px; color: var(--pine); }
.login-foot { position: relative; z-index: 2; color: rgba(255, 255, 255, .6); font-weight: 700; margin-top: 22px; font-size: 14px; text-align: center; }

/* ---------- modal + toast ---------- */

.modal { border: 0; padding: 0; border-radius: 24px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); background: var(--paper); color: var(--ink); }
.modal::backdrop { background: rgba(10, 40, 30, .6); backdrop-filter: blur(3px); }
.modal-form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--cream); }
.modal-head h3 { font-size: 20px; font-weight: 900; color: var(--pine); }
.modal-body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

#toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: calc(100vw - 32px); }
.toast { background: var(--pine); color: #fff; font-weight: 800; padding: 12px 20px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: toast-in .2s ease-out; transition: opacity .3s, transform .3s; max-width: 100%; text-align: center; }
.toast-err { background: var(--berry); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translate3d(var(--x), 105vh, 0) rotate(var(--r)); } }

/* ---------- phones + tablets ---------- */

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; }
  .chat.has-thread .threads { display: none; }
  .chat:not(.has-thread) .convo { display: none; }
  .hero::before { right: 40px; }
  .bow { right: 10px; }
  .countdown { margin-right: 0; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .topbar-inner { padding: 32px 16px 18px; }
  .logo { font-size: 27px; }
  .logo-tree { font-size: 24px; }
  .me-chip span:last-child { display: none; }
  .me-chip { padding: 3px; }
  .nav {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; margin: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(42, 31, 23, .1);
    justify-content: space-around; gap: 0;
  }
  .nav a { flex: 1; flex-direction: column; gap: 1px; padding: 6px 2px; color: var(--muted); font-size: 11px; border-radius: 12px; }
  .nav a:hover { background: none; color: var(--pine); }
  .nav a.active { background: var(--holly-soft); color: var(--pine); }
  .nav-icon { font-size: 21px; }
  .label-long { display: none; }
  .label-short { display: inline; }
  .nav .badge { position: absolute; top: 2px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; box-shadow: 0 0 0 2px var(--paper); }
  .page { padding: 22px 16px 40px; }
  .page-head h1 { font-size: 36px; }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 36px; }
  .hero::before { display: none; }
  .bow { display: none; }
  .countdown { width: 100%; display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 10px 16px; }
  .countdown b { display: inline; font-size: 44px; }
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .items { grid-template-columns: 1fr; }
  .turn-banner h2 { font-size: 32px; }
  .login-card { padding: 28px 18px; }
  .login-card h1 { font-size: 42px; }
  .who-grid { grid-template-columns: repeat(3, 1fr); }
  .envelope { margin-top: 110px; }
  #toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .bubble { max-width: 88%; }
  .person-header h2 { font-size: 32px; }
  .person-header .avatar-xl { width: 64px; height: 64px; font-size: 34px; border-width: 3px; }
  .pill-tabs.scroll { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .pill-tabs.scroll > * { flex: none; }
}

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