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

:root {
  --bg: #05080a;
  --panel: rgba(6, 12, 16, 0.82);
  --line: rgba(32, 195, 224, 0.22);
  --text: #e8f6f8;
  --muted: rgba(255, 255, 255, 0.55);
  --accent: #20C3E0;
  --accent-glow: rgba(32, 195, 224, 0.55);
  --danger: #ff5c7a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--text);
  font: 14px/1.45 "Space Grotesk", "Segoe UI", sans-serif;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(32, 195, 224, 0.55) rgba(0, 10, 14, 0.55);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 10, 14, 0.55);
  border-radius: 999px;
  margin: 6px 0;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(32, 195, 224, 0.85), rgba(32, 195, 224, 0.4));
  border-radius: 999px;
  border: 2px solid rgba(0, 10, 14, 0.55);
  box-shadow: 0 0 12px rgba(32, 195, 224, 0.25);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
#particles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.corner {
  position: fixed;
  width: 44px;
  height: 44px;
  z-index: 10;
  pointer-events: none;
  opacity: 0.75;
}
.corner::before, .corner::after {
  content: "";
  position: absolute;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.corner-tl { top: 24px; left: 24px; }
.corner-tl::before { top: 0; left: 0; width: 26px; height: 2px; }
.corner-tl::after { top: 0; left: 0; width: 2px; height: 26px; }
.corner-tr { top: 24px; right: 24px; }
.corner-tr::before { top: 0; right: 0; width: 26px; height: 2px; }
.corner-tr::after { top: 0; right: 0; width: 2px; height: 26px; }
.corner-bl { bottom: 24px; left: 24px; }
.corner-bl::before { bottom: 0; left: 0; width: 26px; height: 2px; }
.corner-bl::after { bottom: 0; left: 0; width: 2px; height: 26px; }
.corner-br { bottom: 24px; right: 24px; }
.corner-br::before { bottom: 0; right: 0; width: 26px; height: 2px; }
.corner-br::after { bottom: 0; right: 0; width: 2px; height: 26px; }

.site-live {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 16;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 12, 16, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 18px rgba(32, 195, 224, 0.12);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
.site-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.site-live span { color: var(--text); }

#toasts {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 48px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 3px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 10px;
  row-gap: 2px;
  text-align: left;
  cursor: pointer;
  padding: 10px 12px 10px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 12, 16, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(32, 195, 224, 0.12);
  color: var(--text);
  animation: toastIn 0.28s ease-out;
}
.toast-bar {
  grid-row: 1 / span 3;
  width: 3px;
  border-radius: 3px;
  background: var(--chip, var(--accent));
  box-shadow: 0 0 10px var(--chip, var(--accent));
}
.toast-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.toast strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.toast-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.toast-out { animation: toastOut 0.25s ease-in forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(18px); }
}

button, input { font: inherit; }

.kicker { margin: 0 0 4px; color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase; font-size: 11px; }
h1, h2 { margin: 0; font-weight: 650; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 10px 0 0; }

