/* Top Live Stream — light catalog UI (A2 Calm + Monogram T + red wash) */

/* Self-hosted Nunito Sans (variable weights 600–800) */
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/nunito-sans-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/nunito-sans-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/nunito-sans-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/nunito-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/nunito-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --paper: #f4f6f8;
  --paper-2: #e8edf2;
  --line: #d0d7de;
  --accent: #e11d2e;
  --accent-ink: #b91c1c;
  --live: #e11d2e;
  --ui: #1e293b;
  --ui-soft: #334155;
  --danger: #a12828;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --font-display: "Nunito Sans", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;
  --radius: 10px;
  --shell: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--paper);
  line-height: 1.45;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 480px at 8% -12%, rgba(225, 29, 46, 0.12), transparent 55%),
    radial-gradient(800px 400px at 92% 0%, rgba(15, 23, 42, 0.06), transparent 50%),
    linear-gradient(180deg, #f8f9fb 0%, var(--paper) 42%, #eef1f4 100%);
}

.shell {
  width: min(var(--shell), calc(100% - 2rem));
  margin-inline: auto;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(244, 246, 248, 0.88);
  border-bottom: 1px solid rgba(208, 215, 222, 0.9);
}

.site-header .shell {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}

.brand-mark {
  flex: 0 0 auto;
  display: block;
}

.brand-text .live-word {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 0.75rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  padding: 0.2rem 0.1rem;
}

.site-nav a.is-active,
.site-nav a:hover {
  color: var(--ui);
}

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.site-nav-secondary {
  color: var(--muted) !important;
  font-weight: 600 !important;
  font-size: 0.92rem;
  opacity: 0.85;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav-secondary:hover,
.site-nav-secondary.is-active {
  color: var(--ink-soft) !important;
  opacity: 1;
}

.search {
  margin-left: 0;
  display: flex;
  gap: 0.4rem;
}

.search input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  min-width: min(240px, 42vw);
  font: inherit;
  color: var(--ink);
}

.search button {
  border: 1px solid var(--ui);
  border-radius: 8px;
  background: var(--ui);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.search button:hover {
  background: var(--ui-soft);
  border-color: var(--ui-soft);
}

.main {
  padding: 1.5rem 0 3rem;
}

.list-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
  margin: 0 0 0.4rem;
  line-height: 1.1;
}

.lede,
.landing-note {
  margin: 0;
  color: var(--ink-soft);
  max-width: 46rem;
}

