/* Schenkmachine-specific pieces: chrome, home, wizard, party, invitation. */

/* ================================================================ Chrome */
.festive-strip {
  height: 5px;
  background: repeating-linear-gradient(
    -45deg,
    var(--cranberry) 0 12px,
    var(--white) 12px 24px,
    var(--pine) 24px 36px,
    var(--white) 36px 48px
  );
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1020;
  padding-block: 0.6rem;
  border-bottom: 1px solid rgb(43 35 33 / 0.06);
  background: rgb(251 246 238 / 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.brand:hover { color: var(--ink); }

.brand img {
  border-radius: 22%;
  box-shadow: 0 0.25rem 0.75rem rgb(179 38 58 / 0.25);
  transition: transform 0.25s ease;
}

.brand:hover img { transform: rotate(-8deg) scale(1.05); }

.badge-beta {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--gold-light);
  color: var(--gold-dark);
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.locale-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
}

.locale-toggle a {
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.locale-toggle a:hover { color: var(--ink); }
.locale-toggle a.is-active { background: var(--cranberry); color: var(--white); }

.site-footer {
  flex-shrink: 0;
  padding-block: var(--space-4);
  border-top: 1px solid rgb(43 35 33 / 0.06);
  background: rgb(255 255 255 / 0.6);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

@media (min-width: 768px) {
  .site-footer__inner { flex-direction: row; justify-content: space-between; }
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--cranberry); }

/* ================================================================ Shared bits */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--gold-light);
  color: var(--gold-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Inline highlight for important values in running text */
.highlight {
  padding: 0.05em 0.4em;
  border-radius: 0.4rem;
  background: linear-gradient(transparent 55%, rgb(217 164 65 / 0.4) 55%);
  font-weight: 700;
  white-space: nowrap;
}

.page-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.page-title h2 { margin: 0; }

/* ================================================================ Home */
.hero { padding: var(--space-4) 0 var(--space-5); }

.hero__grid {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  text-align: center;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

@media (min-width: 576px) {
  .hero__actions { flex-direction: row; }
}

@media (min-width: 992px) {
  .hero__grid { grid-template-columns: 7fr 5fr; text-align: left; }
  .hero__actions { justify-content: flex-start; }
}

.hero-art {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
}

.hero-art__circle {
  position: absolute;
  inset: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgb(255 255 255 / 0.35), transparent 60%),
    linear-gradient(135deg, var(--cranberry), var(--cranberry-dark));
  box-shadow: 0 2rem 3rem rgb(179 38 58 / 0.3);
  color: var(--white);
  font-size: 6rem;
}

.hero-art__gift {
  animation: wiggle 4s ease-in-out infinite;
  transform-origin: 50% 80%;
}

.sparkle {
  position: absolute;
  color: var(--gold);
  animation: twinkle 3s ease-in-out infinite;
}

.sparkle--1 { top: 0; right: 30px; font-size: 1.75rem; }
.sparkle--2 { bottom: 20px; left: 0; font-size: 1.25rem; animation-delay: 0.8s; color: var(--pine); }
.sparkle--3 { top: 60px; left: -6px; font-size: 1rem; animation-delay: 1.6s; }
.sparkle--4 { bottom: 0; right: 10px; font-size: 1.4rem; animation-delay: 2.2s; color: var(--pine); }

.how-step {
  position: relative;
  padding: 0 var(--space-3);
  text-align: center;
}

.how-step .icon-circle { margin-bottom: var(--space-3); }

.how-step__number {
  position: absolute;
  top: -0.35rem;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: 1rem;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
}

.mode-card { border-top: 4px solid var(--cranberry); }
.mode-card--complex { border-top-color: var(--pine); }
.mode-card .icon-circle { margin-bottom: var(--space-3); }

/* "Gift swap with a twist" explanation (home + wizard step 3) */
.explainer {
  padding: var(--space-4);
  border: 2px dashed rgb(31 92 70 / 0.3);
  border-radius: var(--radius-lg);
  background: var(--white);
  scroll-margin-top: 5rem;
}

.explainer__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: 1.3rem;
}

.explainer .steps-heading { margin-top: var(--space-2); }
.explainer .steps-list { line-height: 1.9; }
/* Names in running text: just bold, no pill */
.explainer .name-tag {
  display: inline;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--pine);
  font-size: inherit;
  font-weight: 800;
}

/* ================================================================ Wizard */
.wizard-steps {
  display: flex;
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
}

.wizard-steps li {
  position: relative;
  flex: 1;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

/* connector line */
.wizard-steps li:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  right: 50%;
  z-index: 0;
  width: 100%;
  height: 3px;
  background: var(--line);
}

.wizard-steps li.is-done::before,
.wizard-steps li.is-current::before { background: var(--pine); }

