:root{
  --bg:#f5f6fa;--surface:#fff;--surface-2:#eef0f6;--border:#dfe2ec;--text:#161827;--muted:#6a7089;
  --accent:#6366f1;--accent-ink:#fff;--danger:#e5484d;--ok:#16a34a;--warn:#d97706;
  --shadow:0 1px 2px rgba(20,24,50,.06),0 8px 24px rgba(20,24,50,.06);--radius:14px;
  --c-anime:#6366f1;--c-manga:#e11d6a;--c-webtoon:#0d9f78;
}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--bg:#0e1017;--surface:#161926;--surface-2:#1e2233;--border:#2a2f45;--text:#e8eaf4;--muted:#9097b3;--shadow:0 1px 2px rgba(0,0,0,.4),0 8px 28px rgba(0,0,0,.35);--c-anime:#8087ff;--c-manga:#ff6b9a;--c-webtoon:#2dd4a7}}
:root[data-theme=dark]{--bg:#0e1017;--surface:#161926;--surface-2:#1e2233;--border:#2a2f45;--text:#e8eaf4;--muted:#9097b3;--shadow:0 1px 2px rgba(0,0,0,.4),0 8px 28px rgba(0,0,0,.35);--c-anime:#8087ff;--c-manga:#ff6b9a;--c-webtoon:#2dd4a7}
[data-cat=anime]{--accent:var(--c-anime)}[data-cat=manga]{--accent:var(--c-manga)}[data-cat=webtoon]{--accent:var(--c-webtoon)}
*{box-sizing:border-box}
html{color-scheme:light dark}
:root[data-theme=light]{color-scheme:light}:root[data-theme=dark]{color-scheme:dark}
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;min-height:100vh;display:flex;flex-direction:column}
a{color:inherit;text-decoration:none}a:hover{text-decoration:underline}
h1,h2,h3{line-height:1.2;margin:0 0 .5em}h1{font-size:1.9rem}h2{font-size:1.3rem}h3{font-size:1.05rem}
.icon{width:1.25em;height:1.25em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:-.25em;flex:none}
.wrap{width:100%;max-width:1180px;margin:0 auto;padding:0 16px}
main.wrap{padding-top:24px;padding-bottom:96px;flex:1}
.muted{color:var(--muted)}.small{font-size:.85rem}.center{text-align:center}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* topbar */
.topbar{position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--bg) 85%,transparent);backdrop-filter:blur(12px);border-bottom:1px solid var(--border)}
.topbar .wrap{display:flex;align-items:center;gap:16px;height:60px}
.brand{white-space:nowrap;font-weight:800;letter-spacing:-.02em;display:flex;align-items:center;gap:8px;font-size:1.1rem}
.brand .logo{width:28px;height:28px;border-radius:8px;background:var(--c-anime);display:grid;place-items:center;color:#fff}
.nav{display:flex;gap:4px;margin-left:8px}
.nav a{padding:8px 12px;border-radius:10px;color:var(--muted);font-weight:600;font-size:.95rem;display:flex;gap:6px;align-items:center}
.nav a:hover{background:var(--surface-2);text-decoration:none;color:var(--text)}
.nav a.active{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,transparent)}
.nav a[data-cat=anime].active{--accent:var(--c-anime)}.nav a[data-cat=manga].active{--accent:var(--c-manga)}.nav a[data-cat=webtoon].active{--accent:var(--c-webtoon)}
.spacer{flex:1}
.top-actions{display:flex;gap:8px;align-items:center}
.search-box{display:flex;align-items:center;background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:0 10px;gap:6px}
.search-box input{background:none;border:0;color:inherit;padding:9px 0;outline:0;width:100%;font:inherit}
.topbar .search-box{width:230px}
/* buttons / forms */
.btn{display:inline-flex;align-items:center;gap:6px;justify-content:center;border:1px solid var(--border);background:var(--surface);color:var(--text);padding:9px 14px;border-radius:10px;font:inherit;font-weight:600;cursor:pointer;line-height:1.2}
.btn:hover{background:var(--surface-2);text-decoration:none}
.btn.primary{background:var(--accent);border-color:transparent;color:#fff}.btn.primary:hover{filter:brightness(1.08);background:var(--accent)}
.btn.danger{color:var(--danger)}.btn.danger.solid{background:var(--danger);color:#fff;border-color:transparent}
.btn.sm{padding:6px 10px;font-size:.85rem}.btn.block{width:100%}
.btn.ghost{border-color:transparent;background:transparent}.btn.ghost:hover{background:var(--surface-2)}
.btn[disabled]{opacity:.55;cursor:default}
input,select,textarea{font:inherit;color:inherit;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:10px 12px;width:100%}
input:focus,select:focus,textarea:focus,.btn:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
input[type=checkbox]{width:auto}
label{display:block;font-weight:600;font-size:.9rem;margin:0 0 4px}
.field{margin-bottom:14px}.hint{color:var(--muted);font-size:.82rem;margin-top:4px}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.row>.grow{flex:1;min-width:140px}
/* cards */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.card.narrow{max-width:440px;margin:24px auto}
.section{margin:32px 0}
.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px}
.section-head h2{margin:0;display:flex;gap:8px;align-items:center}
.section-head a{color:var(--muted);font-size:.9rem;font-weight:600}
/* hero + category tiles */
.hero{padding:36px 0 12px}.hero h1{font-size:clamp(2rem,5vw,3rem);letter-spacing:-.03em;max-width:16ch}
.hero p{max-width:56ch;color:var(--muted);font-size:1.1rem}
.cat-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:20px}
.cat-tile{background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 22%,var(--surface)),var(--surface));border:1px solid var(--border);border-radius:var(--radius);padding:18px;display:block}
.cat-tile:hover{text-decoration:none;border-color:var(--accent)}.cat-tile .icon{width:28px;height:28px;color:var(--accent)}
.cat-tile h3{margin:8px 0 2px}.cat-tile p{margin:0;color:var(--muted);font-size:.9rem}
.cat-header{display:flex;align-items:center;gap:14px;margin-bottom:18px;flex-wrap:wrap}
.cat-header .badge-ic{width:44px;height:44px;border-radius:12px;background:color-mix(in srgb,var(--accent) 16%,transparent);color:var(--accent);display:grid;place-items:center}
.cat-header h1{margin:0}
/* grid of media */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:16px}
.mcard{position:relative;display:flex;flex-direction:column;gap:6px}
.mcard .poster{position:relative;display:block;aspect-ratio:2/3;border-radius:12px;overflow:hidden;background:var(--surface-2);border:1px solid var(--border)}
.mcard .poster img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .25s}
.mcard:hover .poster img{transform:scale(1.04)}
.mcard .title{font-weight:650;font-size:.92rem;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.mcard .meta{font-size:.78rem;color:var(--muted)}
.tag{position:absolute;top:8px;left:8px;background:rgba(10,12,20,.78);color:#fff;font-size:.72rem;font-weight:700;padding:2px 8px;border-radius:999px;backdrop-filter:blur(4px)}
.tag.live{background:var(--ok)}
.in-lib{position:absolute;top:8px;right:8px;background:var(--accent);color:#fff;width:24px;height:24px;border-radius:50%;display:grid;place-items:center}
.in-lib .icon{width:14px;height:14px;stroke-width:3}
.mcard .add{margin-top:2px}
.hscroll{display:grid;grid-auto-flow:column;grid-auto-columns:150px;gap:16px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x proximity}
.hscroll>*{scroll-snap-align:start}
/* progress */
.bar{height:6px;border-radius:99px;background:var(--surface-2);overflow:hidden}.bar>i{display:block;height:100%;background:var(--accent);border-radius:99px;transition:width .3s}
.badge{display:inline-flex;align-items:center;gap:4px;font-size:.75rem;font-weight:700;padding:2px 9px;border-radius:999px;background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--accent)}
.badge.ok{background:color-mix(in srgb,var(--ok) 15%,transparent);color:var(--ok)}
/* tabs */
.tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px}
.tab{padding:7px 13px;border-radius:999px;border:1px solid var(--border);background:var(--surface);font-weight:600;font-size:.88rem;color:var(--muted)}
.tab:hover{text-decoration:none;color:var(--text)}.tab.active{background:var(--accent);color:#fff;border-color:transparent}
.tab .n{opacity:.75;margin-left:4px}
/* library list */
.lib-list{display:grid;gap:12px}
.lib-item{display:grid;grid-template-columns:64px 1fr auto;gap:14px;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:10px}
.lib-item img{width:64px;height:96px;object-fit:cover;border-radius:8px;background:var(--surface-2);display:block}
.lib-item .info{min-width:0}.lib-item .info .t{font-weight:700;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lib-item .acts{display:flex;gap:6px;flex-direction:column;align-items:flex-end}
.stars{color:#f5a524;font-weight:700}
/* media detail */
.detail{display:grid;grid-template-columns:240px 1fr;gap:28px}
.detail .poster-lg{width:100%;aspect-ratio:2/3;object-fit:cover;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface-2)}
.chips{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.chip{font-size:.78rem;padding:3px 10px;border-radius:999px;background:var(--surface-2);color:var(--muted)}
.synopsis{max-width:70ch;color:var(--text);opacity:.9;white-space:pre-line}
.dist{display:flex;align-items:flex-end;gap:4px;height:60px;margin:10px 0}.dist i{flex:1;background:color-mix(in srgb,var(--accent) 55%,transparent);border-radius:3px 3px 0 0;min-height:2px}
.stat-row{display:flex;gap:24px;flex-wrap:wrap;margin:12px 0}.stat b{display:block;font-size:1.4rem}.stat span{color:var(--muted);font-size:.82rem}
/* reviews */
.review{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px;display:grid;gap:6px}
.review p{margin:0;white-space:pre-line;overflow-wrap:anywhere}
.review-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
.avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-weight:800;color:#fff;flex:none}
.av-0{background:#6366f1}.av-1{background:#e11d6a}.av-2{background:#0d9f78}.av-3{background:#d97706}.av-4{background:#0ea5e9}.av-5{background:#a855f7}.av-6{background:#ef4444}.av-7{background:#14b8a6}
.avatar.lg{width:72px;height:72px;font-size:1.8rem}
/* chat */
.chat{display:flex;flex-direction:column;gap:8px;height:min(60vh,560px);overflow-y:auto;padding:14px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}
.msg{display:flex;gap:10px;align-items:flex-start}.msg .b{background:var(--surface-2);padding:8px 12px;border-radius:12px;max-width:min(560px,80%);overflow-wrap:anywhere}
.msg .who{font-size:.78rem;color:var(--muted)}.msg .who b{color:var(--text)}.msg .x{opacity:0;margin-left:6px}.msg:hover .x{opacity:1}
.msg.me{flex-direction:row-reverse}.msg.me .b{background:color-mix(in srgb,var(--accent) 18%,var(--surface-2))}
/* tables / leaderboard */
.table{width:100%;border-collapse:collapse}.table th,.table td{padding:10px 8px;border-bottom:1px solid var(--border);text-align:left}
.table th{color:var(--muted);font-size:.8rem;text-transform:uppercase;letter-spacing:.04em}
/* flashes + toasts */
.flashes{display:grid;gap:8px;margin-bottom:16px}
.flash{padding:11px 14px;border-radius:10px;border:1px solid var(--border);background:var(--surface)}
.flash.success{border-color:var(--ok);color:var(--ok)}.flash.error{border-color:var(--danger);color:var(--danger)}
.alert-err{padding:10px 12px;border-radius:10px;background:color-mix(in srgb,var(--danger) 12%,transparent);color:var(--danger);margin-bottom:14px}
#toasts{position:fixed;left:50%;bottom:84px;transform:translateX(-50%);display:grid;gap:8px;z-index:100;width:min(92vw,380px)}
.toast{background:var(--text);color:var(--bg);padding:11px 14px;border-radius:12px;box-shadow:var(--shadow);animation:pop .2s}
.toast.error{background:var(--danger);color:#fff}
@keyframes pop{from{opacity:0;transform:translateY(8px)}}
/* dialog */
dialog{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);color:var(--text);padding:22px;width:min(520px,94vw);box-shadow:var(--shadow)}
dialog::backdrop{background:rgba(5,6,12,.6)}
.reactions{display:flex;gap:4px;flex-wrap:wrap}.reactions label{font-size:1.2rem;cursor:pointer;margin:0;padding:3px 6px;border-radius:8px;border:1px solid transparent;font-weight:400}
.reactions input{position:absolute;opacity:0;width:0}.reactions input:checked+span{outline:2px solid var(--accent);border-radius:8px}.reactions span{padding:3px 5px;display:inline-block}
/* footer + mobile nav */
.footer{border-top:1px solid var(--border);padding:24px 0 100px;color:var(--muted);font-size:.88rem}
.footer .wrap{display:flex;gap:16px;flex-wrap:wrap;justify-content:space-between}
.footer nav{display:flex;gap:14px;flex-wrap:wrap}
.bottom-nav{display:none}
.empty{text-align:center;padding:48px 16px;color:var(--muted);border:1px dashed var(--border);border-radius:var(--radius)}
.prose{max-width:72ch}.prose h2{margin-top:1.6em}
.pager{display:flex;gap:10px;justify-content:center;margin-top:24px}
.divider{display:flex;align-items:center;gap:10px;color:var(--muted);margin:16px 0;font-size:.85rem}.divider:before,.divider:after{content:"";flex:1;height:1px;background:var(--border)}
@media (max-width:820px){
  .nav,.topbar .search-box{display:none}
  .cat-tiles{grid-template-columns:1fr}
  .detail{grid-template-columns:130px 1fr;gap:16px}
  .grid{grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:12px}
  .hscroll{grid-auto-columns:120px}
  .bottom-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;bottom:0;left:0;right:0;z-index:40;background:var(--surface);border-top:1px solid var(--border);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
  .bottom-nav a{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:.68rem;color:var(--muted);font-weight:600;padding:4px}
  .bottom-nav a:hover{text-decoration:none}.bottom-nav a.active{color:var(--accent)}.bottom-nav .icon{width:22px;height:22px}
  .lib-item{grid-template-columns:52px 1fr}.lib-item img{width:52px;height:78px}.lib-item .acts{grid-column:1/-1;flex-direction:row;justify-content:flex-start;flex-wrap:wrap}
  h1{font-size:1.5rem}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.check{margin:0;font-weight:400;flex-wrap:nowrap;align-items:flex-start}.check input{margin-top:4px}
form.inline{display:inline}
/* avatar fotoğrafı */
.avatar{overflow:hidden;position:relative}.avatar img{width:100%;height:100%;object-fit:cover;display:block}
/* kart düzeni: uzun başlıkta bile Ekle butonu hep aynı hizada altta */
.mcard{height:100%}
.mcard .title{min-height:2.5em}
.mcard .meta{min-height:1.2em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mcard .add{margin-top:auto;padding-top:4px}
.hscroll>.mcard{height:auto;min-height:100%}
/* bölüm kaydırıcısı */
input[type=range]{padding:0;border:0;background:none;margin-top:8px;accent-color:var(--accent)}
input[type=range][hidden]{display:none}
/* reklam alanları */
.ad{margin:24px 0;min-height:90px;text-align:center;position:relative}
.ad-label{display:block;font-size:.68rem;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:4px}
.ad ins{display:block}
/* bölüm seçici penceresi */
dialog.picker{width:min(620px,94vw);padding:0;overflow:hidden;animation:pop .18s}
.picker-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:18px 20px 8px}
.picker-head h2{margin:0}
.pk-row{display:flex;gap:8px;flex-wrap:wrap;padding:6px 20px}
.pk-chip{border:1px solid var(--border);background:var(--surface-2);color:var(--text);border-radius:999px;padding:7px 14px;font:inherit;font-size:.88rem;font-weight:600;cursor:pointer;display:inline-flex;gap:6px;align-items:center}
.pk-chip small{color:var(--muted);font-weight:500}
.pk-chip:hover{border-color:var(--accent)}
.pk-chip.on{background:var(--accent);border-color:transparent;color:#fff}.pk-chip.on small{color:rgba(255,255,255,.8)}
.pk-chip.sm{padding:4px 10px;font-size:.8rem}
.pk-body{padding:10px 20px 6px;max-height:min(46vh,420px);overflow-y:auto}
.pk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(52px,1fr));gap:8px}
.pk-ep{aspect-ratio:1/1;border-radius:12px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);font:inherit;font-weight:700;cursor:pointer;transition:transform .08s,background .12s}
.pk-ep:hover{border-color:var(--accent);transform:translateY(-1px)}
.pk-ep.done{background:color-mix(in srgb,var(--accent) 18%,var(--surface-2));border-color:color-mix(in srgb,var(--accent) 40%,var(--border))}
.pk-ep.sel{background:var(--accent);border-color:transparent;color:#fff;transform:scale(1.05);box-shadow:0 4px 14px color-mix(in srgb,var(--accent) 45%,transparent)}
.pk-ep:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.pk-stepper{display:flex;align-items:center;justify-content:center;gap:14px;padding:22px 0}
.pk-stepper .btn{width:52px;height:52px;font-size:1.4rem;border-radius:14px}
.pk-stepper input{width:110px;text-align:center;font-size:1.6rem;font-weight:800;padding:10px}
.pk-note{text-align:center;color:var(--muted);font-size:.85rem}
.pk-foot{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;padding:14px 20px;border-top:1px solid var(--border);background:var(--surface)}
.pk-sel{font-weight:650}
@media (max-width:820px){.pk-grid{grid-template-columns:repeat(auto-fill,minmax(46px,1fr))}.pk-foot{flex-direction:column;align-items:stretch}}
/* dil düğmesi ve yorum dili sekmesi */
.lang-switch{font-weight:800;letter-spacing:.04em;min-width:42px}
.seg{display:inline-flex;gap:2px;padding:3px;background:var(--surface-2);border:1px solid var(--border);border-radius:12px;margin-bottom:14px}
.section-head .seg{margin-bottom:0}
.seg-item{padding:6px 14px;border-radius:9px;font-weight:650;font-size:.9rem;color:var(--muted)}
.seg-item:hover{text-decoration:none;color:var(--text)}
.seg-item.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow)}

.topbar .search-box{flex:0 1 220px;min-width:130px}.search-box input{min-width:0}
@media (max-width:1180px){.topbar .search-box{display:none}}

/* küçük telefonlar: üst çubuk taşmasın */
.brand{flex-shrink:0}.brand-name{white-space:nowrap}
@media (max-width:560px){
  .brand{flex-shrink:1;min-width:0}.brand-name{overflow:hidden;text-overflow:ellipsis}
  .topbar .wrap{gap:8px}.top-actions{gap:6px;flex-shrink:0}
  .top-actions .btn.sm{padding-left:10px;padding-right:10px}
  .top-actions .btn.sm .icon+span{display:none}
  .lang-switch{min-width:36px}
}
@media (max-width:400px){.brand-name{max-width:118px}.top-actions .btn.sm:not(.primary):not(#theme-toggle):not(.lang-switch):not(:has(.icon)){display:none}}

@media (max-width:560px){.detail{grid-template-columns:96px 1fr;gap:12px}.detail .cover,.detail>img,.detail>div:first-child img{max-width:96px}}

/* seri ve izleme sırası */
.fr .seg{flex-wrap:wrap}.fr [data-fr-note]{margin:0 0 12px}
.fr-group{margin:20px 0 10px;font-size:1rem;color:var(--muted)}
.fr-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.fr-item{display:grid;grid-template-columns:30px 52px minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px 12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}
.fr-item.cur{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 22%,transparent)}
.fr-n{width:28px;height:28px;border-radius:50%;background:var(--surface-2);display:grid;place-items:center;font-weight:700;font-size:.78rem;color:var(--muted)}
.fr-cover img{width:52px;height:76px;object-fit:cover;border-radius:8px;background:var(--surface-2);display:block}
.fr-title{font-weight:700;display:block;overflow-wrap:anywhere;color:var(--text)}
.fr-meta{color:var(--muted);font-size:.85rem;margin-top:2px}
.fr-act{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
@media (max-width:560px){
  .fr-item{grid-template-columns:26px 44px minmax(0,1fr);gap:10px}
  .fr-cover img{width:44px;height:64px}
  .fr-act{grid-column:1/-1;justify-content:flex-start}
}
.fr .section-head{flex-wrap:wrap;gap:10px}
.fr .section-head h2{flex:1 1 220px;min-width:0}
@media (max-width:560px){.fr .seg{width:100%}.fr .seg-item{flex:1 1 auto;text-align:center}}
@media (min-width:1181px) and (max-width:1400px){.nav a{padding:8px 9px}.nav{margin-left:0;gap:2px}.topbar .search-box{flex:0 1 150px;min-width:110px}.topbar .wrap{gap:10px}}
