:root {
  --bg: #f6f1e7;
  --bg-2: #efe7d8;
  --card: #fffdf8;
  --ink: #1f2a24;
  --muted: #6b726c;
  --line: #e4dccb;
  --green: #1f6f4a;
  --green-ink: #ffffff;
  --green-soft: #e3efe7;
  --red: #c8102e;
  --red-soft: #fbe5e7;
  --gold: #c99a2e;
  --gold-soft: #f8edd2;
  --shadow: 0 1px 2px rgb(40 30 10 / .06), 0 8px 28px -12px rgb(40 30 10 / .18);
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121815;
    --bg-2: #18201c;
    --card: #1b2420;
    --ink: #ecebe4;
    --muted: #9aa49d;
    --line: #2b3732;
    --green: #3fa274;
    --green-ink: #0d1411;
    --green-soft: #1c3329;
    --red: #ef5b6b;
    --red-soft: #3a1d22;
    --gold: #e2b94f;
    --gold-soft: #33291a;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -200px, var(--green-soft), transparent 70%),
    var(--bg);
  overflow-x: hidden;
}
a { color: var(--green); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 16px 80px; position: relative; z-index: 1; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; margin-bottom: 28px;
}
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--red); color: #fff; font-size: 18px; box-shadow: var(--shadow);
}

.hero { margin-bottom: 28px; }
.hero p { margin-top: 10px; font-size: 1.08rem; color: var(--muted); max-width: 56ch; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin-top: 4px; }

.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--muted); }
input, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .95rem var(--font);
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--green); }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { padding: 6px 10px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* names editor */
.names { display: grid; gap: 8px; }
.name-row { display: flex; gap: 8px; align-items: center; }
.name-row .num {
  flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-2); color: var(--muted); font-size: .8rem; font-weight: 600;
}
.name-row input { flex: 1; }
.name-row .remove { flex: 0 0 auto; }
.name-row.dupe input { border-color: var(--red); }

.hint { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); font-size: .9rem; color: var(--muted); }
.hint.warn { background: var(--gold-soft); color: var(--ink); }
.hint.bad { background: var(--red-soft); color: var(--ink); }
.hint.good { background: var(--green-soft); color: var(--ink); }
.hint b { color: var(--ink); }

.error { color: var(--red); font-weight: 600; font-size: .92rem; }

/* participant list (admin) */
.plist { list-style: none; margin: 0; padding: 0; }
.plist li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.plist li:first-child { border-top: 0; padding-top: 0; }
.avatar {
  flex: 0 0 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: .95rem;
}
.pinfo { flex: 1 1 140px; min-width: 0; }
.pinfo .name { font-weight: 600; }
.pactions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-2); color: var(--muted);
}
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--gold-soft); color: var(--gold); }
.badge.bad { background: var(--red-soft); color: var(--red); }

/* progress */
.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .4s; }

/* encrypted pairs */
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pair {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--line);
  font-family: var(--mono); font-weight: 600; letter-spacing: .06em;
}
.pair .arrow { color: var(--red); font-family: var(--font); }
.code { padding: 2px 7px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); }

.checks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: baseline; font-size: .95rem; }
.checks .ic { flex: 0 0 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; transform: translateY(5px); }
.checks .ic.ok { background: var(--green); }
.checks .ic.bad { background: var(--red); }

/* key box */
.keybox {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
}
.keybox code { flex: 1 1 200px; font-family: var(--mono); font-size: .85rem; word-break: break-all; min-width: 0; }
.keybox code.blurred { filter: blur(5px); user-select: none; }

/* reveal table */
.reveal-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.reveal-table th, .reveal-table td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.reveal-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 0; }
.reveal-table td.arrow { color: var(--red); width: 30px; text-align: center; }

details.danger summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details.danger[open] summary { margin-bottom: 12px; }

/* my groups */
.mygroups { list-style: none; padding: 0; margin: 0; }
.mygroups li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.mygroups li:first-child { border-top: 0; }
.mygroups a { flex: 1; font-weight: 600; text-decoration: none; color: var(--ink); }
.mygroups a:hover { color: var(--green); }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.step { padding: 16px; border-radius: 14px; background: var(--bg-2); }
.step .n { font-family: var(--display); font-size: 1.6rem; color: var(--red); }
.step p { font-size: .92rem; color: var(--muted); margin-top: 4px; }
.step b { color: var(--ink); display: block; }

