/* ── animated background (site-wide) ─────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .7;
}

.bg-glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(90px);
  animation: bg-drift 18s ease-in-out infinite alternate;
}
.bg-glow--1 {
  width: 520px; height: 520px;
  top: -120px; left: -80px;
  background: radial-gradient(circle, rgba(56,200,240,.13) 0%, transparent 70%);
}
.bg-glow--2 {
  width: 480px; height: 480px;
  bottom: -100px; right: -60px;
  background: radial-gradient(circle, rgba(167,139,250,.1) 0%, transparent 70%);
  animation-delay: -9s;
}
@keyframes bg-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.08); }
}

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

/* ── maintenance banner ──────────────────────────────────── */
.maint-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem 1.25rem;
  background: rgba(255, 209, 0, 0.08);
  border-bottom: 1px solid rgba(255, 209, 0, 0.25);
  color: #ffd100;
  font-size: .8125rem;
  font-family: var(--font, system-ui, sans-serif);
  line-height: 1.4;
  text-align: center;
}
.maint-banner strong { color: #ffe14d; font-weight: 600; }

:root {
  --bg-deep: #060607;
  --bg: #0c0d10;
  --bg-elevated: #14161c;
  --bg-card: #101218;
  --bg-hover: #1a1d26;
  --border: rgba(255, 255, 255, 0.065);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f0f2f5;
  --text-muted: #8b95a5;
  --accent: #38c8f0;
  --accent-dim: #1da8d0;
  --accent-soft: rgba(56, 200, 240, 0.12);
  --accent-glow: rgba(56, 200, 240, 0.22);
  --accent-2: #ffd100;
  --accent-2-soft: rgba(255, 209, 0, 0.14);
  --danger: #ff5c7a;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Syne", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(56, 200, 240, 0.08);
  --space: 1rem;
  --header-h: 72px;
  --sidebar-w: 252px;
  --text-scale: 100%;
}

[data-theme="light"] {
  --bg-deep: #eceef2;
  --bg: #f8f9fb;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #eef0f4;
  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.11);
  --text: #0c0d10;
  --text-muted: #5a6474;
  --accent: #0094b8;
  --accent-dim: #007a9a;
  --accent-soft: rgba(0, 148, 184, 0.12);
  --accent-glow: rgba(0, 148, 184, 0.18);
  --accent-2: #c49a00;
  --accent-2-soft: rgba(196, 154, 0, 0.14);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 48px rgba(0, 148, 184, 0.06);
}

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

html {
  font-size: var(--text-scale);
}

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -40%, rgba(56, 200, 240, 0.06), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(30, 80, 200, 0.04), transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space);
  top: -100px;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: calc(var(--space) + 4px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo__mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
  box-shadow: 0 0 22px var(--accent-glow);
  border-radius: 9px;
}

.logo__text {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 1.05rem;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
}

.logo__text-accent {
  color: var(--accent-2);
  text-shadow: 0 0 18px rgba(255, 209, 0, 0.35);
}

.logo__img {
  height: 64px;
  width: auto;
  display: block;
  border-radius: 6px;
}

.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 0.7rem 5.75rem 0.7rem 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 92%, var(--bg-elevated));
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.4;
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239aa3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
  pointer-events: none;
}

.header-search input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-glow);
}

body.high-contrast-focus *:focus-visible {
  outline: 3px solid var(--accent) !important;
  outline-offset: 3px !important;
}

.header-search__kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
  pointer-events: none;
  opacity: 0.55;
  font-size: 0.7rem;
}

