* {
    font-family: "Press Start 2P", "Courier New", monospace !important;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: pixelated;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.wallpaper {
    position: fixed;
    top: 0;
    left: 0;
    width: 120vw;
    height: 100vh;
    z-index: -1;
    margin-left: -10vw;
    overflow: hidden;
    pointer-events: none;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-layer-0 {
    background-image: url("./assets/background-back.webp");
    z-index: 0;
}
.bg-layer-shine {
    background-image: url("./assets/shine-1.webp");
    z-index: 0.6;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    will-change: transform;
    transform: translateZ(0);
}
.bg-layer-foreground {
    background-image: url("./assets/FORGROUND.webp");
    z-index: 0.7;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    will-change: transform;
    transform: translateZ(0);
}
.bg-layer-frontyard {
    z-index: 0.75;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: auto;
    z-index: 0.5;
}

.bg-layer-frontest {
    display: none;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    z-index: 9999;
    opacity: 1;
    transition: opacity 2s ease-in-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.desktop {
    padding: 20px;
    color: white;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

#pullToRefreshIndicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translate(-50%, -120%);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 160px;
    max-width: 240px;
    padding: 10px 14px;
    border-radius: 24px;
    background: rgba(12, 12, 18, 0.92);
    color: #fff;
    font-family: "Press Start 2P", cursive;
    font-size: 11px;
    z-index: 10050;
    pointer-events: none;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

#pullToRefreshIndicator .ptr-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 215, 0, 0.14);
    color: #ffd700;
    display: grid;
    place-items: center;
    font-size: 16px;
    transition: transform 0.2s ease;
}

#pullToRefreshIndicator .ptr-text {
    line-height: 1.2;
    white-space: nowrap;
}

.desktop.loaded {
    opacity: 1;
}

.icon {
    width: 100px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 20px;
}

.icon img {
    width: 64px;
    height: 64px;
}

.middle-tab {
    position: fixed;
    top: calc(50% - 100px);
    left: calc(50% - 350px);
    width: 700px;
    height: 200px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition:
        transform 0.1s ease-out,
        box-shadow 0.2s ease;
    color: #222;
    z-index: 1000;
}

.middle-tab.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0;
}
.middle-tab.minimized {
    display: none !important;
}

.middle-tab-header {
    background: rgba(45 45 45 / 0.85);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    gap: 10px;
    user-select: none;
}
.middle-tab-header:active {
    cursor: grabbing;
}
.window-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.win-btn {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: transparent;
    border: none;
    color: white;
    font-weight: bold;
    font-size: 14px;
    line-height: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.win-btn:hover {
    background: rgba(255 255 255 / 0.3);
}
.win-btn.close:hover {
    background: #ea4335;
    color: white;
    font-weight: bold;
}

/* Desktop/PC - Make buttons bigger */
@media (min-width: 1024px) {
    .win-btn {
        width: 28px;
        height: 28px;
        font-size: 18px;
        line-height: 24px;
    }
    .chapter-nav-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
    .manga-nav-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
    .chapter-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    .add-chapter-btn {
        padding: 15px;
        font-size: 16px;
    }
    .manga-action-btn {
        padding: 20px 35px;
        font-size: 16px;
    }
    .manga-selection-btn {
        padding: 12px;
        font-size: 14px;
    }
    .manga-modal-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
}

.middle-tab-content {
    flex: 1;
    padding: 40px;
    text-align: center;
    overflow-y: auto;
    color: #222;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.middle-tab-content.wiki-active {
    text-align: initial;
}
#bookReaderSinglePage::-webkit-scrollbar {
    display: none;
}

#bookReaderFrame > div:first-of-type,
#bookReaderLoading {
    font-weight: 300;
    letter-spacing: 0.04em;
}

/* Reader track = gutter between physical sheets */
#bookReaderSinglePage {
    font-weight: 300;
    background: linear-gradient(180deg, #d6c8ac 0%, #c4b493 100%) !important;
}

.book-reader-page-block {
    background: #faf6ee;
    border: 1px solid rgba(120, 92, 49, 0.18);
    border-radius: 6px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.35),
        0 12px 32px rgba(44, 28, 8, 0.16);
    margin: 0;
    padding: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.book-reader-page-block:last-child {
    margin-bottom: 0;
}

.book-reader-page-block-spread {
    position: relative;
}

.book-reader-page-block-spread:first-child::after {
    content: "";
    position: absolute;
    top: 8px;
    right: -10px;
    width: 20px;
    height: calc(100% - 16px);
    background: linear-gradient(
        90deg,
        rgba(88, 57, 21, 0.14) 0%,
        rgba(88, 57, 21, 0.02) 100%
    );
    pointer-events: none;
}

.faux-book-card {
    position: relative;
    overflow: visible !important;
    border-radius: 10px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    perspective: 1200px;
}

.faux-book-spine,
.faux-book-pages,
.faux-book-cover-wrap,
.faux-book-title-plate {
    position: absolute;
}

.faux-book-spine {
    left: -10px;
    top: 6px;
    bottom: 10px;
    width: 16px;
    border-radius: 8px 0 0 8px;
    background: linear-gradient(180deg, #6d532d 0%, #2c1d0d 100%);
    box-shadow: inset -2px 0 5px rgba(255, 255, 255, 0.12);
}

.faux-book-pages {
    right: -6px;
    top: 10px;
    bottom: 16px;
    width: 12px;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(180deg, #f9f1da 0%, #e1d1ac 100%);
    box-shadow:
        inset 0 0 0 1px rgba(126, 93, 37, 0.18),
        inset 3px 0 0 rgba(255, 255, 255, 0.45);
}

.faux-book-cover-wrap {
    inset: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 214, 122, 0.55);
    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.62),
        0 0 18px rgba(255, 214, 122, 0.22);
    transform: rotateY(-10deg) skewY(-1deg);
    transform-origin: left center;
    background: #0f1118;
}

.faux-book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.faux-book-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.02) 28%,
        rgba(0, 0, 0, 0.18) 100%
    );
    pointer-events: none;
}

.faux-book-title-plate {
    left: 12px;
    right: 8px;
    bottom: 12px;
    z-index: 2;
    font-size: 8px;
    line-height: 1.45;
    color: #f7e8bd;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
    background: linear-gradient(
        180deg,
        rgba(8, 8, 10, 0.12) 0%,
        rgba(8, 8, 10, 0.72) 100%
    );
    padding: 10px 8px 8px;
    border-radius: 8px;
}

.faux-book-card:hover .faux-book-cover-wrap {
    transform: rotateY(-18deg) translateY(-4px) skewY(-1deg);
}

.book-open-transition {
    transform-style: preserve-3d;
}

.book-open-transition-spine,
.book-open-transition-pages,
.book-open-transition-cover,
.book-open-transition-sheet {
    position: absolute;
}

.book-open-transition-spine {
    left: 0;
    top: 0;
    bottom: 0;
    width: 28px;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(180deg, #6f532d 0%, #24170b 100%);
    box-shadow: inset -3px 0 6px rgba(255, 255, 255, 0.14);
}

.book-open-transition-pages {
    right: 0;
    top: 14px;
    bottom: 18px;
    width: 18px;
    border-radius: 0 12px 12px 0;
    background: linear-gradient(180deg, #f8efd7 0%, #ded0ac 100%);
    box-shadow:
        inset 0 0 0 1px rgba(126, 93, 37, 0.18),
        inset 4px 0 0 rgba(255, 255, 255, 0.45);
}

.book-open-transition-cover {
    inset: 0 16px 0 12px;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid rgba(255, 214, 122, 0.65);
    background: #0f1118;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
    transform-origin: left center;
    transition: transform 0.48s ease;
}

.book-open-transition.opening .book-open-transition-cover {
    transform: perspective(1800px) rotateY(-115deg);
}

.book-open-transition-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-open-transition-gloss {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.03) 26%,
        rgba(0, 0, 0, 0.22) 100%
    );
}

.book-open-transition-sheet {
    top: 10px;
    bottom: 10px;
    background: linear-gradient(180deg, #fbf3de 0%, #ece0bf 100%);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(62, 38, 11, 0.16);
    opacity: 0;
    transition:
        opacity 0.34s ease,
        transform 0.48s ease;
}

.book-open-transition-sheet-left {
    left: 30px;
    width: calc(50% - 34px);
    transform: perspective(1500px) rotateY(14deg) scaleX(0.96);
}

.book-open-transition-sheet-right {
    right: 22px;
    width: calc(50% - 34px);
    transform: perspective(1500px) rotateY(-8deg) scaleX(0.98);
}

.book-open-transition.opening .book-open-transition-sheet {
    opacity: 1;
}

.book-open-transition.opening .book-open-transition-sheet-left {
    transform: perspective(1800px) rotateY(0deg) scaleX(1);
}

.book-open-transition.opening .book-open-transition-sheet-right {
    transform: perspective(1800px) rotateY(0deg) scaleX(1);
}

.books-card-title {
    font-weight: 300;
    letter-spacing: 0.04em;
}

@media (min-width: 1024px) {
    #bookReaderSinglePage {
        font-size: 15px !important;
        line-height: 1.6 !important;
        font-weight: 300 !important;
    }
}

.middle-tab-title {
    font-size: 60px;
    margin-top: 30px;
    margin-bottom: 10px;
    color: #333;
    font-family: "Press Start 2P", cursive;
    animation: amberGlowPulse 3s ease-in-out infinite;
}
@keyframes amberGlowPulse {
    0%,
    100% {
        color: #333;
        text-shadow:
            0 0 5px #ff980088,
            0 0 10px #ff980044;
        transform: scale(1);
    }
    50% {
        color: #ff9800;
        text-shadow:
            0 0 20px #ff9800bb,
            0 0 40px #ff9800aa;
        transform: scale(1.05);
    }
}

/* Unified GPU-friendly keyframes for all devices - MATCH PC EXACTLY */
@keyframes orbPulseMobile {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 20px rgba(255, 180, 0, 0.5),
            0 0 40px rgba(255, 160, 0, 0.3);
    }
    50% {
        transform: scale(1.06);
        box-shadow:
            0 0 35px rgba(255, 200, 0, 0.7),
            0 0 70px rgba(255, 180, 0, 0.4);
    }
}
@keyframes amberGlowPulseMobile {
    0%,
    100% {
        color: #333;
        text-shadow:
            0 0 5px #ff980088,
            0 0 10px #ff980044;
        transform: scale(1);
        opacity: 1;
    }
    50% {
        color: #ff9800;
        text-shadow:
            0 0 20px #ff9800bb,
            0 0 40px #ff9800aa;
        transform: scale(1.05);
        opacity: 1;
    }
}
@keyframes roadmapGlowMobile {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.06);
        opacity: 0.92;
    }
}
@keyframes iconGlowMobile {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

.middle-tab-subtitle {
    font-size: 12px;
    margin-bottom: 40px;
    color: #444;
    font-family: "Press Start 2P", cursive;
}

/* Keep title/subtitle in fixed position regardless of screen size */
#homeContentOutside {
    transform: translate(-50%, -105%) !important;
}

