:root {
  color-scheme: dark;
  --bg: #030611;
  --panel: #0e1320;
  --panel-2: #171d2c;
  --text: #ffffff;
  --muted: #aab2c2;
  --line: #283044;
  --accent: #ff1767;
  --accent-2: #b423ff;
  --cyan: #27d5ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: block;
  min-height: 100vh;
}

.player-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
}

.player-modal[hidden] {
  display: none;
}

.player-surface {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 36px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  background: #02030a;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.52);
  touch-action: pan-y;
}

.player-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 24%, transparent 60%, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 180ms ease;
}

.player-surface.controls-visible::after {
  opacity: 1;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #02030a;
  pointer-events: none;
}

.tap-zones {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  cursor: pointer;
}

.ad-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  background: #02030a;
}

.episode-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 92px 18px 18px;
  z-index: 4;
  pointer-events: none;
  background: transparent;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.player-surface.controls-visible .episode-overlay {
  opacity: 1;
  transform: translateY(0);
}

.episode-overlay h1 {
  max-width: 300px;
  margin: 8px 0;
  font-size: clamp(24px, 5vw, 38px);
  line-height: 1;
}

.episode-overlay p {
  max-width: 300px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.35;
}

.episode-overlay span,
.brandbar p {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.player-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.swipe-hint {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 3;
  max-width: calc(100% - 84px);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.player-control {
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.player-surface.controls-visible .player-control {
  opacity: 1;
}

.play-toggle {
  align-self: end;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  pointer-events: auto;
}

.player-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 10px;
  z-index: 5;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.player-progress div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.seek-toast {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  transform: translate(-50%, -50%) scale(0.82);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  opacity: 0;
  transition: opacity 120ms ease, transform 180ms ease;
}

.seek-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ad-overlay[hidden] {
  display: none;
}

.ad-card {
  width: min(320px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(14, 19, 32, 0.96);
}

.ad-card span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.ad-card p {
  color: var(--muted);
}

.ad-card button,
.search button,
.feed-tools button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 900;
}

.ad-card button {
  width: 100%;
}

.ad-card button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.catalog {
  min-width: 0;
  min-height: 100vh;
  padding: 24px 24px 92px;
  background:
    linear-gradient(180deg, rgba(255, 23, 103, 0.08), transparent 18rem),
    var(--bg);
}

.catalog > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.brandbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.brandbar img {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  object-fit: cover;
}

.brandbar p {
  margin: 0 0 4px;
}

.brandbar h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1;
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 800;
}

.tabs button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.hero-drama {
  min-height: 230px;
  display: flex;
  align-items: end;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.hero-drama[hidden] {
  display: none;
}

.hero-drama span,
.detail-content > span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-drama h3 {
  max-width: 560px;
  margin: 8px 0;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.98;
}

.hero-drama p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.78);
}

.hero-drama button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 900;
}

.download-app {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 23, 103, 0.18), transparent 18rem),
    var(--panel);
}

.download-app span,
.ios-sheet > span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.download-app h3 {
  margin: 5px 0 6px;
  font-size: 24px;
}

.download-app p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.download-actions a,
.download-actions button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.download-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.download-actions button {
  background: var(--panel-2);
}

.search {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 10px;
  margin-bottom: 14px;
}

.search input {
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.feed-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.feed-tools button {
  padding: 0 14px;
  background: var(--panel-2);
}

.feed-tools span {
  color: var(--muted);
  line-height: 1.4;
}

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

.drama-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.drama-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 23, 103, 0.7);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.drama-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: cover;
  background: var(--panel-2);
}

.drama-card div {
  padding: 10px;
}

.drama-card strong {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.2;
}

.drama-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
}

.ios-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: end center;
}

.ios-modal[hidden] {
  display: none;
}

.ios-sheet {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100vw - 24px));
  padding: 24px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.ios-sheet img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  margin-bottom: 14px;
}

.ios-sheet h2 {
  margin: 8px 0 10px;
  font-size: 30px;
  line-height: 1;
}

.ios-sheet p,
.ios-sheet li {
  color: var(--muted);
  line-height: 1.5;
}

.ios-sheet ol {
  margin: 12px 0 0;
  padding-left: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.detail-sheet {
  position: relative;
  z-index: 1;
  width: min(880px, calc(100vw - 24px));
  max-height: min(760px, calc(100vh - 24px));
  display: grid;
  grid-template-columns: minmax(210px, 310px) 1fr;
  gap: 22px;
  overflow: hidden;
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 24% 12%, rgba(255, 23, 103, 0.18), transparent 18rem),
    var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.close-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.detail-cover-wrap {
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel-2);
}

.detail-cover-wrap img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: block;
  object-fit: cover;
}

.detail-content {
  align-self: center;
  padding: 24px 36px 24px 0;
}

.detail-content h2 {
  margin: 8px 0 12px;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 0.98;
}

.detail-content p {
  max-height: 120px;
  overflow: auto;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.detail-stats {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 18px;
}

.detail-stats strong {
  font-size: 24px;
}

.detail-stats span {
  color: var(--muted);
  font-size: 13px;
}

.detail-content > button {
  width: min(320px, 100%);
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  display: none;
  width: min(430px, calc(100vw - 28px));
  transform: translateX(-50%);
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(14, 19, 32, 0.92);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bottom-nav button.active {
  background: rgba(255, 23, 103, 0.18);
  color: #fff;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 34px 0 12px;
}

.site-footer a,
.legal-page a {
  color: var(--cyan);
  font-weight: 800;
  text-decoration: none;
}

.legal-page {
  width: min(820px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.legal-page h1 {
  margin: 28px 0 18px;
  font-size: clamp(36px, 7vw, 70px);
  line-height: 0.95;
}

.legal-page h2 {
  margin: 28px 0 8px;
  font-size: 24px;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.65;
}

.contact-card {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.contact-card p {
  margin-bottom: 0;
}

@media (max-width: 940px) {
  .catalog {
    height: auto;
  }

  .bottom-nav {
    display: grid;
  }
}

@media (max-width: 540px) {
  .catalog {
    padding: 14px;
  }

  .player-modal {
    padding: 0;
  }

  .player-surface {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .player-progress {
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    border-radius: 0;
  }

  .episode-overlay {
    padding-bottom: 28px;
  }

  .search {
    grid-template-columns: 1fr;
  }

  .download-app {
    align-items: stretch;
    flex-direction: column;
  }

  .download-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .drama-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brandbar img {
    width: 58px;
    height: 58px;
  }

  .hero-drama {
    min-height: 190px;
    padding: 16px;
  }

  .detail-sheet {
    width: 100vw;
    max-height: 86vh;
    grid-template-columns: 116px 1fr;
    gap: 14px;
    margin-bottom: 0;
    border-radius: 18px 18px 0 0;
  }

  .ios-sheet {
    width: 100vw;
    margin-bottom: 0;
    border-radius: 18px 18px 0 0;
  }

  .detail-cover-wrap img {
    min-height: 180px;
  }

  .detail-content {
    padding: 36px 28px 18px 0;
  }

  .detail-content h2 {
    font-size: 28px;
  }

  .detail-content p {
    max-height: 92px;
    font-size: 13px;
  }

  .detail-stats {
    grid-template-columns: auto 1fr;
  }

  .site-footer {
    padding-bottom: 86px;
  }
}
