/* Site theme — dark tube layout. */

:root {
  --bg: #0e0f13;
  --bg-soft: #16181f;
  --bg-card: #1a1d26;
  --line: #262a36;
  --fg: #e8e9ee;
  --fg-dim: #9aa0b0;
  --accent: #ff2d6f;
  --accent-2: #8a5cff;
  --radius: 10px;
  --wrap: 1440px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button { font: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.header-row {
  display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 800; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand-name { letter-spacing: -0.02em; }
.search { display: flex; flex: 1 1 260px; max-width: 560px; }
.search input {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line);
  color: var(--fg); border-radius: var(--radius) 0 0 var(--radius); padding: 9px 12px;
}
.search input:focus { outline: none; border-color: var(--accent); }
.search button {
  background: var(--accent); color: #fff; border: 0; padding: 0 16px; cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0; font-weight: 600;
}
.mainnav { display: flex; gap: 16px; font-weight: 600; }
.mainnav a.on { color: var(--accent); }
.tagbar {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px;
  font-size: 13px; color: var(--fg-dim); scrollbar-width: thin;
}
.tagbar a { white-space: nowrap; }
.ad-header { display: flex; justify-content: center; padding: 8px 16px; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; padding-top: 20px; padding-bottom: 40px; }
.col-side { display: flex; flex-direction: column; gap: 16px; }
.section { margin-bottom: 34px; }
.section-title { font-size: 19px; margin: 0 0 14px; font-weight: 700; }
.section-title .count { color: var(--fg-dim); font-weight: 500; font-size: 14px; margin-left: 6px; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sorts { display: flex; gap: 10px; font-size: 13px; color: var(--fg-dim); }
.sorts a.on { color: var(--accent); font-weight: 700; }
.empty { color: var(--fg-dim); padding: 40px 0; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.grid--tall { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #000; }
.card-thumb--tall { aspect-ratio: 24 / 34; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.78);
  color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 600;
}
.badge.q { left: 6px; right: auto; background: var(--accent); }
.badge.kind { top: 6px; left: 6px; bottom: auto; right: auto; background: var(--accent-2); text-transform: uppercase; }
.badge.pages { bottom: 6px; right: 6px; }
.card-title { font-size: 13.5px; margin: 8px 10px 4px; line-height: 1.35; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 12px; color: var(--fg-dim); margin: 0 10px 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dot { opacity: .5; }
.more { margin-top: 16px; }
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--bg-card);
  padding: 9px 16px; border-radius: var(--radius); font-weight: 600;
}
.btn:hover { border-color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Player ─────────────────────────────────────────────────────────────── */
.player-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.player { width: 100%; height: 100%; display: block; background: #000; }
.player-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.play-btn {
  width: 78px; height: 78px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,45,111,.92);
  clip-path: circle(50%);
}
.play-btn::after { content: ''; display: block; margin: 0 auto; border-style: solid;
  border-width: 15px 0 15px 24px; border-color: transparent transparent transparent #fff; transform: translateX(4px); }
.play-btn.playing::after { border-width: 0; width: 20px; height: 26px;
  border-left: 7px solid #fff; border-right: 7px solid #fff; box-sizing: border-box; transform: none; }
.fallback-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.18); }
.fallback-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s linear; }
.ad-under-player { display: flex; justify-content: center; margin: 16px 0; }
.video-title { font-size: 21px; margin: 16px 0 10px; font-weight: 700; }
.video-bar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center;
  border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.video-stats { color: var(--fg-dim); font-size: 13.5px; display: flex; gap: 7px; }
.video-actions { display: flex; gap: 8px; }
.act { background: var(--bg-card); border: 1px solid var(--line); color: var(--fg);
  padding: 7px 13px; border-radius: var(--radius); cursor: pointer; }
.act:hover { border-color: var(--accent); }
.act.on { border-color: var(--accent); color: var(--accent); }
.video-desc { color: var(--fg-dim); margin: 14px 0; max-width: 78ch; }

/* ── Tags / sidebar ─────────────────────────────────────────────────────── */
.tagcloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tagcloud a { background: var(--bg-card); border: 1px solid var(--line); padding: 5px 10px;
  border-radius: 999px; font-size: 12.5px; color: var(--fg-dim); }
.tagcloud a:hover { border-color: var(--accent); color: var(--accent); }
.tagcloud--inline { margin: 14px 0 6px; }
.side-box { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.side-box h3 { margin: 0 0 10px; font-size: 14px; }
.upnext { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.upnext a { display: flex; gap: 9px; align-items: flex-start; }
.upnext img { width: 108px; border-radius: 6px; flex: none; }
.upnext span { font-size: 12.5px; line-height: 1.35; }

/* ── Comic / reader ─────────────────────────────────────────────────────── */
.comic-head { display: flex; gap: 20px; flex-wrap: wrap; }
.comic-cover { width: 240px; border-radius: var(--radius); border: 1px solid var(--line); }
.comic-info { flex: 1 1 320px; }
.thumbstrip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.thumbstrip img { border-radius: 6px; border: 1px solid var(--line); }
.reader { padding-top: 20px; padding-bottom: 40px; }
.reader-head { margin-bottom: 16px; }
.reader-pages { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.reader-page { width: 100%; max-width: 820px; height: auto; border-radius: 4px; background: #000; }
.reader-ad { margin: 22px 0; display: flex; justify-content: center; }
.reader-foot { display: flex; gap: 12px; justify-content: center; margin-top: 26px; }

/* ── Ad slots ───────────────────────────────────────────────────────────── */
/* Space is reserved from the zone's size hints so a fill never shifts layout. */
.adslot {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: var(--ad-dw); height: var(--ad-dh); max-width: 100%;
  background: var(--bg-soft); border: 1px dashed var(--line); border-radius: 6px;
  overflow: hidden; flex: none;
}
.adslot iframe, .adslot img, .adslot ins { display: block; border: 0; max-width: 100%; }
.adslot-label {
  position: absolute; top: 2px; left: 4px; font-size: 9px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fg-dim); opacity: .55; pointer-events: none;
}
.adslot.filled { border-style: solid; }
.grid-ad { display: flex; align-items: center; justify-content: center; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 26px 0 40px;
  color: var(--fg-dim); font-size: 12.5px; }
.footnav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.disclaimer { max-width: 90ch; margin: 0 0 8px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.pager a, .pager .cur { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-card); }
.pager .cur { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.prose { max-width: 80ch; color: var(--fg-dim); }
.prose p { margin: 0 0 14px; }

/* ── In-page push (rendered by the ad runtime, styled here so the mock and a real
      tag look equally native) ─────────────────────────────────────────────── */
.inpage-unit {
  position: fixed; left: 16px; bottom: 16px; z-index: 9999;
  width: 330px; max-width: calc(100vw - 32px);
  display: flex; gap: 10px; padding: 10px;
  background: #23262f; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0,0,0,.55);
  transform: translateY(140%); transition: transform .35s ease; cursor: pointer;
}
.inpage-unit.in { transform: translateY(0); }
.inpage-unit img { width: 56px; height: 56px; border-radius: 8px; flex: none; }
.inpage-title { font-size: 13.5px; font-weight: 700; margin: 0 0 3px; }
.inpage-body { font-size: 12px; color: var(--fg-dim); margin: 0; }
.inpage-close {
  position: absolute; top: 4px; right: 6px; background: none; border: 0;
  color: var(--fg-dim); font-size: 15px; cursor: pointer; line-height: 1;
}

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side { order: 2; }
  .adslot { width: var(--ad-mw); height: var(--ad-mh); }
  .mainnav { order: 3; width: 100%; overflow-x: auto; }
}
