/* ========================================
   V4 MEDIEVAL GRIMOIRE — CSS DESIGN SYSTEM
   Game of Thrones / Old Book — ENHANCED
   ======================================== */

/* ======== VARIABLES ======== */
:root {
    /* Background */
    --bg-dark: #0a0806;
    --bg-warm: #12100d;
    --bg-accent: #1a1510;

    /* Leather Cover */
    --leather-dark: #1e130b;
    --leather-mid: #2c1a0e;
    --leather-light: #3d2b1f;
    --leather-highlight: #4a3425;

    /* Gold / Metallic */
    --gold: #c5a028;
    --gold-light: #d4af37;
    --gold-bright: #f0d060;
    --gold-dim: #8b6914;
    --gold-glow: rgba(212, 175, 55, 0.3);

    /* Parchment */
    --parchment-light: #f0e2c8;
    --parchment-mid: #e8d5b0;
    --parchment-dark: #d4c09a;
    --parchment-stain: rgba(160, 120, 70, 0.1);

    /* Text */
    --ink-dark: #1a0a00;
    --ink-mid: #2c1810;
    --ink-light: #5a3e2b;
    --ink-red: #6b2020;

    /* Fonts */
    --font-display: 'Cinzel Decorative', 'Cinzel', serif;
    --font-heading: 'Cinzel', serif;
    --font-body: 'EB Garamond', serif;
    --font-medieval: 'MedievalSharp', 'Cinzel', serif;
    --font-uncial: 'Uncial Antiqua', 'MedievalSharp', serif;

    /* Ember */
    --ember-orange: #ff6b35;
    --ember-red: #cc3300;
    --ember-yellow: #ffaa00;
}

/* ======== GLOBAL RESET ======== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--ink-dark);
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* ========================================
   AMBIENT BACKGROUND
   ======================================== */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(42, 30, 15, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(35, 25, 12, 0.6) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-warm) 50%, var(--bg-dark) 100%);
}

.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center,
            transparent 40%,
            rgba(0, 0, 0, 0.4) 70%,
            rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}

/* ========================================
   EMBERS
   ======================================== */
.embers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.ember {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    animation: emberFloat var(--duration, 6s) var(--delay, 0s) linear infinite;
}

@keyframes emberFloat {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }

    10% {
        opacity: var(--max-opacity, 0.8);
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(var(--drift-x, 30px), calc(-100vh - 50px)) scale(0);
        opacity: 0;
    }
}

/* ========================================
   DUST PARTICLES
   ======================================== */
.dust-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.dust {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.4);
    pointer-events: none;
    animation: dustDrift var(--dust-duration, 15s) var(--dust-delay, 0s) linear infinite;
}

@keyframes dustDrift {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }

    15% {
        opacity: var(--dust-opacity, 0.3);
    }

    85% {
        opacity: var(--dust-opacity, 0.3);
    }

    100% {
        transform: translate(var(--dust-dx, 80px), var(--dust-dy, -40px));
        opacity: 0;
    }
}

/* ========================================
   FOG / MIST
   ======================================== */
.fog-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.fog {
    position: absolute;
    width: 200%;
    height: 40%;
    background: radial-gradient(ellipse at center,
            rgba(20, 16, 10, 0.25) 0%,
            transparent 70%);
    filter: blur(40px);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.fog-1 {
    bottom: -5%;
    left: -50%;
    animation: fogDrift1 25s linear infinite;
}

.fog-2 {
    bottom: 10%;
    left: -80%;
    opacity: 0.6;
    animation: fogDrift2 35s linear infinite;
}

.fog-3 {
    top: -5%;
    left: -30%;
    height: 25%;
    opacity: 0.3;
    animation: fogDrift3 40s linear infinite;
}

@keyframes fogDrift1 {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

@keyframes fogDrift2 {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(60%);
    }
}

@keyframes fogDrift3 {
    0% {
        transform: translateX(0) translateY(0);
    }

    50% {
        transform: translateX(30%) translateY(10px);
    }

    100% {
        transform: translateX(60%) translateY(0);
    }
}

/* ========================================
   CANDLELIGHT FLICKER
   ======================================== */
.candlelight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(ellipse at 50% 60%,
            rgba(255, 170, 60, 0.04) 0%,
            transparent 60%);
    animation: candleFlicker 3s ease-in-out infinite;
}

@keyframes candleFlicker {
    0% {
        opacity: 0.6;
    }

    10% {
        opacity: 0.8;
    }

    20% {
        opacity: 0.5;
    }

    30% {
        opacity: 0.9;
    }

    40% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    60% {
        opacity: 0.6;
    }

    70% {
        opacity: 0.85;
    }

    80% {
        opacity: 0.55;
    }

    90% {
        opacity: 0.9;
    }

    100% {
        opacity: 0.6;
    }
}

/* ========================================
   DRAGON SERPENT — PNG with roaming animation
   ======================================== */
.dragon-serpent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 4s ease;
    overflow: hidden;
}

.dragon-serpent.visible {
    opacity: 1;
}

/* The dragon image — mix-blend-mode: screen makes black = transparent */
.dragon-img {
    position: absolute;
    width: 350px;
    height: auto;
    mix-blend-mode: screen;
    opacity: 0.3;
    animation:
        dragonRoam 60s ease-in-out infinite,
        dragonPulse 6s ease-in-out infinite;
    filter: brightness(1.2) saturate(1.1);
    will-change: transform, opacity;
}

/* The dragon roams across the entire page in a large figure-8 path */
@keyframes dragonRoam {
    0% {
        top: 60%;
        left: -15%;
        transform: scale(0.7) rotate(-5deg);
    }

    8% {
        top: 30%;
        left: 10%;
        transform: scale(0.85) rotate(3deg);
    }

    16% {
        top: 10%;
        left: 35%;
        transform: scale(1) rotate(-2deg);
    }

    24% {
        top: 20%;
        left: 60%;
        transform: scale(0.9) rotate(5deg);
    }

    32% {
        top: 45%;
        left: 80%;
        transform: scale(0.75) rotate(-3deg);
    }

    40% {
        top: 65%;
        left: 65%;
        transform: scale(0.85) rotate(2deg);
    }

    48% {
        top: 75%;
        left: 40%;
        transform: scale(0.95) rotate(-4deg);
    }

    56% {
        top: 55%;
        left: 15%;
        transform: scale(0.8) rotate(6deg);
    }

    64% {
        top: 35%;
        left: 5%;
        transform: scale(0.9) rotate(-2deg);
    }

    72% {
        top: 15%;
        left: 25%;
        transform: scale(1.05) rotate(3deg);
    }

    80% {
        top: 25%;
        left: 55%;
        transform: scale(0.85) rotate(-5deg);
    }

    88% {
        top: 50%;
        left: 75%;
        transform: scale(0.75) rotate(2deg);
    }

    94% {
        top: 65%;
        left: 10%;
        transform: scale(0.8) rotate(-3deg);
    }

    100% {
        top: 60%;
        left: -15%;
        transform: scale(0.7) rotate(-5deg);
    }
}

