@font-face {
  font-family: "TikTok Sans";
  src: url("assets/fonts/tiktok-sans-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #050506;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.38);
  --panel: rgba(20, 20, 22, 0.74);
  --panel-hi: rgba(34, 34, 38, 0.72);
  --border: rgba(255, 255, 255, 0.12);
  --border-hi: rgba(255, 255, 255, 0.28);
  --live: #22c55e;
  --error: #ff6b6b;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "TikTok Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- background ---------- */

#chart {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(255, 255, 255, 0.09), transparent 70%),
    radial-gradient(80% 60% at 50% 110%, rgba(255, 255, 255, 0.05), transparent 70%);
}

/* ---------- layout ---------- */

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: max(48px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- profile ---------- */

.profile {
  text-align: center;
  margin-bottom: 14px;
}

.avatar {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1d1d20, #0b0b0c);
  box-shadow: 0 0 0 1px var(--border-hi), 0 18px 50px rgba(0, 0, 0, 0.6);
}

.avatar::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  padding: 1.5px;
  background: conic-gradient(from 0deg, transparent 0 60%, rgba(255, 255, 255, 0.9) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: spin 5s linear infinite;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar span {
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.handle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.bio {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- live pill ---------- */

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 10px var(--live);
}

.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--live);
  animation: ping 1.8s var(--ease) infinite;
}

/* ---------- main CTA ---------- */

.seat {
  position: relative;
  border-radius: var(--radius);
}

.seat-open {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "live arrow" "title arrow";
  align-items: center;
  row-gap: 6px;
  padding: 20px 22px;
  border: 0;
  border-radius: var(--radius);
  background: #ffffff;
  color: #050506;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 20px 60px rgba(255, 255, 255, 0.12);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.3s var(--ease);
}

.seat-open:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px #fff, 0 24px 70px rgba(255, 255, 255, 0.2); }
.seat-open:active { transform: scale(0.985); }
.seat-open:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

.seat-open .live { grid-area: live; color: rgba(5, 5, 6, 0.7); }
.seat-open .dot { background: #16a34a; box-shadow: none; }
.seat-open .dot::after { background: #16a34a; }

.seat-title {
  grid-area: title;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.seat-open .arrow {
  grid-area: arrow;
  width: 26px;
  height: 26px;
  margin-left: 12px;
  transition: transform 0.25s var(--ease);
}

.seat-open:hover .arrow { transform: translateX(4px); }

.shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  mix-blend-mode: soft-light;
  transform: translateX(-120%);
  animation: shine 3.6s var(--ease) 1.2s infinite;
}

/* panel that the button opens into */

.seat-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}

.seat-inner {
  overflow: hidden;
  min-height: 0;
}

.seat[data-state="open"] .seat-open,
.seat[data-state="done"] .seat-open {
  position: absolute;
  inset: 0 0 auto 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

.seat[data-state="open"] .seat-panel,
.seat[data-state="done"] .seat-panel {
  grid-template-rows: 1fr;
}

.seat-form,
.seat-done {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel-hi);
  border: 1px solid var(--border-hi);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
}

.seat-form { display: flex; flex-direction: column; gap: 12px; }
.seat-form .live { color: var(--muted); }

.seat-label {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.field {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field:focus-within { border-color: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.07); }
.field.invalid { border-color: var(--error); }

.field input {
  flex: 1;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zoom on focus */
  outline: none;
}

.field input::placeholder { color: var(--faint); }

.submit {
  position: relative;
  flex: none;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #050506;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}

.submit:active { transform: scale(0.97); }
.submit:disabled { cursor: progress; }
.submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(5, 5, 6, 0.2);
  border-top-color: #050506;
  opacity: 0;
  animation: spin 0.7s linear infinite;
}

.submit.loading .submit-text { opacity: 0; }
.submit.loading .spinner { opacity: 1; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.msg {
  margin: 0;
  min-height: 1em;
  font-size: 13px;
  color: var(--faint);
}

.msg.error { color: var(--error); }
.msg:empty { display: none; }

/* success */

.seat-done {
  display: none;
  text-align: center;
  padding: 26px 20px;
  outline: none;
}

.seat[data-state="done"] .seat-form { display: none; }
.seat[data-state="done"] .seat-done { display: block; animation: rise 0.6s var(--ease) both; }

.check {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #050506;
  animation: pop 0.6s var(--ease) both;
}

.check svg { width: 26px; height: 26px; }
.check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 0.5s 0.25s var(--ease) forwards; }

.done-title { margin: 0; font-size: 20px; font-weight: 800; }
.done-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }

/* ---------- link cards ---------- */

.link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s;
}

.link:hover { transform: translateY(-2px); background: var(--panel-hi); border-color: var(--border-hi); }
.link:active { transform: scale(0.985); }
.link:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

.link .icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #5865f2;
}

.link .icon svg { width: 24px; height: 24px; fill: #fff; }

.link-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.link-title { font-size: 17px; font-weight: 700; }
.link-sub { font-size: 13px; color: var(--muted); }

.link .arrow { width: 20px; height: 20px; color: var(--faint); transition: transform 0.25s var(--ease), color 0.25s; }
.link:hover .arrow { transform: translate(2px, -2px); color: #fff; }

/* ---------- socials ---------- */

.socials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.social {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s;
}

.social svg { width: 24px; height: 24px; fill: currentColor; }
.social:hover { transform: translateY(-2px); background: var(--panel-hi); border-color: var(--border-hi); }
.social:active { transform: scale(0.97); }
.social:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.social.disabled { color: var(--faint); pointer-events: none; }

.soon {
  position: absolute;
  top: -8px;
  right: -4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #1c1c1f;
  border: 1px solid var(--border-hi);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.foot {
  margin-top: 18px;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}

/* ---------- entrance ---------- */

.reveal { animation: rise 0.8s var(--ease) both; }
.reveal:nth-child(1) { animation-delay: 0.05s; }
.reveal:nth-child(2) { animation-delay: 0.15s; }
.reveal:nth-child(3) { animation-delay: 0.25s; }
.reveal:nth-child(4) { animation-delay: 0.35s; }
.reveal:nth-child(5) { animation-delay: 0.45s; }

/* ---------- keyframes ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes shine { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (min-width: 700px) and (min-height: 760px) {
  .wrap { min-height: 100dvh; justify-content: center; padding-top: 32px; }
}

@media (max-width: 360px) {
  .seat-title { font-size: 19px; }
  .field { flex-direction: column; }
  .field input { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .shine { display: none; }
}