.landing-note {
  padding: 0.75rem 0.9rem;
  background: rgba(225, 29, 46, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.redesign-notice {
  margin: 0.85rem 0 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-soft);
  font-size: 0.92rem;
  box-sizing: border-box;
}

.redesign-notice-icon {
  flex: 0 0 auto;
  color: var(--accent-ink);
}

.redesign-notice a {
  color: var(--accent-ink);
  font-weight: 800;
}

.list-intro--search {
  margin-bottom: 1.5rem;
}

.ad-slot {
  margin: 0 0 1.25rem;
}

.ad-slot--infeed {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0.35rem 0 0.5rem;
}

.ad-slot-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.ad-slot-frame {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.ad-slot .adsbygoogle {
  display: block;
  width: 100%;
  min-height: 90px;
}

/* Desktop: hard-cap unit chrome so AdSense iframes cannot grow the layout */
@media (min-width: 721px) {
  .ad-slot {
    max-height: 160px !important;
    overflow: hidden !important;
  }

  .ad-slot-frame {
    height: 160px;
    max-height: 160px !important;
    overflow: hidden !important;
  }

  .ad-slot .adsbygoogle,
  .ad-slot .adsbygoogle iframe {
    max-height: 160px !important;
  }
}

.filters {
  margin: 1.25rem 0 1.5rem;
}

.filters--compact .filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.filter-sep {
  width: 1px;
  height: 1.15rem;
  background: var(--line);
  margin: 0 0.2rem;
  flex: 0 0 auto;
}

.filter-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-right: 0.1rem;
}

.chip {
  text-decoration: none;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.chip:hover,
.chip.is-active {
  color: #fff;
  background: var(--ui);
  border-color: var(--ui);
}

.filter-lang {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ui-soft);
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.filter-lang:hover,
.filter-lang[aria-expanded="true"],
.filter-lang.is-active {
  border-color: var(--ui);
  background: rgba(30, 41, 59, 0.06);
  color: var(--ui);
}

.filter-lang-icon,
.filter-lang-flag {
  display: block;
}

.filter-lang-flag {
  width: 1.1rem;
  height: auto;
  border-radius: 2px;
}

.filter-extra {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 200ms ease;
  margin-top: 0;
}

.filter-extra.is-open {
  grid-template-rows: 1fr;
  margin-top: 0.55rem;
}

.filter-extra-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.filter-extra-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.filter-extra:not(.is-open) .filter-extra-panel {
  border-color: transparent;
  padding-top: 0;
  padding-bottom: 0;
}

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

.stream-item {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease;
}

.stream-item:hover {
  transform: translateY(-2px);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.stream-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stream-thumb--empty {
  background:
    linear-gradient(135deg, #cbd5e1, #94a3b8);
}

.viewer-count {
  position: absolute;
  left: 0.45rem;
  bottom: 0.45rem;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.live-badge {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  background: var(--live);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.14rem 0.4rem;
  border-radius: 3px;
}

.lang-flag {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.25rem;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.chip--lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chip-flag {
  width: 1rem;
  height: auto;
  border-radius: 2px;
  flex-shrink: 0;
}

.stream-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stream-meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.dot {
  opacity: 0.6;
}

.empty-state,
.loading,
.error-banner {
  grid-column: 1 / -1;
  padding: 1.25rem;
  color: var(--ink-soft);
}

.error-banner {
  color: var(--danger);
  background: rgba(161, 40, 40, 0.08);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.site-footer a {
  color: var(--ink-soft);
  font-weight: 700;
}

.about-page .about-body {
  max-width: 40rem;
  color: var(--ink-soft);
}

.about-page .about-body h2 {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin: 1.75rem 0 0.5rem;
}

.about-page .about-body p,
.about-page .about-body ul {
  margin: 0 0 0.85rem;
}

.about-page .about-body ul {
  padding-left: 1.2rem;
}

.about-page .about-body a {
  color: var(--accent-ink);
  font-weight: 700;
}

.update-indicator {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--ink);
  color: #fff;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.update-indicator.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.nav-burger {
  display: none;
  margin-left: auto;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-burger-lines,
.nav-burger-lines::before,
.nav-burger-lines::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  position: relative;
}

.nav-burger-lines::before,
.nav-burger-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-burger-lines::before {
  top: -5px;
}

.nav-burger-lines::after {
  top: 5px;
}

.btn-primary {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: var(--ui);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--ui-soft);
}

.not-found-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.not-found-actions {
  margin: 1.25rem 0 0;
}

.not-found .lede a {
  color: var(--accent-ink);
  font-weight: 700;
}

@media (max-width: 720px) {
  .site-header {
    position: static;
    backdrop-filter: none;
  }

  .site-header .shell {
    gap: 0.45rem 0.65rem;
    padding: 0.45rem 0;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 1.05rem;
    gap: 0.4rem;
    min-width: 0;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .site-nav {
    gap: 0.35rem;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
  }

  .site-nav a {
    font-size: 0.82rem;
    padding: 0.15rem 0.2rem;
  }

  .nav-burger {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .header-tools {
    display: none;
    width: 100%;
    margin-left: 0;
    flex-basis: 100%;
    order: 5;
    padding: 0.55rem 0 0.15rem;
    border-top: 1px solid var(--line);
    gap: 0.65rem;
  }

  .header-tools.is-open {
    display: flex;
  }

  .search {
    width: 100%;
    margin-left: 0;
  }

  .search input {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 0.6rem;
  }

  .search button {
    padding: 0.4rem 0.7rem;
  }

  .main {
    padding: 0.65rem 0 2.25rem;
  }

  .list-intro h1 {
    font-size: 1.35rem;
    margin-bottom: 0.2rem;
  }

  .list-intro .lede,
  .list-intro .landing-note {
    display: none;
  }

  .redesign-notice {
    display: none;
  }

  .filters {
    margin: 0.4rem 0 0.65rem;
  }

  .filter-label {
    width: 100%;
  }

  .ad-slot--leaderboard {
    margin: 0.5rem 0;
  }
}
