/* ============ StreamNexon – Basis ============ */
:root {
  --bg: #07060d;
  --bg-2: #0d0b18;
  --fg: #f3f1ff;
  --muted: #a19cbf;
  --dim: #6c6789;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --glass: rgba(20, 17, 38, 0.55);
  --glass-2: rgba(30, 26, 56, 0.6);
  --accent: #9146ff;
  --cyan: #3de0ff;
  --pink: #ff4fd8;
  --gold: #ffc94d;
  --green: #3ef0a1;
  --red: #ff5470;
  --twitch: #9146ff;
  --discord: #5865f2;
  --radius: 18px;
  --radius-sm: 12px;
  --f-display: "Unbounded Variable", "Unbounded", system-ui, sans-serif;
  --f-body: "Space Grotesk Variable", "Space Grotesk", system-ui, sans-serif;
  --f-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--f-mono); font-size: 0.85em; background: rgba(255,255,255,.06); padding: .1em .4em; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.w-full { width: 100%; }
.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }

::selection { background: color-mix(in srgb, var(--accent) 60%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Glass ---------- */
.glass {
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.015) 40%), var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 20px 60px -20px rgba(0,0,0,.6);
}

/* ---------- Buttons ---------- */
.btn {
  --b: rgba(255,255,255,.08);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .72em 1.25em; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--b); color: var(--fg); text-decoration: none; font-weight: 600; letter-spacing: .01em;
  cursor: pointer; transition: transform .15s ease, background .2s, box-shadow .2s, border-color .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.25); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .ico { width: 1.2em; height: 1.2em; }
.btn-sm { padding: .5em .95em; font-size: .88rem; }
.btn-lg { padding: .95em 1.6em; font-size: 1.05rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--cyan)));
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 80%, transparent), 0 0 0 1px rgba(255,255,255,.12) inset;
}
.btn-primary:hover { box-shadow: 0 14px 40px -10px color-mix(in srgb, var(--accent) 90%, transparent), 0 0 0 1px rgba(255,255,255,.2) inset; }
.btn-twitch { background: var(--twitch); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -10px rgba(145,70,255,.8); }
.btn-twitch:hover { background: #a06bff; }
.btn-discord { background: var(--discord); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -10px rgba(88,101,242,.8); }
.btn-ghost { background: rgba(255,255,255,.04); }
.btn-danger { background: var(--red); border-color: transparent; color: #fff; }
.btn-danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--red) 50%, transparent); color: var(--red); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--f-display); font-weight: 500; letter-spacing: .08em; font-size: 1rem; }
.logo b { font-weight: 800; background: linear-gradient(90deg, #c7a6ff, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark { width: 30px; height: 30px; filter: drop-shadow(0 0 12px rgba(145,70,255,.6)); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .45em; padding: .3em .8em; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.06); border: 1px solid var(--line-2); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-live { color: var(--green); }
.pill-live i { box-shadow: 0 0 10px currentColor; animation: pulse 1.6s infinite; }
.pill-paused { color: var(--gold); }
.pill-ended { color: var(--red); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Alerts ---------- */
.alert { padding: .9rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: rgba(255,255,255,.05); margin: 1rem 0; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.alert-error { border-color: rgba(255,84,112,.4); background: rgba(255,84,112,.1); }
.alert-success { border-color: rgba(62,240,161,.4); background: rgba(62,240,161,.08); }

/* ---------- Grain ---------- */
.grain, .noise {
  position: absolute; inset: -50%; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); }
  60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } 100% { transform: translate(0,0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
