/* ReelShort clone -- design tokens lifted from reelshort.com's own CSS */
:root {
  --bg-1: #0b0b0d;
  --bg-2: #1c1c1e;
  --bg-3: #272729;
  --bg-4: #313133;
  --brand: #ca1c1c;
  --brand-hover: #de3434;
  --gold: #e5a800;
  --text-1: rgba(255, 255, 255, 0.84);
  --text-2: rgba(255, 255, 255, 0.5);
  --text-3: rgba(255, 255, 255, 0.3);
  --line: rgba(255, 255, 255, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --nav-h: 64px;
  --font: "Noto Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-1);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body { padding-top: var(--nav-h); }
body.player-open { padding-top: 0; overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- header ---------------- */
.header {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 60;
  display: flex; align-items: center; gap: 28px; padding: 0 32px;
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header__logo { height: 20px; width: auto; }
.header__nav { display: flex; gap: 24px; align-items: center; }
.header__link {
  font-size: 14px; font-weight: 500; color: var(--text-2);
  padding: 6px 0; transition: color 0.15s;
}
.header__link:hover, .header__link.active { color: #fff; }
.header__right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-1);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg-3); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn-topup {
  background: var(--gold); color: #000; font-weight: 700; font-size: 13px;
  padding: 8px 18px; border-radius: 999px;
}
.btn-topup:hover { filter: brightness(1.1); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #7a1010);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}

/* ---------------- hero ---------------- */
.hero { position: relative; height: 460px; overflow: hidden; }
.hero__slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s;
  pointer-events: none;
}
.hero__slide.active { opacity: 1; pointer-events: auto; }
.hero__img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,11,13,.96) 0%, rgba(11,11,13,.75) 38%, transparent 72%),
              linear-gradient(0deg, var(--bg-1) 0%, transparent 45%);
}
.hero__body {
  position: absolute; left: 64px; bottom: 64px; max-width: 520px; z-index: 2;
}
.hero__title { font-size: 40px; font-weight: 700; line-height: 1.1; margin-bottom: 14px; }
.hero__tags { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.hero__desc {
  color: var(--text-2); font-size: 14px; line-height: 1.5; margin-bottom: 24px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.btn-play {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: #000; font-weight: 700; font-size: 15px;
  padding: 13px 32px; border-radius: 999px; transition: transform 0.15s;
}
.btn-play:hover { transform: scale(1.04); }
.btn-play svg { width: 18px; height: 18px; fill: var(--brand); }
.hero__dots {
  position: absolute; bottom: 24px; left: 64px; display: flex; gap: 8px; z-index: 3;
}
.hero__dot {
  width: 24px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.25);
  transition: background 0.2s;
}
.hero__dot.active { background: #fff; }
.hero__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,.5); display: grid; place-items: center;
  opacity: 0; transition: opacity 0.2s;
}
.hero:hover .hero__arrow { opacity: 1; }
.hero__arrow--prev { left: 20px; }
.hero__arrow--next { right: 20px; }
.hero__arrow svg { width: 20px; height: 20px; fill: #fff; }

/* ---------------- shelves ---------------- */
.main { padding: 0 0 80px; }
.shelf { margin-top: 40px; }
.shelf__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; margin-bottom: 16px;
}
.shelf__title {
  font-size: 20px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.shelf__title:hover { color: #fff; }
.shelf__title svg { width: 16px; height: 16px; fill: var(--text-2); }
.shelf__next {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2);
}
.shelf__next:hover { color: #fff; }
.shelf__next svg { width: 14px; height: 14px; fill: currentColor; }
.shelf__row {
  display: flex; gap: 14px; overflow-x: auto; padding: 0 32px 8px;
  scroll-behavior: smooth; scrollbar-width: none;
}
.shelf__row::-webkit-scrollbar { display: none; }

/* ---------------- card ---------------- */
.card { flex: 0 0 152px; width: 152px; cursor: pointer; }
.card__poster {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-3); margin-bottom: 8px;
}
.card__poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.card:hover .card__poster img { transform: scale(1.06); }
.card__badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 4px;
  background: var(--brand); color: #fff; letter-spacing: .3px;
}
.card__badge--gold { background: var(--gold); color: #000; }
.card__badge--dark { background: rgba(0,0,0,.7); color: #fff; }
.card__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.28); opacity: 0; transition: opacity 0.2s;
}
.card:hover .card__play { opacity: 1; }
.card__play svg { width: 40px; height: 40px; fill: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.card__title {
  font-size: 13px; font-weight: 500; line-height: 1.35; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__meta { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.card__meta svg { width: 11px; height: 11px; fill: currentColor; }

/* ---------------- chips / tags ---------------- */
.chip {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: var(--text-1); white-space: nowrap;
}
.chip--brand { background: rgba(202,28,28,.18); color: #ff6b6b; }
.chip--gold { background: rgba(229,168,0,.18); color: var(--gold); }

/* ---------------- detail ---------------- */
.detail { position: relative; min-height: 100vh; }
.detail__bg { position: absolute; inset: 0 0 auto 0; height: 520px; overflow: hidden; }
.detail__bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(28px) brightness(.5); transform: scale(1.15); }
.detail__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--bg-1) 4%, transparent 90%);
}
.detail__inner { position: relative; padding: 48px 64px 80px; display: flex; gap: 36px; }
.detail__poster {
  flex: 0 0 240px; width: 240px; aspect-ratio: 3 / 4; border-radius: var(--radius-lg);
  object-fit: cover; box-shadow: 0 16px 48px rgba(0,0,0,.6);
}
.detail__body { flex: 1; padding-top: 8px; max-width: 760px; }
.detail__title { font-size: 36px; font-weight: 700; line-height: 1.15; margin-bottom: 14px; }
.detail__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.detail__stats { display: flex; gap: 22px; color: var(--text-2); font-size: 13px; margin-bottom: 22px; }
.detail__stats b { color: var(--text-1); }
.detail__desc { color: var(--text-2); line-height: 1.65; margin-bottom: 28px; white-space: pre-line; }
.detail__actions { display: flex; gap: 12px; margin-bottom: 40px; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 12px 22px;
  font-weight: 600; font-size: 14px; color: var(--text-1);
}
.btn-ghost:hover { background: var(--bg-3); }
.btn-ghost svg { width: 16px; height: 16px; fill: currentColor; }

