﻿/* ============================================
   ALINA NIGHTSONG CHARACTER SITE
   Pastel Pink Tome with Page Flip Navigation
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Light Theme (Pastel Pink Arcane Tome) */
    --bg-primary: #f8f0f5;
    --bg-secondary: #f0e4eb;
    --bg-gradient: linear-gradient(180deg,
            #f8f0f5 0%,
            #f0e4eb 30%,
            #ebe0e8 70%,
            #e5d8e2 100%);

    --parchment: #faf5f8;
    --parchment-dark: #efe4eb;
    --leather: #8b4557;
    --leather-light: #a05a6c;
    --gold: #d4a5b9;
    --gold-light: #e8c4d4;
    --ink: #3a2a32;
    --ink-faded: #5a4a52;

    --accent-primary: #c9869e;
    --accent-secondary: #b8758d;
    --accent-glow: rgba(201, 134, 158, 0.4);

    /* Flat icon color - pastel pink */
    --icon-color: #c9869e;

    --text-primary: #3a2a32;
    --text-secondary: #5a4a52;
    --text-muted: #8a7a82;

    --panel-bg: linear-gradient(135deg,
            rgba(250, 245, 248, 0.98) 0%,
            rgba(239, 228, 235, 0.98) 100%);
    --panel-border: #d4a5b9;
    --panel-shadow:
        0 4px 20px rgba(139, 69, 87, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);

    --button-bg: linear-gradient(180deg, #faf5f8 0%, #efe4eb 100%);
    --button-hover: linear-gradient(180deg, #f5e8f0 0%, #e8d8e2 100%);
    --button-active: linear-gradient(180deg, #e8d8e2 0%, #dcc8d5 100%);

    --particle-color: rgba(212, 165, 185, 0.4);

    --page-edge: #e5d8e2;
    --page-shadow: rgba(139, 69, 87, 0.2);

    --theme-transition: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme (Backstory - Corrupted Tome) */
[data-theme="dark"] {
    --bg-primary: #1a0f14;
    --bg-secondary: #0f0508;
    --bg-gradient: linear-gradient(180deg,
            #1a0f14 0%,
            #120810 30%,
            #0a0506 70%,
            #050203 100%);

    --parchment: #2a1a22;
    --parchment-dark: #1a0f14;
    --leather: #0a0506;
    --leather-light: #1a0f14;
    --gold: #8b2942;
    --gold-light: #a83350;
    --ink: #e8d8e0;
    --ink-faded: #b8a8b0;

    --accent-primary: #8b2942;
    --accent-secondary: #5a1a2a;
    --accent-glow: rgba(139, 41, 66, 0.5);

    /* Flat icon color - red in dark mode */
    --icon-color: #c44;

    --text-primary: #e8d8e0;
    --text-secondary: #b8a8b0;
    --text-muted: #887078;

    --panel-bg: linear-gradient(135deg,
            rgba(42, 26, 34, 0.98) 0%,
            rgba(26, 15, 20, 0.98) 100%);
    --panel-border: #5a2a3a;
    --panel-shadow:
        0 4px 20px rgba(139, 41, 66, 0.3),
        inset 0 1px 0 rgba(139, 41, 66, 0.2);

    --button-bg: linear-gradient(180deg, #2a1a22 0%, #1a0f14 100%);
    --button-hover: linear-gradient(180deg, #3a2a32 0%, #2a1a22 100%);
    --button-active: linear-gradient(180deg, #4a3a42 0%, #3a2a32 100%);

    --particle-color: rgba(139, 41, 66, 0.4);

    --page-edge: #3a2a32;
    --page-shadow: rgba(139, 41, 66, 0.4);
}

/* ---------- Base Reset & Typography ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 20px;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--leather);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition:
        background var(--theme-transition),
        color var(--theme-transition);
}

h1,
h2,
h3 {
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ---------- Custom Scrollbar (Theme-Matched) ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--parchment-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gold) var(--parchment-dark);
}

/* ---------- Background Particles ---------- */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: var(--particle-color);
    border-radius: 50%;
    animation: float-dust 20s infinite ease-in-out;
    transition: background var(--theme-transition);
}

@keyframes float-dust {

    0%,
    100% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    50% {
        transform: translateY(50vh) translateX(20px);
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-10vh) translateX(-10px);
        opacity: 0;
    }
}

/* ---------- Book Wrapper ---------- */
.book-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    z-index: 1;
    transform-origin: center center;
    transition: transform 0.3s ease;
}

/* ---------- Book Container ---------- */
.container {
    position: relative;
    /* Use aspect ratio for consistent proportions across resolutions */
    width: min(55vw, 750px);
    height: min(90vh, 950px);
    aspect-ratio: 0.72 / 1;
    /* Slightly narrower than A4 (0.707) for book feel */
    background: var(--bg-gradient);
    border-radius: 4px 8px 8px 4px;
    box-shadow:
        -8px 0 25px rgba(0, 0, 0, 0.4),
        8px 0 35px rgba(0, 0, 0, 0.3),
        0 15px 50px rgba(0, 0, 0, 0.4),
        inset 0 0 80px rgba(255, 255, 255, 0.15);
    transition: background var(--theme-transition), box-shadow var(--theme-transition), transform 0.3s ease;
    overflow: hidden;
}

/* Book spine on left */
.container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(90deg,
            var(--leather) 0%,
            var(--leather-light) 40%,
            var(--page-edge) 100%);
    border-radius: 4px 0 0 4px;
    box-shadow:
        inset -8px 0 20px rgba(0, 0, 0, 0.35),
        3px 0 8px rgba(0, 0, 0, 0.15);
    transition: background var(--theme-transition);
    z-index: 10;
}

/* Page stack on right */
.container::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 10px;
    bottom: 10px;
    width: 8px;
    background: repeating-linear-gradient(180deg,
            var(--parchment) 0px,
            var(--parchment-dark) 2px,
            var(--parchment) 4px);
    border-radius: 0 3px 3px 0;
    box-shadow: 3px 0 8px rgba(0, 0, 0, 0.2);
    transition: background var(--theme-transition);
}

/* ---------- Page Container ---------- */
.page-container {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 1500px;
}

/* ---------- Book Pages ---------- */
.book-page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 50px 40px 70px;
    background: var(--panel-bg);
    opacity: 0;
    visibility: hidden;
    transform: rotateY(-90deg);
    transform-origin: left center;
    transition:
        opacity 0.5s ease,
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.5s ease;
    overflow-y: auto;
}

.book-page.active {
    opacity: 1;
    visibility: visible;
    transform: rotateY(0deg);
}

.book-page.flipping-out {
    transform: rotateY(90deg);
    opacity: 0;
}

/* ---------- Cover Page ---------- */
.cover-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding-top: 30px;
}

.header {
    margin-bottom: 20px;
}

.character-name {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--ink);
    text-shadow:
        0 2px 4px rgba(139, 69, 87, 0.15),
        0 0 40px var(--accent-glow);
    margin-bottom: 4px;
    transition: color var(--theme-transition), text-shadow var(--theme-transition);
    position: relative;
    display: inline-block;
}

