
:root {
  /* Black backgrounds */
  --bg: #111111;
  --surface: #1c1c1c;
  --raise: #292929;
  --line: #414141;

  /* White and grey text */
  --text: #ffffff;
  --muted: #b8b8b8;

  /* Gold accent */
  --accent: #d6aa45;
  --accent-ink: #111111;

  /* Status colors */
  --ok: #72c99b;
  --bad: #ed8278;

  /* Typography */
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

a {
  color: inherit;
}

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;
  font-weight: 650;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1em;
}

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

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

/* ---- TOP NAVIGATION ---- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}

.brand {
  font: 700 1.4rem var(--display);
  text-decoration: none;
  letter-spacing: -.02em;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  margin-right: .45em;
  vertical-align: -.28em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Crect x='30' y='121' width='226' height='270' fill='%23FD6318'/%3E%3Crect x='256' y='121' width='226' height='270' fill='%23F23800'/%3E%3Crect x='0' y='31' width='256' height='90' fill='%233F4A85'/%3E%3Crect x='256' y='31' width='256' height='90' fill='%23273066'/%3E%3Crect x='0' y='391' width='256' height='90' fill='%233F4A85'/%3E%3Crect x='256' y='391' width='256' height='90' fill='%23273066'/%3E%3Cg fill='%23E1E7F7'%3E%3Crect x='30' y='61' width='51' height='30'/%3E%3Crect x='110' y='61' width='51' height='30'/%3E%3Crect x='191' y='61' width='51' height='30'/%3E%3Crect x='30' y='421' width='51' height='30'/%3E%3Crect x='110' y='421' width='51' height='30'/%3E%3Crect x='191' y='421' width='51' height='30'/%3E%3C/g%3E%3Cg fill='%23C9CEE3'%3E%3Crect x='271' y='61' width='51' height='30'/%3E%3Crect x='351' y='61' width='51' height='30'/%3E%3Crect x='431' y='61' width='51' height='30'/%3E%3Crect x='271' y='421' width='51' height='30'/%3E%3Crect x='351' y='421' width='51' height='30'/%3E%3Crect x='431' y='421' width='51' height='30'/%3E%3C/g%3E%3Cpolygon points='211,168 211,344 256,314 256,198' fill='%23EFF5FD'/%3E%3Cpolygon points='256,198 256,314 343,256' fill='%23DEE4F3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.top nav {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.top nav a {
  text-decoration: none;
  color: var(--muted);
}

.top nav a:hover {
  color: var(--accent);
}

.top nav a.btn {
  color: var(--accent-ink);
}

form.inline {
  display: inline;
  margin: 0;
}

button.link {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

button.link:hover {
  color: var(--accent);
}

/* ---- BUTTONS ---- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 8px;
  padding: 11px 20px;
  font: 600 1rem var(--body);
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  filter: brightness(1.12);
}

.btn.small {
  padding: 7px 14px;
  font-size: .9rem;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn.ghost:hover {
  background: var(--raise);
  border-color: var(--accent);
}

.btn.danger {
  background: var(--bad);
  color: #2e0d05;
}

.btn:disabled {
  opacity: .6;
  cursor: wait;
}

/* ---- NOTIFICATIONS ---- */

.flash {
  list-style: none;
  padding: 0 20px;
  max-width: 1180px;
  margin: 14px auto 0;
}

.flash li {
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--raise);
  border-left: 4px solid var(--ok);
  margin-bottom: 8px;
}

.flash li.error {
  border-color: var(--bad);
}

/* ---- FORMS ---- */

input,
select,
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
}

input[type=checkbox] {
  width: auto;
  accent-color: var(--accent);
}

input[type=file] {
  padding: 9px;
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
}

.field {
  margin-bottom: 18px;
}

.field .help {
  color: var(--muted);
  font-size: .88rem;
  margin: 4px 0 0;
}

.field .err {
  color: var(--bad);
  font-size: .92rem;
  margin: 4px 0 0;
}

.field.check label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 500;
}

/* ---- PANELS ---- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

.narrow {
  max-width: 520px;
  margin: 24px auto;
}

/* ---- HERO SECTION ---- */

.hero {
  padding: 28px 0 26px;
  max-width: 760px;
}

