* {
margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #101014;
    color: white;
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

/* HEADER */

header {
    text-align: center;
    padding: 45px 20px;
    background: #191923;
}

header h1 {
    font-size: 42px;
    color: #c9a7ff;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

header p {
    color: #b8b8c5;
}

/* NAVIGATION */

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px 15px;
    background: #22222d;
}

nav button {
    background: transparent;
    color: white;
    border: 1px solid #555568;
    padding: 11px 20px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 15px;
    transition: 0.3s;
}

nav button:hover {
    background: #c9a7ff;
    color: #101014;
}

/* MAIN */

main {
    padding: 45px 20px;
    min-height: 450px;
}

[hidden] {
    display: none !important;
}

/* HERO SECTION */

.hero {
    max-width: 1000px;
    margin: 20px auto 70px;
    padding: 75px 25px;
    text-align: center;
    background: linear-gradient(135deg, #29243b, #191923, #302344);
    border: 1px solid #49405d;
    border-radius: 20px;
}

.small-heading {
    color: #c9a7ff;
    font-size: 12px;
    letter-spacing: 3px;
    margin-bottom: 22px;
}

.hero h2 {
    font-size: 42px;
    margin-bottom: 18px;
}

.hero-text {
    color: #c0bdca;
    font-size: 17px;
    line-height: 1.7;
    max-width: 600px;
    margin: auto;
}

.explore-button {
    margin-top: 30px;
    padding: 13px 25px;
    border: none;
    border-radius: 25px;
    background: #c9a7ff;
    color: #17131f;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
}

.explore-button:hover {
    background: white;
    transform: translateY(-3px);
}

/* EXPLORE CARDS */

.explore {
    max-width: 1100px;
    margin: auto;
    text-align: center;
}

.explore h2 {
    color: #c9a7ff;
    font-size: 30px;
    margin-bottom: 12px;
}

.section-subtitle {
    color: #aaa8b6;
    margin-bottom: 35px;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.creative-card {
    background: #1c1c27;
    border: 1px solid #393747;
    border-radius: 16px;
    padding: 30px 18px;
    cursor: pointer;
    transition: 0.3s;
}

.creative-card:hover {
    transform: translateY(-7px);
    border-color: #c9a7ff;
    background: #262333;
}

.card-icon {
    font-size: 35px;
    display: block;
    margin-bottom: 18px;
}

.creative-card h3 {
    color: #c9a7ff;
    margin-bottom: 12px;
    font-size: 20px;
}

.creative-card p {
    color: #aaa8b6;
    font-size: 14px;
    line-height: 1.6;
}

/* OTHER SECTIONS */

.content-section:not(#home) {
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.3s ease;
}

.content-section:not(#home) h2 {
    font-size: 32px;
    color: #c9a7ff;
    margin-bottom: 18px;
}

.content-section:not(#home) p {
    color: #b8b8c5;
    font-size: 17px;
}

/* ANIMATION */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* FOOTER */

footer {
    text-align: center;
    padding: 25px;
    color: #888899;
    background: #191923;
    line-height: 1.8;
}

/* MOBILE RESPONSIVE */

@media (max-width: 800px) {
    .card-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h2 {
        font-size: 34px;
    }
}

@media (max-width: 500px) {
    header h1 {
        font-size: 32px;
    }

    .hero {
        padding: 55px 18px;
    }

    .hero h2 {
        font-size: 28px;
    }

    .hero-text {
        font-size: 15px;
    }

    .card-container {
        grid-template-columns: 1fr;
    }

    nav {
        gap: 9px;
    }

    nav button {
        padding: 9px 13px;
        font-size: 13px;
    }
}

/* BOOKS PAGE */

.page-heading {
    text-align: center;
    margin: 20px 0 60px;
}

.page-heading h2 {
    color: #c9a7ff;
    font-size: 35px;
    margin: 15px 0;
}

.page-heading p:last-child {
    color: #aaa8b6;
}

.book-category {
    max-width: 1100px;
    margin: 50px auto;
}

.book-category > h2 {
    color: #c9a7ff;
    margin-bottom: 25px;
    font-size: 25px;
}

.book-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
}

.book-card {
    display: flex;
    gap: 18px;
    align-items: center;
    background: #1c1c27;
    border: 1px solid #393747;
    border-radius: 15px;
    padding: 18px;
    transition: 0.3s;
}

.book-card:hover {
    border-color: #c9a7ff;
    transform: translateY(-4px);
}

.book-cover {
    min-width: 105px;
    height: 145px;
    background: linear-gradient(145deg, #45365f, #211d30);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 38px;
}

.book-info {
    text-align: left;
}

.book-info h3 {
    color: white;
    margin-bottom: 10px;
}

.book-info p {
    color: #aaa8b6;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.book-info .author {
    color: #c9a7ff;
}

.status {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
}

.ongoing {
    background: #34304a;
    color: #c9a7ff;
}

.completed {
    background: #263d36;
    color: #a5e6c2;
}

@media (max-width: 500px) {
    .book-card {
        gap: 13px;
        padding: 13px;
    }

    .book-cover {
        min-width: 90px;
        height: 125px;
    }
}

/* BOOK READER */

.back-button {
    background: transparent;
    color: #c9a7ff;
    border: 1px solid #555568;
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
}

.back-button:hover {
    background: #c9a7ff;
    color: #101014;
}

.reader-heading {
    text-align: center;
    margin: 40px 0;
}

.reader-heading h2 {
    color: #c9a7ff;
    font-size: 32px;
    margin: 12px;
}

.reader-heading p {
    color: #aaa8b6;
}

.reader-box {
    max-width: 800px;
    margin: auto;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 25px;
    background: #1c1c27;
    border: 1px solid #393747;
    border-radius: 15px;
}

.reader-cover {
    width: 130px;
    height: 175px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
    background: linear-gradient(145deg, #45365f, #211d30);
    border-radius: 10px;
}

.reader-info h2 {
    color: #c9a7ff;
    margin-bottom: 15px;
}

.reader-info p {
    color: #aaa8b6;
    margin-bottom: 10px;
}

.reading-area {
    max-width: 800px;
    margin: 35px auto;
    padding: 35px;
    min-height: 200px;
    text-align: center;
    background: #191923;
    border-radius: 15px;
}

.reading-area h2 {
    color: #c9a7ff;
    margin-bottom: 15px;
}

.reading-area p {
    color: #aaa8b6;
}

@media (max-width: 500px) {
    .reader-box {
        flex-direction: column;
        text-align: center;
    }

    .reader-info {
        text-align: center;
    }
}

.read-button {
    margin-top: 12px;
    padding: 9px 15px;
    background: #c9a7ff;
    color: #17131f;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.3s;
}

.read-button:hover {
    background: white;
    transform: translateY(-2px);
}

/* PDF READER */

.pdf-container {
    max-width: 1000px;
    height: 750px;
    margin: 30px auto;
    background: #1c1c27;
    border: 1px solid #49405d;
    border-radius: 12px;
    overflow: hidden;
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

@media (max-width: 600px) {
    .pdf-container {
        height: 600px;
    }
}


.art-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.art-card {
    background: #191720;
    border: 1px solid #49405d;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
}

.art-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #24202e;
    border-radius: 10px;
    font-size: 45px;
    margin-bottom: 15px;
}

.art-card h3 {
    color: #c9a7ff;
    margin-bottom: 8px;
}

.art-card p {
    color: #aaa;
}


.gallery-hero {
    text-align: center;
    max-width: 750px;
    margin: 20px auto 55px;
    padding: 35px 20px;
}

.gallery-hero h2 {
    font-size: clamp(32px, 6vw, 52px);
    color: #e6d8ff;
    margin: 18px 0;
    letter-spacing: 1px;
}

.gallery-description {
    color: #b9b2c5;
    font-size: 16px;
    line-height: 1.9;
}

.gallery-divider {
    display: block;
    width: 65px;
    height: 2px;
    background: #c9a7ff;
    margin: 28px auto;
}

.gallery-note {
    color: #c9a7ff;
    font-size: 11px;
    letter-spacing: 4px;
}

.category-number {
    color: #a98bd2;
    font-size: 10px;
    letter-spacing: 2px;
    margin: 18px 0 10px;
}

.category-card {
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: #c9a7ff;
}

.category-card button {
    margin-top: 15px;
}

.art-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #24202e;
    border-radius: 10px;
    display: block;
}


.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 950px;
    margin: 0 auto 40px;
}

.manga-card {
    background: #191720;
    border: 1px solid #49405d;
    border-radius: 14px;
    overflow: hidden;
    transition: 0.3s ease;
}

.manga-card:hover {
    transform: translateY(-5px);
    border-color: #c9a7ff;
}

.manga-cover {
    height: 260px;
    background: linear-gradient(145deg, #30263e, #17141f);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.manga-cover span {
    font-size: 55px;
}

.manga-cover p {
    color: #c9a7ff;
    font-size: 11px;
    letter-spacing: 3px;
}

.manga-info {
    padding: 22px;
}

.manga-info h3 {
    color: #e6d8ff;
    margin: 12px 0;
}

.manga-info > p:not(.category-number) {
    color: #aaa;
    line-height: 1.7;
}

.chapter-container {
    max-width: 750px;
    margin: 0 auto 40px;
    padding: 20px;
}

.chapter-container h3 {
    color: #e6d8ff;
    font-size: 25px;
}

.chapter-subtitle {
    color: #aaa;
    margin: 10px 0 25px;
}

.chapter-list {
    display: grid;
    gap: 14px;
}

.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px;
    background: #191720;
    border: 1px solid #49405d;
    border-radius: 12px;
}

.chapter-item h4 {
    color: #c9a7ff;
    margin-bottom: 6px;
}

.chapter-item p {
    color: #999;
    font-size: 13px;
}

.manga-page-area {
    max-width: 850px;
    margin: 0 auto 40px;
}

.manga-page-placeholder {
    min-height: 500px;
    background: #191720;
    border: 1px solid #49405d;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 15px;
    padding: 20px;
}

.manga-page-placeholder span {
    font-size: 55px;
}

.manga-page-placeholder h3 {
    color: #c9a7ff;
}

.manga-page-placeholder p {
    color: #aaa;
}

.manga-reader-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.manga-reader-controls span {
    color: #c9a7ff;
}

.manga-reader-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 500px) {
    .chapter-item {
        padding: 14px;
    }

    .manga-page-placeholder {
        min-height: 400px;
    }
}


/* EDITS COLLECTION */

.edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 1050px;
    margin: 0 auto 40px;
}