.character-name::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--gold) 30%,
            var(--gold) 70%,
            transparent 100%);
}

.character-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 12px;
    transition: color var(--theme-transition);
}

.character-oath {
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-style: italic;
    padding: 10px 20px;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    display: inline-block;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.4) 0%,
            transparent 100%);
    position: relative;
    transition: color var(--theme-transition), border-color var(--theme-transition);
}

.character-oath::before {
    content: '"';
    position: absolute;
    top: -4px;
    left: 8px;
    font-size: 1.5rem;
    color: var(--gold);
    opacity: 0.6;
    font-family: Georgia, serif;
}

.character-oath::after {
    content: '"';
    position: absolute;
    bottom: -10px;
    right: 8px;
    font-size: 1.5rem;
    color: var(--gold);
    opacity: 0.6;
    font-family: Georgia, serif;
}

/* ---------- Art Section ---------- */
.art-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.art-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.main-art {
    position: relative;
    padding: 12px;
    background: linear-gradient(135deg,
            rgba(212, 165, 185, 0.1) 0%,
            transparent 50%,
            rgba(212, 165, 185, 0.1) 100%);
    border: 2px solid var(--panel-border);
    border-radius: 6px;
    animation: float 6s ease-in-out infinite;
}

.main-art::before,
.main-art::after {
    content: '◆';
    position: absolute;
    font-size: 0.7rem;
    color: var(--icon-color);
    opacity: 0.7;
    transition: color var(--theme-transition);
}

.main-art::before {
    top: 5px;
    left: 5px;
}

.main-art::after {
    bottom: 5px;
    right: 5px;
}

.character-art {
    max-width: 100%;
    height: auto;
    max-height: min(35vh, 380px);
    /* Scale with viewport, max 380px */
    object-fit: contain;
    filter: drop-shadow(0 5px 12px var(--page-shadow));
    transition: filter var(--theme-transition);
}

