/* Measured from live.fb-lives.com/login */
:root {
  --bg: #1f2c2c;
  --surface: #263636;
  --teal: #187f7e;
  --teal-hover: #1d9493;
  --glow: #10e3fd;
  --black: #000;
  --text: #fff;
  --muted: #b9c6c6;
  --line: rgba(255, 255, 255, 0.12);
  --font: 'Avenir Next', AvenirNext, 'Nunito Sans', 'Cairo', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
}

h1, h2, p { margin: 0; }
h1 { font-size: 22px; font-weight: 500; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.muted { color: var(--muted); }

/* Logo centred on top, as on the live site */
.bar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 4px 16px;
}
.logo { display: block; direction: ltr; }
.logo img { display: block; width: 143px; height: 75px; object-fit: contain; }
.corner {
  position: absolute;
  top: 10px;
  inset-inline-end: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.corner.start { inset-inline-end: auto; inset-inline-start: 16px; }

.link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.link:hover { color: var(--glow); }

.pill {
  display: block;
  width: 100%;
  min-height: 47px;
  padding: 15px 20px;
  border: 0;
  border-radius: 50px;
  background: var(--black);
  color: var(--text);
  font: 600 12px/17px var(--font);
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
.pill:hover { background: #1a1a1a; }
.pill:disabled { opacity: 0.6; cursor: wait; }
.pill.teal { background: var(--teal); }
.pill.teal:hover { background: var(--teal-hover); }

:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }

/* Sign in: the running player behind a teal card */
.login-page { overflow-x: hidden; background: #141414; }
.login-page::before {
  content: '';
  position: fixed;
  top: 83px;
  left: 0;
  width: 100%;
  height: 85vh;
  background: url('https://live.fb-lives.com/img/introvideo.gif') center / 100% 100% no-repeat;
}
/* The dim layer over the page. It also softens the logo, as on the live site. */
.login-page::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(47, 79, 79, 0.4);
  pointer-events: none;
}
.login-page .bar { z-index: auto; }
.login-page .corner { z-index: 2; }
.login-page .foot { z-index: 2; }
.login {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
}
.dialog {
  width: 100%;
  max-width: 546px;
  padding: 30px 30px 26px;
  border-radius: 20px;
  background: var(--teal);
  text-align: center;
}
.dialog p { margin-top: 14px; }
.dialog form { margin: 22px auto 0; max-width: 464px; display: grid; gap: 12px; }
.dialog label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.dialog input {
  width: 100%;
  min-height: 47px;
  padding: 0 20px;
  border: 0;
  border-radius: 50px;
  background: var(--text);
  color: #141414;
  font: 500 15px var(--font);
  text-align: center;
}
.dialog .error {
  margin: 0;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
  font-size: 13px;
}
.dialog .error[hidden] { display: none; }

/* Videos */
.page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  flex: 1;
}
.page > .muted { margin-top: 10px; }
.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface);
}
.media { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--black); }
.media > * { position: absolute; inset: 0; }
.media.whole { aspect-ratio: 1 / 1; }
.media.whole img { object-fit: contain; }
.media > img, .media video, .cover img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.cover {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.cover::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 6.5v11l9-5.5z'/%3E%3C/svg%3E") center / 32px no-repeat;
}
#search {
  display: block;
  width: 100%;
  max-width: 420px;
  min-height: 42px;
  margin-top: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 50px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
#search[hidden] { display: none; }
.card[hidden] { display: none; }
.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 50px;
  background: var(--surface);
}
.tabs button {
  flex: 1;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 50px;
  background: none;
  color: var(--muted);
  font: 600 14px var(--font);
  cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected='true'] { background: var(--teal); color: var(--text); }
.tabs small { font-size: 12px; font-weight: 400; opacity: 0.8; }
.grid[hidden] { display: none; }
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.tools #search { flex: 1 1 240px; margin-top: 0; }
.tools .pill { flex: 0 0 auto; width: auto; min-width: 180px; margin-inline-start: auto; }
.see-more { width: 100%; max-width: 360px; margin: 22px auto 0; }
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 14px;
}
.card-body .pill { margin-top: auto; }
.card-body .pill + .pill { margin-top: 8px; }
.about { font-size: 13px; }
.size { margin-bottom: 12px; font-size: 13px; }
.size:empty { margin-bottom: 8px; }

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 14px;
  padding: 10px 16px;
  color: #ecedec;
  font-size: 11px;
}
.foot a { color: inherit; }
