@font-face { font-family: "Creato"; src: url("/fonts/CreatoDisplay-Regular.otf"); font-weight: 400; }
@font-face { font-family: "Creato"; src: url("/fonts/CreatoDisplay-Medium.otf"); font-weight: 500; }
@font-face { font-family: "Creato"; src: url("/fonts/CreatoDisplay-Bold.otf"); font-weight: 700; }
@font-face { font-family: "Creato"; src: url("/fonts/CreatoDisplay-ExtraBold.otf"); font-weight: 800; }

:root {
  --bg: #000;
  --bar: #141519;
  --panel: #1b1c21;
  --panel-2: #23252b;
  --line: #2c2f36;
  --text: #fff;
  --muted: #a0a3ab;
  --dim: #6e727b;
  --accent: #7ccf00;
  --on-accent: #04140a;
  --top-h: 52px;
  --tab-h: 58px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 14px/1.45 "Creato", -apple-system, system-ui, sans-serif;
  min-height: 100vh;
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- top bar */
.top {
  position: sticky; top: 0; z-index: 20;
  height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) 6px 0 8px;
  display: flex; align-items: center; gap: 2px;
  background: var(--bar);
}
.brand { display: flex; align-items: center; padding: 0 6px; }
.brand img { height: 22px; width: auto; }
.back, .top-search {
  width: 40px; height: 40px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--text);
}
.top-search { margin-left: auto; }
.back svg, .top-search svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

main { max-width: 760px; margin: 0 auto; }