.edit-card {
    background: #191720;
    border: 1px solid #49405d;
    border-radius: 14px;
    overflow: hidden;
    transition: .3s ease;
}

.edit-card:hover {
    transform: translateY(-6px);
    border-color: #c9a7ff;
}

.edit-cover {
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.edit-cover span {
    font-size: 55px;
    color: #e6d8ff;
}

.edit-cover p {
    color: #c9a7ff;
    font-size: 11px;
    letter-spacing: 3px;
}

.video-cover {
    background: linear-gradient(145deg, #342442, #17141f);
}

.birthday-cover {
    background: linear-gradient(145deg, #473044, #1c1724);
}

.other-cover {
    background: linear-gradient(145deg, #263448, #17141f);
}

.edit-info {
    padding: 22px;
}

.edit-info h3 {
    color: #e6d8ff;
    margin: 12px 0;
}

.edit-info > p:not(.category-number) {
    color: #aaa;
    line-height: 1.7;
}

.edit-info button {
    margin-top: 15px;
}

.edit-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #30263e, #191720);
    border-radius: 10px;
    font-size: 45px;
    color: #c9a7ff;
    margin-bottom: 15px;
}

footer {
    margin-top: 20px;
    padding: 20px 10px;
    text-align: center;
}

nav {
    margin-bottom: 10px;
}

.content-section {
    margin-top: 10px;
}


header {
    padding-bottom: 5px !important;
    margin-bottom: 0 !important;
}

nav {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 5px !important;
}

.content-section {
    margin-top: 0 !important;
    padding-top: 5px !important;
}


.content-section[hidden] {
    display: none !important;
}

.content-section:not([hidden]) {
    min-height: auto !important;
    height: auto !important;
    margin-top: 0 !important;
    padding-top: 10px !important;
}

main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}



/* DRAWINGS: THREE SQUARE 3D CATEGORY CARDS */
.category-grid {
    width: min(100%, 1100px);
    margin: 0 auto 35px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
    perspective: 1000px;
}

.category-card {
    position: relative;
    isolation: isolate;
    min-width: 0;
    aspect-ratio: 1 / 1;
    padding: clamp(18px, 2.5vw, 30px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    background: linear-gradient(145deg, #292238 0%, #1b1825 55%, #14131b 100%);
    border: 1px solid #51436b;
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28),
                inset 0 1px 0 rgba(255, 255, 255, 0.07);
    transform-style: preserve-3d;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.category-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 50% 0%, rgba(201, 167, 255, 0.18), transparent 58%);
    pointer-events: none;
}

.category-card:hover {
    transform: translateY(-9px) rotateX(3deg) rotateY(-3deg);
    border-color: #c9a7ff;
    box-shadow: 0 22px 38px rgba(0, 0, 0, 0.38),
                0 0 22px rgba(201, 167, 255, 0.12);
}

.category-icon {
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    font-size: 42px;
    border-radius: 20px;
    background: linear-gradient(145deg, #44345f, #241d33);
    border: 1px solid rgba(201, 167, 255, 0.28);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateZ(24px);
}

.category-card .category-number {
    margin: 8px 0;
    font-size: 9px;
    line-height: 1.5;
    letter-spacing: 1.5px;
    transform: translateZ(18px);
}

.category-card h3 {
    margin: 4px 0 8px;
    color: #e3d2ff;
    font-size: clamp(18px, 2vw, 23px);
    transform: translateZ(20px);
}

.category-card > p:not(.category-number) {
    max-width: 290px;
    color: #b9b2c5;
    font-size: 12px;
    line-height: 1.6;
    transform: translateZ(14px);
}

.category-card button {
    margin-top: 14px;
    padding: 9px 15px;
    border: 1px solid rgba(201, 167, 255, 0.55);
    border-radius: 22px;
    background: linear-gradient(135deg, #c9a7ff, #a982e8);
    color: #17131f;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transform: translateZ(25px);
    transition: background 0.25s ease, transform 0.25s ease;
}

.category-card button:hover {
    background: #ffffff;
    transform: translateZ(30px) translateY(-2px);
}

@media (max-width: 850px) {
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (max-width: 560px) {
    .category-grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 360px;
        gap: 20px;
    }

    .category-card {
        aspect-ratio: 1 / 1;
        padding: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-card,
    .category-card button {
        transition: none;
    }

    .category-card:hover {
        transform: none;
    }
}


/* BOOK LIBRARY + EMBEDDED PDF READER */
.book-loading{color:#aaa8b6;padding:18px;background:#191923;border:1px dashed #49405d;border-radius:12px;grid-column:1/-1}
.book-slot-label{color:#c9a7ff!important;font-size:12px}
#reader .reader-heading{margin-top:28px}
#reader .pdf-container{width:min(1100px,100%);height:min(78vh,900px);min-height:560px}
#reader .pdf-container iframe{display:block;width:100%;height:100%}
@media(max-width:600px){#reader .pdf-container{height:72vh;min-height:480px}}


/* ACCOUNT / LOGIN */
header { position: relative; }
.profile-button {
    position: absolute;
    top: 22px;
    right: clamp(14px, 4vw, 42px);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid #8065a8;
    background: linear-gradient(145deg, #30263e, #191720);
    color: #e6d8ff;
    font-size: 20px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: .25s ease;
}
.profile-button:hover { transform: translateY(-2px); border-color: #c9a7ff; }
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(5, 4, 10, .78);
    backdrop-filter: blur(7px);
}
.auth-modal[hidden] { display: none !important; }
.auth-dialog {
    position: relative;
    width: min(420px, 100%);
    padding: 34px 26px 28px;
    text-align: center;
    background: #1c1c27;
    border: 1px solid #51436b;
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(0,0,0,.45);
}
.auth-dialog h2 { color: #e6d8ff; margin: 8px 0 12px; }
.auth-dialog p { color: #b8b8c5; line-height: 1.6; }
.auth-close {
    position: absolute;
    top: 8px;
    right: 13px;
    border: 0;
    background: transparent;
    color: #ddd;
    font-size: 28px;
    cursor: pointer;
}
#visitorAuthForm { display: grid; gap: 12px; margin: 22px 0 12px; }
#visitorAuthForm input {
    width: 100%;
    padding: 13px 14px;
    color: white;
    background: #111018;
    border: 1px solid #49405d;
    border-radius: 9px;
}
#visitorAuthForm button, #visitorLogout {
    padding: 12px 18px;
    border: 0;
    border-radius: 22px;
    background: #c9a7ff;
    color: #17131f;
    font-weight: bold;
    cursor: pointer;
}
#visitorAuthSubmit:disabled { opacity: .6; cursor: wait; }
#authMessage { min-height: 22px; font-size: 13px !important; }
.auth-text-button {
    border: 0;
    background: transparent;
    color: #c9a7ff;
    cursor: pointer;
    margin-top: 8px;
}
#profileEmail { margin: 15px 0 22px; overflow-wrap: anywhere; }

/* LOCKED COMPLETED COLLECTIONS */
.access-prompt-button, .locked-content-card {
    display: block;
    width: min(100%, 420px);
    margin: 14px auto 20px;
    padding: 17px 20px;
    border: 1px solid #6d5a8c;
    border-radius: 13px;
    background: linear-gradient(135deg, #292238, #1c1c27);
    color: #e6d8ff;
    font-weight: bold;
    cursor: pointer;
    transition: .25s ease;
}
.access-prompt-button:hover, .locked-content-card:hover {
    border-color: #c9a7ff;
    transform: translateY(-2px);
}
.status-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 auto 28px;
}
.status-tabs button {
    padding: 11px 23px;
    border: 1px solid #555568;
    border-radius: 22px;
    background: #1c1c27;
    color: #ddd;
    cursor: pointer;
}
.status-tabs button.active {
    background: #c9a7ff;
    color: #17131f;
    border-color: #c9a7ff;
    font-weight: bold;
}
.owner-chapters { display: grid; gap: 8px; margin: 12px 0; }
.owner-chapter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px;
    border-radius: 8px;
    background: #171122;
    color: #ddd;
    font-size: 13px;
}
.owner-chapter-row button { width: auto; padding: 7px 10px; margin: 0; }
@media (max-width: 520px) {
    .profile-button { top: 12px; right: 12px; width: 40px; height: 40px; }
    header { padding-top: 55px; }
    .auth-dialog { padding: 32px 18px 22px; }
    .owner-chapter-row { align-items: flex-start; }
}


/* BOOKS PAGE HEADING CONTRAST */
#books .page-heading .small-heading {
    color: #7956a8;
}
#books .page-heading h2 {
    color: #68458f;
}
#books .page-heading p:last-child {
    color: #5b5664;
}


/* Clear and brighter section headings */
.hero h1,
.hero p,
.section-header h1,
.section-header h2,
.section-header p,
.section-title,
.section-subtitle {
    color: #49316F !important;
    opacity: 1 !important;
}

/* Supporting descriptions */
.hero p,
.section-header p,
.section-subtitle {
    color: #62546F !important;
}


/* BRIGHT TEXT - OUTSIDE CONTENT SLOTS ONLY */

/* HOME */
#home .hero .small-heading,
#home .explore > h2 {
    color: #7C3AED !important;
}

#home .hero h2 {
    color: #54218C !important;
}

#home .hero-text,
#home .section-subtitle {
    color: #3F3F46 !important;
}

/* BOOKS */
#books .page-heading .small-heading,
#books .page-heading h2 {
    color: #7C3AED !important;
}

#books .page-heading > p:last-child {
    color: #3F3F46 !important;
}