/* Responsive adjustments for title and subtitle */
@media (max-width: 768px) {
    .middle-tab-title {
        font-size: 36px;
        margin-top: 20px;
    }
    .middle-tab-subtitle {
        font-size: 10px;
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .middle-tab-title {
        font-size: 24px;
        margin-top: 15px;
    }
    .middle-tab-subtitle {
        font-size: 8px;
        margin-bottom: 20px;
    }
}

.nav-buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: nowrap;
    font-family: sans-serif;
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}
.nav-buttons.hidden {
    display: none !important;
}
.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    user-select: none;
    font-size: 14px;
    color: #222;
}
.roadmap-toggle-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 62px;
    height: 62px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    overflow: hidden;
    cursor: pointer;
    z-index: 10050;
    background: #111;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    padding: 0;
}
.roadmap-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.65);
}
.roadmap-toggle-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.settings-drawer {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 0;
    height: 0;
    z-index: 10049;
    pointer-events: none;
}
.settings-drawer.show {
    pointer-events: auto;
}
.settings-drawer-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-family: "Press Start 2P", cursive;
    font-size: 12px;
    cursor: pointer;
    transition:
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.18s ease,
        border-color 0.18s ease,
        opacity 0.24s ease,
        padding-left 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        padding-right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: grid;
    place-items: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transform: translate(0, 0) scale(0.01) rotate(0deg);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
    transform-origin: center center;
    overflow: hidden;
    padding: 0;
    white-space: nowrap;
}
.settings-drawer-short,
.settings-drawer-label {
    position: relative;
    z-index: 1;
    transition:
        opacity 0.2s ease,
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.settings-drawer-short {
    display: inline-block;
    width: 100%;
    text-align: center;
}
.settings-drawer-label {
    position: absolute;
    left: 56px;
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    opacity: 0;
    color: #fff;
    font-size: 10px;
    letter-spacing: 0.08em;
    pointer-events: none;
}
.settings-drawer.show .settings-drawer-btn {
    opacity: 1;
    pointer-events: auto;
}
.settings-drawer.show .settings-drawer-btn:nth-of-type(1) {
    transform: translateY(70px) scale(1) rotate(-360deg);
    transition-delay: 0.05s;
}
.settings-drawer.show .settings-drawer-btn:nth-of-type(2) {
    transform: translateY(140px) scale(1) rotate(-360deg);
    transition-delay: 0.1s;
}
.settings-drawer-btn:hover,
.settings-drawer-btn:focus-visible {
    width: 158px;
    border-radius: 999px;
    justify-content: flex-start;
    padding-left: 18px;
    padding-right: 20px;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 215, 0, 0.32);
}
.settings-drawer-btn:hover .settings-drawer-short,
.settings-drawer-btn:focus-visible .settings-drawer-short {
    opacity: 0;
    transform: translateX(-18px);
}
.settings-drawer-btn:hover .settings-drawer-label,
.settings-drawer-btn:focus-visible .settings-drawer-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.settings-drawer-btn:hover {
    transform: scale(1.08) rotate(0deg);
}
.settings-drawer:not(.show) .settings-drawer-btn {
    transform: translate(0, 0) scale(0.01) rotate(0deg);
    opacity: 0;
    transition-delay: 0s;
}
.update-panel {
    position: fixed;
    inset: 80px 40px 40px 40px;
    padding: 20px;
    border-radius: 22px;
    background: rgba(10, 10, 16, 0.96);
    border: 1px solid rgba(255, 215, 0, 0.14);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(18px);
    z-index: 10048;
    opacity: 0;
    transform: translateY(10px) scale(0.99);
    visibility: hidden;
    transition:
        opacity 0.28s ease,
        transform 0.28s ease,
        visibility 0.28s ease;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: hidden;
}
body.update-panel-open #roadmapToggleBtn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.9);
}
.update-panel.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}
.update-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}
.update-panel-title {
    color: #fff;
    font-family: "Press Start 2P", cursive;
    font-size: 16px;
    letter-spacing: 0.04em;
}
.update-panel-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.28);
    background: rgba(0, 0, 0, 0.55);
    color: #ffd700;
    font-size: 18px;
    cursor: pointer;
    transition:
        background 0.18s ease,
        transform 0.18s ease;
}
.update-panel-close-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 215, 0, 0.1);
}
.update-panel-subtitle {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.5;
}
.update-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 18px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.update-card-title {
    font-family: "Press Start 2P", cursive;
    color: #ffffff;
    font-size: 12px;
    margin-bottom: 10px;
}
.update-card p {
    color: #f8f8f8;
}
.update-feed {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}
.update-feed-item {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #f1f1f1;
}
.update-feed-item.active {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.05)
    );
    border-color: rgba(255, 215, 0, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.update-feed-title {
    font-size: 13px;
    line-height: 1.45;
    color: #ffffff;
}
.update-feed-kicker {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #69b8ff;
}
.update-feed-summary {
    font-size: 11px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.8);
    max-width: 100%;
}
.update-feed-meta {
    flex: 0 0 auto;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.62);
}
.update-article {
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 18px;
}
.update-article-kicker {
    color: #7fbfff;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.update-article-title {
    color: #fff;
    font-family: "Press Start 2P", cursive;
    font-size: 13px;
    line-height: 1.5;
}
.update-section {
    display: grid;
    gap: 10px;
}
.update-section-title {
    color: rgba(255, 255, 255, 0.94);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.update-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    color: #f8f8f8;
    font-size: 12px;
    line-height: 1.5;
}
.update-list li::before {
    content: "•";
    margin-right: 8px;
    color: #ffd700;
}
.update-panel-subtitle {
    color: #f8f8f8;
}
.update-panel-hero {
    display: grid;
    gap: 6px;
    padding: 4px 2px 0 2px;
}
.update-panel-kicker {
    color: #6fb8ff;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.update-panel-date {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.update-panel-headline {
    color: #ffffff;
    font-family: "Press Start 2P", cursive;
    font-size: 14px;
    line-height: 1.55;
}
.update-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.55) rgba(255, 255, 255, 0.08);
}
.update-panel-body::-webkit-scrollbar {
    width: 8px;
}
.update-panel-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}
.update-panel-body::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.55);
    border-radius: 999px;
}
.roadmap-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10040;
    padding: 24px;
    box-sizing: border-box;
}
.roadmap-overlay.show {
    display: flex;
}
.roadmap-image-wrapper {
    position: relative;
    display: inline-block;
}
.roadmap-modal-image {
    max-width: min(95vw, 1100px);
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 3px solid #ffd700;
    box-shadow:
        0 0 18px #ffd700,
        0 0 42px rgba(255, 215, 0, 0.9);
    display: block;
}
.roadmap-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffd700;
    border-radius: 50%;
    color: #ffd700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10041;
    transition:
        transform 0.2s ease,
        background 0.2s ease;
    font-family: sans-serif;
}
.roadmap-close-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 215, 0, 0.9);
    color: #000;
}

/* AI Popup Image Animation */
.ai-popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    pointer-events: none;
    flex-direction: column;
    gap: 16px;
}
.ai-popup-image {
    max-width: min(80vw, 400px);
    max-height: 60vh;
    width: auto;
    height: auto;
    border-radius: 16px;
    border: 3px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: scale(0.3);
    animation: aiPopupBounce 3s forwards ease-out;
    pointer-events: none;
}
.ai-popup-label {
    color: #ffd700;
    font-family: "Press Start 2P", cursive;
    font-size: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    opacity: 0;
    animation: aiPopupFadeIn 0.5s 0.3s forwards ease-out;
    text-align: center;
    max-width: 90vw;
    line-height: 1.6;
}
@keyframes aiPopupBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.12);
    }
    70% {
        transform: scale(0.95);
    }
    85% {
        transform: scale(1.03);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}
@keyframes aiPopupFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Desktop - Make buttons closer (~1cm apart) */
@media (min-width: 1024px) {
    .nav-buttons {
        gap: 38px;
    }
}

/* Responsive adjustments for buttons */
@media (max-width: 768px) {
    .nav-buttons {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        gap: 12px !important;
    }
    .nav-btn {
        font-size: 14px !important;
        gap: 6px !important;
    }
    .nav-btn-icon {
        width: 85px !important;
        height: 85px !important;
    }
    .nav-btn-icon img {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .nav-buttons {
        position: fixed;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        gap: 8px !important;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        max-width: 95%;
        padding: 0 3px;
    }
    .nav-btn {
        font-size: 12px !important;
        gap: 4px !important;
        min-width: auto;
        flex-shrink: 0;
    }
    .nav-btn-icon {
        width: 70px !important;
        height: 70px !important;
    }
    .nav-btn-icon img {
        width: 100%;
        height: 100%;
    }
}

/* Standard phones (360px - Galaxy S8, Pixel, etc.) */
@media (max-width: 400px) {
    .nav-buttons {
        gap: 6px !important;
    }
    .nav-btn {
        font-size: 12px !important;
        gap: 3px !important;
    }
    .nav-btn-icon {
        width: 68px !important;
        height: 68px !important;
    }
}

@media (max-width: 380px) {
    .nav-buttons {
        gap: 5px !important;
        bottom: 6px;
    }
    .nav-btn {
        font-size: 11px !important;
        gap: 2px !important;
    }
    .nav-btn-icon {
        width: 60px !important;
        height: 60px !important;
    }
}

@media (max-width: 320px) {
    .nav-buttons {
        gap: 4px !important;
        bottom: 5px;
    }
    .nav-btn {
        font-size: 10px !important;
        gap: 2px !important;
    }
    .nav-btn-icon {
        width: 52px !important;
        height: 52px !important;
    }
}

.nav-btn:hover {
    transform: translateY(-4px) scale(1.05);
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1)) brightness(1.2);
}
.nav-btn:active {
    animation: btnBounce 0.4s ease;
}

@keyframes btnBounce {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(0.85) translateY(4px);
    }
    50% {
        transform: scale(1.05) translateY(-6px);
    }
    70% {
        transform: scale(0.95) translateY(2px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

/* Q&A button special boing effect */
.qa-btn:active {
    animation: qaBoing 0.6s ease !important;
}

@keyframes qaBoing {
    0% {
        transform: scale(1);
    }
    15% {
        transform: scale(0.8) translateY(8px);
    }
    35% {
        transform: scale(1.15) translateY(-12px);
    }
    55% {
        transform: scale(0.9) translateY(4px);
    }
    75% {
        transform: scale(1.05) translateY(-4px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

/* AI Companion Orb */
.ai-companion {
    position: fixed;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    transition:
        top 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        left 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ai-companion.active {
    display: flex;
}

.ai-companion.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ai-companion.top-right {
    top: 80px;
    left: calc(100% - 140px);
    right: auto;
    transform: translate(0, 0);
}

.ai-orb {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 215, 0, 0.1) 0%,
        rgba(255, 180, 0, 0.05) 50%,
        transparent 70%
    );
    box-shadow:
        0 0 20px rgba(255, 200, 0, 0.5),
        0 0 40px rgba(255, 180, 0, 0.3),
        inset 0 0 30px rgba(255, 215, 0, 0.1);
    animation: orbPulse 3s ease-in-out infinite;
    position: relative;
    border: 2px solid rgba(255, 215, 0, 0.6);
}

/* Jarvis-style rotating rings */
.ai-orb::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-top-color: transparent;
    border-bottom-color: transparent;
    animation: jarvisRing1 2s linear infinite;
}

.ai-orb::after {
    content: "";
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-left-color: transparent;
    border-right-color: transparent;
    animation: jarvisRing2 3s linear infinite;
}

/* AI Avatar image replacing core */
.ai-orb .ai-avatar-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 215, 0, 0.6);
    box-shadow:
        0 0 20px rgba(255, 200, 0, 0.8),
        0 0 40px rgba(255, 180, 0, 0.4);
    animation: corePulse 1.5s ease-in-out infinite;
    z-index: 1;
}

/* Inner core glow - hidden when using avatar */
.ai-orb .ai-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 220, 0, 0.8) 0%,
        rgba(255, 180, 0, 0.4) 50%,
        transparent 70%
    );
    box-shadow:
        0 0 20px rgba(255, 200, 0, 0.8),
        0 0 40px rgba(255, 180, 0, 0.4);
    animation: corePulse 1.5s ease-in-out infinite;
}

.ai-orb .ai-avatar-img + .ai-core {
    display: none;
}

@keyframes jarvisRing1 {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes jarvisRing2 {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(-360deg);
    }
}

@keyframes corePulse {
    0%,
    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes orbPulse {
    0%,
    100% {
        box-shadow:
            0 0 20px rgba(255, 180, 0, 0.5),
            0 0 40px rgba(255, 160, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 30px rgba(255, 200, 0, 0.7),
            0 0 60px rgba(255, 180, 0, 0.4);
    }
}

@keyframes orbFloatCenter {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes orbFloatCorner {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Wavelength visualizer inside orb */
.ai-wavelength {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2;
}

.ai-orb.speaking .ai-wavelength {
    opacity: 1;
}

.ai-wave-bar {
    width: 3px;
    height: 8px;
    background: rgba(255, 220, 0, 0.9);
    border-radius: 2px;
    animation: waveBar 0.4s ease-in-out infinite;
    box-shadow: 0 0 5px rgba(255, 200, 0, 0.8);
}

.ai-wave-bar:nth-child(1) {
    animation-delay: 0s;
}
.ai-wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}
.ai-wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}
.ai-wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}
.ai-wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}
.ai-wave-bar:nth-child(6) {
    animation-delay: 0.3s;
}
.ai-wave-bar:nth-child(7) {
    animation-delay: 0.2s;
}
.ai-wave-bar:nth-child(8) {
    animation-delay: 0.1s;
}

@keyframes waveBar {
    0%,
    100% {
        height: 8px;
    }
    50% {
        height: 24px;
    }
}

