/* Voiid Hub v3 — dark purple, top-nav */

:root {
  --bg: #0b0b12;
  --bg2: #10101a;
  --card: #14141f;
  --card2: #1a1a28;
  --line: #2c2c42;
  --text: #eceaf4;
  --muted: #9b96b0;
  --dim: #6a6580;
  --accent: #8b5cf6;
  --accent2: #a78bfa;
  --accent-d: #6d28d9;
  --glow: rgba(139, 92, 246, 0.28);
  --ok: #34d399;
  --err: #f87171;
  --r: 12px;
}

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

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(ellipse 80% 50% at 50% -30%, rgba(139, 92, 246, 0.14), transparent);
}

h1, h2, .brand-name {
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== LOGIN ========== */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(139, 92, 246, 0.18), transparent),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.login-mark, .mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  box-shadow: 0 0 20px var(--glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  color: #fff;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.login-mark { margin-bottom: 18px; width: 46px; height: 46px; }

.login-card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 26px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  padding: 11px 13px;
  background: #0e0e16 !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  color: var(--text) !important;
  font-size: 0.95rem;
  font-family: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--glow);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  margin-top: 6px;
}
.btn-primary:hover { box-shadow: 0 0 22px var(--glow); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }

.login-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ========== TOPBAR ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(11, 11, 18, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .mark { width: 34px; height: 34px; font-size: 0.9rem; border-radius: 10px; }
.brand-name { font-size: 1rem; white-space: nowrap; }

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  font-family: inherit;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: rgba(139, 92, 246, 0.22);
  color: var(--accent2);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.user-name { font-size: 0.82rem; color: var(--dim); }

.btn-out {
  font-size: 0.82rem;
  color: var(--muted) !important;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: border-color 0.15s, color 0.15s;
}
.btn-out:hover { border-color: var(--accent); color: var(--text) !important; }

/* ========== PANELS (views) ========== */
.panel { display: none; }
.panel.active { display: block; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 22px 40px;
}

.page-title { margin-bottom: 22px; }
.page-title h1 { font-size: 1.55rem; margin-bottom: 4px; }
.page-title p { color: var(--muted); font-size: 0.9rem; }

/* ========== CARDS ========== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.card h2 { font-size: 1.05rem; margin-bottom: 4px; }

.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent2);
  font-weight: 600;
  margin-bottom: 2px;
}

.pill {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent2);
  border: 1px solid rgba(139, 92, 246, 0.28);
  white-space: nowrap;
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ========== GRIDS ========== */
.grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.grid-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.card-wide { grid-column: 1 / -1; }

/* ========== FORM CONTROLS (forced dark) ========== */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inp,
.ta,
.sel,
input.inp,
textarea.ta,
select.sel {
  background: #0e0e16 !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  font-size: 0.9rem !important;
  font-family: inherit !important;
  padding: 10px 12px !important;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.inp { flex: 1; min-width: 0; width: auto; }
.ta {
  width: 100%;
  resize: vertical;
  margin-bottom: 10px;
  line-height: 1.45;
  display: block;
}
.sel {
  padding: 9px 12px !important;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%9b96b0' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 32px !important;
}

.inp:focus,
.ta:focus,
.sel:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--glow) !important;
}

.inp::placeholder,
.ta::placeholder { color: var(--dim) !important; }

.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace !important; font-size: 0.82rem !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  color: #fff !important;
  font-weight: 600;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow 0.12s, transform 0.12s, opacity 0.12s;
}
.btn:hover { box-shadow: 0 0 18px var(--glow); }
.btn:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}
.btn-ghost:hover {
  border-color: var(--accent) !important;
  color: var(--text) !important;
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  margin-top: 8px;
}
.chk input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.lbl {
  display: block;
  font-size: 0.72rem;
  color: var(--dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.coords {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .coords { grid-template-columns: 1fr; }
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s, border-color 0.1s;
}
.swatch:hover { transform: scale(1.12); border-color: #fff; }

.mc-prev {
  background: #1a1a24;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: 0.95rem;
  min-height: 42px;
  word-break: break-word;
  margin-top: 8px;
}

.status { font-size: 0.8rem; margin-top: 6px; min-height: 1.2em; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

/* ========== FEED ========== */
.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.feed::-webkit-scrollbar { width: 6px; }
.feed::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.feed-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg2);
  transition: background 0.15s, border-color 0.15s;
}
.feed-item:hover { background: var(--card2); border-color: #3a3a55; }

.feed-av {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
}

.feed-body { min-width: 0; flex: 1; }
.feed-top { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.feed-creator { font-weight: 600; font-size: 0.88rem; }
.feed-src {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
}
.feed-src.youtube { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
.feed-src.x { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
.feed-text {
  font-size: 0.86rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-decoration: none;
}
.feed-text:hover { color: var(--text); }
.feed-time { font-size: 0.72rem; color: var(--dim); margin-top: 4px; }
.feed-err { color: var(--muted); font-size: 0.88rem; padding: 16px; text-align: center; }

/* ========== STEAM ========== */
.steam {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.steam-art {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: var(--bg2);
  overflow: hidden;
  flex-shrink: 0;
}
.steam-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.steam-name { font-weight: 600; font-size: 0.95rem; }
.steam-meta {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}
.dot.online { background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.5); }
.dot.playing { background: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.5); }

.steam-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.stat-n { font-size: 1.25rem; font-weight: 700; font-family: 'Sora', sans-serif; }
.stat-l { font-size: 0.72rem; color: var(--dim); margin-top: 2px; }

/* ========== MISC ========== */
.skel {
  background: linear-gradient(90deg, #161622 25%, #22223a 50%, #161622 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.foot {
  text-align: center;
  font-size: 0.75rem;
  color: var(--dim);
  padding: 8px 16px 28px;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  box-shadow: 0 0 20px var(--glow);
  z-index: 200;
  pointer-events: none;
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 10px 14px; }
  .topbar-left { width: 100%; justify-content: space-between; }
  .tabs { overflow-x: auto; }
  .wrap { padding: 18px 14px 32px; }
}
