:root {
  --bg: #14161a;
  --elev: #1c1f27;
  --card: #22252e;
  --line: #2c303a;
  --text: #ebecf0;
  --mute: #9aa0ad;
  --blue: #4d7dff;
  --blue-2: #6b93ff;
  --nav: 64px;
  --top: 72px;
  --grad: linear-gradient(90deg, #ff8465, #ef4f88 50%, #d176ff);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: Inter, system-ui, sans-serif;
  overflow: hidden;
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 78% -12%, rgba(77, 125, 255, 0.2), transparent 58%),
    radial-gradient(720px 420px at -8% 108%, rgba(239, 79, 136, 0.12), transparent 52%),
    radial-gradient(640px 360px at 50% 120%, rgba(209, 118, 255, 0.08), transparent 50%);
}
.haze {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.045;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.35) 2px,
    rgba(255, 255, 255, 0.35) 3px
  );
}

.shell, .tabbar { position: relative; z-index: 1; }
.overlay { position: fixed; z-index: 50; }
.toast { position: fixed; z-index: 60; }

.topbar {
  position: relative;
  z-index: 20;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: none;
  border: 0;
  color: var(--blue);
  font: inherit;
}
.playmark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--grad);
  display: grid;
  place-items: center;
}
.playmark i {
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
  margin-left: 2px;
}
.brand b { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; color: var(--blue); }
.search {
  flex: 1;
  max-width: 720px;
  display: flex;
  align-items: center;
  background: #101217;
  border: 1px solid #2a2e38;
  border-radius: 999px;
  height: 44px;
  padding: 0 6px 0 16px;
}
.search input {
  flex: 1;
  height: 42px;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  outline: none;
}
.search button {
  width: 40px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  font-size: 18px;
}
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang-dd { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px 0 10px;
  border-radius: 12px;
  border: 1px solid #2a2e38;
  background: #101217;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.lang-btn:hover { border-color: #3a4254; }
.lang-btn .flag { font-size: 16px; line-height: 1; }
.lang-btn .chev { color: var(--mute); font-size: 11px; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #1c1f27;
  border: 1px solid #2a2e38;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  z-index: 30;
}
.lang-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.lang-menu li:hover { background: #2a2e38; }
.lang-menu li.on { background: rgba(77,125,255,.18); color: var(--blue-2); }
.lang-menu .code { margin-left: auto; color: var(--mute); font-size: 11px; letter-spacing: 0.08em; }
.signin {
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 0;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.shell {
  height: calc(100% - var(--top) - var(--nav));
  overflow: auto;
}
.view { display: none; min-height: 100%; }
.view.on { display: block; }
#view-shorts.on {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.watch-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 18px 24px;
}
.watch-frame {
  margin-top: 8px;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #2a2e38;
  aspect-ratio: 16 / 9;
}
.watch-vid {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}
.watch-wrap h2 {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 700;
}

.chips {
  display: flex;
  gap: 8px;
  padding: 4px 18px 14px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, var(--bg), transparent);
}
.chip {
  background: var(--elev);
  color: var(--text);
  border: 1px solid #2a2e38;
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}
.chip.on {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 14px;
  padding: 0 18px 24px;
}
.card {
  cursor: pointer;
  background: var(--elev);
  border: 1px solid #262a34;
  border-radius: 20px;
  padding: 10px 10px 14px;
}
.card:hover { border-color: #3a4254; }
.poster {
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  background: #2a2a2a center/cover no-repeat;
  position: relative;
  overflow: hidden;
}
.poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(16,18,23,.86);
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
}
.card h3 { font-size: 14px; margin-top: 10px; font-weight: 600; line-height: 1.3; }
.card .sub { color: var(--mute); font-size: 12px; margin-top: 4px; }

.profile-head {
  display: flex;
  gap: 20px;
  margin: 8px 18px 0;
  padding: 18px;
  align-items: center;
  background: var(--elev);
  border-radius: 24px;
  border: 1px solid #262a34;
}
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #222 center/cover no-repeat;
  flex-shrink: 0;
  border: 3px solid #2c303a;
}
.profile-head h1 { font-size: 24px; font-weight: 700; }
.profile-head p { color: var(--mute); margin-top: 6px; max-width: 640px; }
.linkish {
  background: none;
  border: 0;
  color: var(--blue-2);
  cursor: pointer;
  font: inherit;
  margin-bottom: 8px;
}
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px 18px 24px;
}
.ep-card {
  cursor: pointer;
  background: var(--elev);
  border-radius: 16px;
  padding: 10px;
  border: 1px solid #262a34;
}
.ep-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #111 center/cover no-repeat;
  position: relative;
}
.ep-card h3 { font-size: 14px; margin-top: 8px; font-weight: 600; }
.lock-film {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  border-radius: 12px;
}

