:root {
  --bg: #0c080a;
  --bg-deep: #060405;
  --surface: rgba(22, 14, 18, 0.9);
  --surface2: rgba(34, 20, 28, 0.92);
  --glass: rgba(14, 10, 12, 0.82);
  --border: rgba(212, 165, 116, 0.14);
  --text: #f7efe9;
  --muted: #a89490;
  --accent: #d4a574;
  --accent-hover: #e8c49a;
  --accent-rose: #c97888;
  --danger: #e07070;
  --radius: 10px;
  --shadow-card: 0 10px 36px rgba(0, 0, 0, 0.5);
  --focus: 0 0 0 3px rgba(212, 165, 116, 0.42);
  --bg-header: image-set(
    url("/images/design/bg-header.avif") type("image/avif"),
    url("/images/design/bg-header.webp") type("image/webp"),
    url("/images/design/bg-header.png") type("image/png")
  );
  --bg-sidebar: url("/images/design/bg-sidebar.png");
  --bg-grid: image-set(
    url("/images/design/bg-grid.avif") type("image/avif"),
    url("/images/design/bg-grid.webp") type("image/webp"),
    url("/images/design/bg-grid.png") type("image/png")
  );
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(80, 36, 48, 0.35), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(42, 22, 32, 0.4), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a:not(.logo) { color: var(--accent); text-decoration: none; }
a:not(.logo):hover { color: var(--accent-hover); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

/* Header — blurred silhouette backdrop under navigation */
.site-header,
.watch-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  isolation: isolate;
}

.site-header::before,
.watch-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--bg-header) center / cover no-repeat;
  filter: blur(6px) saturate(1.1);
  transform: scale(1.06);
  pointer-events: none;
}

.site-header::after,
.watch-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(12, 6, 9, 0.72) 0%,
    rgba(12, 6, 9, 0.9) 100%
  );
  pointer-events: none;
}

.site-header > *,
.watch-header > * {
  position: relative;
  z-index: 1;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
}

a.logo,
a.logo:hover,
a.logo .logo-cams,
a.logo:hover .logo-cams {
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  background: transparent;
}

a.logo .logo-tau {
  color: var(--accent);
}

a.logo:hover .logo-tau {
  color: var(--accent-hover);
}

a.logo .logo-cams:hover {
  color: var(--accent-hover);
}

.logo--watch {
  margin-right: 0.25rem;
}

.search-form { flex: 1; max-width: 420px; display: flex; gap: 0.5rem; }
.search-form input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  min-height: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface); border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.header-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.country-filter,
.cat-filter,
.lang-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.country-filter__label,
.cat-filter__label,
.lang-filter__label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.country-filter__select,
.cat-filter__select,
.lang-filter__select {
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 1.85rem 0.55rem 0.65rem;
  min-height: 44px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a89490' d='M3 4.5 6 8 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  transition: border-color 0.15s, background 0.15s;
}

.country-filter__select {
  min-width: 7.5rem;
  max-width: 10rem;
}

.cat-filter__select {
  min-width: 8.5rem;
  max-width: 11rem;
}

.lang-filter__select {
  min-width: 9.5rem;
  max-width: 12rem;
}

.country-filter__select:hover,
.cat-filter__select:hover,
.lang-filter__select:hover {
  border-color: var(--accent);
  background-color: var(--surface);
}

.country-filter__select:focus-visible,
.cat-filter__select:focus-visible,
.lang-filter__select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* legacy alias */
.lang-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.lang-en { margin-left: auto; font-size: 0.85rem; }

@media (max-width: 720px) {
  .site-header {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    padding: 0.65rem 0.75rem;
  }

  .header-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-filters {
    order: 2;
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    align-items: stretch;
  }

  .country-filter,
  .cat-filter,
  .lang-filter {
    min-width: 0;
    width: 100%;
  }

  .country-filter__label,
  .cat-filter__label,
  .lang-filter__label { display: none; }

  .country-filter__select,
  .cat-filter__select,
  .lang-filter__select {
    width: 100%;
    min-width: 0;
    max-width: none;
    font-size: 16px;
    padding: 0.55rem 1.5rem 0.55rem 0.5rem;
    color: var(--text);
    background-color: var(--surface2);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-form {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .search-form input {
    font-size: 16px;
    min-width: 0;
  }

  .search-form .btn {
    flex-shrink: 0;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .logo-icon {
    width: 2.75rem;
    height: 2.75rem;
  }

  .logo {
    font-size: 1.05rem;
  }
}

@media (max-width: 400px) {
  .header-filters {
    grid-template-columns: 1fr;
  }
}

/* Layout */
.layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 1600px;
  margin: 0 auto;
}

.tag-cloud { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; }

.tag-cloud a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  border: 1px solid transparent;
}
.tag-cloud a:hover, .tag-cloud a.active {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--border);
}