/* MANGA, DRAWINGS AND EDITS - OUTER HEADINGS */
#manga .gallery-hero h2,
#manga .gallery-hero .small-heading,
#drawings .gallery-hero h2,
#drawings .gallery-hero .small-heading,
#edits .gallery-hero h2,
#edits .gallery-hero .small-heading {
    color: #7C3AED !important;
}

#manga .gallery-description,
#drawings .gallery-description,
#edits .gallery-description {
    color: #3F3F46 !important;
}

#manga .gallery-note,
#drawings .gallery-note,
#edits .gallery-note {
    color: #6D28D9 !important;
}


/* Normalize these two headings */
.gallery-hero h2 {
    color: #B9A7D6 !important;
}

.gallery-description {
    color: #AAA4B5 !important;
}



/* DRAWINGS - FINAL RESPONSIVE 3D CARDS */

.category-grid {
    width: min(100%, 1250px);
    max-width: 1250px;
    margin: 0 auto 35px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
    perspective: 1000px;
}

.category-card {
    box-sizing: border-box;
    min-width: 0;
    aspect-ratio: 1 / 1;
    height: auto;
    padding: 28px;
    overflow: hidden;
}

/* TABLET */
@media (max-width: 850px) {
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .category-card {
        padding: 22px;
    }
}

