/* Plain dark pages for the MVP (pick E in the plan). The YouTube look replaces this after the
   MVP, in parts D1 and D2. */
:root {
  color-scheme: dark;
  --bg: #0f0f0f;
  --text: #f1f1f1;
  --muted: #aaaaaa;
  --surface: #272727;
  --line: #3f3f3f;
  --link: #3ea6ff;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

a { color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* The header on every page: the site's name, the owner's Friends link, who is watching. */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.site-name { color: var(--text); font-size: 1.125rem; font-weight: 700; text-decoration: none; }
.site-header nav { color: var(--muted); }
.viewer { margin-left: auto; color: var(--muted); font-size: 0.875rem; }

/* A 16 px gutter at the sides; the content is never wider than the player. */
main {
  max-width: calc(1280px + 32px);
  margin: 0 auto;
  padding: 16px;
}

h1 { margin: 12px 0 4px; font-size: 1.25rem; line-height: 1.4; }
p { margin: 0 0 12px; }
.meta { color: var(--muted); font-size: 0.875rem; }

.notice {
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
}

/* The list: a grid of cards at least 280 px wide, as many to a row as fit. */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 24px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.video-grid a { display: block; color: var(--text); text-decoration: none; }
.video-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  border-radius: var(--radius);
}
.video-grid .title {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.video-grid .meta { display: block; margin-top: 2px; }

/* The video page: the player full width up to 1280 px, and never taller than 80% of the screen.
   The small-viewport unit keeps it from resizing as a phone's address bar slides away. */
.watch video,
.watch .poster {
  display: block;
  width: 100%;
  max-width: 1280px;
  height: auto;
  max-height: 80vh;
  max-height: 80svh;
  object-fit: contain;
  background: #000;
  border-radius: var(--radius);
}
.description {
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  white-space: pre-line;
}
.back { margin-top: 16px; }

/* Forms and lists on the join and Friends pages. */
button, input, select, textarea { font: inherit; color: inherit; }
button {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 20px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
}
input, select, textarea {
  max-width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); font-weight: 600; }