[data-theme="dark"] .character-art {
    filter:
        drop-shadow(0 5px 12px var(--page-shadow)) brightness(0.9);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* ---------- Expression Carousel ---------- */
.expression-carousel {
    display: flex;
    align-items: center;
    gap: 14px;
}

.carousel-arrow {
    width: 32px;
    height: 32px;
    border: 2px solid var(--panel-border);
    border-radius: 50%;
    background: var(--button-bg);
    color: var(--ink);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.carousel-arrow:hover {
    background: var(--button-hover);
    transform: scale(1.1);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

.expression-display {
    text-align: center;
    cursor: pointer;
}

.expression-images {
    position: relative;
    width: 120px;
    height: 110px;
}

.expression-img {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: auto;
    opacity: 0;
    transition: opacity 0.5s ease;
    filter: drop-shadow(0 2px 8px var(--page-shadow));
    border-radius: 5px;
    border: 2px solid var(--panel-border);
}

.expression-img.active {
    opacity: 1;
}

.expression-label {
    margin-top: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color var(--theme-transition);
}

.expression-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--panel-border);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background: var(--panel-border);
    transform: scale(1.2);
}

.dot.active {
    background: var(--icon-color);
    border-color: var(--icon-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ---------- Content Pages ---------- */
.content-page {
    padding: 35px 45px 35px 65px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--panel-border);
}

.page-header h2 {
    font-size: 1.5rem;
    color: var(--accent-primary);
    transition: color var(--theme-transition);
}

.page-decoration {
    color: var(--icon-color);
    font-size: 0.9rem;
    transition: color var(--theme-transition);
}

.page-content {
    height: calc(100% - 60px);
    overflow-y: auto;
}

/* ---------- Lore Text ---------- */
.lore-text {
    margin-bottom: 12px;
    color: var(--text-primary);
    text-align: justify;
    text-indent: 1.5em;
    transition: color var(--theme-transition);
}

.lore-text:first-of-type {
    text-indent: 0;
}

.lore-text:first-of-type::first-letter {
    font-size: 2em;
    float: left;
    line-height: 1;
    margin-right: 5px;
    margin-top: 2px;
    color: var(--accent-primary);
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

.lore-text:last-child {
    margin-bottom: 0;
}

.lore-text.emphasis {
    font-size: 1rem;
    text-align: center;
    text-indent: 0;
    color: var(--accent-primary);
    padding: 8px 0;
    font-style: italic;
}

.lore-text.warning {
    color: #8b4444;
}

[data-theme="dark"] .lore-text.warning {
    color: #ff6b6b;
}

.lore-text strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.lore-text em {
    font-style: italic;
    color: var(--text-secondary);
}

/* ---------- Info Grid ---------- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.2) 0%,
            transparent 100%);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    text-align: center;
    transition: background var(--theme-transition);
}

[data-theme="dark"] .info-item {
    background: linear-gradient(135deg,
            rgba(139, 41, 66, 0.1) 0%,
            transparent 100%);
}

.info-label {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.info-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Dramatic Break */
.dramatic-break {
    text-align: center;
    padding: 12px 0;
}

.break-symbol {
    color: var(--icon-color);
    font-size: 0.8rem;
    opacity: 0.7;
    letter-spacing: 0.3em;
    transition: color var(--theme-transition);
}

/* ---------- Personality Layout ---------- */
.personality-dual {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.personality-side {
    flex: 1;
    padding: 14px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid var(--panel-border);
}

.light-side {
    background: linear-gradient(135deg,
            rgba(180, 200, 160, 0.1) 0%,
            transparent 100%);
}

[data-theme="dark"] .light-side {
    background: linear-gradient(135deg,
            rgba(100, 140, 100, 0.08) 0%,
            transparent 100%);
}

.dark-side {
    background: linear-gradient(135deg,
            rgba(139, 69, 87, 0.1) 0%,
            transparent 100%);
}

[data-theme="dark"] .dark-side {
    background: linear-gradient(135deg,
            rgba(139, 41, 66, 0.12) 0%,
            transparent 100%);
}

.personality-side h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.personality-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.divider-symbol {
    font-size: 1rem;
    color: var(--icon-color);
    opacity: 0.6;
    transition: color var(--theme-transition);
}

.trait-list {
    list-style: none;
    text-align: left;
}

.trait-list li {
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
    font-size: 1rem;
}

.trait-list li::before {
    content: '◆';
    position: absolute;
    left: 0;
    color: var(--icon-color);
    font-size: 0.6rem;
    top: 8px;
    transition: color var(--theme-transition);
}

/* Alignment Box */
.alignment-box {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.12) 0%,
            transparent 100%);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 14px;
    text-align: center;
    margin-bottom: 14px;
}

.alignment-label {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.alignment-value {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--accent-primary);
    margin: 6px 0 10px;
}

.alignment-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: justify;
}

/* Fear Box */
.fear-box {
    background: linear-gradient(90deg,
            rgba(139, 69, 87, 0.08) 0%,
            transparent 100%);
    border-left: 3px solid var(--accent-primary);
    padding: 10px 14px;
    border-radius: 0 4px 4px 0;
}

[data-theme="dark"] .fear-box {
    background: linear-gradient(90deg,
            rgba(139, 41, 66, 0.12) 0%,
            transparent 100%);
}

.fear-box h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.fear-box p {
    font-size: 1rem;
}

/* Connection Card */
.connection-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.12) 0%,
            transparent 100%);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 16px;
}

