:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --border: #e6e1d8;
  --border-strong: #d6d0c4;
  --text: #211e1a;
  --muted: #7a7368;
  --accent: #b23a48;
  --accent-soft: #f7e7e9;
  --live: #d64550;
  --radius: 4px;
  --card-gap: 2px;
  --shadow: 0 1px 2px rgba(30, 20, 10, 0.05), 0 6px 18px rgba(30, 20, 10, 0.07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1600px; margin: 0 auto; padding: 0 10px; }

a { color: var(--accent); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  z-index: 200;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; }
.brand-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.2px; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: var(--text); border-bottom-color: var(--accent); }
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px 4px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 1px; }

/* ---------- Intro ---------- */
.intro { padding: 30px 0 6px; }
.intro h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin: 0 0 8px; letter-spacing: -0.4px; }
.lede { color: var(--muted); font-size: 1rem; max-width: 1400px; margin: 0; }

/* ---------- Stats ---------- */
.stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 8px 0 4px; color: var(--muted); font-size: 0.85rem; }
.stats .stat { white-space: nowrap; }
.stats .stat b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-sep { opacity: 0.6; }

/* ---------- Search / filter toolbar ---------- */
.toolbar { padding: 4px 0 14px; }
.toolbar-bar { display: flex; align-items: center; gap: 10px; }
.filter-toggle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.filter-toggle svg { width: 19px; height: 19px; fill: currentColor; }
.filter-toggle:hover { border-color: var(--accent); color: var(--accent); }
.search-input {
  flex: 1 1 auto;
  max-width: 420px;
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
.filter-panel { padding-top: 12px; }
.filter-panel[hidden] { display: none; }
.filter-option { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; color: var(--text); cursor: pointer; margin: 0 0 10px; }
.filter-option input { width: 16px; height: 16px; accent-color: var(--accent); }
.tag-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.tag-chip:hover { border-color: var(--accent); }
.tag-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-count { font-size: 0.72rem; opacity: 0.6; }

/* ---------- Grid status ---------- */
.grid-status { padding: 36px 0; text-align: center; color: var(--muted); }
.grid-error { color: var(--accent); }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--card-gap);
  padding: 0 0 40px;
}

.card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.28s ease, transform 0.28s ease;
  opacity: 0;
  transform: translateY(6px);
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: auto 210px;
}
.card.is-visible { opacity: 1; transform: translateY(0); }
.card.is-removing { opacity: 0 !important; transform: translateY(6px) !important; pointer-events: none; }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }

.card.promoted { animation: promote 1s ease; }
@keyframes promote {
  0% { box-shadow: 0 0 0 0 rgba(178, 58, 72, 0.35); }
  55% { box-shadow: 0 0 0 3px rgba(178, 58, 72, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(178, 58, 72, 0); }
}

.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb img.img-error { filter: grayscale(1) brightness(0.92); }

.live {
  position: absolute;
  top: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--live);
  color: #fff;
  text-transform: uppercase;
  opacity: 0.85;
}
.live::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #fff; }

.new-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #1f7a4d;
  color: #fff;
  text-transform: uppercase;
  opacity: 0.85;
}

.src-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px !important;
  height: 16px !important;
  object-fit: contain;
  opacity: 0.85;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.meta { padding: 8px 10px 10px; }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.username { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.country { color: var(--muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; }
.subrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
.subject { color: var(--muted); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.viewers { color: var(--muted); font-size: 0.72rem; display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.viewers svg { width: 12px; height: 12px; fill: currentColor; opacity: 0.7; }

.sentinel { height: 1px; grid-column: 1 / -1; }

/* ---------- Load more ---------- */
.load-more-wrap { display: flex; justify-content: center; padding: 8px 0 44px; }
.load-more-wrap[hidden] { display: none; }
.load-more {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.load-more:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }

/* ---------- Info section ---------- */
.info { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0 56px; }
.info h2 { font-size: 1.3rem; margin: 30px 0 10px; }
.info h2:first-child { margin-top: 0; }
.info h3 { font-size: 1rem; margin: 20px 0 5px; color: var(--accent); }
.info p { color: var(--muted); max-width: 860px; margin: 0 0 8px; }
.info-links { margin-top: 24px; font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0 40px; color: var(--muted); font-size: 0.85rem; background: var(--bg); }
.site-footer p { margin: 5px 0; }
.disclaimer { font-size: 0.78rem; opacity: 0.75; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--text); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 60;
}
.back-to-top.is-shown { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Static pages (FAQ / Privacy) ---------- */
.page { max-width: 860px; padding: 34px 20px 60px; }
.page h1 { font-size: 2rem; letter-spacing: -0.4px; margin: 0 0 18px; }
.page h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.page p { color: var(--muted); margin: 0 0 12px; }
.page code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 0.85em; }
.updated { font-size: 0.82rem; color: var(--muted); margin-top: -10px; }

/* ---------- Age overlay ---------- */
.age-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 22, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.age-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.age-logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 14px; }
.age-box h2 { margin: 0 0 8px; font-size: 1.45rem; }
.age-box p { color: var(--muted); margin: 0 0 18px; }
.age-actions { display: flex; flex-direction: column; gap: 10px; }
.btn { border: 0; cursor: pointer; font-size: 0.98rem; font-weight: 600; padding: 12px 18px; border-radius: 9px; transition: transform 0.12s ease, opacity 0.12s ease; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border-strong); }
.age-note { font-size: 0.75rem; margin-top: 16px; opacity: 0.6; }

/* ---------- Player overlay ---------- */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.player-overlay[hidden] { display: none; }
.player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 17, 14, 0.85);
  backdrop-filter: blur(4px);
}
.player-dialog {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.player-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 8px;
  z-index: 2;
}
.player-close:hover { color: var(--text); }
.player-title {
  font-size: 1.05rem;
  margin: 0 44px 12px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-stage {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.player-stage iframe {
  width: 100%;
  max-width: 850px;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
  display: block;
}
#sc-player-container { width: 100%; max-width: 850px; aspect-ratio: 16 / 9; }
#sc-player-container iframe { width: 100%; height: 100%; }
.player-cta {
  display: block;
  margin: 14px auto 0;
  text-align: center;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 9px;
  max-width: 340px;
}
.player-cta:hover { opacity: 0.92; }
.player-error { color: var(--muted); padding: 30px 0; }
body.no-scroll { overflow: hidden; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    padding: 8px 16px 14px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav .nav-link { padding: 11px 0; border-bottom: 1px solid var(--border); }
  .site-nav .nav-link:last-child { border-bottom: 0; }
  .site-nav .nav-link.is-active { border-bottom: 1px solid var(--border); color: var(--accent); }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px; }
  .container { padding: 0 4px; }
  .player-overlay { padding: 6px; }
  .player-dialog { padding: 10px; }
  .player-title { font-size: 0.95rem; }
}