/* Breathing glow pulse */
@keyframes dragonPulse {

    0%,
    100% {
        opacity: 0.2;
        filter: brightness(1.1) drop-shadow(0 0 5px rgba(212, 175, 55, 0.1));
    }

    50% {
        opacity: 0.4;
        filter: brightness(1.4) drop-shadow(0 0 25px rgba(212, 175, 55, 0.4));
    }
}

/* ========================================
   INTRO SCREEN
   ======================================== */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 8, 6, 0.95);
    transition: opacity 1.2s ease, visibility 1.2s ease;
}

.intro-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.intro-content {
    text-align: center;
    animation: introAppear 1.5s ease forwards;
}

@keyframes introAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-dragon {
    margin-bottom: 2rem;
}

.dragon-svg {
    width: 150px;
    height: 135px;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
    animation: dragonGlow 3s ease-in-out infinite alternate;
}

@keyframes dragonGlow {
    from {
        filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
    }

    to {
        filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.6));
    }
}

.intro-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 900;
    color: var(--gold-light);
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 30px var(--gold-glow);
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.intro-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: var(--gold-dim);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.intro-ornament {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--gold-dim);
    margin-bottom: 2.5rem;
    opacity: 0.7;
}

.intro-hint {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: var(--gold-dim);
    letter-spacing: 0.08em;
    margin-top: 1.5rem;
    opacity: 0.5;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

.btn-open {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--leather-mid) 0%, var(--leather-dark) 100%);
    color: var(--gold-light);
    border: 2px solid var(--gold-dim);
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.btn-open::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 60%);
    animation: btnShimmer 3s ease-in-out infinite;
}

@keyframes btnShimmer {
    0% {
        transform: translateX(-30%) translateY(-30%);
    }

    50% {
        transform: translateX(30%) translateY(30%);
    }

    100% {
        transform: translateX(-30%) translateY(-30%);
    }
}

.btn-open:hover {
    background: linear-gradient(135deg, var(--leather-light) 0%, var(--leather-mid) 100%);
    border-color: var(--gold-light);
    box-shadow:
        0 6px 25px rgba(0, 0, 0, 0.6),
        0 0 20px var(--gold-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.btn-open:active {
    transform: translateY(0);
}

/* ========================================
   BOOK SCENE
   ======================================== */
.book-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: bookSceneIn 1s ease forwards;
}

@keyframes bookSceneIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.book-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
    position: relative;
}

/* ========================================
   StPageFlip BOOK STYLING
   ======================================== */

/* ======= PAGES BASE ======= */
.page {
    background: var(--parchment-light);
    overflow: hidden;
}

.page-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ======= ENHANCED PARCHMENT TEXTURE ======= */
.page-content {
    background:
        /* Ink spots */
        radial-gradient(circle at 85% 92%, rgba(100, 70, 30, 0.06) 0%, transparent 8px),
        radial-gradient(circle at 12% 78%, rgba(120, 80, 40, 0.05) 0%, transparent 6px),
        radial-gradient(circle at 72% 8%, rgba(110, 75, 35, 0.04) 0%, transparent 5px),
        /* Subtle stains */
        radial-gradient(ellipse at 15% 85%, var(--parchment-stain) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 15%, var(--parchment-stain) 0%, transparent 35%),
        radial-gradient(ellipse at 50% 50%, rgba(140, 110, 65, 0.03) 0%, transparent 50%),
        /* Coffee ring stain */
        radial-gradient(circle at 70% 75%, transparent 18px, rgba(160, 120, 70, 0.04) 19px, rgba(160, 120, 70, 0.04) 22px, transparent 23px),
        /* Edge aging — stronger burnt look */
        linear-gradient(to right, rgba(140, 110, 60, 0.25) 0%, rgba(180, 150, 100, 0.1) 2%, transparent 6%, transparent 94%, rgba(180, 150, 100, 0.1) 98%, rgba(140, 110, 60, 0.25) 100%),
        linear-gradient(to bottom, rgba(140, 110, 60, 0.2) 0%, rgba(180, 150, 100, 0.08) 2%, transparent 5%, transparent 95%, rgba(180, 150, 100, 0.08) 98%, rgba(140, 110, 60, 0.2) 100%),
        /* Paper grain noise */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23f0e2c8'/%3E%3Crect width='1' height='1' x='1' y='1' fill='%23ead4b0' fill-opacity='0.3'/%3E%3Crect width='1' height='1' x='3' y='0' fill='%23e6cfaa' fill-opacity='0.2'/%3E%3C/svg%3E"),
        /* Base parchment gradient */
        linear-gradient(175deg,
            #f2e4ca 0%,
            #ecd8b4 15%,
            #f0dfbf 30%,
            #e8d3ad 50%,
            #f0dfc2 70%,
            #ebd6b2 85%,
            #f0e0c4 100%);
    /* Inner shadow for page depth */
    box-shadow:
        inset 3px 0 10px rgba(0, 0, 0, 0.06),
        inset -2px 0 8px rgba(0, 0, 0, 0.04),
        inset 0 3px 8px rgba(0, 0, 0, 0.04),
        inset 0 -3px 8px rgba(0, 0, 0, 0.04);
}

/* ======= BOOKBINDING SHADOW ======= */
.stf__parent {
    filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.7));
}

/* Spine shadow for two-page spread */
.stf__parent::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 90%;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(0, 0, 0, 0.15) 30%,
            rgba(0, 0, 0, 0.25) 50%,
            rgba(0, 0, 0, 0.15) 70%,
            transparent 100%);
    pointer-events: none;
    z-index: 100;
    border-radius: 50%;
}

/* ======= MEDIEVAL BORDERS ======= */
.page-border {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 2px solid var(--gold-dim);
    padding: 4px;
}

.page-border::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(139, 105, 20, 0.3);
    pointer-events: none;
}

/* ======= CORNER ORNAMENTS ======= */
.corner {
    position: absolute;
    font-size: 1.3rem;
    color: var(--gold-dim);
    line-height: 1;
    z-index: 2;
    opacity: 0.6;
}

.corner-tl {
    top: -2px;
    left: 4px;
}

.corner-tr {
    top: -2px;
    right: 4px;
    transform: scaleX(-1);
}

.corner-bl {
    bottom: -2px;
    left: 4px;
    transform: scaleY(-1);
}

.corner-br {
    bottom: -2px;
    right: 4px;
    transform: scale(-1);
}

/* ======= PAGE BODY ======= */
.page-body {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px;
}

.page-number {
    margin-top: auto;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--gold-dim);
    letter-spacing: 0.2em;
    padding-top: 10px;
    opacity: 0.6;
}

/* ========================================
   CHAPTER HEADERS
   ======================================== */
.chapter-header {
    text-align: center;
    margin-bottom: 12px;
}

