:root {
  color-scheme: dark;
  --background: #0d0d10;
  --surface: #17171c;
  --raised: #222229;
  --line: #ffffff21;
  --text: #f5f4f2;
  --muted: #bcbac2;
  --gold: #efc57e;
  --gutter: clamp(20px, 4.4vw, 82px);
  font: 17px/1.5 system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; background: var(--background); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, .button, nav a, select {
  min-height: 50px; border: 1px solid transparent; border-radius: 999px;
  padding: 10px 19px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 620; color: var(--text); cursor: pointer; background: var(--raised);
}
select { padding-inline: 14px; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 4px; }
.primary { background: var(--text); color: #141317; }
.primary:hover { background: #e3dfe7; }
.secondary { background: var(--raised); border-color: var(--line); }
.secondary:hover, nav a:hover { background: #34343d; }
.round { width: 50px; padding: 0; flex-shrink: 0; }
.icon { width: 21px; height: 21px; display: block; flex: none; }
.topbar {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: clamp(12px, 3vw, 56px);
  min-height: 76px; padding: 10px var(--gutter); background: #0d0d10ed; border-bottom: 1px solid #ffffff0b;
  backdrop-filter: blur(14px);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 28px; font-weight: 760; letter-spacing: -.045em; }
.wordmark img { width: 40px; height: 40px; }
nav { display: flex; align-items: center; gap: 5px; }
nav a { background: transparent; padding-inline: clamp(10px, 1.5vw, 22px); color: var(--muted); white-space: nowrap; }
nav a[aria-current] { background: var(--text); color: #141317; }
#server-menu { margin-left: auto; }
main { padding: clamp(22px, 3vw, 45px) var(--gutter) 68px; max-width: 1920px; margin: 0 auto; }
main:has(> .hero), main:has(> .detail) { padding-top: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(34px, 5vw, 79px); letter-spacing: -.05em; line-height: 1.02; font-weight: 690; }
h2 { font-size: clamp(23px, 2.45vw, 35px); letter-spacing: -.035em; font-weight: 660; line-height: 1.15; }
.muted, .wait { color: var(--muted); }
.wait { padding: 48px 0; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.intro {
  min-height: min(640px, calc(100svh - 160px)); border: 1px solid var(--line); border-radius: 28px;
  padding: clamp(25px, 6vw, 103px); display: grid; align-items: center; grid-template-columns: 1.16fr .84fr;
  gap: clamp(20px, 6vw, 98px); overflow: hidden;
  background: radial-gradient(ellipse at 80% 40%, #3c3028 0%, #241d1d 37%, transparent 68%), #17161b;
}
.intro-copy { display: grid; justify-items: start; align-content: center; gap: 19px; }
.intro-copy > p { max-width: 42ch; }
.intro h1 { font-size: clamp(39px, 6.2vw, 88px); }
.kicker { color: var(--gold); font-size: .72rem; font-weight: 740; letter-spacing: .15em; text-transform: uppercase; }
.intro-art { width: min(100%, 330px); justify-self: center; filter: drop-shadow(0 12px 32px #0006); }
.pair-box { text-align: center; display: grid; justify-items: center; gap: 11px; }
.pair-box a { display: inline-flex; background: white; border-radius: 16px; padding: 9px; }
.pair-box img { width: clamp(150px, 22vw, 230px); aspect-ratio: 1; }
.pin { font-size: clamp(34px, 4vw, 55px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .19em; }
.notice { display: grid; justify-items: start; gap: 16px; padding: 26px 0; }
.hero {
  min-height: clamp(360px, 39vw, 650px); isolation: isolate; position: relative; overflow: hidden;
  display: flex; align-items: end; gap: clamp(24px, 3.8vw, 58px); margin-inline: calc(-1 * var(--gutter));
  padding: clamp(38px, 5vw, 83px) var(--gutter) clamp(30px, 4.4vw, 74px);
  background: radial-gradient(ellipse at 80% 6%, #372a27, #19171c 55%, var(--background));
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #0d0d10 2%, #0d0d10ea 20%, #0d0d1070 49%, transparent 80%),
    linear-gradient(0deg, #0d0d10 0%, #0d0d10a6 15%, transparent 63%);
}
.hero .backdrop { position: absolute; top: 0; right: 0; width: 87%; height: 100%; z-index: -2; object-fit: cover; object-position: center 39%; }
.hero-copy { width: min(100%, 690px); display: grid; justify-items: start; gap: 13px; }
.hero-copy h1 { overflow-wrap: anywhere; }
.hero-copy .summary { max-width: 55ch; color: #e1dfe5; }
main > .hero .summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-copy .actions { margin-top: 6px; }
.metadata { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; color: var(--muted); font-size: .87rem; font-weight: 580; }
.metadata:empty, .hero-copy p:empty, .shelf > p:empty { display: none; }
.metadata .badge { padding: 0 7px; border: 1px solid #ffffff44; border-radius: 4px; color: var(--text); font-size: .75rem; }
.shelf { margin-top: 32px; }
main > .hero + .shelf { margin-top: 0; }
.shelf-head { display: flex; gap: 20px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(156px, 100%), 1fr)); gap: clamp(12px, 1.5vw, 22px); }
.posters.row {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: clamp(132px, 15vw, 230px);
  overflow-x: auto; padding: 6px; margin: -6px; scrollbar-color: #63616b transparent; overscroll-behavior-inline: contain;
}
.posters.landscape { grid-auto-columns: clamp(235px, 27vw, 410px); }
.poster { position: relative; text-align: left; background: var(--surface); border: 1px solid #ffffff12; border-radius: 13px; display: block; min-width: 0; padding: 0; overflow: hidden; }
.poster:hover { border-color: #ffffff85; }
.poster-art { display: grid; position: relative; aspect-ratio: 2 / 3; place-items: center; color: var(--muted); background: linear-gradient(150deg, #39303b, #222128 66%); }
.landscape .poster-art { aspect-ratio: 16 / 9; }
.poster-art img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.poster::after { content: ''; position: absolute; inset: 34% 0 0; background: linear-gradient(0deg, #07070a 0%, #07070ab0 24%, transparent 79%); pointer-events: none; }
.poster-caption { position: absolute; z-index: 1; inset: auto 12px 11px; display: grid; gap: 1px; }
.landscape .poster-caption { inset: auto 14px 13px; }
.poster-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.poster-year { color: var(--muted); font-size: .72rem; }
.progress { position: absolute; z-index: 2; bottom: 0; left: 0; width: 100%; height: 4px; border: 0; border-radius: 0; appearance: none; background: #ffffff40; }
.progress::-webkit-progress-bar { background: #ffffff40; }
.progress::-webkit-progress-value { background: #e2caee; }
.progress::-moz-progress-bar { background: #e2caee; }
.filters, .search { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.search input { flex: 1 1 200px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 12px 15px; }
.page-head p { margin-top: 9px; }
.empty { margin-top: 20px; padding: 20px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; color: var(--muted); }
.more { margin-top: 24px; }
.detail { display: grid; }
.detail .hero { align-items: center; }
.detail .hero-copy { gap: 13px; }
.hero-poster { display: block; flex: none; width: clamp(126px, 18vw, 270px); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 13px; border: 1px solid var(--line); box-shadow: 0 15px 45px #0007; }
.back-row { position: relative; z-index: 1; margin: 18px 0 -50px; }
.detail .hero { padding-top: clamp(85px, 9vw, 132px); }
.episodes, #server-list, .subtitle-results { display: grid; gap: 10px; }
.detail .episodes { margin-top: 10px; }
.episode, #server-list button { text-align: left; justify-content: flex-start; border-radius: 13px; }
.episode img { width: 78px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; }
dialog { width: min(92vw, 660px); max-height: 88vh; color: var(--text); background: #1c1c24; border: 1px solid #ffffff38; border-radius: 21px; padding: clamp(15px, 3vw, 27px); }
dialog::backdrop { background: #000a; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-bottom: 16px; }
#settings-status, #profiles-status, .subtitle-status { margin: 14px 0; }
.subtitle-result { display: grid; justify-content: start; gap: 2px; border-radius: 11px; text-align: left; overflow-wrap: anywhere; }
.subtitle-result span { color: var(--muted); font-size: .8rem; }
.player { display: grid; gap: 15px; }
.player header, .player-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 11px 16px; }
.player header h1 { font-size: clamp(26px, 3vw, 46px); }
.player header .kicker { margin-bottom: 3px; }
.video-wrap { background: #000; overflow: hidden; border-radius: 15px; border: 1px solid var(--line); }
video { width: 100%; max-height: max(190px, min(71vh, calc(100svh - 251px))); aspect-ratio: 16 / 9; display: block; }
.player-controls label { display: grid; gap: 3px; color: var(--muted); font-size: .79rem; max-width: min(100%, 275px); }
.player-controls select { font-size: .92rem; width: 100%; }
.player:fullscreen { display: flex; flex-direction: column; background: #09090b; padding: 14px var(--gutter); }
.player:fullscreen .video-wrap { min-height: 0; flex: 1; border: 0; }
.player:fullscreen video { height: 100%; max-height: none; }
.player:fullscreen > p:empty { display: none; }
@media (max-width: 770px) {
  .topbar { flex-wrap: wrap; column-gap: 15px; row-gap: 5px; }
  nav { order: 3; width: 100%; overflow-x: auto; padding-block: 4px; }
  nav a { min-height: 45px; }
  main { padding-top: 24px; }
  .intro { grid-template-columns: 1fr; }
  .intro-art { width: min(55%, 215px); grid-row: 1; }
  .hero { min-height: 390px; }
  .hero .backdrop { width: 100%; }
  .hero::after { background: linear-gradient(0deg, #0d0d10 2%, #0d0d10d9 36%, #0d0d1017 91%); }
  .hero-poster { display: none; }
  .posters { grid-template-columns: repeat(auto-fill, minmax(min(113px, 100%), 1fr)); }
}
@media (max-width: 390px) {
  :root { --gutter: 15px; font-size: 16px; }
  nav a { padding-inline: 9px; }
  nav a .icon { display: none; }
}
