:root {
  --ember: #ff6b35;
  --flame: #ffbf33;
  --charcoal: #211f21;
  --charcoal-2: #2c282b;
  --plate: #faf7f0;
  --rim: #e0d9cc;
  --paid: #33c773;
  --ink-soft: rgba(250, 247, 240, 0.72);
  --ink-faint: rgba(250, 247, 240, 0.5);
  --radius: 28px;
  --font: ui-rounded, "SF Pro Rounded", "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% 110%, rgba(255, 107, 53, 0.35), transparent 60%),
    radial-gradient(80% 40% at 50% -10%, rgba(255, 191, 51, 0.12), transparent 70%),
    var(--charcoal);
  color: var(--plate);
  font-family: var(--font);
  font-weight: 600;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

.page {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 16px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/* Plate logo ----------------------------------------------------------- */

.plate {
  position: relative;
  width: var(--size, 120px);
  height: var(--size, 120px);
  border-radius: 50%;
  background: var(--plate);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 50px rgba(255, 107, 53, 0.45);
  display: grid;
  place-items: center;
  color: var(--ember);
  animation: wobble 2.4s ease-in-out infinite alternate;
}

.plate::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: calc(var(--size, 120px) * 0.07) solid var(--rim);
}

.plate svg {
  position: relative;
  width: 42%;
  height: 42%;
}

@keyframes wobble {
  from { transform: rotate(-4deg); }
  to { transform: rotate(4deg); }
}

.emblem {
  display: block;
  height: auto;
  max-width: 60vw;
  filter: drop-shadow(0 16px 36px rgba(255, 107, 53, 0.45));
  animation: wobble 2.4s ease-in-out infinite alternate;
}

/* Type ------------------------------------------------------------------ */

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

h1 .hot { color: var(--ember); }

.lede {
  margin: 0;
  max-width: 30ch;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

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

/* Buttons --------------------------------------------------------------- */

.actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  appearance: none;
  border: 0;
  width: 100%;
  min-height: 58px;
  padding: 0 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.94); }

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

.btn svg { width: 22px; height: 22px; flex: none; }

.btn-primary {
  background: var(--ember);
  color: #fff;
  box-shadow: 0 10px 28px rgba(255, 107, 53, 0.5), inset 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.btn-secondary {
  background: var(--plate);
  color: var(--charcoal);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--plate);
  box-shadow: inset 0 0 0 2px rgba(250, 247, 240, 0.3);
}

.btn[aria-busy="true"] { opacity: 0.75; pointer-events: none; }

/* Cards ----------------------------------------------------------------- */

.card {
  width: 100%;
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(250, 247, 240, 0.07);
  border: 1px solid rgba(250, 247, 240, 0.12);
  text-align: left;
}

.features {
  width: 100%;
  display: grid;
  gap: 12px;
}

.feature {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
}

.feature .icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 191, 51, 0.15);
  color: var(--flame);
}

.feature .icon svg { width: 24px; height: 24px; }

.feature h3 { margin: 0 0 2px; font-size: 1.05rem; font-weight: 800; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* Invite code ----------------------------------------------------------- */

.ticket {
  width: 100%;
  padding: 22px 16px 24px;
  border-radius: var(--radius);
  background: var(--plate);
  color: var(--charcoal);
  box-shadow: 0 18px 44px rgba(255, 107, 53, 0.35), inset 0 0 0 5px var(--plate), inset 0 0 0 8px rgba(255, 107, 53, 0.55);
}

.ticket .kicker { color: rgba(33, 31, 33, 0.55); }

.code {
  margin: 12px 0 0;
  display: flex;
  justify-content: center;
  gap: clamp(4px, 2vw, 8px);
}

.code span {
  width: clamp(44px, 14vw, 58px);
  height: clamp(58px, 18vw, 72px);
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 107, 53, 0.14);
  font-size: clamp(2rem, 10vw, 2.8rem);
  font-weight: 900;
  animation: drop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.code span:nth-child(2) { animation-delay: 0.06s; }
.code span:nth-child(3) { animation-delay: 0.12s; }
.code span:nth-child(4) { animation-delay: 0.18s; }
.code span:nth-child(5) { animation-delay: 0.24s; }

@keyframes drop {
  from { transform: translateY(-48px) rotate(-12deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  color: var(--ink-soft);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ember);
  color: #fff;
  font-weight: 900;
}

.note {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-faint);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 3;
  transform: translate(-50%, 140%);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--paid);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s linear 0.45s;
  max-width: calc(100% - 32px);
  visibility: hidden;
}

.toast.show {
  transform: translate(-50%, 0);
  visibility: visible;
  transition-delay: 0s;
}

.code-form {
  width: 100%;
  display: flex;
  gap: 10px;
}

.code-form input {
  flex: 1;
  min-width: 0;
  min-height: 58px;
  border-radius: 18px;
  border: 2px solid rgba(250, 247, 240, 0.25);
  background: rgba(250, 247, 240, 0.08);
  color: var(--plate);
  font: inherit;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}

.code-form .btn { width: auto; }

[hidden] { display: none !important; }

footer {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

footer nav { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; }

/* Legal pages (privacy, terms) ----------------------------------------- */

.page.legal { max-width: 720px; }

.legal .doc {
  width: 100%;
  padding: 28px 22px;
  border-radius: var(--radius);
  background: rgba(250, 247, 240, 0.06);
  border: 1px solid rgba(250, 247, 240, 0.1);
  text-align: left;
  font-weight: 500;
  color: var(--ink-soft);
}

.legal .doc h2 {
  margin: 28px 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--plate);
}

.legal .doc h2:first-child { margin-top: 0; }

.legal .doc p, .legal .doc ul { margin: 0 0 12px; }
.legal .doc ul { padding-left: 20px; }
.legal .doc li { margin-bottom: 6px; }
.legal .doc strong { color: var(--plate); font-weight: 700; }
.legal .doc a { color: var(--flame); }
.legal .updated { margin: 0; font-size: 0.9rem; color: var(--ink-faint); }

/* Flames ---------------------------------------------------------------- */

.flames {
  position: fixed;
  inset: auto 0 0 0;
  height: 220px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  filter: blur(14px);
  mix-blend-mode: screen;
}

.flames i {
  position: absolute;
  bottom: -60px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle, var(--flame), var(--ember) 60%, transparent 72%);
  opacity: 0;
  animation: rise var(--d) linear infinite;
  animation-delay: var(--delay);
}

@keyframes rise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  15% { opacity: 0.8; }
  100% { transform: translateY(-220px) scale(0.3); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .plate, .emblem, .code span, .flames i { animation: none; }
  .flames i { opacity: 0.35; bottom: -40px; }
  .btn, .toast { transition: none; }
}