/* participant page */
.center { text-align: center; }
.gift-stage { display: grid; place-items: center; padding: 28px 0 8px; }
.gift {
  position: relative; width: 190px; height: 190px; cursor: pointer;
  border: 0; background: none; padding: 0;
  filter: drop-shadow(0 18px 24px rgb(0 0 0 / .18));
  animation: wobble 3.2s ease-in-out infinite;
}
.gift:focus-visible { outline: 3px solid var(--green); outline-offset: 10px; border-radius: 16px; }
.gift .box { position: absolute; left: 15px; right: 15px; bottom: 0; height: 120px; background: var(--red); border-radius: 10px; }
.gift .lid { position: absolute; left: 0; right: 0; top: 46px; height: 38px; background: var(--red); border-radius: 10px; filter: brightness(1.12); transition: transform .6s cubic-bezier(.3,1.6,.5,1), opacity .6s; z-index: 2; }
.gift .ribbon-v { position: absolute; left: 50%; width: 26px; margin-left: -13px; top: 46px; bottom: 0; background: var(--gold); z-index: 3; transition: transform .6s, opacity .6s; }
.gift .bow { position: absolute; top: 6px; left: 50%; width: 80px; height: 46px; margin-left: -40px; z-index: 4; transition: transform .6s cubic-bezier(.3,1.6,.5,1), opacity .6s; }
.gift .bow::before, .gift .bow::after {
  content: ""; position: absolute; top: 8px; width: 38px; height: 34px; border: 9px solid var(--gold); border-radius: 50% 50% 10% 50%;
}
.gift .bow::before { left: 0; transform: rotate(-20deg); }
.gift .bow::after { right: 0; transform: scaleX(-1) rotate(-20deg); }
.gift.open { animation: none; }
.gift.open .lid { transform: translateY(-90px) rotate(-18deg); opacity: 0; }
.gift.open .bow { transform: translateY(-120px) rotate(25deg); opacity: 0; }
.gift.open .ribbon-v { opacity: 0; }
@keyframes wobble { 0%, 100% { transform: rotate(0) } 88% { transform: rotate(0) } 92% { transform: rotate(-4deg) } 96% { transform: rotate(4deg) } }

.result { display: none; }
.result.show { display: block; animation: pop .6s cubic-bezier(.3,1.5,.5,1); }
.result .receiver {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.4rem, 11vw, 4.2rem); line-height: 1.05;
  color: var(--red); margin: 6px 0 4px; word-break: break-word;
}
@keyframes pop { from { transform: scale(.7); opacity: 0 } to { transform: scale(1); opacity: 1 } }

.facts { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.fact { padding: 10px 14px; border-radius: 12px; background: var(--bg-2); font-size: .9rem; }
.fact b { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.note { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--gold-soft); text-align: left; white-space: pre-wrap; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-weight: 600; font-size: .92rem; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* global admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input { flex: 1 1 220px; padding: 8px 12px; }
.table-scroll { overflow-x: auto; margin: 0 -8px; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 0; white-space: nowrap; }
.admin-table tr.sel td { background: var(--green-soft); }
.admin-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green); }
.admin-table .gname { font-weight: 600; text-decoration: none; }
.admin-table .mono { font-size: .75rem; }

.footer { text-align: center; margin-top: 40px; font-size: .85rem; color: var(--muted); }
.hidden { display: none !important; }

@media (max-width: 520px) {
  .card { padding: 18px; }
  .wrap { padding-top: 22px; }
  .pactions { width: 100%; }
  .pactions .btn { flex: 1; }
}

/* =====================================================================
   ✨ FX – the fancy layer
   ===================================================================== */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }
body.no-scroll { overflow: hidden; }

