
:root {
    --bg: #F3EFFA;
    --surface: #FFFFFF;
    --surface-soft: #EAE3F5;
    --text: #493F55;
    --muted: #91849F;
    --accent: #B9A3D6;
    --accent-dark: #80649F;
    --border: #DDD2EA;
    --shadow: 0 4px 16px rgba(105, 82, 135, 0.08);
}

:root[data-theme="dark"] {
    --bg: #211c22;
    --surface: #2c252e;
    --surface-soft: #382c37;
    --text: #f0e3eb;
    --muted: #b9a5b2;
    --accent: #d99eaf;
    --accent-dark: #e8afc1;
    --border: #493a48;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Trebuchet MS", Arial, sans-serif;
    line-height: 1.6;
    transition: background 0.2s, color 0.2s;
}

.container {
    width: min(100% - 36px, 920px);
    margin: 0 auto;
}

.topbar {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--accent-dark);
    text-decoration: none;
}

.story-hero {
    margin: 40px auto;
    text-align: center;
}

.story-cover {
    display: block;
    width: min(100%, 512px);
    height: auto;
    margin: 0 auto 24px;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.story-hero h1 {
    color: var(--accent-dark);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    line-height: 1.3;
}


.story-characters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px auto;
}

.story-characters img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--surface-soft);
    padding: 4px;
}


.chapters {
    margin: 40px 0;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.chapters h2 {
    margin-top: 0;
    color: var(--accent-dark);
}

.chapter-group {
    margin: 24px 0;
}

.chapter-group h3 {
    margin-bottom: 12px;
    color: var(--accent-dark);
}

.chapter-group a,
.chapter-group a:visited {
    display: block;
    margin: 8px 0;
    padding: 10px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.chapter-group a:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent-dark);
    text-decoration: none;
}

.chapter-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.chapter-navigation a {
    color: var(--accent-dark);
    text-decoration: none;
    padding: 10px 16px;
    background: var(--surface-soft);
    border-radius: 10px;
}

.chapter-navigation a:hover {
    background: var(--surface);
    text-decoration: underline;
}
/* Soft page transitions */
body {
    opacity: 0;
    transition: opacity 220ms ease, background 0.2s, color 0.2s;
}

body.page-ready {
    opacity: 1;
}

body.page-leaving {
    opacity: 0;
}

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

#story-list {
    opacity: 1;
    transition: opacity 180ms ease;
}

#story-list.is-updating {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    #story-list {
        transition: none;
    }
}
.event-date {
    margin-top: 14px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-align: center;
}
.story-credits {
    padding: 10px 0;
    background: var(--surface-soft);
    border-radius: 10px;
    margin: 8px 0 16px;
}

.story-credits p {
    margin: 4px 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
}

.story-credits strong {
    color: var(--accent-dark);
}


.story-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(250px, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 28px;
}


.event-info {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}


.event-info h2 {
    margin-top: 0;
}

.event-info h3 {
    margin-top: 20px;
    margin-bottom: 8px;
}


.event-info .story-characters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.event-info .story-characters img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}


.event-type {
    display: inline-block;
    background: var(--accent);
    color: #493F55;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}




.card-cgs {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.card-cgs summary {
    cursor: pointer;
    font-weight: 600;
    padding: 8px 0;
}

.card-cgs summary:hover {
    color: var(--accent-dark);
}


.card-cg-entry {
    margin-top: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.card-cg-entry:last-child {
    border-bottom: none;
}


.card-cg-stars {
    text-align: center;
    color: #D5A642;
    font-size: 1.1rem;
    letter-spacing: 4px;
    margin-bottom: 10px;
}


.card-cg-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.card-cg-pair a {
    display: block;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    font-size: 0.8rem;
}

.card-cg-pair img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 180ms ease;
}

.card-cg-pair a:hover img {
    transform: scale(1.04);
}

.card-cg-pair span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}




@media (max-width: 700px) {
    .story-layout {
        grid-template-columns: 1fr;
    }
}


.card-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(25, 20, 35, 0.88);
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.card-lightbox.is-open {
    display: flex;
}

.card-lightbox-image {
    display: block;
    max-width: 90%;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.35);
}


.card-lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 5px 10px;
}

.card-lightbox-close:hover {
    color: #D5A642;
}


.card-lightbox-prev,
.card-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 180ms ease, transform 180ms ease;
}

.card-lightbox-prev {
    left: 25px;
}

.card-lightbox-next {
    right: 25px;
}

.card-lightbox-prev:hover,
.card-lightbox-next:hover {
    background: var(--accent-dark);
    transform: translateY(-50%) scale(1.08);
}



@media (max-width: 600px) {
    .card-lightbox {
        padding: 15px;
    }

    .card-lightbox-image {
        max-width: 100%;
        max-height: 80vh;
    }

    .card-lightbox-close {
        top: 10px;
        right: 12px;
    }
    .card-lightbox-prev {
    left: 8px;
}

.card-lightbox-next {
    right: 8px;
}

.card-lightbox-prev,
.card-lightbox-next {
    width: 38px;
    height: 38px;
    font-size: 1rem;
}
}

.chapter-group a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}


.chapter-characters {
    display: flex;
    align-items: center;
    gap: 6px;
}