.chapter-number {
    font-family: var(--font-heading);
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    color: var(--gold);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.chapter-line {
    display: block;
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    margin: 0 auto;
}

/* ========================================
   COVER STYLES (LEATHER LOOK)
   ======================================== */
.page-cover {
    background:
        repeating-linear-gradient(45deg,
            transparent, transparent 2px,
            rgba(0, 0, 0, 0.04) 2px, rgba(0, 0, 0, 0.04) 4px),
        repeating-linear-gradient(-45deg,
            transparent, transparent 3px,
            rgba(0, 0, 0, 0.03) 3px, rgba(0, 0, 0, 0.03) 6px),
        /* Leather grain texture */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Crect width='6' height='6' fill='%232c1a0e'/%3E%3Crect width='1' height='1' x='2' y='1' fill='%23251609' fill-opacity='0.5'/%3E%3Crect width='1' height='1' x='4' y='3' fill='%23341e10' fill-opacity='0.3'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 30% 20%, rgba(74, 52, 37, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(60, 40, 25, 0.4) 0%, transparent 50%),
        linear-gradient(160deg,
            var(--leather-mid) 0%,
            var(--leather-dark) 25%,
            var(--leather-light) 50%,
            var(--leather-dark) 75%,
            var(--leather-mid) 100%);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5) !important;
}

.cover-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.cover-border {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 3px solid var(--gold-dim);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-border::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid rgba(139, 105, 20, 0.35);
}

.cover-border::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(139, 105, 20, 0.15);
}

.cover-inner {
    text-align: center;
    padding: 30px 20px;
    z-index: 1;
    position: relative;
}

.cover-ornament-top,
.cover-ornament-bottom {
    font-size: 1.3rem;
    color: var(--gold);
    letter-spacing: 0.5em;
    margin: 10px 0;
    opacity: 0.7;
}

.cover-dragon {
    width: 120px;
    height: 110px;
    margin: 15px auto;
    display: block;
    filter: drop-shadow(0 0 8px rgba(197, 160, 40, 0.4));
    cursor: help;
    transition: filter 0.3s ease;
}

.cover-dragon:hover {
    filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.6));
}

.cover-dragon-small {
    width: 80px;
    height: 72px;
    opacity: 0.5;
    cursor: default;
}

.cover-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    color: var(--gold-light);
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 15px var(--gold-glow);
    letter-spacing: 0.06em;
    margin: 10px 0 5px;
}

.cover-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(0.8rem, 2vw, 1.1rem);
    color: var(--gold-dim);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.cover-date {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--gold-dim);
    letter-spacing: 0.25em;
    margin-top: 10px;
    opacity: 0.6;
}

.cover-back-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.back-cover-text {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--gold-dim);
    letter-spacing: 0.3em;
    opacity: 0.4;
    margin-top: 15px;
}

/* ========================================
   DEDICATION PAGE
   ======================================== */
.dedication-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.dedication-ornament {
    font-size: 2.5rem;
    color: var(--gold);
    margin: 15px 0;
    opacity: 0.5;
}

.dedication-text {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--ink-mid);
    line-height: 2;
    letter-spacing: 0.05em;
}

.dedication-separator {
    font-size: 1rem;
    color: var(--gold-dim);
    margin: 20px 0;
    letter-spacing: 0.5em;
    opacity: 0.6;
}

.dedication-quote,
.dedication-response {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--ink-light);
    margin: 5px 0;
}

/* ========================================
   LETTER PAGES
   ======================================== */
.page-heading {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--ink-red);
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gold-dim);
}

.letter-body {
    flex: 1;
    overflow: hidden;
}

.letter-body p {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.8vw, 1.15rem);
    line-height: 1.85;
    color: var(--ink-mid);
    text-align: justify;
    margin-bottom: 12px;
    text-indent: 1.5em;
}

.dropcap {
    font-family: var(--font-uncial);
    font-size: 3.5rem;
    float: left;
    line-height: 0.8;
    margin: 2px 8px 0 0;
    color: var(--ink-red);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.letter-signature {
    font-family: var(--font-body);
    font-style: italic;
    text-align: right;
    color: var(--ink-light);
    text-indent: 0 !important;
    margin-top: 10px;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
}

/* ========================================
   QUOTE PAGES
   ======================================== */
.quote-page {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
}

.quote-ornament {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--gold);
    line-height: 0.6;
    margin-bottom: 15px;
    opacity: 0.4;
}

.quote-text {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.95rem, 2vw, 1.2rem);
    line-height: 1.8;
    color: var(--ink-mid);
    max-width: 90%;
    margin: 0 auto 10px;
    border: none;
    padding: 0;
}

.quote-small {
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

.quote-author {
    font-family: var(--font-heading);
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    color: var(--ink-red);
    letter-spacing: 0.05em;
    margin-bottom: 15px;
}

.quote-separator {
    font-size: 1.5rem;
    color: var(--gold);
    margin: 15px 0;
    opacity: 0.4;
}

/* ========================================
   DECREE PAGE (Gaming Tribunal)
   ======================================== */
.decree-page {
    align-items: center;
    text-align: center;
}

.decree-heading {
    font-size: clamp(1.2rem, 2.8vw, 1.7rem) !important;
    border-bottom: 2px solid var(--gold-dim) !important;
    padding-bottom: 8px;
}

.decree-seal {
    font-size: 2.5rem;
    color: var(--gold);
    margin: 10px 0;
    opacity: 0.5;
    text-shadow: 0 0 10px var(--gold-glow);
}

.decree-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5px;
}

.decree-text {
    font-family: var(--font-body);
    font-size: clamp(0.85rem, 1.6vw, 1.05rem);
    line-height: 1.75;
    color: var(--ink-mid);
    text-align: justify;
    margin-bottom: 10px;
}

.decree-dropcap {
    color: var(--gold) !important;
}

.decree-dramatic {
    font-family: var(--font-heading) !important;
    font-size: clamp(0.95rem, 2vw, 1.2rem) !important;
    color: var(--ink-red) !important;
    text-align: center !important;
    font-style: italic;
    margin: 12px 0;
}

.decree-divider {
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 0.5em;
    text-align: center;
    margin: 8px 0;
    opacity: 0.6;
}

.decree-italic {
    font-style: italic;
    text-align: center !important;
    color: var(--ink-light) !important;
}

/* ========================================
   GAMING PAGES (Valo, LoL, Messages)
   ======================================== */
.gaming-page {
    align-items: center;
    text-align: center;
}

.gaming-heading {
    font-size: clamp(1rem, 2.5vw, 1.5rem) !important;
    border-bottom: none !important;
    margin-bottom: 8px !important;
}

.gaming-intro {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    color: var(--ink-light);
    font-style: italic;
    margin-bottom: 12px;
    text-align: center;
}

.gaming-caption {
    font-family: var(--font-body);
    font-size: clamp(0.75rem, 1.3vw, 0.85rem);
    color: var(--ink-light);
    margin-top: 8px;
    text-align: center;
}

/* ======= SCREENSHOT FRAME ======= */
.screenshot-frame {
    position: relative;
    width: 90%;
    max-height: 55%;
    margin: 0 auto;
    border: 3px solid var(--gold-dim);
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.15),
        inset 0 0 15px rgba(0, 0, 0, 0.08);
}

.screenshot-frame-small {
    max-height: 40%;
    width: 85%;
}

.screenshot-frame::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(139, 105, 20, 0.2);
    pointer-events: none;
    z-index: 2;
}

.frame-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--gold);
    z-index: 3;
}