/* PHONE */
@media (max-width: 560px) {
    .category-grid {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 440px;
        padding: 0 12px;
        gap: 22px;
        box-sizing: border-box;
    }

    .category-card {
        width: 100%;
        aspect-ratio: 1 / 1;
        padding: 26px 22px;
    }

    .category-icon {
        width: 68px;
        height: 68px;
        font-size: 38px;
    }

    .category-card > p:not(.category-number) {
        max-width: 100%;
    }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .category-card,
    .category-card button {
        transition: none;
    }

    .category-card:hover {
        transform: none;
    }
}


/* DRAWINGS - LARGE SQUARE CARDS FINAL FIX */

#drawings .category-grid {
    width: min(100%, 1250px);
    max-width: 1250px;
    margin: 0 auto 35px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 28px;
    perspective: 1000px;
}

#drawings .category-card {
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    height: auto;
    box-sizing: border-box;
    padding: 30px;
    overflow: hidden;
}

@media (max-width: 560px) {
    #drawings .category-grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 440px;
        padding: 0 12px;
        gap: 22px;
        box-sizing: border-box;
    }

    #drawings .category-card {
        aspect-ratio: 1 / 1;
        padding: 24px 20px;
    }

    #drawings .category-icon {
        width: 68px;
        height: 68px;
        font-size: 38px;
    }
}