.wizard-steps a { color: inherit; }
.wizard-steps a:hover .wizard-dot { border-color: var(--pine); }

.wizard-dot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 auto 0.4rem;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted);
  font-weight: 800;
  transition: all 0.2s ease;
}

.wizard-steps .is-done { color: var(--pine); }
.wizard-steps .is-done .wizard-dot { border-color: var(--pine); background: var(--pine); color: var(--white); }

.wizard-steps .is-current { color: var(--cranberry); }

.wizard-steps .is-current .wizard-dot {
  border-color: var(--cranberry);
  background: var(--cranberry);
  color: var(--white);
  box-shadow: 0 0 0 6px rgb(179 38 58 / 0.15);
}

/* Step 4: add-participant row */
.add-row {
  display: grid;
  gap: var(--space-2);
}

@media (min-width: 768px) {
  .add-row { grid-template-columns: 1fr auto; }
  .add-row--groups { grid-template-columns: 2fr 1fr auto; }
}

/* ================================================================ Participants */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--cranberry);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
}

.avatar--tone-0 { background: var(--cranberry); }
.avatar--tone-1 { background: var(--pine); }
.avatar--tone-2 { background: #c4861f; }
.avatar--tone-3 { background: var(--blue); }
.avatar--tone-4 { background: var(--plum); }

.group-badge--1 { background: rgb(179 38 58 / 0.12); color: var(--cranberry-dark); }
.group-badge--2 { background: rgb(31 92 70 / 0.12); color: var(--pine-dark); }
.group-badge--3 { background: rgb(217 164 65 / 0.25); color: var(--gold-dark); }
.group-badge--4 { background: rgb(61 117 147 / 0.14); color: var(--blue-dark); }

.participant-name { margin-right: var(--space-2); font-weight: 700; }

/* ================================================================ Party overview */
.party-header {
  overflow: hidden;
  border: 0;
  background:
    radial-gradient(circle at 90% 10%, rgb(217 164 65 / 0.35), transparent 40%),
    linear-gradient(135deg, var(--pine), var(--pine-dark));
  box-shadow: var(--shadow);
  color: var(--white);
}

.party-header .card__body { position: relative; }
.party-header h2 { margin-bottom: var(--space-4); }

.party-header__icon {
  position: absolute;
  right: -1rem;
  bottom: -2rem;
  font-size: 9rem;
  opacity: 0.08;
  transform: rotate(-12deg);
}

.party-header__byline { margin-bottom: var(--space-1); opacity: 0.75; }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-size: 0.88rem;
  font-weight: 600;
}

.party-header .chip {
  border-color: transparent;
  background: rgb(255 255 255 / 0.14);
  color: var(--white);
}

.chip__label { font-weight: 400; opacity: 0.75; }

.quote-card {
  position: relative;
  padding: var(--space-4) var(--space-4) 1.25rem 3.75rem;
  border-radius: var(--radius-lg);
  background: var(--sand);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
}

.quote-card::before {
  content: "\201C";
  position: absolute;
  top: 0.25rem;
  left: 1.1rem;
  color: var(--cranberry);
  font-size: 4rem;
  line-height: 1;
  opacity: 0.6;
}

.quote-card p:last-child { margin-bottom: 0; }

.generate-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .generate-panel { flex-direction: row; align-items: center; }
}

/* ================================================================ Invitation */
.invitation-card {
  overflow: hidden;
  border: 0;
  box-shadow: var(--shadow-lg);
}

.invitation-card__banner {
  padding: 2.25rem var(--space-4) 2rem;
  background:
    radial-gradient(circle at 15% 20%, rgb(217 164 65 / 0.35), transparent 35%),
    radial-gradient(circle at 85% 80%, rgb(255 255 255 / 0.12), transparent 35%),
    linear-gradient(135deg, var(--cranberry), var(--cranberry-dark));
  color: var(--white);
  text-align: center;
}

.invitation-card__banner .eyebrow { margin-bottom: var(--space-3); }
.invitation-card__banner h1 { margin-bottom: var(--space-1); }
.invitation-card__banner p { margin: 0; opacity: 0.75; }

.invitation-card__body {
  padding: 2rem 1.75rem;
  font-size: 1.08rem;
  line-height: 1.8;
}

@media (min-width: 768px) {
  .invitation-card__body { padding: var(--space-5) 3rem; }
}

.greeting {
  margin-bottom: var(--space-4);
  font-family: var(--font-serif);
  font-size: 1.75rem;
}

.match-card {
  margin: var(--space-5) 0 0;
  border: 2px dashed rgb(31 92 70 / 0.35);
}

.match-card .card__header { border-bottom-style: dashed; }

.match-sentence {
  margin: var(--space-3) 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  text-align: center;
}