.frame-tl {
    top: -1px;
    left: -1px;
    border-top: 2px solid;
    border-left: 2px solid;
}

.frame-tr {
    top: -1px;
    right: -1px;
    border-top: 2px solid;
    border-right: 2px solid;
}

.frame-bl {
    bottom: -1px;
    left: -1px;
    border-bottom: 2px solid;
    border-left: 2px solid;
}

.frame-br {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid;
    border-right: 2px solid;
}

.screenshot-img {
    width: 100%;
    height: auto;
    max-height: 100%;
    display: block;
    object-fit: contain;
    filter: sepia(15%) contrast(1.05);
}

.screenshot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    color: var(--ink-light);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    opacity: 0.7;
}

.placeholder-hint {
    font-family: var(--font-body);
    font-size: 0.7rem;
    margin-top: 8px;
    opacity: 0.5;
    text-align: center;
}

.placeholder-hint code {
    font-family: monospace;
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 5px;
    border-radius: 2px;
}

/* ========================================
   WANTED POSTER (LoL page)
   ======================================== */
.wanted-poster {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.wanted-header {
    font-family: var(--font-heading);
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--ink-red);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding: 4px 20px;
    border: 2px solid var(--ink-red);
    opacity: 0.8;
}

.wanted-text {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    color: var(--ink-mid);
    line-height: 1.65;
    text-align: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

.wanted-caption {
    font-family: var(--font-body);
    font-size: clamp(0.7rem, 1.3vw, 0.8rem);
    color: var(--ink-light);
    margin-top: 8px;
}

/* ========================================
   TRANSITION PAGE
   ======================================== */
.transition-page {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.transition-ornament {
    font-size: 2rem;
    color: var(--gold);
    opacity: 0.4;
    margin-bottom: 20px;
}

.transition-text-small {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: var(--ink-light);
    line-height: 1.6;
    margin: 3px 0;
}

.transition-strikethrough {
    text-decoration: line-through;
    text-decoration-color: var(--ink-red);
    color: var(--ink-light);
    opacity: 0.7;
    font-style: italic;
}

.transition-pause {
    font-size: 1.2rem;
    color: var(--gold-dim);
    letter-spacing: 1em;
    margin: 15px 0;
    opacity: 0.4;
}

.transition-text-big {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--ink-mid);
    line-height: 1.8;
    margin: 5px 0;
}

.transition-text-reveal {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--ink-red);
    margin: 10px 0;
    text-shadow: 0 0 20px rgba(107, 32, 32, 0.2);
}

.transition-heart {
    font-size: 2rem;
    color: var(--ink-red);
    margin-top: 15px;
    animation: heartbeat 2s ease-in-out infinite;
    opacity: 0.7;
}

/* ========================================
   TIMELINE
   ======================================== */
.timeline {
    position: relative;
    padding: 5px 0 5px 25px;
    flex: 1;
}

.timeline-line {
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--gold-dim), var(--gold), var(--gold-dim));
    opacity: 0.4;
}

.timeline-entry {
    position: relative;
    margin-bottom: 20px;
    padding-left: 15px;
}

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 2px;
    color: var(--gold);
    font-size: 0.7rem;
}

.timeline-marker.future {
    color: var(--gold-dim);
    animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

.timeline-entry h3 {
    font-family: var(--font-heading);
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    color: var(--ink-red);
    margin-bottom: 4px;
}

.timeline-entry p {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    line-height: 1.6;
    color: var(--ink-mid);
}

.timeline-closing {
    text-align: center;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(139, 105, 20, 0.2);
}

.timeline-closing-text {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    color: var(--ink-light);
    line-height: 1.6;
}

/* ========================================
   FINAL PAGE
   ======================================== */
.final-page {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.final-heart {
    font-size: 3rem;
    color: var(--ink-red);
    margin-bottom: 15px;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.1);
    }

    60% {
        transform: scale(1);
    }
}

.final-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--ink-red);
    margin-bottom: 15px;
}

.final-text {
    font-family: var(--font-body);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    line-height: 1.7;
    color: var(--ink-mid);
    margin-bottom: 8px;
    max-width: 90%;
}

.final-text.emphasis {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--ink-red);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    margin: 12px 0;
}

.final-signature {
    margin-top: 15px;
    font-family: var(--font-body);
    font-style: italic;
    color: var(--ink-light);
}

.final-date {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    margin-top: 5px;
    opacity: 0.5;
}

/* ========================================
   NAVIGATION CONTROLS
   ======================================== */
.nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px 25px;
    margin-top: 15px;
    background: linear-gradient(135deg, rgba(30, 19, 11, 0.9) 0%, rgba(20, 14, 8, 0.95) 100%);
    border: 1px solid rgba(139, 105, 20, 0.25);
    border-radius: 4px;
    backdrop-filter: blur(5px);
    z-index: 200;
}

.nav-btn {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--leather-mid) 0%, var(--leather-dark) 100%);
    color: var(--gold);
    border: 1px solid var(--gold-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--leather-light) 0%, var(--leather-mid) 100%);
    border-color: var(--gold-light);
    box-shadow: 0 0 12px var(--gold-glow);
}

.nav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.nav-icon {
    font-size: 1rem;
}

.nav-page-info {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    min-width: 60px;
    text-align: center;
}

.nav-sep {
    margin: 0 4px;
    opacity: 0.4;
}

.nav-total {
    opacity: 0.5;
}

/* ========================================
   AUDIO CONTROLS
   ======================================== */
.audio-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(30, 19, 11, 0.95) 0%, rgba(20, 14, 8, 0.98) 100%);
    border: 1px solid rgba(139, 105, 20, 0.3);
    border-radius: 30px;
    backdrop-filter: blur(8px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.audio-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px;
    transition: transform 0.2s ease;
}

.audio-btn:hover {
    transform: scale(1.15);
}

.audio-visualizer {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 18px;
}

.viz-bar {
    width: 3px;
    height: 4px;
    background: var(--gold);
    border-radius: 1px;
    animation: vizPulse 0.8s ease-in-out infinite;
    opacity: 0.7;
}

.viz-bar:nth-child(1) {
    animation-delay: 0s;
}

.viz-bar:nth-child(2) {
    animation-delay: 0.15s;
}

.viz-bar:nth-child(3) {
    animation-delay: 0.3s;
}

.viz-bar:nth-child(4) {
    animation-delay: 0.45s;
}

.viz-bar:nth-child(5) {
    animation-delay: 0.6s;
}

@keyframes vizPulse {

    0%,
    100% {
        height: 4px;
    }

    50% {
        height: 16px;
    }
}

.audio-controls.muted .viz-bar {
    animation: none;
    height: 4px;
    opacity: 0.3;
}

/* ========================================
   KONAMI CODE OVERLAY
   ======================================== */
.konami-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 8, 6, 0.9);
    animation: konamiIn 0.5s ease;
}

.konami-overlay.hidden {
    display: none;
}

@keyframes konamiIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.konami-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.konami-heart {
    position: absolute;
    font-size: 1.5rem;
    animation: heartFall var(--fall-duration, 4s) var(--fall-delay, 0s) linear forwards;
    opacity: 0;
}

