/* PLQ Live Graph — styles. Palette and type follow the nvai.dev design system. */

:root {
  --radius: 1.15rem;
  --radius-sm: .7rem;
  --bg: #0A0E17;
  --surface: #111827;
  --surface-2: #161F31;
  --surface-3: #1F2A3F;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .14);
  --text: #F2EFF8;
  --muted: #A9A3B8;
  --faint: #6F7C92;
  --purple: #9B86D6;
  --purple-strong: #7B68AE;
  --gold: #E0BE5C;
  --gold-strong: #D4AF37;
  --live: #4ADE80;
  --live-bg: rgba(74, 222, 128, .12);
  --danger: #FB7185;
  --danger-bg: rgba(251, 113, 133, .12);
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
  --glow:
    radial-gradient(60rem 34rem at 8% -12%, rgba(139, 119, 201, .20), transparent 62%),
    radial-gradient(46rem 30rem at 104% 112%, rgba(212, 175, 55, .10), transparent 60%);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--glow);
  background-attachment: fixed;
  color: var(--text);
  font: 400 15px/1.55 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }

h1, h2, .brand, .btn { font-family: 'Quicksand', Inter, system-ui, sans-serif; }

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 23, .78);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: .01em;
  color: var(--text);
  text-decoration: none;
}

.brand .sub { color: var(--muted); font-weight: 600; }

.mark {
  width: .8rem;
  height: .8rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--gold));
  box-shadow: 0 0 0 4px rgba(123, 104, 174, .16);
}

.topbar-right { display: flex; align-items: center; gap: 1rem; }

.date { color: var(--muted); font-size: .9rem; }

.livepill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  font-family: 'Quicksand', Inter, sans-serif;
  letter-spacing: .02em;
}

.livepill .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--faint); }

.livepill.live { color: var(--live); border-color: rgba(74, 222, 128, .32); background: var(--live-bg); }
.livepill.live .dot { background: var(--live); box-shadow: 0 0 0 0 rgba(74, 222, 128, .5); animation: pulse 2s infinite; }

.livepill.error { color: var(--danger); border-color: rgba(251, 113, 133, .32); background: var(--danger-bg); }
.livepill.error .dot { background: var(--danger); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .45); }
  70%  { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ---------- card ---------- */

main.container { padding-block: 1.75rem 2.5rem; }

.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem 1.5rem;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.card-head h1 {
  margin: 0 0 .25rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.sub { margin: 0; color: var(--muted); font-size: .92rem; }

.updated { color: var(--faint); font-size: .82rem; white-space: nowrap; padding-top: .35rem; }

.chart-wrap {
  position: relative;
  height: 26rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .18);
  padding: .6rem;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: .95rem;
  pointer-events: none;
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .6rem;
  margin-top: 1.1rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .02);
}

.stat .swatch { width: .65rem; height: .65rem; border-radius: 3px; flex: none; }
.stat .k { color: var(--muted); font-size: .82rem; }
.stat .v { margin-left: auto; font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; }

/* ---------- connect ---------- */

.connect {
  margin-top: 1.25rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid rgba(212, 175, 55, .28);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(212, 175, 55, .07), rgba(212, 175, 55, .03));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  justify-content: space-between;
}

.connect h2 { margin: 0 0 .4rem; font-size: 1.12rem; font-weight: 700; }
.connect p { margin: 0 0 .5rem; color: var(--muted); font-size: .9rem; max-width: 44rem; }
.connect .hint { color: var(--faint); font-size: .82rem; margin-bottom: 0; }
.connect code { font-family: var(--mono); font-size: .82em; color: var(--gold); }

.connect-form { display: flex; gap: .6rem; flex: 1 1 22rem; max-width: 34rem; }

.connect-form input {
  flex: 1;
  min-width: 0;
  padding: .6rem .8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
  font: 400 .85rem var(--mono);
}

.connect-form input:focus { outline: 2px solid var(--purple); outline-offset: 1px; }

.btn {
  padding: .6rem 1.1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--purple-strong), var(--purple));
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.08); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  margin-top: 1.5rem;
  color: var(--faint);
  font-size: .8rem;
}

@media (max-width: 40rem) {
  .card { padding: 1.1rem 1rem 1.2rem; }
  .chart-wrap { height: 20rem; }
  .card-head { flex-direction: column; }
  .updated { padding-top: 0; }
}
