:root {
  --brand: #1478d4;          /* xnxx-style bright blue */
  --brand-dark: #0d5cb6;
  --bg: #10457f;             /* blue page background */
  --card: #ffffff;
  --text: #17202a;
  --muted: #5b6b7f;
  --header-text: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.site-header { background: var(--brand); color: var(--header-text); padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.site-header .logo { font-size: 22px; font-weight: bold; color: #fff; letter-spacing: 1px; }
.site-header nav a { color: #dbeafe; margin-right: 14px; }
.site-search { display: flex; width: 100%; }
.site-search input { border: 0; border-radius: 3px 0 0 3px; padding: 7px 10px; font-size: 14px; width: 220px; min-width: 0; flex: 1 1 auto; }
.site-search button { border: 0; border-radius: 0 3px 3px 0; background: var(--brand-dark); color: #fff; padding: 7px 14px; cursor: pointer; font-size: 14px; }
.site-search button:hover { background: #094a94; }
.container { padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.home-grid, .tag-grid { grid-template-columns: repeat(2, 1fr); margin-bottom: 20px; }
.home-main h2 { font-size: 18px; margin: 0 0 10px; }
.intro { font-size: 14px; line-height: 1.6; margin: 0 0 16px; max-width: 70ch; }
.pagination { display: flex; align-items: center; gap: 16px; justify-content: center; margin: 20px 0; color: var(--text); }
.pagination a { color: var(--brand); font-weight: bold; }
.sort-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sort-links a { background: #e6f0fb; color: var(--brand-dark); padding: 5px 12px; border-radius: 4px; font-size: 13px; }
.sort-links a.active { background: var(--brand); color: #fff; }
.card { background: var(--card); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; }
/* card-thumb (not .card) is the positioning context — the preview video must
   only cover the thumbnail link, not the whole card (which also contains the
   title/meta below it). pointer-events: none lets clicks fall through to the
   <a> underneath instead of the video intercepting them. */
.card-thumb { position: relative; display: block; }
.card-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: block; z-index: 1; pointer-events: none; }
.card .meta { padding: 8px 10px; }
.card .meta a { color: var(--text); font-size: 14px; font-weight: 600; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.watch { background: var(--card); border-radius: 6px; padding: 16px; max-width: 1200px; margin: 0 auto; }
.watch video, .watch .player { width: 100%; aspect-ratio: 16/9; background: #000; }
.watch-title { font-size: 21px; font-weight: 700; color: var(--text); margin: 16px 0 8px; line-height: 1.3; }
.watch-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.watch-meta .sub { color: var(--muted); font-size: 13px; margin: 0; }
.watch-meta .vote-buttons { margin: 0; }
.watch-description { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 14px 0; padding-top: 14px; border-top: 1px solid #e2e8f0; }
.watch-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.tags-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.watch-tags .tags { display: flex; flex-wrap: wrap; margin: 0; }
.player { position: relative; overflow: hidden; border-radius: 4px; }
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.player video { position: relative; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.player-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(16, 69, 127, .7); border: 3px solid rgba(255, 255, 255, .9);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; z-index: 2;
  transition: background .15s ease, transform .15s ease;
}
.player-play:hover, .player-play:focus-visible { background: var(--brand); transform: translate(-50%, -50%) scale(1.08); }
.player-play-icon {
  width: 0; height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 24px solid #fff;
  margin-left: 6px; /* optical centering: the triangle's visual weight sits left of its bounding box */
}
.tags a { display: inline-block; background: #e6f0fb; color: var(--brand-dark); padding: 3px 8px; border-radius: 3px; font-size: 12px; margin: 2px; }
.vote-buttons { display: flex; gap: 8px; margin: 8px 0; }
.vote-btn { background: #e6f0fb; color: var(--text); border: 0; border-radius: 4px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.vote-btn:hover { background: #d5e6fa; }
.vote-btn.active { background: var(--brand); color: #fff; }
.comments { max-width: 1200px; margin: 16px auto 0; }
.comments h2 { color: #fff; font-size: 18px; margin: 0 0 10px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.comment-form input[type="text"]:not(.hp-field), .comment-form textarea { padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; font: inherit; }
.comment-form textarea { min-height: 70px; resize: vertical; }
.comment-form button { align-self: flex-start; background: var(--brand); color: #fff; border: 0; padding: 8px 16px; border-radius: 4px; cursor: pointer; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.comment { background: var(--card); border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; }
.comment-body { white-space: pre-wrap; margin: 4px 0 0; }
.related { margin-top: 20px; max-width: 1200px; margin-left: auto; margin-right: auto; }
.related h2 { color: #fff; font-size: 18px; margin: 0 0 10px; }
.site-footer { color: #cdd9e8; text-align: center; padding: 24px; font-size: 12px; }
.footer-links a { color: #cdd9e8; margin: 0 8px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.age-gate { position: fixed; inset: 0; background: rgba(6,26,52,.97); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.age-gate[hidden] { display: none; }  /* the hidden attribute must win over the flex rule above */
.age-gate .box { background: var(--card); color: var(--text); padding: 28px; border-radius: 8px; width: calc(100% - 32px); max-width: 420px; text-align: center; }
.age-gate button { background: var(--brand); color: #fff; border: 0; padding: 10px 18px; border-radius: 4px; font-size: 15px; cursor: pointer; margin: 6px; }
.age-gate .leave { background: var(--muted); }
.home-layout { display: flex; flex-direction: column; gap: 20px; align-items: stretch; }
.home-main { flex: 3 1 480px; min-width: 0; }
.home-sidebar { flex: 1 1 auto; background: #dbeafe; border-radius: 6px; padding: 16px; height: 100%; }
.home-sidebar h2 { font-size: 15px; margin: 0 0 10px; color: var(--text); }
.home-sidebar .tags + h2 { margin-top: 16px; }
.home-sidebar .tags { display: flex; flex-direction: column; align-items: flex-start; margin: 0; padding: 0; }
.home-sidebar .tags a { display: block; margin: 3px 0; background: #ffffff; }
.legal { background: var(--card); color: var(--text); border-radius: 6px; padding: 20px 16px; max-width: 760px; margin: 0 auto; line-height: 1.5; }
.legal h2 { font-size: 17px; margin: 24px 0 8px; }
.legal ul { padding-left: 22px; }
.legal li { margin: 4px 0; }

/* Mobile-first: everything above this point is the mobile-base layout.
   These queries progressively restore the wider-viewport look. */
@media (min-width: 640px) {
  .site-header { flex-wrap: nowrap; }
  .site-search { width: auto; }
  .site-search input { width: 220px; }
  .home-grid, .tag-grid { grid-template-columns: repeat(3, 1fr); }
  .age-gate .box { width: auto; max-width: 420px; }
  .legal { padding: 20px 28px; }
  .player-play { width: 76px; height: 76px; }
}

@media (min-width: 1024px) {
  .home-layout { flex-direction: row; }
  .home-sidebar { flex: 0 1 73px; }
  .home-grid, .tag-grid { grid-template-columns: repeat(6, 1fr); }
}
