:root {
  --bg: #141414;
  --bg-2: #181818;
  --bg-3: #232323;
  --bg-4: #2f2f2f;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --text-2: #b3b3b3;
  --text-3: #808080;
  --red: #e50914;
  --red-hover: #f40612;
  --green: #46d369;
  --gutter: 4%;
  --nav-h: 68px;
  --card-w: clamp(128px, 12.4vw, 210px);
  --wide-w: clamp(230px, 21vw, 330px);
  --radius: 6px;
  --font: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.modal-open, body.player-open { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 1.25em; height: 1.25em; flex-shrink: 0; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
::selection { background: var(--red); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 36px;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(0,0,0,.75) 10%, transparent);
  transition: background-color .4s;
}
.nav.solid { background-color: var(--bg); }
.logo span { color: #fff; }
.logo {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 34px; letter-spacing: 1.5px; line-height: 1;
  color: var(--red);
  padding-top: 4px;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: #e5e5e5; font-size: 14.5px; transition: color .2s; }
.nav-links a:hover { color: var(--text-2); }
.nav-links a.active { color: #fff; font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-search {
  display: flex; align-items: center; gap: 8px;
  height: 36px; width: 36px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 4px;
  transition: width .3s, background-color .3s, border-color .3s;
  overflow: hidden; cursor: pointer;
}
.nav-search input { width: 100%; background: none; border: 0; outline: none; font-size: 14px; min-width: 0; }
.nav-search input::-webkit-search-cancel-button { filter: invert(1); }
.nav-search.open, .nav-search:focus-within { width: 250px; background: rgba(0,0,0,.75); border-color: rgba(255,255,255,.85); cursor: text; }
.nav-search-icon { display: flex; }
.nav-search-icon svg { width: 20px; height: 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 4px;
  padding: 10px 24px;
  font-weight: 600; font-size: 16px; line-height: 1.2;
  white-space: nowrap;
  transition: background-color .2s, opacity .2s, transform .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 22px; height: 22px; }
.btn-white { background: #fff; color: #000; }
.btn-white:hover { background: rgba(255,255,255,.78); }
.btn-grey { background: rgba(109,109,110,.7); color: #fff; }
.btn-grey:hover { background: rgba(109,109,110,.45); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-hover); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid var(--line-2); }
.btn-ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
.btn-danger { background: transparent; color: #ff6b6b; border: 1px solid rgba(255,107,107,.35); }
.btn-danger:hover { background: rgba(255,107,107,.1); }
.btn-sm { padding: 7px 14px; font-size: 14px; gap: 6px; }
.btn-sm svg { width: 18px; height: 18px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 0; color: #fff;
  transition: background-color .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }
.icon-btn svg { width: 22px; height: 22px; }
.circle-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(42,42,42,.6); color: #fff;
  border: 2px solid rgba(255,255,255,.5);
  transition: border-color .2s, background-color .2s;
}
.circle-btn:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.circle-btn svg { width: 20px; height: 20px; }
.circle-btn.on { border-color: #fff; background: rgba(255,255,255,.14); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: min(86vh, 56.25vw + 80px);
  min-height: 460px;
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) clamp(120px, 15vw, 210px);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; animation: fadeIn 1s ease both; }
.hero-bg img.soft { filter: blur(24px) brightness(.55); transform: scale(1.15); }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(77deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.4) 40%, transparent 72%),
    linear-gradient(0deg, var(--bg) 0%, var(--bg) 3%, rgba(20,20,20,.85) 14%, rgba(20,20,20,.4) 32%, transparent 52%),
    linear-gradient(180deg, rgba(0,0,0,.3), transparent 22%);
}
.hero-cover {
  position: absolute; right: var(--gutter); bottom: clamp(120px, 15vw, 210px);
  width: clamp(150px, 16vw, 250px); aspect-ratio: 2/3; object-fit: cover;
  border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.6);
  animation: fadeIn 1.2s ease both;
}
.hero-content { position: relative; max-width: min(640px, 52vw); animation: fadeIn .9s ease both; }
.hero-kicker { display: flex; align-items: center; gap: 8px; color: #e5e5e5; font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px; }
.hero-kicker b { color: var(--red); font-family: "Bebas Neue", Impact, sans-serif; font-size: 22px; letter-spacing: 1px; font-weight: 400; }
.hero-title {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 4.6vw, 4.4rem);
  font-weight: 800; line-height: 1.02; letter-spacing: -0.02em;
  text-shadow: 2px 2px 10px rgba(0,0,0,.45);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: #e5e5e5; font-size: 15px; }
.meta .score { color: var(--green); font-weight: 700; }
.meta .tag { border: 1px solid rgba(255,255,255,.4); padding: 0 6px; border-radius: 3px; font-size: 12px; line-height: 1.6; }
.meta .dot::before { content: "•"; color: var(--text-3); margin-right: 10px; }
.hero-desc {
  margin: 14px 0 22px;
  font-size: clamp(14px, 1.15vw, 18px); line-height: 1.5;
  text-shadow: 1px 1px 6px rgba(0,0,0,.5);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .btn { font-size: clamp(15px, 1.2vw, 18px); padding: 11px clamp(20px, 2.2vw, 30px); }
.resume-line { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: #ddd; }
.resume-line .bar { width: 160px; }

/* ---------- rows ---------- */
.rows { position: relative; margin-top: clamp(-150px, -9vw, -80px); padding-bottom: 60px; z-index: 2; }
.rows.flat { margin-top: 0; padding-top: calc(var(--nav-h) + 20px); }
.row { position: relative; margin-bottom: 18px; }
.row-title { margin: 0 var(--gutter) 2px; font-size: clamp(16px, 1.45vw, 21px); font-weight: 700; color: #e5e5e5; display: flex; align-items: baseline; gap: 12px; }
.row-title small { font-size: 13px; color: var(--text-3); font-weight: 500; }
.row-track {
  display: flex; gap: 8px;
  overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none;
  padding: 14px var(--gutter) 22px;
  scroll-padding-inline: var(--gutter);
}
.row-track::-webkit-scrollbar { display: none; }
.row-arrow {
  position: absolute; top: 40px; bottom: 30px; z-index: 5;
  width: calc(var(--gutter) - 6px); min-width: 34px;
  display: grid; place-items: center;
  background: rgba(20,20,20,.55); border: 0; color: #fff;
  opacity: 0; transition: opacity .2s, background-color .2s;
}
.row-arrow svg { width: 30px; height: 30px; transition: transform .2s; }
.row-arrow:hover { background: rgba(20,20,20,.8); }
.row-arrow:hover svg { transform: scale(1.25); }
.row-arrow.l { left: 0; border-radius: 0 4px 4px 0; }
.row-arrow.r { right: 0; border-radius: 4px 0 0 4px; }
.row:hover .row-arrow:not([hidden]) { opacity: 1; }

/* poster card */
.poster {
  position: relative; flex: 0 0 var(--card-w);
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg-3);
  aspect-ratio: 2/3;
  transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s;
  cursor: pointer;
}
.poster:hover, .poster:focus-visible { transform: scale(1.06); box-shadow: 0 14px 30px rgba(0,0,0,.6); z-index: 3; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .p-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; text-align: center; font-weight: 700; background: linear-gradient(160deg, #2c2c2c, #1a1a1a); }
.poster .p-info {
  position: absolute; inset: auto 0 0 0;
  padding: 40px 10px 10px;
  background: linear-gradient(0deg, rgba(0,0,0,.92), transparent);
  opacity: 0; transition: opacity .25s;
}
.poster:hover .p-info, .poster:focus-visible .p-info { opacity: 1; }
.p-info .t { font-weight: 700; font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-info .s { color: var(--text-2); font-size: 12px; margin-top: 3px; }
.poster .bar { position: absolute; left: 8px; right: 8px; bottom: 7px; }
.poster:hover .bar { opacity: 0; }
.badge {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 7px; border-radius: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  background: var(--red); color: #fff;
}
.badge.done { background: rgba(0,0,0,.72); color: var(--green); display: inline-flex; align-items: center; gap: 3px; }
.badge.done svg { width: 12px; height: 12px; }
.badge.log { background: rgba(0,0,0,.72); color: #ddd; }

.bar { height: 3px; background: rgba(255,255,255,.28); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--red); }

/* continue-watching card */
.wide-card { flex: 0 0 var(--wide-w); cursor: pointer; transition: transform .3s cubic-bezier(.2,.7,.3,1); }
.wide-card:hover, .wide-card:focus-visible { transform: scale(1.04); z-index: 3; }
.wc-thumb { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.wc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wc-thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.25); opacity: 0; transition: opacity .25s;
}
.wc-thumb .play span { width: 52px; height: 52px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center; background: rgba(0,0,0,.45); }
.wc-thumb .play svg { width: 22px; height: 22px; margin-left: 3px; }
.wide-card:hover .play { opacity: 1; }
.wc-thumb .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 0; }
.wc-thumb .chip { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.72); padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; }
.wc-meta { padding: 9px 2px 0; }
.wc-meta .t { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-meta .s { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- pages ---------- */
.page { padding: calc(var(--nav-h) + 26px) var(--gutter) 70px; min-height: 100vh; animation: fadeIn .35s ease both; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: clamp(26px, 2.6vw, 38px); font-weight: 800; letter-spacing: -0.01em; }
.page-head .count { color: var(--text-3); font-size: 15px; }
.page-head .tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr)); gap: 28px 12px; }
.grid .poster { flex: none; width: 100%; }
.grid-item .under { padding-top: 8px; }
.grid-item .under .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-item .under .s { color: var(--text-3); font-size: 12.5px; }

.select, .input {
  height: 38px; padding: 0 12px;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 4px;
  outline: none; font-size: 14px;
}
.select:focus, .input:focus { border-color: #fff; }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
.select option { background: var(--bg-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  padding: 6px 14px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line-2); color: var(--text-2);
  font-size: 13.5px; font-weight: 500; transition: all .2s;
}
.chip-btn:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.chip-btn.on { background: #fff; color: #000; border-color: #fff; }
.chip-btn .n { opacity: .6; margin-left: 4px; }

.empty {
  display: grid; place-items: center; text-align: center;
  min-height: 60vh; padding: 40px 20px;
}
.empty h2 { margin: 18px 0 8px; font-size: 26px; }
.empty p { margin: 0 auto 24px; color: var(--text-2); max-width: 460px; }
.empty .big-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); color: var(--text-2); margin: 0 auto; }
.empty .big-icon svg { width: 36px; height: 36px; }

.welcome {
  position: relative; min-height: 100vh; display: grid; place-items: center; text-align: center;
  padding: 120px 24px 60px; overflow: hidden;
}
.welcome::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 35%, rgba(229,9,20,.22), transparent 70%), radial-gradient(40% 40% at 80% 90%, rgba(229,9,20,.08), transparent 70%);
}
.welcome-inner { position: relative; max-width: 640px; animation: fadeIn .8s ease both; }
.welcome h1 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.05; margin: 0 0 16px; font-weight: 800; letter-spacing: -0.02em; }
.welcome p { color: #ddd; font-size: clamp(16px, 1.4vw, 20px); margin: 0 0 30px; }
.welcome .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 46px; text-align: left; }
.welcome .step { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.welcome .step b { display: block; color: var(--red); font-family: "Bebas Neue", Impact, sans-serif; font-size: 26px; font-weight: 400; line-height: 1; margin-bottom: 6px; }
.welcome .step span { color: var(--text-2); font-size: 14px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.72);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 32px 16px 60px;
  animation: fadeIn .25s ease both;
}
.modal {
  position: relative; margin: 0 auto;
  width: min(920px, 100%);
  background: var(--bg-2); border-radius: 8px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.75);
  animation: modalIn .3s cubic-bezier(.2,.7,.3,1) both;
}
.modal.narrow { width: min(560px, 100%); }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 4; width: 38px; height: 38px; border-radius: 50%; background: #181818; border: 0; color: #fff; display: grid; place-items: center; }
.modal-close:hover { background: #2a2a2a; }
.modal-close svg { width: 20px; height: 20px; }
.m-hero { position: relative; aspect-ratio: 16/8; background: #000; overflow: hidden; }
.m-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.m-hero img.soft { filter: blur(22px) brightness(.5); transform: scale(1.2); }
.m-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg-2) 0%, rgba(24,24,24,.4) 35%, transparent 60%); }
.m-hero-content { position: absolute; left: 48px; right: 48px; bottom: 34px; z-index: 2; }
.m-title { margin: 0 0 18px; font-size: clamp(26px, 3.6vw, 44px); font-weight: 800; line-height: 1.05; letter-spacing: -0.015em; text-shadow: 2px 2px 12px rgba(0,0,0,.5); }
.m-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.m-body { padding: 4px 48px 30px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 30px; }
.m-body .desc { margin: 14px 0 0; color: #e5e5e5; white-space: pre-line; font-size: 15px; }
.m-side { font-size: 14px; color: var(--text-3); display: grid; gap: 10px; align-content: start; }
.m-side b { font-weight: 400; color: var(--text-3); }
.m-side span { color: #ddd; }
.watched-line { margin-top: 10px; color: var(--text-2); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.watched-line .bar { width: 140px; }
.m-section { padding: 0 48px 34px; }
.m-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.m-section-head h3 { margin: 0; font-size: 22px; font-weight: 700; }
.m-section-head .sub { color: var(--text-3); font-size: 14px; }
.m-section-head .tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.notice { background: rgba(255,255,255,.04); border: 1px dashed var(--line-2); border-radius: 6px; padding: 14px 16px; color: var(--text-2); font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notice svg { color: var(--text-2); }
.notice code { color: #fff; background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 3px; font-family: Consolas, monospace; font-size: 13px; word-break: break-all; }

.ep-list { border-top: 1px solid var(--line); }
.ep {
  display: grid; grid-template-columns: 34px clamp(120px, 18vw, 160px) minmax(0, 1fr) auto;
  align-items: center; gap: 16px;
  padding: 14px 14px; border-bottom: 1px solid var(--line); border-radius: 4px;
  transition: background-color .2s;
}
.ep:hover { background: #2a2a2a; }
.ep.current { background: #333; }
.ep .num { font-size: 22px; color: var(--text-2); text-align: center; }
.ep-thumb { position: relative; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: var(--bg-4); cursor: pointer; border: 0; padding: 0; }
.ep-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.ep-thumb .play, .ep-thumb .bar { z-index: 2; }
.ep-thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.ep-thumb .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.3); }
.ep-thumb .play span { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center; background: rgba(0,0,0,.5); }
.ep-thumb .play svg { width: 18px; height: 18px; margin-left: 2px; }
.ep:hover .ep-thumb .play { opacity: 1; }
.ep-thumb .bar { position: absolute; left: 6px; right: 6px; bottom: 6px; }
.ep .info { min-width: 0; }
.ep .info .t { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 15px; }
.ep .info .t span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep .info .t .dur { color: #ddd; font-weight: 500; flex-shrink: 0; }
.ep .info .f { color: var(--text-3); font-size: 12.5px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep .info .f.missing { color: #a0a0a0; font-style: italic; }
.ep.unavailable .ep-thumb { cursor: default; opacity: .55; }
.ep.unavailable .num, .ep.unavailable .info .t span:first-child { color: var(--text-3); }
.ep .check { width: 34px; height: 34px; }
.ep .check svg { width: 16px; height: 16px; }
.ep .check.on { background: #fff; color: #000; border-color: #fff; }
.more-eps { width: 100%; margin-top: 12px; }
.folder-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.folder-path { flex: 1 1 320px; min-width: 0; font-family: Consolas, monospace; font-size: 13px; color: #ddd; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 4px; padding: 9px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* add / settings dialogs */
.dialog { padding: 30px 34px 34px; }
.dialog h2 { margin: 0 0 6px; font-size: 26px; font-weight: 800; }
.dialog .lead { margin: 0 0 22px; color: var(--text-2); }
.search-big { position: relative; }
.search-big svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--text-2); pointer-events: none; }
.search-big input { width: 100%; height: 54px; padding: 0 16px 0 50px; font-size: 18px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 6px; outline: none; }
.search-big input:focus { border-color: #fff; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 22px 14px; margin-top: 24px; min-height: 120px; }
.result { text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.result .cv { position: relative; aspect-ratio: 2/3; border-radius: 5px; overflow: hidden; background: var(--bg-3); transition: transform .25s, box-shadow .25s; }
.result .cv img { width: 100%; height: 100%; object-fit: cover; }
.result:hover .cv, .result:focus-visible .cv { transform: scale(1.04); box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.result .t { margin-top: 8px; font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result .s { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.results .hint { grid-column: 1/-1; color: var(--text-3); text-align: center; padding: 30px 0; }
.pick { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 26px; margin-top: 4px; }
.pick > img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; }
.pick h3 { margin: 0 0 6px; font-size: 24px; line-height: 1.15; }
.pick .alt { color: var(--text-3); font-size: 14px; margin-bottom: 10px; }
.pick .desc { color: var(--text-2); font-size: 14px; margin: 12px 0 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.seg { display: inline-flex; background: var(--bg-3); border-radius: 6px; padding: 4px; gap: 4px; margin: 22px 0 18px; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 8px 16px; border-radius: 4px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.seg button svg { width: 18px; height: 18px; }
.seg button.on { background: #fff; color: #000; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: #ddd; }
.field .row-inline { display: flex; gap: 8px; }
.field .row-inline .input { flex: 1; min-width: 0; }
.field .help { font-size: 13px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.field .help.ok { color: var(--green); }
.field .help svg { width: 16px; height: 16px; }
.input { width: 100%; }
.input.mono { font-family: Consolas, monospace; font-size: 13.5px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; color: var(--text-2); padding: 0; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.link-btn:hover { color: #fff; }
.link-btn svg { width: 16px; height: 16px; }
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-4); transition: background-color .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + span { background: var(--red); }
.toggle input:checked + span::after { transform: translateX(20px); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting:last-of-type { border-bottom: 0; }
.setting .txt b { display: block; font-weight: 600; }
.setting .txt span { color: var(--text-3); font-size: 13px; }
.setting.col { display: grid; gap: 10px; }

/* ---------- history ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 30px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
.stat b { display: block; font-size: clamp(26px, 2.6vw, 36px); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.stat span { color: var(--text-3); font-size: 13px; }
.stat.accent b { color: var(--red); }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button { background: none; border: 0; padding: 0 0 12px; color: var(--text-2); font-weight: 600; font-size: 16px; position: relative; }
.tabs button:hover { color: #fff; }
.tabs button.on { color: #fff; }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--red); border-radius: 2px; }
.day { margin-bottom: 30px; }
.day h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: #e5e5e5; }
.day h3 small { color: var(--text-3); font-weight: 500; margin-left: 8px; }
.act {
  display: grid; grid-template-columns: 136px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 10px; border-radius: 6px; transition: background-color .2s;
}
.act:hover { background: var(--bg-2); }
.act .th { position: relative; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: var(--bg-3); cursor: pointer; border: 0; padding: 0; }
.act .th img { width: 100%; height: 100%; object-fit: cover; }
.act .th img.cover { object-position: center 20%; }
.act .th .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 0; }
.act .th .ic { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; }
.act .main { min-width: 0; }
.act .main .t { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.act .main .t:hover { text-decoration: underline; }
.act .main .s { color: var(--text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act .main .m { color: var(--text-3); font-size: 12.5px; margin-top: 2px; display: flex; gap: 8px; align-items: center; }
.act .main .m .ok { color: var(--green); display: inline-flex; align-items: center; gap: 4px; }
.act .main .m .ok svg { width: 14px; height: 14px; }
.act .acts { display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.act:hover .acts, .act:focus-within .acts { opacity: 1; }
.act .acts .icon-btn { width: 34px; height: 34px; }
.act .acts .icon-btn svg { width: 18px; height: 18px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  background: #f5f5f5; color: #111; font-weight: 600; font-size: 14px;
  padding: 11px 18px; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  display: flex; align-items: center; gap: 10px; max-width: min(560px, 90vw);
  animation: toastIn .3s ease both; pointer-events: auto;
}
.toast.err { background: #2b0d0e; color: #ffb4b4; border: 1px solid rgba(229,9,20,.6); }
.toast svg { width: 18px; height: 18px; }
.toast.out { animation: fadeOut .3s ease both; }

/* ---------- skeleton / spinner ---------- */
.skel { background: linear-gradient(90deg, #202020 25%, #2a2a2a 50%, #202020 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
.spinner { width: 46px; height: 46px; border: 4px solid rgba(255,255,255,.18); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
.center-load { display: grid; place-items: center; min-height: 70vh; }

/* ---------- player ---------- */
.player { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; user-select: none; animation: fadeIn .3s ease both; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player.idle, .player.idle * { cursor: none !important; }
.p-ui { position: absolute; inset: 0; transition: opacity .35s; pointer-events: none; }
.p-ui > * { pointer-events: auto; }
.player.idle .p-ui { opacity: 0; }
.p-ui::before, .p-ui::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; }
.p-ui::before { top: 0; height: 160px; background: linear-gradient(180deg, rgba(0,0,0,.7), transparent); }
.p-ui::after { bottom: 0; height: 220px; background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); }
.p-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 22px 28px; }
.p-top .icon-btn { width: 48px; height: 48px; }
.p-top .icon-btn svg { width: 30px; height: 30px; }
.p-title { min-width: 0; }
.p-title .a { font-size: 13px; color: var(--text-2); font-weight: 600; letter-spacing: .3px; }
.p-title .b { font-size: clamp(16px, 1.5vw, 21px); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-mode { margin-left: auto; font-size: 12px; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 3px; padding: 2px 8px; }
.p-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 28px 18px; }
.p-progress { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; margin-bottom: 4px; touch-action: none; }
.p-progress .track { position: relative; width: 100%; height: 4px; background: rgba(255,255,255,.25); border-radius: 2px; transition: height .15s; }
.p-progress:hover .track, .p-progress.drag .track { height: 7px; }
.p-progress .buffered, .p-progress .played, .p-progress .hover { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.p-progress .buffered { background: rgba(255,255,255,.35); }
.p-progress .hover { background: rgba(255,255,255,.2); opacity: 0; }
.p-progress:hover .hover { opacity: 1; }
.p-progress .played { background: var(--red); }
.p-progress .chap { position: absolute; top: 0; bottom: 0; width: 3px; background: rgba(0,0,0,.65); }
.p-progress .knob { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--red); transform: scale(0); transition: transform .15s; }
.p-progress:hover .knob, .p-progress.drag .knob { transform: scale(1); }
.p-progress .bubble { position: absolute; bottom: 24px; transform: translateX(-50%); background: rgba(20,20,20,.92); padding: 4px 9px; border-radius: 4px; font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; white-space: nowrap; transition: opacity .15s; }
.p-progress:hover .bubble, .p-progress.drag .bubble { opacity: 1; }
.p-controls { display: flex; align-items: center; gap: 6px; }
.p-btn { width: 50px; height: 50px; display: grid; place-items: center; background: none; border: 0; color: #fff; border-radius: 50%; transition: transform .15s, background-color .15s; }
.p-btn:hover { transform: scale(1.15); }
.p-btn svg { width: 30px; height: 30px; }
.p-btn.sm svg { width: 26px; height: 26px; }
.p-time { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 6px; color: #e5e5e5; white-space: nowrap; }
.p-spacer { flex: 1; }
.p-center-title { flex: 1; text-align: center; font-size: 15px; font-weight: 600; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
.p-volume { display: flex; align-items: center; }
.p-volume input { width: 0; opacity: 0; transition: width .25s, opacity .25s; accent-color: var(--red); cursor: pointer; }
.p-volume:hover input, .p-volume:focus-within input { width: 90px; opacity: 1; margin-right: 8px; }
.p-skip-btn { height: 36px; padding: 0 12px; border-radius: 4px; border: 1px solid rgba(255,255,255,.45); background: rgba(0,0,0,.3); color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; transition: background-color .2s, border-color .2s; }
.p-skip-btn:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.p-skip-btn svg { width: 16px; height: 16px; }
.p-flash { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; background: rgba(0,0,0,.5); display: grid; place-items: center; opacity: 0; pointer-events: none; }
.p-flash svg { width: 42px; height: 42px; }
.p-flash.show { animation: flash .55s ease-out; }
.p-seek-hint { position: absolute; top: 50%; transform: translateY(-50%); font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; opacity: 0; pointer-events: none; padding: 14px 20px; border-radius: 999px; background: rgba(0,0,0,.45); }
.p-seek-hint.l { left: 12%; } .p-seek-hint.r { right: 12%; }
.p-seek-hint.show { animation: flash .6s ease-out; }
.p-loading { position: absolute; left: 50%; top: 50%; margin: -23px 0 0 -23px; display: none; pointer-events: none; }
.player.waiting .p-loading { display: block; }
.p-toast { position: absolute; left: 50%; top: 90px; transform: translateX(-50%); background: rgba(20,20,20,.9); border-radius: 6px; padding: 9px 16px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 5; }
.p-toast.show { opacity: 1; }

.p-subs { position: absolute; left: 6%; right: 6%; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; z-index: 1; transition: bottom .3s; }
.p-subs.bottom { bottom: 7%; }
.player:not(.idle) .p-subs.bottom { bottom: 150px; }
.p-subs.top { top: 6%; }
.p-subs .cue {
  font-size: calc(3.6vh * var(--sub-scale, 1));
  font-weight: 600; line-height: 1.28; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 3px #000, 1px 1px 3px #000, 0 2px 6px rgba(0,0,0,.6);
  white-space: pre-line; unicode-bidi: plaintext;
}
.p-subs.top .cue { font-size: calc(2.7vh * var(--sub-scale, 1)); }
.p-subs.bg .cue { background: rgba(0,0,0,.72); padding: 2px 10px; border-radius: 3px; text-shadow: none; }

.p-menu {
  position: absolute; right: 28px; bottom: 96px; z-index: 6;
  background: rgba(24,24,24,.97); border-radius: 6px; box-shadow: 0 12px 40px rgba(0,0,0,.6);
  display: flex; max-height: calc(100vh - 160px); overflow: hidden; animation: fadeIn .15s ease both;
}
.p-menu .col { min-width: 220px; max-width: 320px; padding: 18px 8px 12px; overflow-y: auto; }
.p-menu .col + .col { border-left: 1px solid var(--line); }
.p-menu h4 { margin: 0 12px 8px; font-size: 18px; font-weight: 700; }
.p-menu button.opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px 8px 36px; position: relative; border: 0; background: none; color: var(--text-2); text-align: left; font-size: 15px; border-radius: 4px; }
.p-menu button.opt:hover { background: rgba(255,255,255,.08); color: #fff; }
.p-menu button.opt.on { color: #fff; font-weight: 600; }
.p-menu button.opt.on::before { content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 8px; margin-top: -6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg); }
.p-menu .mini { display: flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--text-2); font-size: 14px; }
.p-menu .mini button { width: 30px; height: 30px; border-radius: 4px; border: 1px solid var(--line-2); background: none; color: #fff; font-weight: 700; }
.p-menu .mini button:hover { background: rgba(255,255,255,.1); }
.p-menu .mini output { min-width: 56px; text-align: center; color: #fff; font-variant-numeric: tabular-nums; }
.p-menu .sep { height: 1px; background: var(--line); margin: 10px 12px; }

.p-skip-intro { position: absolute; right: 40px; bottom: 120px; z-index: 4; animation: fadeIn .3s ease both; }
.p-skip-intro .btn { background: rgba(30,30,30,.75); border: 1px solid rgba(255,255,255,.7); color: #fff; }
.p-skip-intro .btn:hover { background: #fff; color: #000; }
.player.idle .p-skip-intro { bottom: 60px; }

.p-next { position: absolute; right: 40px; bottom: 120px; z-index: 4; width: min(380px, 80vw); background: rgba(20,20,20,.92); border-radius: 8px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.6); animation: fadeIn .35s ease both; }
.player.idle .p-next { bottom: 60px; }
.p-next .row1 { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; padding: 14px; align-items: center; }
.p-next img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: var(--bg-3); }
.p-next .k { font-size: 12px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.p-next .t { font-weight: 700; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-next .row2 { display: flex; gap: 8px; padding: 0 14px 14px; }
.p-next .row2 .btn { flex: 1; position: relative; overflow: hidden; }
.p-next .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.18); transform-origin: left; }

.p-error { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; background: rgba(0,0,0,.85); text-align: center; padding: 30px; }
.p-error h3 { margin: 0 0 10px; font-size: 24px; }
.p-error p { color: var(--text-2); max-width: 560px; margin: 0 auto 20px; }
.p-error code { display: block; color: #ff9b9b; font-size: 12.5px; margin: -8px auto 20px; max-width: 640px; word-break: break-word; }

/* ---------- animation ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(6px); } }
@keyframes modalIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flash { 0% { opacity: .95; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- smaller windows ---------- */
@media (max-width: 900px) {
  :root { --gutter: 16px; }
  .nav { gap: 18px; }
  .nav-links { gap: 14px; }
  .nav-right .btn .label { display: none; }
  .nav-search.open, .nav-search:focus-within { width: 170px; }
  .hero-content { max-width: 100%; }
  .hero-cover { display: none; }
  .m-hero-content { left: 22px; right: 22px; bottom: 20px; }
  .m-hero { aspect-ratio: auto; height: clamp(260px, 62vw, 420px); }
  .m-body { grid-template-columns: 1fr; padding: 4px 22px 24px; gap: 16px; }
  .m-section { padding: 0 22px 28px; }
  .ep { grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; padding: 12px 6px; }
  .ep .num { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick { grid-template-columns: 110px minmax(0, 1fr); gap: 16px; }
  .dialog { padding: 24px 20px; }
  .welcome .steps { grid-template-columns: 1fr; }
  .act { grid-template-columns: 100px minmax(0, 1fr); }
  .act .acts { grid-column: 1 / -1; opacity: 1; justify-content: flex-end; }
  .p-top, .p-bottom { padding-left: 14px; padding-right: 14px; }
  .p-center-title, .p-mode { display: none; }
  .p-btn { width: 42px; height: 42px; }
}
@media (max-width: 560px) {
  .nav-links a { font-size: 13px; }
  .logo { font-size: 28px; }
  .nav-search { display: none; }
  .p-volume { display: none; }
}

/* ---------- account (server mode) ---------- */
.icon-btn[hidden] { display: none; }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; }
.btn-discord svg { width: 20px; height: 20px; }
.avatar-btn { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--bg-4); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn:hover { outline: 2px solid rgba(255,255,255,.7); }
.account-head { display: flex; align-items: center; gap: 16px; }
.account-head img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.account-head h2 { margin: 0; }
.account-head .sub { color: var(--text-2); font-size: 14px; }
.gate { text-align: center; }
.gate .lead { max-width: 380px; margin-left: auto; margin-right: auto; }
.gate-mark { width: 92px; margin: 4px auto 14px; }
.gate .btn { min-width: 240px; }