.shorts-stage {
  height: 100%;
  display: grid;
  place-items: center;
  background: transparent;
}
.shorts-frame {
  height: calc(100% - 16px);
  max-height: 100%;
  aspect-ratio: 9 / 16;
  max-width: min(420px, 100%);
  position: relative;
  background: #111 center/cover no-repeat;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid #2a2e38;
}
.shorts-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.shorts-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.75));
}
.shorts-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  color: #fff;
  border: 0;
  font-size: 22px;
  cursor: pointer;
}
.shorts-meta {
  position: absolute;
  left: 12px;
  right: 72px;
  bottom: 18px;
  z-index: 2;
}
.shorts-meta button {
  background: none;
  border: 0;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.shorts-meta p { font-size: 14px; margin-top: 6px; }
.rail {
  position: absolute;
  right: 10px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 2;
}
.rail button, .rail .ava {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(16,18,23,.55);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 11px;
}
.rail .ava { background: center/cover no-repeat; border: 2px solid #fff; }
.nav-arrows {
  position: absolute;
  right: -56px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-arrows button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--elev);
  color: #fff;
  cursor: pointer;
}

.sub-wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; }
.sub-wrap h1 { font-size: 28px; font-weight: 800; }
.sub-wrap .lead { color: var(--mute); margin: 8px 0 20px; }
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.plan {
  background: var(--elev);
  border: 1px solid #2a2e38;
  border-radius: 20px;
  padding: 16px;
  cursor: pointer;
}
.plan.on { border-color: #ef4f88; }
.plan .off {
  display: inline-block;
  background: var(--grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.plan h2 { font-size: 16px; font-weight: 600; }
.price { font-size: 32px; margin: 8px 0 0; font-weight: 800; }
.price span { font-size: 14px; color: var(--mute); font-weight: 500; }
.was { color: var(--mute); text-decoration: line-through; font-size: 14px; }
.bill { color: var(--mute); font-size: 13px; margin: 8px 0 14px; }
.buy {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.why { margin-top: 28px; }
.why li { margin: 8px 0; color: var(--mute); }
.legal { margin-top: 16px; color: var(--mute); font-size: 12px; line-height: 1.5; }

.upload-wrap { max-width: 560px; margin: 0 auto; padding: 32px 16px; }
.upload-wrap h1 { font-weight: 800; }
.drop {
  border: 1px dashed #4d7dff;
  border-radius: 20px;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  background: var(--elev);
}
.drop img { max-height: 220px; max-width: 100%; border-radius: 12px; }
textarea {
  width: 100%;
  min-height: 140px;
  margin-top: 16px;
  background: #101217;
  color: #fff;
  border: 1px solid #2a2e38;
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  resize: vertical;
}
.next {
  margin-top: 16px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.next:disabled { opacity: .4; cursor: default; }
.spin-box { text-align: center; padding: 60px 16px; }
.spin {
  width: 56px;
  height: 56px;
  border: 4px solid #2a2e38;
  border-top-color: #ef4f88;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tabbar {
  height: var(--nav);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #101217;
  border-top: 1px solid #262a34;
}
.tab {
  background: none;
  border: 0;
  color: var(--mute);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tab.on { color: var(--blue-2); }
.tab svg { width: 24px; height: 24px; fill: currentColor; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,10,14,.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.overlay.on { display: flex; }
.panel {
  width: min(420px, 100%);
  background: var(--elev);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid #2a2e38;
}
.panel h2 { font-weight: 700; margin-bottom: 8px; }
.panel p { color: var(--mute); margin-bottom: 16px; }
.row { display: flex; gap: 8px; }
.row button { flex: 1; height: 44px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 700; }
.primary { background: var(--blue); color: #fff; }
.ghost { background: #2a2e38; color: #fff; }

.tg-panel { position: relative; text-align: center; }
.tg-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--mute);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.tg-logo {
  width: 56px;
  height: 56px;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: #2aabee;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 26px;
  transform: rotate(45deg);
}
.tg-step { display: none; text-align: left; }
.tg-step.on { display: block; }
.tg-panel h2 { text-align: center; }
.tg-panel .tg-step p { text-align: center; }
.tg-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: #2aabee;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.tg-panel input {
  width: 100%;
  height: 46px;
  margin: 0 0 14px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #2a2e38;
  background: #101217;
  color: #fff;
  font: inherit;
}
.tg-country { position: relative; margin: 0 0 10px; }
.tg-country-btn {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #2a2e38;
  background: #101217;
  color: #fff;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.tg-country-btn .tg-flag { font-size: 22px; line-height: 1; display: grid; place-items: center; }
.tg-flag-img {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}
.tg-country-btn .tg-country-name { flex: 1; font-weight: 600; }
.tg-country-btn .tg-dial { color: #8ab4f8; font-weight: 700; }
.tg-country-btn .chev { color: var(--mute); }
.tg-country-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 50px;
  z-index: 5;
  max-height: 240px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #2a2e38;
  background: #171a21;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.tg-country-menu input {
  margin: 8px 8px 0;
  width: calc(100% - 16px);
  height: 38px;
}
.tg-country-menu ul { list-style: none; margin: 4px 0 8px; padding: 0; }
.tg-country-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}
.tg-country-menu li:hover,
.tg-country-menu li.on { background: #22262f; }
.tg-country-menu li .iso { margin-left: auto; color: var(--mute); font-size: 12px; }
.tg-country-menu li .dial { color: #8ab4f8; font-weight: 700; min-width: 42px; }
.tg-flag-fallback {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  background: #2a2e38;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.tg-err {
  color: #ff7b8a;
  font-size: 13px;
  margin: 10px 0 0;
  text-align: center;
}
.up-need { text-align: center; padding: 48px 12px; }
.up-need h2 { margin-bottom: 10px; }
.up-need .tg-btn { max-width: 320px; margin: 16px auto 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  background: #ebecf0;
  color: #14161a;
  padding: 10px 16px;
  border-radius: 12px;
  display: none;
  z-index: 60;
  font-size: 14px;
}
.toast.on { display: block; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .nav-arrows { display: none; }
}
@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .search { display: none; }
}