kbd {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

.header-nav {
  display: none;
  gap: 0.25rem;
}

@media (min-width: 900px) {
  .header-nav {
    display: flex;
  }
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
}

.header-nav a:hover,
.header-nav a.is-active {
  color: var(--text);
  background: var(--bg-hover);
}

.header-nav a.is-active {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  background: transparent;
  color: var(--text);
}

.btn--ghost {
  border-color: var(--border);
  background: color-mix(in srgb, var(--bg-card) 85%, transparent);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

body:not(.reduce-motion) .btn--ghost:active {
  transform: scale(0.98);
}

.btn--ghost[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
  color: var(--accent);
  background: var(--accent-soft);
}

.btn--primary {
  background: linear-gradient(180deg, #6efe3a 0%, var(--accent) 40%, var(--accent-dim) 100%);
  color: #081008;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, #000);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 4px 20px var(--accent-glow);
  transition: filter 0.15s, transform 0.15s;
}

.btn--primary:hover {
  filter: brightness(1.06);
}

body:not(.reduce-motion) .btn--primary:active {
  transform: scale(0.98);
}

.btn--small {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
}

.btn-kick-signin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--kick-green, #53fc18);
  color: #050d05;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 7px;
  padding: 0.45rem 1rem 0.45rem 0.8rem;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 2px 6px rgba(0,0,0,0.3);
  transition: filter 0.12s, box-shadow 0.12s, transform 0.1s;
}

.btn-kick-signin:hover {
  filter: brightness(1.07);
  box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 3px 12px rgba(83,252,24,0.45);
}

body:not(.reduce-motion) .btn-kick-signin:active {
  transform: scale(0.97);
  filter: brightness(0.96);
}

/* ── Admin badge ──────────────────────────────────────────── */
.btn-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .3rem .65rem;
  border-radius: 6px;
  border: 1px solid rgba(251,191,36,.35);
  background: rgba(251,191,36,.1);
  color: #fbbf24;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-admin-badge:hover { background: rgba(251,191,36,.18); border-color: rgba(251,191,36,.55); }

/* ── Admin panel ──────────────────────────────────────────── */
.admin-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  backdrop-filter: blur(3px);
}
.admin-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  width: min(92vw, 860px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.admin-panel__inner { display: flex; flex-direction: column; height: 100%; }
.admin-panel__hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-panel__title { font-weight: 700; font-size: .95rem; color: #fbbf24; }
.admin-panel__tabs {
  display: flex; gap: .25rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-tab {
  font-family: inherit; font-size: .8rem; font-weight: 600;
  padding: .3rem .75rem; border-radius: 6px; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background .12s, color .12s;
}
.admin-tab:hover { background: var(--bg-elevated); color: var(--text); }
.admin-tab.is-active { background: var(--bg-card); color: var(--text); }
.admin-panel__body { overflow-y: auto; flex: 1; padding: .75rem 1rem; }
.admin-loading, .admin-empty { color: var(--text-muted); font-size: .85rem; padding: 1.5rem 0; text-align: center; }
.admin-tbl { width: 100%; border-collapse: collapse; font-size: .8rem; }
.admin-tbl th { text-align: left; padding: .45rem .6rem; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-deep); }
.admin-tbl td { padding: .4rem .6rem; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
.admin-tbl tr:last-child td { border-bottom: none; }
.admin-link { color: var(--accent); text-decoration: none; }
.admin-link:hover { text-decoration: underline; }
.admin-kv { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; }
.admin-kv__row { display: flex; justify-content: space-between; padding: .35rem .5rem; border-radius: 6px; background: var(--bg-card); }
.admin-kv__k { color: var(--text-muted); }
.admin-kv__v { font-weight: 600; color: var(--text); font-family: var(--font-mono); }

.btn--block {
  width: 100%;
  margin-bottom: 0.65rem;
}

.layout[hidden] { display: none !important; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr minmax(300px, 340px);
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h) - 80px);
  gap: 0;
}

.layout.is-focus {
  grid-template-columns: 0 1fr 0;
}

.layout.is-focus .sidebar {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  width: 0;
  padding: 0;
  border: 0;
}

.layout.is-focus .theater__stage {
  grid-template-columns: 1fr;
}

.layout.is-focus .theater__chat {
  display: none;
}

.sidebar {
  padding: 1.35rem 1.1rem;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
}

.sidebar--right {
  border-right: 0;
  border-left: 1px solid var(--border);
}

.sidebar__title {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.sidebar__list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.sidebar__link:hover,
.sidebar__link.is-active {
  color: var(--text);
  background: var(--bg-hover);
}

.sidebar__link.is-active {
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar__link .icon {
  opacity: 0.7;
  font-size: 0.85rem;
}

.badge {
  margin-left: auto;
  font-size: 0.7rem;
  background: var(--bg-elevated);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.main {
  padding: 1.5rem var(--space) 3rem;
  border-right: 1px solid var(--border);
}

.layout:not(.is-focus) .main {
  border-right: 1px solid var(--border);
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.hero__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.03em;
}

.hero__lede {
  margin: 0;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1rem;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chip {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}

.chip:hover,
.chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
}

.hero__stats {
  display: flex;
  gap: 1.5rem;
}

.stat {
  text-align: right;
}

.stat__value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.stat__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
}

.toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.toolbar__label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.select {
  font-family: inherit;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.toolbar input[type="range"] {
  width: 140px;
  accent-color: var(--accent);
}

.output {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 3.5rem;
}

.toolbar__grow {
  flex: 1;
  min-width: 0.5rem;
}

.section {
  margin-bottom: 2.5rem;
}

.section--muted {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.section__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.link:hover {
  text-decoration: underline;
}

.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

body:not(.reduce-motion) .card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
}

.card__thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #1a1d24, #0d0f12);
  position: relative;
  overflow: hidden;
}

.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__live {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

body:not(.reduce-motion) .card__live {
  animation: pulse 2s ease-in-out infinite;
}

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

.card__viewers {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.65);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.card__follow {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  transition: background 0.15s, color 0.15s;
}

.card__follow:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.card__follow[aria-pressed="true"] {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.card__body {
  padding: 0.85rem 1rem 1rem;
}

.card__title-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.card__meta {
  min-width: 0;
}

.card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__game {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__tags {
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

.clip-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.clip {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.clip__thumb {
  aspect-ratio: 16 / 9;
  background: #1a1d24;
}

.clip__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clip__body {
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
}

.clip__title {
  margin: 0;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.panel {
  background: color-mix(in srgb, var(--bg-card) 92%, var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.panel__title {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.panel__field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

.panel__field span {
  color: var(--text-muted);
}

.panel__check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.panel__note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
}

.tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tips li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tips li kbd {
  flex-shrink: 0;
  margin-left: 0.5rem;
  font-size: 0.68rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 200;
}

/* ── Live notifications (bottom-right stack) ─────────────────── */
.live-notif-stack {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-end;
  pointer-events: none;
}

.live-notif {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem 0.7rem 0.75rem;
  background: var(--bg-elevated, #1a1a1a);
  border: 1px solid rgba(83, 252, 24, 0.35);
  border-left: 3px solid var(--kick-green, #53fc18);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.55), 0 0 0 1px rgba(83,252,24,0.08);
  backdrop-filter: blur(10px);
  min-width: 240px;
  max-width: 300px;
  pointer-events: all;
  cursor: pointer;
  animation: notif-in 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}
.live-notif:hover { border-color: rgba(83,252,24,0.6); }
.live-notif.notif-out { animation: notif-out 0.2s ease-in forwards; }

@keyframes notif-in {
  from { opacity: 0; transform: translateX(110%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes notif-out {
  from { opacity: 1; transform: translateX(0); max-height: 120px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(110%); max-height: 0;   margin-bottom: -0.6rem; }
}

.live-notif__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2, #222);
}
.live-notif__avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--kick-green, #53fc18);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.live-notif__body { flex: 1; min-width: 0; }
.live-notif__name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-notif__status {
  font-size: 0.72rem;
  color: var(--kick-green, #53fc18);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.live-notif__status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kick-green, #53fc18);
  animation: pulse-dot 1.5s infinite;
  flex-shrink: 0;
}
.live-notif__cat {
  font-size: 0.7rem;
  color: var(--text-muted, #888);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-notif__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #888);
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.15rem;
  border-radius: 4px;
  flex-shrink: 0;
  align-self: flex-start;
}
.live-notif__close:hover { color: var(--text, #fff); }

.palette {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: start center;
  padding-top: 10vh;
}

.palette[hidden] { display: none; }

.palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.palette__panel {
  position: relative;
  width: min(580px, 94vw);
  background: color-mix(in srgb, var(--bg-card) 96%, var(--bg-elevated));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), 0 0 100px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.palette__search-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
}

.palette__search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.45;
  margin-right: 0.65rem;
}

.palette__input {
  flex: 1;
  padding: 1rem 0;
  font-size: 1rem;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text);
}

.palette__input:focus { outline: none; }

.palette__clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  opacity: 0.6;
}
.palette__clear:hover { opacity: 1; background: var(--bg-hover); }

.palette__results {
  padding: 0.5rem 0.5rem;
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.palette__section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.5rem 0.6rem 0.25rem;
  margin: 0;
}

.palette__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.1s;
}

.palette__item:hover,
.palette__item.is-highlighted {
  background: var(--bg-hover);
}

.palette__item.is-highlighted {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-hover));
}

.palette__item-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.palette__item-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.palette__item-info {
  flex: 1;
  min-width: 0;
}

.palette__item-name {
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette__item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette__item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.palette__live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  flex-shrink: 0;
}

.palette__viewers {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.palette__cat-chip {
  font-size: 0.62rem;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette__footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.palette__footer kbd {
  font-size: 0.62rem;
  padding: 0.05rem 0.3rem;
}

.palette__footer-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.palette__match {
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.sidebar__badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.header-nav__ext {
  opacity: 0.6;
  font-size: 0.82rem !important;
}

.sidebar__hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
  line-height: 1.4;
}

.main--watch {
  padding: 1.25rem var(--space) 2.5rem;
}

.live-status {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 90%, var(--bg-elevated)), var(--bg-card));
  font-size: 0.875rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

.live-status__text {
  flex: 1;
  min-width: 0;
}

.live-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.live-status.is-live {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--bg-card) 88%, transparent));
}

.live-status.is-live .live-status__dot {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.live-status.is-error .live-status__dot {
  background: var(--danger);
}

.discover-tile__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.channel-row__avatar--img {
  padding: 0;
  overflow: hidden;
}

.channel-row__avatar--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.palette__sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Watch row: fixed ~75% / 25% split (Kick-like), chat height tracks video row */
.theater {
  display: block;
}

.theater__primary {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.theater__stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

.player-shell {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: radial-gradient(ellipse at center, #1a1d22 0%, #000 70%);
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-md), var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.player-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#player-ban-notice:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
}

/* ── volume bar overlay ─────────────────────────────────────── */




.player-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.15rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 85%, var(--bg-elevated));
  box-shadow: var(--shadow-sm);
}

.player-meta__avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.player-meta__avatar-img {
  position: absolute;
  inset: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  z-index: 1;
}

.player-meta__mark {
  position: absolute;
  inset: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-dim));
  color: #000;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 1rem;
  z-index: 0;
}

.player-meta__avatar-img:not([hidden]) ~ .player-meta__mark {
  visibility: hidden;
}

.player-meta__text {
  flex: 1;
  min-width: 0;
}

.channel-title {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.channel-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.live-pill {
  display: inline-block;
  background: linear-gradient(135deg, #ff7a8f, var(--danger));
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.35);
}

.player-meta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ── Speed selector + adaptive lag badge ─────────────────────── */
.speed-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.speed-sel {
  background: var(--bg-elevated, #1e1e1e);
  color: var(--text, #fff);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  appearance: auto;
  line-height: 1.3;
}
.speed-sel:hover { border-color: var(--kick-green, #53fc18); }
.speed-sel:focus-visible { outline: 2px solid var(--kick-green, #53fc18); outline-offset: 2px; }

/* Lag badge — shown only when HLS is active */
.speed-lag-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  color: var(--text-muted, #999);
  white-space: nowrap;
  user-select: none;
  transition: background 0.2s, color 0.2s;
}
.speed-lag-badge--live {
  background: rgba(83,252,24,0.15);
  color: var(--kick-green, #53fc18);
}
.speed-lag-badge--warn {
  background: rgba(249,115,22,0.15);
  color: #f97316;
}

.channel-mobile {
  display: none;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.theater__chat {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  min-width: 0;
  width: 100%;
  min-height: 0;
  max-height: none;
  background: linear-gradient(180deg, var(--bg-card) 0%, color-mix(in srgb, var(--bg-card) 92%, #000) 100%);
  border-left: 1px solid var(--border-strong);
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--bg-elevated) 50%, transparent);
  gap: 0.5rem;
}

.chat-header__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.chat-translate-lang {
  font-size: 0.68rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 5px;
  padding: 0.15em 0.4em;
  cursor: pointer;
  font-family: var(--font-mono);
}

.btn--tiny {
  font-size: 0.7rem;
  padding: 0.2em 0.55em;
  border-radius: 5px;
}

.btn--active {
  background: color-mix(in srgb, var(--accent) 15%, transparent) !important;
  color: var(--accent) !important;
  border-color: color-mix(in srgb, var(--accent) 50%, transparent) !important;
}

.link--small {
  font-size: 0.8rem;
}

/* ── Pinned message ──────────────────────────────────────────── */
.chat-pinned {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  font-size: 0.78rem;
  line-height: 1.4;
  flex-shrink: 0;
}
.chat-pinned[hidden] { display: none; }
.chat-pinned__icon { flex-shrink: 0; font-size: 0.75rem; margin-top: 0.05rem; opacity: 0.7; }
.chat-pinned__body { flex: 1; min-width: 0; word-break: break-word; }
.chat-pinned__label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.75;
  margin-bottom: 0.1rem;
}
.chat-pinned__author { font-weight: 700; color: var(--accent); }
.chat-pinned__sep   { color: var(--text-muted); margin: 0 0.05rem; }
.chat-pinned__msg   { color: var(--text); }
.chat-pinned__close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.1rem 0.2rem;
  line-height: 1;
  opacity: 0.6;
  border-radius: 3px;
  transition: opacity 0.15s;
}
.chat-pinned__close:hover { opacity: 1; }

/* ── Gift leaderboard panel ──────────────────────────────────── */
.leaderboard-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-deep) 70%, transparent);
  max-height: 260px;
}
.leaderboard-panel[hidden] { display: none; }

.leaderboard-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 0.5rem;
  flex-shrink: 0;
}
.lb-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.lb-tab:hover { color: var(--text); }
.lb-tab--active { color: var(--accent); border-bottom-color: var(--accent); }

.leaderboard-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.85rem;
  font-size: 0.78rem;
  transition: background 0.1s;
}
.lb-row:hover { background: color-mix(in srgb, var(--bg-hover) 60%, transparent); }
.lb-rank {
  flex-shrink: 0;
  width: 1.4rem;
  text-align: right;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.lb-row:nth-child(1) .lb-rank { color: #fbbf24; }
.lb-row:nth-child(2) .lb-rank { color: #9ca3af; }
.lb-row:nth-child(3) .lb-rank { color: #cd7c45; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lb-count { flex-shrink: 0; font-weight: 700; color: var(--accent); font-family: var(--font-mono); font-size: 0.75rem; }
.lb-unit  { font-weight: 400; color: var(--text-muted); font-family: var(--font-sans, inherit); font-size: 0.7rem; }

.leaderboard-empty {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 1.2rem 0.5rem;
  opacity: 0.6;
}
.leaderboard-empty[hidden] { display: none; }

/* ── Gift sub notification in chat ───────────────────────────── */
.chat-msg--gift {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  margin: 0.2rem 0;
  background: color-mix(in srgb, #a855f7 10%, transparent);
  border-left: 2px solid rgba(168, 85, 247, 0.55);
  border-radius: 5px;
  animation: chat-in 0.15s ease-out both;
}
.chat-msg--gift:hover { background: color-mix(in srgb, #a855f7 16%, transparent); }
.chat-gift__icon { font-size: 0.95rem; flex-shrink: 0; }
.chat-gift__text { font-size: 0.8rem; color: var(--text); line-height: 1.4; }
.chat-gift__text strong { color: #c084fc; }

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  background: color-mix(in srgb, var(--bg-deep) 60%, transparent);
}

.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

.chat-paused-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(56, 200, 240, 0.12);
  color: #38c8f0;
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  border: 1px solid rgba(56, 200, 240, 0.35);
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}
.chat-paused-badge[hidden] { display: none; }

.chat-status {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 1.5rem 0;
  opacity: 0.6;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

@keyframes chat-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg {
  font-size: 0.825rem;
  line-height: 1.45;
  word-break: break-word;
  padding: 0.12rem 0.25rem;
  border-radius: 5px;
  transition: background 0.1s;
  animation: chat-in 0.12s ease-out both;
}

.chat-msg:hover {
  background: color-mix(in srgb, var(--bg-hover) 60%, transparent);
}

.chat-msg--first {
  background: rgba(56, 200, 240, 0.07);
  border-left: 2px solid rgba(56, 200, 240, 0.5);
  padding-left: 0.5rem;
  margin: 0.15rem 0;
}

.chat-msg--first:hover {
  background: rgba(56, 200, 240, 0.12);
}

.chat-msg__first-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #38c8f0;
  opacity: 0.75;
  margin-bottom: 0.1rem;
}

.chat-msg__badges {
  display: inline;
  margin-right: 0.25rem;
}

.chat-badge {
  display: inline-block;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.1em 0.38em;
  border-radius: 3px;
  margin-right: 0.18em;
  vertical-align: middle;
  position: relative;
  top: -1px;
  line-height: 1.6;
}

.chat-badge--broadcaster { background: rgba(239,68,68,0.18); color: #ef4444; }
.chat-badge--moderator   { background: rgba(56,200,240,0.14); color: #38c8f0; }
.chat-badge--subscriber  { background: rgba(139,92,246,0.18); color: #a78bfa; }
.chat-badge--vip         { background: rgba(250,204,21,0.16); color: #facc15; }
.chat-badge--og          { background: rgba(250,204,21,0.16); color: #facc15; }
.chat-badge--founder     { background: rgba(249,115,22,0.16); color: #f97316; }
.chat-badge--level       { background: rgba(83,252,24,0.14); color: #53fc18; font-weight: 700; }

.chat-msg__user {
  font-weight: 700;
  font-size: 0.825rem;
  color: var(--accent);
  cursor: default;
  text-transform: capitalize;
}

.chat-msg__sep {
  color: var(--text-muted);
  font-weight: 400;
  margin: 0 0.05rem;
}

.chat-msg__text {
  color: var(--text);
}

.chat-msg__translation {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.18rem;
  padding-left: 0.5rem;
  border-left: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  line-height: 1.4;
}

.chat-badge-img {
  display: inline-block;
  height: 1.1em;
  width: auto;
  vertical-align: middle;
  position: relative;
  top: -1px;
  object-fit: contain;
  margin-right: 0.15em;
}

.chat-badge-svg {
  display: inline-flex;
  align-items: center;
  margin-right: 0.15em;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.chat-badge-svg svg {
  display: block;
  height: 1.1em;
  width: auto;
  min-width: 0.5em;
  overflow: visible;
  flex-shrink: 0;
}

.chat-emote {
  display: inline-block;
  height: 2em;
  width: auto;
  vertical-align: middle;
  position: relative;
  top: -1px;
  object-fit: contain;
}

.chat-input-bar {
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: color-mix(in srgb, var(--bg-elevated) 50%, transparent);
}

.chat-input-bar .btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(40vh, 380px);
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.channel-list::-webkit-scrollbar {
  width: 6px;
}

.channel-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.channel-row:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.channel-row.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.channel-row__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.channel-row__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.channel-row__name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 5px;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.channel-row__game {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Live dot inside channel name row (following sidebar) */
.channel-row__live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: live-pulse 2s ease-in-out infinite;
}

/* Viewer count badge next to category label */
.channel-row__viewers {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 1.5;
  flex-shrink: 0;
}

.discover {
  margin-top: 1.75rem;
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.discover-tile {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 92%, var(--bg-elevated));
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.discover-tile:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent);
}

body:not(.reduce-motion) .discover-tile:hover {
  transform: translateY(-2px);
}

.discover-tile.is-active {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 2px var(--accent-soft);
}

.discover-tile__thumb {
  width: 128px;
  min-height: 72px;
  flex-shrink: 0;
  position: relative;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 35%, #111), #0a0a0c);
}

.discover-tile__body {
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.discover-tile__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

.discover-tile__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section.clips-cta.section--muted {
  border-top: none;
  padding-top: 0;
  margin-top: 2rem;
}

.clips-cta {
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  box-shadow: var(--shadow-sm);
}

.clips-cta__copy {
  margin: 0;
  max-width: 720px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

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

  .sidebar--left {
    display: none;
  }

  .main {
    border-right: 0;
    order: 2;
  }

  .theater__chat {
    position: static;
    height: min(55vh, 520px);
    min-height: 0;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--border-strong);
    order: 3;
  }

  .channel-mobile {
    display: block;
  }
}

/* Skeleton loading */
@keyframes skeleton-shimmer {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.65; }
}

.skeleton {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

/* Category filter chips strip */
.language-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  min-height: 1.75rem;
}

.lang-chip { font-size: .78rem; }

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  min-height: 1.75rem;
}

/* Viewer count in player meta sub-line */
.channel-sub__viewers {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Viewer count overlay on discover tile thumbnail */
.discover-tile__viewers {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  pointer-events: none;
}

/* Auto-refresh hint in status bar */
.live-status__refresh {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .header-search__kbd {
    display: none;
  }

  .hero__stats {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ─── Stream stats bar ────────────────────────────────────────── */

.stream-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-elevated));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stream-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 0.4rem;
  gap: 0.22rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Last column in each row */
.stream-stat:nth-child(6n) { border-right: none; }

/* Second row — no bottom border */
.stream-stat:nth-child(n+7) { border-bottom: none; }

.stream-stat__value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stream-stat__value.is-loading {
  opacity: 0.4;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.stream-stat__label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .stream-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  /* Reset desktop column rules */
  .stream-stat:nth-child(6n) { border-right: 1px solid var(--border); }
  .stream-stat:nth-child(n+7) { border-bottom: 1px solid var(--border); }
  /* Mobile: 3 per row */
  .stream-stat:nth-child(3n) { border-right: none; }
  .stream-stat:nth-last-child(-n+3) { border-bottom: none; }
}

/* ─── Stats panel ─────────────────────────────────────────────── */

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  gap: 0.5rem;
}

.stats-row:last-of-type {
  border-bottom: none;
}

.stats-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.stats-value {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  text-align: right;
}

.stats-section-title {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 1rem 0 0.55rem;
}

.stats-channel {
  margin-bottom: 0.75rem;
}

.stats-channel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.82rem;
  margin-bottom: 0.3rem;
}

.stats-channel__name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
  min-width: 0;
}

.stats-channel__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.stats-bar {
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.stats-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 2px;
  transition: width 0.5s ease;
  min-width: 4px;
}

.stats-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.75rem 0;
}

/* ── live stats chart ────────────────────────────────────────── */
/* ── Mod Actions Panel ─────────────────────────────────────────── */
.mod-actions-panel {
  margin-top: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mod-actions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 50%, transparent);
  gap: 0.5rem;
}

.mod-actions-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mod-actions-tabs {
  display: flex;
  gap: 0.25rem;
}

.mod-tab {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.mod-tab:hover { background: var(--bg-hover); color: var(--text); }

.mod-tab--active {
  background: rgba(56, 200, 240, 0.1);
  border-color: rgba(56, 200, 240, 0.35);
  color: #38c8f0;
}

.mod-tab-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 99px;
  min-width: 1rem;
  text-align: center;
}

.mod-actions-list {
  max-height: 180px;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.mod-actions-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.5;
  text-align: center;
  padding: 0.75rem 0;
  margin: 0;
}

.mod-action-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  border-left: 2px solid transparent;
  transition: background 0.1s;
}

.mod-action-row:hover { background: color-mix(in srgb, var(--bg-hover) 50%, transparent); }

.mod-action-row--ban      { border-left-color: #ef4444; }
.mod-action-row--timeout  { border-left-color: #f97316; }
.mod-action-row--unban    { border-left-color: #38c8f0; }
.mod-action-row--delete   { border-left-color: #60a5fa; }
.mod-action-row--clear    { border-left-color: #a78bfa; }
.mod-action-row--pin      { border-left-color: #fbbf24; }
.mod-action-row--unpin    { border-left-color: #6b7280; }
.mod-action-row--category { border-left-color: #34d399; }
.mod-action-row--slow     { border-left-color: #818cf8; }
.mod-action-row--sub      { border-left-color: #f472b6; }
.mod-action-row--emote    { border-left-color: #fb923c; }

.mod-action-row__icon { font-size: 0.85rem; flex-shrink: 0; }
.mod-action-row__text { flex: 1; color: var(--text); }
.mod-action-row__time { font-size: 0.68rem; color: var(--text-muted); flex-shrink: 0; }

.mod-deleted-body { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.mod-deleted-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.mod-deleted-user { font-weight: 700; font-size: 0.75rem; color: #60a5fa; }
.mod-deleted-content {
  font-size: 0.78rem;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  padding: 0.2rem 0.4rem;
  word-break: break-word;
}
.mod-deleted-content--unknown { color: var(--text-muted); font-style: italic; }
.mod-deleted-content--ai { color: var(--text-muted); }
.mod-deleted-rule { color: #f87171; font-weight: 600; text-transform: capitalize; }
.mod-deleted-user--unknown { color: var(--text-muted); font-style: italic; }
.mod-deleted-reason { font-size: 0.68rem; color: var(--text-muted); font-style: italic; }

/* ── In-chat mod action notices ────────────────────────────────── */
.chat-mod-action {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  margin: 0.1rem 0;
  border-radius: 4px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border-left: 2px solid transparent;
}

.chat-mod-action--ban      { border-left-color: #ef4444; color: #fca5a5; background: rgba(239,68,68,0.07); }
.chat-mod-action--timeout  { border-left-color: #f97316; color: #fdba74; background: rgba(249,115,22,0.07); }
.chat-mod-action--unban    { border-left-color: #38c8f0; color: #38c8f0; background: rgba(56,200,240,0.06); }
.chat-mod-action--delete   { border-left-color: #60a5fa; color: #93c5fd; background: rgba(96,165,250,0.06); }
.chat-mod-action--clear    { border-left-color: #a78bfa; color: #c4b5fd; background: rgba(167,139,250,0.06); }
.chat-mod-action--pin      { border-left-color: #fbbf24; color: #fde68a; background: rgba(251,191,36,0.06); }
.chat-mod-action--unpin    { border-left-color: #6b7280; color: #9ca3af; background: rgba(107,114,128,0.06); }
.chat-mod-action--category { border-left-color: #34d399; color: #6ee7b7; background: rgba(52,211,153,0.06); }
.chat-mod-action--slow     { border-left-color: #818cf8; color: #a5b4fc; background: rgba(129,140,248,0.06); }
.chat-mod-action--sub      { border-left-color: #f472b6; color: #f9a8d4; background: rgba(244,114,182,0.06); }
.chat-mod-action--emote    { border-left-color: #fb923c; color: #fdba74; background: rgba(251,146,60,0.06); }

/* Deleted chat message — keep visible but struck through */
.chat-msg--deleted .chat-msg__text { text-decoration: line-through; text-decoration-color: rgba(96,165,250,0.7); opacity: 0.55; }
.chat-msg--deleted .chat-msg__user { opacity: 0.55; }
.chat-msg--deleted .chat-msg__badges { opacity: 0.45; }
.chat-msg--deleted::after { content: "deleted"; font-size: .65rem; color: #60a5fa; opacity: 0.7; margin-left: .35rem; vertical-align: middle; }

.chat-mod-action__icon { font-size: 0.8rem; flex-shrink: 0; }

/* ── Existing chart-wrap ─────────────────────────────────────────── */
.chart-wrap {
  margin-top: .75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem .75rem .45rem;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .35rem;
}

.chart-title {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .7rem;
  color: var(--text-muted);
}

.chart-legend__item {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.chart-pip {
  display: inline-block;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
}

.chart-pip--dash {
  background: repeating-linear-gradient(
    90deg,
    var(--pip-c, currentColor) 0,
    var(--pip-c, currentColor) 4px,
    transparent 4px,
    transparent 7px
  ) !important;
}

.chart-canvas-wrap {
  position: relative;
}

.stats-canvas {
  display: block;
  width: 100%;
  height: 160px;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .45rem .65rem;
  font-size: .72rem;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  min-width: 130px;
  z-index: 10;
}

.chart-tt__time {
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
  letter-spacing: .04em;
}

.chart-tt__row {
  display: flex;
  align-items: center;
  gap: .4rem;
  justify-content: space-between;
}

.chart-tt__row span:not(.chart-tt__pip) {
  color: var(--text-muted);
  flex: 1;
}

.chart-tt__row strong {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text);
}

.chart-tt__pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Responsive: Tablet / Narrow (≤ 900px already hides header-nav) ── */

@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  /* Tighter header */
  .site-header__inner {
    gap: 0.5rem;
    padding: 0 0.75rem;
  }

  /* Hide secondary header actions on mobile — keep theme toggle */
  #btn-refresh-live,
  #btn-focus,
  .header-actions .btn--primary {
    display: none;
  }

  /* Search: compact */
  .header-search input {
    padding: 0.5rem 2.5rem 0.5rem 2.5rem;
    font-size: 0.875rem;
  }

  /* Buttons: taller touch targets */
  .btn {
    min-height: 40px;
  }

  /* Main content: reduce padding */
  .main,
  .main--watch {
    padding: 0.9rem 0.75rem 2rem;
  }

  /* Hero section */
  .hero {
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  /* Category filter: horizontal scroll instead of wrap */
  .category-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .category-filter::-webkit-scrollbar { display: none; }

  /* Discover grid: 2 tiles per row */
  .discover-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.65rem;
  }

  /* Stream card grid */
  .stream-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem;
  }

  /* Player meta: more compact */
  .player-meta {
    padding: 0.85rem;
    gap: 0.75rem;
  }

  /* Chat: fixed height so it never grows beyond screen */
  .theater__chat {
    height: min(45vh, 400px) !important;
    min-height: 0 !important;
  }

  /* Real Views: toolbar stacks */
  .rc-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .rc-toolbar__disclaimer {
    margin-left: 0;
  }

  /* Real Views: pagination wraps */
  .rc-pagination {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
  }

  /* Real Views: hero meta wraps tighter */
  .rc-hero__meta {
    gap: 0.75rem;
  }

  /* Real Views: table enable touch scroll */
  .rc-table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  /* Chart legend: wrap */
  .chart-legend {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* ── Responsive: Phone (≤ 480px) ────────────────────────────── */

@media (max-width: 480px) {
  /* Hide logo wordmark — keep the icon */
  .logo__text {
    display: none;
  }

  /* Full-width home cards */
  .home-cards {
    flex-direction: column;
    align-items: stretch;
  }
  .home-card {
    width: auto;
  }

  /* Stack home stats vertically */
  .home-stats {
    flex-direction: column;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem;
  }

  /* Real Views meta: single column */
  .rc-hero__meta {
    flex-direction: column;
    gap: 0.2rem;
  }

  /* Stream grid: 1 column on very small phones */
  .stream-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Discover grid: 2 columns */
  .discover-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  /* Discover tile thumb: narrower */
  .discover-tile__thumb {
    width: 90px;
    min-height: 56px;
  }

  /* Player meta actions: full width wrap */
  .player-meta__actions {
    width: 100%;
  }
  .player-meta__actions .btn--primary {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  /* Toolbar: smaller inputs */
  .toolbar .select,
  .toolbar input[type="range"] {
    width: 100%;
  }

  /* Section head: stack on phones */
  .section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

/* ── Maintenance banner ─────────────────────────────────────── */
.maintenance-banner {
  width: 100%;
  background: #1a1200;
  border-bottom: 1px solid #f59e0b44;
  overflow: hidden;
  height: 32px;
  display: flex;
  align-items: center;
  contain: layout paint;
}

.maintenance-banner__track {
  display: flex;
  white-space: nowrap;
  animation: marquee 28s linear infinite;
  color: #f59e0b;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  will-change: transform;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-33.333%); }
}

/* ── Tap-to-unmute overlay (mobile only) ────────────────────── */
.player-unmute-btn { display: none; }

@media (max-width: 1100px) {
  .player-unmute-btn:not([hidden]) {
    display: flex;
    align-items: center;
    gap: .4rem;
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    padding: .5rem 1.1rem;
    background: rgba(0, 0, 0, .82);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(6px);
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0,0,0,.5);
    animation: fadeIn .25s ease;
  }
  @keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(4px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
}

/* ══════════════════════════════════════════════════════════════
   Real Views — phone-friendly table (≤ 640 px)
   Drop low-priority columns so 5 fit without horizontal scroll.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Hide: rank (#1), category (#3), uniq/min (#6), active-30m (#7) */
  .rc-table thead th:nth-child(1),
  .rc-table thead th:nth-child(3),
  .rc-table thead th:nth-child(6),
  .rc-table thead th:nth-child(7),
  .rc-table tbody td:nth-child(1),
  .rc-table tbody td:nth-child(3),
  .rc-table tbody td:nth-child(6),
  .rc-table tbody td:nth-child(7) { display: none; }

  /* Tighter cell padding */
  .rc-table td, .rc-table th { padding: .45rem .5rem; }

  /* Channel cell: drop stream-title subtitle, shrink avatar */
  .rc-ch      { min-width: 100px; gap: .35rem; }
  .rc-av      { width: 26px; height: 26px; font-size: .6rem; }
  .rc-ch__title { display: none; }
  .rc-ch__name  { font-size: .8rem; }

  /* Numeric columns & estimate value: slightly smaller */
  .td-num  { font-size: .8rem; }
  .est-val { font-size: .88rem; }

  /* Search bar spans full toolbar width */
  .rc-search { max-width: 100%; width: 100%; }

  /* Hero: tighter top padding */
  .rc-hero { padding: 1.1rem 0 .8rem; }
}

/* ── Extra narrow (≤ 480 px): drop Ratio too → 4 columns ── */
@media (max-width: 480px) {
  .rc-table thead th:nth-child(8),
  .rc-table tbody td:nth-child(8) { display: none; }
  .rc-table td, .rc-table th { padding: .4rem .45rem; }
}

/* ── Very narrow (≤ 380 px): status dot only, no text ─── */
@media (max-width: 380px) {
  .rc-status span:last-child { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   Watch page — phone layout improvements (≤ 560 px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  /* Player meta: push action buttons onto their own full-width row */
  .player-meta {
    padding: .8rem .9rem;
    gap: .65rem;
    margin-top: .85rem;
  }
  .player-meta__actions {
    flex: 0 0 100%;
    order: 3;
  }
  .player-meta__actions .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    min-height: 42px;
    font-size: .84rem;
  }

  /* Channel title: slightly smaller so it never truncates */
  .channel-title { font-size: 1.1rem; }

  /* Channel sub (slug line): save vertical space */
  .channel-sub__slug { display: none; }

  /* Channel mobile select: larger touch target */
  .channel-mobile {
    font-size: .9rem;
    padding: .55rem .75rem;
    min-height: 44px;
  }

  /* Let header search shrink to fill remaining header space */
  .header-search { flex: 1; min-width: 0; max-width: none; }
  .header-search input { padding-right: 1.25rem; }

  /* Chat: comfortable fixed height on phones */
  .theater__chat {
    height: min(50vh, 460px) !important;
    min-height: 0 !important;
  }

  /* Chart legend: 2-column grid so it doesn't wrap awkwardly */
  .chart-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .35rem .75rem;
    font-size: .68rem;
  }

  /* Mod actions panel: shorter max-height on phones */
  .mod-actions-list { max-height: 120px; }
}

/* ── Report button (all users) ──────────────────────────── */
.report-btn {
  border-color: rgba(239,68,68,.35) !important;
  color: #fca5a5 !important;
}
.report-btn:hover {
  background: rgba(239,68,68,.1) !important;
  border-color: rgba(239,68,68,.6) !important;
}

/* ── Report modal ────────────────────────────────────────── */
.report-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
}
.report-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
}
.report-modal[style*="flex"] { pointer-events: auto; }
.report-modal__inner {
  background: var(--bg-deep, #0d0d11);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.65);
}
.report-modal__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.1));
}
.report-modal__title { font-weight: 700; font-size: .95rem; }
.report-modal__x {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: .25rem .45rem;
  border-radius: 4px;
  line-height: 1;
}
.report-modal__x:hover { color: var(--text); background: var(--bg-elevated); }
.report-modal__body { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .65rem; }
.report-modal__ch { font-size: .82rem; color: var(--text-muted); margin: 0; }
.report-modal__label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.report-modal__opt { font-weight: 400; opacity: .7; }
.report-modal__select,
.report-modal__textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: .84rem;
  font-family: inherit;
  padding: .45rem .65rem;
  outline: none;
  transition: border-color .15s;
}
.report-modal__select:focus,
.report-modal__textarea:focus { border-color: var(--accent); }
.report-modal__textarea { resize: vertical; min-height: 72px; }
.report-modal__foot {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  padding-top: .25rem;
}
.report-detail-cell {
  font-size: .75rem;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Admin — track button (player-meta, admin-only) ─────── */
.admin-register-btn {
  border-color: rgba(251,191,36,.4) !important;
  color: #fbbf24 !important;
}
.admin-register-btn:hover {
  background: rgba(251,191,36,.12) !important;
  border-color: rgba(251,191,36,.65) !important;
}
.admin-register-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Admin panel — buttons ───────────────────────────────── */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.07);
  color: var(--text);
  font-size: .8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.admin-btn:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.28); }
.admin-btn--danger {
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.1);
  color: #fca5a5;
}
.admin-btn--danger:hover { background: rgba(239,68,68,.22); border-color: rgba(239,68,68,.7); }
.admin-btn--sm { padding: .22rem .5rem; font-size: .73rem; }

/* ── Admin panel — Rooms tab ─────────────────────────────── */
.admin-rooms-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .6rem;
  flex-wrap: wrap;
}
.admin-search {
  flex: 1;
  min-width: 130px;
  max-width: 240px;
  padding: .32rem .6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-size: .8rem;
  font-family: inherit;
  outline: none;
}
.admin-search:focus { border-color: var(--accent); }

/* ── Admin panel — Relay tab ─────────────────────────────── */
.admin-relay { display: flex; flex-direction: column; gap: .75rem; font-size: .82rem; }
.admin-relay__status {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .85rem;
}
.admin-relay__status.ok  { background: rgba(34,197,94,.12);  color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.admin-relay__status.err { background: rgba(239,68,68,.1);   color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.admin-relay__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.admin-relay__status.ok  .admin-relay__dot { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.admin-relay__status.err .admin-relay__dot { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.admin-relay__help {
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 8px;
  padding: .65rem .85rem;
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.6;
}

/* ── Clips Page ───────────────────────────────────────────── */
.clips-page { max-width: 1400px; margin: 0 auto; padding: 0 1.25rem 4rem; }

.clips-hero { padding: 2rem 0 1.5rem; }
.clips-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 1rem;
}

.clips-tabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.clips-tab {
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: .4rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.clips-tab:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.clips-tab.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
}

.clips-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
@media (max-width: 1300px) { .clips-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1000px) { .clips-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 650px)  { .clips-grid { grid-template-columns: repeat(2, 1fr); } }

.clip-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  display: block;
  text-decoration: none;
}
.clip-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,.55);
}

.clip-card__media {
  aspect-ratio: 9 / 16;
  position: relative;
  background: #000;
  overflow: hidden;
}

.clip-card__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .25s;
}

.clip-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s;
}
.clip-card:hover .clip-card__video { opacity: 1; }
.clip-card:hover .clip-card__thumb { opacity: 0; }

/* play icon shown before hover */
.clip-card__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  transition: opacity .2s;
  border: 1.5px solid rgba(255,255,255,.25);
}
.clip-card:hover .clip-card__play { opacity: 0; }
.clip-card__play svg { margin-left: 3px; }

/* top gradient + title */
.clip-card__top {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 10px 10px 28px;
  background: linear-gradient(to bottom, rgba(0,0,0,.75) 0%, transparent 100%);
  pointer-events: none;
}
.clip-card__title {
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

/* duration badge */
.clip-card__dur {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 5px;
  pointer-events: none;
}

/* bottom gradient + social overlay */
.clip-card__bot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 32px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}
.clip-card__social {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: .71rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
}
.clip-card__social-name { color: #53fc18; }
.clip-card__views {
  font-size: .65rem;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  font-family: var(--font-mono);
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
}

/* skeleton loading */
.clip-skeleton {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.clip-skeleton__media {
  aspect-ratio: 9 / 16;
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.clips-load-more-wrap { display: flex; justify-content: center; margin-top: 2rem; }
.clips-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
  font-size: .95rem;
}

/* ── User account dropdown ────────────────────────────────── */
.user-pill {
  display: none;
  align-items: center;
  gap: .45rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .25rem .6rem .25rem .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
}
.user-pill:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.user-pill.is-open { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.user-pill__chevron {
  opacity: .55;
  flex-shrink: 0;
  transition: transform .2s;
}
.user-pill.is-open .user-pill__chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 188px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 300;
  padding: 4px 0;
  animation: dd-in .12s ease;
}
.user-dropdown[hidden] { display: none; }

@keyframes dd-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown__item {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .55rem 1rem;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background .1s;
  box-sizing: border-box;
}
.user-dropdown__item:hover { background: var(--bg-hover); }
.user-dropdown__item--danger { color: var(--danger, #ff5c7a); }
.user-dropdown__item--danger:hover { background: rgba(255,92,122,.08); }

.user-dropdown__divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ── Chat compose bar ─────────────────────────────────────── */
.chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
}
.chat-compose[hidden] { display: none; }

.chat-compose__input {
  flex: 1;
  min-height: 34px;
  max-height: 96px;
  resize: none;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: .84rem;
  line-height: 1.45;
  padding: 7px 10px;
  outline: none;
  overflow-y: auto;
  scrollbar-width: thin;
  transition: border-color .15s;
}
.chat-compose__input:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.chat-compose__input::placeholder { color: var(--text-muted); }

.chat-compose__emote-btn,
.chat-compose__send {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chat-compose__emote-btn:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-strong); }
.chat-compose__emote-btn.is-open { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.chat-compose__send { background: var(--accent); border-color: transparent; color: #081008; }
.chat-compose__send:hover { filter: brightness(1.1); }
.chat-compose__send:disabled { opacity: .45; cursor: default; filter: none; }

.chat-char-count {
  font-size: .7rem;
  color: var(--text-muted);
  text-align: right;
  padding: 0 10px 4px;
}
.chat-char-count.is-warn { color: var(--accent-2); }
.chat-char-count.is-danger { color: var(--danger); }

/* ── Emote picker ─────────────────────────────────────────── */
.emote-picker {
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px 10px 0 0;
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 220px;
}
.emote-picker[hidden] { display: none; }

.emote-picker__search-wrap { padding: 8px; border-bottom: 1px solid var(--border); }
.emote-picker__search {
  width: 100%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: .8rem;
  padding: 5px 8px;
  outline: none;
  box-sizing: border-box;
}
.emote-picker__search:focus { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

.emote-picker__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.emote-btn {
  width: 38px; height: 38px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  transition: background .1s;
  flex-shrink: 0;
}
.emote-btn:hover { background: var(--bg-hover); }
.emote-btn img { width: 28px; height: 28px; object-fit: contain; }

.emote-picker__empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
}

/* ── Chat reply & mentions ────────────────────────────────── */
.chat-msg { position: relative; }

.chat-msg--mention {
  background: rgba(255,209,0,.07) !important;
  border-left: 2px solid rgba(255,209,0,.5);
  padding-left: .5rem !important;
  margin: .15rem 0;
}
.chat-msg--mention:hover { background: rgba(255,209,0,.12) !important; }

.chat-msg__reply-btn {
  display: none;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 0;
  flex-shrink: 0;
  transition: background .1s, color .1s;
  line-height: 1;
}
.chat--logged-in .chat-msg:hover .chat-msg__reply-btn { display: flex; }
.chat-msg__reply-btn:hover { color: var(--text); background: var(--bg-hover); border-color: var(--border-strong); }

/* inline @mention styling inside message text */
.chat-mention { color: var(--accent-2, #ffd100); font-weight: 600; }
.chat-mention--self {
  background: rgba(255,209,0,.15);
  border-radius: 3px;
  padding: 0 2px;
}

/* reply bar shown above compose textarea */
.chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: 5px 10px;
  background: rgba(255,209,0,.05);
  border-bottom: 1px solid rgba(255,209,0,.18);
  font-size: .75rem;
  color: var(--text-muted);
  border-radius: 0;
}
.chat-reply-bar[hidden] { display: none; }
.chat-reply-bar strong { color: var(--accent-2, #ffd100); }
.chat-reply-cancel {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .85rem; padding: 0; line-height: 1;
}
.chat-reply-cancel:hover { color: var(--text); }

.chat-msg__reply-quote {
  display: block;
  font-size: .7rem;
  color: var(--text-muted);
  border-left: 2px solid rgba(255,209,0,.4);
  padding-left: .4rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-msg__reply-quote em { font-style: normal; opacity: .8; }

/* ── Emote picker tabs ────────────────────────────────────── */
.emote-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.emote-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  font-size: .72rem;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.emote-tab:hover { color: var(--text); }
.emote-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