/* ---- bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, #07080a 84%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid color-mix(in srgb, #23272f 70%, transparent);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #8b93a1; font-size: 10.5px; font-weight: 500; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on svg { stroke-width: 2.3; }

/* ---- buttons */
.btn {
  height: 40px; padding: 0 16px; border-radius: 3px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--on-accent);
  font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.line { background: transparent; color: var(--text); border-color: var(--text); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn:first-child { flex: 1; }
.icon-btn { width: 40px; flex: none; padding: 0; }
.icon-btn.on svg { fill: currentColor; }
.text-btn { background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; cursor: pointer; }

/* ---- home hero */
.hero { position: relative; overflow: hidden; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; height: min(132vw, 600px); }
.slide > img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.65) 62%, #000 92%); }
.slide-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 16px 22px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.slide-logo { max-width: 62%; max-height: 92px; object-fit: contain; margin-bottom: 12px; filter: drop-shadow(0 4px 14px rgba(0,0,0,.6)); }
.slide-title { font-size: 26px; font-weight: 800; line-height: 1.1; margin: 0 0 10px; text-shadow: 0 3px 14px #000; }
.slide-meta { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.slide .btn-row { width: 100%; max-width: 380px; }
.dots { display: flex; gap: 6px; justify-content: center; padding: 6px 0 4px; }
.dots i { width: 14px; height: 4px; border-radius: 2px; background: #4a4d55; transition: width .2s, background .2s; }
.dots i.on { width: 28px; background: var(--accent); }

/* ---- rows */
.row { margin-top: 30px; }
.row-title { padding: 0 16px; }
.row-title h2 { font-size: 18px; font-weight: 800; margin: 0; }
.see-all { float: right; margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--accent); }
.row-title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.rail { display: flex; gap: 10px; overflow-x: auto; padding: 12px 16px 2px; scroll-snap-type: x proximity; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail .card { flex: 0 0 37%; max-width: 170px; scroll-snap-align: start; }
.rail.wide .card { flex: 0 0 68%; max-width: 320px; }

/* ---- continue watching: the episode's picture */
.still { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel); }
.still img { width: 100%; height: 100%; object-fit: cover; }
.still img.blur { filter: blur(10px) brightness(.7); transform: scale(1.2); }
.still .pl { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; }
.still .pl svg { width: 16px; height: 16px; fill: #fff; margin-left: 2px; }
.still .dur { position: absolute; right: 0; bottom: 0; padding: 1px 6px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.8); }
.cw .ep-show { margin-top: 7px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw .name { margin-top: 1px; -webkit-line-clamp: 1; }
.cw-list { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 0 16px; }
@media (min-width: 560px) { .cw-list { grid-template-columns: repeat(2, 1fr); } }

/* ---- cards */
.card { min-width: 0; display: block; }
.poster { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: var(--panel); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .tag { position: absolute; left: 0; bottom: 0; padding: 2px 7px; font-size: 10px; font-weight: 800; background: var(--accent); color: var(--on-accent); letter-spacing: .4px; }
.card .name { margin-top: 7px; font-size: 13px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 12px; padding: 0 16px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- page headers */
.page-head { display: flex; align-items: center; gap: 6px; padding: 18px 10px 4px 16px; }
.page-head h1 { font-size: 20px; font-weight: 700; margin: 0; flex: 1; }
.sec-title { font-size: 15px; font-weight: 700; padding: 10px 16px 12px; margin: 0; }

/* ---- show */
.poster-hero { position: relative; aspect-ratio: 3 / 4; max-height: 74vh; width: 100%; overflow: hidden; background: var(--panel); }
.poster-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.poster-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 70%, #000 100%); }
.show-body { padding: 12px 16px 0; }
.title-line { display: flex; align-items: flex-start; gap: 10px; }
.title-line h1 { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.2; flex: 1; }
.subdub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stars { display: flex; gap: 6px; margin: 16px 0 6px; }
.stars svg { width: 22px; height: 22px; }
.stars .full { fill: var(--text); }
.stars .half { fill: url(#half); }
.stars .none { fill: none; stroke: var(--dim); stroke-width: 1.6; }
.rating-line { font-size: 12px; color: var(--muted); }
.rating-line b { color: var(--text); }
.show-body .btn-row { margin-top: 18px; }
.add-list { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; background: none; border: 0; padding: 4px 0; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.add-list svg { width: 18px; height: 18px; }
.add-list.on { color: var(--accent); }
.desc { color: #d6d8dd; font-size: 13px; white-space: pre-line; margin: 16px 0 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.desc.open { -webkit-line-clamp: unset; }
.genres { color: var(--muted); font-size: 12px; margin-top: 10px; }

.season-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 0; padding: 14px 10px 10px 16px; border-top: 1px solid var(--line); }
.season-head h2 { font-size: 14px; font-weight: 700; margin: 0; text-transform: uppercase; letter-spacing: .4px; }
.season-head .tools { display: flex; align-items: center; gap: 2px; }
.tool { width: 38px; height: 38px; border: 0; background: none; display: grid; place-items: center; color: var(--text); cursor: pointer; }
.tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 6px 12px; font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.seg button:disabled { opacity: .35; }

/* ---- episodes */
.eps { display: flex; flex-direction: column; gap: 14px; padding: 0 16px; }
.ep { display: flex; gap: 12px; align-items: flex-start; }
.ep .thumb { width: 44%; max-width: 200px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel); flex: none; position: relative; }
.ep .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep .thumb .pl { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; }
.ep .thumb .pl svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }
.ep .thumb .dur { position: absolute; right: 0; bottom: 0; padding: 1px 6px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.8); }
.track { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.28); }
.track i { display: block; height: 100%; background: var(--accent); }
.ep .thumb .dur, .still .dur { bottom: 4px; }
.ep .thumb .pl .ok { width: 16px; height: 16px; stroke: #fff; stroke-width: 3; margin: 0; }
.ep.done .thumb img { opacity: .55; }
.ep .seen { color: var(--accent); font-weight: 700; }
.show-progress { margin-top: 14px; }
.sp-line { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.sp-line span:last-child { color: var(--text); font-weight: 500; }
.sp-bar { height: 4px; background: var(--panel-2); margin-top: 6px; border-radius: 2px; overflow: hidden; }
.sp-bar i { display: block; height: 100%; background: var(--accent); }

/* ---- mouse dragging for sideways rows (touch scrolls natively) */
.rail, .hero-track { cursor: grab; }
.rail.dragging, .hero-track.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.rail a, .rail img, .hero-track a, .hero-track img { -webkit-user-drag: none; user-select: none; }
.ep .ep-show { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.ep .ep-title { font-size: 13px; font-weight: 500; line-height: 1.3; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep .ep-sd { font-size: 11px; color: var(--muted); margin-top: 3px; }
.ep.on .ep-title { color: var(--accent); }
.more-eps { margin: 18px 16px 0; }

/* ---- watch */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }
.watch-body { padding: 14px 16px 0; }
.watch-body .show-link { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.watch-body .mini-rating { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.watch-body h1 { font-size: 17px; font-weight: 700; margin: 12px 0 0; }
.watch-body .released { font-size: 11px; color: var(--muted); margin-top: 6px; }
.player-opts { margin: 18px 16px 0; padding: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; }
.opt .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.servers { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.server { height: 30px; padding: 0 12px; border-radius: 3px; border: 1px solid var(--line); background: none; font-size: 11px; font-weight: 800; letter-spacing: .4px; cursor: pointer; }
.server.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line); border: 0; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }
.next-head { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 20px 16px 10px; margin: 0; }

/* ---- search */
.search-box { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 10px 0 16px; background: var(--bar); }
.search-box input { flex: 1; height: 44px; border: 0; border-bottom: 2px solid var(--accent); background: none; font-size: 18px; outline: none; -webkit-appearance: none; appearance: none; border-radius: 0; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box .tool { margin-bottom: -2px; }
.search-pad { height: 14px; background: var(--bar); }
.results { display: flex; flex-direction: column; gap: 14px; padding: 0 16px; }
.result { display: flex; gap: 12px; align-items: center; }
.result .poster { width: 56px; flex: none; }
.result .name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.result .sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---- lists / account */
.tabs { display: flex; gap: 22px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bar); }
.tabs button { background: none; border: 0; padding: 14px 0 12px; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.signin { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 24px 10px; gap: 10px; }
.signin img { width: 120px; height: 120px; border-radius: 26px; margin-bottom: 12px; }
.signin h1 { font-size: 16px; margin: 0; font-weight: 700; }
.signin p { color: var(--muted); font-size: 12px; margin: 0 0 12px; max-width: 300px; }
.signin .btn { width: 100%; max-width: 360px; }
.list { margin: 0 16px; border-top: 1px solid var(--line); }
.list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 2px; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; font-size: 14px; }
.list .dot { width: 20px; height: 20px; border-radius: 50%; flex: none; }
.list .tick { margin-left: auto; color: var(--accent); font-weight: 800; }

/* ---- filter sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: calc(var(--safe-t) + 40px); z-index: 41;
  background: var(--bar); display: flex; flex-direction: column; padding-bottom: calc(16px + var(--safe-b));
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 6px 10px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 16px; }
.sheet-body h3 { font-size: 14px; font-weight: 700; margin: 18px 0 6px; }
.radio { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: 13px; color: var(--muted); cursor: pointer; }
.radio input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); margin: 0; display: grid; place-items: center; }
.radio input:checked { border-color: var(--accent); }
.radio input:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.radio:has(input:checked) { color: var(--text); }
.sheet-foot { padding: 12px 16px 0; }

/* ---- states */
.empty { color: var(--muted); text-align: center; padding: 48px 24px; font-size: 13px; }
.skel { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
@keyframes skel { to { background-position: -200% 0; } }
.soon { margin: 70px 24px; text-align: center; color: var(--muted); font-size: 13px; }
.soon svg { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; }
.soon h1 { color: var(--text); font-size: 18px; margin: 0 0 6px; }

/* ---- login (password page) */
body.login { display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.login-logo { height: 40px; width: auto; align-self: center; margin-bottom: 18px; }
.login-card label { font-size: 13px; color: var(--muted); }
.login-card input { height: 48px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); padding: 0 14px; font-size: 16px; outline: none; }
.login-card input:focus { border-color: var(--accent); }
.login-wrong { color: #ff6b6b; font-size: 13px; margin: 0; }
.login-card .btn { margin-top: 8px; }

/* ---- settings */
.settings { padding-bottom: 20px; }
.settings .sec-title { padding-top: 26px; }
.set-group { margin: 0 16px; border-top: 1px solid var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.set-row.col { flex-wrap: wrap; }
.set-row > span:first-child { flex: 1; min-width: 160px; }
.set-row b { display: block; font-size: 14px; font-weight: 500; }
.set-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.set-note { margin: -4px 16px 12px; font-size: 12px; color: var(--muted); }
.btn.small { height: 32px; padding: 0 12px; font-size: 11px; }
.pill { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; flex: none; }
.pill.ok { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.pill.warn { background: rgba(255, 176, 32, .16); color: #ffb020; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 16px; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; text-align: center; }
.stats b { display: block; font-size: 22px; font-weight: 800; color: var(--accent); }
.stats span { font-size: 11px; color: var(--muted); }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; }

/* ---- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 50;
  transform: translate(-50%, 10px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 500;
  background: rgba(30, 32, 38, .96); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- AniList sign-in */
.signin img.avatar { border-radius: 50%; object-fit: cover; }
.code-in { width: 100%; max-width: 360px; height: 46px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); padding: 0 14px; font-size: 16px; color: var(--text); outline: none; }
.code-in:focus { border-color: var(--accent); }
.signin a.btn { text-decoration: none; }

/* ---- Yoru+ account */
.signin .seg { margin: 4px 0 6px; }
.auth-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.auth-form .btn { width: 100%; }
.link-box { margin: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.link-box p { margin: 0; color: var(--muted); font-size: 13px; }
.link-box .btn, .link-box .code-in { width: 100%; max-width: none; }
.al-who { display: flex; align-items: center; gap: 12px; }
.al-who img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
#pw-form .code-in { max-width: none; }
#pw-form .btn { margin-left: auto; }

/* ---- AniList: genres and ratings */
.card .sub .rate, .result .sub .rate { color: var(--accent); font-weight: 700; }
.genre-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.genre-chips .chip { font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); background: var(--panel); }
.genre-pick { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 6px; }
.gchip input { display: none; }
.gchip span { display: inline-block; font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.gchip input:checked + span { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 700; }
.seg-row { display: flex; gap: 14px; flex-wrap: wrap; }
.sheet-foot { display: flex; gap: 10px; }
.sheet-foot .btn.line { flex: none; }
.tool.on { color: var(--accent); }
.toast { display: flex; align-items: center; gap: 12px; }
.toast-btn { background: none; border: 0; color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; cursor: pointer; padding: 4px 0; flex: none; pointer-events: auto; }
.toast.show { pointer-events: auto; }

/* ---- Install button and the iPhone guide */
.top-install { margin-left: auto; height: 30px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800; letter-spacing: .4px; cursor: pointer; }
.top-install:not([hidden]) + .top-search { margin-left: 4px; }
.install-guide { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 18px; }
.ig-icon { width: 84px; height: 84px; border-radius: 20px; margin-bottom: 12px; }
.ig-lead { color: var(--muted); font-size: 14px; margin: 0 0 18px; max-width: 320px; }
.ig-steps { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.ig-steps li { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.4; }
.ig-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.ig-chip { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--panel-2); vertical-align: middle; color: #3d8bff; }
.ig-chip svg { width: 18px; height: 18px; }
.ig-arrow { position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); color: var(--accent); animation: ig-bob 1.2s ease-in-out infinite; }
.ig-arrow svg { width: 34px; height: 34px; stroke-width: 2.6; }
@keyframes ig-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---- Welcome (installed app, signed out) */
body.welcome-on .top, body.welcome-on .tabbar { display: none !important; }
body.welcome-on { padding-bottom: 0; }
.welcome { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: calc(40px + var(--safe-t)) 24px calc(30px + var(--safe-b)); text-align: center;
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
.w-icon { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.w-logo { height: 34px; width: auto; margin-top: 6px; }
.w-lead { color: var(--muted); font-size: 14px; max-width: 320px; margin: 0 0 8px; line-height: 1.45; }
.welcome .seg { margin-bottom: 4px; }
.welcome .text-btn { margin-top: 6px; }

/* ---- No zooming and no sideways page movement (it behaves like an app). Pages scroll up and
   down only; the sideways rows, the banner and tab strips still scroll sideways. Text fields are
   16px so iPhone doesn't zoom in when you tap one. */
html, body { overflow-x: hidden; overscroll-behavior: none; }
html, body { touch-action: pan-y; }
.rail, .hero-track, .tabs, .genre-pick, .sheet-body, .servers { touch-action: pan-x pan-y; }
.player, .player iframe { touch-action: auto; }
input, select, textarea { font-size: 16px !important; }
main, .top, .tabbar { max-width: 100vw; }

/* ---- The frame: a little space around the whole app and a rounded border, like a card on the
   screen. A fixed outline sits on top (taps pass through it); everything outside it is black. */
:root { --edge: 7px; --frame-r: 22px; }
html { background: #000; }
body::after {
  content: ""; position: fixed; z-index: 60; pointer-events: none;
  top: calc(var(--safe-t) + var(--edge)); left: var(--edge); right: var(--edge); bottom: calc(var(--safe-b) + var(--edge));
  border-radius: var(--frame-r);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 200px #000;
}
/* The bars and panels sit inside the frame. */
.top { padding-top: calc(var(--safe-t) + var(--edge)); padding-left: calc(8px + var(--edge)); padding-right: calc(6px + var(--edge)); height: calc(var(--top-h) + var(--safe-t) + var(--edge)); }
.tabbar { left: var(--edge); right: var(--edge); bottom: calc(var(--safe-b) + var(--edge)); padding-bottom: 0; height: var(--tab-h); border-radius: 0 0 var(--frame-r) var(--frame-r); }
body { padding-bottom: calc(var(--tab-h) + var(--safe-b) + var(--edge) + 20px); }
main { padding-left: var(--edge); padding-right: var(--edge); }
.sheet { left: var(--edge); right: var(--edge); bottom: calc(var(--safe-b) + var(--edge)); border-radius: 0 0 var(--frame-r) var(--frame-r); }
.toast { bottom: calc(var(--tab-h) + var(--safe-b) + var(--edge) + 14px); }
body.welcome-on { padding-bottom: 0; }
.welcome { padding: calc(40px + var(--safe-t)) calc(24px + var(--edge)) calc(30px + var(--safe-b)); }

/* ---- Seasons row on a show page */
.seasons { display: flex; gap: 8px; overflow-x: auto; padding: 18px 16px 0; scrollbar-width: none; touch-action: pan-x pan-y; }
.seasons::-webkit-scrollbar { display: none; }
.season-chip { flex: none; display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 13px; font-weight: 700; white-space: nowrap; }
.season-chip small { font-size: 11px; font-weight: 500; color: var(--muted); }
.season-chip.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.season-chip.on small { color: inherit; opacity: .75; }

/* ---- Delete on Continue watching, and the History tab */
.card.cw { position: relative; }
.cw-del { position: absolute; z-index: 2; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }
.cw-del svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.hist-head { display: flex; justify-content: flex-end; padding: 0 16px; }
.hist { padding: 0 6px 0 16px; }
.hist-day { padding-left: 0 !important; margin-top: 14px; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--text); }
.hist-pic { position: relative; flex: none; width: 128px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--panel); }
.hist-pic img { width: 100%; height: 100%; object-fit: cover; }
.hist-text { flex: 1; min-width: 0; }
.hist-text .ep-show { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-text .name { font-size: 14px; font-weight: 700; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hist-when { font-size: 11px; color: var(--muted); margin-top: 3px; }
.hist-del { flex: none; color: var(--muted); }

/* ---- Settings → Account: Profile and Sync */
.profile { margin: 0 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.pf-banner { position: relative; aspect-ratio: 3 / 1; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, var(--panel-2)), var(--panel-2)); background-size: cover; background-position: center; }
.pf-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.pf-tools .btn, .pf-av-tools .btn { background: rgba(0,0,0,.6); }
.pf-me { display: flex; align-items: flex-end; gap: 12px; padding: 0 14px; margin-top: -34px; position: relative; }
.pf-av { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--panel); background: var(--panel-2); flex: none; }
.pf-av-tools { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 4px; }
.pf-field { display: block; padding: 12px 14px 0; }
.pf-field:last-of-type { padding-bottom: 14px; }
.pf-field span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pf-field .code-in { width: 100%; box-sizing: border-box; }
.pf-field textarea.code-in { resize: vertical; min-height: 70px; font-family: inherit; line-height: 1.4; }
.pf-bio-show { white-space: pre-line; }
.pair-join { display: flex; gap: 8px; margin-top: 10px; }
.pair-join .code-in { flex: 1; text-transform: uppercase; letter-spacing: 3px; font-weight: 700; }
.pair-code { font-size: 18px; letter-spacing: 3px; color: var(--accent); }
.pf-tools { top: 8px; bottom: auto; }
.pf-me { align-items: flex-end; }
.pf-av-tools { flex-wrap: nowrap; padding-bottom: 2px; }

/* ---- Leaderboard (as the PC app's, stacked for a phone) */
.lb { padding: 18px 16px 10px; }
.lb-head h1 { margin: 0 0 6px; font-size: 24px; }
.lb-head p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.lb-card { border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.lb-grow { flex: 1; min-width: 0; }
.rank-ico { flex: none; display: block; filter: drop-shadow(0 3px 8px rgba(0,0,0,.35)); }
.lb-join-card, .lb-me { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 18px; }
.lb-join-card h3 { margin: 0 0 4px; font-size: 16px; }
.lb-join-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.lb-join-card .btn { flex: none; white-space: nowrap; }
.lb-lv { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lb-rank-name { font-size: 18px; font-weight: 800; margin: 1px 0 8px; }
.lb-bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.lb-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s ease; }
.lb-next { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.lb-next b { color: var(--text); }
.lb-place { display: flex; flex-direction: column; align-items: center; flex: none; min-width: 58px; padding-left: 12px; border-left: 1px solid var(--line); }
.lb-place b { font-size: 24px; line-height: 1.1; }
.lb-place span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.lb-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 10px; }
.lb-list { list-style: none; margin: 0; padding: 4px 0; }
.lb-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.lb-list li + li { border-top: 1px solid var(--line); }
.lb-list li.me { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.lb-n { width: 22px; text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-list li:nth-child(1) .lb-n { color: #f5c542; } .lb-list li:nth-child(2) .lb-n { color: #c8ccd4; } .lb-list li:nth-child(3) .lb-n { color: #d08a4e; }
.lb-av { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: rgba(255,255,255,.1) center / cover; color: #fff; }
.lb-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.lb-you { margin-left: 4px; padding: 1px 6px; border-radius: 99px; font-size: 10px; background: var(--accent); color: var(--on-accent); vertical-align: 2px; }
.lb-sub { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.lb-v { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13px; }
.lb-empty { justify-content: center; padding: 24px 14px !important; color: var(--muted); font-size: 13px; text-align: center; }
.lb-leave { margin-top: 8px; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 4px 2px; }
.lb-ladder { margin-top: 18px; padding: 14px 8px 8px; }
.lb-ladder h2 { margin: 0 8px 6px; font-size: 15px; }
.lb-ladder ol { list-style: none; margin: 0; padding: 0; }
.lb-ladder li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.lb-ladder li .lb-grow { display: flex; flex-direction: column; }
.lb-ladder li .lb-lv { color: var(--muted); font-size: 9.5px; }
.lb-ladder li b { font-size: 13px; }
.lb-xp { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-ladder li.now { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.lb-ladder li.now .lb-lv { color: var(--accent); }
.lb-ladder li.locked .rank-ico { filter: grayscale(1) brightness(.55); opacity: .7; }
.lb-ladder li.locked b { color: var(--muted); }
.tabbar a span { white-space: nowrap; }

.tabbar { grid-template-columns: repeat(6, 1fr); }
.tabbar a { font-size: 10px; min-width: 0; }

/* Tabs keep their size so the row scrolls (and drags) instead of squeezing. */
.tabs button { flex: none; }
.tabs.dragging, .seasons.dragging { cursor: grabbing; }

/* ---- Schedule on Home */
.sched-days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; touch-action: pan-x pan-y; }
.sched-days::-webkit-scrollbar { display: none; }
.sched-days button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 64px; padding: 7px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 800; cursor: pointer; }
.sched-days button small { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.sched-days button.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.sched-days button.on small { color: inherit; opacity: .75; }
.sched-list { display: flex; flex-direction: column; gap: 2px; padding: 0 16px; max-height: 360px; overflow-y: auto; overscroll-behavior: contain; }
.sched-item { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.sched-item.skel { border-radius: 10px; border: 0; margin-bottom: 6px; }
.sched-item.aired { opacity: .55; }
.sched-time { flex: none; width: 62px; font-size: 12.5px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.sched-item img { flex: none; width: 40px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--panel); }
.sched-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sched-text b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-text small { font-size: 11.5px; color: var(--muted); }
.sched-mine { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; padding: 3px 7px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.sched-list { position: relative; }

/* ---- Manga: chapter progress */
.m-progress { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.m-prog-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.m-prog-head span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.m-step { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.m-step .code-in { width: 84px; text-align: center; font-weight: 800; }
.m-step .btn { flex: none; }
.m-step .btn:last-child { flex: 1; }

/* ---- Schedule, cleaner: plain day tabs and a row of cards like the rest of Home */
.sched-days { gap: 18px; padding: 2px 16px 0; border-bottom: 1px solid var(--line); margin: 0 16px; padding-left: 0; padding-right: 0; }
.sched-days button { min-width: 0; padding: 8px 0 9px; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 700; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sched-days button.on { background: none; color: var(--text); border-bottom-color: var(--accent); }
.sched-rail { max-height: none; flex-direction: row; gap: 10px; padding: 12px 16px 2px; overflow-y: visible; }
.sched-time { position: absolute; left: 6px; top: 6px; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; background: rgba(0,0,0,.72); color: #fff; font-variant-numeric: tabular-nums; width: auto; }
.sched-card.aired .sched-time { background: var(--accent); color: var(--on-accent); }
.sched-card.mine .poster { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---- Manga chapters and the reader */
.ch-list { padding: 0 16px 10px; }
.ch-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.ch-row.skel { border-radius: 10px; border: 0; margin-bottom: 6px; }
.ch-n { flex: none; min-width: 44px; font-size: 13px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.ch-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ch-t b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-t small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-row.done .ch-t b, .ch-row.done .ch-n { color: var(--muted); }
.ch-done svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 2.4; }

body.reading .tabbar, body.reading .top { display: none !important; }
body.reading { padding-bottom: 0; background: #000; }
body.reading main { padding-left: 0; padding-right: 0; }
body.reading::after { display: none; }
.reader { min-height: 100vh; background: #000; }
.rd-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; padding: calc(6px + var(--safe-t)) 8px 6px 4px; background: rgba(8,9,11,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); transition: transform .25s ease; }
.rd-bar.hide { transform: translateY(-100%); }
.rd-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rd-title b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-title small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-bar select { flex: none; max-width: 104px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.rd-pages { display: flex; flex-direction: column; align-items: center; touch-action: pan-x pan-y pinch-zoom; }
.rd-pages img { display: block; width: 100%; max-width: 900px; height: auto; min-height: 200px; background: #0d0e11; }
.rd-pages img[src] { min-height: 0; }
.rd-wait { padding: 120px 20px; color: var(--muted); text-align: center; }
.rd-end { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 20px calc(40px + var(--safe-b)); text-align: center; }
.rd-end > p { margin: 0; color: var(--muted); font-size: 13px; }
.rd-end .btn { min-width: 220px; }
.rd-end-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---- Reader: options, backgrounds, fit, page-at-a-time */
.reader.bg-gray, .reader.bg-gray .rd-pages img { background: #2a2c31; }
.reader.bg-white, .reader.bg-white .rd-pages img { background: #f4f4f4; }
.reader.bg-white .rd-end > p, .reader.bg-white .rd-end .set-note { color: #555; }
.reader.gaps .rd-pages { gap: 12px; }
.reader.fit-height .rd-pages img { width: auto; max-width: 100%; max-height: calc(100vh - 56px); }
.reader.fit-original .rd-pages img { width: auto; max-width: none; }
.reader.fit-original .rd-pages { overflow-x: auto; align-items: flex-start; }
.rd-count { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 4px; }
.rd-stage { position: relative; min-height: calc(100vh - 56px); display: flex; align-items: center; justify-content: center; }
.rd-stage img { display: block; max-width: 100%; height: auto; }
.reader.fit-height .rd-stage img { max-height: calc(100vh - 56px - var(--safe-t)); width: auto; }
.reader.fit-width .rd-stage img { width: 100%; max-width: 900px; }
.reader.fit-original .rd-stage { overflow: auto; justify-content: flex-start; align-items: flex-start; }
.reader.fit-original .rd-stage img { max-width: none; }
.rd-stage img[hidden], .rd-endpage[hidden] { display: none; }
.rd-endpage { width: 100%; }
.rd-tap { position: absolute; top: 0; bottom: 0; border: 0; background: transparent; padding: 0; cursor: pointer; z-index: 2; -webkit-tap-highlight-color: transparent; }
.rd-tap.left { left: 0; width: 34%; }
.rd-tap.right { right: 0; width: 34%; }
.rd-tap.mid { left: 34%; right: 34%; }
.rd-endpage:not([hidden]) ~ .rd-tap.mid { display: none; }
.rd-side-bg { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.5); }
.rd-side { position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(86vw, 340px); background: var(--bg, #0b0c0f); border-left: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; padding-top: var(--safe-t); padding-bottom: var(--safe-b); }
.rd-side.in { transform: none; }
.rd-side-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 8px 18px; border-bottom: 1px solid var(--line); }
.rd-side-head h2 { margin: 0; font-size: 17px; }
.rd-side-body { flex: 1; overflow-y: auto; padding: 4px 18px 20px; overscroll-behavior: contain; }
.rd-side h3 { margin: 18px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.rd-seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rd-seg button { flex: 1; border: 0; background: none; color: var(--text); padding: 9px 4px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.rd-seg button + button { border-left: 1px solid var(--line); }
.rd-seg button.on { background: var(--accent); color: var(--on-accent); }
.rd-hint { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.rd-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 0; }
.rd-row span { display: flex; flex-direction: column; font-size: 13.5px; }
.rd-row small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.rd-chs { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rd-chs a { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; color: var(--text); font-size: 13px; }
.rd-chs a + a { border-top: 1px solid var(--line); }
.rd-chs a b { flex: none; min-width: 34px; color: var(--accent); font-variant-numeric: tabular-nums; }
.rd-chs a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-chs a.done { color: var(--muted); }
.rd-chs a.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.rd-side-body { position: relative; }
.rd-side.no-anim { transition: none; }

/* ---- Video loading screen (as the PC app's): the show's logo over a blurred, slowly drifting
   backdrop. The logo rises in out of a blur, then breathes with a soft glow in the theme color
   while a light sweeps across it; a thin bar runs along the bottom. Taps pass through to the player. */
.player { position: relative; }
.ld { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; overflow: hidden; background: #000;
  container-type: size; pointer-events: none; transition: opacity .7s ease, visibility .7s; }
.ld.out { opacity: 0; visibility: hidden; }
.ld-bg { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(24px) brightness(.42) saturate(1.25);
  transform: scale(1.08); animation: ld-drift 16s ease-in-out infinite alternate, ld-fade 1.2s ease both; }
.ld-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,.05) 0%, rgba(0,0,0,.72) 78%); }
.ld-mid { position: relative; display: flex; flex-direction: column; align-items: center; gap: max(8px, 2.4cqh); padding: 0 6cqw; text-align: center;
  transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.ld.out .ld-mid { transform: scale(1.06); }
.ld-art { position: relative; display: block; animation: ld-in 1.1s cubic-bezier(.2,.8,.2,1) both; }
.ld-art img { display: block; max-width: 56cqw; max-height: 34cqh; object-fit: contain;
  animation: ld-breathe 3.4s ease-in-out 1.1s infinite; filter: drop-shadow(0 6px 22px rgba(0,0,0,.65)); }
.ld-shine { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.85) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%; mix-blend-mode: overlay; animation: ld-sweep 2.8s ease-in-out 1.2s infinite; }
.ld-name { margin: 0; max-width: 76cqw; font-weight: 800; font-size: clamp(18px, 7cqw, 44px); line-height: 1.05; letter-spacing: -.01em; color: transparent;
  background: linear-gradient(105deg, #fff 38%, var(--accent) 50%, #fff 62%) 120% 0 / 260% 100% no-repeat, #fff;
  -webkit-background-clip: text; background-clip: text;
  animation: ld-in 1.1s cubic-bezier(.2,.8,.2,1) both, ld-sweep 2.8s ease-in-out 1.2s infinite; }
.ld-ep { color: rgba(255,255,255,.72); font-weight: 700; font-size: max(10px, 2.6cqw); letter-spacing: .14em; text-transform: uppercase;
  max-width: 76cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: ld-fade .8s ease .55s both; }
.ld-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.07); overflow: hidden; }
.ld-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 34%; background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: ld-load 1.5s ease-in-out infinite; }
@keyframes ld-in { from { opacity: 0; transform: translateY(16px) scale(.9); filter: blur(12px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes ld-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ld-drift { to { transform: scale(1.2) translate(-2%, -1.5%); } }
@keyframes ld-breathe { 50% { transform: scale(1.03);
  filter: drop-shadow(0 6px 22px rgba(0,0,0,.65)) drop-shadow(0 0 26px color-mix(in srgb, var(--accent) 50%, transparent)); } }
@keyframes ld-sweep { from { background-position: 120% 0, 0 0; } to { background-position: -20% 0, 0 0; } }
@keyframes ld-load { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* ---- Reader: book mode, two pages side by side like an open book (right to left: the earlier
   page on the right, as in a printed manga). The pair fits the screen's height and width. */
.rd-stage.book { gap: 0; }
.rd-stage.book.rtl { flex-direction: row-reverse; }
.rd-stage.book img.half { width: auto; max-width: 50%; max-height: calc(100vh - 56px - var(--safe-t)); object-fit: contain; }
.reader.fit-width .rd-stage.book img.half { width: 50%; height: auto; max-height: none; }
.reader.fit-height .rd-stage.book img.half { width: auto; max-width: 50%; max-height: calc(100vh - 56px - var(--safe-t)); }
.reader.gaps .rd-stage.book { gap: 6px; }
.reader.gaps .rd-stage.book img.half { max-width: calc(50% - 3px); }
.rd-stage.book .rd-endpage { flex: 1 1 100%; }
.lb-unlisted { display: flex; align-items: center; gap: 12px; margin: -8px 0 18px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.lb-unlisted p { margin: 0; flex: 1; }
.lb-unlisted .btn { flex: none; }

/* ---- XP pop-up (an episode counted): small, under the top bar, gone in a few seconds, never in the way */
.xp-pop { position: fixed; z-index: 80; left: 50%; top: calc(var(--safe-t) + var(--edge, 0px) + 62px); display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 10px; border-radius: 14px; background: rgba(16,17,20,.92); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 26px rgba(0,0,0,.45);
  pointer-events: none; opacity: 0; transform: translate(-50%, -12px); transition: opacity .3s ease, transform .3s ease; max-width: min(86vw, 320px); }
.xp-pop.in { opacity: 1; transform: translate(-50%, 0); }
.xp-pop .rank-ico { flex: none; }
.xp-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.xp-text b { font-size: 14px; color: var(--accent); white-space: nowrap; }
.xp-text small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xp-bar { display: block; width: 150px; max-width: 100%; height: 3px; margin-top: 3px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.xp-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
body.reading .xp-pop { top: calc(var(--safe-t) + 60px); }
@media (prefers-reduced-motion: reduce) { .xp-pop { transition: opacity .2s; transform: translate(-50%, 0); } }
