:root {
  color-scheme: dark;
  --paper: #fff3d9;
  --gold: #e4c78e;
  --muted: #c4c4b3;
  --green: #10221e;
  --line: rgb(223 196 141 / 26%);
  --serif: "Iowan Old Style", Baskerville, Georgia, "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--green);
  color: var(--paper);
  font-family: var(--sans);
}

button, input { font: inherit; }
button { cursor: pointer; }

button:focus-visible, input:focus-visible, .name-hints button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
}

.backdrop {
  position: absolute;
  inset: 0 0 auto;
  z-index: -2;
  height: max(100svh, 640px);
  background:
    linear-gradient(90deg, transparent 38%, rgb(8 24 20 / 28%) 68%, rgb(8 24 20 / 36%)),
    linear-gradient(180deg, rgb(10 22 24 / 45%), transparent 20%, transparent 55%, rgb(12 26 23 / 85%) 95%, var(--green)),
    url("/images/silent-night.webp") 42% 50% / cover no-repeat;
}

.snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  width: min(100% - 100px, 1360px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 29px 0;
}

.music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgb(14 31 27 / 76%);
  color: var(--paper);
  font-size: .87rem;
}

.music-toggle:hover, .music-toggle[aria-pressed="true"] { background: #2a3a2f; }
.music-note { color: var(--gold); font: 1.28rem/1 var(--serif); }
.sound-bars { display: flex; align-items: center; gap: 2px; height: 12px; opacity: .58; }
.sound-bars i { width: 1.5px; height: 3px; background: var(--gold); border-radius: 1px; }
.sound-bars i:nth-child(2) { height: 8px; }
.sound-bars i:nth-child(3) { height: 5px; }
.music-toggle[aria-pressed="true"] .sound-bars { opacity: 1; }
.music-toggle[aria-pressed="true"] .sound-bars i { animation: sound .82s ease-in-out infinite alternate; }
.music-toggle[aria-pressed="true"] .sound-bars i:nth-child(2) { animation-delay: -.32s; }
.music-toggle[aria-pressed="true"] .sound-bars i:nth-child(3) { animation-delay: -.58s; }
@keyframes sound { from { transform: scaleY(.6); } to { transform: scaleY(1.8); } }

.main { width: min(100% - 100px, 1260px); margin: 0 auto; }

.layout {
  min-height: max(100svh, 640px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  align-items: center;
  gap: clamp(32px, 7vw, 104px);
  padding: 116px 36px 68px 24px;
}

.hero {
  align-self: end;
  padding-bottom: clamp(15px, 4vh, 55px);
}

.hero h1 {
  margin: 0;
  width: max-content;
  max-width: 100%;
  font: 400 clamp(4rem, 8.6vw, 8.35rem)/.8 var(--serif);
  letter-spacing: -.075em;
  text-shadow: 0 6px 32px #0a1a17, 0 2px 9px rgb(10 26 23 / 65%);
}

.hero em {
  display: block;
  margin: .15em 0 0 .05em;
  font-weight: 400;
  color: #f7dca4;
}

.exchange {
  position: relative;
  width: 100%;
  border: 1px solid rgb(235 206 148 / 47%);
  border-radius: 17px;
  background: linear-gradient(155deg, rgb(35 54 43 / 96%), rgb(16 34 28 / 97%) 65%);
  box-shadow: 0 22px 85px rgb(1 12 11 / 43%), 0 0 45px rgb(244 194 107 / 7%);
}

.exchange::before {
  position: absolute;
  inset: 7px;
  content: "";
  border: 1px solid rgb(235 206 148 / 19%);
  border-radius: 11px;
  pointer-events: none;
}

.exchange-inner { position: relative; padding: 34px 34px 29px; }

.ornament {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  height: 65px;
  margin-bottom: 13px;
}

.ornament-spark { position: relative; top: 3px; font-size: 15px; }
.ornament-spark:last-child { top: -9px; font-size: 18px; }

.present {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle, #6e5630 0, rgb(94 74 43 / 22%) 56%, transparent 73%);
  color: #fbe1a6;
}

.present i {
  position: relative;
  width: 25px;
  height: 17px;
  margin-top: 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 47%, currentColor 47% 53%, transparent 53%);
}

.present i::before {
  position: absolute;
  top: -5px;
  left: -3px;
  width: 29px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: linear-gradient(90deg, #404334 47%, currentColor 47% 53%, #404334 53%);
  content: "";
  transition: transform 600ms cubic-bezier(.18,.77,.22,1.22);
}

.present i::after {
  position: absolute;
  top: -11px;
  left: 8px;
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 80% 80% 0 80%;
  transform: rotate(18deg);
  content: "";
  transition: transform 600ms cubic-bezier(.18,.77,.22,1.22);
}

.phase-ritual .ornament, .phase-reveal .ornament { filter: drop-shadow(0 0 12px #c5974d); }
.phase-ritual:has(.opened) .present i::before, .phase-reveal .present i::before { transform: translate(3px, -8px) rotate(11deg); }
.phase-ritual:has(.opened) .present i::after, .phase-reveal .present i::after { transform: translate(4px, -8px) rotate(29deg); }

.exchange-heading { text-align: center; }
.exchange-heading h2, .board-heading h2 {
  margin: 0;
  font: 400 2.8rem/.99 var(--serif);
  letter-spacing: -.053em;
}

.heading-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--gold);
  margin: 16px 0 22px;
  font-size: .66rem;
}

.heading-rule i { width: 29px; height: 1px; background: var(--line); }
.identity { position: relative; }
.identity label { display: block; margin: 0 0 8px; color: var(--paper); font-size: .9rem; }
.field { position: relative; }
.identity input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #142820;
  color: var(--paper);
  padding: 10px 39px 10px 13px;
  font-size: 1rem;
}
.identity input::placeholder { color: #b7bcae; opacity: 1; }
.field-icon {
  pointer-events: none;
  position: absolute;
  right: 15px;
  top: calc(50% - 7px);
  width: 12px;
  height: 12px;
  border: 1px solid var(--gold);
  border-radius: 50%;
}
.field-icon::after {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 6px;
  height: 1px;
  transform: rotate(47deg);
  background: var(--gold);
  content: "";
}

.name-hints {
  position: absolute;
  z-index: 3;
  top: 74px;
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #243b30;
  box-shadow: 0 8px 30px #091812bf;
}

.name-hints button, .name-hints .empty {
  width: 100%;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--paper);
  padding: 9px;
  text-align: left;
  font-size: .94rem;
}
.name-hints button:hover, .name-hints button:focus-visible { background: #3c4e39; }
.tag-status { min-height: 1.15rem; margin: 6px 0 3px; color: var(--gold); font-size: .84rem; }

.gift-hotspot {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 47px;
  border: 1px solid #e5ca98;
  border-radius: 6px;
  background: linear-gradient(105deg, #f4e2ba, #e2c38a);
  color: #253024;
  font-size: .97rem;
  font-weight: 660;
  transition: box-shadow 200ms ease, filter 200ms ease;
}
.gift-hotspot[aria-disabled="true"] { filter: saturate(.66) brightness(.9); }
.gift-hotspot.ready:hover { box-shadow: 0 0 26px rgb(238 198 125 / 35%); filter: brightness(1.08); }
.gift-hint, .message { text-align: center; color: var(--muted); font-size: .875rem; line-height: 1.45; margin: 11px 0 0; }
.message:empty { display: none; }
.message { color: #f7cd9e; }
.countdown { display: none; font: 500 1.7rem/1 var(--serif); }
.countdown.show { display: block; }
.countdown.pop { animation: count-pop .65s ease-out; }
.phase-ritual .gift-label { display: none; }
.phase-ritual .identity { pointer-events: none; }
@keyframes count-pop { from { opacity: .05; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }
.shake { animation: shake .35s ease-out; }
@keyframes shake { 30%, 70% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }

.reveal-names { display: none; text-align: center; }
.reveal-names.show { display: grid; justify-items: center; gap: 16px; animation: reveal-in .7s ease-out both; }
.phase-reveal .identity, .phase-reveal .gift-hotspot, .phase-reveal .gift-hint { display: none; }
.kicker { font-size: .88rem; color: var(--gold); margin: 0; }
.partner span { display: block; overflow-wrap: anywhere; }
.partner .zh { font: 500 clamp(1.9rem, 4.2vw, 2.7rem)/1.14 var(--serif); }
.partner .en { font: italic 400 1.65rem/1.1 var(--serif); color: #ebcb8d; margin-top: 6px; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.brand-signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 21px;
}

.brand-signature::before, .brand-signature::after {
  width: 25px;
  height: 1px;
  background: var(--line);
  content: "";
}

.brand-plaque {
  display: block;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background:
    linear-gradient(155deg, #343b2c, #18271f 63%, #202d23) padding-box,
    linear-gradient(145deg, #c8a76a, #755a33 46%, #ae8a4e 70%, #d6b47a) border-box;
  box-shadow: inset 0 0 0 2px #19271e, 0 3px 8px rgb(5 16 12 / 39%);
}

.brand-mark {
  display: block;
  filter: drop-shadow(0 -1px 0 rgb(255 235 188 / 31%)) drop-shadow(0 1px 1px #100e08);
}

.brand-mark::before {
  display: block;
  width: 72px;
  aspect-ratio: 256 / 122;
  background:
    repeating-linear-gradient(2deg, #fff4ce2b 0 .45px, transparent .45px 1.45px, #4a311b26 1.45px 2px),
    linear-gradient(158deg, #c29a56, #f3d692 21%, #ffeab4 29%, #bf8b42 44%, #e5bd73 58%, #f4db96 69%, #986630 83%, #e2b66a);
  mask: url("/images/innolabx-mark.webp") center / contain no-repeat;
  content: "";
}

.drawn-board {
  width: min(100%, 640px);
  margin: 0 auto 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1c3229;
  padding: 25px;
}
.board-heading { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.board-heading h2 { font-size: 2rem; }
#revealed-count { color: var(--gold); font-size: .875rem; }
.revealed-list { padding: 0; margin: 18px 0 0; list-style: none; }
.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.match-row.trio { grid-template-columns: minmax(0, 1fr) 15px minmax(0, 1fr) 15px minmax(0, 1fr); }
.match-name { text-align: center; overflow-wrap: anywhere; }
.match-name span { display: block; }
.match-name .en { color: var(--muted); font-size: .875rem; margin-top: 3px; }
.swap-arrow { color: var(--gold); text-align: center; }

@media (max-width: 950px) {
  .topbar, .main { width: calc(100% - 56px); }
  .layout { gap: 26px; padding-inline: 0; grid-template-columns: minmax(0, 1fr) minmax(310px, 365px); }
  .exchange-inner { padding-inline: 28px; }
}

@media (max-width: 720px) {
  .topbar, .main { width: calc(100% - 36px); }
  .topbar { padding: 16px 0; }
  .backdrop {
    height: min(102vw, 590px);
    min-height: 370px;
    background:
      linear-gradient(180deg, rgb(9 25 23 / 30%), transparent 18%, transparent 35%, rgb(13 30 25 / 87%) 89%, var(--green)),
      url("/images/silent-night.webp") 10% 40% / cover no-repeat;
  }
  .layout {
    min-height: auto;
    max-width: 430px;
    margin: 0 auto;
    padding: clamp(205px, 49vw, 335px) 0 30px;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero { padding: 0; }
  .hero h1 { margin: 0 auto; text-align: center; font-size: clamp(3.1rem, 11vw, 5.55rem); }
  .hero em { display: inline; margin: 0; }
  .exchange-inner { padding: 26px 24px 23px; }
  .ornament { height: 58px; margin-bottom: 8px; }
  .present { width: 56px; height: 56px; }
  .exchange-heading h2 { font-size: 2.5rem; }
  .heading-rule { margin: 13px 0 18px; }
  .drawn-board { padding: 18px; max-width: 430px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .snow { display: none; }
}

/* 名单标题：⭐Lucky starts⭐ 居中 */
.board-heading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.board-heading h2 { text-align: center; }
#revealed-count { text-align: center; }