.login-wrap {
  min-height: 100%;
  position: relative;
  z-index: 5;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.45) 100%),
    linear-gradient(180deg, rgba(0, 8, 12, 0.25) 0%, transparent 35%, transparent 65%, rgba(0, 8, 12, 0.55) 100%);
}
.fx-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  opacity: 0.55;
}
.fx-orb-a {
  width: 280px; height: 280px;
  background: #20C3E0;
  top: -80px; left: -60px;
  animation: driftA 14s ease-in-out infinite;
}
.fx-orb-b {
  width: 220px; height: 220px;
  background: #147a88;
  bottom: -70px; right: 8%;
  animation: driftB 18s ease-in-out infinite;
}
.fx-orb-c {
  width: 160px; height: 160px;
  background: #5ee7f5;
  top: 40%; right: -50px;
  animation: driftC 12s ease-in-out infinite;
}
.fx-spark {
  position: absolute;
  width: 6px; height: 6px;
  background: #fff;
  box-shadow: 0 0 12px 4px var(--accent);
  pointer-events: none;
  border-radius: 50%;
}
.fx-spark-1 { animation: spark 9s linear infinite; }
.fx-spark-2 { animation: spark 11s linear infinite 2s; }
.fx-spark-3 { animation: spark 8s linear infinite 4s; }
@keyframes driftA {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(80px, 50px); }
}
@keyframes driftB {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-70px, -40px); }
}
@keyframes driftC {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 60px) scale(1.15); }
}
@keyframes spark {
  0% { top: 110%; left: 12%; opacity: 0; }
  10% { opacity: 1; }
  100% { top: -8%; left: 78%; opacity: 0; }
}
.login-stage {
  width: min(960px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 48px rgba(32, 195, 224, 0.12), 0 24px 60px rgba(0, 0, 0, 0.45);
}
.login-visual {
  position: relative;
  padding: 40px 36px 36px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  background: transparent;
  overflow: hidden;
}
.login-grid {
  position: absolute;
  inset: -40px;
  background-image:
    linear-gradient(rgba(32, 195, 224, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 195, 224, 0.11) 1px, transparent 1px);
  background-size: 32px 32px;
  animation: gridMove 18s linear infinite;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.2), rgba(0,0,0,0.9));
  z-index: 0;
}
@keyframes gridMove {
  from { transform: translate(0, 0); }
  to { transform: translate(32px, 32px); }
}
.login-scan {
  position: absolute;
  left: 0; right: 0;
  height: 80px;
  background: linear-gradient(180deg, transparent, rgba(32, 195, 224, 0.18), transparent);
  animation: scan 4.5s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
@keyframes scan {
  0% { top: -80px; }
  100% { top: 110%; }
}
.login-logo {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  height: auto;
  mix-blend-mode: screen;
  animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.03); }
}
.login-tag {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 12px;
}
.login-points {
  position: relative;
  z-index: 2;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.login-points li {
  padding-left: 16px;
  position: relative;
}
.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  background: var(--accent);
}
.login-panel {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  border-left: 1px solid var(--line);
}
.login-panel h1 { font-size: 34px; letter-spacing: -0.03em; }
.login-lead { margin: 0; color: var(--muted); max-width: 32ch; }
.login-foot { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.discord-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  text-decoration: none;
  background: var(--accent);
  color: #062226;
  padding: 14px 16px;
  font-weight: 700;
}
.discord-btn:hover { filter: brightness(1.08); }
.login-panel .error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--danger);
  background: rgba(255, 92, 122, 0.08);
}
input, button { border: 1px solid var(--line); background: #071416; color: var(--text); padding: 10px 12px; }
button { background: var(--accent); border-color: var(--accent); color: #fff; cursor: pointer; }
button.toast {
  background: rgba(6, 12, 16, 0.92);
  border: 1px solid var(--line);
  color: var(--text);
}
button.ghost { background: transparent; color: var(--muted); border: 0; padding: 8px 0; text-align: left; }

#app:not([hidden]) {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 5;
  padding: 20px;
  background:
    radial-gradient(ellipse at center, transparent 28%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(180deg, rgba(0, 8, 12, 0.2) 0%, transparent 40%, rgba(0, 8, 12, 0.55) 100%);
}
aside {
  min-height: 0;
  max-height: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 12px 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(6, 12, 16, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), 0 0 40px rgba(32, 195, 224, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.brand {
  padding: 4px 10px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.brand-logo {
  width: 100%;
  max-height: 72px;
  object-fit: contain;
  margin-bottom: 10px;
  mix-blend-mode: screen;
}
.brand h1 { font-size: 22px; letter-spacing: -0.03em; }
#who { margin: 6px 0 0; font-size: 12px; }
#groups {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 4px 8px;
}
.group {
  margin: 14px 6px 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}
.chan {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
}
.chan b { font-weight: 600; font-size: 13px; }
.chan:hover { background: rgba(32, 195, 224, 0.08); border-color: rgba(32, 195, 224, 0.12); }
.chan.active {
  background: rgba(32, 195, 224, 0.14);
  border-color: var(--line);
  color: #fff;
  box-shadow: 0 0 18px rgba(32, 195, 224, 0.12);
}
.chan span {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
#logout.ghost {
  margin: 8px 6px 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}
#logout.ghost:hover { color: #fff; border-color: var(--accent); }

main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(6, 12, 16, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
}
main::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
header h2 { font-size: 26px; letter-spacing: -0.03em; }
#sub { margin: 4px 0 0; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}
.live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}
.search-wrap { width: min(380px, 42vw); }
#search {
  width: 100%;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 12px 14px;
  outline: none;
}
#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 195, 224, 0.15);
}

#feed {
  flex: 1 1 0;
  min-height: 0;
  padding: 16px 10px 24px 20px;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
}
.card {
  position: relative;
  display: block;
  flex: none;
  height: auto;
  background: rgba(7, 16, 20, 0.78);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px 12px 20px;
  min-width: 0;
  margin: 0 6px 10px 0;
  overflow: visible;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:last-child {
  margin-bottom: 8px;
}
.card:hover {
  border-color: rgba(32, 195, 224, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 20px rgba(32, 195, 224, 0.07);
}
.card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}
.card-inner {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.card-compact {
  padding-top: 10px;
  padding-bottom: 10px;
}
.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--chip) 55%, transparent);
  background: color-mix(in srgb, var(--chip) 16%, transparent);
  color: #e8f6f8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}
.card-who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.card-head time {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}
.card h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.card-body, .card-full { color: rgba(255, 255, 255, 0.82); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.card-body { margin: 0; }
.card-preview {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.pill {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(32, 195, 224, 0.12);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pill b {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}
.card-more {
  margin-top: 8px;
  border-top: 1px solid rgba(32, 195, 224, 0.1);
  padding-top: 6px;
}
.card-more summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  list-style: none;
}
.card-more summary::-webkit-details-marker { display: none; }
.card-more summary::after { content: " +"; }
.card-more[open] summary::after { content: " –"; }
.card-more .fields { margin-top: 10px; }
.card-foot { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.swatch {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 50%;
}
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.field {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(32, 195, 224, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
}
.field b { display: block; color: var(--accent); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.media { margin-top: 10px; max-width: min(520px, 100%); border-radius: 10px; overflow: hidden; }
.media img, .media video { max-width: 100%; display: block; }
#feed.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.empty {
  color: var(--muted);
  margin: 0;
  padding: 0 16px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.empty span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  opacity: 0.7;
}

@media (max-width: 860px) {
  #app:not([hidden]) { grid-template-columns: 1fr; padding: 12px; }
  aside { display: none; }
  .search-wrap { width: min(240px, 46vw); }
  .login-stage { grid-template-columns: 1fr; min-height: 0; }
  .login-visual { min-height: 220px; padding: 32px 24px; }
  .login-panel { border-left: 0; border-top: 1px solid var(--line); padding: 32px 24px; }
}
