:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #111113;
  --muted: #5e6570;
  --line: #e4e5e9;
  --accent: #e10600;
  --shadow: 0 10px 28px rgba(17, 17, 19, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
a { color: inherit; }
button, input { font: inherit; }
img { display: block; max-width: 100%; }
h1, h2 { font-weight: 650; letter-spacing: -0.045em; margin: 0; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--text);
  color: white;
  padding: 8px 12px;
  border-radius: 999px;
}
.skip:focus { top: 12px; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.top-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand {
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.live-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}
.live-count b { color: var(--text); }
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(225, 6, 0, 0.45);
  animation: pulse 1.8s infinite;
}
.search { margin-left: auto; }
.search input {
  width: min(280px, 46vw);
  background: #efeff2;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
}
.search input:focus { outline: none; border-color: var(--text); background: white; }

.lede {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 22px 0 14px;
}
.lede h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.lede p { margin: 6px 0 0; max-width: 46ch; color: var(--muted); }
.updated { color: var(--muted); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-bottom: 16px;
}
.chip, .sort a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--text);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 600;
}
.chip b { font-weight: 700; }
.sort { margin-left: auto; display: flex; gap: 8px; }
.chip.on, .sort a.on {
  background: var(--text);
  border-color: var(--text);
  color: white;
}
.notice {
  margin: 0 0 14px;
  color: #8a5a00;
  background: #fff7e8;
  border: 1px solid #f0dfb8;
  border-radius: 10px;
  padding: 10px 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 36px;
}
.card {
  display: block;
  text-decoration: none;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: auto 280px;
}
.card:hover, .card:focus-visible {
  border-color: #d0d1d6;
  box-shadow: var(--shadow);
}
.shot {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: #ececee;
}
.shot img, .placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.placeholder { background: linear-gradient(160deg, #ececee, #d8d9de); }
.card:hover img { transform: scale(1.03); }
.viewers, .hd, .watch {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.viewers, .hd {
  top: 8px;
  padding: 4px 8px;
  background: rgba(17, 17, 19, 0.78);
  color: white;
}
.viewers { left: 8px; }
.viewers i { width: 6px; height: 6px; border-radius: 50%; background: #ff3b30; }
.hd { right: 8px; }
.watch {
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  background: white;
  color: var(--text);
  padding: 7px 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}
.card:hover .watch, .card:focus-visible .watch {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  padding: 10px 12px 12px;
}
.name {
  font-weight: 700;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.net { color: var(--muted); font-size: 0.75rem; font-weight: 600; flex: none; }

.empty { padding: 48px 0 72px; color: var(--muted); }
.empty a { color: var(--accent); font-weight: 700; }

.crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  padding: 18px 0 14px;
  font-size: 0.92rem;
}
.crumbs a { color: var(--text); text-decoration: none; font-weight: 600; }
.room { display: grid; gap: 28px; padding-bottom: 28px; }
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111113 center / cover no-repeat;
  border-radius: 14px;
  overflow: hidden;
}
.player iframe, .sc-mount, .player .poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.player iframe, .sc-mount { z-index: 1; }
.sc-mount iframe, .sc-mount > div { width: 100% !important; height: 100% !important; }
.player .poster { object-fit: cover; }
.room-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.room-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.room-id > div { min-width: 0; }
.room-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: #ececee;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}
.room-avatar:hover { outline: 2px solid var(--accent); outline-offset: 2px; }
.room-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  text-decoration: none;
}
.room-name:hover { color: var(--accent); }
.room-avatar img { width: 100%; height: 100%; object-fit: cover; }
.room h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
  font-size: 1.25rem;
  white-space: nowrap;
  overflow: hidden;
}
.live-pill { flex: none; }
.room h1 span.live-pill { font-size: 0.72rem; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f3f4f6;
  color: var(--text);
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 700;
}
.room-viewers { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.room-viewers b { color: var(--text); }
.room-viewers span::before { content: "·"; margin: 0 6px; color: #c5c7cc; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags span {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: #f3f4f6;
  font-size: 0.84rem;
  font-weight: 600;
}
.subject { color: var(--muted); margin: 14px 0 0; }
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 700;
  border-radius: 12px;
  padding: 14px 18px;
  flex: none;
}
.btn:hover { background: #c10500; }
.room-side { min-width: 0; }
.room-side h2 {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-list a {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  text-decoration: none;
}
.side-list a:hover { background: white; }
.side-thumb {
  width: 72px;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #ececee;
}
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-meta { display: flex; flex-direction: column; min-width: 0; }
.side-meta strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-meta span { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.side-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.mobile-cta {
  display: none;
  position: fixed;
  z-index: 15;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(225, 6, 0, 0.28);
}
.mobile-cta .pulse { background: white; box-shadow: none; }
.more h2 { margin: 8px 0 14px; font-size: 1.25rem; }

.legal { padding: 28px 0 64px; max-width: 68ch; }
.legal h1 { font-size: 2.2rem; margin-bottom: 8px; }
.legal h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.legal p { color: var(--muted); }
.legal a { color: var(--accent); font-weight: 650; }

.site-foot {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
  display: grid;
  gap: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}
.network, .foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.site-foot a { color: var(--text); text-decoration: none; font-weight: 600; }
.network a { color: var(--muted); font-weight: 500; }
.network a:hover, .site-foot a:hover { color: var(--accent); }

.gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(17, 17, 19, 0.46);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
html:not(.age-ok) .gate { display: flex; }
html:not(.age-ok) { overflow: hidden; }
.gate-card {
  width: min(420px, 100%);
  background: white;
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.gate-card h1 { font-size: 2rem; margin: 8px 0; }
.gate-card p { color: var(--muted); }
.gate-card button, .leave {
  display: inline-flex;
  margin-right: 14px;
  margin-top: 8px;
  text-decoration: none;
}
.gate-card button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.gate-card button:hover { background: #c10500; }
.leave { color: var(--muted); padding: 12px 0; font-weight: 600; }

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 960px) {
  .room { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .room-side { position: sticky; top: 18px; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
  .lede { display: block; }
  .updated { display: block; margin-top: 8px; }
  .top-row { flex-wrap: wrap; min-height: 0; padding: 10px 0; gap: 10px; }
  .search { width: 100%; margin-left: 0; }
  .search input { width: 100%; }
  .sort { margin-left: 0; }
  .room-chat { display: none; }
  .mobile-cta { display: flex; }
  .room-page { padding-bottom: 84px; }
  body:has(.mobile-cta) .site-foot { margin-bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .watch { opacity: 1; transform: translateX(-50%); }
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 6px rgba(225, 6, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 6, 0, 0); }
}