/* AI Speech Bubble */
.ai-speech-bubble {
    position: absolute;
    background: rgba(30, 25, 10, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    padding: 15px 20px;
    max-width: 280px;
    min-width: 150px;
    box-shadow:
        0 5px 20px rgba(255, 180, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    font-size: 12px;
    line-height: 1.5;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.ai-companion.center .ai-speech-bubble {
    top: 140px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
}

.ai-companion.top-right .ai-speech-bubble {
    top: 0;
    right: 130px;
    left: auto;
    transform: scale(1);
}

.ai-speech-bubble.show {
    opacity: 1;
    transform: scale(1);
}

.ai-companion.top-right .ai-speech-bubble.show {
    transform: scale(1);
}

.ai-speech-bubble::before {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.ai-companion.center .ai-speech-bubble::before {
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: rgba(255, 215, 0, 0.5);
}

.ai-companion.top-right .ai-speech-bubble::before {
    top: 15px;
    right: -12px;
    left: auto;
    border-left-color: rgba(255, 215, 0, 0.5);
}

/* Typing cursor */
.ai-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 14px;
    background: #ffffff;
    animation: blink 0.7s infinite;
    margin-left: 2px;
    vertical-align: middle;
    box-shadow: 0 0 5px #ffffff;
}

@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }
    51%,
    100% {
        opacity: 0;
    }
}

/* AI Close Button */
.ai-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(10, 20, 30, 0.95);
    border: 1px solid rgba(255, 100, 100, 0.6);
    cursor: pointer;
    color: #ff6666;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.2s;
}

.ai-close-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.5);
}

.ai-companion.top-right .ai-close-btn {
    display: flex;
}

/* AI Quick Options */
.ai-options {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 500px;
    width: 90%;
    z-index: 9997;
}

.ai-options.show {
    display: flex !important;
}

.ai-option-btn {
    background: rgba(30, 25, 10, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 20px;
    padding: 8px 16px;
    color: #ffffff;
    font-family: "Press Start 2P", cursive;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(255, 180, 0, 0.2);
}

.ai-option-btn:hover {
    background: rgba(255, 200, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 200, 0, 0.5);
    transform: scale(1.05);
}

/* Mobile styles for AI companion */
@media (max-width: 768px) {
    .ai-companion {
        width: 100px;
        height: 100px;
        position: fixed !important; /* Ensure it stays fixed */
    }
    .ai-orb {
        width: 80px;
        height: 80px;
        position: relative;
        margin: 0 auto;
    }
    .ai-orb .ai-avatar-img {
        width: 55px;
        height: 55px;
        position: absolute;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    .ai-orb::before {
        top: -6px !important;
        left: -6px !important;
        width: calc(100% + 12px) !important;
        height: calc(100% + 12px) !important;
        position: absolute;
    }
    .ai-orb::after {
        top: -12px !important;
        left: -12px !important;
        width: calc(100% + 24px) !important;
        height: calc(100% + 24px) !important;
        position: absolute;
    }
    .ai-companion.top-right {
        top: 70px;
        left: calc(100% - 130px);
        right: auto;
    }
    .ai-speech-bubble {
        font-size: 10px;
        padding: 10px 15px;
        width: 180px;
    }
    .ai-companion.top-right .ai-speech-bubble {
        right: 90px;
        left: auto;
        top: 0;
    }
    .ai-close-btn {
        top: -10px;
        right: -10px;
        width: 28px;
        height: 28px;
        font-size: 14px;
        display: flex !important; /* Force visibility for closing on mobile */
    }
    .ai-options {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        max-width: 100vw !important;
        width: 100vw !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        background: rgba(0, 0, 0, 0.4);
        padding: 10px 5px 15px 5px !important; /* Bottom padding for safe area */
        border-radius: 15px 15px 0 0;
        box-sizing: border-box !important;
        display: none !important; /* Ensure AI options are hidden by default on mobile */
    }
    .ai-option-btn {
        padding: 6px 10px;
        font-size: 8px !important;
        margin: 2px !important;
    }
}

/* Roadmap Button */
.roadmap-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ffd700;
    background: transparent;
    cursor: pointer;
    z-index: 10000;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    transition: all 0.3s ease;
    padding: 0;
}

.roadmap-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
}

.roadmap-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Roadmap Modal */
.roadmap-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.roadmap-modal.show {
    display: flex;
}

.roadmap-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
}

.roadmap-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 15px;
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.8),
        0 0 60px rgba(255, 215, 0, 0.5),
        0 0 90px rgba(255, 215, 0, 0.3);
    animation: roadmapGlow 2s ease-in-out infinite;
}

@keyframes roadmapGlow {
    0%,
    100% {
        box-shadow:
            0 0 30px rgba(255, 215, 0, 0.8),
            0 0 60px rgba(255, 215, 0, 0.5),
            0 0 90px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 40px rgba(255, 215, 0, 1),
            0 0 80px rgba(255, 215, 0, 0.7),
            0 0 120px rgba(255, 215, 0, 0.4);
    }
}

@media (max-width: 768px) {
    .roadmap-btn {
        width: 50px;
        height: 50px;
        top: 10px;
        right: 10px;
    }
}

/* Message Bubble / Thought Bubble Styles for Q&A */
.message-bubble-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 10px;
}

.thought-bubble {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 20px 25px;
    width: 90vw;
    max-width: 460px;
    height: auto;
    min-height: 360px;
    max-height: 70vh;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: bubblePop 0.5s ease-out;
    overflow-y: auto;
}

@keyframes bubblePop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.thought-bubble-content {
    position: relative;
    z-index: 2;
}

.bubble-title {
    font-family: "Press Start 2P", cursive;
    font-size: 14px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px dashed #ddd;
    padding-bottom: 10px;
}

.bubble-message {
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-left: 4px solid #ff9800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.bubble-message:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.bubble-message p {
    margin: 4px 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #444;
}

.bubble-message strong {
    color: #ff9800;
    font-weight: 600;
}

.thought-tail {
    position: absolute;
    bottom: -15px;
    left: 51%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid #ffffff;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.1));
}

/* Thought dots */
.thought-dot {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dot1 {
    width: 12px;
    height: 12px;
    bottom: -28px;
    left: 45%;
    animation: dotFloat 2s ease-in-out infinite;
}

.dot2 {
    width: 8px;
    height: 8px;
    bottom: -40px;
    left: 40%;
    animation: dotFloat 2s ease-in-out infinite 0.3s;
}

.dot3 {
    width: 5px;
    height: 5px;
    bottom: -50px;
    left: 35%;
    animation: dotFloat 2s ease-in-out infinite 0.6s;
}

@keyframes dotFloat {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-5px);
        opacity: 1;
    }
}
.nav-btn-icon {
    width: 100px;
    height: 100px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    user-select: none;
    background: transparent;
}
.nav-btn-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
}

.work-btn-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px) rotate(-5deg);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px) rotate(5deg);
    }
}

.middle-open-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    display: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 999;
    border-radius: 999px;
    overflow: visible;
    background: radial-gradient(
        circle at center,
        rgba(255, 245, 200, 0.12) 0%,
        rgba(255, 215, 0, 0.06) 40%,
        transparent 60%
    );
}
.middle-open-btn::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 220%;
    height: 220%;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 245, 200, 0.9) 10%,
        rgba(255, 215, 0, 0.6) 30%,
        rgba(255, 215, 0, 0.15) 55%,
        transparent 70%
    );
    filter: blur(18px) saturate(1.6) brightness(1.2);
    opacity: 0.9;
    mix-blend-mode: screen;
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}
.middle-open-btn img {
    width: 56px;
    height: 56px;
    display: block;
    object-fit: contain;
    background: transparent;
    filter: brightness(1.6) saturate(1.4)
        drop-shadow(0 0 30px rgba(255, 215, 0, 1))
        drop-shadow(0 0 90px rgba(255, 255, 255, 0.95));
    transition:
        filter 0.12s ease,
        transform 0.12s ease;
    animation: iconGlow 1.6s infinite ease-in-out;
    position: relative;
    z-index: 2;
}
.middle-open-btn:hover::before {
    transform: translate(-50%, -50%) scale(1.02);
    opacity: 1;
}
.middle-open-btn:hover img {
    transform: scale(1.18);
    filter: brightness(2) saturate(1.6)
        drop-shadow(0 0 80px rgba(255, 215, 0, 1))
        drop-shadow(0 0 160px rgba(255, 255, 255, 1));
}

@keyframes iconGlow {
    0% {
        filter: brightness(1.4) saturate(1.3)
            drop-shadow(0 0 24px rgba(255, 215, 0, 0.95));
        transform: scale(1);
    }
    50% {
        filter: brightness(2) saturate(1.6)
            drop-shadow(0 0 90px rgba(255, 215, 0, 1));
        transform: scale(1.08);
    }
    100% {
        filter: brightness(1.4) saturate(1.3)
            drop-shadow(0 0 24px rgba(255, 215, 0, 0.95));
        transform: scale(1);
    }
}

/* Test Animation Examples */
.tab-content.slide-expand {
    animation: slideExpand 0.5s ease-out;
}

@keyframes slideExpand {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.tab-content.rotate-expand {
    animation: rotateExpand 0.6s ease-out;
}

@keyframes rotateExpand {
    0% {
        opacity: 0;
        transform: rotate(-180deg) scale(0);
    }
    50% {
        opacity: 0.5;
        transform: rotate(-90deg) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

.tab-content.bounce-expand {
    animation: bounceExpand 0.8s ease-out;
}

@keyframes bounceExpand {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    25% {
        opacity: 0.3;
        transform: scale(0.3);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
    75% {
        opacity: 0.9;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.middle-tab.slow-maximize {
    animation: slowMaximize 0.2s ease-out;
}

@keyframes slowMaximize {
    0% {
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        transform: scale(1);
        border-radius: 0;
    }
    100% {
        top: calc(50% - 230px);
        left: calc(50% - 350px);
        width: 700px;
        height: 460px;
    }
}

.middle-tab.minimized ~ .middle-open-btn {
    display: flex;
}

.artwork-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px auto;
    position: relative;
    max-width: 1200px;
    justify-content: center;
}
.artwork-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    pointer-events: auto;
    z-index: 1;
}
.artwork-item:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.6);
}
.artwork-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: none;
}
.artwork-item.expanded img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.artwork-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(5px);
}
.artwork-overlay.show {
    display: block;
}

.artwork-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}
.artwork-viewer.show {
    display: flex;
}
.artwork-viewer-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.artwork-viewer-content img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}
.artwork-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.artwork-viewer-close:hover {
    background: rgba(255, 215, 0, 0.9);
    color: white;
    transform: scale(1.1);
}
.artwork-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 215, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.artwork-nav:hover {
    background: rgba(255, 215, 0, 1);
    transform: translateY(-50%) scale(1.1);
}
.artwork-nav-prev {
    left: 20px;
}
.artwork-nav-next {
    right: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .artwork-viewer-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
}
@media (max-width: 480px) {
    .artwork-viewer-close {
        width: 35px;
        height: 35px;
        font-size: 18px;
        top: 5px;
        right: 5px;
    }
}

.manga-gallery {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    max-width: 100%;
    overflow-x: auto;
}
.manga-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: none; /* Remove transition */
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    text-align: center;
    height: 280px; /* Increased from 220px */
    width: 200px; /* Increased from 150px */
    flex-shrink: 0; /* Prevent shrinking */
}
.manga-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}
.manga-item img {
    width: 100%;
    height: 220px; /* Increased from 160px to match bigger container */
    object-fit: cover;
    transition: all 0.3s ease;
}
.manga-title {
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    font-size: 14px; /* Increased from 12px */
    font-weight: bold;
    border-top: 2px solid rgba(255, 215, 0, 0.3);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}