.connection-name {
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin-bottom: 2px;
}

.connection-role {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* ---------- Bookmark Navigation (Right Side - Horizontal Text) ---------- */
.bookmark-nav {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 1px;
    /* Small gap to clear scrollbar */
    z-index: 10;
}

.bookmark-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px 10px 10px;
    background: var(--button-bg);
    border: 2px solid var(--panel-border);
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    box-shadow:
        3px 2px 10px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.bookmark-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--icon-color);
    border-radius: 0;
    transition: width 0.3s ease, background var(--theme-transition);
}

.bookmark-tab:hover {
    transform: translateX(6px);
    box-shadow:
        5px 3px 14px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.bookmark-tab:hover::before {
    width: 4px;
}

.bookmark-tab.active {
    transform: translateX(-3px);
    background: var(--parchment);
    border-color: var(--accent-primary);
    box-shadow:
        -2px 2px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.bookmark-tab.active::before {
    width: 4px;
    background: var(--leather);
}

.bookmark-icon {
    font-size: 0.9rem;
    color: var(--icon-color);
    transition: color var(--theme-transition);
    line-height: 1;
}

.bookmark-text {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-primary);
    transition: color var(--theme-transition);
}

/* Stagger animation for bookmarks */
.bookmark-tab {
    animation: slideInRight 0.4s ease-out backwards;
}

.bookmark-tab:nth-child(1) {
    animation-delay: 0.05s;
}

.bookmark-tab:nth-child(2) {
    animation-delay: 0.1s;
}

.bookmark-tab:nth-child(3) {
    animation-delay: 0.15s;
}

.bookmark-tab:nth-child(4) {
    animation-delay: 0.2s;
}

.bookmark-tab:nth-child(5) {
    animation-delay: 0.25s;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ---------- Zoom Controls ---------- */
.zoom-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 100;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--panel-border);
    background: var(--button-bg);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.zoom-btn:hover {
    transform: scale(1.1);
    background: var(--button-hover);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* ---------- Audio Controls ---------- */
.audio-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.audio-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--panel-border);
    background: var(--button-bg);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.audio-toggle:hover {
    transform: scale(1.1);
}

.volume-slider-container {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 6px 10px;
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.volume-slider-container.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--parchment-dark);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--icon-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background var(--theme-transition);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--icon-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ---------- Lightbox (Full-Size Art View) ---------- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Make character art clickable */
.main-art {
    cursor: pointer;
}

.main-art:hover .character-art {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* ---------- Responsive Design ---------- */
@media (max-width: 800px) {
    .container {
        width: 100%;
        max-width: calc(100vw - 80px);
        height: 580px;
    }

    .bookmark-tab {
        padding: 8px 10px 8px 8px;
    }

    .bookmark-text {
        font-size: 0.55rem;
    }
}

@media (max-width: 650px) {
    body {
        padding: 10px;
    }

    .container {
        max-width: calc(100vw - 55px);
        height: 540px;
    }

    .container::before {
        width: 20px;
    }

    .book-page {
        padding: 30px 35px 30px 50px;
    }

    .cover-page {
        padding-top: 20px;
    }

    .character-name {
        font-size: 1.6rem;
    }

    .character-art {
        max-height: 200px;
    }

    .expression-images {
        width: 100px;
        height: 90px;
    }

    .expression-img {
        width: 85px;
    }

    .bookmark-text {
        display: none;
    }

    .bookmark-tab {
        padding: 10px 12px;
    }

    .bookmark-icon {
        font-size: 1rem;
    }

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

    .personality-dual {
        flex-direction: column;
        gap: 8px;
    }

    .personality-divider {
        transform: rotate(90deg);
        padding: 4px 0;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
        padding: 5px;
    }

    .container {
        height: 500px;
        max-width: calc(100vw - 45px);
    }

    .container::before {
        width: 15px;
    }

    .book-page {
        padding: 25px 25px 25px 40px;
    }

    .character-oath {
        font-size: 0.8rem;
        padding: 8px 14px;
    }

    .carousel-arrow {
        width: 28px;
        height: 28px;
    }

    .audio-controls {
        bottom: 10px;
        right: 10px;
    }

    .audio-toggle {
        width: 36px;
        height: 36px;
    }

    .lore-text:first-of-type::first-letter {
        font-size: 1.6em;
    }
}