/*
 * Supporter thank-you. One authored moment: a black-metal membership card is presented in a bloom of gold light.
 * Everything that moves is transform or opacity (compositor only); the particles are one canvas.
 * Gold is reserved for supporters; mint stays the action colour.
 */
.ks-celebrate {
  --ks-gold: #d4af37;
  --ks-gold-hi: #f3d98b;
  --ks-gold-lo: #8a6a1c;
  --ks-ease: cubic-bezier(0.16, 1, 0.3, 1);
  position: fixed; inset: 0; z-index: 100100;
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(5, 6, 10, 0.78);
  -webkit-backdrop-filter: blur(12px) saturate(1.15); backdrop-filter: blur(12px) saturate(1.15);
  perspective: 1400px;
  animation: ks-fade 0.45s ease both;
}
.ks-celebrate.is-leaving { animation: ks-out 0.3s ease-in forwards; pointer-events: none; }
.ks-celebrate.is-leaving .ks-card { animation: ks-card-out 0.3s ease-in forwards; }

.ks-canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }

/* Light blooming from behind the card. */
.ks-glow {
  position: absolute; left: 50%; top: 50%; width: min(1100px, 150vmax); aspect-ratio: 1; margin: calc(min(1100px, 150vmax) / -2) 0 0 calc(min(1100px, 150vmax) / -2);
  background: radial-gradient(closest-side, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.1) 45%, rgba(212, 175, 55, 0) 72%);
  pointer-events: none; will-change: transform, opacity;
  animation: ks-bloom 1.8s var(--ks-ease) both, ks-breathe 7s 1.8s ease-in-out infinite;
}