/* snow */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.snow span {
  position: absolute; top: -30px; color: var(--muted); line-height: 1;
  animation-name: fall, sway; animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite; animation-direction: normal, alternate;
}
@media (prefers-color-scheme: dark) { .snow span { color: #dfe9e3; } }
@keyframes fall { to { top: 105vh; } }
@keyframes sway { from { transform: translateX(-18px) rotate(-20deg); } to { transform: translateX(18px) rotate(20deg); } }

/* entrance */
.enter { animation: enter .7s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes enter { from { opacity: 0; transform: translateY(26px) scale(.97); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* shimmering text */
.shine {
  background: linear-gradient(100deg, var(--red) 0%, var(--gold) 25%, var(--green) 50%, var(--gold) 75%, var(--red) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: -250% 0; } }

/* floating ornaments in the hero */
.hero { position: relative; }
.ornaments { position: absolute; inset: -20px -10px auto auto; width: 46%; height: 150px; pointer-events: none; }
.ornaments span { position: absolute; font-size: 28px; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .15)); }
.ornaments span:nth-child(1) { right: 6%;  top: 0;    animation-delay: 0s; }
.ornaments span:nth-child(2) { right: 32%; top: 18px; animation-delay: -1s; font-size: 22px; }
.ornaments span:nth-child(3) { right: 58%; top: -6px; animation-delay: -2s; }
.ornaments span:nth-child(4) { right: 18%; top: 78px; animation-delay: -3s; font-size: 20px; }
.ornaments span:nth-child(5) { right: 46%; top: 70px; animation-delay: -4s; font-size: 24px; }
.ornaments span:nth-child(6) { right: 76%; top: 40px; animation-delay: -5s; font-size: 22px; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-14px) rotate(8deg); } }
@media (max-width: 600px) { .ornaments { top: -78px; right: 0; width: 62%; height: 60px; } .ornaments span { font-size: 20px !important; } }

/* buttons: shine sweep + glow */
.btn { position: relative; overflow: hidden; }
.btn-primary::after, .btn-red::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .45), transparent);
  transition: transform .7s;
}
.btn-primary:hover::after, .btn-red:hover::after { transform: translateX(120%) skewX(-20deg); }
.btn-glow { animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgb(200 16 46 / .0), var(--shadow); } 50% { box-shadow: 0 0 0 8px rgb(200 16 46 / .14), 0 10px 30px -6px rgb(200 16 46 / .55); } }
.card { transition: transform .25s, box-shadow .25s; }

