:root {
  --bg: #04050b;
  --panel: #10131f;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e9ebf5;
  --muted: #868ca6;
  --muted-2: #5f6584;
  --accent: #7c6bf6;
  --accent-2: #9b8cff;
  --accent-soft: rgba(124, 107, 246, 0.16);
  --green: #36d39a;
  --red: #f4617f;
  --amber: #f5b95c;
  --radius-lg: 20px;
  --radius: 14px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Headings share the body voice, just tighter - quiet rather than decorative. */
  --display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
             Roboto, sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 12% -6%, rgba(124, 107, 246, 0.20), transparent 62%),
    radial-gradient(680px 400px at 92% 4%, rgba(72, 108, 255, 0.14), transparent 60%),
    radial-gradient(900px 620px at 50% 108%, rgba(124, 107, 246, 0.10), transparent 70%);
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 15, 0.72);
  backdrop-filter: blur(14px);
}

.brand-block { display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 34px; height: 34px; border-radius: 11px; }
.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
}

.topnav { display: flex; align-items: center; gap: 6px; margin-left: 18px; }
.topnav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.topnav a.active { color: #fff; background: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.user-chip img, .avatar-fallback {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: #fff;
}
.user-chip .who { line-height: 1.15; padding-right: 6px; }
.user-chip .who b { display: block; font-size: 13.5px; font-weight: 600; }
.user-chip .who small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.lang-switch a {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
.lang-switch a.active { background: var(--accent); color: #fff; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--red); border-color: rgba(244, 97, 127, 0.4); }

/* ------------------------------------------------------------------- shell */

.shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 32px 72px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.page-head.center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}
.page-head.center .lede { max-width: 46ch; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}

h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}

.lede { color: var(--muted); margin: 0; max-width: 60ch; }

.back-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.back-link:hover { color: var(--text); border-bottom-color: var(--line-strong); }

.event-thumb {
  width: 200px;
  height: 120px;
  filter: brightness(0.82);
  border-radius: 18px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  flex: none;
  box-shadow: var(--shadow);
}

/* -------------------------------------------------------------- event cards */

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
  margin-top: 38px;
}

.pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 330px;
  padding: 24px 22px 20px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  color: #fff;
  isolation: isolate;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.pick-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.pick-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--card-image, none);
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
}
.pick-card:hover .pick-art { transform: scale(1.04); }

/* Events without artwork still need to look like different events. */
.pick-card.tone-0 .pick-art {
  background-color: #2a1f78;
  background-image: var(--card-image, none),
    radial-gradient(120% 90% at 20% 0%, rgba(155, 140, 255, 0.95), transparent 55%),
    linear-gradient(200deg, #5b46e5 0%, #2c2288 55%, #120f33 100%);
}
.pick-card.tone-1 .pick-art {
  background-color: #0c3b34;
  background-image: var(--card-image, none),
    radial-gradient(120% 90% at 15% 5%, rgba(86, 232, 188, 0.85), transparent 55%),
    linear-gradient(200deg, #29c99b 0%, #10695f 55%, #06211f 100%);
}
.pick-card.tone-2 .pick-art {
  background-color: #63360c;
  background-image: var(--card-image, none),
    radial-gradient(120% 90% at 18% 0%, rgba(255, 199, 120, 0.9), transparent 55%),
    linear-gradient(200deg, #f0a23c 0%, #93571a 55%, #2a1806 100%);
}
.pick-card.tone-3 .pick-art {
  background-color: #611f33;
  background-image: var(--card-image, none),
    radial-gradient(120% 90% at 16% 4%, rgba(255, 150, 176, 0.88), transparent 55%),
    linear-gradient(200deg, #ef5f84 0%, #8f2545 55%, #2c0a17 100%);
}
.pick-card.tone-4 .pick-art {
  background-color: #0a2a3d;
  background-image: var(--card-image, none),
    radial-gradient(120% 90% at 18% 2%, rgba(168, 232, 255, 0.72), transparent 55%),
    linear-gradient(200deg, #43b3e6 0%, #1a5d83 52%, #051926 100%);
}

.pick-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(4, 5, 11, 0.5) 0%,
    rgba(4, 5, 11, 0.16) 34%,
    rgba(4, 5, 11, 0.78) 100%
  );
}

/* A real poster can be white, yellow, anything - the title has to survive it. */
.pick-card.has-photo .pick-art { filter: brightness(0.6) saturate(1.05); }
.pick-card.has-photo .pick-scrim {
  background:
    linear-gradient(
      180deg,
      rgba(4, 5, 11, 0.74) 0%,
      rgba(4, 5, 11, 0.44) 42%,
      rgba(4, 5, 11, 0.92) 100%
    ),
    rgba(4, 5, 11, 0.2);
}

.pick-top { display: block; }
.pick-eyebrow {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 12px;
}
.pick-title {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
  overflow-wrap: anywhere;
}

.pick-panel { display: block; }
.pick-meta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 4px 14px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.92);
}
.pick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(10, 12, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.18s ease;
}
.pick-card:hover .pick-btn { background: #05060c; border-color: rgba(255, 255, 255, 0.3); }

/* ------------------------------------------------------------------- cards */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 34px 0 0;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.stat .stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat h3 { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.stat .value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 12px 0 8px;
}
.stat .value.neg { color: var(--red); }
.stat small { color: var(--muted-2); font-size: 12.5px; }
.stat .badge {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid rgba(124, 107, 246, 0.25);
}

/* -------------------------------------------------------------------- form */

.panel {
  margin-top: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* The "add a cart" card: glass over the event artwork behind the page. */
.panel.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.035));
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.panel.glass input[type="text"],
.panel.glass textarea,
.panel.glass .dropzone,
.panel.glass .currency-row button {
  background: rgba(8, 10, 18, 0.42);
}
/* ...but the picked option still has to look picked - this beats the line above. */
.panel.glass .currency-row button[aria-pressed="true"] {
  background: rgba(124, 107, 246, 0.34);
}
.panel.glass .file-pill,
.panel.glass .mini-note { background: rgba(255, 255, 255, 0.06); }

/* Sits behind everything, so the glass has an image to blur rather than flat black. */
.event-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  filter: blur(30px) saturate(135%);
  transform: scale(1.12);
  pointer-events: none;
}
.event-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 5, 11, 0.62) 0%, rgba(4, 5, 11, 0.84) 55%, rgba(4, 5, 11, 0.95) 100%);
}

