/* ==================================================================
   Secret Santa — festive light theme for participants
   Only applies under  body.theme-festive  (admin keeps the dark theme)
   ================================================================== */

body.theme-festive {
  --paper: #fbf5e7;
  --paper-2: #fffdf7;
  --ink: #1b2a22;
  --ink-soft: #3d4a42;
  --ink-muted: #6b6658;
  --green: #0f4c36;
  --green-deep: #0a3a28;
  --green-mid: #14573d;
  --red: #a32334;
  --red-deep: #7e1a28;
  --gold: #b8892e;
  --gold-soft: #f5e7c4;
  --gold-ink: #5a4616;
  --line: rgba(27, 42, 34, 0.16);

  margin: 0;
  color: var(--ink);
  font: 1rem/1.6 var(--font);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 6%, rgba(163, 35, 52, 0.07), transparent 34%),
    radial-gradient(circle at 88% 2%, rgba(15, 76, 54, 0.08), transparent 36%),
    radial-gradient(circle at 50% 108%, rgba(184, 137, 46, 0.09), transparent 46%),
    radial-gradient(rgba(15, 76, 54, 0.05) 1px, transparent 1px);
  background-size: auto, auto, auto, 20px 20px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body.theme-festive ::selection {
  background: rgba(15, 76, 54, 0.2);
}

body.theme-festive a {
  color: var(--green-deep);
  font-weight: 600;
}

body.theme-festive .snow {
  display: none;
}

body.theme-festive .wrap {
  max-width: 44rem;
  padding: 1.2rem 1.15rem 3.5rem;
}

/* ----------------------------- garland ---------------------------- */

.fest .garland {
  position: relative;
  height: 2.1rem;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  margin: 0.2rem 0 0.9rem;
}

.fest .garland::before {
  content: "";
  position: absolute;
  inset: 0 -2% auto -2%;
  height: 1.5rem;
  border-bottom: 3px solid rgba(15, 76, 54, 0.5);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.fest .garland i {
  position: relative;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.72rem;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.75), transparent 42%), var(--red);
  box-shadow: 0 2px 4px rgba(27, 42, 34, 0.18);
}

.fest .garland i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.75rem;
  width: 1px;
  height: 0.75rem;
  background: rgba(15, 76, 54, 0.45);
}

.fest .garland i:nth-child(2n) {
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.8), transparent 42%), var(--gold);
}

.fest .garland i:nth-child(3n) {
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.8), transparent 42%), var(--green);
}

.fest .garland i:nth-child(4n) {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.15rem;
  transform: rotate(45deg);
}

/* --------------------------- text size ---------------------------- */