/* LOGIN INPUT BOXES - WIDTH FIX */

#visitorAuthForm {
    width: 100%;
    box-sizing: border-box;
}

#visitorAuthForm input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: block;
    padding: 12px 14px;
    margin: 0;
}

.auth-dialog {
    box-sizing: border-box;
}

/* Writer Access Form */
#writerRequestForm input {
    width: 100%;
    min-height: 50px;
    padding: 14px 16px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 14px;
}

#writerRequestForm textarea {
    width: 100%;
    min-height: 150px;
    padding: 14px 16px;
    font-size: 16px;
    line-height: 1.6;
    box-sizing: border-box;
    resize: vertical;
    margin-bottom: 14px;
}

#writerRequestForm {
    width: 100%;
}

/* Keep profile panel compact */
#profilePanel {
    max-height: 75vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 18px;
}

/* Writer access section */
.writer-access-panel {
    width: 100%;
    box-sizing: border-box;
}

/* Writer form fields */
#writerRequestForm input,
#writerRequestForm textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* About yourself box */
#writerRequestForm textarea {
    min-height: 120px;
    resize: vertical;
}
#profilePanel {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#profilePanel::-webkit-scrollbar {
    display: none;
}


/* DRAWINGS: MOBILE TWO-COLUMN CARDS + VISIBLE EXPLORE BUTTONS */
@media (max-width: 560px) {
    #drawings .category-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        max-width: 100%;
        padding: 0 8px;
        gap: 12px;
        box-sizing: border-box;
    }

    #drawings .category-card {
        width: 100%;
        min-width: 0;
        min-height: 190px;
        aspect-ratio: 1 / 1;
        height: auto;
        padding: 12px 8px;
        overflow: visible;
        box-sizing: border-box;
    }

    #drawings .category-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 6px;
        font-size: 24px;
        border-radius: 12px;
    }

    #drawings .category-card .category-number {
        margin: 5px 0;
        font-size: 7px;
        line-height: 1.35;
        letter-spacing: 1px;
    }

    #drawings .category-card h3 {
        margin: 3px 0 5px;
        font-size: 14px;
        line-height: 1.25;
    }

    #drawings .category-card > p:not(.category-number) {
        max-width: 100%;
        font-size: 9px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    #drawings .category-card button {
        display: inline-block;
        visibility: visible;
        margin-top: 8px;
        padding: 7px 9px;
        font-size: 9px;
        line-height: 1.2;
        white-space: nowrap;
    }
}