.panel-head { padding: 26px 28px 8px; }
.panel-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.panel-head p { margin: 0; color: var(--muted); font-size: 14px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 26px;
  padding: 22px 28px 28px;
}

.event-form {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.7fr) minmax(0, 1.2fr);
  gap: 18px;
  padding: 18px 28px 28px;
  align-items: start;
}
.event-form .actions { grid-column: 1 / -1; margin-top: 0; }
.event-form .toast { grid-column: 1 / -1; margin-top: 0; }

label.field { display: block; }
label.field > span.lab, .lab {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.lab small { letter-spacing: 0; text-transform: none; color: var(--accent-2); font-size: 11px; }

input[type="text"], textarea {
  width: 100%;
  background: rgba(8, 10, 18, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
input:focus, textarea:focus {
  border-color: rgba(124, 107, 246, 0.6);
  box-shadow: 0 0 0 4px rgba(124, 107, 246, 0.14);
}
input::placeholder, textarea::placeholder { color: #4d5370; }
textarea { min-height: 96px; resize: vertical; }

input[type="file"] {
  width: 100%;
  font-size: 12.5px;
  color: var(--muted);
}
input[type="file"]::file-selector-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  margin-right: 12px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--line-strong); }

/* --------------------------------------------------------------- dropzone */

.dropzone {
  margin-top: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(8, 10, 18, 0.5);
  padding: 26px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.dropzone:hover { border-color: rgba(124, 107, 246, 0.5); }
.dropzone.drag { border-color: var(--accent); background: rgba(124, 107, 246, 0.1); }
.dropzone .dz-icon {
  width: 44px; height: 44px; margin: 0 auto 10px;
  border-radius: 13px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-2);
  border: 1px solid rgba(124, 107, 246, 0.25);
}
.dropzone b { display: block; font-size: 14px; }
.dropzone small { color: var(--muted-2); font-size: 12.5px; }
.dropzone input[type="file"] { display: none; }

/* -------------------------------------------------------------- price row */

.price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-top: 20px;
  align-items: start;
}
.price-row .field > .lab { margin-bottom: 8px; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .cur {
  position: absolute; left: 14px;
  color: var(--muted-2); font-size: 14px; pointer-events: none;
}
.input-wrap.with-cur input { padding-left: 38px; font-weight: 600; }

.currency-row { display: flex; gap: 8px; flex-wrap: wrap; }
.currency-row button {
  flex: 1;
  min-width: 0;
  padding: 13px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(8, 10, 18, 0.72);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.16s ease;
}
.currency-row button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: rgba(124, 107, 246, 0.55);
  color: #fff;
}

.file-pill {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.file-pill.show { display: flex; }
.file-pill img { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; }
.file-pill .meta { flex: 1; min-width: 0; }
.file-pill .meta b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pill .meta small { color: var(--muted-2); }
.file-pill button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 9px; padding: 6px 10px; cursor: pointer; font-size: 12.5px;
}
.file-pill button:hover { color: var(--red); border-color: rgba(244, 97, 127, 0.45); }

/* ---------------------------------------------------------------- actions */

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 14px 34px rgba(124, 107, 246, 0.35);
}
.btn.primary:hover { transform: translateY(-1px); }
.btn.primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
}
.btn.ghost:hover { color: var(--text); }
.btn[hidden] { display: none; }