@keyframes heartFall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.konami-message {
    text-align: center;
    z-index: 1;
    animation: konamiPulse 2s ease-in-out infinite;
}

@keyframes konamiPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

.konami-text {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--gold-light);
    text-shadow: 0 0 30px var(--gold-glow);
    margin-bottom: 1rem;
}

.konami-sub {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--gold-dim);
    line-height: 1.8;
}

/* ========================================
   KEYBOARD HINT
   ======================================== */
.keyboard-hint {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--gold-dim);
    opacity: 0.4;
    z-index: 200;
    pointer-events: none;
    animation: fadeInHint 1s ease 2s both;
}

@keyframes fadeInHint {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.4;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .book-scene {
        padding: 10px;
    }

    .nav-controls {
        gap: 10px;
        padding: 10px 15px;
        margin-top: 10px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.7rem;
    }

    .nav-label {
        display: none;
    }

    .keyboard-hint {
        display: none;
    }

    .page-border {
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .page-body {
        top: 14px;
        left: 14px;
        right: 14px;
        bottom: 14px;
    }

    .cover-border {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .cover-dragon {
        width: 80px;
        height: 72px;
    }

    .dropcap {
        font-size: 2.5rem;
    }

    .dragon-serpent {
        display: none;
    }

    .audio-controls {
        bottom: 10px;
        right: 10px;
        padding: 6px 10px;
    }

    .screenshot-frame {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .corner {
        font-size: 1rem;
    }

    .cover-ornament-top,
    .cover-ornament-bottom {
        font-size: 1rem;
    }

    .dedication-ornament {
        font-size: 1.8rem;
    }

    .quote-ornament {
        font-size: 2.5rem;
    }
}

/* ========================================
   MEDIEVAL CURSOR
   ======================================== */
body {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='32' viewBox='0 0 24 32'%3E%3Cpath d='M4,2 L4,26 L8,22 L12,30 L15,28 L11,20 L16,20 Z' fill='%23d4af37' stroke='%23704214' stroke-width='1'/%3E%3C/svg%3E") 4 2, auto;
}

a,
button,
.nav-btn,
.audio-btn,
.intro-btn {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='10' fill='none' stroke='%23d4af37' stroke-width='2'/%3E%3Ccircle cx='14' cy='14' r='3' fill='%23d4af37'/%3E%3C/svg%3E") 14 14, pointer;
}

/* ========================================
   GOLD ILLUMINATED DROP CAPS — Realistic
   ======================================== */
.dropcap {
    float: left;
    font-family: 'Cinzel Decorative', 'Uncial Antiqua', serif;
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 0.75;
    margin-right: 8px;
    margin-top: 6px;
    padding: 4px 2px;

    /* Realistic gold metallic gradient */
    background: linear-gradient(150deg,
            #bf953f 0%,
            #fcf6ba 25%,
            #b38728 30%,
            #fbf5b7 45%,
            #aa771c 60%,
            #d4af37 70%,
            #f5e7a3 80%,
            #b8860b 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    /* Gold glow */
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5)) drop-shadow(0 0 12px rgba(212, 175, 55, 0.2));

    /* Shine animation */
    animation: goldShine 6s ease-in-out infinite;
    position: relative;
}

/* Shine sweeping across the gold letter */
@keyframes goldShine {
    0% {
        background-position: 200% 0%;
        filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5)) drop-shadow(0 0 12px rgba(212, 175, 55, 0.2));
    }

    50% {
        background-position: 0% 100%;
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7)) drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
    }

    100% {
        background-position: 200% 0%;
        filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5)) drop-shadow(0 0 12px rgba(212, 175, 55, 0.2));
    }
}

/* ========================================
   LOVE COUNTER
   ======================================== */
/* ========================================
   LOVE COUNTER
   ======================================== */
.love-counter {
    margin: 25px auto 20px;
    padding: 20px 15px;
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 8px;
    /* Darker, stronger background for contrast */
    background: linear-gradient(135deg,
            rgba(20, 10, 5, 0.85) 0%,
            rgba(40, 25, 10, 0.75) 100%);
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.8),
        0 0 5px rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(4px);
    max-width: 90%;
}

.counter-label {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: #f0d060;
    /* Brighter gold */
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.8);
}

.counter-digits {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.counter-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.counter-value {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 2.5rem;
    /* Much larger */
    line-height: 1;
    /* Brighter, more metallic gold gradient */
    background: linear-gradient(180deg,
            #fffce6 0%,
            #ffd700 30%,
            #d4af37 60%,
            #b8860b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    min-width: 60px;
}

.counter-name {
    font-family: 'EB Garamond', serif;
    font-size: 0.8rem;
    color: #cca449;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 5px;
    font-weight: 600;
}

.counter-sep {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: #d4af37;
    opacity: 0.8;
    margin-top: -20px;
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.counter-sub {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #e0c070;
    margin-top: 12px;
    animation: counterHeartbeat 3s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

@keyframes counterHeartbeat {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
        color: #fff;
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    }
}

/* ========================================
   ROSE PETALS
   ======================================== */
.rose-petals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.rose-petals.active {
    opacity: 1;
}

.petal {
    position: absolute;
    top: -40px;
    width: 14px;
    height: 18px;
    border-radius: 50% 50% 50% 0;
    opacity: 0;
    animation: petalFall linear forwards;
    will-change: transform, opacity;
    /* Rose petal gradient */
    background: radial-gradient(ellipse at 30% 30%,
            #e8486a 0%,
            #c43a5a 40%,
            #9b2d4a 80%,
            #6d1f35 100%);
    box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        inset 1px 1px 3px rgba(255, 150, 170, 0.3);
    transform-style: preserve-3d;
}

.petal:nth-child(odd) {
    background: radial-gradient(ellipse at 40% 20%,
            #f07090 0%,
            #d44060 40%,
            #b03050 80%,
            #801030 100%);
}

.petal:nth-child(3n) {
    background: radial-gradient(ellipse at 30% 40%,
            #ff9bb0 0%,
            #e06080 40%,
            #c04060 80%,
            #9a2040 100%);
    width: 11px;
    height: 14px;
}

@keyframes petalFall {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) rotate(0deg) rotateX(0deg) rotateY(0deg) scale(1);
    }

    10% {
        opacity: 0.9;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: translateY(110vh) translateX(var(--drift, 80px)) rotate(var(--spin, 720deg)) rotateX(var(--rx, 180deg)) rotateY(var(--ry, 90deg)) scale(0.4);
    }
}

/* ========================================
   CALLIGRAPHIC TEXT ANIMATION
   ======================================== */
.calligraphic-reveal .letter-body p,
.calligraphic-reveal .final-text {
    overflow: hidden;
}

.calligraphic-reveal .letter-body p span.char,
.calligraphic-reveal .final-text span.char {
    display: inline-block;
    opacity: 0;
    animation: charReveal 0.05s ease forwards;
    animation-play-state: paused;
}

.calligraphic-reveal .letter-body p span.char.revealed {
    animation-play-state: running;
}

@keyframes charReveal {
    from {
        opacity: 0;
        transform: translateY(5px) rotate(-2deg);
        filter: blur(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
        filter: blur(0);
    }
}

/* ========================================
   TORCHLIGHT EXPERIENCE (Dracarys)
   ======================================== */
.torchlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%),
            transparent 250px,
            rgba(0, 0, 0, 0.96) 500px,
            black 900px);
    opacity: 1;
    /* Always visible */
    transition: background 0.1s linear, opacity 2s ease;
    /* Smooth movement only */
}

/* .active class removed as it's always on now */

/* ========================================
   BLOOD PACT (Interactive Seal)
   ======================================== */
.blood-pact-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.pact-seal-wrapper {
    width: 160px;
    height: 160px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pact-seal-wrapper:hover {
    transform: scale(1.05);
}

.pact-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(138, 3, 3, 0.3));
    transition: filter 0.3s ease;
}

.pact-svg:hover {
    filter: drop-shadow(0 0 15px rgba(138, 3, 3, 0.6));
}

.seal-outer-ring {
    transform-origin: center;
    animation: rotateSlow 60s linear infinite;
}

.seal-heart {
    transform-origin: center;
    animation: heartbeat 2s ease-in-out infinite;
}

.pact-instruction {
    margin-top: 15px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #8a0303;
    opacity: 0.7;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

/* HOLDING STATE (Active) */
.blood-pact-container.holding .pact-seal-wrapper {
    animation: shake 0.1s cubic-bezier(.36, .07, .19, .97) both infinite;
}

.blood-pact-container.holding .seal-heart {
    animation: heartbeat 0.4s ease-in-out infinite;
    fill: #b30000;
}

.blood-pact-container.holding .pact-instruction {
    opacity: 1;
    color: #ff0000;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* SEALED STATE (Done) */
.pact-signature {
    margin-top: 20px;
    text-align: center;
    position: relative;
    animation: signatureReveal 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.signature-names {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.5rem;
    color: #500000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.signature-sep {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 1.5rem;
    color: #8a0303;
}

.signature-date {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #8a0303;
    margin-top: 5px;
    letter-spacing: 4px;
    opacity: 0.8;
}

.signature-blood-splatter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 150px;
    background: radial-gradient(circle, #8a0303 0%, transparent 70%);
    opacity: 0;
    /* Hidden initially */
    z-index: -1;
    filter: blur(20px);
    animation: splatterExpand 0.8s ease-out forwards 0.2s;
    /* Delayed start */
}

@keyframes rotateSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes signatureReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-5deg);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0);
    }
}