/* names editor rows */
.name-row { animation: rowIn .38s cubic-bezier(.2, 1.3, .4, 1) both; }
.name-row.leaving { animation: rowOut .26s ease-in forwards; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-24px) scale(.95); } }
@keyframes rowOut { to { opacity: 0; transform: translateX(40px) scale(.9); height: 0; margin: -4px 0; } }
.name-row .num { transition: background .2s, color .2s, transform .3s; }
.name-row:focus-within .num { background: var(--red); color: #fff; transform: scale(1.12) rotate(-8deg); }

/* ---------- draw show overlay ---------- */
.ds-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 16px; overflow: hidden; color: #fff; text-align: center;
  background: radial-gradient(circle at 50% 45%, #1f6f4a 0%, #0f3d2a 45%, #07160f 100%);
  opacity: 0; transition: opacity .35s;
}
.ds-overlay.show { opacity: 1; }
.ds-rays {
  position: absolute; left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg, rgb(255 255 255 / .06) 0deg 8deg, transparent 8deg 20deg);
  animation: spin 30s linear infinite; pointer-events: none;
}
.ds-overlay.finale .ds-rays { animation-duration: 6s; background: repeating-conic-gradient(from 0deg, rgb(255 209 102 / .16) 0deg 8deg, transparent 8deg 20deg); }
@keyframes spin { to { transform: rotate(360deg); } }
.ds-head { position: relative; z-index: 2; min-height: 92px; }
.ds-title { color: #fff; font-size: clamp(1.7rem, 6vw, 2.8rem); text-shadow: 0 4px 24px rgb(0 0 0 / .4); }
.ds-sub { color: rgb(255 255 255 / .75); margin-top: 6px; }
.ds-letter { display: inline-block; animation: letterPop .7s cubic-bezier(.2, 1.8, .4, 1) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes letterPop { from { opacity: 0; transform: translateY(40px) scale(.2) rotate(-30deg); } }

.ds-stage { position: relative; z-index: 2; perspective: 900px; }
.ds-orbit { position: absolute; inset: 0; }
.ds-stage.spinning .ds-orbit { animation: orbit 2.6s cubic-bezier(.5, 0, .5, 1) infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.ds-card {
  position: absolute; left: 50%; top: 50%;
  transition: transform .8s cubic-bezier(.5, -0.35, .3, 1.4), opacity .4s;
}
.ds-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.4, 1.6, .5, 1); }
.ds-card.flipped .ds-inner { transform: rotateY(180deg); }
.ds-face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 10px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; font-weight: 700; padding: 4px;
  box-shadow: 0 8px 20px -6px rgb(0 0 0 / .5);
}
.ds-front { background: #fffdf8; color: #1f2a24; overflow: hidden; }
.ds-front span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ds-back {
  transform: rotateY(180deg); font-size: 1.4em;
  background: repeating-linear-gradient(45deg, #c8102e 0 10px, #e0233f 10px 20px);
  border: 3px solid #ffd166;
}

.ds-lock {
  position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; z-index: 3;
  display: grid; place-items: center; opacity: 0; transform: scale(.2); pointer-events: none;
  transition: transform .6s cubic-bezier(.2, 1.8, .4, 1), opacity .3s;
}
.ds-lock.show { opacity: 1; transform: scale(1); }
.ds-lock-icon { font-size: 84px; filter: drop-shadow(0 0 30px rgb(255 209 102 / .8)); animation: lockPulse 1s ease-in-out infinite; position: relative; z-index: 2; }
.ds-lock i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgb(255 209 102 / .7); animation: ring 1.8s ease-out infinite; }
.ds-lock i:nth-child(3) { animation-delay: .6s; }
.ds-lock i:nth-child(4) { animation-delay: 1.2s; }
.ds-lock.done .ds-lock-icon { animation: lockDone .8s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes lockPulse { 50% { transform: scale(1.12) rotate(-6deg); } }
@keyframes lockDone { 0% { transform: scale(.4) rotate(-90deg); } 100% { transform: scale(1.3); } }
@keyframes ring { from { transform: scale(.5); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.ds-cipher {
  position: absolute; left: 0; right: 0; bottom: 120px; z-index: 3; opacity: 0; transition: opacity .3s;
  font-size: .9rem; color: #9ef0c4; text-shadow: 0 0 10px rgb(6 214 160 / .6); line-height: 1.8; overflow: hidden; white-space: nowrap;
}
.ds-cipher.show { opacity: 1; }
.ds-overlay.finale .ds-stage, .ds-overlay.finale .ds-cipher { opacity: 0; transition: opacity .8s 1.6s; }
.ds-foot { position: absolute; bottom: 28px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; z-index: 4; }
.ds-skip { color: rgb(255 255 255 / .6); }
.ds-skip:hover { color: #fff; border-color: rgb(255 255 255 / .3); }
.ds-go { animation: enter .6s cubic-bezier(.2, 1.5, .4, 1) both, glow 2s 0.6s infinite; }

/* ---------- participant page ---------- */
.bounce-letter { display: inline-block; animation: letterPop .8s cubic-bezier(.2, 1.8, .4, 1) both, bob 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * 60ms), calc(var(--i) * 120ms + 1s); }
@keyframes bob { 50% { transform: translateY(-5px); } }
.pulse { animation: pulseTxt .9s ease-in-out infinite; font-weight: 600; color: var(--red) !important; }
@keyframes pulseTxt { 50% { transform: scale(1.08); } }

.gift-stage { position: relative; min-height: 290px; padding: 40px 0 10px; }
.gift-halo {
  position: absolute; left: 50%; top: 50%; width: 420px; height: 420px; margin: -230px 0 0 -210px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgb(255 209 102 / .22) 0deg 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%);
  animation: spin 18s linear infinite; pointer-events: none; transition: transform .4s, opacity .4s;
}
.gift-stage[data-level="1"] .gift-halo { transform: scale(1.15); animation-duration: 9s; }
.gift-stage[data-level="2"] .gift-halo { transform: scale(1.35); animation-duration: 4s; filter: saturate(2); }
.gift-stage[data-level="3"] .gift-halo { transform: scale(1.7); animation-duration: 1.2s; filter: saturate(3) brightness(1.3); }
.gift-stage.boom .gift-halo { transform: scale(5); opacity: 0; transition: transform .7s ease-out, opacity .7s; }
.gift-sparkles { position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin-top: -20px; animation: spin 7s linear infinite; pointer-events: none; }
.gift-sparkles span { position: absolute; font-size: 20px; animation: twinkle 1.6s ease-in-out infinite; }
.gift-sparkles span:nth-child(1) { transform: translate(-150px, -10px); }
.gift-sparkles span:nth-child(2) { transform: translate(120px, -90px); animation-delay: -.4s; }
.gift-sparkles span:nth-child(3) { transform: translate(110px, 90px); animation-delay: -.8s; }
.gift-sparkles span:nth-child(4) { transform: translate(-100px, 100px); animation-delay: -1.2s; }
@keyframes twinkle { 50% { opacity: .2; scale: .6; } }
.gift { z-index: 2; transition: transform .2s; }
.gift:hover { transform: scale(1.05); }
.gift.shake { animation: shake .55s cubic-bezier(.36, .07, .19, .97) both; }
.gift-stage[data-level="2"] .gift.shake { animation: shakeHard .6s cubic-bezier(.36, .07, .19, .97) both; }
.gift.rumble { animation: rumble .09s linear infinite; filter: drop-shadow(0 0 40px rgb(255 209 102 / .9)) brightness(1.15); }
@keyframes shake { 20%, 60% { transform: rotate(-9deg) scale(1.06); } 40%, 80% { transform: rotate(9deg) scale(1.06); } }
@keyframes shakeHard { 10%, 50%, 90% { transform: rotate(-16deg) scale(1.14) translateY(-8px); } 30%, 70% { transform: rotate(16deg) scale(1.14) translateY(-8px); } }
@keyframes rumble { 0% { transform: translate(3px, -2px) rotate(3deg) scale(1.15); } 50% { transform: translate(-3px, 2px) rotate(-3deg) scale(1.18); } 100% { transform: translate(2px, 3px) rotate(2deg) scale(1.15); } }
.gift.open { animation: none; transform: scale(1.2); }
.gift.open .box { animation: boxPop .5s ease-out forwards; }
@keyframes boxPop { to { transform: scale(.2) translateY(60px); opacity: 0; } }
.gift.open .lid { transform: translateY(-260px) rotate(-60deg); opacity: 0; transition-duration: .7s; }
.gift.open .bow { transform: translateY(-340px) rotate(200deg) scale(1.4); opacity: 0; transition-duration: .8s; }
.taps { display: flex; gap: 10px; justify-content: center; margin-top: 26px; }
.taps i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); transition: background .2s, transform .3s cubic-bezier(.2, 2, .4, 1); }
.taps i.on { background: var(--red); transform: scale(1.4); box-shadow: 0 0 12px var(--red); }

.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 65; }
.flash.go { animation: flash .7s ease-out; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: .95; } 100% { opacity: 0; } }