/* PAGINATION: square buttons in groups of three */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px auto 38px;
}
.pagination[hidden] { display: none !important; }
.pagination .page-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border: 1px solid #594773;
    border-radius: 10px;
    background: #211a2d;
    color: #e6d8ff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}
.pagination .page-button:hover,
.pagination .page-button.active {
    border-color: #c9a7ff;
    background: #c9a7ff;
    color: #17131f;
}
.pagination .page-button.page-arrow { font-size: 20px; }

/* Uploaded artwork and video cards */
.dynamic-gallery { align-items: stretch; }
.media-art-card { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.media-art-card h3 { margin-top: 4px; }
.media-art-card > p:not(.media-slot-label) { line-height: 1.55; }
.media-slot-label { color: #a98bd2 !important; font-size: 12px; margin: 0; }
.art-media-preview {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: cover;
    background: #111018;
    border: 1px solid #49405d;
    border-radius: 10px;
}
.media-art-card video.art-media-preview { object-fit: contain; }
.media-open-button {
    align-self: center;
    margin-top: auto;
    padding: 9px 18px;
    border: 0;
    border-radius: 20px;
    background: #c9a7ff;
    color: #17131f;
    font-weight: 700;
    cursor: pointer;
}

/* On-site media viewer */
.media-viewer { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 16px; }
.media-viewer[hidden] { display: none !important; }
.media-viewer-backdrop { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(5,4,10,.88); backdrop-filter: blur(8px); }
.media-viewer-dialog { position: relative; z-index: 1; width: min(1000px, 100%); max-height: 92vh; overflow: auto; padding: 24px; border: 1px solid #51436b; border-radius: 18px; background: #191720; box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.media-viewer-dialog h2 { color: #e6d8ff; margin: 4px 44px 18px 0; }
.media-viewer-dialog > p { color: #b8b8c5; line-height: 1.6; }
.media-viewer-close { position: absolute; top: 10px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #30263e; color: white; font-size: 26px; cursor: pointer; }
.media-viewer-content { display: grid; place-items: center; min-height: 120px; }
.media-viewer-media { display: block; max-width: 100%; max-height: 72vh; width: auto; height: auto; object-fit: contain; border-radius: 10px; background: #08070c; }
.media-viewer video.media-viewer-media { width: 100%; }

/* Footer links */
footer { text-align: center; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 22px; margin-top: 14px; }
.footer-links a { color: #c9a7ff; text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: white; text-decoration: underline; }

/* About, Contact and Privacy pages */
.legal-page { width: min(940px, calc(100% - 32px)); margin: 34px auto 60px; }
.legal-heading { text-align: center; margin: 24px auto 30px; }
.legal-heading .small-heading { color: #8b63c7; letter-spacing: 3px; font-size: 11px; }
.legal-heading h2 { color: #7c3aed; font-size: clamp(30px, 5vw, 42px); margin: 12px 0; }
.legal-heading p { color: #4b4654; line-height: 1.7; }
.legal-content { padding: clamp(20px, 4vw, 34px); background: #191923; border: 1px solid #49405d; border-radius: 18px; color: #e8e3ef; line-height: 1.8; }
.legal-content h2 { margin: 26px 0 10px; color: #c9a7ff; font-size: 21px; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { margin: 18px 0 8px; color: #e6d8ff; }
.legal-content p, .legal-content li { color: #c5c0ce; }
.legal-content ul { padding-left: 22px; }
.legal-content a { color: #c9a7ff; overflow-wrap: anywhere; }
.legal-back { display: inline-block; margin: 20px 0 0; color: #7c3aed; text-decoration: none; }
@media (max-width: 560px) {
    .pagination .page-button { width: 38px; height: 38px; min-width: 38px; }
    .media-viewer-dialog { padding: 18px 14px; }
    .art-media-preview { height: 190px; }
}


/* Navigation on the standalone information pages */
.legal-nav { background: #22222d; padding: 16px 14px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 22px; }
.legal-nav a { color: #e6d8ff; text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 18px; }
.legal-nav a:hover { color: #17131f; background: #c9a7ff; }
.footer-links { background: transparent !important; padding: 0 !important; margin: 14px 0 0 !important; }