.hero p {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 56ch;
}

/* ---- SEARCH ---- */

.search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 34px;
}

.search input {
  flex: 1 1 240px;
  width: auto;
}

.search select {
  flex: 0 0 auto;
  width: auto;
}

/* ---- GRID AND CARDS ---- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px;
}

.card {
  text-decoration: none;
  display: block;
}

.poster {
  aspect-ratio: 2/3;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--raise), var(--surface));
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  position: relative;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster .initial {
  font: 700 4.5rem var(--display);
  color: var(--accent);
}

.card:hover .poster {
  border-color: var(--accent);
}

.price-tag {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: .85rem;
  padding: 3px 9px;
  border-radius: 99px;
}

.price-tag.owned {
  background: var(--ok);
}

.card h3 {
  margin: 10px 0 2px;
}

.card .meta {
  color: var(--muted);
  font-size: .9rem;
  display: flex;
  gap: 12px;
}

.section-title {
  margin: 40px 0 16px;
}

.empty {
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---- VIDEO PLAYER ---- */

.stage {
  max-width: 980px;
  margin: 0 auto;
}

.player {
  position: relative;
  background: #000;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.player video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

/* ---- ACCESS GATE ---- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 6, 6, .88);
  display: flex;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.gate[hidden] {
  display: none;
}

.gate-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 28px 22px 18px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  outline: 0;
  animation: pop .18s ease-out;
}

.gate h2 {
  font-size: 1.6rem;
  padding: 0 28px;
}

.gate .field {
  text-align: left;
}

.gate input {
  font-size: 16px;
  padding: 14px 12px;
}

.gate .pay-btn {
  width: 100%;
  padding: 15px 20px;
  font-size: 1.05rem;
  min-height: 52px;
}

.gate .status {
  min-height: 1.5em;
  margin: 12px 0 0;
  font-size: .95rem;
}

.gate .status.bad {
  color: var(--bad);
}

.gate-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.gate-close:hover {
  background: var(--raise);
  color: var(--accent);
}

.link-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 12px;
  text-decoration: underline;
}

body.modal-open {
  overflow: hidden;
}

/* ---- ANIMATIONS ---- */

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sheet {
  from {
    transform: translateY(100%);
  }

  to {
    transform: none;
  }
}

/* ---- MOBILE ACCESS GATE ---- */

@media (max-width: 600px) {
  .gate {
    padding: 0;
    align-items: flex-end;
  }

  .gate-box {
    max-width: none;
    margin: 0;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    padding: 26px 18px calc(14px + env(safe-area-inset-bottom));
    max-height: 100%;
    max-height: 100dvh;
    overflow-y: auto;
    animation: sheet .22s ease-out;
  }

  .gate-box::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 2px;
    background: var(--accent);
  }
}

/* ---- SHORT SCREENS ---- */

@media (max-height: 520px) {
  .gate-box {
    padding-top: 18px;
  }

  .gate h2 {
    font-size: 1.25rem;
    margin-bottom: .3em;
  }

  .gate .muted {
    margin-bottom: .6em;
    font-size: .9rem;
  }

  .gate .field {
    margin-bottom: 10px;
  }
}

/* ---- VIDEO TIMELINE ---- */

.timeline {
  position: relative;
  height: 10px;
  border-radius: 0 0 12px 12px;
  background: repeating-linear-gradient(
    135deg,
    var(--line) 0 5px,
    var(--surface) 5px 10px
  );
}

.timeline .free {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent);
  border-bottom-left-radius: 12px;
}

.timeline.open .free {
  background: var(--ok);
  width: 100% !important;
  border-bottom-right-radius: 12px;
}

.timeline .head {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  background: var(--text);
  border-radius: 2px;
  left: 0;
}

.tl-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: .9rem;
  margin: 10px 2px 26px;
  flex-wrap: wrap;
}

.tl-label strong {
  color: var(--text);
}

/* ---- CHIPS ---- */

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 12px;
  font-size: .88rem;
  color: var(--muted);
}

/* ---- DASHBOARD ---- */

.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.dash-head h1 {
  font-size: 2.2rem;
  margin: 0;
}

