:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #8a8a8a;
  --tile: #f2f2f2;
  --pad: clamp(16px, 3vw, 40px);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

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

html, body { background: var(--bg); color: var(--ink); }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Nothing can be selected, dragged or long-pressed for a save menu. */
html {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img, a { -webkit-user-drag: none; user-drag: none; }

/* ---------- Video grid (home) ---------- */

.feed-page { padding: 64px var(--pad) 80px; }

.feed {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 22px;
}

.card { display: block; text-align: center; }

.card .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 3px;
  background: var(--tile);
}
.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s;
}
img.letterboxed { transform: scale(1.36); }
.card:hover .thumb img { filter: brightness(1.08); }

.card h2 {
  margin: 12px 6px 6px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #24578c;
}
.card:hover h2 { text-decoration: underline; }

.stats {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 14px;
  color: #444;
}
.stats span { display: inline-flex; align-items: center; gap: 7px; }
.stats svg { width: 17px; height: 17px; fill: #8c8c8c; }
.stats b { font-weight: 400; }
.stats b.bumped { animation: bump 1.6s ease; }
@keyframes bump { 0% { color: #1f8a3b; } 100% { color: inherit; } }

@media (max-width: 860px) { .feed { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) {
  .feed { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; }
  .card h2 { font-size: 13.5px; }
}

/* ---------- Video page ---------- */

.video-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px var(--pad) 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 960px) { .video-page { grid-template-columns: minmax(0, 1fr); } }
.video-page h1 {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 22px;
  margin: 18px 0 8px;
  color: #24578c;
}
.video-page .stats { justify-content: flex-start; }
.video-page .back { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--muted); }
.video-page .back:hover { color: var(--ink); }

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 3px;
  overflow: hidden;
  user-select: none;
}
.player:fullscreen { border-radius: 0; aspect-ratio: auto; }

/* The embedded frame is display-only: it never sees the mouse. */
.player .frame, .player .frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.player .cover, .player .hit { position: absolute; inset: 0; }
.player .cover { z-index: 2; cursor: pointer; overflow: hidden; background: #000; transition: opacity 0.3s; }
.player .cover img { width: 100%; height: 100%; object-fit: cover; }
.player.started .cover { opacity: 0; pointer-events: none; }
.player .hit { z-index: 1; cursor: pointer; }

.big-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.big-play svg { width: 34px; height: 34px; fill: #fff; margin-left: 4px; }
.cover:hover .big-play { background: rgba(0, 0, 0, 0.75); transform: scale(1.05); }

.controls {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: #fff;
  font: 12px/1 Arial, "Helvetica Neue", Helvetica, sans-serif;
  opacity: 0;
  transition: opacity 0.25s;
}
.player.started:hover .controls, .player.started:not(.playing) .controls { opacity: 1; }
.player:not(.started) .controls { pointer-events: none; }

.ctl { border: 0; background: none; cursor: pointer; padding: 2px; display: inline-flex; }
.ctl svg { width: 20px; height: 20px; fill: #fff; }
.time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 4px; background: rgba(255, 255, 255, 0.3); border-radius: 2px; cursor: pointer; position: relative; }
.bar::before { content: ""; position: absolute; inset: -8px 0; }
.bar .fill { height: 100%; width: 0; background: #fff; border-radius: 2px; }

/* ---------- Related videos (right column) ---------- */

.related { display: flex; flex-direction: column; gap: 14px; }
.rel { display: flex; gap: 10px; align-items: flex-start; }
.rel-thumb {
  flex: 0 0 150px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 3px;
  background: var(--tile);
}
.rel-thumb img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.2s; }
.rel:hover .rel-thumb img { filter: brightness(1.08); }
.rel-info { min-width: 0; }
.rel h3 {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #24578c;
  margin: 1px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rel:hover h3 { text-decoration: underline; }
.stats.mini { justify-content: flex-start; gap: 12px; font-size: 12px; }
.stats.mini svg { width: 14px; height: 14px; }
.stats.mini span { gap: 5px; }

/* ---------- Comments ---------- */

.comments { margin-top: 30px; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; }
.comments-head {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #222;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 2px solid #222;
}
.comments-head .n { color: #8b1a1a; }

.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #eee; }
.comment.reply { margin-left: 56px; padding-top: 10px; }
.comment .avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 3px;
  object-fit: cover;
  background: var(--tile);
}
.comment.reply .avatar { flex-basis: 32px; width: 32px; height: 32px; }
.comment-body { min-width: 0; flex: 1; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.who { font-weight: 700; font-size: 14px; color: #24578c; }
.when { font-size: 12px; color: #999; }
.comment-text { margin: 4px 0 6px; font-size: 14px; line-height: 1.45; color: #222; white-space: pre-line; overflow-wrap: anywhere; }
.comment-foot { font-size: 12px; color: #777; }
.comment-foot .likes { display: inline-flex; align-items: center; gap: 5px; }
.comment-foot svg { width: 14px; height: 14px; fill: #9a9a9a; }

.comment.new { animation: fresh 3s ease; }
@keyframes fresh { 0% { background: #fff6cc; } 100% { background: transparent; } }

.no-comments { padding: 18px 0; color: #888; font-size: 14px; }
.more-comments {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fafafa;
  font: 700 13px Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: #24578c;
  cursor: pointer;
}
.more-comments:hover { background: #f1f1f1; }

/* ---------- Header (WorldStar-style black bar, logo only) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(#1d1d1d, #000);
  border-bottom: 3px solid #c8102e;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.topbar-inner {
  max-width: 1000px;
  height: 74px;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
}
.wide .topbar-inner { max-width: 1280px; }
.topbar-logo { display: block; }
.topbar-logo img {
  display: block;
  height: 60px;
  width: auto;
  transition: transform 0.2s ease;
}
.topbar-logo:hover img { transform: rotate(-4deg) scale(1.06); }
@media (max-width: 620px) {
  .topbar-inner { height: 60px; }
  .topbar-logo img { height: 48px; }
}


/* ---------- Landing page (assets/landing.js) ---------- */

body.landing {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
  transition: opacity 0.6s ease;
}
body.landing.leaving { opacity: 0; }
/* The video plays full-size underneath; the canvas on top shows its frames
   steadied (landing.js). The video has to stay on screen: iPhones only
   autoplay video they consider visible. */
.landing-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.landing-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
}

/* ---------- Fake 2000s ads (assets/ads.js) ---------- */

.ad { position: fixed; z-index: 60; user-select: none; cursor: default; transition: opacity 0.25s; }
.ad-hidden { display: none; }
.ad-closing { opacity: 0; }
.ad-left { left: 14px; top: 140px; }
.ad-right { right: 14px; top: 140px; }
.ad-bottom { left: 50%; bottom: 6px; transform: translateX(-50%) scale(var(--ad-scale, 1)); transform-origin: bottom center; }
.ad-label { font: 9px Verdana, Tahoma, sans-serif; color: #999; text-transform: uppercase; letter-spacing: 0.06em; text-align: center; margin-bottom: 2px; }
.ad-frame { position: relative; overflow: hidden; border: 1px solid #8a8a8a; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); background: #fff; }
.ad-sky .ad-frame { width: 160px; height: 600px; }
.ad-board .ad-frame { width: 728px; height: 90px; }
.ad-close {
  position: absolute; top: 2px; right: 2px; z-index: 2;
  width: 16px; height: 16px; padding: 0;
  border: 1px solid #777; background: #eee; color: #333;
  font: bold 10px/14px Verdana, sans-serif; cursor: pointer;
}
.ad-close:hover { background: #fff; color: #000; }

.ad-body {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: space-evenly;
  padding: 14px 10px; text-align: center;
  font: bold 13px/1.25 Verdana, Tahoma, sans-serif;
}
.ad-board .ad-body { flex-direction: row; padding: 0 28px 0 12px; gap: 12px; font-size: 12px; }
.ad .big { font: 26px/1 Impact, "Arial Black", sans-serif; letter-spacing: 0.02em; }
.ad-board .big { font-size: 24px; }
.ad .price { font: 24px/1 Impact, "Arial Black", sans-serif; }
.ad .fine { font-size: 8px; font-weight: normal; opacity: 0.8; }
.ad .blink { animation: ad-blink 0.8s steps(2, start) infinite; }
.ad .fake-btn {
  padding: 6px 12px; color: #000; font-size: 12px;
  background: linear-gradient(#ffe766, #f2b400);
  border: 2px outset #fff3b0;
}
@keyframes ad-blink { to { visibility: hidden; } }

/* Channel flip when an ad slot swaps to a new ad */
.ad-frame.ad-flip { animation: ad-flip 0.34s ease-in-out; }
@keyframes ad-flip {
  0% { transform: scaleY(1); filter: none; }
  45% { transform: scaleY(0.04); filter: brightness(3) saturate(0); }
  55% { transform: scaleY(0.04); filter: brightness(3) saturate(0); }
  100% { transform: scaleY(1); filter: none; }
}
.ad-slot { width: 100%; height: 100%; }

/* Generated ads: shared layout */
.ad-gen .gen-icon { font-size: 44px; line-height: 1; }
.ad-gen .gen-head { overflow-wrap: anywhere; }
.ad-gen .gen-sub { font-size: 12px; }
.ad-sky .ad-gen .gen-head { font-size: 30px; }
.ad-board .ad-gen .gen-icon { font-size: 38px; }
.ad-board .ad-gen .gen-head { font-size: 20px; max-width: 250px; }
.ad-board .ad-gen .gen-sub { font-size: 11px; max-width: 170px; }
.ad-board .ad-gen .fine { display: none; }
.ad-board .ad-gen .price { font-size: 16px; max-width: 130px; }
.ad-board .ad-gen .fake-btn { white-space: nowrap; font-size: 11px; padding: 5px 9px; }

/* Styles */
.style-neon { background: linear-gradient(#000, #2d0045); color: #fff; }
.style-neon .gen-head { color: #ff3bd9; text-shadow: 0 0 8px #ff3bd9; }
.style-neon .price { color: #39ff14; }

.style-flash { color: #b00000; animation: ad-flash 0.6s steps(2, start) infinite; }
.style-flash .gen-head { color: #d00000; }
@keyframes ad-flash { 0% { background: #fff200; } 100% { background: #ffb300; } }

.style-chrome { background: linear-gradient(#fafafa, #9a9a9a 55%, #e6e6e6); color: #111; }
.style-chrome .gen-head { color: #1a1a1a; text-shadow: 0 1px 0 #fff; }
.style-chrome .price { color: #c40000; }

.style-chroma { background: #00d400; color: #000; }
.style-chroma .gen-head { color: #fff; text-shadow: 2px 2px 0 #000; }

.style-money { background: linear-gradient(#0e7a2c, #064d1b); color: #fff; }
.style-money .gen-head { color: #ffe600; }
.style-money .price { color: #fff; }

.style-tape { background: repeating-linear-gradient(-45deg, #ffd400 0 18px, #111 18px 36px); color: #fff; }
.style-tape .gen-head, .style-tape .gen-sub, .style-tape .price, .style-tape .fine { background: #111; padding: 2px 6px; }
.style-tape .gen-head { color: #ffd400; }

.style-matrix {
  background: #000 repeating-linear-gradient(transparent 0 14px, rgba(0, 255, 70, 0.06) 14px 15px);
  color: #00ff46;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 6px rgba(0, 255, 70, 0.7);
  animation: ad-scan 3s linear infinite;
}
.style-matrix .gen-head { font-family: "Courier New", monospace; font-weight: bold; }
@keyframes ad-scan { to { background-position: 0 60px; } }

.style-vapor { background: linear-gradient(#ff5fc8, #8a1fd1 60%, #2a0a6b); color: #fff; }
.style-vapor .gen-head { color: #fff; text-shadow: 2px 2px 0 #5a007a, 0 0 10px #ff9ef0; }
.style-vapor .price { color: #ffe600; }

.style-news { background: #fff; color: #002f87; border-top: 8px solid #c8102e; }
.style-news .gen-head { color: #c8102e; }
.style-news .price { color: #002f87; }

.style-y2k { background: linear-gradient(#5ab0ff, #0a3fd6); color: #fff; }
.style-y2k .gen-head { color: #ffe600; text-shadow: 2px 2px 0 #001a66; }

/* Old-Windows popup style */
.style-xp { background: #ece9d8; color: #000; padding: 0 !important; justify-content: flex-start; align-items: stretch; flex-direction: column !important; gap: 0 !important; }
.xp-title { display: flex; justify-content: space-between; padding: 4px 26px 4px 8px; background: linear-gradient(#0a62f0, #0743b5); color: #fff; font-size: 11px; }
.xp-main { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; padding: 10px; font-weight: normal; font-size: 12px; text-align: center; }
.ad-board .xp-main { flex-direction: row; padding: 4px 10px; gap: 10px; }
.xp-icon { font-size: 34px; line-height: 1; }
.ad-board .xp-icon { font-size: 26px; }
.xp-bar { width: 120px; height: 14px; border: 1px solid #7a7a7a; background: #fff; padding: 1px; flex: none; }
.xp-bar span { display: block; height: 100%; width: 10%; background: repeating-linear-gradient(90deg, #2bbd2b 0 8px, transparent 8px 10px); animation: ad-bar 3s linear infinite; }
@keyframes ad-bar { to { width: 100%; } }
.xp-btns { display: flex; gap: 6px; }
.xp-btns span { padding: 2px 10px; border: 1px solid #003c74; border-radius: 3px; background: linear-gradient(#fff, #e3e3db); font-size: 11px; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .ad .blink, .style-flash, .style-matrix, .xp-bar span, .ad-frame.ad-flip { animation: none; }
}

/* ---------- Header search (assets/search.js) ---------- */

.topbar { z-index: 70; } /* above the side ads, so suggestions show over them */
.search { position: relative; display: flex; flex: 0 1 380px; margin-left: auto; }
.search-input {
  flex: 1; min-width: 0; height: 38px; padding: 0 12px;
  border: 2px solid #fff; border-right: 0; border-radius: 3px 0 0 3px;
  background: #fff; color: #111; font: 14px Arial, Helvetica, sans-serif;
  -webkit-user-select: text; user-select: text; outline: none;
}
.search-input:focus { border-color: #c8102e; }
.search-input::placeholder { color: #8a8a8a; }
.search-go {
  flex: none; width: 46px; height: 38px; border: 0; border-radius: 0 3px 3px 0;
  background: linear-gradient(#e3203a, #a50c22); cursor: pointer;
  display: grid; place-items: center;
}
.search-go:hover { background: linear-gradient(#f0304a, #b8102a); }
.search-go svg { width: 21px; height: 21px; fill: #fff; }

.search-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 100;
  margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid #cfcfcf; border-top: 3px solid #c8102e;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  max-height: 70vh; overflow-y: auto;
}
.search-list[hidden] { display: none; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; }
.search-item.active { background: #eef3fb; }
.search-item img { flex: none; width: 84px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; background: #eee; }
.search-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.search-title {
  font: bold 13px/1.25 Arial, Helvetica, sans-serif; color: #24578c;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.search-title mark { background: #fff1a0; color: inherit; padding: 0; }
.search-views { font: 11px Arial, Helvetica, sans-serif; color: #777; }
.search-none { padding: 12px; font: 13px Arial, Helvetica, sans-serif; color: #777; }

.search-note { max-width: 1000px; margin: 0 auto 18px; font: 14px Arial, Helvetica, sans-serif; color: #555; }
.search-note a { color: #24578c; text-decoration: underline; }

@media (max-width: 620px) {
  .search { margin-left: 14px; flex: 1 1 auto; }
  .search-input, .search-go { height: 34px; }
  .search-go { width: 40px; }
  .search-list { position: fixed; top: 66px; left: 8px; right: 8px; }
}

/* ---------- Instagram badge under the header's right corner ---------- */

.topbar-inner { position: relative; }
.ig-badge {
  position: absolute;
  top: calc(100% + 11px);
  right: var(--pad);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 6px;
  border: 1px solid #e3e3e3;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font: bold 13px/1 Arial, Helvetica, sans-serif;
  color: #222;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ig-badge svg { width: 22px; height: 22px; flex: none; }
.ig-badge:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
@media (max-width: 620px) {
  .ig-badge { top: calc(100% + 8px); font-size: 12px; padding: 4px 10px 4px 5px; }
  .ig-badge svg { width: 19px; height: 19px; }
}
