
:root {
    --bg: #0a0b10;
    --surface: #12141d;
    --surface-2: #1a1e2b;
    --fg: #eef1f8;
    --muted: #8b93a7;
    --border: #242a3a;
    --accent: #b16bff;      /* electric violet */
    --accent-2: #46e6ff;    /* cyan */
    --finished: #46e6ff;
    --new: #b16bff;
    --updated: #46e6ff;
    --card: var(--accent);  /* per-card override via inline style */
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body {
    margin: 0; color: var(--fg); min-height: 100vh; line-height: 1.5;
    font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-image:
        radial-gradient(60vw 40vh at 80% -10%, rgba(177,107,255,.10), transparent 70%),
        radial-gradient(50vw 40vh at 0% 0%, rgba(70,230,255,.07), transparent 70%);
    background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.linklike { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; }
.linklike:hover { color: var(--accent-2); }

/* ---------- header ---------- */
.page-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.5rem; min-height: 112px; border-bottom: 1px solid var(--border);
    background: rgba(10,11,16,.72); backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--fg); }
.brand-mark { filter: drop-shadow(0 0 6px rgba(177,107,255,.5)); }
.brand-logo {
    display: block; height: 78px; width: auto; max-width: min(78vw, 480px);
    filter: drop-shadow(0 0 10px rgba(177,107,255,.45));
}
.head-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.desc { margin: 0; color: var(--muted); font-size: .74rem; }
.views { display: flex; gap: .35rem; }
.view-btn {
    padding: .4rem .9rem; border-radius: 999px; color: var(--muted);
    font-size: .9rem; font-weight: 600; border: 1px solid transparent;
}
.view-btn.active {
    color: var(--fg); border-color: var(--border); background: var(--surface-2);
    box-shadow: 0 0 0 1px rgba(177,107,255,.25), 0 0 18px rgba(177,107,255,.12);
}
.view-btn:hover { color: var(--fg); }

/* ---------- content ---------- */
.content { padding: 1.25rem; max-width: 1240px; margin: 0 auto; }
.empty {
    padding: 2.5rem 2rem; text-align: center; color: var(--muted);
    border: 1px dashed var(--border); border-radius: 14px; background: var(--surface);
}
.empty h2 { color: var(--fg); margin-top: 0; }
.empty-art {
    display: block; width: min(240px, 64%); height: auto; margin: 0 auto 1.25rem;
    filter: drop-shadow(0 0 26px rgba(177,107,255,.28));
}

/* ---------- about overlay art ---------- */
.about-logo { display: block; width: min(300px, 82%); height: auto; margin: 0 0 .75rem; }
.about-mascot {
    float: right; width: min(220px, 42%); height: auto; margin: 0 0 .75rem 1.25rem;
    filter: drop-shadow(0 0 22px rgba(70,230,255,.25));
}