@keyframes splatterExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0.3;
    }
}

/* Hide love counter styles if present */
.love-counter {
    display: none !important;
}

/* Light Switch Button */
.btn-light-switch {
    margin-top: 30px;
    padding: 10px 25px;
    background: transparent;
    border: 1px solid #d4af37;
    border-radius: 30px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 2s ease forwards 0.5s;
    pointer-events: auto;
}

.btn-light-switch:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.btn-light-switch.hidden {
    display: none;
}

/* ========================================
   GOT PAGE THEMES
   ======================================== */

/* --- Common Overrides --- */
.theme-dothraki .corner,
.theme-stark .corner,
.theme-tyrell .corner,
.theme-lannister .corner,
.theme-lannister-gold .corner,
.theme-martell .corner,
.theme-wall .corner,
.theme-varys .corner,
.theme-targaryen .corner,
.theme-map .corner,
.theme-weirwood .corner {
    font-size: 0 !important;
    /* Hide '❧' */
    display: flex;
    justify-content: center;
    align-items: center;
}

.theme-dothraki .corner::after,
.theme-stark .corner::after,
.theme-tyrell .corner::after,
.theme-lannister .corner::after,
.theme-lannister-gold .corner::after,
.theme-martell .corner::after,
.theme-wall .corner::after,
.theme-varys .corner::after,
.theme-targaryen .corner::after,
.theme-map .corner::after,
.theme-weirwood .corner::after {
    font-size: 1.5rem;
    display: block;
}

/* --- 1. Dothraki (Dedication) --- */
.theme-dothraki .page-border {
    border-color: #cd7f32;
    /* Bronze */
    background: radial-gradient(circle, rgba(205, 127, 50, 0.05), transparent);
}

.theme-dothraki .corner::after {
    content: "☾";
    color: #cd7f32;
}

.theme-dothraki .dedication-text {
    color: #5d4037;
}

/* --- 2. Stark (Letters) --- */
.theme-stark .page-border {
    border-color: #7f8c8d;
    /* Silver */
    box-shadow: inset 0 0 20px rgba(127, 140, 141, 0.1);
}

.theme-stark .corner::after {
    content: "🐺";
    filter: grayscale(1);
    font-size: 1.2rem;
}

.theme-stark .page-heading {
    color: #2c3e50;
}

.theme-stark .dropcap {
    color: #34495e;
}

/* --- 3. Tyrell (Quotes) --- */
.theme-tyrell .page-border {
    border-color: #27ae60;
    border-style: double;
}

.theme-tyrell .corner::after {
    content: "🌹";
    font-size: 1.2rem;
}

.theme-tyrell .quote-ornament {
    color: #27ae60;
}

.theme-tyrell .page-body {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0 L15 10 L10 20 L5 10 Z' fill='%2327ae60' fill-opacity='0.03'/%3E%3C/svg%3E");
}

/* --- 4. Lannister (Tribunal) --- */
.theme-lannister .page-border {
    border-color: #c0392b;
    border-width: 3px;
}

.theme-lannister .corner::after {
    content: "🦁";
    font-size: 1.2rem;
}

.theme-lannister .page-heading {
    color: #c0392b;
}

.theme-lannister .decree-seal {
    color: #d4af37;
}

/* --- 5. Martell (Valorant Roast) --- */
.theme-martell .page-border {
    border-color: #d35400;
}

.theme-martell .corner::after {
    content: "☀";
    color: #d35400;
    font-size: 1.4rem;
}

.theme-martell .gaming-heading {
    color: #e67e22;
}

/* --- 6. The Wall (Rank) --- */
.theme-wall .page-border {
    border-color: #bdc3c7;
    background: linear-gradient(to bottom, rgba(44, 62, 80, 0.05), rgba(44, 62, 80, 0.2));
}

.theme-wall .corner::after {
    content: "❄";
    color: #bdc3c7;
    font-size: 1.4rem;
}

.theme-wall .page-heading {
    color: #2c3e50;
    text-shadow: 0 0 2px #fff;
}

.theme-wall .wanted-header {
    background: #2c3e50;
    color: #fff;
}

/* --- 7. Varys (Message) --- */
.theme-varys .page-border {
    border-color: #8e44ad;
}

.theme-varys .corner::after {
    content: "🕸";
    color: #2c3e50;
    font-size: 1.4rem;
}

.theme-varys .gaming-intro {
    color: #8e44ad;
    font-style: italic;
}

/* --- 8. Targaryen (Transition) --- */
.theme-targaryen .page-border {
    border-color: #8a0303;
    background: radial-gradient(circle, rgba(138, 3, 3, 0.05), transparent);
}

.theme-targaryen .corner::after {
    content: "🐉";
    color: #8a0303;
    font-size: 1.4rem;
}

