/* ============================================================
   StalkTrend Live — shared design system
   A ticket is a physical object: torn stub, punch-hole notches,
   stage light. That's the visual thread through every page here.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  /* Deep, premium dark — near-black with a cool undertone, not flat.
     Inspired directly by the shared references: black cards, bold white
     type, one confident accent color doing the work. */
  --bg: #0a0a10;
  --bg-card: #131218;
  --bg-card-2: #1a1922;
  --border: #26242f;
  --text: #f7f6fb;
  --muted: #9896a8;
  --muted-2: #625f70;

  /* Punchier, more purple-forward gradient than before — leans into the
     violet from the reference screens while keeping the logo's magenta
     and cyan as supporting accents, not the dominant note. */
  --magenta: #ff3d8a;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --danger: #ff5470;
  --grad: linear-gradient(135deg, var(--magenta) 0%, var(--violet) 55%, var(--cyan) 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,61,138,0.16) 0%, rgba(139,92,246,0.18) 55%, rgba(34,211,238,0.14) 100%);

  --radius: 22px;
  --radius-sm: 14px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

.btn-primary { color: #0a0a10; }

.logo-img { height: 24px; width: auto; display: block; }

.theme-toggle-btn {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg-card-2);
  border: 1px solid var(--border); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle-btn:hover { border-color: var(--violet); }
.theme-toggle-fixed { position: absolute; top: 24px; right: 20px; z-index: 3; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient stage-light glow, fixed behind all content, slow drift.
   This is the "concert lighting" ambience — subtle, not a light show. */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  width: 140vw;
  height: 60vh;
  transform: translateX(-50%);
  background: var(--grad-soft);
  filter: blur(80px);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
  animation: driftGlow 18s ease-in-out infinite alternate;
}

@keyframes driftGlow {
  0%   { transform: translateX(-54%) translateY(0); }
  100% { transform: translateX(-46%) translateY(4%); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.wrap.wide { max-width: 720px; }

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad);
  flex: none;
}

/* ---------- Typography ---------- */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 18px; }
p { color: var(--muted); line-height: 1.6; margin: 0; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  animation: riseIn 0.5s ease both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Signature: perforated ticket-stub divider ----------
   A real ticket has a torn, punch-holed seam between the info half
   and the stub half. This recreates that inside any card. */
.perforation {
  position: relative;
  height: 0;
  margin: 22px -24px;
  border-top: 2px dashed var(--border);
}
.perforation::before,
.perforation::after {
  content: '';
  position: absolute;
  top: -11px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg);
}
.perforation::before { left: -11px; }
.perforation::after { right: -11px; }

/* ---------- Buttons ---------- */
button, .btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--grad);
  color: #0b0b12;
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(124,92,255,0.35); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  width: 100%;
  padding: 13px;
  background: var(--bg-card-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--violet); }

/* ---------- Inputs ---------- */
label {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
input, textarea, select {
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124,92,255,0.18);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }

/* ---------- Price / mono numerals ---------- */
.price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 32px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mono { font-family: var(--font-mono); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.badge.ok { background: rgba(52,228,208,0.12); color: var(--cyan); }
.badge.bad { background: rgba(255,84,112,0.12); color: var(--danger); }
.badge.neutral { background: var(--bg-card-2); color: var(--muted); }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; min-width: 0; }
.stats > * { min-width: 0; }
.stat {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow: hidden;
}
.stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; margin-top: 6px; overflow-wrap: break-word; }
.stat .value.accent {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Table ---------- */
.table-scroll { overflow-x: auto; margin-top: 20px; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: 0.06em; }
td { color: var(--text); }

/* ---------- Error / status text ---------- */
.error { color: var(--danger); font-size: 13px; margin-top: 12px; }
.hint { font-size: 12px; color: var(--muted-2); margin-top: 14px; line-height: 1.6; }

/* ---------- Spinner ---------- */
.spinner-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad); animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