.main {
  padding: 1rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

.main::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  background: var(--bg-grid) center / cover no-repeat;
  filter: blur(10px) brightness(0.45) saturate(1.05);
  opacity: 0.5;
  pointer-events: none;
}

.main::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(12, 6, 9, 0.35) 0%,
    rgba(12, 6, 9, 0.75) 100%
  );
  pointer-events: none;
}

.main > * {
  position: relative;
  z-index: 1;
}

.tags-bar--below {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  min-height: 5rem;
}

.tag-cloud--scroll {
  min-height: 2.25rem;
}

.tags-bar h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.tags-scroll {
  max-height: 21rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

/* Thin scrollbars — visible only on hover (tags) */
.tags-scroll {
  scrollbar-width: none;
  scrollbar-color: transparent transparent;
}

.tags-scroll:hover {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 165, 116, 0.45) transparent;
}

.tags-scroll::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

.tags-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.tags-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

.tags-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(212, 165, 116, 0.45);
}

.tags-scroll:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 196, 154, 0.65);
}

.tag-cloud--scroll a {
  font-size: 0.78rem;
  padding: 0.28rem 0.5rem;
  white-space: nowrap;
}

/* Grid: mobile 2, tablet 4, desktop 7 */
.grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, 1fr);
  min-height: 72vh;
  align-content: start;
}

.grid.grid--empty {
  min-height: 12rem;
}

.grid:not(.grid--loading):not(.grid--empty) {
  min-height: 0;
}

@media (min-width: 480px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(7, 1fr); }
}

.card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 165, 116, 0.45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(201, 120, 136, 0.12);
}

.card--clickable { cursor: pointer; }
.card--clickable .card-name { cursor: pointer; }

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 11;
  width: 100%;
  background: var(--surface2);
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
}
.card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  text-transform: uppercase;
}

.card-body {
  padding: 0.45rem 0.5rem 0.7rem;
}
.card-title {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.card-name {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  padding: 0;
}

.card-age {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 500;
  color: #c4b0a8;
  white-space: nowrap;
}
.card-stats {
  font-size: 0.7rem;
  color: #c4b0a8;
  line-height: 1.35;
  margin-top: 0.2rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card-langs {
  font-size: 0.65rem;
  color: #9a8884;
  line-height: 1.3;
  margin-top: 0.15rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card-tags-more {
  display: block;
  width: 100%;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.2;
  margin-top: 0.2rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.25rem;
  margin-top: 0.25rem;
  line-height: 1.2;
}

.tag-chip {
  max-width: 100%;
  font-size: 0.65rem;
  line-height: 1.2;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(212, 165, 116, 0.1);
  color: #e8ddd6;
  border: 1px solid rgba(212, 165, 116, 0.22);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tag-more {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.15rem 0.1rem;
}

.card-meta { font-size: 0.7rem; color: var(--muted); }

/* Skeleton */
.card--skeleton {
  pointer-events: none;
  box-shadow: none;
}

.card-thumb--skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.card-body--skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 2.85rem;
  padding: 0.45rem 0.5rem 0.7rem;
}

.skeleton-line {
  display: block;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton-line--title {
  width: 72%;
  height: 0.75rem;
}

.skeleton-line--stats {
  width: 48%;
  height: 0.6rem;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius);
  aspect-ratio: 16/11;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.state-msg {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.state-msg.error { color: var(--danger); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
  flex-wrap: wrap;
}
.page-info { font-size: 0.9rem; color: var(--muted); }

.partner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  min-height: 4.25rem;
  align-content: flex-start;
}
.header-stats {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.35rem 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 9.5rem;
  min-height: 1.35rem;
}

.header-stats__ph {
  display: inline-block;
  width: 9rem;
  height: 1em;
  visibility: hidden;
}

.stat-online {
  font-weight: 700;
  font-size: 1.05rem;
  color: #5fd97a;
}

.stat-total {
  font-weight: 600;
  color: var(--muted);
}

.stat-label {
  color: #5fd97a;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-label-muted {
  color: var(--muted);
  font-size: 0.72rem;
}

.stat-sep {
  color: var(--muted);
  margin: 0 0.15rem;
}

.partner-links a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  background: var(--surface);
}

.partner-name {
  text-transform: capitalize;
}

.partner-stat {
  font-size: 0.75rem;
  font-weight: 600;
}

.partner-stat .stat-online {
  font-size: 0.85rem;
}

.partner-stat .stat-total {
  font-size: 0.8rem;
}

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

/* Watch page */
.watch-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  max-width: 100vw;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(72, 32, 44, 0.3), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.watch-header {
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  border-radius: var(--radius);
}

.player-wrap {
  width: 100%;
  max-width: min(100%, 1280px);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  isolation: isolate;
}

.player-wrap::before {
  content: "";
  position: absolute;
  inset: -0.5rem -1rem;
  z-index: 0;
  background: var(--bg-grid) center / cover no-repeat;
  filter: blur(12px) brightness(0.4);
  opacity: 0.45;
  border-radius: calc(var(--radius) + 4px);
  pointer-events: none;
}

.player-wrap > * {
  position: relative;
  z-index: 1;
}

.player-stage {
  position: relative;
  width: 100%;
}

.player-box {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 120px);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.player-box .player-preview {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.player-box .player-preview[hidden] {
  display: none !important;
}

.player-preview--loading .player-preview-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

/* Jasmin: model photo stays on top; embed (if any) loads underneath */
.player-box--jasmin .player-preview {
  z-index: 5;
  pointer-events: none;
}

.player-box--jasmin .player-iframe {
  z-index: 2;
}

.player-box--jasmin .player-preview-img {
  object-fit: cover;
}

.state-msg--player {
  margin-top: 0.65rem;
  padding: 0.75rem 1rem;
}

.player-box video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  display: block;
  background: #000;
}

.player-box iframe {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 120px);
  border: 0;
  background: #000;
  display: block;
}

.player-preview {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 360px;
  max-height: calc(100vh - 120px);
  background: #000;
}

.player-preview-img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 120px);
  object-fit: cover;
  display: block;
}