.manga-item.expanded {
    position: fixed;
    top: 50%;
    left: 51%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    max-height: 900px;
    z-index: 10000;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: none; /* Remove transition */
}
.manga-item.expanded img {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    display: block; /* Show the cover image */
}
.manga-item.expanded .manga-title {
    display: none;
}
.manga-pages {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
}
.manga-pages.show {
    display: block;
}
.manga-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}
.manga-page {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.manga-page-click {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}
.manga-page-click:hover {
    transform: scale(1.02);
}
.manga-detail-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.manga-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}
.manga-detail-info {
    display: flex;
    gap: 30px;
    align-items: center;
    flex: 1;
}
.manga-detail-cover {
    width: 200px;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.manga-detail-text h2 {
    color: #ffd700;
    font-size: 28px;
    margin: 0 0 10px 0;
    font-family: "Press Start 2P", cursive;
}
.manga-detail-pages {
    color: #ffffff;
    font-size: 16px;
    margin: 0;
    opacity: 0.8;
}
.manga-detail-content h3 {
    color: #ffd700;
    font-size: 20px;
    margin: 0 0 20px 0;
    font-family: "Press Start 2P", cursive;
}
.manga-chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.2);
}
.manga-chapter-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.manga-chapter-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}
.manga-chapter-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}
.manga-chapter-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 5px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
}
.chapter-reader-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.chapter-reader-header {
    height: 60px;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 20px;
}
.chapter-reader-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chapter-reader-title {
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
    font-family: "Press Start 2P", cursive;
}
.chapter-reader-manga-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: normal;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    opacity: 0.9;
}
.chapter-reader-close {
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.chapter-reader-close:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}
.chapter-reader-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Remove scroll from here */
}
.chapter-reader-image img {
    max-width: 90%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.chapter-reader-nav {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.chapter-nav-btn {
    padding: 10px 20px;
    background: rgba(255, 215, 0, 0.8);
    border: none;
    border-radius: 5px;
    color: #222;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.chapter-nav-btn:hover {
    background: rgba(255, 215, 0, 1);
    transform: scale(1.05);
}
.chapter-reader-pages {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}
.chapter-reader-page {
    position: relative;
    text-align: center;
}
.chapter-reader-page img {
    max-width: 90%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.chapter-page-label {
    margin-top: 10px;
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
}
.manga-reader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: none;
    flex-direction: column;
}
.manga-reader-header {
    height: 60px;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.manga-reader-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.manga-reader-title {
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
    font-family: "Press Start 2P", cursive;
}
.manga-reader-manga-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: normal;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    opacity: 0.9;
}
.manga-reader-close {
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.manga-reader-close:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}
.manga-reader-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.manga-reader-click {
    width: 100%;
    height: 100%;
    position: relative;
    background: rgba(0, 0, 0, 0.9);
}
.manga-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10001;
    display: none;
}
.manga-close.show {
    display: block;
}
.manga-reader-click {
    display: none;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    position: relative;
}
.manga-reader-click.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.manga-page-click {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.manga-nav-buttons {
    position: absolute;
    bottom: 20px;
    left: 51%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10;
}
.manga-nav-btn {
    padding: 10px 20px;
    background: rgba(255, 215, 0, 0.8);
    border: none;
    border-radius: 5px;
    color: #222;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    position: relative;
}
.manga-nav-btn:hover {
    background: rgba(255, 215, 0, 1);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}
.manga-nav-btn:disabled {
    background: rgba(128, 128, 128, 0.5);
    cursor: not-allowed;
    transform: scale(1);
    box-shadow: none;
}
.manga-nav-btn:disabled:hover {
    background: rgba(128, 128, 128, 0.5);
    transform: scale(1);
    box-shadow: none;
}

/* Side navigation areas */
.manga-nav-left,
.manga-nav-right {
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 5;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.manga-nav-left {
    left: 0;
    background: linear-gradient(to right, rgba(255, 215, 0, 0.3), transparent);
}
.manga-nav-right {
    right: 0;
    background: linear-gradient(to left, rgba(255, 215, 0, 0.3), transparent);
}
.manga-nav-left:hover {
    background: linear-gradient(to right, rgba(255, 215, 0, 0.6), transparent);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
}
.manga-nav-right:hover {
    background: linear-gradient(to left, rgba(255, 215, 0, 0.6), transparent);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
}
.manga-nav-preview {
    position: absolute;
    top: 50%;
    width: 100px;
    height: 140px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 215, 0, 0.8);
    border-radius: 8px;
    padding: 5px;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.manga-nav-left .manga-nav-preview {
    left: 110px;
}
.manga-nav-right .manga-nav-preview {
    right: 110px;
}
.manga-nav-left:hover .manga-nav-preview,
.manga-nav-right:hover .manga-nav-preview {
    opacity: 1;
}
.manga-nav-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Navigation hint text */
.manga-nav-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 215, 0, 0.8);
    font-size: 24px;
    font-weight: bold;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.manga-nav-left .manga-nav-hint {
    left: 20px;
}
.manga-nav-right .manga-nav-hint {
    right: 20px;
}
.manga-nav-left:hover .manga-nav-hint,
.manga-nav-right:hover .manga-nav-hint {
    opacity: 1;
}
.manga-page-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}
.manga-creation-tab {
    position: fixed;
    top: 50%;
    left: 51%;
    transform: translate(-50%, -50%);
    width: 70vw;
    max-width: 700px;
    max-height: 85vh;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    z-index: 10000;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}
.manga-creation-tab.dragging {
    user-select: none;
    cursor: move;
}
.manga-creation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}
.manga-creation-content {
    padding: 20px;
}
.creation-section {
    margin-bottom: 25px;
}
.creation-section h4 {
    color: #ffd700;
    margin: 0 0 10px 0;
    font-size: 16px;
}
.page-preview-item {
    display: inline-block;
    width: 80px;
    height: 100px;
    margin: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    cursor: move;
    position: relative;
}
.page-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.page-preview-item .page-number {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}
.page-preview-item.dragging {
    opacity: 0.5;
    transform: scale(1.1);
    z-index: 1000;
}
.chapters-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}
.chapter-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}
.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.chapter-title {
    color: #ffd700;
    font-size: 16px;
    font-weight: bold;
}
.chapter-actions {
    display: flex;
    gap: 5px;
}
.chapter-btn {
    padding: 5px 10px;
    background: rgba(255, 215, 0, 0.8);
    border: none;
    border-radius: 4px;
    color: #222;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}
.chapter-btn:hover {
    background: rgba(255, 215, 0, 1);
}
.chapter-btn.delete {
    background: rgba(255, 0, 0, 0.8);
    color: white;
}
.chapter-btn.delete:hover {
    background: rgba(255, 0, 0, 1);
}
.chapter-pages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.chapter-page-item {
    width: 80px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    cursor: move;
    position: relative;
}
.chapter-page-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.chapter-page-item .page-number {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}
.add-chapter-btn {
    width: 100%;
    padding: 10px;
    background: rgba(0, 128, 0, 0.8);
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}
.add-chapter-btn:hover {
    background: rgba(0, 128, 0, 1);
}
.manga-action-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    color: white;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.manga-action-btn.create {
    background: linear-gradient(
        135deg,
        rgba(0, 128, 0, 0.8),
        rgba(0, 180, 0, 0.6)
    );
    border: 2px solid rgba(0, 255, 0, 0.3);
}
.manga-action-btn.create:hover {
    background: linear-gradient(
        135deg,
        rgba(0, 128, 0, 1),
        rgba(0, 180, 0, 0.8)
    );
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.3);
}
.manga-action-btn.edit {
    background: linear-gradient(
        135deg,
        rgba(255, 140, 0, 0.8),
        rgba(255, 180, 0, 0.6)
    );
    border: 2px solid rgba(255, 215, 0, 0.3);
}
.manga-action-btn.edit:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 140, 0, 1),
        rgba(255, 180, 0, 0.8)
    );
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}
.manga-action-btn.add {
    background: linear-gradient(
        135deg,
        rgba(0, 128, 0, 0.8),
        rgba(0, 180, 0, 0.6)
    );
    border: 2px solid rgba(0, 255, 0, 0.3);
}
.manga-action-btn.add:hover {
    background: linear-gradient(
        135deg,
        rgba(0, 128, 0, 1),
        rgba(0, 180, 0, 0.8)
    );
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.3);
}
.manga-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 350px;
    overflow-y: auto;
    padding: 5px;
}
.manga-selection-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    height: fit-content;
}
.manga-selection-card:hover {
    border-color: rgba(255, 215, 0, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}
.manga-selection-cover {
    margin-bottom: 8px;
}
.manga-selection-info {
    margin-bottom: 8px;
}
.manga-selection-title {
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.manga-selection-chapters {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}
.manga-selection-action {
    margin-top: 8px;
}
.manga-selection-btn {
    width: 100%;
    padding: 8px;
    background: rgba(255, 140, 0, 0.8);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.2s ease;
}
.manga-selection-btn:hover {
    background: rgba(255, 140, 0, 1);
}
.manga-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}
.manga-modal-content {
    background: rgba(0, 0, 0, 0.95);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    width: 80vw;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}
.manga-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}
.manga-modal-header h2 {
    margin: 0;
    color: #ffd700;
    font-size: 20px;
}
.manga-modal-close {
    background: rgba(255, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.manga-modal-close:hover {
    background: rgba(255, 0, 0, 1);
}
.manga-modal-body {
    padding: 20px;
}
.manga-form-section {
    margin-bottom: 20px;
}
.manga-form-section label {
    display: block;
    color: #ffd700;
    margin-bottom: 8px;
    font-weight: bold;
}
.manga-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    margin-bottom: 10px;
}
.manga-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.cover-preview {
    margin-top: 10px;
    text-align: center;
}
.cover-preview img {
    max-width: 200px;
    max-height: 250px;
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}
.pages-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.page-preview-thumb {
    position: relative;
    width: 80px;
    height: 100px;
    border-radius: 5px;
    overflow: hidden;
}
.page-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.page-preview-thumb span {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}
.manga-modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    justify-content: flex-end;
}
.manga-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}
.manga-modal-btn.cancel {
    background: rgba(128, 128, 128, 0.8);
    color: white;
}
.manga-modal-btn.cancel:hover {
    background: rgba(128, 128, 128, 1);
}
.manga-modal-btn.create {
    background: rgba(0, 128, 0, 0.8);
    color: white;
}
.manga-modal-btn.create:hover {
    background: rgba(0, 128, 0, 1);
}
.manga-modal-btn.save {
    background: rgba(0, 100, 200, 0.8);
    color: white;
}
.manga-modal-btn.save:hover {
    background: rgba(0, 100, 200, 1);
}
.manga-modal-btn.delete {
    background: rgba(255, 0, 0, 0.8);
    color: white;
}
.manga-modal-btn.delete:hover {
    background: rgba(255, 0, 0, 1);
}

/* Manga Editor Window Styles */
.manga-editor-window {
    position: fixed;
    top: 50%;
    left: 51%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.manga-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 215, 0, 0.1);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.manga-editor-title {
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
}