.episodes { position: relative; padding: 0 64px 80px; }
.episodes__head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px;
  border-top: 1px solid var(--line); padding-top: 28px;
}
.episodes__title { font-size: 20px; font-weight: 700; }
.episodes__count { font-size: 13px; color: var(--text-3); }
.episodes__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px;
}
.ep {
  display: flex; gap: 10px; padding: 8px; border-radius: var(--radius);
  background: var(--bg-2); cursor: pointer; transition: background 0.15s;
  border: 1px solid transparent;
}
.ep:hover { background: var(--bg-3); border-color: var(--line); }
.ep__thumb {
  position: relative; flex: 0 0 64px; width: 64px; aspect-ratio: 9 / 16;
  border-radius: 5px; overflow: hidden; background: var(--bg-4);
}
.ep__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep__info { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.ep__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep__dur { font-size: 11px; color: var(--text-3); }
.ep__lock {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px;
  background: rgba(229,168,0,.16); color: var(--gold); width: fit-content;
}
.ep__lock--free { background: rgba(60,200,120,.15); color: #4ade80; }

/* ---------------- player ---------------- */
.player {
  position: fixed; inset: 0; z-index: 200; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.player__stage { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; background: #000; }
.player__video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player__ui { position: absolute; inset: 0; pointer-events: none; }
.player__ui > * { pointer-events: auto; }
.player__top {
  position: absolute; inset: 0 0 auto 0; padding: 16px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(0deg, transparent, rgba(0,0,0,.65));
}
.player__back { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.player__back svg { width: 22px; height: 22px; fill: #fff; }
.player__titles { flex: 1; min-width: 0; }
.player__book { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__ep { font-size: 12px; color: var(--text-2); }
.player__rail {
  position: absolute; right: 12px; bottom: 96px; width: 92px; max-height: 52vh;
  overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: none; padding: 4px;
}
.player__rail::-webkit-scrollbar { display: none; }
.player__railitem {
  position: relative; flex: 0 0 auto; aspect-ratio: 9 / 16; border-radius: 6px;
  overflow: hidden; border: 2px solid transparent; opacity: .55; transition: opacity .15s;
}
.player__railitem:hover { opacity: .85; }
.player__railitem.active { border-color: var(--brand); opacity: 1; }
.player__railitem img { width: 100%; height: 100%; object-fit: cover; }
.player__railitem span {
  position: absolute; inset: auto 0 0 0; font-size: 10px; font-weight: 700;
  text-align: center; padding: 3px 0; background: rgba(0,0,0,.7);
}
.player__bottom {
  position: absolute; inset: auto 0 0 0; padding: 12px 16px 18px;
  background: linear-gradient(0deg, rgba(0,0,0,.8), transparent);
}
.player__bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.25); margin-bottom: 12px; overflow: hidden; }
.player__fill { height: 100%; width: 0; background: var(--brand); }
.player__controls { display: flex; align-items: center; gap: 14px; }
.player__controls .spacer { flex: 1; }
.player__btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.45); }
.player__btn svg { width: 18px; height: 18px; fill: #fff; }
.player__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.4);
  display: grid; place-items: center;
}
.player__nav svg { width: 18px; height: 18px; fill: #fff; }
.player__nav--prev { left: -52px; }
.player__nav--next { right: 108px; }
.player__spinner {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.4);
}
.player__spinner::after {
  content: ""; width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.2); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player__swipe {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.player__swipe.show { opacity: 1; }
.player__swipe span { background: rgba(0,0,0,.6); padding: 8px 16px; border-radius: 999px; font-size: 13px; }

/* ---------------- grid page ---------------- */
.page { padding: 32px 32px 80px; }
.page__title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.page__sub { color: var(--text-3); font-size: 13px; margin-bottom: 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 20px 14px; }
.grid .card { flex: none; width: auto; }

.searchbox {
  display: flex; align-items: center; gap: 10px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 12px 20px;
  margin-bottom: 28px; max-width: 560px;
}
.searchbox svg { width: 18px; height: 18px; fill: var(--text-2); flex: 0 0 auto; }
.searchbox input {
  flex: 1; background: none; border: 0; outline: 0; color: var(--text-1);
  font-size: 15px; font-family: inherit;
}

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pager button {
  min-width: 38px; height: 38px; border-radius: var(--radius); background: var(--bg-2);
  font-size: 13px; padding: 0 12px;
}
.pager button:hover { background: var(--bg-3); }
.pager button.active { background: var(--brand); font-weight: 700; }
.pager button:disabled { opacity: .35; cursor: default; }

.cat { margin-bottom: 32px; }
.cat__name { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.cat__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.cat__tag {
  padding: 8px 16px; border-radius: 999px; background: var(--bg-2);
  font-size: 13px; border: 1px solid var(--line);
}
.cat__tag:hover { background: var(--bg-3); }

/* ---------------- misc ---------------- */
.skel { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%; animation: sh 1.2s linear infinite; border-radius: var(--radius); }
@keyframes sh { to { background-position: -200% 0; } }
.skel--card { aspect-ratio: 3 / 4; }
.empty { text-align: center; padding: 80px 20px; color: var(--text-3); }
.empty svg { width: 48px; height: 48px; fill: var(--text-3); margin-bottom: 16px; }
.toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  background: var(--bg-4); padding: 10px 20px; border-radius: 999px;
  font-size: 13px; z-index: 300; opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }

.bottomnav { display: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  body { padding-top: 56px; }
  .header { height: 56px; padding: 0 16px; gap: 12px; }
  .header__nav, .header__right .btn-topup, .header__right .icon-btn.hide-m { display: none; }
  .header__logo { height: 17px; }
  .hero { height: 380px; }
  .hero__body { left: 16px; right: 16px; bottom: 40px; max-width: none; }
  .hero__title { font-size: 26px; }
  .hero__desc { font-size: 13px; -webkit-line-clamp: 2; }
  .hero__dots { left: 16px; }
  .hero__arrow { display: none; }
  .shelf__head { padding: 0 16px; }
  .shelf__row { padding: 0 16px; gap: 10px; }
  .shelf__title { font-size: 17px; }
  .card { flex: 0 0 116px; width: 116px; }
  .detail__inner { flex-direction: column; padding: 24px 16px 32px; gap: 20px; }
  .detail__poster { flex: none; width: 140px; }
  .detail__title { font-size: 24px; }
  .detail__bg { height: 380px; }
  .episodes { padding: 0 16px 90px; }
  .episodes__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .page { padding: 20px 16px 90px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
  .player__stage { width: 100%; height: 100%; aspect-ratio: auto; }
  .player__nav { display: none; }
  .player__rail { right: 8px; bottom: 84px; width: 68px; }
  .bottomnav {
    display: flex; position: fixed; inset: auto 0 0 0; height: 56px; z-index: 70;
    background: rgba(11,11,13,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; font-size: 10px; color: var(--text-3);
  }
  .bottomnav a.active { color: #fff; }
  .bottomnav svg { width: 20px; height: 20px; fill: currentColor; }
  body.player-open .bottomnav { display: none; }
  .main { padding-bottom: 70px; }
}
