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

:root {
  --bg: #08121b;
  --bg2: #0d1f2d;
  --panel: rgba(14, 33, 48, 0.82);
  --panel-strong: #153248;
  --text: #ecf7ff;
  --muted: rgba(205, 225, 240, 0.72);
  --border: rgba(137, 186, 219, 0.24);
  --accent: #2ec4b6;
  --accent-strong: #16a799;
  --accent-warm: #ff9f43;
  --ok: #59d98e;
  --danger: #ff6f7a;
  --mono: "JetBrains Mono", "IBM Plex Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: "Space Grotesk", "Avenir Next", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 15% 12%, rgba(46, 196, 182, 0.2), transparent 38%),
    radial-gradient(circle at 82% 10%, rgba(255, 159, 67, 0.16), transparent 36%),
    linear-gradient(155deg, var(--bg) 0%, var(--bg2) 58%, #112536 100%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #cffffb;
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(500px 360px at 78% 16%, rgba(255, 159, 67, 0.13), transparent 70%),
    radial-gradient(620px 420px at 20% 8%, rgba(46, 196, 182, 0.14), transparent 72%);
  z-index: 0;
}

.wrap {
  max-width: 1360px;
  margin: 24px auto;
  padding: 0 16px;
}

.observer-wrap {
  position: relative;
  z-index: 1;
}

h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-brand-head {
  margin-bottom: 8px;
}

.site-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex: 0 0 auto;
}

h2 {
  font-size: 15px;
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 600;
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(46, 196, 182, 0.7);
  box-shadow: 0 0 0 1px rgba(46, 196, 182, 0.22);
}

input::placeholder,
textarea::placeholder {
  color: rgba(205, 225, 240, 0.45);
}

textarea {
  min-height: 82px;
}

.row {
  display: flex;
  gap: 10px;
}

.row > * {
  flex: 1;
  min-width: 0;
}

.btns {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

button {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(46, 196, 182, 0.12);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 140ms ease;
}

button:hover {
  background: rgba(46, 196, 182, 0.2);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.danger {
  background: rgba(255, 111, 122, 0.14);
}

button.danger:hover {
  background: rgba(255, 111, 122, 0.24);
}

button.ok {
  background: rgba(89, 217, 142, 0.14);
}

button.ok:hover {
  background: rgba(89, 217, 142, 0.24);
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.pill {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--muted);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
}

.grid {
  display: grid;
  grid-template-columns: minmax(360px, 420px) 1fr;
  gap: 16px;
}

.card .card {
  background: rgba(12, 27, 40, 0.72);
  border-color: rgba(137, 186, 219, 0.18);
  box-shadow: none;
}

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

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.dot.running {
  background: var(--ok);
  box-shadow: 0 0 0 5px rgba(89, 217, 142, 0.15);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  border-bottom: 1px solid rgba(137, 186, 219, 0.16);
  padding: 8px 6px;
  font-size: 12px;
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.transcript {
  height: 520px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(7, 17, 26, 0.68);
  padding: 12px;
  white-space: pre-wrap;
  line-height: 1.5;
  font-family: var(--mono);
  font-size: 12px;
}

.observer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(205, 225, 240, 0.8);
  margin-bottom: 8px;
}

.link-btn {
  border: 1px solid rgba(255, 159, 67, 0.4);
  color: #ffba72;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 159, 67, 0.12);
}

.link-btn:hover {
  color: #ffe2bf;
  background: rgba(255, 159, 67, 0.2);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(13, 30, 44, 0.84);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card span {
  font-size: 12px;
  color: var(--muted);
}

.stat-card strong {
  font-size: 24px;
  color: #d8fff9;
}

.observer-grid {
  display: grid;
  grid-template-columns: 300px minmax(420px, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.panel-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-headline h2 {
  margin: 0;
}

.panel-headline button {
  margin: 0;
  padding: 7px 10px;
  font-size: 12px;
}

.navlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.navitem {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}

.navitem:hover {
  background: rgba(46, 196, 182, 0.14);
}

.navitem.active {
  border-color: rgba(46, 196, 182, 0.6);
  background: rgba(46, 196, 182, 0.18);
}

.navtitle {
  font-size: 13px;
  font-weight: 700;
}

.navmeta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.navright {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.badgedot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.badgedot.on {
  background: var(--ok);
}

.tip-block {
  margin-top: 12px;
  line-height: 1.6;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filters {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(11, 26, 39, 0.62);
  padding: 10px;
  margin-bottom: 10px;
}

.filter-col + .filter-col {
  margin-top: 8px;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  color: var(--muted);
}

.toggle-pill input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.rich-transcript {
  white-space: normal;
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event {
  border: 1px solid rgba(137, 186, 219, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}

.event-system {
  border-color: rgba(255, 159, 67, 0.38);
  background: rgba(255, 159, 67, 0.08);
}

.event-message {
  border-color: rgba(46, 196, 182, 0.34);
  background: rgba(46, 196, 182, 0.08);
}

.event-rewards {
  border-color: rgba(89, 217, 142, 0.35);
  background: rgba(89, 217, 142, 0.08);
}

.event-meta {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.event-body {
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin-bottom: 12px;
}

.leader-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.leader-name {
  font-weight: 600;
}

.leader-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.metric-chip {
  border-radius: 999px;
  border: 1px solid rgba(137, 186, 219, 0.26);
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

@media (max-width: 1260px) {
  .observer-grid {
    grid-template-columns: 290px minmax(420px, 1fr);
  }

  .state-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .observer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-logo {
    width: 54px;
    height: 54px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .observer-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .transcript {
    height: 430px;
  }
}

@media (max-width: 640px) {
  .wrap {
    margin: 16px auto;
    padding: 0 12px;
  }

  h1 {
    font-size: 26px;
  }

  .site-logo {
    width: 46px;
    height: 46px;
  }

  .row,
  .btns {
    flex-wrap: wrap;
  }

  .btns button {
    flex: 1 1 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .transcript {
    height: 340px;
  }
}