.manga-editor-close {
    background: rgba(255, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.manga-editor-close:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.manga-editor-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.chapters-list-edit {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}
.edit-chapter-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}
.chapter-pages-edit {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}
.page-thumb {
    position: relative;
    width: 60px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}
.page-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.page-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-remove:hover {
    background: rgba(255, 0, 0, 1);
}
.manga-editor-container {
    background: rgba(0, 0, 0, 0.95);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    margin: 20px;
    overflow: hidden;
}
.manga-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    background: rgba(255, 215, 0, 0.1);
}
.manga-editor-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.manga-editor-title {
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
}
.manga-editor-manga-title {
    color: white;
    font-size: 14px;
    opacity: 0.8;
}
.manga-editor-close {
    background: rgba(255, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.manga-editor-close:hover {
    background: rgba(255, 0, 0, 1);
}
.manga-editor-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}
.editor-section {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}
.editor-section h3 {
    color: #ffd700;
    margin: 0 0 15px 0;
    font-size: 16px;
}
.editor-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group label {
    color: #ffd700;
    font-weight: bold;
    font-size: 14px;
}
.editor-input {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 14px;
}
.editor-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.cover-display {
    margin-top: 10px;
    text-align: center;
}
.cover-display img {
    max-width: 200px;
    max-height: 250px;
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.editor-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    color: white;
}
.editor-btn.save {
    background: rgba(0, 100, 200, 0.8);
}
.editor-btn.save:hover {
    background: rgba(0, 100, 200, 1);
}
.editor-btn.add {
    background: rgba(0, 128, 0, 0.8);
}
.editor-btn.add:hover {
    background: rgba(0, 128, 0, 1);
}
.editor-btn.add-chapter {
    width: 100%;
    padding: 15px;
    background: rgba(0, 128, 0, 0.8);
    font-size: 16px;
}
.editor-btn.add-chapter:hover {
    background: rgba(0, 128, 0, 1);
}
.editor-btn.danger {
    background: rgba(255, 0, 0, 0.8);
}
.editor-btn.danger:hover {
    background: rgba(255, 0, 0, 1);
}
.chapters-management {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.chapters-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.chapter-edit-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}
.chapter-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}
.chapter-title-input {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    color: white;
    font-size: 14px;
}
.chapter-actions {
    display: flex;
    gap: 5px;
}
.chapter-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
}
.chapter-btn.move-up {
    background: rgba(0, 100, 200, 0.8);
    color: white;
}
.chapter-btn.move-up:hover:not(:disabled) {
    background: rgba(0, 100, 200, 1);
}
.chapter-btn.move-down {
    background: rgba(0, 100, 200, 0.8);
    color: white;
}
.chapter-btn.move-down:hover:not(:disabled) {
    background: rgba(0, 100, 200, 1);
}
.chapter-btn.delete {
    background: rgba(255, 0, 0, 0.8);
    color: white;
}
.chapter-btn.delete:hover {
    background: rgba(255, 0, 0, 1);
}
.chapter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.chapter-pages-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chapter-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
.page-edit-item {
    position: relative;
    width: 100px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid rgba(255, 215, 0, 0.3);
}
.page-edit-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.page-actions {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    gap: 2px;
}
.page-btn {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    transition: all 0.2s ease;
}
.page-btn.move-left {
    background: rgba(0, 100, 200, 0.8);
    color: white;
}
.page-btn.move-left:hover:not(:disabled) {
    background: rgba(0, 100, 200, 1);
}
.page-btn.move-right {
    background: rgba(0, 100, 200, 0.8);
    color: white;
}
.page-btn.move-right:hover:not(:disabled) {
    background: rgba(0, 100, 200, 1);
}
.page-btn.delete {
    background: rgba(255, 0, 0, 0.8);
    color: white;
}
.page-btn.delete:hover {
    background: rgba(255, 0, 0, 1);
}
.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.add-pages-section {
    display: flex;
    gap: 10px;
    align-items: center;
}
.add-chapter-section {
    margin-top: 20px;
}
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}
.chapter-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    height: fit-content;
    min-height: 120px;
    max-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.chapter-card:hover {
    border-color: rgba(255, 215, 0, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}
.chapter-card-header {
    margin-bottom: 10px;
}
.chapter-card-title {
    color: #ffd700;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}
.chapter-card-pages {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}
.chapter-card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.chapter-card-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
}
.chapter-card-btn.open {
    background: rgba(0, 128, 0, 0.8);
    color: white;
}
.chapter-card-btn.open:hover {
    background: rgba(0, 128, 0, 1);
}
.chapter-card-btn.delete {
    background: rgba(255, 0, 0, 0.8);
    color: white;
}
.chapter-card-btn.delete:hover {
    background: rgba(255, 0, 0, 1);
}
.danger-actions {
    display: flex;
    justify-content: center;
}
.artwork-manager-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 5000;
    display: flex;
    flex-direction: column;
}
.artwork-manager-header {
    background: rgba(255, 215, 0, 0.1);
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.artwork-manager-title {
    color: #ffd700;
    font-size: 20px;
    font-family: "Press Start 2P", cursive;
    margin: 0;
}
.artwork-manager-actions {
    display: flex;
    gap: 10px;
}
.artwork-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.artwork-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 10px;
    cursor: grab;
    transition: all 0.3s ease;
    position: relative;
}
.artwork-item:hover {
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
}
.artwork-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    border-color: #ffd700;
}
.artwork-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}
.artwork-item-title {
    color: white;
    font-size: 12px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.artwork-item-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 215, 0, 0.9);
    color: #222;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.artwork-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}
.artwork-delete-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}
.artwork-drag-handle {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    cursor: grab;
    font-size: 11px;
}
.file-input {
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 11px;
}

#homeBtn {
    margin-top: 30px;
    cursor: pointer;
    color: #444;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    user-select: none;
    padding: 8px 14px;
    border: 2px solid #444;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.2s ease;
    background: rgba(255 255 255 / 0.7);
}
#homeBtn:hover {
    background: rgba(255 215 0 / 0.85);
    color: #222;
    border-color: #ffb300;
}

/* Loading Screen - Dark Reveal Effect */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* CSS fallback: auto-hide loading screen after 5s even if JS is blocked */
@keyframes autoHideLoading {
    0%,
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        pointer-events: none;
    }
}
.loading-screen {
    animation: autoHideLoading 5s ease-in-out forwards;
}
.loading-screen.hidden {
    animation: none;
}

.desktop {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.desktop.loaded {
    opacity: 1;
}

/* Wiki-style manga information page */
.wiki-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 0 10%;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    text-align: left;
}

/* Fullscreen editing mode */
.window-maximized .wiki-container {
    max-width: 90%;
    margin: 0 auto;
    grid-template-columns: 1fr 250px;
    gap: 30px;
}

.window-maximized .wiki-main-content {
    min-height: 80vh;
}

.wiki-main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 20px;
    color: #333;
}

.wiki-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wiki-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.wiki-box h3 {
    color: #ffd700;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-family: "Press Start 2P", cursive;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.wiki-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.wiki-title {
    font-size: 36px;
    color: #333;
    margin: 0;
    font-family: "Press Start 2P", cursive;
    text-shadow: 2px 2px 4px rgba(255, 215, 0, 0.3);
}

.wiki-subtitle {
    font-size: 14px;
    color: #666;
    margin: 5px 0 0 0;
    font-style: italic;
}

.wiki-section {
    margin-bottom: 25px;
}

.wiki-section h2 {
    color: #ffd700;
    font-size: 20px;
    margin: 0 0 15px 0;
    font-family: "Press Start 2P", cursive;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 5px;
}

.wiki-section p {
    line-height: 1.6;
    margin: 0 0 10px 0;
}

.wiki-info-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.wiki-info-label {
    font-weight: bold;
    color: #666;
}

.wiki-info-value {
    color: #333;
}

.wiki-manga-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.wiki-manga-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wiki-manga-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.5);
}

.wiki-manga-card h4 {
    color: #ffd700;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.wiki-manga-card p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.wiki-list-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.wiki-list-item:last-child {
    border-bottom: none;
}

.wiki-list-item a {
    color: #ffd700;
    text-decoration: none;
    font-weight: bold;
}

.wiki-list-item a:hover {
    text-decoration: underline;
}

.wiki-date {
    color: #666;
    font-size: 12px;
}

/* Complete Fandom Layout Styles */

/* Global Pixel Font Styles for Wiki - TEXT ELEMENTS ONLY */
.fandom-top-nav,
.fandom-left-sidebar,
.fandom-content-area,
.fandom-right-sidebar,
.fandom-page-header,
.fandom-toc,
.fandom-article-content,
.fandom-page-categories,
.wiki-container,
.wiki-main-content,
.wiki-sidebar,
.wiki-section,
.wiki-box,
.fandom-infobox,
.fandom-sidebar-box,
.wiki-header,
.wiki-title,
.wiki-subtitle,
.wiki-manga-card,
.wiki-info-grid,
.wiki-character-grid,
.wiki-character-card,
.wiki-location-list,
.wiki-location-item,
.wiki-story-list,
.wiki-media-note,
.wiki-trivia-grid,
.wiki-trivia-item,
.wiki-guidelines-list,
.wiki-categories,
.wiki-category-group,
.wiki-category-links,
.wiki-references-list,
.wiki-list-item,
.wiki-date,
.wiki-subsection,
.manga-title,
.manga-detail-container,
.manga-detail-header,
.manga-detail-info,
.manga-detail-text,
.manga-detail-pages,
.manga-detail-content,
.manga-chapters-grid,
.manga-chapter-item,
.manga-chapter-number,
.chapter-reader-container,
.chapter-reader-header,
.chapter-reader-info,
.chapter-reader-title,
.chapter-reader-manga-title,
.chapter-reader-content,
.chapter-reader-pages,
.chapter-reader-page,
.chapter-page-label,
.window-title,
.tab,
.button,
input,
select,
textarea,
label,
p,
h1,
h2,
h3,
h4,
h5,
h6,
a,
li,
ul,
ol,
strong,
em,
b,
i {
    font-family:
        "Press Start 2P", "Arcade Classic", "Pixelated", "Retro Computer",
        "Game Over", "8-Bit Wonder", "VT323", "Share Tech Mono", "Roboto Mono",
        "Space Mono", "Fira Mono", "Inconsolata", "Source Code Pro",
        "IBM Plex Mono", "Cutive Mono", "JetBrains Mono", "Ubuntu Mono",
        "Noto Sans Mono", monospace !important;
    text-rendering: pixelated !important;
    -webkit-font-smoothing: none !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-smooth: never !important;
    font-variant-ligatures: none !important;
    font-feature-settings: normal !important;
}

/* Apply pixel fonts to text elements inside containers */
.fandom-top-nav *,
.fandom-left-sidebar *,
.fandom-content-area *,
.fandom-right-sidebar *,
.fandom-page-header *,
.fandom-toc *,
.fandom-article-content *,
.fandom-page-categories *,
.wiki-container *,
.wiki-main-content *,
.wiki-sidebar *,
.wiki-section *,
.wiki-box *,
.fandom-infobox *,
.fandom-sidebar-box * {
    font-family:
        "Press Start 2P", "Arcade Classic", "Pixelated", "Retro Computer",
        "Game Over", "8-Bit Wonder", "VT323", "Share Tech Mono", "Roboto Mono",
        "Space Mono", "Fira Mono", "Inconsolata", "Source Code Pro",
        "IBM Plex Mono", "Cutive Mono", "JetBrains Mono", "Ubuntu Mono",
        "Noto Sans Mono", monospace !important;
    text-rendering: pixelated !important;
    -webkit-font-smoothing: none !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-smooth: never !important;
}

/* IMAGES - NORMAL RENDERING (NO PIXELATION) */
img,
.manga-item,
.manga-detail-cover,
.manga-chapter-item,
.chapter-reader-page img,
.artwork-item,
.gallery-item {
    image-rendering: auto !important;
    -webkit-font-smoothing: auto !important;
    -moz-osx-font-smoothing: auto !important;
    font-smooth: auto !important;
}

/* Specific Pixel Font Variations for Different Elements */
.fandom-page-title,
.wiki-title {
    font-family: "Press Start 2P", "Arcade Classic", cursive !important;
    font-size: 20px !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
}

.fandom-site-name,
.wiki-subtitle {
    font-family: "VT323", "Pixelated", monospace !important;
    font-size: 16px !important;
    letter-spacing: 3px !important;
    text-transform: uppercase !important;
}

.sidebar-section h4,
.infobox-title,
.sidebar-box-title,
.wiki-section h2 {
    font-family: "Retro Computer", "Game Over", monospace !important;
    font-size: 12px !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

.wiki-section h3,
.manga-detail-title {
    font-family: "8-Bit Wonder", "Share Tech Mono", monospace !important;
    font-size: 14px !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

.wiki-section p,
.sidebar-nav li,
.sidebar-box-list li,
.toc-list li,
.wiki-list-item,
.infobox-label,
.infobox-value,
.category-tag {
    font-family: "Space Mono", "Fira Mono", monospace !important;
    font-size: 10px !important;
    line-height: 1.8 !important;
    letter-spacing: 1px !important;
}

.fandom-search,
.fandom-nav-link,
input,
select,
textarea {
    font-family: "Inconsolata", "JetBrains Mono", monospace !important;
    font-size: 9px !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

.manga-title,
.manga-chapter-number,
.chapter-reader-title,
.chapter-reader-manga-title {
    font-family: "IBM Plex Mono", "Ubuntu Mono", monospace !important;
    font-size: 11px !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

.button,
.tab,
a {
    font-family: "Source Code Pro", "Cutive Mono", monospace !important;
    font-size: 9px !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

.wiki-date,
.chapter-page-label {
    font-family: "Noto Sans Mono", monospace !important;
    font-size: 8px !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

/* Top Navigation Bar */
.fandom-top-nav {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: none;
}

.fandom-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fandom-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wiki-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

.wiki-logo-img:hover {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8))
        drop-shadow(0 0 16px rgba(255, 215, 0, 0.6))
        drop-shadow(0 0 24px rgba(255, 215, 0, 0.4));
    transform: scale(1.1);
    animation: logoGlow 1.5s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8))
            drop-shadow(0 0 16px rgba(255, 215, 0, 0.6))
            drop-shadow(0 0 24px rgba(255, 215, 0, 0.4));
    }
    100% {
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1))
            drop-shadow(0 0 24px rgba(255, 215, 0, 0.8))
            drop-shadow(0 0 36px rgba(255, 215, 0, 0.6));
    }
}

