:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-border: #2a3140;
  --text: #e8ecf4;
  --muted: #9aa3b5;
  --accent: #fe2c55;
  --accent-2: #25f4ee;
  --online: #3ddc97;
  --offline: #ff6b6b;
  --connecting: #f0c14b;
  --radius: 12px;
  --font: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(254, 44, 85, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(37, 244, 238, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
}

.brand h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

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

.status[data-state="online"] {
  color: var(--online);
}

.status[data-state="offline"] {
  color: var(--offline);
}

.status[data-state="connecting"] {
  color: #f0c14b;
}

.status[data-state="waiting"] {
  color: #7eb6ff;
}

.connect-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.connect-row {
  display: flex;
  gap: 0.5rem;
}

.connect-row input {
  min-width: 220px;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: #0c0e13;
  color: var(--text);
}

.connect-row button {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #ff5a7a);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.connect-row button:hover {
  filter: brightness(1.08);
}

.panels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
}

@media (max-width: 1200px) {
  .panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .panels {
    grid-template-columns: 1fr;
  }

  .connect-row {
    flex-direction: column;
  }

  .connect-row input {
    min-width: 0;
    width: 100%;
  }
}

.panel {
  background: color-mix(in srgb, var(--panel) 92%, black);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.panel h2 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge {
  background: #222836;
  color: var(--accent-2);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.feed {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: calc(100vh - 220px);
}

.event-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.7rem;
  padding: 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  animation: fadeIn 0.25s ease;
}

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

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
}

.event-title {
  font-size: 0.9rem;
  line-height: 1.3;
}

.event-title .nick {
  color: var(--muted);
  font-weight: 400;
}

.event-meta {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.event-detail {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  word-break: break-word;
}