.player-preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.55) 45%,
    rgba(0, 0, 0, 0.75) 100%
  );
  text-align: center;
}

.player-preview-hint {
  margin: 0;
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
  line-height: 1.45;
}

.player-preview-btn {
  font-size: 1rem;
  padding: 0.75rem 1.35rem;
}

.player-stage .view-chat-btn {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  pointer-events: auto;
  font-family: inherit;
  appearance: none;
  padding: 0.9rem 1.6rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #c97888 0%, #d4a574 55%, #a86b4a 100%);
  border: 2px solid rgba(255, 228, 210, 0.4);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(201, 120, 136, 0.55), 0 0 36px rgba(212, 165, 116, 0.25);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.player-stage .view-chat-btn[hidden] {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.player-stage .view-chat-btn:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.view-chat-btn:hover,
.view-chat-btn:focus-visible {
  color: #fff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 30px rgba(201, 120, 136, 0.7), 0 0 48px rgba(212, 165, 116, 0.35);
  filter: brightness(1.08);
}

/* Partner overlays — bottom-left: volume (higher), play (lower, over native controls) */
.player-stage .view-chat-btn--sound {
  left: 1rem;
  right: auto;
  bottom: 4.35rem;
  z-index: 31;
  padding: 0.7rem;
  min-width: 3.1rem;
  min-height: 3.1rem;
  border-radius: 12px;
}

.player-stage .view-chat-btn--play {
  left: 1rem;
  right: auto;
  bottom: 0.55rem;
  z-index: 32;
  padding: 0.7rem;
  min-width: 3.1rem;
  min-height: 3.1rem;
  border-radius: 12px;
}

.player-stage .view-chat-btn--sound .view-chat-btn__icon,
.player-stage .view-chat-btn--play .view-chat-btn__icon {
  display: block;
  flex-shrink: 0;
}

.player-stage .view-chat-btn--play .view-chat-btn__icon {
  margin-left: 2px;
}

@media (max-width: 720px) {
  .watch-page {
    padding: 0.5rem;
  }

  .watch-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .watch-header .logo--watch {
    flex: 1 1 auto;
    min-width: 0;
  }

  .watch-header > div {
    flex: 1 1 100%;
    order: 4;
    min-width: 0;
  }

  #back-btn {
    order: 3;
    flex-shrink: 0;
  }

  .watch-title {
    font-size: 1rem;
    word-break: break-word;
  }

  .player-box {
    aspect-ratio: 16 / 9;
    max-height: min(56vh, 420px);
  }

  .player-box video,
  .player-box iframe,
  .player-preview,
  .player-preview-img {
    max-height: min(56vh, 420px);
  }

  .player-preview {
    min-height: 0;
  }

  .watch-details {
    margin-left: 0;
    margin-right: 0;
    padding: 0.65rem 0.75rem;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .player-stage .view-chat-btn,
  .view-chat-btn {
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
    max-width: calc(100% - 1rem);
    text-align: center;
  }

  .player-stage .view-chat-btn--sound {
    left: 0.5rem;
    bottom: 3.85rem;
    padding: 0.6rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .player-stage .view-chat-btn--play {
    left: 0.5rem;
    bottom: 0.45rem;
    padding: 0.6rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}

.watch-title { font-size: 1.1rem; font-weight: 600; }
.watch-meta { font-size: 0.85rem; color: var(--muted); }

.watch-tags-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.watch-details {
  max-width: min(100%, 1280px);
  margin: 0.75rem auto 1.5rem;
  padding: 0.75rem 0.85rem;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (min-width: 520px) {
  .detail-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .detail-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.4rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 0;
}

.detail-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.2;
}

.detail-value {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
  word-break: break-word;
}

.browse-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(72, 32, 44, 0.3), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.browse-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
  isolation: isolate;
}

.browse-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg-grid) center / cover no-repeat;
  filter: blur(10px) brightness(0.45);
  opacity: 0.45;
  pointer-events: none;
}

.browse-main::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(12, 6, 9, 0.4), rgba(12, 6, 9, 0.8));
  pointer-events: none;
}

