/* ---------------------------------------------------------------- tokens */
:root {
  --bg:            #08060d;
  --bg-2:          #0d0a16;
  --surface:       rgba(255, 255, 255, .045);
  --surface-2:     rgba(255, 255, 255, .07);
  --line:          rgba(255, 255, 255, .09);
  --line-strong:   rgba(255, 255, 255, .16);

  --text:          #f4f1ea;
  --muted:         #a49db4;
  --faint:         #6f6883;

  --gold:          #e3b457;
  --gold-soft:     #f3d79b;
  --violet:        #8b6bd6;
  --rose:          #d1608e;
  --danger:        #ff6b81;
  --ok:            #57d6a4;

  --radius:        16px;
  --radius-sm:     11px;
  --shadow:        0 18px 45px rgba(0, 0, 0, .55);
  --ring:          0 0 0 3px rgba(227, 180, 87, .22);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

/* Several components below set `display`, which would otherwise beat the UA
   rule for [hidden] and leave modals/panels permanently on screen. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg); /* fallback behind body's gradient stack */
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(139, 107, 214, .20), transparent 65%),
    radial-gradient(760px 460px at 12% 8%, rgba(209, 96, 142, .13), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 45%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Release-stage strip - sits above everything, on the gate and in the app alike. */
.stage-banner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 16px;
  background: rgba(227, 180, 87, .1);
  border-bottom: 1px solid rgba(227, 180, 87, .22);
  color: var(--gold-soft);
  font-size: 12.5px;
  text-align: center;
}

.stage-tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #241a05;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
}

/* Soft moving light behind the hero. */
.glow {
  position: fixed;
  inset: -30vh 0 auto 0;
  height: 70vh;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(227, 180, 87, .14), transparent 72%);
  filter: blur(10px);
  z-index: 0;
}

main, .topbar, .foot { position: relative; z-index: 1; }

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

/* ---------------------------------------------------------------- topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 22px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 40px;
  height: 26px;
  color: var(--gold);
  flex: none;
  filter: drop-shadow(0 0 12px rgba(227, 180, 87, .4));
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; letter-spacing: .02em; }
.brand-text small { color: var(--faint); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 5px 11px;
  border-radius: 999px;
  transition: color .18s, background .18s;
}

.lang-switch button:hover { color: var(--text); }

.lang-switch button.is-active {
  background: var(--gold);
  color: #241a05;
}

/* ------------------------------------------------------------- logged in */
.me {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 5px 4px 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.me-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex: none;
}

.me-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 15ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(227, 180, 87, .16);
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
}

.btn-small { padding: 6px 12px; font-size: 12px; }

/* ----------------------------------------------------------- login gate */
.gate {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 90px);
  padding: 30px 22px 60px;
}

.gate-card {
  width: min(460px, 100%);
  padding: 42px 34px 38px;
  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
}

.gate-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(42px, 10vw, 62px);
  line-height: 1;
  background: linear-gradient(180deg, #fffaf0 12%, #e6c98e 62%, #b98f42 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  padding: 15px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  font-size: 15px;
  color: #fff;
  background: #5865f2;
  box-shadow: 0 12px 30px rgba(88, 101, 242, .3);
  transition: transform .15s, background .18s, box-shadow .18s;
}