.chapter-characters img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.character-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.character-button {
    position: relative;
    background: var(--surface-soft);
    border: 3px solid var(--border);
    border-radius: 50%;
    padding: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.character-button img {
    display: block;
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
}


.character-button.selected {
    background: #493F55;
    border: 4px solid #493F55;
    box-shadow: 0 0 0 3px #FFFFFF;
}

.character-button.selected::after {
    content: "✓";
    position: absolute;
    top: -5px;
    right: -5px;
    width: 23px;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    color: #493F55;
    border: 2px solid #493F55;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}


.character-button.unit-selected:not(.selected) {
    background: #493F55;
    border: 4px dashed #493F55;
    box-shadow: 0 0 0 3px #FFFFFF;
}

.character-button.unit-selected:not(.selected)::after {
    content: "U";
    position: absolute;
    top: -5px;
    right: -5px;
    width: 23px;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    color: #493F55;
    border: 2px solid #493F55;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

:root[data-theme="dark"] .oissu__embed .oissu {
    background-color: #211D29 !important;
    color: #F4EFFA !important;
}


:root[data-theme="dark"] .oissu__embed .os-toolbar.top {
    background-color: #292331 !important;
    color: #F4EFFA !important;
    border-color: #554762 !important;
}

:root[data-theme="dark"] .oissu__embed .os-toolbar.top a {
    color: #E5D5F5 !important;
}

:root[data-theme="dark"] .oissu__embed .os-toolbar.top a:hover {
    color: #FFFFFF !important;
    background-color: #554762 !important;
}

:root[data-theme="dark"] .oissu__embed {
    --os-text-color: #F4EFFA;
    --os-bubble-color: #352D40;
    --os-background-color: #211D29;
    --os-background-secondary-color: #292331;
    --os-border-color: #554762;
    --os-toolbar-icon-color: #F4EFFA;
    --os-identifier-color: #E5D5F5;
}

:root[data-theme="dark"] .oissu__embed .os-toolbar.bottom {
    background-color: #292331 !important;
    color: #F4EFFA !important;
    border-color: #554762 !important;
}

:root[data-theme="dark"] .oissu__embed .os-toolbar.bottom a {
    color: #E5D5F5 !important;
}

:root[data-theme="dark"] .oissu__embed .os-toolbar.bottom a:hover {
    color: #FFFFFF !important;
    background-color: #554762 !important;
}

.theme-button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 50px;
    padding: 8px 13px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    line-height: 20.8px;
}

.confession-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.confession-title {
    flex: 1;
    min-width: 0;
}

.confession-title h1 {
    margin-bottom: 8px;
}

.confession-title p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.confession-card-art {
    width: 130px;
    height: 130px;
    flex: 0 0 130px;
    object-fit: contain;
    border-radius: 10px;
}


@media (max-width: 500px) {
    .confession-header {
        gap: 12px;
    }

    .confession-card-art {
        width: 105px;
        height: 105px;
        flex-basis: 105px;
    }
}


.prose-story-page {
    max-width: 820px;
    margin: 0 auto;
    padding-bottom: 48px;
}

.prose-story-header {
    text-align: center;
    padding: 36px 20px 30px;
}

.prose-story-header h1 {
    font-size: 2.4rem;
    line-height: 1.2;
    margin: 0 0 12px;
    color: var(--text);
}

.prose-story-credit {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
    font-style: italic;
}

.prose-story-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 42px;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.9;
    box-shadow: var(--shadow);
}

.prose-story-content p {
    margin: 0 0 1.4em;
}

.prose-story-content p:last-child {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .prose-story-header {
        padding: 28px 12px 24px;
    }

    .prose-story-header h1 {
        font-size: 2rem;
    }

    .prose-story-content {
        padding: 24px 20px;
        font-size: 0.95rem;
        line-height: 1.85;
    }
}

.prose-story-divider {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 42px 0;
    color: var(--accent-dark);
}

.prose-story-divider::before,
.prose-story-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--accent);
}

.prose-story-divider span {
    font-size: 1.1rem;
    letter-spacing: 5px;
    font-weight: 600;
}

.footnote-ref {
    display: inline-block;
    margin-left: 2px;
    font-size: 0.72em;
    line-height: 0;
    vertical-align: super;
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.footnote-ref:hover {
    text-decoration: underline;
}

.prose-story-notes {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.prose-story-notes h2 {
    margin: 0 0 20px;
    font-size: 1.15rem;
    color: var(--text);
}

.prose-story-note {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 14px 16px;
    background: var(--surface-soft);
    border-radius: 10px;
    scroll-margin-top: 24px;
}

.prose-story-note-number {
    color: var(--accent-dark);
    font-weight: 700;
}

.prose-story-note p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.footnote-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: var(--accent-dark);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
}

.footnote-back:hover {
    background: var(--border);
}

.prose-story-intro {
    max-width: 720px;
    margin: 0 auto 28px;
    padding: 16px 22px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.75;
    text-align: center;
}

@media (max-width: 600px) {
    .prose-story-intro {
        margin: 0 0 24px;
        padding: 14px 16px;
        font-size: 0.88rem;
    }
}

.prose-story-info {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.prose-story-info h2 {
    margin: 0 0 18px;
    font-size: 1.15rem;
    color: var(--text);
}

.prose-story-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 14px;
    border-radius: 8px;
}

.prose-story-info-row:nth-of-type(even) {
    background: var(--surface-soft);
}

.prose-story-info-row span:first-child {
    color: var(--muted);
    font-size: 0.9rem;
}

.prose-story-info-row span:last-child {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

@media (max-width: 600px) {
    .prose-story-info-row {
        gap: 10px;
        padding: 10px;
    }

    .prose-story-info-row span:first-child,
    .prose-story-info-row span:last-child {
        font-size: 0.85rem;
    }
}
.oissu video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    border-radius: 8px;
}