.browse-main > * {
  position: relative;
  z-index: 1;
}

.browse-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.detail-tags-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0.65rem 0 0.4rem;
}

.tag-cloud--watch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: none;
}

.tag-cloud--watch .tag-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
}

.watch-description {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(22, 14, 18, 0.5);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* SEO overview (homepage) */
.seo-overview {
  margin-top: 2rem;
  padding: 1.25rem 1rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 72rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

.seo-overview h2 {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.seo-overview h2:first-child { margin-top: 0; }

.seo-overview h3 {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
}

.seo-overview p { margin-bottom: 0.75rem; }

.seo-overview strong { color: var(--accent-hover); font-weight: 600; }

/* Site footer */
.site-footer {
  margin-top: 2rem;
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid var(--border);
  background: rgba(8, 5, 7, 0.6);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer__intro,
.site-footer__legal-note {
  max-width: 52rem;
  margin: 0 auto 0.85rem;
}

.site-footer__links {
  text-align: center;
  margin: 1rem 0;
  line-height: 1.8;
}

.site-footer__links a {
  color: var(--accent);
  white-space: nowrap;
}

.site-footer__badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.rta-badge,
.adults-only-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.site-footer__copy {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Legal static pages */
.legal-page .site-header { justify-content: flex-start; }

.legal-main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.legal-main h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.legal-main h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.legal-main p,
.legal-main li {
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.legal-main ul,
.legal-main ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.legal-main code {
  font-size: 0.85em;
  color: var(--accent);
}

.country-list {
  list-style: none;
  padding-left: 0;
  columns: 1;
  column-gap: 2rem;
}

@media (min-width: 520px) {
  .country-list {
    columns: 2;
  }
}

@media (min-width: 900px) {
  .country-list {
    columns: 3;
  }
}

.country-list li {
  break-inside: avoid;
  margin-bottom: 0.55rem;
  padding: 0.35rem 0;
}

.country-list a {
  font-weight: 600;
  color: var(--text);
}

.country-list a:hover {
  color: var(--accent);
}

.country-list__note {
  font-size: 0.9em;
  color: var(--muted);
  font-weight: 400;
}

.sitemap-updated {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* Tag statistics page */
body.tags-stats-page main.legal-main.tags-stats-main {
  max-width: min(96rem, calc(100vw - 2rem));
  width: 100%;
}

.tags-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
  width: 100%;
}

.tags-stats-panel {
  min-width: 0;
}

.tags-stats-panel .tags-stats-table-wrap {
  max-height: 75vh;
  overflow: auto;
}

.tags-stats-panel__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.tags-stats-panel__hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.tags-stats-panel__hint code {
  font-size: 0.85em;
}

.tags-stats-table--compact {
  font-size: 0.82rem;
}

.tags-stats-table--compact th,
.tags-stats-table--compact td {
  padding: 0.35rem 0.5rem;
}

.tags-stats-table__empty {
  color: var(--muted);
}

@media (max-width: 520px) {
  body.tags-stats-page main.legal-main.tags-stats-main {
    max-width: 100%;
  }

  .tags-stats-grid {
    grid-template-columns: 1fr;
  }
}

.tags-stats-lead {
  margin-bottom: 1.25rem;
  color: var(--muted);
}

.tags-stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.tags-stats-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.tags-stats-filter select {
  min-width: 12rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}

.tags-stats-filter--check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.35rem;
}

.tags-stats-summary {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text);
}

.tags-stats-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 5, 7, 0.5);
}

.tags-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tags-stats-table th,
.tags-stats-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.tags-stats-table thead th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tags-stats-table tbody tr:last-child td {
  border-bottom: none;
}

.tags-stats-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tags-stats-table__rank {
  width: 3rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tags-stats-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tags-stats-table a {
  color: var(--accent);
  text-decoration: none;
}

.tags-stats-table a:hover {
  text-decoration: underline;
}

.tags-stats-status {
  margin-top: 1rem;
  color: var(--muted);
}

body.tags-slash-page main.tags-slash-main {
  max-width: min(40rem, calc(100vw - 2rem));
}