.fest .textsize {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.fest .textsize-label {
  margin-right: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.fest .ts-btn {
  min-width: 52px;
  min-height: 46px;
  padding: 0 0.45rem;
  border-radius: 0.7rem;
  border: 2px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font: 700 0.95rem/1 var(--font);
  cursor: pointer;
}

.fest .ts-btn:hover {
  border-color: var(--green);
}

.fest .ts-btn[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.fest .ts-btn:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

/* ---------------------------- headings ---------------------------- */

.fest .fest-head {
  margin-bottom: 1.4rem;
}

.fest .kicker {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}

.fest .f-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 9vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--green-deep);
  text-wrap: balance;
}

.fest .lead {
  margin: 0.7rem 0 0;
  max-width: 34ch;
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.fest .f-h2 {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--green-deep);
}

.fest .body-text {
  margin: 0 0 1rem;
  font-size: 1.04rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.fest .f-label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.fest .f-help {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.fest .f-field + .f-field {
  margin-top: 1.15rem;
}

.fest .f-error {
  display: none;
  margin: 0.9rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--red);
}

.fest .f-error.show {
  display: block;
}

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

.fest .card {
  position: relative;
  padding: 1.45rem 1.25rem;
  border: 1px solid var(--line);
  border-top: 6px solid var(--green);
  border-radius: 1.1rem;
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 0 16px 34px -26px rgba(27, 42, 34, 0.55);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: festRise 0.35s ease both;
}

.fest .card + .card,
.fest .card + .steps,
.fest .steps + .card {
  margin-top: 1.2rem;
}

.fest .ideas-card {
  border-top-color: var(--red);
  margin-top: 1.5rem;
}

.fest .welcome-back {
  border-top-color: var(--gold);
  background: linear-gradient(170deg, var(--green-mid), var(--green-deep));
  color: #fff;
}

.fest .welcome-back .f-h2 {
  color: #fff;
}

.fest .welcome-back .body-text {
  color: #e6f0e8;
}

.fest .welcome-back .btn {
  background: linear-gradient(180deg, #d9ae5c, var(--gold));
  color: #2a2109;
  box-shadow: none;
}

/* ----------------------------- buttons ---------------------------- */

.fest .btn {
  min-height: 3.1rem;
  padding: 0 1.25rem;
  border-radius: 0.85rem;
  border: 2px solid transparent;
  font: 700 1.08rem/1.2 var(--font);
  color: #fff;
  background: linear-gradient(180deg, #b7334a, var(--red));
  box-shadow: 0 12px 22px -14px rgba(163, 35, 52, 0.8);
  white-space: normal;
  text-align: center;
}

.fest .btn:hover {
  filter: brightness(1.06);
}

.fest .btn:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.fest .btn.xl {
  min-height: 3.6rem;
  font-size: 1.16rem;
}

.fest .btn.big {
  min-height: 3.3rem;
}

.fest .btn.block {
  width: 100%;
}

.fest .btn.secondary {
  border-color: var(--green);
  background: var(--paper-2);
  color: var(--green-deep);
  box-shadow: none;
}

.fest .btn.secondary:hover {
  background: #eef4ea;
  filter: none;
}

.fest .btn.danger {
  border-color: rgba(163, 35, 52, 0.5);
  background: #fbeef0;
  color: var(--red);
  box-shadow: none;
}

.fest .btn.small {
  min-height: 2.8rem;
  padding: 0 0.9rem;
  font-size: 0.98rem;
  border-radius: 0.7rem;
}

.fest .btn[disabled] {
  opacity: 0.6;
}

/* ----------------------------- inputs ----------------------------- */

.fest .input,
.fest .textarea {
  min-height: 3.4rem;
  padding: 0.85rem 1rem;
  border: 2px solid #c9bea6;
  border-radius: 0.8rem;
  background: #fff;
  color: var(--ink);
  font: 1.1rem/1.5 var(--font);
}

.fest .textarea {
  min-height: 7rem;
  line-height: 1.55;
}

.fest .input::placeholder,
.fest .textarea::placeholder {
  color: #6f6a5c;
}

.fest .input:focus,
.fest .textarea:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 76, 54, 0.14);
}

.fest .code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fest .or {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.2rem 0 0.9rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.fest .or::before,
.fest .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ------------------------------ steps ----------------------------- */

.fest .steps {
  margin-top: 1.5rem;
}

.fest .steps ol {
  display: grid;
  gap: 0.6rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.fest .steps li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--paper-2);
}

.fest .step-n {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

.fest .steps b {
  display: block;
  font-size: 1.05rem;
  color: var(--ink);
}

.fest .steps p {
  margin: 0.15rem 0 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

/* ----------------------------- waiting ---------------------------- */

.fest .waiting {
  margin-bottom: 1.4rem;
  padding: 1.6rem 1.25rem;
  text-align: center;
  border: 2px dashed rgba(15, 76, 54, 0.5);
  border-radius: 1.1rem;
  background: var(--paper-2);
}

.fest .waiting-mark {
  font-size: 2.6rem;
  line-height: 1;
}

.fest .waiting h2 {
  margin: 0.5rem 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--green-deep);
}

.fest .waiting p {
  margin: 0 auto;
  max-width: 32ch;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* --------------------------- gift tag ----------------------------- */

.fest .reveal-wrap {
  display: flex;
  justify-content: center;
  padding-top: 1.6rem;
  margin: 0.4rem 0 1.2rem;
}

.fest .gift-tag {
  position: relative;
  width: min(100%, 30rem);
  padding: 2.1rem 1.4rem 1.8rem;
  text-align: center;
  border: 3px solid var(--gold);
  border-radius: 1.4rem;
  background: linear-gradient(180deg, #fffdf7, #f7edd6);
  box-shadow:
    0 26px 44px -28px rgba(27, 42, 34, 0.6),
    inset 0 0 0 6px #fff;
  transform: rotate(-1.2deg);
  animation: festPop 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}

.fest .gift-tag::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -1.7rem;
  width: 2px;
  height: 1.7rem;
  background: linear-gradient(180deg, transparent, var(--gold));
}

.fest .tag-hole {
  position: absolute;
  left: 50%;
  top: 0.8rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  box-shadow:
    inset 0 2px 3px rgba(27, 42, 34, 0.35),
    0 0 0 3px #fff;
}

.fest .tag-kicker {
  margin: 0.9rem 0 0.1rem;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.fest .tag-name {
  margin: 0.35rem 0 0.2rem;
  font-family: var(--serif);
  font-size: clamp(2.9rem, 16vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--green-deep);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.fest .tag-budget {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  margin: 0.8rem 0 0;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

/* --------------------------- wish panels -------------------------- */

.fest .wish-grid {
  display: grid;
  gap: 0.9rem;
}

.fest .wish-panel {
  padding: 1.1rem 1.2rem;
  border-radius: 1rem;
}

.fest .panel-love {
  border: 2px solid rgba(15, 76, 54, 0.3);
  background: #f1f8f2;
}

.fest .panel-avoid {
  border: 2px solid rgba(163, 35, 52, 0.28);
  background: #fdf2f3;
}

.fest .wish-panel h3 {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-size: 1.28rem;
  letter-spacing: 0;
}

.fest .panel-love h3 {
  color: var(--green);
}

.fest .panel-avoid h3 {
  color: var(--red);
}

.fest .wish-body {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fest .wish-body.empty {
  font-style: italic;
  color: var(--ink-muted);
}

/* --------------------------- secret note -------------------------- */

.fest .secret-note {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 2px solid rgba(184, 137, 46, 0.5);
  border-radius: 0.9rem;
  background: var(--gold-soft);
}

.fest .secret-note p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--gold-ink);
}

.fest .secret-note b {
  color: #4a390f;
}

.fest .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.1rem;
}

.fest .actions .btn {
  flex: 1;
  min-width: 12rem;
}

/* ---------------------------- save note --------------------------- */

.fest .save-status {
  min-height: 1.6rem;
  margin: 0.8rem 0 0;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.fest .save-status.ok {
  color: #0e6b3f;
}

.fest .save-status.warn {
  color: #8a5a00;
}

.fest .save-status.bad {
  color: var(--red);
}

/* --------------------------- link / more -------------------------- */

.fest .more {
  margin-top: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--paper-2);
}

.fest .more > summary {
  padding: 0.95rem 1.1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-deep);
  list-style: none;
  cursor: pointer;
}

.fest .more > summary::-webkit-details-marker {
  display: none;
}

.fest .more > summary::before {
  content: "🔗";
  margin-right: 0.5rem;
}

.fest .more-body {
  padding: 0 1.1rem 1.1rem;
}

.fest .more-body .row {
  flex-wrap: wrap;
}

.fest .link-box {
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ----------------------------- footer ----------------------------- */

.fest .fest-foot {
  margin: 1.6rem 0 0;
  text-align: center;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.fest .fest-foot a {
  color: var(--green-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fest .signout-link {
  min-height: 2.75rem;
  padding: 0.4rem 0.6rem;
  border: none;
  background: none;
  color: var(--ink-muted);
  font: 600 0.95rem/1.2 var(--font);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.fest .signout-link:hover {
  color: var(--red);
}

/* --------------------------- toasts / modal ----------------------- */

body.theme-festive .toast {
  padding: 0.85rem 1.1rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--green-deep);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 18px 30px -20px rgba(27, 42, 34, 0.9);
}

body.theme-festive .toast.bad {
  background: var(--red-deep);
  color: #fff;
}

body.theme-festive .modal {
  padding: 1.5rem;
  border: 3px solid var(--gold);
  border-radius: 1.2rem;
  background: var(--paper-2);
  color: var(--ink);
}

body.theme-festive .modal::backdrop {
  background: rgba(27, 42, 34, 0.5);
  backdrop-filter: blur(3px);
}

body.theme-festive .modal h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--green-deep);
}

body.theme-festive .modal .muted {
  color: var(--ink-soft);
}

body.theme-festive .modal .btn {
  min-height: 3rem;
  padding: 0 1.1rem;
  border-radius: 0.8rem;
  font: 700 1rem/1.2 var(--font);
  color: #fff;
  background: linear-gradient(180deg, #b7334a, var(--red));
  border: 2px solid transparent;
}

body.theme-festive .modal .btn.secondary {
  border-color: var(--green);
  background: var(--paper-2);
  color: var(--green-deep);
}

body.theme-festive .modal .btn.danger {
  border-color: rgba(163, 35, 52, 0.5);
  background: #fbeef0;
  color: var(--red);
}

body.theme-festive .modal .modal-actions .btn {
  min-height: 3rem;
  font-size: 1rem;
}

/* ---------------------------- skeleton ---------------------------- */

body.theme-festive .skeleton {
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: linear-gradient(90deg, #f4ecd9, #fffdf7, #f4ecd9);
  background-size: 200% 100%;
}

/* ---------------------------- animation --------------------------- */

@keyframes festRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes festPop {
  from {
    opacity: 0;
    transform: rotate(-1.2deg) scale(0.97);
  }
  to {
    opacity: 1;
    transform: rotate(-1.2deg) scale(1);
  }
}

/* --------------------------- wider screens ------------------------ */

@media (min-width: 40em) {
  .fest .wish-grid {
    grid-template-columns: 1fr 1fr;
  }

  .fest .textsize {
    margin-bottom: 0.6rem;
  }
}

/* ------------------------------ print ----------------------------- */

@media print {
  body.theme-festive {
    background: #fff !important;
    color: #000;
  }

  .fest .garland,
  .fest .textsize,
  .fest .ideas-card,
  .fest .secret-note,
  .fest .actions,
  .fest .more,
  .fest .fest-foot,
  .fest .signout-link,
  body.theme-festive .toasts {
    display: none !important;
  }

  .fest .wrap {
    max-width: none;
    padding: 0;
  }

  .fest .gift-tag {
    transform: none;
    box-shadow: none;
    border-color: #555;
    background: #fff;
    animation: none;
  }

  .fest .gift-tag::after,
  .fest .tag-hole {
    display: none;
  }

  .fest .wish-panel {
    border-color: #777 !important;
    background: #fff !important;
    break-inside: avoid;
  }

  .fest .wish-body {
    color: #000;
  }

  @page {
    margin: 18mm;
  }
}
