@font-face {
  font-family: Carlito;
  src: url("/fonts/Carlito-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Carlito;
  src: url("/fonts/Carlito-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #070708;
  --rail: #0b0b0d;
  --surface: #16161a;
  --surface-2: #1c1c21;
  --line: #2c2c33;
  --text: #f4f4f5;
  --muted: #9b9ba4;
  --gold: #f5c518;
  --ink: #1a1403;
  --danger: #f0a8a8;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: Carlito, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.6; cursor: default; }
img { max-width: 100%; display: block; }
#app { min-height: 100vh; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 40px;
  background: #000;
}
.gate h1 { margin: 0 0 36px; font-size: 28px; font-weight: 700; letter-spacing: 0.01em; }
.users {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 28px;
  justify-content: center;
  max-width: 760px;
}
.user-card, .add-card {
  width: 132px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: center;
}
.user-card img, .add-mark {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  background: #1a1a1e;
  box-shadow: var(--shadow);
}
.add-mark {
  display: grid;
  place-items: center;
  border: 2px dashed #3a3a42;
  color: var(--gold);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}
.user-card strong, .add-card strong { display: block; font-size: 16px; font-weight: 700; }
.user-card span, .add-card span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.user-card.active img { box-shadow: 0 0 0 3px var(--gold); }

.panel {
  width: min(460px, 100%);
  background: var(--surface);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
}
.panel h1, .panel h2 { margin: 0 0 6px; font-size: 22px; }
.panel .lead { margin: 0 0 8px; color: var(--muted); }
label { display: block; margin: 14px 0 6px; color: #d4d4d8; font-size: 14px; }
input, select {
  width: 100%;
  background: #0e0e11;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px;
}
.avatars { display: flex; gap: 8px; margin-top: 8px; }
.avatars button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: transparent;
}
.avatars button.on { border-color: var(--gold); }
.avatars img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.gold, .chip.on {
  background: var(--gold);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
}
.gold.block { width: 100%; margin-top: 18px; }
.ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
}
.row-actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.err { color: var(--danger); min-height: 1.2em; margin: 10px 0 0; }
.back {
  align-self: flex-start;
  background: none;
  border: 0;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 18px;
  padding: 8px 0;
}

.shell { display: flex; min-height: 100vh; }
.rail {
  width: 84px;
  flex: none;
  background: var(--rail);
  border-right: 1px solid #16161a;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 0 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.rail .who {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  margin-bottom: 10px;
}
.rail .who img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.rail button.nav {
  width: 52px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #f2f2f3;
  display: grid;
  place-items: center;
}
.rail button.nav svg { width: 24px; height: 24px; }
.rail button.nav.on { color: var(--gold); }
.main { flex: 1; min-width: 0; padding: 22px 28px 64px; }
.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.top h1 { margin: 0; font-size: 28px; font-weight: 700; }
.tabs { display: flex; gap: 22px; flex-wrap: wrap; }
.tabs button {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 8px 0 10px;
  font-weight: 700;
  font-size: 16px;
}
.tabs button.on { color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }

.section { margin: 22px 0 8px; }
.section h2 { margin: 0 0 14px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.scroller {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
}
.scroller::-webkit-scrollbar { height: 8px; }
.scroller::-webkit-scrollbar-thumb { background: #2a2a30; border-radius: 99px; }

.poster, .wide {
  flex: none;
  width: 158px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  scroll-snap-align: start;
}
.poster .art, .wide .art, .logo, .hero-art {
  background: #1a1a1f center/cover no-repeat;
}
.poster .art {
  position: relative;
  width: 158px;
  height: 236px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.poster strong, .wide strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster em, .wide em {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 4px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.bar i { display: block; height: 100%; background: var(--gold); }
.wide { width: 248px; }
.wide .art {
  width: 248px;
  height: 140px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  position: relative;
}
.wide .art span {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-weight: 700;
  text-shadow: 0 1px 6px #000;
}
@media (hover: hover) and (pointer: fine) {
  .poster, .wide, .sport-card, .guide-row, .setting, .ep { transition: transform 0.18s ease; }
  .poster:hover, .wide:hover { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .poster, .wide, .sport-card, .guide-row, .setting, .ep { transition: none; }
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0 16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  background: #1a1a1f;
  color: #eee;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
}
.chip.on { background: var(--gold); color: var(--ink); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 18px 12px;
}
.grid .poster { width: auto; }
.grid .poster .art { width: 100%; height: auto; aspect-ratio: 2 / 3; }
.pager { display: flex; gap: 10px; align-items: center; margin: 18px 0; color: var(--muted); }
.empty { color: var(--muted); margin: 8px 0 18px; }
.kicker {
  margin: 4px 0 0;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

.detail {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 28px;
  margin-top: 12px;
}
.hero-art {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.crumbs { color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.detail h2 { margin: 8px 0 10px; font-size: 36px; line-height: 1.1; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pills span {
  background: #1a1a1f;
  border-radius: 999px;
  padding: 4px 10px;
  color: #ddd;
  font-size: 13px;
}
.plot { margin: 0 0 8px; color: #d7d7dc; max-width: 62ch; }
.cast { margin: 0 0 14px; color: var(--muted); }
.season {
  margin: 8px 0 14px;
  max-width: 280px;
  background: #121216;
}
.eps { display: flex; flex-direction: column; gap: 10px; }
.ep {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 0;
  border-radius: 14px;
  padding: 10px;
}
.ep .thumb {
  width: 112px;
  height: 68px;
  border-radius: 8px;
  background: #111 center/cover no-repeat;
}
.ep strong { display: block; }
.ep em { display: block; color: var(--muted); font-style: normal; font-size: 14px; }
.play {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--gold);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.play svg { width: 16px; height: 16px; margin-left: 2px; }

.guide { display: flex; flex-direction: column; gap: 8px; }
.guide-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr 1fr;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.guide-row .ch, .slot {
  background: var(--surface);
  border-radius: 12px;
  min-height: 72px;
  padding: 10px 12px;
}
.guide-row .ch { display: flex; gap: 10px; align-items: center; }
.logo {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  flex: none;
}
.guide-row .ch em, .slot em { color: var(--muted); font-style: normal; font-size: 12px; }
.slot { display: flex; flex-direction: column; justify-content: center; }
.slot strong, .guide-row .ch strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.team-line form { display: flex; gap: 8px; }
.team-line input { width: 180px; padding: 9px 12px; }
.sport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.sport-card {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  padding: 14px;
}
.sport-card .mark {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #111 center/cover no-repeat;
  flex: none;
}
.sport-card strong { display: block; color: var(--text); font-size: 15px; line-height: 1.35; }
.sport-card .sport-copy { min-width: 0; }
.sport-card span { color: var(--muted); font-size: 13px; }

.settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}
.setting {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  background: var(--surface);
  border: 0;
  border-radius: 18px;
  padding: 16px;
  min-height: 92px;
}
.setting .ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #2a2412;
  color: var(--gold);
  display: grid;
  place-items: center;
  flex: none;
}
.setting .ico svg { width: 22px; height: 22px; }
.setting strong { display: block; font-size: 16px; }
.setting em { display: block; margin-top: 3px; color: var(--muted); font-style: normal; font-size: 14px; }
.note {
  margin-top: 18px;
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  max-width: 640px;
}
.note p { margin: 8px 0 0; color: var(--muted); }

.player {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  padding: 16px 18px 24px;
}
.player header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.player header strong { font-size: 18px; }
.player video, .slate {
  width: min(1100px, 100%);
  margin: 0 auto;
  background: #000;
  max-height: calc(100vh - 110px);
}
.slate {
  min-height: 280px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: #111 center/cover no-repeat;
}
.slate p {
  background: rgba(0, 0, 0, 0.72);
  border-radius: 12px;
  padding: 14px 16px;
  max-width: 420px;
}

.search {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}
.search input { max-width: 520px; }

@media (max-width: 800px) {
  .shell { display: block; min-height: 100vh; }
  .rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 64px;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-top: 1px solid #1c1c22;
    z-index: 6;
    padding: 6px 4px;
    gap: 2px;
  }
  .rail .who { margin: 0; width: 36px; height: 36px; }
  .rail .who img { width: 36px; height: 36px; }
  .rail button.nav { width: 40px; height: 44px; flex: none; }
  .main { padding: 16px 14px 88px; }
  .top { flex-direction: column; align-items: flex-start; }
  .top h1, .section h2, .gate h1 { font-size: 24px; }
  .detail { grid-template-columns: 1fr; }
  .hero-art { max-width: 220px; }
  .settings, .guide-row { grid-template-columns: 1fr; }
  .ep { grid-template-columns: 84px minmax(0, 1fr); }
  .ep .play { display: none; }
  .users { max-width: 320px; }
  .poster { width: 132px; }
  .poster .art { width: 132px; height: 198px; }
  .sport-card .play { margin-left: auto; }
}
