/* Funny Playlist: late-2000s video site look. */
:root {
  --red: #ff0000;
  --red-dark: #cc0000;
  --red-deep: #a80000;
  --link: #0033cc;
  --text: #222;
  --muted: #666;
  --faint: #999;
  --page: #fff;
  --panel: #f6f6f6;
  --border: #ccc;
  --border-light: #e2e2e2;
  --font: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 13px/1.4 var(--font);
}
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #3d7fff; outline-offset: 1px; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

/* ---------- Glossy buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border: 1px solid #b4b4b4; border-radius: 3px;
  background: linear-gradient(#ffffff, #e8e8e8);
  box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(0, 0, 0, .08);
  color: #333; font-weight: bold; font-size: 12px; white-space: nowrap;
  cursor: pointer; text-shadow: 0 1px 0 #fff;
}
.btn:hover { background: linear-gradient(#ffffff, #dcdcdc); border-color: #999; }
.btn:active { background: linear-gradient(#e0e0e0, #f4f4f4); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15); }
.btn-red {
  border-color: var(--red-deep);
  background: linear-gradient(#ff4a4a, var(--red) 50%, var(--red-dark));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 1px rgba(0, 0, 0, .12);
  color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, .3);
}
.btn-red:hover { background: linear-gradient(#ff5c5c, #ee0000 50%, #b80000); border-color: #900; }
.btn-red:active { background: linear-gradient(var(--red-dark), var(--red)); }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 3px 0 0 3px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 3px 3px 0; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; color: #000; text-decoration: none !important; }
.logo-tv { width: 40px; height: 34px; flex: none; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.brand-name { font: bold 22px/1 var(--font); letter-spacing: -1px; }

/* ---------- Masthead ---------- */
.masthead { border-bottom: 1px solid var(--border); background: linear-gradient(#fff, #f3f3f3); }
.masthead-in { display: flex; align-items: center; gap: 16px; height: 60px; }
.search { display: flex; flex: 1; max-width: 420px; margin-left: auto; }
.search input {
  flex: 1; min-width: 0; height: 28px; padding: 0 8px;
  border: 1px solid #999; border-right: 0; border-radius: 2px 0 0 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); background: #fff; outline: none;
}
.search input:focus { border-color: #4d90fe; }
.search .btn { border-radius: 0 3px 3px 0; }

#app { min-height: 100vh; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; padding-top: 16px; padding-bottom: 24px; }

/* ---------- Modules (boxed sections) ---------- */
.module { border: 1px solid var(--border); border-radius: 3px; background: #fff; }
.module-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 7px 10px; border-bottom: 1px solid var(--border);
  background: linear-gradient(#f9f9f9, #e9e9e9); border-radius: 3px 3px 0 0;
}
.module-head h2 { margin: 0; font-size: 14px; color: #333; }
.module-head .count { color: var(--muted); font-weight: normal; }
.module-note { color: var(--muted); font-size: 11px; }
.module-body { padding: 10px; }

/* ---------- Video grid ---------- */
.grid {
  list-style: none; margin: 0; padding: 14px 10px 4px;
  display: grid; gap: 14px 12px;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
}
.card { display: block; color: inherit; text-decoration: none !important; }
.thumb {
  position: relative; display: block; aspect-ratio: 4 / 3;
  border: 1px solid #999; padding: 2px; background: #fff;
}
.thumb-in { position: absolute; inset: 2px; display: block; overflow: hidden; background: #000; }
.upnext .thumb-in { inset: 1px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card:hover .thumb { border-color: var(--red); }
.badge {
  position: absolute; right: 3px; bottom: 3px; padding: 0 4px;
  background: rgba(0, 0, 0, .8); color: #fff; font-size: 11px; font-weight: bold; line-height: 16px;
}
.card-title {
  margin: 5px 0 1px; color: var(--link); font-weight: bold; font-size: 12px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card:hover .card-title { text-decoration: underline; }
.card-sub { margin: 0; color: var(--faint); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub b { color: var(--muted); font-weight: normal; }
.empty { padding: 24px 10px; color: var(--muted); text-align: center; }

/* ---------- Watch page ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.watch-title { margin: 0 0 8px; font-size: 20px; line-height: 1.25; color: #000; }
.player-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid #000; }
.player-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.player-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 6px; margin-bottom: 12px;
  background: linear-gradient(#f4f4f4, #e2e2e2); border: 1px solid var(--border); border-top: 0;
}
.autoplay { display: inline-flex; align-items: center; gap: 5px; color: #333; font-size: 12px; cursor: pointer; }
.autoplay input { margin: 0; accent-color: var(--red); }
.info-line { margin: 0 0 4px; color: var(--muted); }
.info-line:last-child { margin-bottom: 0; }
.info-line b { color: #333; }
.info-pos { font-size: 11px; }

.upnext { list-style: none; margin: 0; padding: 4px 0; max-height: 640px; overflow-y: auto; }
.upnext a {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px;
  padding: 5px 10px; color: inherit; text-decoration: none !important;
}
.upnext a:hover { background: #f1f5ff; }
.upnext .thumb { aspect-ratio: 4 / 3; padding: 1px; }
.upnext .card-title { margin-top: 0; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--border); background: var(--panel); padding: 14px 0 22px; text-align: center; color: var(--muted); font-size: 11px; }
.foot p { margin: 4px 0; }
.foot .copy { color: var(--faint); }

/* ---------- Sign in ---------- */
.login {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 12vh 16px 40px; background: linear-gradient(#fff 60%, #eee);
}
.brand-big { margin-bottom: 20px; }
.brand-big .logo-tv { width: 52px; height: 44px; }
.brand-big .brand-name { font-size: 30px; }
.login-box { width: min(340px, 100%); }
.login-sub { margin: 0 0 12px; color: var(--muted); }
.login label { display: block; margin-bottom: 4px; font-weight: bold; }
.login input {
  width: 100%; height: 28px; padding: 0 6px; margin-bottom: 10px;
  border: 1px solid #999; border-radius: 2px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); outline: none;
}
.login input:focus { border-color: #4d90fe; }
.login-row { display: flex; align-items: center; gap: 10px; }
.login-error { color: var(--red-dark); font-weight: bold; font-size: 12px; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .watch { grid-template-columns: 1fr; }
  .upnext { max-height: none; }
}
@media (max-width: 560px) {
  .masthead-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px 10px; }
  .brand-name { font-size: 19px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  #random-btn { margin-left: auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding: 10px 8px 4px; }
  .watch-title { font-size: 17px; }
  .page { padding-left: 8px; padding-right: 8px; }
  .search input, .login input { font-size: 16px; height: 32px; } /* stops iOS zooming on focus */
  .search .btn { height: 32px; }
}