.theme-targaryen .transition-text-reveal {
    color: #c0392b;
    text-shadow: 0 0 10px rgba(192, 57, 43, 0.3);
}

/* --- 9. Lannister Gold (Reason) --- */
.theme-lannister-gold .page-border {
    border-color: #f1c40f;
    box-shadow: inset 0 0 15px rgba(241, 196, 15, 0.2);
}

.theme-lannister-gold .corner::after {
    content: "👑";
    filter: hue-rotate(45deg);
    font-size: 1.3rem;
}

.theme-lannister-gold .page-heading {
    color: #b7950b;
}

/* --- 10. Map (Timeline) --- */
.theme-map .page-border {
    border-color: #795548;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(0, 0, 0, 0.03) 20px);
}

.theme-map .corner::after {
    content: "⊕";
    color: #5d4037;
    font-size: 1.2rem;
}

.theme-map .timeline-line {
    background: #795548;
}

/* --- 11. Weirwood (Pact) --- */
.theme-weirwood .page-border {
    border-color: #c0392b;
    background-image: radial-gradient(#c0392b 0.5px, transparent 0.5px);
    background-size: 15px 15px;
    /* Subtle dots */
    background-color: rgba(255, 255, 255, 0.4);
}

.theme-weirwood .corner::after {
    content: "🍂";
    color: #c0392b;
    font-size: 1.2rem;
}

.theme-weirwood .final-title {
    color: #c0392b;
    font-family: 'MedievalSharp';
}

/* --- PARTICLE THEMES (Applied to #embers) --- */
.theme-snow .ember {
    background: #ffffff !important;
    box-shadow: 0 0 4px #a0c4ff !important;
    opacity: 0.8 !important;
}

.theme-gold .ember {
    background: #ffd700 !important;
    box-shadow: 0 0 5px #d4af37 !important;
}

.theme-blood .ember {
    background: #8a0303 !important;
    box-shadow: 0 0 5px #500000 !important;
    opacity: 0.9 !important;
}

.theme-fire .ember {
    /* Default orange/red */
}

/* ========================================
   MEGA EFFECTS STYLES
   ======================================== */

/* ICE WALL */
.ice-wall-container {
    position: relative;
    width: 300px;
    height: 400px;
    /* Adjust based on wanted poster size */
    margin: 0 auto;
}

#iceWall {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    /* Above poster */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23a0c4ff" d="M12,2L15,8L21,9L17,14L18,20L12,17L6,20L7,14L3,9L9,8Z"/></svg>') 12 12, auto;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(160, 196, 255, 0.5);
}

/* DRAGON BREATH */
.dragon-breath-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    mix-blend-mode: screen;
}

/* GOLD COINS */
.coin-particle {
    position: fixed;
    font-size: 20px;
    z-index: 9999;
    pointer-events: none;
    user-select: none;
}

/* ========================================
   LIGHT TOGGLE BUTTON
   ======================================== */
.btn-toggle-light {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #ffd700;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.btn-toggle-light:hover {
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: scale(1.1);
}

/* When lights are on, page backgrounds might need adjustment if they rely on torchlight */
body.lights-on .torchlight {
    opacity: 0 !important;
    pointer-events: none;
}

/* ========================================
   CONTENT EXPANSION (PHASE 8)
   ======================================== */

/* --- A. RELATIONSHIP TIMER (Page 12) --- */
.medieval-timer-container {
    text-align: center;
    margin: 20px auto;
    padding: 15px;
    border: 2px solid #d4af37;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    font-family: 'Uncial Antiqua', cursive;
}

.timer-title {
    color: #d4af37;
    margin-bottom: 15px;
    font-size: 1.4rem;
    text-shadow: 0 2px 4px black;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 5px;
}

.medieval-timer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(20, 20, 20, 0.8);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #8b4513;
    min-width: 60px;
}

.timer-unit span:first-child {
    font-size: 1.5rem;
    color: #ffd700;
    font-weight: bold;
}

.timer-unit .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #aaa;
    margin-top: 5px;
    font-family: 'Cinzel', serif;
}

.timer-subtitle {
    font-size: 0.9rem;
    color: #ccc;
    font-style: italic;
    margin-top: 10px;
}

/* --- B. WHISPERS OF VARYS (Page 9) --- */
.varys-whispers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through, but enable pointer-events on birds */
}

.little-bird {
    position: absolute;
    font-size: 24px;
    cursor: help;
    pointer-events: auto;
    filter: drop-shadow(0 0 5px white);
    transition: transform 0.3s ease;
    animation: floatBird 3s ease-in-out infinite;
    opacity: 0.7;
}

.little-bird:hover {
    transform: scale(1.2) rotate(10deg);
    opacity: 1;
}

.little-bird::after {
    content: attr(data-secret);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #d4af37;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: normal;
    width: max-content;
    max-width: 200px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
    font-family: 'Cinzel', serif;
    pointer-events: none;
    line-height: 1.4;
}

/* Birds on the right side: tooltip goes left */
.little-bird[style*="left: 8"]::after,
.little-bird[style*="left: 9"]::after {
    left: auto;
    right: 0;
    transform: none;
}

/* Birds at top: tooltip goes below */
.little-bird[style*="top: 1"]::after,
.little-bird[style*="top: 0"]::after {
    bottom: auto;
    top: 120%;
}

.little-bird:hover::after {
    opacity: 1;
    visibility: visible;
}

@keyframes floatBird {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* --- C. TYRELL GARDEN (Page 5) --- */
#tyrellGarden {
    position: relative;
    overflow: hidden;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><text y="20" font-size="20">🌹</text></svg>') 10 10, auto;
}

.garden-flower {
    position: absolute;
    font-size: 20px;
    pointer-events: none;
    animation: growFlower 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom center;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    z-index: 5;
}

@keyframes growFlower {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(var(--rot));
        opacity: 1;
    }
}

/* --- D. DRAGON EGG (Page 15) --- */
.dragon-egg-container {
    padding: 15px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.dragon-egg {
    font-size: 4rem;
    transition: transform 0.1s;
    display: inline-block;
    filter: drop-shadow(0 0 10px gold);
}

.dragon-egg:active {
    transform: scale(0.95);
}

.dragon-egg.moved-up {
    margin-bottom: 20px;
    /* Space for the dragon */
    display: block;
    /* Ensure it takes space */
}

.egg-hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
    font-style: italic;
    opacity: 0.7;
}

.dragon-egg.shake {
    animation: eggShake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.dragon-egg.hatching {
    animation: eggHatch 2s forwards;
}

/* ========================================
   PHASE 9: FINAL POLISH ELEMENTS
   ======================================== */

/* --- Wax Seal (Page 3) --- */
.wax-seal-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-right: 40px;
}

.wax-seal {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #ff4d4d, #8a0303);
    border-radius: 50%;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.4),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        inset 2px 2px 4px rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a0000;
    font-size: 30px;
    font-family: 'Cinzel Decorative', cursive;
    transform: rotate(15deg);
    border: 2px dashed rgba(60, 0, 0, 0.2);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s;
}

.wax-seal:hover {
    transform: rotate(15deg) scale(1.05);
}

