:root {
  --bg: #08090b;
  --bg-soft: #0e1014;
  --panel: #13161b;
  --panel-hover: #1a1f27;
  --panel-light: #222832;
  --line: #2a3039;

  --red: #e50914;
  --red-hover: #ff1b26;
  --red-dark: #a80710;
  --red-soft: rgba(229, 9, 20, 0.12);
  --cyan: #44d7c7;
  --amber: #f4b84a;

  --text: #f5f5f5;
  --text-soft: #d8dee8;
  --muted: #929aa8;
  --muted-dark: #687180;

  --sidebar: 210px;
  --header: 66px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(68, 215, 199, 0.05), transparent 280px),
    radial-gradient(circle at 72% -18%, rgba(229, 9, 20, 0.12), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

body,
button,
input {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

.hidden {
  display: none !important;
}

.age-locked {
  overflow: hidden;
}

/* =========================
   AGE GATE
   ========================= */

/* Reset the browser's built-in <dialog> styling (border, centering via
   absolute positioning, background, etc). #ageGate (ID) is used here
   instead of .age-gate so this always outranks the UA stylesheet
   regardless of browser. */
#ageGate {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;

  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 24px;

  color: inherit;
  background:
    radial-gradient(circle at 50% 8%, rgba(229, 9, 20, 0.2), transparent 34%),
    rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

#ageGate:not([open]) {
  display: none;
}

.age-gate-card {
  width: min(460px, 100%);
  padding: 42px 36px;

  text-align: center;

  background: #0f1217;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 12px;

  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.85),
    0 0 50px rgba(229, 9, 20, 0.12);
}

.age-gate-logo {
  color: var(--red);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 16px;
}

.age-gate-brand {
  margin-bottom: 32px;

  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 4px;
}

.age-gate-card h2 {
  margin: 0 0 18px;

  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
}

.age-gate-card p {
  margin: 9px 0;

  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.age-gate-card button {
  width: 100%;
  margin-top: 26px;
  padding: 14px 18px;

  border: 0;
  border-radius: 6px;

  background: var(--red);
  color: #fff;

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;

  cursor: pointer;

  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.age-gate-card button:hover {
  background: var(--red-hover);
  box-shadow: 0 0 24px rgba(229, 9, 20, 0.25);
}

.age-gate-card button:active {
  transform: translateY(1px);
}

/* =========================
   TOP BAR
   ========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;

  height: var(--header);

  display: flex;
  align-items: center;
  gap: 18px;

  padding: 0 22px;

  background: rgba(8, 9, 11, 0.92);
  border-bottom: 1px solid var(--line);

  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 190px;

  color: #fff;

  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.brand-mark {
  display: grid;
  place-items: center;

  width: 31px;
  height: 23px;

  border-radius: 5px;

  background: linear-gradient(135deg, var(--red), #ff4d54);

  color: #fff;
  font-size: 11px;

  box-shadow: 0 0 18px rgba(229, 9, 20, 0.18);
}

.search {
  display: flex;
  flex: 1;

  width: 100%;
  max-width: 760px;
  height: 42px;

  margin: auto;
}

.search input {
  flex: 1;
  min-width: 0;

  padding: 0 15px;

  border: 1px solid #303846;
  border-right: 0;
  border-radius: 6px 0 0 6px;

  outline: none;

  background: #0d1015;
  color: var(--text);

  font-size: 13px;
}

.search input::placeholder {
  color: var(--muted-dark);
}

.search input:focus {
  border-color: var(--red);
}

.search button {
  padding: 0 17px;

  border: 1px solid var(--line);
  border-radius: 0 6px 6px 0;

  background: #1b2028;

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.search button:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.icon-button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  padding: 7px;

  background: transparent;

  font-size: 20px;
}

.mobile-only {
  display: none;
}

/* =========================
   LAYOUT
   ========================= */

.app-shell {
  display: flex;
}

.sidebar {
  position: sticky;
  top: var(--header);

  width: var(--sidebar);
  height: calc(100vh - var(--header));

  flex: 0 0 var(--sidebar);

  padding: 18px 10px;

  background: rgba(9, 11, 14, 0.84);
  border-right: 1px solid var(--line);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;

  margin: 2px 0;
  padding: 11px 12px;

  border-radius: 6px;

  color: #b5bdc9;

  font-size: 13px;
  font-weight: 500;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.nav-item span {
  width: 18px;
  text-align: center;
}

.nav-item:hover {
  background: var(--panel-hover);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, var(--red-soft), rgba(68, 215, 199, 0.05));
  color: #fff;

  border-left: 2px solid var(--red);

  padding-left: 10px;
}

.nav-divider {
  height: 1px;

  margin: 16px 8px;

  background: var(--line);
}

.nav-heading {
  padding: 0 12px 7px;

  color: var(--muted-dark);

  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.content {
  flex: 1;
  min-width: 0;

  padding: 34px clamp(18px, 3vw, 44px) 64px;
}

/* =========================
   SECTION HEADERS
   ========================= */

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;

  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 7px;

  color: var(--cyan);

  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;

  color: #fff;

  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);

  font-size: 12px;
}

/* =========================
   VIDEO GRID
   ========================= */

.video-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fill, minmax(250px, 1fr));

  gap: 28px 20px;
}