.name-tag {
  display: inline-block;
  padding: 0.15em 0.75em;
  border-radius: var(--radius-pill);
  background: var(--pine);
  box-shadow: 0 0.25rem 0.75rem rgb(31 92 70 / 0.25);
  color: var(--white);
  font-family: var(--font-sans);
  font-weight: 800;
  white-space: nowrap;
}

/* Gift label in complex mode ("GIVER --> RECEIVER") */
.gift-label {
  position: relative;
  display: inline-block;
  margin-top: var(--space-2);
  padding: 0.35rem 1rem 0.35rem 1.75rem;
  border: 1px solid rgb(217 164 65 / 0.6);
  border-radius: 0.35rem 0.75rem 0.75rem 0.35rem;
  background: var(--gold-light);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.gift-label::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.6rem;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.25rem;
  border: 1px solid rgb(217 164 65 / 0.8);
  border-radius: 50%;
  background: var(--white);
}

.steps-heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-3);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
}

.steps-list {
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.steps-list > li {
  position: relative;
  min-height: 2rem;
  margin-bottom: var(--space-3);
  padding-left: 2.75rem;
}

.steps-list > li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  top: 0.15rem;
  left: 0;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: rgb(31 92 70 / 0.1);
  color: var(--pine);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.9rem;
  text-align: center;
}

/* ---------------------------------------------------------------- Gift reveal
   Only hidden when JavaScript is available (html.js), so the page keeps
   working without JS (and in rack_test specs). */
.gift-reveal { position: relative; }
.gift-reveal__cover { display: none; }
.gift-reveal__rewrap { display: none; }

.js .gift-reveal:not(.is-revealed) { min-height: 16rem; }

.js .gift-reveal:not(.is-revealed) .gift-reveal__content {
  max-height: 16rem;
  overflow: hidden;
  filter: blur(12px);
  visibility: hidden;
}

.js .gift-reveal:not(.is-revealed) .gift-reveal__cover { display: flex; }
.js .gift-reveal.is-revealed .gift-reveal__rewrap { display: inline-flex; }

.gift-reveal__cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  border: 0;
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.06) 0 14px, transparent 14px 28px),
    linear-gradient(135deg, var(--pine), var(--pine-dark));
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 800;
}

/* ribbon */
.gift-reveal__cover::before,
.gift-reveal__cover::after {
  content: "";
  position: absolute;
  background: var(--gold);
  opacity: 0.9;
}

.gift-reveal__cover::before { top: 0; bottom: 0; left: 50%; width: 18px; margin-left: -9px; }
.gift-reveal__cover::after { top: 50%; right: 0; left: 0; height: 18px; margin-top: -9px; }

.gift-reveal__cover > * { position: relative; z-index: 1; }

.gift-reveal__cover:focus-visible {
  outline: 4px solid rgb(217 164 65 / 0.6);
  outline-offset: 3px;
}

.gift-reveal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: var(--cranberry);
  box-shadow: 0 0 0 8px rgb(255 255 255 / 0.2), 0 1rem 2rem rgb(0 0 0 / 0.25);
  font-size: 2.6rem;
  animation: wiggle 2.5s ease-in-out infinite;
}

.gift-reveal__cover:hover .gift-reveal__icon,
.gift-reveal__cover:focus-visible .gift-reveal__icon {
  animation: shake 0.5s ease-in-out infinite;
}

.gift-reveal__text {
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-pill);
  background: rgb(22 68 51 / 0.85);
}

.gift-reveal.is-opening .gift-reveal__cover { animation: unwrap 0.55s ease-in forwards; }
.gift-reveal.is-revealed .gift-reveal__content { animation: pop-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.gift-reveal__content:focus { outline: 0; }

.confetti {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}

.confetti span {
  position: absolute;
  top: 30%;
  left: 50%;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: confetti 1.1s ease-out forwards;
}

/* ================================================================ Auth */
.auth-card {
  max-width: 420px;
  margin: var(--space-4) auto;
}

.auth-card__head {
  margin-bottom: var(--space-4);
  text-align: center;
}

.auth-card__head .icon-circle { margin-bottom: var(--space-3); }

/* ================================================================ Admin */
.stat__label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__value {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  line-height: 1.2;
}

/* ================================================================ Animations */
@keyframes wiggle {
  0%, 80%, 100% { transform: rotate(0); }
  84% { transform: rotate(-6deg); }
  88% { transform: rotate(6deg); }
  92% { transform: rotate(-4deg); }
  96% { transform: rotate(3deg); }
}

@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg) scale(1.05); }
  75% { transform: rotate(8deg) scale(1.05); }
}

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

@keyframes unwrap {
  to { opacity: 0; transform: scale(1.08); filter: blur(4px); }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes confetti {
  from { opacity: 1; transform: translate(0, 0) rotate(0); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
}
