/* Scoped to manga pages. The existing game catalog and editor are untouched. */
.manga-site { --manga-blue:#a6cfff; --manga-muted:#b1c6df; --manga-line:#2b4668; }
.manga-site [hidden] { display:none !important; }
.manga-site a { color:var(--manga-blue); }
.manga-site :is(a,button,input,select):focus-visible { outline:2px solid #b6dbff; outline-offset:4px; }
.manga-main { width:calc(100% - 40px); max-width:1200px; margin:40px auto 64px; flex:1; min-width:0; }
.manga-heading { margin-bottom:28px; }
.manga-eyebrow { font-size:12px; font-weight:bold; letter-spacing:.14em; color:#8ac3ff; margin-bottom:12px; }
.manga-heading h1 { font-size:clamp(28px,4vw,42px); line-height:1.18; color:#edf6ff; margin-bottom:12px; overflow-wrap:anywhere; }
.manga-heading p:not(.manga-eyebrow) { max-width:650px; color:var(--manga-muted); line-height:1.7; }
.manga-breadcrumb { display:flex; flex-wrap:wrap; gap:12px; font-size:14px; margin-bottom:25px; }
.manga-breadcrumb a { text-decoration:none; }
.manga-surface { padding:28px; border-radius:16px; border:1px solid var(--manga-line); background:linear-gradient(125deg,rgba(37,117,221,.08),transparent 65%),#132238; }
.manga-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; min-height:310px; gap:16px; padding:38px 24px; }
.manga-empty svg { width:62px; height:62px; color:#8ac3ff; margin-bottom:6px; }
.manga-empty :is(h1,h2) { font-size:23px; color:#e4f1ff; line-height:1.35; }
.manga-empty p { color:var(--manga-muted); max-width:490px; line-height:1.75; }
.manga-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:11px 18px; border:1px solid #3b6798; background:#205daa; border-radius:9px; color:#fff !important; text-decoration:none; font-size:15px; line-height:1.4; cursor:pointer; }
.manga-button:hover { background:#2c70bd; }
.manga-button.secondary { background:#182f4c; }
.manga-button:disabled { opacity:.45; cursor:not-allowed; }
.manga-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:22px; }
.manga-tools { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:16px; margin-bottom:26px; }
.manga-tools label { display:block; font-size:14px; color:#ccdef3; margin-bottom:9px; }
.manga-search { display:flex; align-items:center; gap:10px; padding:0 14px; border:1px solid #365e86; background:#101e32; border-radius:10px; }
.manga-search input { width:100%; min-width:0; padding:14px 0; font-size:16px; color:white; background:transparent; border:0; outline:0; }
.manga-search:focus-within { outline:2px solid #93c5fd; outline-offset:2px; }
.manga-search button { background:none; color:#b6dbff; border:0; padding:10px 0; cursor:pointer; min-height:44px; }
.manga-count { color:var(--manga-muted); font-size:14px; padding-bottom:14px; }
.manga-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:24px; align-items:start; }
.manga-card { min-width:0; width:100%; border:1px solid var(--manga-line); border-radius:14px; background:#14233a; overflow:hidden; display:flex; flex-direction:column; }
.manga-cover { display:block; width:100%; height:auto; aspect-ratio:2/3; object-fit:contain; background:#101b2c; }
.manga-cover-frame { position:relative; width:100%; min-width:0; max-width:100%; aspect-ratio:2/3; flex:none; overflow:hidden; background:#101b2c; }
.manga-cover-frame > .manga-cover { position:absolute; inset:0; width:100%; height:100%; max-width:100%; max-height:100%; margin:0; aspect-ratio:auto; object-fit:contain; object-position:center; }
.manga-cover-placeholder { display:grid; place-items:center; color:#93b6df; font-size:15px; }
.manga-card-body { padding:18px; display:flex; flex-direction:column; gap:12px; flex:1; }
.manga-card h2 { font-size:19px; line-height:1.4; overflow-wrap:anywhere; }
.manga-card p { color:var(--manga-muted); font-size:14px; line-height:1.6; }
.manga-card .manga-button { margin-top:auto; }
.manga-card-open { display:block;color:inherit!important;text-decoration:none;border-radius:inherit; }
.manga-card-open:focus-visible { outline-offset:-3px!important; }
.manga-card-open:hover h2 { color:#b8d9ff; }
#series-actions { display:grid;gap:12px;justify-items:start; }
.manga-reading-actions,.manga-library-actions { display:flex;align-items:center;flex-wrap:wrap;gap:10px;max-width:100%; }
.manga-reading-actions:empty { display:none; }
.manga-library-actions .h-like-wrap { display:contents; }
.manga-library-actions .h-like-status:not(:empty) { flex-basis:100%; }
.manga-library-status { flex-basis:100%;color:var(--manga-muted);font-size:14px;line-height:1.5; }
.manga-series { display:grid; grid-template-columns:minmax(160px,260px) minmax(0,1fr); gap:32px; margin-bottom:32px; align-items:start; }
.manga-series > * { min-width:0; }
.manga-series > .manga-cover-frame,.manga-series > .manga-cover { border-radius:12px; align-self:start; }
.manga-series-summary { line-height:1.85; white-space:pre-line; color:#d0dff0; }
.manga-badge { display:inline-block; background:#193c62; color:#bcdeff; border-radius:6px; font-size:13px; padding:7px 10px; margin-bottom:18px; }
.manga-section-title { font-size:22px; color:#c2dfff; margin-bottom:20px; }
.manga-chapters { display:grid; gap:10px; list-style:none; }
.manga-chapter { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px; background:#14283f; border:1px solid var(--manga-line); border-radius:10px; color:#e4f1ff !important; text-decoration:none; }
.manga-chapter strong { line-height:1.5; overflow-wrap:anywhere; }
.manga-chapter span { flex:none; font-size:13px; color:var(--manga-muted); }
.manga-credits { margin-top:32px; display:flex; flex-wrap:wrap; gap:24px 40px; }
.manga-credits dt { color:#9fcaff; font-size:14px; margin-bottom:10px; }
.manga-credits dd { display:flex; flex-wrap:wrap; gap:8px; }
.manga-credit { display:inline-block; padding:7px 11px; background:#1a3453; border-radius:7px; color:#e6f1ff; white-space:nowrap; max-width:100%; }
.manga-help { color:var(--manga-muted); line-height:1.7; font-size:14px; margin-top:24px; }
.manga-error { border-color:#8c5d47; }
.manga-reader { background:#0c1422; }
.manga-reader > header { position:static; }
.reader-toolbar { position:sticky; top:0; z-index:100; background:rgba(15,30,49,.98); border-bottom:1px solid #2b4668; padding:12px 20px; }
.reader-toolbar-inner { max-width:1200px; margin:auto; display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.reader-title { min-width:0; flex:1 1 180px; }
.reader-title h1 { color:#e5f2ff; font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.6; }
.reader-title a { font-size:13px; text-decoration:none; }
.reader-controls { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.reader-controls label { font-size:12px; color:#bdd5ee; display:flex; flex-direction:column; gap:5px; }
.reader-controls select { max-width:200px; min-width:80px; min-height:40px; padding:7px 28px 7px 10px; color:#e6f1ff; background:#152c47; border:1px solid #41678e; border-radius:7px; font-size:14px; }
.reader-shell { width:100%; flex:1; min-width:0; padding-bottom:60px; }
.reader-intro,.reader-end { width:calc(100% - 32px); max-width:900px; margin:28px auto; }
.reader-intro p { color:var(--manga-muted); line-height:1.7; font-size:14px; }
.reader-resume { padding:18px; background:#173353; border:1px solid #4776a5; border-radius:10px; margin-bottom:20px; }
.reader-resume .manga-actions { margin-top:12px; }
.reader-pages { width:100%; max-width:900px; margin:auto; }
.reader-pages[data-width="narrow"] { max-width:680px; }
.reader-pages[data-width="wide"] { max-width:1200px; }
.reader-page { position:relative; width:100%; background:#172437; scroll-margin-top:190px; }
.reader-page img { display:block; width:100%; height:auto; object-fit:contain; }
.reader-page-open { display:block; width:100%; padding:0; border:0; background:none; line-height:0; cursor:zoom-in; }
.reader-page-open:focus-visible { outline:3px solid #b6dbff; outline-offset:-3px; }
.reader-page-error { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; padding:18px; text-align:center; background:#172437; }
.reader-page-error p { line-height:1.6; max-width:400px; }
.reader-progress { position:fixed; z-index:101; bottom:0; left:0; width:100%; display:flex; align-items:center; justify-content:center; gap:18px; min-height:46px; padding:7px 16px calc(7px + env(safe-area-inset-bottom)); background:rgba(15,30,49,.97); border-top:1px solid #2b4668; color:#c5dff8; font-size:13px; }
.reader-progress button { color:#c5dff8; background:none; border:0; padding:6px 8px; cursor:pointer; min-height:32px; }
.reader-storage { font-size:12px !important; margin-top:12px; }
.reader-end h2 { color:#e4f1ff; font-size:21px; margin-bottom:12px; }
.manga-noscript { margin:24px auto; padding:20px; width:calc(100% - 40px); max-width:1200px; background:#422d25; border-radius:10px; line-height:1.7; }
@media (min-width:901px) { .manga-site > header { gap:16px 22px; flex-wrap:wrap; min-height:80px; height:auto; padding:16px 32px; } .manga-site > header nav { margin-left:auto; } .manga-site > header nav ul { gap:22px; } .manga-site > header :is(nav a,.LinksButton-title) { white-space:nowrap; } }
@media (max-width:1000px) { .manga-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:700px) { .manga-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; } .manga-series { grid-template-columns:150px minmax(0,1fr); gap:22px; } .manga-chapter { align-items:start; flex-direction:column; gap:8px; } }
@media (max-width:550px) {
 .manga-main { width:calc(100% - 32px); margin-top:28px; } .manga-surface { padding:22px 18px; }
 .manga-heading h1 { font-size:30px; } .manga-empty { min-height:290px; } .manga-empty :is(h1,h2) { font-size:21px; }
 .manga-tools { grid-template-columns:minmax(0,1fr); gap:10px; } .manga-count { padding:0; }
 .manga-card-body { padding:14px; } .manga-card h2 { font-size:17px; }
 .manga-series { grid-template-columns:minmax(0,1fr); } .manga-series > .manga-cover-frame,.manga-series > .manga-cover { width:min(60%,230px); margin:0 auto; }
 .manga-reader > header { min-height:60px; padding:10px 16px; flex-direction:row; justify-content:space-between; }
 .manga-reader > header .logo img { height:30px; } .manga-reader > header .LinksButton,.manga-reader > header nav { display:none; }
 .reader-toolbar { padding:10px 12px; } .reader-title { flex-basis:100%; }
 .reader-controls { width:100%; display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr); gap:8px; }
 .reader-controls select { width:100%; max-width:none; min-width:0; font-size:13px; padding-left:8px; }
 .reader-controls label { min-width:0; } .reader-intro { margin:20px auto; }
 .reader-page { scroll-margin-top:160px; } .reader-end .manga-actions > * { flex:1; }
}
/* Bound the whole card, not just image height: no side bars or clipped cover. */
@media (max-width:360px) { .manga-grid { grid-template-columns:minmax(0,1fr); justify-items:center; } .manga-card { max-width:240px; } }

/* Full-screen, scrollable image viewer; no changes to reading-image proportions. */
html:has(.reader-zoom[open]) { overflow:hidden; }
.reader-zoom { width:100%; max-width:none; height:100vh; height:100dvh; max-height:none; margin:0; padding:0; border:0; color:#e7f2ff; background:#0c1422; overflow:hidden; }
.reader-zoom:not([open]) { display:none; }
.reader-zoom[open] { display:flex; flex-direction:column; }
.reader-zoom::backdrop { background:rgba(4,10,18,.94); }
.reader-zoom-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 20px; padding:12px 18px; background:#13263d; border-bottom:1px solid #355578; flex:none; }
.reader-zoom-title { margin:0; font-size:16px; line-height:1.4; }
.reader-zoom-controls { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.reader-zoom-control { min-width:42px; min-height:44px; border:1px solid #41678e; border-radius:8px; padding:8px 12px; color:#edf6ff; background:#1b3c60; font-size:16px; cursor:pointer; }
.reader-zoom-control:disabled { opacity:.45; cursor:not-allowed; }
.reader-zoom-close { background:#245e9c; }
.reader-zoom-range { width:100px; accent-color:#8ac3ff; min-height:40px; }
.reader-zoom-amount { min-width:38px; text-align:center; font-size:14px; }
.reader-zoom-help { flex:none; color:#bdd2e9; padding:10px 18px; margin:0; font-size:13px; line-height:1.5; }
.reader-zoom-viewport { position:relative; flex:1; min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; cursor:grab; -webkit-overflow-scrolling:touch; }
.reader-zoom-viewport.is-dragging { cursor:grabbing; user-select:none; }
.reader-zoom-canvas { position:relative; margin-inline:auto; }
.reader-zoom-image { display:block; max-width:none; max-height:none; object-fit:contain; margin:0; padding:0; user-select:none; -webkit-user-drag:none; }
.reader-zoom-status { position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); width:min(90%,360px); padding:20px; border:1px solid #41678e; border-radius:12px; background:#13263d; text-align:center; line-height:1.6; }
.reader-zoom-status button { margin-top:12px; }
@media (max-width:550px) {
 .reader-zoom-bar { padding:10px 12px; gap:8px; }
 .reader-zoom-title { font-size:14px; }
 .reader-zoom-controls { width:100%; gap:6px; }
 .reader-zoom-range { flex:1; min-width:35px; width:50px; }
 .reader-zoom-control { padding:8px; font-size:14px; }
 .reader-zoom-amount { min-width:32px; font-size:12px; }
 .reader-zoom-close { margin-left:auto; }
 .reader-zoom-help { padding:8px 12px; font-size:12px; }
}

/* On phones, reading width follows the screen; only useful controls remain. */
@media (max-width:700px) {
 .manga-reader.manga-site > header.h-account-header { min-height:64px;padding:8px 16px;gap:0 12px;grid-template-columns:minmax(0,1fr) auto; }
 .manga-reader.manga-site > header.h-account-header .logo img { width:100%;max-width:190px;height:auto; }
 .manga-reader.manga-site > header.h-account-header > nav,
 .manga-reader.manga-site > header.h-account-header > .LinksButton { display:none; }
 .reader-width-control { display:none!important; }
 .reader-toolbar { padding:9px 14px;background:rgba(15,30,49,.96); }
 .reader-toolbar-inner { gap:8px; }
 .reader-title { flex:1 1 100%; }
 .reader-title h1 { font-size:14px;line-height:1.4;font-weight:600; }
 .reader-title a { font-size:12px;text-decoration:none; }
 .reader-controls { display:grid;grid-template-columns:minmax(0,1fr) 84px;gap:10px;width:100%; }
 .reader-controls label { min-width:0;gap:4px;font-size:11px;line-height:1.2;color:#9db4ce; }
 .reader-controls select { width:100%;min-width:0;max-width:none;min-height:44px;font-size:13px;padding:8px 24px 8px 10px;border-color:#304a69;background:#14273e;border-radius:8px; }
 .reader-pages[data-width] { width:100%;max-width:100%; }
}