.card {
  min-width: 0;

  cursor: pointer;
}

.thumb {
  position: relative;

  aspect-ratio: 16 / 9;

  overflow: hidden;

  border: 1px solid #2c3440;
  border-radius: 8px;

  background: #0b0d11;

  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.thumb video {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  background: #000;
}

.card:hover .thumb {
  border-color: #4b5666;

  transform: translateY(-2px);

  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(229, 9, 20, 0.08);
}

.play {
  position: absolute;
  right: 9px;
  bottom: 9px;

  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;

  border-radius: 6px;

  background: rgba(229, 9, 20, 0.92);

  color: #fff;

  opacity: 0;

  transition: opacity 0.15s ease;
}

.card:hover .play {
  opacity: 1;
}

.duration {
  position: absolute;
  right: 7px;
  bottom: 7px;

  padding: 3px 5px;

  border-radius: 4px;

  background: rgba(0, 0, 0, 0.86);

  color: #fff;

  font-size: 9px;
  font-weight: 600;
}

.card:hover .duration {
  display: none;
}

.card-body {
  padding-top: 12px;
}

.card-title {
  display: -webkit-box;

  overflow: hidden;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  margin: 0 0 5px;

  color: #f2f5f8;

  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.card-meta {
  color: var(--muted);

  font-size: 12px;
  line-height: 1.5;
}

/* =========================
   EMPTY STATE
   ========================= */

.empty {
  padding: 76px 20px;

  text-align: center;

  border: 1px dashed #39414d;
  border-radius: 9px;

  background: rgba(19, 22, 27, 0.72);
}

.empty h2 {
  margin-bottom: 10px;

  font-size: 18px;
}

.empty p {
  color: var(--muted);

  font-size: 13px;
}

code {
  color: var(--amber);

  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* =========================
   WATCH PAGE
   ========================= */

.watch-page {
  max-width: 1540px;

  margin: 0 auto;
}

.watch-layout {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(310px, 380px);

  gap: 28px;
}

.player {
  display: block;

  width: 100%;
  aspect-ratio: 16 / 9;

  background: #000;

  border: 1px solid #303846;
  border-radius: 7px;

  outline: none;
}

.player:focus {
  border-color: var(--red);
}

.watch-title {
  margin: 18px 0 8px;

  color: #fff;

  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0;
}

.watch-stats {
  color: var(--muted);

  font-size: 12px;
}

.rec-title {
  margin: 0 0 16px;

  color: #fff;

  font-size: 16px;
}

.rec-card {
  display: grid;

  grid-template-columns: 148px minmax(0, 1fr);

  gap: 12px;

  margin-bottom: 16px;

  cursor: pointer;
}

.rec-thumb {
  aspect-ratio: 16 / 9;

  overflow: hidden;

  border: 1px solid #2c3440;
  border-radius: 7px;

  background: var(--panel);

  transition: border-color 0.15s ease;
}

.rec-card:hover .rec-thumb {
  border-color: var(--cyan);
}

.rec-thumb video {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}

.rec-name {
  margin: 1px 0 5px;

  color: #edf1f5;

  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

.rec-meta {
  color: var(--muted);

  font-size: 12px;
}

/* =========================
   SCROLLBARS
   ========================= */

* {
  scrollbar-width: thin;
  scrollbar-color: #333 #090909;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #090909;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}

/* =========================
   SELECTION
   ========================= */

::selection {
  background: var(--red);
  color: #fff;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1050px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .recommendations {
    margin-top: 22px;
  }
}

@media (max-width: 760px) {
  :root {
    --header: 58px;
  }

  .topbar {
    gap: 10px;
    padding: 0 12px;
  }

  .mobile-only {
    display: block;
  }

  .brand {
    min-width: auto;
  }

  .brand span:last-child {
    display: none;
  }

  .sidebar {
    position: fixed;

    z-index: 15;

    top: var(--header);
    left: -230px;

    transition: left 0.18s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .content {
    padding: 20px 12px 40px;
  }

  .video-grid {
    grid-template-columns: 1fr;

    gap: 25px;
  }

  .search button {
    width: 44px;

    padding: 0;

    font-size: 0;
  }

  .search button::after {
    content: "⌕";

    font-size: 17px;
  }

  .section-head {
    align-items: flex-start;
  }

  .rec-card {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  #ageGate {
    padding: 16px;
  }

  .age-gate-card {
    padding: 34px 24px;
  }

  .age-gate-brand {
    margin-bottom: 25px;
  }
}

@media (max-width: 430px) {
  .search {
    max-width: none;
  }

  .rec-card {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .age-gate-card {
    padding: 30px 20px;
  }

  .age-gate-card h2 {
    font-size: 22px;
  }
}