.btn-discord:hover { background: #4752c4; transform: translateY(-1px); }
.btn-discord:active { transform: translateY(0); }
.btn-discord svg { width: 23px; height: 18px; flex: none; }

.btn-discord.is-disabled { pointer-events: none; opacity: .45; }

/* --------------------------------------------------------------- buttons */
.btn-primary,
.btn-ghost {
  border-radius: 999px;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .01em;
  transition: transform .15s, background .18s, border-color .18s, box-shadow .18s;
}

.btn-primary {
  border: 0;
  padding: 12px 22px;
  color: #241a05;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 10px 26px rgba(227, 180, 87, .22);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(227, 180, 87, .3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn-ghost.is-active { border-color: var(--gold); color: var(--gold); }

:where(button, input, select, a):focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ------------------------------------------------------------------ hero */
main { max-width: 1080px; margin: 0 auto; padding: 0 22px 60px; }

.hero { text-align: center; padding: 46px 0 30px; }

.hero-kicker {
  margin: 0 0 12px;
  font-size: 11.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(46px, 11vw, 82px);
  line-height: 1;
  letter-spacing: -.01em;
  background: linear-gradient(180deg, #fffaf0 12%, #e6c98e 62%, #b98f42 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  margin: 12px 0 0;
  font-size: 13.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-sub {
  margin: 14px auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 15px;
}

.match-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.match-counter.has-matches {
  background: rgba(87, 214, 164, .1);
  border-color: rgba(87, 214, 164, .34);
  color: #b6f2d8;
  font-weight: 600;
  animation: buddyGlow 2.8s ease-in-out infinite;
}

/* ------------------------------------------------------------------ tabs */
.tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  margin: 4px auto 26px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 999px;
  transition: background .18s, color .18s;
}

.tab:hover { color: var(--text); }

.tab.is-active {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #241a05;
}

/* --------------------------------------------------------------- filters */
.list-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.list-hint { color: var(--faint); font-size: 12px; }

/* -------------------------------------------------- collapsible date list */
.date-list { display: grid; gap: 8px; }

.date-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .18s, background .18s;
}

.date-row:hover { border-color: var(--line-strong); }

.date-row.is-open {
  background: rgba(255, 255, 255, .028);
  border-color: rgba(227, 180, 87, .3);
}

.date-row.is-past { opacity: .55; }

.date-head {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  transition: background .18s;
}

.date-head:hover { background: rgba(255, 255, 255, .035); }

.date-box {
  flex: none;
  display: grid;
  justify-items: center;
  min-width: 58px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
}

.date-box b {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.05;
  color: var(--gold-soft);
}

.date-box span {
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.date-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.date-meta strong { font-size: 14.5px; }
.date-meta small { color: var(--faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.date-count {
  margin-left: auto;
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
  white-space: nowrap;
}

.date-count.has-seats {
  background: rgba(227, 180, 87, .13);
  border-color: rgba(227, 180, 87, .35);
  color: var(--gold-soft);
  font-weight: 600;
}

.chevron {
  flex: none;
  width: 13px;
  height: 9px;
  color: var(--faint);
  transition: transform .22s ease, color .18s;
}

.date-row.is-open .chevron { transform: rotate(180deg); color: var(--gold); }

.date-body {
  padding: 4px 16px 16px;
  animation: unfold .22s ease;
}

.date-empty {
  margin: 8px 0 4px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}

@keyframes unfold {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.seat-table {
  /* The name column is capped so section/row/seat sit right behind it instead
     of being flung to the far edge; the last column soaks up the slack. */
  --cols: 22px minmax(110px, 210px) 56px 44px 62px minmax(90px, 1fr);
  display: grid;
  gap: 1px;
}

.seat-thead,
.seat-line {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  column-gap: 10px;
}

.seat-thead {
  padding: 0 10px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
}

.seat-thead span:nth-child(n + 3) { text-align: center; }

.seat-line {
  position: relative;
  padding: 7px 10px;
  border-radius: 9px;
  border-left: 2px solid transparent;
  transition: background .15s;
}

.seat-line:hover { background: rgba(255, 255, 255, .045); }

.seat-line.is-mine {
  background: rgba(227, 180, 87, .07);
  border-left-color: var(--gold);
}

/* Buddies found each other - listed after .is-mine so green wins on your own row. */
.seat-line.is-buddy {
  background: rgba(87, 214, 164, .09);
  border-left-color: var(--ok);
  animation: buddyGlow 2.8s ease-in-out infinite;
}

.seat-line.is-buddy:hover { background: rgba(87, 214, 164, .14); }

.seat-line.is-buddy .sl-name { color: #b6f2d8; }

@keyframes buddyGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(87, 214, 164, .18), 0 0 10px rgba(87, 214, 164, .10); }
  50%      { box-shadow: 0 0 0 1px rgba(87, 214, 164, .38), 0 0 22px rgba(87, 214, 164, .24); }
}

/* Neutral glow so it does not fight whichever heart colour the group got. */
.buddy-heart {
  flex: none;
  font-size: 12.5px;
  line-height: 1;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, .3));
}

.sl-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.sl-who { display: flex; align-items: center; gap: 7px; min-width: 0; }

.sl-name {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.you-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(227, 180, 87, .16);
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sl-val {
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sl-act { display: flex; justify-content: flex-end; }

.sl-del {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}

.sl-del:hover {
  color: var(--danger);
  border-color: rgba(255, 107, 129, .45);
  background: rgba(255, 107, 129, .1);
}

.sl-note {
  grid-column: 2 / -1;
  margin: 1px 0 2px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

/* ------------------------------------------------------------------ form */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.form { max-width: 520px; margin: 0 auto; padding: 30px; display: grid; gap: 15px; }

.form h2, .success h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 27px;
}

.form-lead { margin: -8px 0 4px; color: var(--muted); font-size: 13.5px; }

.field { display: grid; gap: 6px; }

.field > span {
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color .18s, background .18s;
}

.field input::placeholder { color: var(--faint); }
.field input:hover, .field select:hover { border-color: var(--line-strong); }

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23a49db4' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px;
  padding-right: 36px;
}

.field select option,
.field select optgroup { background: #14101f; color: var(--text); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-error {
  margin: 0;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 129, .11);
  border: 1px solid rgba(255, 107, 129, .3);
  color: #ffb3be;
  font-size: 13px;
}

.form-fineprint { margin: 0; text-align: center; color: var(--faint); font-size: 11.5px; }

/* --------------------------------------------------------------- success */
.success { max-width: 520px; margin: 0 auto; padding: 34px 30px; text-align: center; display: grid; gap: 14px; }

.success-mark {
  justify-self: center;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 24px;
  color: #08301f;
  background: linear-gradient(135deg, #a8f0cf, var(--ok));
}

.success p { margin: 0; color: var(--muted); font-size: 14px; }

.success-seat {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(227, 180, 87, .3);
  color: var(--gold-soft) !important;
  font-size: 14px;
}

/* "Posting as <you>" strip above the form fields. */
.form-as {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
}

.form-as span { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.form-as small { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }
.form-as strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.success-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 3, 8, .72);
  backdrop-filter: blur(6px);
  animation: fade .18s ease;
}

.modal { width: min(420px, 100%); padding: 26px; display: grid; gap: 14px; }
.modal h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 23px; }
.modal p { margin: 0; color: var(--muted); font-size: 13.5px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  background: #171122;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: rise .22s ease;
}

.toast.is-error { border-color: rgba(255, 107, 129, .45); color: #ffb3be; }

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------------------------------------------------------- footer */
.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px 34px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
}

.foot .heart { font-style: normal; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .hero { padding: 30px 0 22px; }
  .date-head { gap: 11px; padding: 10px 12px; }
  .date-box { min-width: 48px; padding: 5px 7px; }
  .date-box b { font-size: 21px; }
  .date-meta small { display: none; }
  .date-count { padding: 4px 9px; font-size: 10.5px; }
  .date-body { padding: 4px 10px 14px; }
  .seat-table { --cols: 20px minmax(60px, 130px) 38px 32px 42px minmax(78px, 1fr); }
  .sl-del { padding: 4px 9px; font-size: 10.5px; }
  .seat-thead { font-size: 8.5px; letter-spacing: .06em; padding: 0 6px 6px; }
  .seat-line { padding: 7px 6px; column-gap: 7px; }
  .sl-name { font-size: 13px; }
  .sl-val { font-size: 13px; }
  .form, .success { padding: 24px 20px; }
  .gate-card { padding: 32px 22px; }
  .me-name { max-width: 10ch; }
}

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