/* ---------- cards (shared) ---------- */
.cards {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.show {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
    position: relative; color: var(--fg); text-decoration: none;
}
.show:hover, .show:focus-visible {
    transform: translateY(-3px); outline: none; color: var(--fg);
    border-color: color-mix(in srgb, var(--card) 60%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--card) 45%, transparent),
                0 10px 30px color-mix(in srgb, var(--card) 28%, transparent);
}
.show-cover {
    aspect-ratio: 3 / 4; background-size: cover; background-position: center;
    background-color: var(--surface-2);
}
.show-cover-empty {
    background: linear-gradient(150deg, color-mix(in srgb, var(--card) 30%, var(--surface-2)), var(--surface));
    display: flex; align-items: center; justify-content: center; padding: .9rem;
}
/* A work with no art still reads as a real entry rather than a blank tile. */
.show-cover-empty span {
    font-size: .82rem; font-weight: 600; line-height: 1.25; text-align: center;
    color: color-mix(in srgb, var(--fg) 72%, transparent);
    display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
    overflow: hidden;
}
.show-body { padding: .6rem .7rem .8rem; display: flex; flex-direction: column; gap: .3rem; }
.show-title { margin: 0; font-size: .95rem; line-height: 1.2; }
.show-sub { margin: 0; color: var(--muted); font-size: .72rem; }
.show-latest { margin: .1rem 0 0; font-size: .82rem; color: var(--muted); }
.ep-badge {
    display: inline-block; background: color-mix(in srgb, var(--card) 22%, transparent);
    color: color-mix(in srgb, var(--card) 75%, white); border: 1px solid color-mix(in srgb, var(--card) 40%, transparent);
    padding: .06rem .45rem; border-radius: 999px; font-size: .74rem; font-weight: 700; margin-right: .35rem;
}
.flag {
    position: absolute; top: .5rem; left: .5rem; font-size: .62rem; padding: .12rem .45rem;
    border-radius: 5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    backdrop-filter: blur(4px);
}
.flag-new { background: rgba(177,107,255,.22); color: #d9bcff; }
.flag-updated { background: rgba(70,230,255,.18); color: #b3f4ff; }
.flag-finished { background: rgba(70,230,255,.12); color: #9fe9f7; }

/* ---------- today / calendar ---------- */
.day-nav {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 1rem;
}
.day-nav button {
    padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--fg); cursor: pointer; font-weight: 600;
}
.day-nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.day-nav button:disabled { opacity: .35; cursor: default; }
.day-label { font-size: 1.35rem; font-weight: 700; text-align: center; }
.day-label .day-count { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); }
.cal-filter { margin-bottom: 1rem; }
.cal-filter input {
    width: 100%; max-width: 360px; padding: .5rem .75rem; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); color: var(--fg); font: inherit;
}
.cal-card .show-when { font-size: .76rem; color: var(--muted); }

/* ---------- categories ---------- */
.cat-nav {
    display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem;
    position: sticky; top: 112px; z-index: 20; padding: .5rem 0;
    background: linear-gradient(var(--bg), var(--bg) 70%, transparent);
}
.cat-nav a {
    padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600;
}
.cat-nav a:hover { color: var(--accent); border-color: var(--accent); }
.cat-filter { margin-bottom: 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-filter input {
    width: 100%; max-width: 360px; padding: .5rem .75rem; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); color: var(--fg); font: inherit;
}
.cat-filter select {
    padding: .5rem .65rem; border-radius: 10px; font: inherit;
    border: 1px solid var(--border); background: var(--surface); color: var(--fg);
}
.cat-section { margin: 2rem 0; scroll-margin-top: 164px; }
.cat-section > h2 {
    font-size: 1.4rem; margin: 0 0 .25rem; display: flex; align-items: baseline; gap: .5rem;
}
.cat-section > h2 .section-count { font-size: .85rem; color: var(--muted); font-weight: 500; }
.lane-label {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
    margin: 1rem 0 .6rem;
}

/* ---------- footer ---------- */
.page-foot {
    margin: 2.5rem auto 1rem; padding: 1rem 1.25rem 2rem; max-width: 1240px;
    display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .8rem;
    border-top: 1px solid var(--border);
}

/* ---------- detail overlay ---------- */
.cm-overlay, .about-overlay {
    position: fixed; inset: 0; background: rgba(4,5,9,.7); z-index: 200;
    display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; overflow-y: auto;
    backdrop-filter: blur(3px);
}
.about-overlay { align-items: center; }
.cm-overlay[hidden], .about-overlay[hidden] { display: none; }
.cm-dialog, .about-dialog {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    width: min(760px, 100%); position: relative; overflow: hidden;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--card) 30%, transparent), 0 20px 60px rgba(0,0,0,.55);
}
.about-dialog { padding: 1.5rem 1.5rem 1rem; }
.cm-close {
    position: absolute; top: .55rem; right: .65rem; width: 36px; height: 36px;
    border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: white;
    font-size: 1.4rem; cursor: pointer; z-index: 5;
}
body.cm-open { overflow: hidden; }
.cm-hero { height: 210px; background-size: cover; background-position: center; background-color: var(--surface-2); position: relative; }
.cm-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, var(--surface)); }
.cm-hero-cover { background-size: cover; background-position: center 20%; height: 300px; }
.cm-hero-empty { background: linear-gradient(150deg, color-mix(in srgb, var(--card) 35%, var(--surface-2)), var(--surface)); }
.cm-head { padding: 1rem 1.25rem .25rem; position: relative; }
.cm-head h1, .cm-head h2 { margin: 0 0 .25rem; font-size: 1.45rem; }

