:root {
  color-scheme: light;
  --bg: #fafafa;
  --panel: #ffffff;
  --ink: #0f1419;
  --muted: #737373;
  --soft: #f5f5f5;
  --line: #dbdbdb;
  --line-soft: #efefef;
  --accent: #e1306c;
  --accent-2: #833ab4;
  --accent-3: #f77737;
  --accent-soft: #fff0f5;
  --sakura-soft: #fff6fa;
  --sakura-line: #ffd6e7;
  --cinema-ink: #171018;
  --success: #00a35c;
  --shadow: 0 2px 8px rgba(15, 20, 25, 0.06);
  --shadow-lift: 0 12px 28px rgba(15, 20, 25, 0.12);
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.18);
  --ig-gradient: linear-gradient(135deg, #833ab4 0%, #c13584 38%, #e1306c 60%, #fd1d1d 78%, #f77737 100%);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s var(--spring), box-shadow 0.18s ease;
}

button:active {
  transform: scale(0.96);
}

.shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 14px 94px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: 58px;
  margin: 0 -14px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 132px 0 14px;
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-lockup::after {
  content: "";
  width: 7px;
  height: 7px;
  align-self: flex-start;
  margin-top: 9px;
  border-radius: 999px 999px 999px 2px;
  background: #ff6aa2;
  transform: rotate(-24deg);
  opacity: 0.82;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
  border: 0;
  box-shadow: none;
  transition: transform 0.22s var(--spring);
  filter: drop-shadow(0 3px 8px rgba(225, 48, 108, 0.14));
}

.brand-mark:hover {
  transform: scale(1.06) rotate(-3deg);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

h1 {
  margin: 0;
  overflow: hidden;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusline {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.top-actions {
  position: absolute;
  top: 9px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.language-picker {
  position: relative;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 58px;
  min-height: 36px;
  border: 1px solid var(--sakura-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
  font-size: 0.76rem;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.language-trigger:hover,
.language-trigger[aria-expanded="true"] {
  border-color: #c7c7c7;
  background: var(--soft);
}

.language-menu {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 168px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lift);
  padding: 6px;
}

.language-option {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  padding: 0 9px;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 800;
}

.language-option:hover {
  background: var(--soft);
}

.language-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.language-option.active .language-dot {
  background: var(--ig-gradient);
}

.language-code {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 1.06rem;
}

.icon-button:hover {
  background: var(--soft);
}

.searchbar {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff 0%, var(--sakura-soft) 100%);
  padding: 0 12px;
}

.searchbar:focus-within {
  border-color: #c7c7c7;
  background: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.search-icon {
  color: var(--muted);
  font-size: 1rem;
}

.searchbar input {
  min-height: 42px;
  border: 0;
  background: transparent;
  padding: 0;
}

.searchbar input:focus {
  box-shadow: none;
}

.sr-only {
  position: absolute;
  display: none;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

select:focus,
input:focus {
  border-color: #a8a8a8;
  box-shadow: 0 0 0 3px rgba(225, 48, 108, 0.10);
}

.hero {
  position: relative;
  display: grid;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--cinema-ink);
  box-shadow: var(--shadow);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 78%, rgba(225, 48, 108, 0.42), transparent 24%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.10) 62%);
}

.hero-content {
  position: relative;
  z-index: 1;
  align-self: end;
  max-width: 660px;
  padding: 22px;
  color: #fff;
}

.hero-content h2 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.04;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

.hero-content p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.48;
}

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

.primary,
.secondary {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 900;
}

.primary {
  background: linear-gradient(135deg, #ff5c93 0%, #e1306c 48%, #b72171 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(225, 48, 108, 0.20);
}

.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.primary:hover,
.secondary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 800;
}

.tabs button.active {
  border-color: transparent;
  background: var(--ig-gradient);
  color: #fff;
  box-shadow: 0 6px 16px rgba(225, 48, 108, 0.22);
}

.tabs button.active::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 999px 999px 999px 2px;
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(-22deg);
  vertical-align: 1px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hidden {
  display: none !important;
}

.view-panel {
  display: grid;
  gap: 12px;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 12px;
}

.panel-head h2::after {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--ig-gradient);
}

.panel-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.info-card,
.stat,
.list-row,
.card {
  border: 1px solid rgba(219, 219, 219, 0.88);
  border-radius: 18px;
  background: var(--panel);
}

.info-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.info-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  padding: 14px;
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-size: 1.65rem;
  font-weight: 900;
  color: #c13584;
}

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

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.list-row small {
  color: var(--muted);
}

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

.quick-actions button,
.quick-actions a {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 900;
}

.quick-actions button:hover,
.quick-actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.card {
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--spring), box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px) scale(1.012);
  border-color: var(--sakura-line);
}

.poster {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #eee;
}

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

.badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  border-radius: 999px;
  background: rgba(255, 246, 250, 0.96);
  color: var(--ink);
  padding: 5px 8px;
  font-size: 0.7rem;
  font-weight: 900;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-body {
  display: grid;
  gap: 8px;
  padding: 11px;
}

.card h3 {
  min-height: 42px;
  margin: 0;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.2;
}

.meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.card .action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.card .primary,
.card .secondary {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 980px);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  padding: 7px 8px calc(8px + env(safe-area-inset-bottom));
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.bottom-nav button.active {
  color: var(--ink);
  background: var(--sakura-soft);
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 24px;
  place-items: center;
  border-radius: 0;
}

.nav-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-label {
  line-height: 1;
}

.bottom-nav button.active .nav-icon {
  background: transparent;
  color: var(--accent);
}

dialog {
  width: min(92vw, 560px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0;
  box-shadow: var(--shadow-lift);
}

#playerDialog {
  width: min(94vw, 760px);
}

.player-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.player-frame {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
}

.player-frame video {
  display: block;
  width: 100%;
  max-height: 72vh;
  background: #000;
}

.partner-fallback {
  display: grid;
  gap: 12px;
  padding: 8px 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.dialog-head {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
}

.dialog-head img {
  width: 112px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
}

.episode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding: 12px 0 0;
}

.partner-note {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff7fb;
  color: var(--muted);
  padding: 12px;
  line-height: 1.5;
}

.close-button {
  justify-self: end;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 78px;
  left: 18px;
  z-index: 20;
  display: none;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(15, 20, 25, 0.94);
  color: #fff;
  padding: 12px 16px;
  box-shadow: var(--shadow-lift);
}

.toast.show {
  display: block;
}

.legal {
  width: min(100% - 28px, 760px);
  margin: 0 auto;
  padding: 32px 0 52px;
  line-height: 1.65;
}

.legal h1 {
  margin-bottom: 22px;
  font-size: clamp(2rem, 6vw, 3.2rem);
}

.legal h2 {
  margin: 26px 0 8px;
  font-size: 1.08rem;
}

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

.legal a {
  color: var(--accent);
  font-weight: 900;
}

@media (max-width: 760px) {
  .shell {
    padding: 0 10px 88px;
  }

  .topbar {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 126px;
    padding-left: 10px;
  }

  .language-trigger {
    min-width: 54px;
  }

  .hero {
    min-height: 280px;
  }

  .hero-content {
    padding: 18px;
  }

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

  .tool-grid,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .list-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding-right: 116px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: 1rem;
  }

  .language-trigger {
    min-width: 50px;
    padding: 0 9px;
  }

  .card .action-row {
    grid-template-columns: 1fr;
  }

  .dialog-head {
    grid-template-columns: 88px 1fr;
  }

  .dialog-head img {
    width: 88px;
  }
}