.fandom-site-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.fandom-nav-center {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.fandom-search {
    width: 100%;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
}

.fandom-nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.fandom-nav-link {
    color: #3366cc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.fandom-nav-link:hover {
    color: #2244aa;
    text-decoration: underline;
}

.fandom-user-icon {
    font-size: 20px;
    cursor: pointer;
}

/* Main Layout Container - Column layout with top nav */
.fandom-main-layout {
    display: flex;
    flex-direction: row;
    background: #f6f6f6;
    min-height: calc(100vh - 60px);
    overflow: hidden;
}

/* Left Sidebar - Fixed width */
.fandom-left-sidebar {
    width: 220px;
    min-width: 220px;
    background: #f8f8f8;
    border-right: 1px solid #ccc;
    padding: 20px 0;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

.sidebar-section {
    margin-bottom: 25px;
    padding: 0 15px;
}

.sidebar-section h4 {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 3px;
}

.sidebar-nav a {
    color: #3366cc;
    text-decoration: none;
    margin: 0 0 15px 0;
}

.fandom-page-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #eaecf0;
}

.fandom-page-tabs .tab {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #eaecf0;
    border-bottom: none;
    margin-right: 2px;
    cursor: pointer;
    font-size: 14px;
    color: #3366cc;
    border-radius: 5px 5px 0 0;
    transition: all 0.2s;
}

.fandom-page-tabs .tab:hover {
    background: #e8f0ff;
}

.fandom-page-tabs .tab.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    color: #222;
    font-weight: 500;
}

/* Table of Contents */
.fandom-toc {
    background: #f8f9fa;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: inline-block;
    min-width: 200px;
}

.toc-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    color: #222;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 5px;
}

.toc-list a {
    color: #3366cc;
    text-decoration: none;
    font-size: 14px;
}

.toc-list a:hover {
    text-decoration: underline;
}

/* Right Sidebar - Fixed width, no absolute positioning */
.fandom-right-sidebar {
    width: 300px;
    min-width: 300px;
    padding: 20px;
    background: #f8f8f8;
    border-left: 1px solid #ccc;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

/* Content Area - Flex row layout */
.fandom-content-area {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
}

/* Article Content */
.fandom-article-content {
    flex: 1;
    padding: 20px;
    background: #fff;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

/* Infobox */
.fandom-infobox {
    background: #fff;
    border: 1px solid #a2a9b1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.infobox-title {
    background: linear-gradient(135deg, #ff9800, #ffc107);
    color: #fff;
    font-weight: bold;
    padding: 10px;
    text-align: center;
    font-size: 16px;
}

.infobox-image {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #eaecf0;
}

.infobox-placeholder {
    font-size: 48px;
    color: #666;
}

.infobox-content {
    padding: 0;
}

.infobox-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #eaecf0;
    font-size: 14px;
}

.infobox-row:last-child {
    border-bottom: none;
}

.infobox-label {
    font-weight: bold;
    color: #333;
}

.infobox-value {
    color: #333;
    text-align: right;
}

/* Sidebar Boxes */
.fandom-sidebar-box {
    background: #fff;
    border: 1px solid #a2a9b1;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.sidebar-box-title {
    background: #f8f9fa;
    font-weight: bold;
    padding: 10px;
    font-size: 14px;
    border-bottom: 1px solid #eaecf0;
}

.sidebar-box-list {
    list-style: none;
    padding: 10px;
    margin: 0;
}

.sidebar-box-list li {
    margin-bottom: 5px;
    font-size: 13px;
}

.sidebar-box-list a {
    color: #3366cc;
    text-decoration: none;
}

.sidebar-box-list a:hover {
    text-decoration: underline;
}

/* Page Categories */
.fandom-page-categories {
    background: #f8f9fa;
    border-top: 1px solid #eaecf0;
    padding: 15px 20px;
    margin-top: 30px;
}

.categories-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    background: #e8f0ff;
    color: #3366cc;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid #a2a9b1;
    cursor: pointer;
    transition: all 0.2s;
}

.category-tag:hover {
    background: #d0e0ff;
    text-decoration: underline;
}

/* Fandom-style wiki additional styles */
.wiki-subsection {
    margin-bottom: 30px;
}

.wiki-subsection h3 {
    color: #ff9800;
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 5px;
}

.wiki-character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.wiki-character-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
}

.wiki-character-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.5);
}

.wiki-character-card h4 {
    color: #ff9800;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.wiki-location-list {
    margin-top: 15px;
}

.wiki-location-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.wiki-location-item:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
}

.wiki-story-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.wiki-story-list li {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.wiki-story-list li:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
}

.wiki-media-note {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    font-style: italic;
    text-align: center;
}

.wiki-trivia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.wiki-trivia-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
}

.wiki-trivia-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.5);
}

.wiki-trivia-item h4 {
    color: #ff9800;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.wiki-guidelines-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.wiki-guidelines-list li {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.wiki-guidelines-list li:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
}

.wiki-categories {
    margin-top: 15px;
}

.wiki-category-group {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.wiki-category-group h4 {
    color: #ff9800;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.wiki-category-links {
    line-height: 1.8;
}

.wiki-category-links a {
    color: #ff9800;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s ease;
}

.wiki-category-links a:hover {
    text-decoration: underline;
    color: #ffc107;
}

.wiki-references-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.wiki-references-list li {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.wiki-references-list li:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
}

.wiki-infobox {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.wiki-infobox-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.wiki-infobox-row:last-child {
    border-bottom: none;
}

.wiki-infobox-label {
    font-weight: bold;
    color: #666;
    font-size: 14px;
}

.wiki-infobox-value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .wiki-container {
        grid-template-columns: 1fr;
    }

    .wiki-info-grid {
        grid-template-columns: 1fr;
    }

    .wiki-character-grid,
    .wiki-trivia-grid {
        grid-template-columns: 1fr;
    }
}

/* Wiki Loading Screen */
.wiki-loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.wiki-loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.wiki-loading-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    font-family: "Press Start 2P", cursive;
}

.wiki-loading-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
}

.wiki-loading-dots {
    display: flex;
    gap: 8px;
}

.wiki-loading-dot {
    width: 12px;
    height: 12px;
    background: #ffd700;
    border-radius: 50%;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.wiki-loading-dot:nth-child(1) {
    animation-delay: 0s;
}

.wiki-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.wiki-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%,
    60%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    30% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

/* Manga Viewer Loading Spinner */
.manga-viewer-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 10;
    pointer-events: none;
}
.manga-viewer-loader.hidden {
    display: none;
}
.manga-viewer-loader-dots {
    display: flex;
    gap: 8px;
}
.manga-viewer-loader-dot {
    width: 10px;
    height: 10px;
    background: #ffd700;
    border-radius: 50%;
    animation: dotPulse 1.2s infinite ease-in-out;
}
.manga-viewer-loader-dot:nth-child(1) {
    animation-delay: 0s;
}
.manga-viewer-loader-dot:nth-child(2) {
    animation-delay: 0.15s;
}
.manga-viewer-loader-dot:nth-child(3) {
    animation-delay: 0.3s;
}
.manga-viewer-loader-text {
    color: rgba(255, 215, 0, 0.8);
    font-size: 9px;
    font-family: "Press Start 2P", cursive;
}

.wiki-content {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.wiki-content.show {
    opacity: 1;
}
/* Mobile - Make diary bigger on phone */
@media (max-width: 768px) {
    .diary-page {
        padding: 30px 20px;
        font-size: 16px;
        line-height: 1.8;
    }
    .diary-title {
        font-size: 32px !important;
        margin-bottom: 20px !important;
    }
    .diary-entry {
        margin-bottom: 25px;
        padding: 15px;
    }
    .diary-entry-title {
        font-size: 20px !important;
    }
    .diary-entry-content {
        font-size: 15px !important;
    }
}

@media (max-width: 480px) {
    .diary-page {
        padding: 20px 15px;
        font-size: 18px;
        line-height: 2;
    }
    .diary-title {
        font-size: 28px !important;
        margin-bottom: 25px !important;
    }
    .diary-entry {
        margin-bottom: 30px;
        padding: 18px;
    }
    .diary-entry-title {
        font-size: 22px !important;
    }
    .diary-entry-content {
        font-size: 16px !important;
    }
}

/* Book reader only: readable serif page + smooth UI (overrides site-wide pixel font) */
#bookReaderSinglePage,
#bookReaderSinglePage * {
    font-family: Georgia, "Times New Roman", serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
}

.book-cover-overlay,
.book-pages-overlay {
    position: fixed;
    inset: 0;
    z-index: 3601;
    background: rgba(0, 0, 0, 0.12);
}

.book-cover-stage,
.book-pages-stage {
    position: fixed;
    inset: 0;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.book-cover-stage.is-visible,
.book-pages-stage.is-visible {
    opacity: 1;
}

.book-cover-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-wrapper {
    position: relative;
    width: min(520px, 95vw);
    aspect-ratio: 0.7;
    max-height: 90vh;
    perspective: 2000px;
}

.book-back-cover,
.book-page-layer-5,
.book-page-layer-4,
.book-page-layer-3,
.book-page-layer-2,
.book-page-layer-1,
.book-front-cover,
.book {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    box-sizing: border-box;
    top: 0;
    left: 0;
}

.book-back-cover {
    background: linear-gradient(180deg, #b8864a 0%, #6d4922 100%);
    border: 1px solid rgba(84, 55, 22, 0.28);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    z-index: 1;
}

.book {
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transform-style: preserve-3d;
    z-index: 2;
    pointer-events: none;
}

.book.is-open {
    pointer-events: auto;
}

.book-front-cover {
    z-index: 3;
}

.book-page-layer-5,
.book-page-layer-4,
.book-page-layer-3,
.book-page-layer-2,
.book-page-layer-1 {
    position: absolute;
    background: #f7eed8;
    border: 1px solid rgba(120, 92, 49, 0.16);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.14);
    transform-origin: left center;
    transition: transform 0.62s ease;
    cursor: pointer;
    transform-style: preserve-3d;
}

.book-page-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
}