/* ---------- per-work page ---------- */
.cm-crumbs { max-width: 760px; margin: 0 auto 1rem; font-size: .85rem; }
.cm-crumbs a:hover { color: var(--accent-2); }
.work-page { width: min(760px, 100%); margin: 0 auto; position: static; }
.cm-alt-titles { color: var(--text); opacity: .85; margin: 0 0 .35rem; font-size: .95rem; }
.cm-meta { color: var(--muted); margin: 0 0 .5rem; }
.cm-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.cm-chip { font-size: .72rem; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); }
.cm-chip-genre { background: rgba(177,107,255,.18); color: #d9bcff; }
.cm-chip-kind { background: rgba(70,230,255,.16); color: #b3f4ff; }
.cm-sec { padding: .8rem 1.25rem; border-top: 1px solid var(--border); }
.cm-sec h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .5rem; }
.cm-text { margin: 0; white-space: pre-line; }
.cm-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.cm-link {
    font-size: .82rem; padding: .3rem .7rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2);
}
.cm-link:hover { border-color: var(--accent); }
.cm-trailer { aspect-ratio: 16 / 9; }
.cm-trailer iframe { width: 100%; height: 100%; border: 0; }
.cm-eps { width: 100%; border-collapse: collapse; }
.cm-eps td { padding: .35rem .25rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
.cm-eps tr:last-child td { border-bottom: 0; }
.cm-eps td.cm-ep { width: 80px; font-weight: 600; }
.cm-when { color: var(--muted); }
.cm-empty, .cm-err, .cm-loading { padding: 1rem 1.25rem; color: var(--muted); }
.cm-err { color: #ff8da3; }

/* ---- A1/A2: availability lede, event flags, catches ---- */
.page-lede { max-width: 62ch; margin: 0 0 1rem; font-size: .95rem; line-height: 1.5; }
.page-lede b { color: var(--fg); }
.lane-head { font: 700 .8rem/1.2 inherit; letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted); margin: 1.1rem 0 .55rem; }
.lane-head.lane-catches { color: var(--accent-2); }
.ev-flag { display: inline-block; padding: 1px 7px; margin-left: 5px; border-radius: 999px;
    font-size: .62rem; font-weight: 700; letter-spacing: .08em;
    border: 1px solid var(--border); color: var(--muted); vertical-align: 1px; }
.ev-premiere { color: var(--accent); border-color: var(--accent); }
.ev-finale { color: var(--finished); border-color: var(--finished); }
.ev-batch, .ev-movie, .ev-ova, .ev-special { color: var(--accent-2); border-color: var(--accent-2); }
.ev-back { color: #ffd166; border-color: #ffd166; }
.catch-list { list-style: none; margin: 0; padding: 0; max-width: 860px; }
.catch-row { display: flex; align-items: baseline; gap: .8rem; padding: .6rem .2rem;
    border-top: 1px solid var(--border); }
.catch-row:first-child { border-top: none; }
.catch-day { flex: none; font-size: .82rem; width: 6.2em; }
.catch-row .ev-flag { margin-left: 0; flex: none; }
.catch-main { min-width: 0; flex: 1; }
.catch-title { color: var(--fg); font-weight: 600; text-decoration: none; }
.catch-title:hover { color: var(--card, var(--accent)); }
.catch-sub { display: block; font-size: .8rem; }
.catch-age { flex: none; font-size: .8rem; }
@media (max-width: 560px) { .catch-age { display: none; } }

@media (prefers-reduced-motion: reduce) {
    .show { transition: none; }
}