.form-note { color: var(--muted-2); font-size: 12.5px; max-width: 40ch; }

.toast {
  margin-top: 16px;
  display: none;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  border: 1px solid transparent;
}
.toast.show { display: block; }
.toast.ok { background: rgba(54, 211, 154, 0.12); border-color: rgba(54, 211, 154, 0.35); color: #9df0cf; }
.toast.err { background: rgba(244, 97, 127, 0.12); border-color: rgba(244, 97, 127, 0.35); color: #ffb7c5; }

/* --------------------------------------------------------------- preview */

.preview-col { display: flex; flex-direction: column; gap: 14px; }
.preview-label {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2);
}

.discord {
  background: #313338;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}
.discord .msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.discord .msg-head img { width: 38px; height: 38px; border-radius: 50%; }
.discord .msg-head b { font-size: 14.5px; color: #f2f3f5; }
.discord .msg-head .tag {
  background: #5865f2; color: #fff; font-size: 10px; font-weight: 600;
  padding: 1px 5px; border-radius: 4px;
}
.discord .msg-head .ts { color: #949ba4; font-size: 11px; }

.embed {
  position: relative;
  background: #2b2d31;
  border-radius: 6px;
  padding: 14px 16px 16px 18px;
  overflow: hidden;
  color: #dbdee1;
}
.embed::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent);
}
.embed .e-author { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.embed .e-author img, .embed .e-author .avatar-fallback { width: 24px; height: 24px; border-radius: 50%; font-size: 9px; }
.embed .e-author span { font-size: 13.5px; font-weight: 600; color: #fff; }
.embed .e-title { font-size: 15.5px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.embed .e-desc { font-size: 13.5px; white-space: pre-wrap; margin-bottom: 10px; color: #c7ccd3; }
.embed .e-fields { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.embed .e-field b { display: block; font-size: 12.5px; color: #fff; margin-bottom: 2px; }
.embed .e-field span { font-size: 13.5px; font-weight: 700; color: #4ade9b; }

.embed .e-image {
  display: none;
  width: 100%;
  border-radius: 5px;
  margin-bottom: 10px;
  max-height: 240px;
  object-fit: cover;
}
.embed .e-image.show { display: block; }
.embed .e-footer { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #949ba4; }

.mini-note {
  font-size: 12.5px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}

/* -------------------------------------------------------------- cart cards */

.cart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  padding: 4px 28px 28px;
  /* Cards are as tall as their screenshot, so do not stretch them to match. */
  align-items: start;
}

.cart-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.cart-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.cart-card.is-deleted { opacity: 0.5; }

/* Reserve some height so a lazily-loaded screenshot does not make the card
   jump once it arrives. */
.cart-shot { display: block; background: #05060c; min-height: 140px; }
/* The whole screenshot, not a strip out of the middle - the point is to see
   which cart this is. Phone shots are tall, desktop ones wide, so `contain`
   with a generous ceiling handles both without cropping either. */
.cart-shot img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
}

.cart-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }

/* The dot says at a glance whether the listing is still up in Discord. */
.live-state { display: inline-flex; align-items: center; gap: 7px; }
.live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--muted-2);
}
.live-dot.on {
  background: #3ff29f;
  box-shadow: 0 0 0 0 rgba(63, 242, 159, 0.55);
  animation: live-pulse 1.9s ease-out infinite;
}
.live-dot.sold { background: var(--red); }
.live-text { font-weight: 600; letter-spacing: 0.02em; }
.cart-card .live-dot.on + .live-text { color: #7ff0c2; }
.cart-card.is-sold .live-text { color: #ffb7c5; }

@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(63, 242, 159, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(63, 242, 159, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 242, 159, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot.on { animation: none; }
}

.cart-card.is-sold .cart-shot img { filter: grayscale(0.7) brightness(0.72); }
.cart-price {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.cart-card.is-sold .cart-price { color: var(--muted-2); text-decoration: line-through; }
.price-mode {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted-2);
  text-decoration: none;
}
.cart-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
/* SOLD sits on the left, Delete is pushed over to the right. */
.cart-actions .btn-delete { margin-left: auto; }

.btn-sold {
  border: 1px solid rgba(54, 211, 154, 0.4);
  background: rgba(54, 211, 154, 0.12);
  color: #8ce8c6;
  border-radius: 9px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-sold:hover { background: rgba(54, 211, 154, 0.24); border-color: rgba(54, 211, 154, 0.7); }
.btn-sold:disabled { opacity: 0.5; cursor: not-allowed; }

.pill.sold { color: #ffb7c5; border-color: rgba(244, 97, 127, 0.4); background: rgba(244, 97, 127, 0.12); }
.cart-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.cart-event { font-size: 13.5px; font-weight: 600; color: var(--accent-2); }
.cart-event:hover { text-decoration: underline; }
.cart-note { margin: 0; font-size: 13.5px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.cart-card.is-sold { opacity: 0.85; }

/* ------------------------------------------------------------------ table */

.table-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}
.table-head b { font-size: 14px; font-weight: 600; }
.table-head small { color: var(--muted-2); }

.table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }

.collapsible > summary { cursor: pointer; list-style: none; user-select: none; }
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary:hover { background: rgba(255, 255, 255, 0.02); }
.collapsible > summary .chev {
  display: inline-flex; flex: none; color: var(--muted);
  margin-right: 10px; transition: transform 0.18s ease;
}
.collapsible[open] > summary .chev { transform: rotate(90deg); }
.collapsible > summary > span.chev + span { flex: 1; }

.tw-table { width: 100%; border-collapse: collapse; }
.tw-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  white-space: nowrap;
}
.tw-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 13.5px;
  vertical-align: middle;
}
.tw-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.tw-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tw-table img.shot { width: 54px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.note-cell { max-width: 280px; color: var(--muted); }
.webhook-cell {
  font-size: 11.5px;
  color: var(--muted-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  display: inline-block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.row-actions { display: flex; gap: 6px; white-space: nowrap; }

.who-cell { display: flex; align-items: center; gap: 10px; }
.who-cell img, .who-cell .avatar-fallback { width: 28px; height: 28px; border-radius: 50%; font-size: 10px; }
.who-cell b { display: block; font-size: 13px; font-weight: 600; }
.who-cell small { color: var(--muted-2); font-size: 11.5px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  white-space: nowrap;
}
.pill.ok { color: #8ce8c6; border-color: rgba(54, 211, 154, 0.35); background: rgba(54, 211, 154, 0.12); }
.pill.failed { color: #ffb7c5; border-color: rgba(244, 97, 127, 0.4); background: rgba(244, 97, 127, 0.12); }

.row-deleted td { opacity: 0.5; }
.row-deleted td .pill.failed, .row-deleted td .row-actions { opacity: 1; }

.btn-row, .btn-delete {
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-row {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}
.btn-row:hover { color: var(--text); border-color: var(--line-strong); }
.btn-delete {
  border: 1px solid rgba(244, 97, 127, 0.35);
  background: rgba(244, 97, 127, 0.1);
  color: #ffb7c5;
}
.btn-delete:hover { background: rgba(244, 97, 127, 0.2); border-color: rgba(244, 97, 127, 0.6); }
.btn-row:disabled, .btn-delete:disabled { opacity: 0.5; cursor: not-allowed; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted-2); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.empty[hidden] { display: none; }

.warn-bar {
  margin-top: 22px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 185, 92, 0.32);
  background: rgba(245, 185, 92, 0.1);
  color: #f6d49a;
  font-size: 13.5px;
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------------ login */

.login-wrap {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}
.login-card {
  width: min(460px, 100%);
  text-align: center;
  padding: 40px 34px 34px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow);
}
.login-card img.mark { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 20px; }
.login-card h1 { font-size: 30px; margin-bottom: 10px; }
.login-card p { color: var(--muted); margin: 0 0 26px; }
.login-card .btn { width: 100%; justify-content: center; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
  .event-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tw-table { min-width: 880px; }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 14px 18px; flex-wrap: wrap; }
  .shell { padding: 28px 18px 60px; }
  .user-chip .who { display: none; }
  .event-thumb { width: 100%; height: 150px; }
  .cart-grid { padding: 4px 18px 22px; }
  .layout, .event-form { padding-left: 18px; padding-right: 18px; }
  .panel-head { padding: 22px 18px 6px; }
}

@media (max-width: 620px) {
  .event-form, .price-row { grid-template-columns: minmax(0, 1fr); }
  .pick-card { min-height: 290px; padding: 20px 18px 16px; }
  .pick-title { font-size: 24px; }
}