.result.show { animation: resultIn .9s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes resultIn { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.glow-card { position: relative; border: 0; isolation: isolate; }
.glow-card::before {
  content: ""; position: absolute; inset: -3px; border-radius: calc(var(--radius) + 3px); z-index: -2;
  background: conic-gradient(from var(--ang, 0deg), var(--red), var(--gold), var(--green), var(--gold), var(--red));
  animation: angle 3s linear infinite;
}
.glow-card::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); background: var(--card); z-index: -1; }
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes angle { to { --ang: 360deg; } }
.result .receiver { min-height: 1.1em; }
.result .receiver.landed {
  background: linear-gradient(100deg, var(--red), var(--gold), var(--red)); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: landed .7s cubic-bezier(.2, 2, .4, 1), shine 3s linear infinite;
}
.result .receiver.spinning { color: var(--ink); }
.result .receiver.tick { animation: reel .14s ease-out; }
@keyframes reel { from { transform: translateY(-45%); opacity: .2; filter: blur(1.5px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes landed { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }

/* ---------- admin page ---------- */
#checks li:not(.pop) { opacity: 0; transform: translateX(-12px); }
#checks li { transition: opacity .3s, transform .4s cubic-bezier(.2, 1.6, .4, 1); }
#checks li.pop .ic { animation: tick .5s cubic-bezier(.2, 2.2, .4, 1); }
@keyframes tick { from { transform: translateY(5px) scale(0) rotate(-120deg); } }
.pair { transition: transform .2s, border-color .2s; }
.pair:hover { transform: translateY(-2px) scale(1.03); border-color: var(--red); border-style: solid; }
.progress > i { background: linear-gradient(90deg, var(--green), #3fcf8e, var(--green)); background-size: 200% 100%; animation: shine 2.5s linear infinite; }
.decrypt { font-family: var(--mono); }
.decrypt.landed { font-family: var(--font); animation: landed .5s cubic-bezier(.2, 2, .4, 1); display: inline-block; }
.avatar { transition: transform .3s cubic-bezier(.2, 2, .4, 1); }
.plist li:hover .avatar { transform: scale(1.15) rotate(-10deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  #checks li:not(.pop) { opacity: 1; transform: none; }
}