.book-page-front {
    background: linear-gradient(180deg, #f4ead2 0%, #e6d8b4 100%);
    border: 1px solid rgba(120, 92, 49, 0.18);
    transform: rotateY(0deg);
}

.book-page-back {
    background: linear-gradient(180deg, #f4ead2 0%, #e6d8b4 100%);
    border: 1px solid rgba(120, 92, 49, 0.18);
    transform: rotateY(180deg);
}

.page-content {
    padding: 20px;
    height: calc(100% - 40px);
    overflow: hidden;
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    background: linear-gradient(180deg, #f4ead2 0%, #e6d8b4 100%);
}

.book {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    box-sizing: border-box;
    top: 0;
    left: 0;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transform-style: preserve-3d;
    z-index: 2;
    pointer-events: none;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    border-radius: 16px;
}

.front, .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px;
    box-sizing: border-box;
}

.front {
    background: #fcf6eb;
    color: #1c1a17;
    box-shadow: inset -10px 0 20px rgba(0,0,0,0.05), 0 4px 10px rgba(0,0,0,0.2);
    box-sizing: border-box;
    border: none;
    border-radius: 0;
}

.back {
    background: #faefdf;
    color: #1c1a17;
    transform: rotateY(180deg);
    box-shadow: inset 10px 0 20px rgba(0,0,0,0.05), 0 4px 10px rgba(0,0,0,0.2);
    box-sizing: border-box;
    border: none;
    border-radius: 0;
}

.content {
    font-size: 0.7rem;
    line-height: 1.45;
    text-align: justify;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.title-container {
    margin: auto 0;
    padding-left: 20px;
}

.title-large {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: 1px;
    line-height: 1.1;
}

.title-combined {
    display: flex;
    align-items: flex-start;
    margin-top: 5px;
    margin-bottom: 2px;
}

.drop-n {
    font-size: 4.2rem;
    font-weight: 900;
    line-height: 0.8;
    margin-right: 4px;
    margin-top: -2px;
}

.title-sub-text {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 0.9;
    margin-top: 4px;
}

.tagline {
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    margin-top: 8px;
    font-weight: bold;
}

.credits {
    font-size: 0.68rem;
    color: #222;
    text-align: center;
    line-height: 1.4;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-top: auto;
    margin-bottom: 20px;
}

.content p {
    margin: 0 0 10px 0;
    text-indent: 18px;
}

.page-number {
    font-size: 0.8rem;
    font-weight: bold;
    color: #8c8273;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-top: 4px;
    margin-top: 4px;
}

.front .page-number { text-align: right; }
.back .page-number { text-align: left; }

.page.flipped { transform: rotateY(-180deg); }

/* Position classes for cycling */
.position-left {
    transform: translateX(-20px) translateY(0px);
}

.position-center {
    transform: translateX(0px) translateY(0px);
}

.position-right {
    transform: translateX(20px) translateY(0px);
}


.book-page-layer-5.is-opening,
.book-page-layer-5.is-closing {
    z-index: 10;
}

.book-page-layer-5.is-opening {
    transform: perspective(1600px) rotateY(-170deg) rotateX(4deg)
        translateY(8px) translateX(-10px);
}

.book-page-layer-5.is-closing {
    transform: translateX(1px) translateY(0px);
}

.book-page-layer-4.is-opening,
.book-page-layer-4.is-closing {
    z-index: 10;
}

.book-page-layer-4.is-opening {
    transform: perspective(1600px) rotateY(-170deg) rotateX(4deg)
        translateY(8px) translateX(-10px);
}

.book-page-layer-4.is-closing {
    transform: translateX(1px) translateY(0px);
}

.book-page-layer-3.is-opening,
.book-page-layer-3.is-closing {
    z-index: 10;
}

.book-page-layer-3.is-opening {
    transform: perspective(1600px) rotateY(-170deg) rotateX(4deg)
        translateY(8px) translateX(-10px);
}

.book-page-layer-3.is-closing {
    transform: translateX(1px) translateY(0px);
}

/* Cycling states */
.cycle-state-0 .book-page-layer-1 {
    transform: translateX(5px) translateY(3px);
}

.cycle-state-0 .book-page-layer-2 {
    transform: translateX(2px) translateY(1px);
}

.cycle-state-0 .book-page-layer-3 {
    transform: translateX(1px) translateY(0px);
}

.cycle-state-1 .book-page-layer-1 {
    transform: translateX(1px) translateY(0px);
}

.cycle-state-1 .book-page-layer-2 {
    transform: translateX(5px) translateY(3px);
}

.cycle-state-1 .book-page-layer-3 {
    transform: translateX(2px) translateY(1px);
}

.cycle-state-2 .book-page-layer-1 {
    transform: translateX(2px) translateY(1px);
}

.cycle-state-2 .book-page-layer-2 {
    transform: translateX(1px) translateY(0px);
}

.cycle-state-2 .book-page-layer-3 {
    transform: translateX(5px) translateY(3px);
}

.book-page-layer-2.is-opening,
.book-page-layer-2.is-closing {
    z-index: 50;
}

.book-page-layer-2.is-opening {
    transform: perspective(1600px) rotateY(-170deg) rotateX(4deg)
        translateY(8px) translateX(-10px);
}

.book-page-layer-2.is-closing {
    transform: translateX(2px) translateY(1px);
}

.book-page-layer-1.is-opening,
.book-page-layer-1.is-closing {
    z-index: 4;
}

.book-page-layer-1.is-opening {
    transform: perspective(1600px) rotateY(-170deg) rotateX(4deg)
        translateY(8px) translateX(-10px);
}

.book-page-layer-1.is-closing {
    transform: translateX(5px) translateY(3px);
}

.book-front-cover {
    transform-style: preserve-3d;
    transform-origin: left center;
    transition:
        transform 0.62s ease,
        opacity 0.22s ease;
    cursor: pointer;
    z-index: 3;
}

.book-front-cover.is-opening {
    transform: perspective(1800px) rotateY(-180deg) rotateX(6deg)
        translateY(10px) translateX(-5px);
}

.book-front-cover.is-closing {
    transform: perspective(1800px) rotateY(0deg) rotateX(0deg) translateY(0)
        translateX(0);
}

.book-front-cover-face {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.book-front-cover-front {
    background: #101010;
}

.book-front-cover-back {
    background: linear-gradient(180deg, #f4ead2 0%, #e6d8b4 100%);
    border: 1px solid rgba(120, 92, 49, 0.18);
    transform: rotateY(180deg);
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.book-front-cover-back > * {
    max-width: 100%;
}

.book-front-cover-page-debug {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    font-size: 8px;
    line-height: 1.2;
}

.book-front-cover-page-fit {
    transform-origin: top center;
    width: max-content;
    margin: 0 auto;
    display: block;
    outline: 2px solid rgba(0, 120, 255, 0.85);
    background: rgba(255, 255, 255, 0.92);
}

.book-front-cover-page-fallback {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
}

.book-cover-stage-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-bookmark {
    position: absolute;
    top: -20px;
    right: 30px;
    width: 40px;
    height: 80px;
    background: #e74c3c;
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-bookmark:hover {
    transform: translateY(5px);
    box-shadow: 2px 6px 12px rgba(0, 0, 0, 0.4);
}

.book-bookmark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 0 0 4px 4px;
}

.book-pages-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.book-pages-cover-bg {
    position: absolute;
    inset: 24px;
    border-radius: 20px;
    overflow: hidden;
    opacity: 0.22;
}

.book-pages-cover-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2px) brightness(0.72);
}

.book-pages-surface {
    position: relative;
    width: min(980px, 88vw);
    height: min(720px, 82vh);
    border-radius: 20px;
    background: linear-gradient(
        180deg,
        rgba(245, 235, 212, 0.98) 0%,
        rgba(223, 205, 170, 0.98) 100%
    );
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    padding: 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.book-surface-spine,
.book-surface-cover-bg,
.book-surface-cover,
.book-surface-pages-edge,
.book-surface-opened {
    position: absolute;
}

.book-surface-spine {
    left: 0;
    top: 0;
    bottom: 0;
    width: 28px;
    border-radius: 16px 0 0 16px;
    background: linear-gradient(180deg, #6f532d 0%, #24170b 100%);
    box-shadow: inset -3px 0 6px rgba(255, 255, 255, 0.12);
}

.book-surface-cover-bg,
.book-surface-cover {
    inset: 0 16px 0 12px;
    overflow: hidden;
    border-radius: 14px;
    border: 2px solid rgba(255, 214, 122, 0.65);
    background: #0f1118;
}

.book-surface-cover-bg {
    z-index: 1;
    opacity: 0.22;
    filter: blur(1px) brightness(0.7);
}

.book-surface-cover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    transform-origin: left center;
    transition:
        transform 0.62s ease,
        opacity 0.28s ease;
    z-index: 4;
}

.book-surface-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-surface-cover-gloss {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.03) 26%,
        rgba(0, 0, 0, 0.2) 100%
    );
}

.book-surface-pages-edge {
    right: 0;
    top: 14px;
    bottom: 18px;
    width: 18px;
    border-radius: 0 12px 12px 0;
    background: linear-gradient(180deg, #f8efd7 0%, #ded0ac 100%);
    box-shadow:
        inset 0 0 0 1px rgba(126, 93, 37, 0.18),
        inset 4px 0 0 rgba(255, 255, 255, 0.45);
    z-index: 2;
}

.book-surface-opened {
    left: 26px;
    top: 10px;
    bottom: 10px;
    width: calc(100% - 42px);
    border-radius: 16px;
    background: linear-gradient(
        180deg,
        rgba(245, 235, 212, 0.98) 0%,
        rgba(223, 205, 170, 0.98) 100%
    );
    box-shadow:
        inset 0 0 0 1px rgba(120, 92, 49, 0.18),
        0 18px 50px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transition: opacity 0.26s ease;
    display: flex;
    flex-direction: column;
    padding: 18px 18px 14px;
    box-sizing: border-box;
    z-index: 3;
}

.book-surface-shell.is-open .book-surface-cover {
    opacity: 0;
    pointer-events: none;
}

.book-surface-shell.is-open .book-surface-opened {
    opacity: 1;
}

.book-surface-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    background: rgba(32, 24, 12, 0.78);
    border: 1px solid rgba(120, 92, 49, 0.24);
    color: #fff6dd;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 10px;
}

.book-surface-loading,
.book-surface-error {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #5f4120;
    font-size: 10px;
    text-align: center;
}

.book-surface-error {
    display: none;
    color: #8b2f2f;
}

.book-surface-pages {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(
        var(--book-spread-columns, 2),
        minmax(0, 1fr)
    );
    gap: 0;
    align-items: stretch;
    overflow: hidden;
    padding: 4px 2px 0;
    transition:
        opacity 0.32s ease,
        transform 0.32s ease;
}

.book-surface-pages .book-reader-page-block {
    border-radius: 0;
    box-shadow: none;
    border: none;
    background: #faf4e5;
}

.book-surface-pages .book-reader-page-block:first-child {
    border-radius: 12px 0 0 12px;
    box-shadow: inset -8px 0 18px rgba(94, 64, 28, 0.08);
}

.book-surface-pages .book-reader-page-block:last-child {
    border-radius: 0 12px 12px 0;
    box-shadow: inset 8px 0 18px rgba(94, 64, 28, 0.08);
}

.book-surface-controls,
.book-surface-close {
    display: none !important;
}

@media (max-width: 768px) {
    .book-cover-stage {
        padding: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    .book-wrapper {
        width: min(400px, 85vw);
        max-height: 80vh;
        margin: 0 auto;
    }

    .book-cover-stage-image {
        width: min(360px, 92vw);
        max-height: 88vh;
    }

    .content {
        font-size: 0.4rem;
        line-height: 1.2;
        padding: 4px;
        margin: 0;
    }

    .book-pages-stage {
        padding: 10px;
    }

    .book-pages-cover-bg {
        inset: 10px;
        border-radius: 16px;
    }

    .book-pages-surface {
        width: 100%;
        height: min(82vh, 680px);
        padding: 12px;
        border-radius: 16px;
    }

    .book-surface-pages {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
    }

    .book-surface-pages .book-reader-page-block,
    .book-surface-pages .book-reader-page-block:first-child,
    .book-surface-pages .book-reader-page-block:last-child {
        border-radius: 12px;
        box-shadow: none;
    }

    #bookReaderSinglePage {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Manga Reader Styles */
.manga-reader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #f5f5f0 0%, #e8e8e0 50%, #f0f0e8 100%);
    z-index: 10000;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow: hidden;
    will-change: transform;
    contain: layout style paint;
}

.manga-reader-sidebar {
    width: 25%;
    min-width: 280px;
    max-width: 350px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f8f5 100%);
    border-right: 2px solid rgba(255, 215, 0, 0.5);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.manga-reader-exit {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 0, 0, 0.7);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.manga-reader-exit:hover {
    background: rgba(255, 0, 0, 0.9);
    transform: scale(1.1);
}

.manga-reader-cover {
    width: 100%;
    margin-top: 50px;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.manga-reader-cover img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.manga-reader-title {
    color: #222;
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 15px 0;
    text-align: center;
    font-family: "Press Start 2P", cursive;
}

.manga-reader-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.manga-reader-synopsis {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px 0;
    text-align: center;
}

.manga-reader-sidebar-dark .manga-reader-title,
.manga-reader-sidebar-dark .manga-reader-synopsis {
    color: #ffffff;
}

.manga-section-toggle {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: bold;
    color: #222;
    background: linear-gradient(135deg, #ffd700 0%, #ffec8b 100%);
    border: 2px solid rgba(255, 215, 0, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.manga-section-toggle:hover {
    background: linear-gradient(135deg, #ffec8b 0%, #ffd700 100%);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.manga-section-toggle:active {
    transform: scale(0.98);
}

.manga-reader-main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    height: 100vh;
    background: transparent;
}

.manga-reader-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    padding: 20px 0;
    align-content: start;
}

.manga-panel {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    background: #fff;
    will-change: transform;
    transform: translateZ(0);
}

.manga-panel:hover {
    transform: scale(1.05) translateZ(0);
    border-color: rgba(255, 215, 0, 1);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3);
}

.manga-panel img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    content-visibility: auto;
    background: #f0f0f0;
}

/* Page numbers removed */

/* Manga Page Viewer (Fullscreen) */
.manga-page-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    will-change: transform;
    contain: layout style paint;
}

.manga-viewer-header {
    height: 60px;
    background: rgba(10, 10, 16, 0.95);
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.manga-viewer-title {
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
    font-family: "Press Start 2P", cursive;
}

.manga-viewer-counter {
    color: #ccc;
    font-size: 14px;
}

.manga-viewer-close {
    background: rgba(255, 0, 0, 0.7);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.manga-viewer-close:hover {
    background: rgba(255, 0, 0, 0.9);
    transform: scale(1.1);
}

.manga-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
}

.manga-viewer-image-container {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.manga-viewer-image-container img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transition: opacity 0.15s ease;
    will-change: opacity;
    transform: translateZ(0);
}

.manga-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 40px;
    height: 60px;
    font-size: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
    line-height: 1;
}

.manga-nav-arrow:hover {
    color: #ffd700;
    transform: translateY(-50%) scale(1.1);
}

.manga-nav-prev {
    left: 10px;
}

.manga-nav-next {
    right: 10px;
}

.manga-viewer-click-zones {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
}

.manga-click-zone {
    flex: 1;
    pointer-events: auto;
    cursor: pointer;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .manga-reader-sidebar {
        width: 30%;
        min-width: 250px;
        padding: 15px;
        background: linear-gradient(180deg, #ffffff 0%, #f8f8f5 100%);
        overflow: hidden;
    }

    .manga-reader-title {
        font-size: 16px;
        color: #222;
    }

    .manga-reader-synopsis {
        font-size: 12px;
        color: #555;
    }

    .manga-reader-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 18px;
    }

    .manga-panel img {
        height: 220px;
    }

    .manga-nav-arrow {
        width: 35px;
        height: 55px;
        font-size: 45px;
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.6);
    }

    .manga-nav-arrow:hover {
        color: #ffd700;
    }

    .manga-section-toggle {
        width: 100%;
        padding: 10px 18px;
        font-size: 12px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body.update-panel-open #roadmapToggleBtn {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px) scale(0.9);
    }

    .update-panel {
        inset: 56px 10px 10px 10px;
        padding: 14px 12px 12px;
        border-radius: 18px;
        gap: 12px;
    }

    .update-panel-title {
        font-size: 13px;
    }

    .update-panel-close-btn {
        width: 30px;
        height: 30px;
        font-size: 15px;
        flex: 0 0 auto;
    }

    .update-panel-body {
        padding-right: 6px;
    }

    .update-panel-hero {
        gap: 4px;
    }

    .update-panel-headline {
        font-size: 11px;
        line-height: 1.45;
    }

    .update-feed {
        gap: 8px;
    }

    .update-feed-item {
        padding: 10px 11px;
        border-radius: 10px;
        gap: 4px;
    }

    .update-feed-kicker {
        font-size: 9px;
        line-height: 1.3;
    }

    .update-feed-title {
        font-size: 11px;
        line-height: 1.35;
    }

    .update-feed-summary {
        font-size: 10px;
        line-height: 1.45;
    }

    .update-article {
        padding: 12px;
        gap: 14px;
        border-radius: 14px;
    }

    .update-section {
        gap: 7px;
    }

    .update-section-title {
        font-size: 10px;
    }

    .update-list {
        gap: 8px;
        font-size: 10px;
        line-height: 1.45;
    }

    .update-list li::before {
        margin-right: 6px;
    }

    .manga-reader-container {
        flex-direction: column;
    }

    .manga-reader-sidebar {
        width: 100%;
        min-width: auto;
        max-width: 100%;
        border-right: none;
        border-bottom: 2px solid rgba(255, 215, 0, 0.5);
        padding: 10px 12px;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 8px 12px;
        background: linear-gradient(180deg, #ffffff 0%, #f5f5f0 100%);
        overflow: hidden;
        box-sizing: border-box;
        align-items: start;
    }

    .manga-reader-exit {
        position: relative;
        top: auto;
        right: auto;
        width: 28px;
        height: 28px;
        font-size: 14px;
        flex-shrink: 0;
        grid-column: 1;
        grid-row: 1;
    }

    .manga-reader-cover {
        width: 65px;
        height: 85px;
        margin: 0;
        flex-shrink: 0;
        border-radius: 6px;
        grid-column: 1;
        grid-row: 2;
        overflow: hidden;
    }

    .manga-reader-cover img {
        height: 100%;
        width: 100%;
        object-fit: cover;
        display: block;
    }

    .manga-reader-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
        overflow: hidden;
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-start;
    }

    .manga-reader-title {
        font-size: 12px;
        margin: 0;
        text-align: left;
        color: #222;
        line-height: 1.3;
        font-weight: bold;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .manga-reader-synopsis {
        font-size: 9px;
        color: #666;
        margin: 0;
        text-align: left;
        line-height: 1.3;
        max-height: 36px;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    .manga-section-toggle {
        width: calc(100% - 24px);
        max-width: 200px;
        padding: 8px 12px;
        font-size: 11px;
        margin: 5px auto 0;
        grid-column: 1 / -1;
        grid-row: 3;
        justify-self: center;
        transform: none !important;
        box-sizing: border-box;
    }

    .manga-section-toggle:active {
        transform: none !important;
        opacity: 0.9;
    }

    .manga-reader-main {
        padding: 15px;
        background: transparent;
    }

    .manga-reader-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px 0;
        justify-items: center;
    }

    .manga-panel {
        width: 100%;
        max-width: min(320px, 100%);
    }

    .manga-panel img {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
        aspect-ratio: auto;
    }

    .manga-viewer-header {
        height: 50px;
        padding: 0 15px;
    }

    .manga-viewer-title {
        font-size: 12px;
    }

    .manga-viewer-counter {
        font-size: 11px;
    }

    .manga-viewer-close {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .manga-viewer-content {
        padding: 10px;
    }

    .manga-nav-arrow {
        width: 30px;
        height: 50px;
        font-size: 35px;
        top: 50%;
        transform: translateY(-50%);
    }

    .manga-nav-prev {
        left: 5px;
    }

    .manga-nav-next {
        right: 5px;
    }

    .manga-viewer-image-container img {
        max-height: 70vh;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    body.update-panel-open #roadmapToggleBtn {
        opacity: 0;
        pointer-events: none;
    }

    .update-panel {
        inset: 50px 8px 8px 8px;
        padding: 12px 10px 10px;
        border-radius: 16px;
        gap: 10px;
    }

    .update-panel-headline {
        font-size: 10px;
    }

    .update-feed-item {
        padding: 9px 10px;
    }

    .update-feed-title {
        font-size: 10px;
    }

    .update-feed-summary {
        font-size: 9px;
    }

    .update-article {
        padding: 10px;
    }

    .update-list {
        font-size: 9px;
    }

    .manga-reader-sidebar {
        padding: 14px 14px 12px;
        gap: 8px 12px;
    }

    .manga-reader-cover {
        width: 96px;
        height: 128px;
        border-radius: 8px;
    }

    .manga-reader-title {
        font-size: 12px;
        line-height: 1.35;
    }

    .manga-reader-synopsis {
        font-size: 8px;
        line-height: 1.35;
        max-height: 52px;
        -webkit-line-clamp: 5;
        line-clamp: 5;
    }

    .manga-section-toggle {
        width: calc(100% - 20px);
        max-width: 188px;
        justify-self: end;
        margin: 2px 0 0 auto;
        transform: translate(-10px, -2px) !important;
        font-size: 10px;
        padding: 8px 10px;
    }

    .manga-reader-page-count {
        font-size: 11px;
    }

    .manga-reader-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px 0;
        justify-items: center;
    }

    .manga-panel {
        width: 100%;
        max-width: min(260px, 100%);
    }

    .manga-panel img {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
        aspect-ratio: auto;
    }
}

.manga-section-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(20, 20, 30, 0.95);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    justify-content: center;
}

.section-tab {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-family: "Press Start 2P", cursive;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.section-tab:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

.section-tab.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffec8b 100%);
    color: #1a1a2e;
    border-color: #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.manga-section-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 0 30px;
}

.section-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 215, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.section-dot:hover {
    background: rgba(255, 215, 0, 0.25);
    transform: scale(1.1);
}

.section-dot.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffec8b 100%);
    border-color: #ffd700;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
}