.ks-card {
  position: relative; isolation: isolate; width: 100%; max-width: 440px;
  padding: 44px 32px 26px; text-align: center; border-radius: 24px;
  background: linear-gradient(180deg, #171b26 0%, #0e1118 62%);
  box-shadow: 0 44px 90px -24px rgba(0, 0, 0, 0.85), 0 30px 100px -36px rgba(212, 175, 55, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform-origin: 50% 70%; will-change: transform, opacity;
  animation: ks-present 1s 0.12s var(--ks-ease) both;
}
/* Gold hairline edge, brighter at the corners like polished metal. */
.ks-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1; pointer-events: none;
  background: linear-gradient(155deg, rgba(243, 217, 139, 0.95), rgba(212, 175, 55, 0.22) 32%, rgba(138, 106, 28, 0.12) 62%, rgba(243, 217, 139, 0.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* One pass of light across the metal once the card has settled. */
.ks-foil { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 0; }
.ks-foil::before {
  content: ''; position: absolute; top: -10%; bottom: -10%; left: 0; width: 48%;
  background: linear-gradient(105deg, transparent 18%, rgba(255, 244, 214, 0.1) 42%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 244, 214, 0.1) 58%, transparent 82%);
  transform: translateX(-150%) skewX(-16deg); will-change: transform;
  animation: ks-foil 1.7s 1s var(--ks-ease) both;
}
.ks-card > :not(.ks-foil) { position: relative; z-index: 1; }

.ks-crest { position: relative; width: 84px; height: 84px; margin: 0 auto 22px; }
.ks-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(243, 217, 139, 0.6); opacity: 0; will-change: transform, opacity; animation: ks-ring 2s 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.ks-ring-2 { animation-delay: 0.95s; }
.ks-star {
  position: absolute; inset: 6px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #2a1f05;
  background: linear-gradient(145deg, #f7e5a8 0%, var(--ks-gold) 52%, var(--ks-gold-lo) 100%);
  box-shadow: 0 12px 26px -8px rgba(212, 175, 55, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.6), inset 0 -3px 6px rgba(90, 64, 8, 0.45);
  will-change: transform, opacity; animation: ks-stamp 0.8s 0.4s var(--ks-ease) both;
}
.ks-star svg { width: 30px; height: 30px; }

.ks-title { margin: 0; font-family: Outfit, Inter, sans-serif; color: #fff; }
.ks-line { display: block; overflow: hidden; padding-bottom: 0.12em; }
.ks-line-in { display: block; will-change: transform; animation: ks-line 0.9s var(--ks-ease) both; }
.ks-title-main { font-weight: 800; font-size: clamp(2.3rem, 9vw, 3rem); line-height: 1.05; letter-spacing: -0.025em; animation-delay: 0.62s; text-wrap: balance; }
.ks-title-sub { margin-top: 2px; font-weight: 500; font-size: 1.1rem; line-height: 1.3; letter-spacing: 0.01em; color: var(--ks-gold-hi); animation-delay: 0.76s; }

.ks-copy { margin: 14px auto 0; max-width: 34ch; color: hsl(240, 5%, 76%); font-size: 0.95rem; line-height: 1.6; animation: ks-up 0.8s 1s var(--ks-ease) both; text-wrap: pretty; }
.ks-plaque {
  display: inline-block; margin-top: 18px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.45); background: rgba(212, 175, 55, 0.08); color: var(--ks-gold-hi);
  font: 600 0.7rem/1 Inter, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; animation: ks-up 0.8s 1.1s var(--ks-ease) both;
}
.ks-perks {
  list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; animation: ks-up 0.8s 1.2s var(--ks-ease) both;
}
.ks-perks li { display: inline-flex; align-items: center; gap: 8px; color: hsl(240, 5%, 78%); font-size: 0.82rem; line-height: 1.3; }
.ks-perks svg { width: 16px; height: 16px; flex: none; color: var(--ks-gold); }

.ks-continue {
  margin-top: 24px; min-height: 48px; padding: 0 36px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--accent, var(--k-mint, #00f5a0)); color: var(--on-accent, #04130d); font: 700 0.95rem Inter, sans-serif;
  box-shadow: 0 12px 26px -12px rgba(var(--k-mint-rgb, 0, 245, 160), 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease; animation: ks-up 0.8s 1.3s var(--ks-ease) both;
}
.ks-continue:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(var(--k-mint-rgb, 0, 245, 160), 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.ks-continue:active { transform: scale(0.98); }
.ks-continue:focus-visible { outline: 2px solid rgba(243, 217, 139, 0.9); outline-offset: 4px; }

/* An open hand, not a hard sell: quiet, below the main action. */
.ks-tip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-top: 8px; padding: 0 14px; border-radius: 10px; color: hsl(240, 5%, 70%); font: 500 0.82rem Inter, sans-serif; text-decoration: none; transition: color 0.18s ease, background-color 0.18s ease; animation: ks-up 0.8s 1.4s var(--ks-ease) both; }
.ks-tip svg { width: 15px; height: 15px; color: var(--ks-gold); flex: none; }
.ks-tip:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.ks-tip:focus-visible { outline: 2px solid rgba(243, 217, 139, 0.9); outline-offset: 2px; }

@media (max-width: 480px) {
  .ks-card { padding: 38px 22px 22px; border-radius: 22px; }
  .ks-perks { flex-direction: column; align-items: center; gap: 10px; }
  .ks-continue { width: 100%; }
}

@keyframes ks-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ks-out { to { opacity: 0; } }
@keyframes ks-card-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes ks-present { from { opacity: 0; transform: translateY(34px) rotateX(14deg) scale(0.95); } to { opacity: 1; transform: none; } }
@keyframes ks-bloom { from { opacity: 0; transform: scale(0.55); } to { opacity: 1; transform: scale(1); } }
@keyframes ks-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }
@keyframes ks-stamp { 0% { opacity: 0; transform: scale(1.7); } 55% { opacity: 1; transform: scale(0.93); } 100% { opacity: 1; transform: scale(1); } }
@keyframes ks-ring { 0% { opacity: 0.6; transform: scale(0.7); } 100% { opacity: 0; transform: scale(2.3); } }
@keyframes ks-line { from { transform: translateY(110%); } to { transform: none; } }
@keyframes ks-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ks-foil { to { transform: translateX(330%) skewX(-16deg); } }

/* Still version: the same card, no motion beyond a quick fade. */
.ks-celebrate.is-still { animation: ks-fade 0.2s ease both; }
.ks-celebrate.is-still .ks-card, .ks-celebrate.is-still .ks-glow, .ks-celebrate.is-still .ks-star, .ks-celebrate.is-still .ks-line-in,
.ks-celebrate.is-still .ks-tip, .ks-celebrate.is-still .ks-copy, .ks-celebrate.is-still .ks-plaque, .ks-celebrate.is-still .ks-perks, .ks-celebrate.is-still .ks-continue { animation: none; }
.ks-celebrate.is-still .ks-ring, .ks-celebrate.is-still .ks-foil { display: none; }
.ks-celebrate.is-still .ks-glow { opacity: 0.8; }
@media (prefers-reduced-motion: reduce) {
  .ks-celebrate { animation: ks-fade 0.2s ease both; }
  .ks-celebrate .ks-card, .ks-celebrate .ks-glow, .ks-celebrate .ks-star, .ks-celebrate .ks-line-in,
  .ks-celebrate .ks-tip, .ks-celebrate .ks-copy, .ks-celebrate .ks-plaque, .ks-celebrate .ks-perks, .ks-celebrate .ks-continue { animation: none; }
  .ks-celebrate .ks-ring, .ks-celebrate .ks-foil { display: none; }
  .ks-celebrate .ks-glow { opacity: 0.8; }
  .ks-continue { transition: none; }
}

/* ---- Supporter pack: accent swatches (sidebar) and the supporter avatar group (picker) ---- */
.kap-accent-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px 0 4px; }
.kap-accent-swatch { position: relative; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.12); background: var(--sw); cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.kap-accent-swatch:hover { transform: scale(1.08); }
.kap-accent-swatch.is-on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14); }
.kap-accent-swatch.is-locked { filter: saturate(0.55) brightness(0.8); }
.kap-accent-swatch:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.kap-accent-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(0, 0, 0, 0.75); }
.kap-accent-note { margin: 8px 0 0; font-size: 0.74rem; line-height: 1.45; color: hsl(240, 5%, 62%); }
.kap-accent-note.is-nudged, .kap-av-sup-note.is-nudged { animation: kap-nudge 0.5s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)); color: #f3d98b; }
@keyframes kap-nudge { 0% { transform: translateX(0); } 25% { transform: translateX(-4px); } 60% { transform: translateX(3px); } 100% { transform: translateX(0); } }

.kap-av-sup-group .kap-av-group-title { color: #f3d98b; }
.kap-av-tile.kap-av-sup { position: relative; background: #0e1118; border-color: transparent; }
.kap-av-tile.kap-av-sup.is-on { border-color: #fff; box-shadow: 0 0 0 3px #d4af37; }
.kap-av-tile.is-locked img { filter: grayscale(0.75) brightness(0.55); }
.kap-av-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #f3d98b; }
@media (prefers-reduced-motion: reduce) { .kap-accent-note.is-nudged, .kap-av-sup-note.is-nudged { animation: none; } .kap-accent-swatch { transition: none; } }