/* ---- TABS ---- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.tabs a {
  padding: 10px 16px;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.tabs a.on {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- STATISTICS ---- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}

.stat b {
  display: block;
  font: 700 1.7rem var(--display);
}

.stat span {
  color: var(--muted);
  font-size: .9rem;
}

.stat.lead {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.stat.lead span {
  color: #3d2b08;
}

/* ---- TABLES ---- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 30px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-weight: 600;
  color: var(--muted);
  font-size: .9rem;
  background: var(--surface);
}

tr:last-child td {
  border-bottom: 0;
}

td.num,
th.num {
  text-align: right;
}

/* ---- THUMBNAILS AND BADGES ---- */

.thumb {
  width: 44px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--raise);
  display: block;
}

.row-title {
  display: flex;
  gap: 14px;
  align-items: center;
}

.badge {
  font-size: .82rem;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--raise);
  white-space: nowrap;
}

.badge.ok {
  background: rgba(114, 201, 155, .18);
  color: var(--ok);
}

.badge.bad {
  background: rgba(237, 130, 120, .18);
  color: var(--bad);
}

.badge.wait {
  background: rgba(214, 170, 69, .18);
  color: var(--accent);
}

/* ---- ACTIONS ---- */

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

/* ---- PROGRESS ---- */

.progress {
  height: 8px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 14px;
  display: none;
}

.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s;
}

/* ---- FOOTER ---- */

footer {
  border-top: 1px solid var(--line);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}

/* ---- CATALOGUE SECTIONS ---- */

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px;
  margin: 0 0 26px;
}

.seg a {
  padding: 9px 26px;
  border-radius: 99px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

.seg a.on {
  background: var(--accent);
  color: var(--accent-ink);
}

.jump {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 4px;
}

.jump .chip {
  text-decoration: none;
}

.jump .chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 34px 0 14px;
  flex-wrap: wrap;
}

.row-head h2 {
  margin: 0;
}

/* ---- HORIZONTAL RAIL ---- */

.rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  margin: 0 -20px;
  padding: 0 20px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.rail .card {
  flex: 0 0 150px;
  scroll-snap-align: start;
}

@media (min-width: 700px) {
  .rail .card {
    flex-basis: 190px;
  }
}

.section-title {
  scroll-margin-top: 80px;
}

.row {
  scroll-margin-top: 80px;
}

.vj-line {
  font-size: .85rem;
  color: var(--accent);
  margin-top: 2px;
}

.kind-tag {
  position: absolute;
  left: 8px;
  top: 8px;
  background: rgba(9, 9, 9, .88);
  border: 1px solid var(--line);
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
}

.vj-chip {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ---- PAGINATION ---- */

.pager {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin: 26px 0 0;
  flex-wrap: wrap;
}

/* ---- SERIES ---- */

.series-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 10px;
}

.series-poster {
  width: 200px;
}

@media (max-width: 640px) {
  .series-head {
    grid-template-columns: 1fr;
  }

  .series-poster {
    width: 150px;
  }
}

/* ---- EPISODE LIST ---- */

.ep-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.ep-list li + li {
  border-top: 1px solid var(--line);
}

.ep-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  text-decoration: none;
  background: var(--surface);
}

.ep-list a:hover {
  background: var(--raise);
}

.ep-num {
  font: 700 1.3rem var(--display);
  color: var(--accent);
  width: 2ch;
  text-align: center;
}

.ep-main {
  flex: 1;
}

.price-pill {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: .85rem;
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ---- ROW ARROWS ---- */

.rail-wrap {
  position: relative;
}

.rail-btn {
  position: absolute;
  top: 112px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, .92);
  color: var(--text);
  font: 400 1.7rem/1 var(--body);
  padding: 0 0 3px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}

.rail-btn[hidden] {
  display: none;
}

.rail-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.rail-btn.prev {
  left: 2px;
}

.rail-btn.next {
  right: 2px;
}

@media (min-width: 700px) {
  .rail-btn {
    top: 142px;
    width: 46px;
    height: 46px;
    font-size: 2rem;
  }

  .rail-btn.prev {
    left: -8px;
  }

  .rail-btn.next {
    right: -8px;
  }
}

/* ---- REDUCED MOTION ---- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}