.dot-number {
    font-family: "Press Start 2P", cursive;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.section-dot.active .dot-number {
    color: #1a1a2e;
}

@media (max-width: 768px) {
    .manga-section-tabs {
        padding: 8px 15px;
        gap: 6px;
    }

    .section-tab {
        padding: 6px 12px;
        font-size: 9px;
    }

    .manga-section-dots {
        gap: 8px;
        padding: 15px 0 20px;
    }

    .section-dot {
        width: 28px;
        height: 28px;
    }

    .dot-number {
        font-size: 10px;
    }
}

/* ============================================================
       MOBILE PERFORMANCE OPTIMIZATIONS
       Disable expensive GPU/CPU effects on touch devices
       ============================================================ */
@media (pointer: coarse), (max-width: 768px) {
    /* Disable backdrop-filter blur (extremely expensive on mobile GPUs) */
    .artwork-overlay,
    .artwork-viewer,
    .manga-creation-tab,
    .manga-modal-overlay,
    .books-overlay,
    .middle-tab {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* background-attachment:fixed causes rendering bugs on mobile browsers
         when combined with transform animations (wallpaper appears "cut").
         Switching to scroll makes backgrounds follow their containers. */
    .bg-layer,
    .bg-layer-0,
    .bg-layer-shine,
    .bg-layer-foreground,
    .bg-layer-frontyard,
    .bg-layer-frontest {
        background-attachment: scroll !important;
    }

    /* Ensure the wallpaper container is wide enough on mobile to prevent edges from showing */
    .wallpaper {
        width: 140vw !important;
        margin-left: -20vw !important;
    }

    /* Keep title visible on small screens (default -105% pushes it off-screen) */
    #homeContentOutside {
        transform: translate(-50%, -55%) !important;
    }

    /* AI orb: full glow + pulse exactly like PC */
    .ai-orb,
    .ai-core,
    .ai-avatar-img {
        box-shadow: 0 0 30px rgba(255, 180, 0, 0.6) !important;
        animation: orbPulseMobile 3s ease-in-out infinite !important;
    }

    /* Keep all effects: filter, shadows, will-change */
    .bg-layer-shine,
    .bg-layer-foreground,
    .bg-layer-frontyard {
        will-change: transform !important;
    }

    /* Keep GPU-friendly transitions (transform + opacity only) */
    .nav-btn,
    .roadmap-toggle-btn,
    .win-btn,
    .middle-tab {
        transition:
            transform 0.2s ease,
            opacity 0.2s ease !important;
    }

    /* Particles: JS already reduces count to 40 and skips glow on mobile */
    #particle-canvas {
        opacity: 1;
    }

    /* Title: MATCH PC GLOW EXACTLY */
    .middle-tab-title {
        animation: amberGlowPulseMobile 3s ease-in-out infinite !important;
        opacity: 1 !important;
        font-family: "Press Start 2P", cursive !important;
    }

    /* AI orb rings: transform:rotate is 100% GPU-friendly */
    .ai-orb::before {
        animation: jarvisRing1 2s linear infinite !important;
    }
    .ai-orb::after {
        animation: jarvisRing2 2s linear infinite !important;
    }

    /* Wave bars: same speed as PC for better visual energy */
    .ai-wave-bar {
        animation-name: waveBar !important;
        animation-duration: 0.4s !important;
        animation-iteration-count: infinite !important;
        animation-timing-function: ease-in-out !important;
        box-shadow: 0 0 10px rgba(255, 200, 0, 0.9) !important;
        background: rgba(255, 220, 0, 1) !important;
    }

    /* Roadmap: GPU-friendly scale pulse instead of box-shadow animation */
    .roadmap-toggle-btn {
        animation: roadmapGlowMobile 2s ease-in-out infinite !important;
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.35) !important;
    }

    /* Middle open button: static glow + simple scale animation */
    .middle-open-btn img {
        filter: brightness(1.6) saturate(1.4)
            drop-shadow(0 0 15px rgba(255, 215, 0, 0.8)) !important;
        animation: iconGlowMobile 1.6s infinite ease-in-out !important;
    }

    /* Floating dots: already GPU-friendly (transform + opacity) */
    .dot1 {
        animation: dotFloat 2s ease-in-out infinite 0s !important;
    }
    .dot2 {
        animation: dotFloat 2s ease-in-out infinite 0.3s !important;
    }
    .dot3 {
        animation: dotFloat 2s ease-in-out infinite 0.6s !important;
    }

    /* Loading dots: already GPU-friendly */
    .wiki-loading-dot,
    .manga-viewer-loader-dot {
        animation: dotPulse 1.5s infinite ease-in-out !important;
    }

    /* Nav button hover: GPU-friendly transform only */
    .nav-btn:hover {
        filter: none !important;
        transform: translateY(-2px) scale(1.02) !important;
    }

    /* Disable expensive transition:all on common interactive elements */
    .artwork-item,
    .manga-panel,
    .work-card,
    .books-card,
    .wiki-manga-card,
    .wiki-character-card,
    .wiki-location-item,
    .wiki-story-list li,
    .wiki-trivia-item,
    .wiki-guidelines-list li,
    .wiki-references-list li,
    .wiki-category-links a,
    .chapter-nav-btn,
    .manga-nav-btn,
    .manga-selection-btn,
    .manga-modal-btn,
    .manga-editor-close,
    .editor-btn,
    .chapter-btn,
    .page-btn,
    .chapter-card-btn,
    .artwork-delete-btn,
    .fandom-page-tabs .tab,
    .category-tag {
        transition: none !important;
    }
}