.wax-seal::after {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    right: 5px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Gaming Stats (Page 6) --- */
.gaming-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #d4af37;
    border-radius: 5px;
}

.stat-box {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 2px;
}

.stat-value {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    color: #ffd700;
    font-family: 'Cinzel', serif;
}

/* --- Classified Stamp (Page 7) --- */
.classified-stamp {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    border: 3px solid #d00;
    color: #d00;
    font-family: 'Black Ops One', 'Courier New', monospace;
    /* Fallback to monospace if specialized font missing */
    font-weight: bold;
    font-size: 2rem;
    padding: 5px 15px;
    text-transform: uppercase;
    opacity: 0.8;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 10;
    mask-image: url('data:image/svg+xml;utf8,<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100%" height="100%" fill="white"/><circle cx="10" cy="10" r="2" fill="black"/><circle cx="50%" cy="50%" r="20" fill="gray" opacity="0.1"/></svg>');
    /* Grungy effect simulation */
    box-shadow: 0 0 0 2px rgba(221, 0, 0, 0.2);
}

/* --- Timeline Stars (Page 13) --- */
.timeline-stars {
    text-align: center;
    color: #ffd700;
    font-size: 1.2rem;
    margin-top: 10px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    from {
        opacity: 0.7;
        text-shadow: 0 0 2px gold;
    }

    to {
        opacity: 1;
        text-shadow: 0 0 10px gold;
    }
}

@keyframes eggShake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes eggHatch {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
        filter: brightness(2) drop-shadow(0 0 20px red);
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* ========================================
   PHASE 9: FINAL POLISH ELEMENTS
   ======================================== */

/* --- Love Potion (Page 5) --- */
.love-potion-recipe {
    margin-top: 25px;
    padding: 20px;
    background: rgba(139, 69, 19, 0.08);
    border: 2px dotted #8b6914;
    border-radius: 10px;
    font-family: 'EB Garamond', serif;
}

.love-potion-recipe h4 {
    color: #6b3a10;
    border-bottom: 1px solid rgba(107, 58, 16, 0.3);
    padding-bottom: 8px;
    margin-bottom: 12px;
    text-align: center;
    font-family: 'Uncial Antiqua', cursive;
    font-size: 1.1rem;
}

.love-potion-recipe ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.love-potion-recipe li {
    margin-bottom: 8px;
    color: #4a3520;
    font-style: italic;
    font-size: 1rem;
}

.love-potion-recipe li::before {
    content: '♥ ';
    color: #8b0000;
}

/* --- Royal Decree Stamp (Page 8) --- */
.decree-stamp-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.royal-decree-stamp {
    border: 3px double #4a0000;
    color: #4a0000;
    padding: 5px 10px;
    font-family: 'Uncial Antiqua', cursive;
    font-weight: bold;
    transform: rotate(-5deg);
    opacity: 0.7;
    mix-blend-mode: multiply;
    font-size: 0.9rem;
    letter-spacing: 1px;
    background: rgba(74, 0, 0, 0.05);
}

/* --- Wax Seal (Page 3) --- */
.wax-seal-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-right: 40px;
}

.wax-seal {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #ff4d4d, #8a0303);
    border-radius: 50%;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.4),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        inset 2px 2px 4px rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a0000;
    font-size: 30px;
    font-family: 'Cinzel Decorative', cursive;
    transform: rotate(15deg);
    border: 2px dashed rgba(60, 0, 0, 0.2);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s;
}

.wax-seal:hover {
    transform: rotate(15deg) scale(1.05);
}

.wax-seal::after {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    right: 5px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Gaming Stats (Page 6) --- */
.gaming-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #d4af37;
    border-radius: 5px;
}

.stat-box {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 2px;
}

.stat-value {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    color: #ffd700;
    font-family: 'Cinzel', serif;
}

/* --- Classified Stamp (Page 7) --- */
.classified-stamp {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    border: 3px solid #d00;
    color: #d00;
    font-family: 'Black Ops One', 'Courier New', monospace;
    /* Fallback to monospace if specialized font missing */
    font-weight: bold;
    font-size: 2rem;
    padding: 5px 15px;
    text-transform: uppercase;
    opacity: 0.8;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 10;
    mask-image: url('data:image/svg+xml;utf8,<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100%" height="100%" fill="white"/><circle cx="10" cy="10" r="2" fill="black"/><circle cx="50%" cy="50%" r="20" fill="gray" opacity="0.1"/></svg>');
    /* Grungy effect simulation */
    box-shadow: 0 0 0 2px rgba(221, 0, 0, 0.2);
}

/* --- Timeline Stars (Page 13) --- */
.timeline-stars {
    text-align: center;
    color: #ffd700;
    font-size: 1.2rem;
    margin-top: 10px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    from {
        opacity: 0.7;
        text-shadow: 0 0 2px gold;
    }

    to {
        opacity: 1;
        text-shadow: 0 0 10px gold;
    }
}

/* ========================================
   PHASE 10: COMPREHENSIVE CONTENT STYLES
   ======================================== */

/* --- Verdict Box (Page 6) --- */
.verdict-box {
    margin-top: 15px;
    padding: 15px;
    border: 2px solid #8b4513;
    border-radius: 8px;
    background: rgba(139, 69, 19, 0.08);
    text-align: left;
}

.verdict-title {
    color: #6b3a10;
    font-family: 'Uncial Antiqua', cursive;
    margin-bottom: 8px;
    text-align: center;
    font-size: 1rem;
}

.verdict-text {
    font-family: 'EB Garamond', serif;
    font-size: 0.9rem;
    color: #4a3520;
    margin-bottom: 8px;
    line-height: 1.5;
}

.verdict-list {
    list-style-type: none;
    padding: 0;
    margin: 5px 0 0 0;
}

.verdict-list li {
    padding: 4px 0;
    font-family: 'EB Garamond', serif;
    color: #4a3520;
    font-style: italic;
    font-size: 0.9rem;
}

.verdict-list li::before {
    content: '⚔ ';
    color: #8b0000;
}

/* --- Intercepted Footer (Page 8) --- */
.intercepted-footer {
    margin-top: 15px;
    padding: 12px;
    border-top: 1px dashed rgba(139, 69, 19, 0.3);
}

.intercepted-note {
    font-size: 0.85rem;
    color: #6b3a10;
    margin-bottom: 4px;
}

.intercepted-quote {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    color: #4a3520;
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 8px;
}

.intercepted-verdict {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: #6b3a10;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Transition Oath (Page 9) --- */
.transition-oath {
    margin-top: 20px;
    padding: 15px 20px;
    border-left: 3px solid #d4af37;
    border-right: 3px solid #d4af37;
    text-align: center;
}

.oath-text {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 4px 0;
    line-height: 1.6;
}

/* --- Letter P.S. (Page 3) --- */
.letter-ps {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: #6b3a10;
    margin-top: 12px;
    text-align: right;
    padding-right: 20px;
}

/* --- Gaming Stats Improved (Page 6) --- */
.gaming-stats .stat-box {
    padding: 5px 10px;
    min-width: 70px;
}

.gaming-stats .stat-label {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}