/* ==========================================================================
   Somalin Talvimetsän Kultainen Joulukirja 2026
   Aidontuntuinen 3D-kultakantinen satukirja, lämmin pergamenttiaukeama,
   sivunkääntöanimaatio, kultainen lukunauha & mini-interaktiot (0 pop-uppia)
   ========================================================================== */

:root {
    --book-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --book-gold-bright: #fff3b0;
    --book-gold: #d9a426;
    --book-gold-deep: #8f620a;
    --book-parchment: #f6efe0;
    --book-parchment-edge: #e7d9bc;
    --book-ink: #1a2b22;
    --book-ink-muted: #4a5c52;
}

.page-calendar {
    position: relative;
}

.winter-snow-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.calendar-main-shell {
    position: relative;
    z-index: 2;
}

/* Joulukirjan responsiivinen navigaatio (navbar-expand-xl: 1200px rajapinta) */
.calendar-navbar {
    background: rgba(10, 24, 18, 0.88) !important;
    z-index: 1030;
}

.calendar-navbar .btn-primary-custom {
    padding: 0.5rem 1.15rem;
    font-size: 0.84rem;
}

@media (min-width: 1200px) and (max-width: 1359.98px) {
    .calendar-navbar .calendar-nav-list {
        gap: 0.65rem !important;
        font-size: 0.78rem !important;
    }

    .calendar-navbar .nav-link-custom {
        padding-inline: 0.3rem !important;
    }

    .calendar-navbar .btn-primary-custom {
        padding: 0.45rem 0.95rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 1199.98px) {
    .calendar-navbar .navbar-collapse {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 0.65rem;
        padding-bottom: 0.5rem;
    }

    /* Hampurilaisvalikon alavalikot näkyvät selkeästi myös 992–1199px leveydellä */
    .calendar-navbar .nav-item.dropdown .dropdown-menu {
        display: block !important;
        position: static !important;
        float: none !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.15rem 0 0.25rem 1rem !important;
        margin-top: 0 !important;
    }

    .calendar-navbar .nav-item.dropdown .dropdown-menu .dropdown-item {
        color: rgba(255, 255, 255, 0.85) !important;
        padding: 0.35rem 0 !important;
        font-size: 0.82rem;
        text-transform: uppercase;
    }

    .calendar-navbar .nav-item.dropdown .dropdown-menu .dropdown-item:hover,
    .calendar-navbar .nav-item.dropdown .dropdown-menu .dropdown-item.active {
        color: var(--primary) !important;
        background: transparent !important;
    }
}

@media (max-width: 400px) {
    .calendar-navbar .navbar-brand span {
        font-size: 1rem !important;
    }

    .calendar-navbar .lang-btn {
        padding: 0.22rem 0.48rem;
        font-size: 0.68rem;
    }
}

/* Esikatselupalkki (?esikatselu=1) */
.preview-mode-banner {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.16), rgba(17, 212, 147, 0.16));
    border: 1px solid rgba(255, 215, 0, 0.45);
    border-radius: 1rem;
    padding: 0.7rem 1.15rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Hero-alue */
.calendar-hero {
    padding-top: 2.25rem;
    padding-bottom: 1.25rem;
}

.calendar-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.32);
}

.book-hero-title {
    font-family: var(--book-serif);
    font-size: clamp(1.9rem, 3.2vw, 2.85rem);
    font-weight: 700;
    line-height: 1.14;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.calendar-hero-lead {
    color: #f4f9f6;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

.calendar-tip-text {
    color: #f3f8f5;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.78);
}

.calendar-tip-text strong {
    color: #ffd700;
}

/* Joulurauha vs. Somalikaaos -mittari */
.chaos-meter-card {
    max-width: 52rem;
    margin: 0 auto;
    padding: 1rem 1.35rem;
    border-radius: 1.15rem;
    background: rgba(10, 25, 18, 0.84);
    border: 1px solid rgba(217, 164, 38, 0.32);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.chaos-meter-track {
    height: 0.65rem;
    border-radius: 50rem;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chaos-meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 50rem;
    background: linear-gradient(90deg, #11d493 0%, #86efc8 48%, #ffd700 84%, #ffae00 100%);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.68rem;
    border-radius: 50rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: rgba(244, 250, 247, 0.9);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-sound-toggle:hover,
.btn-sound-toggle:focus-visible {
    border-color: rgba(255, 215, 0, 0.65);
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    outline: none;
}

.btn-sound-toggle[aria-pressed="false"] {
    opacity: 0.66;
}

/* Kaksikielinen kielivalitsin (FI | EN) – erottuva kulta-smaragdipilleri */
.lang-switch-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 50rem;
    background: rgba(9, 25, 18, 0.88);
    border: 1px solid rgba(255, 215, 0, 0.48);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    gap: 2px;
}

.lang-btn {
    border: none;
    background: transparent;
    color: rgba(244, 250, 247, 0.85);
    font-family: 'Manrope', sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.65rem;
    border-radius: 50rem;
    cursor: pointer;
    transition: all 0.22s ease;
    line-height: 1.1;
}

.lang-btn:hover,
.lang-btn:focus-visible {
    color: #ffd700;
    outline: none;
}

.lang-btn.is-active {
    background: linear-gradient(135deg, #fff3b0 0%, #ffd700 55%, #e5a91a 100%);
    color: #132219 !important;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.45);
}

.lang-switch-compact {
    padding: 2px;
}

.lang-switch-compact .lang-btn {
    padding: 0.2rem 0.54rem;
    font-size: 0.72rem;
}

.countdown-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.22rem 0.75rem;
    border-radius: 50rem;
    background: rgba(255, 215, 0, 0.09);
    border: 1px solid rgba(255, 215, 0, 0.28);
    color: #ffe89e;
    font-size: 0.77rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.countdown-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.9);
    animation: dotBreath 2.2s ease-in-out infinite;
}

@keyframes dotBreath {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.btn-gold-outline {
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.55);
    background: rgba(255, 215, 0, 0.08);
    border-radius: 50rem;
    font-weight: 700;
    padding: 0.38rem 0.95rem;
    transition: all 0.25s ease;
}

.btn-gold-outline:hover,
.btn-gold-outline:focus {
    background: linear-gradient(135deg, #ffd700, #ffae00);
    color: #0e1f16;
    border-color: #ffd700;
}

/* ==========================================================================
   Kultainen 24 luvun kirjanmerkkinauha (1–24)
   ========================================================================== */
.chapter-ribbon-wrap {
    max-width: 68rem;
    margin: 0 auto;
    padding: 0.7rem 0.9rem;
    border-radius: 1.1rem;
    background: rgba(9, 23, 17, 0.78);
    border: 1px solid rgba(217, 164, 38, 0.28);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.chapter-ribbon {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.45rem;
}

.chapter-seal {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0;
    border-radius: 0.65rem;
    border: 1px solid rgba(217, 164, 38, 0.26);
    background: linear-gradient(155deg, rgba(18, 46, 34, 0.92), rgba(9, 24, 18, 0.95));
    color: #f3ead3;
    font-family: var(--book-serif);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    overflow: hidden;
}

.chapter-seal:hover,
.chapter-seal:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4), 0 0 14px rgba(255, 215, 0, 0.2);
    outline: none;
}

.chapter-seal-sub {
    font-family: 'Manrope', sans-serif;
    font-size: 0.54rem;
    line-height: 1;
    opacity: 0.75;
    margin-top: -1px;
}

.chapter-seal.is-locked {
    opacity: 0.68;
    border-color: rgba(185, 224, 220, 0.18);
    background: rgba(12, 27, 23, 0.8);
}

.chapter-seal.is-opened {
    border-color: rgba(217, 164, 38, 0.55);
    background: linear-gradient(145deg, rgba(24, 68, 48, 0.92), rgba(14, 39, 28, 0.96));
    color: #ffe89e;
}

.chapter-seal.is-active {
    background: linear-gradient(135deg, #fff3b0 0%, #e5b228 55%, #b87c0c 100%) !important;
    color: #16241c !important;
    border-color: #fff6c9 !important;
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.65), 0 6px 14px rgba(0, 0, 0, 0.45);
    transform: translateY(-2px) scale(1.05);
}

/* Kimmeltävä kultakiilto nykyiselle / alkavalle luukulle ("missä mennään") */
.chapter-seal.is-beacon:not(.is-active) {
    opacity: 1;
    border-color: #ffd700;
    color: #fff5c0;
    background: linear-gradient(145deg, rgba(64, 52, 16, 0.94), rgba(18, 48, 34, 0.96));
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.5), inset 0 0 10px rgba(255, 215, 0, 0.18);
    animation: beaconGlow 2.8s ease-in-out infinite;
}

.chapter-seal.is-beacon::after,
.chapter-seal.is-active::after {
    content: '';
    position: absolute;
    top: -40%;
    left: -130%;
    width: 85%;
    height: 180%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 38%,
        rgba(255, 250, 210, 0.65) 50%,
        rgba(255, 255, 255, 0.08) 62%,
        transparent 100%
    );
    transform: rotate(16deg);
    animation: sealGoldSweep 3.1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sealGoldSweep {
    0% { left: -130%; }
    45%, 100% { left: 155%; }
}

@keyframes beaconGlow {
    0%, 100% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.4), inset 0 0 8px rgba(255, 215, 0, 0.15); }
    50% { box-shadow: 0 0 26px rgba(255, 215, 0, 0.8), inset 0 0 14px rgba(255, 215, 0, 0.3); }
}

.chapter-seal.is-today:not(.is-active) {
    border-color: #ffd700;
}

.chapter-seal.is-fi:not(.is-active) {
    border-color: rgba(115, 185, 255, 0.55);
}

.chapter-seal.is-finale:not(.is-active) {
    border-color: rgba(255, 215, 0, 0.75);
}

.chapter-seal.is-shaking {
    animation: sealShake 0.4s ease;
}

@keyframes sealShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

.seal-scratch-svg {
    position: absolute;
    inset: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    pointer-events: none;
}

/* ==========================================================================
   KIRJAN NÄYTTÄMÖ: Suljettu kultainen kansi → Avoin 2-sivuinen satukirja
   ========================================================================== */
.book-viewport {
    position: relative;
    max-width: 70rem;
    margin: 0 auto;
    perspective: 2200px;
}

.book-viewport.is-closed .open-book-wrap {
    display: none;
}

.book-viewport.is-open .closed-book-wrap {
    display: none;
}

/* 1. SULJETTU AIDONTUNTUINEN KULTAINEN KIRJA */
.closed-book-wrap {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0 2.5rem;
}

.closed-book {
    position: relative;
    width: min(92vw, 430px);
    min-height: 560px;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: rotateY(-8deg) rotateX(2deg);
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
    filter: drop-shadow(0 32px 46px rgba(0, 0, 0, 0.68));
}

.closed-book:hover,
.closed-book:focus-visible {
    transform: rotateY(-14deg) rotateX(3deg) translateY(-6px);
    outline: none;
}

.closed-book.is-opening {
    transform: rotateY(-148deg) scale(1.04);
    opacity: 0;
    transition: transform 0.72s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.62s ease;
}

/* Kullattu sivupakka kirjan oikeassa reunassa */
.closed-book-pages {
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: -18px;
    width: 22px;
    border-radius: 0 5px 5px 0;
    background:
        repeating-linear-gradient(
            to right,
            #f3e6c8 0px,
            #f3e6c8 2px,
            #c7a665 2px,
            #c7a665 3.2px
        );
    box-shadow: inset 3px 0 6px rgba(0, 0, 0, 0.35), 4px 0 12px rgba(0, 0, 0, 0.45);
}

/* Kohokuvioitu nahkaselkämys vasemmassa reunassa */
.closed-book-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -18px;
    width: 26px;
    border-radius: 10px 0 0 10px;
    background: linear-gradient(90deg, #06140d 0%, #163b28 45%, #0c2317 85%, #05100a 100%);
    border-left: 1px solid rgba(255, 215, 0, 0.32);
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    padding: 2.5rem 0;
    box-shadow: inset -4px 0 10px rgba(0, 0, 0, 0.55);
}

.spine-rib {
    display: block;
    height: 7px;
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.55), rgba(145, 98, 12, 0.85), rgba(0, 0, 0, 0.5));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

/* Silkkikirjanmerkki alareunasta */
.closed-book-ribbon {
    position: absolute;
    bottom: -44px;
    left: 24%;
    width: 30px;
    height: 54px;
    background: linear-gradient(180deg, #8b1e24 0%, #c0392b 55%, #7a141b 100%);
    border-left: 2px solid rgba(255, 215, 0, 0.7);
    border-right: 2px solid rgba(255, 215, 0, 0.7);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
    z-index: -1;
}

/* Kultakohokuvioitu etukansi (nahkatekstuuri + kultafolio) */
.closed-book-cover {
    position: relative;
    width: 100%;
    min-height: 560px;
    padding: 2.5rem 2rem;
    border-radius: 6px 16px 16px 6px;
    background:
        radial-gradient(circle at 25% 20%, rgba(255, 215, 0, 0.14), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(17, 212, 147, 0.1), transparent 50%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 2px, transparent 2px, transparent 5px),
        linear-gradient(150deg, #133926 0%, #0b2418 48%, #071710 100%);
    border: 2px solid rgba(229, 184, 50, 0.72);
    box-shadow:
        inset 14px 0 22px rgba(0, 0, 0, 0.55),
        inset -2px 0 6px rgba(255, 240, 175, 0.22),
        0 0 36px rgba(217, 164, 38, 0.22);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.cover-gold-border {
    position: absolute;
    inset: 14px;
    border: 1.5px solid rgba(229, 184, 50, 0.45);
    border-radius: 4px 10px 10px 4px;
    box-shadow: inset 0 0 0 4px rgba(10, 28, 19, 0.8), inset 0 0 0 5px rgba(229, 184, 50, 0.24);
    pointer-events: none;
}

.cover-corner {
    position: absolute;
    width: 52px;
    height: 52px;
    pointer-events: none;
}

.corner-tl { top: 10px; left: 10px; }
.corner-tr { top: 10px; right: 10px; transform: scaleX(-1); }
.corner-bl { bottom: 10px; left: 10px; transform: scaleY(-1); }
.corner-br { bottom: 10px; right: 10px; transform: scale(-1, -1); }

.cover-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
}

.cover-star-crest {
    width: 78px;
    height: 78px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 16px rgba(255, 215, 0, 0.42));
}

.cover-edition {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #e9c46a;
    margin-bottom: 0.6rem;
}

.cover-main-title {
    font-family: var(--book-serif);
    font-size: 2.35rem;
    font-weight: 700;
    line-height: 1.08;
    background: linear-gradient(180deg, #fff9d6 0%, #f1c64c 48%, #b98212 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
    margin-bottom: 0.75rem;
}

.cover-main-title span {
    font-size: 2.85rem;
    font-style: italic;
}

.cover-divider {
    position: relative;
    width: 150px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5b832;
    margin-bottom: 0.9rem;
}

.cover-divider::before,
.cover-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(229, 184, 50, 0.75), transparent);
}

.cover-divider span {
    padding: 0 0.5rem;
    font-size: 0.85rem;
}

.cover-subtitle {
    font-family: var(--book-serif);
    font-size: 1.15rem;
    font-style: italic;
    color: rgba(246, 238, 218, 0.86);
    line-height: 1.45;
    margin-bottom: 1.35rem;
}

.cover-authors {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(233, 196, 106, 0.85);
    margin-bottom: 1.8rem;
}

.cover-open-clasp {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.65rem;
    border-radius: 50rem;
    font-size: 0.9rem;
    font-weight: 800;
    color: #132219;
    background: linear-gradient(135deg, #fff5be 0%, #f1c139 50%, #cc8d10 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 22px rgba(255, 215, 0, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.closed-book:hover .cover-open-clasp {
    transform: scale(1.04);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 32px rgba(255, 215, 0, 0.65);
}

.clasp-arrow {
    transition: transform 0.25s ease;
}

.closed-book:hover .clasp-arrow {
    transform: translateX(4px);
}

/* ==========================================================================
   2. AVOIN 2-SIVUINEN KULTAINEN JOULUKIRJA (Lämmin pergamenttipaperi)
   ========================================================================== */
.open-book-wrap {
    animation: bookUnfoldIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes bookUnfoldIn {
    0% { opacity: 0; transform: scale(0.95) rotateX(6deg); }
    100% { opacity: 1; transform: scale(1) rotateX(0deg); }
}

.open-book-board {
    position: relative;
    padding: 13px 16px 15px;
    border-radius: 14px;
    background: linear-gradient(145deg, #163d29 0%, #0b2317 50%, #091b12 100%);
    border: 2px solid rgba(229, 184, 50, 0.72);
    box-shadow:
        0 30px 65px rgba(0, 0, 0, 0.68),
        0 0 42px rgba(217, 164, 38, 0.16),
        inset 0 1px 0 rgba(255, 245, 200, 0.25);
}

/* Paperipakkojen paksuus sivuilla */
.page-stack-left,
.page-stack-right {
    position: absolute;
    top: 18px;
    bottom: 20px;
    width: 11px;
    z-index: 1;
    pointer-events: none;
}

.page-stack-left {
    left: 6px;
    border-radius: 5px 0 0 5px;
    background: repeating-linear-gradient(to right, #cbb68a 0px, #cbb68a 1.5px, #efe4ca 1.5px, #efe4ca 3px);
    box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.25);
}

.page-stack-right {
    right: 6px;
    border-radius: 0 5px 5px 0;
    background: repeating-linear-gradient(to left, #cbb68a 0px, #cbb68a 1.5px, #efe4ca 1.5px, #efe4ca 3px);
    box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.25);
}

.book-spread {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 590px;
    border-radius: 7px;
    overflow: hidden;
    perspective: 1800px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Keskitaite ja sidonnan syvä varjostus */
.book-gutter {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 58px;
    transform: translateX(-50%);
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(38, 28, 14, 0.08) 25%,
        rgba(28, 19, 8, 0.26) 46%,
        rgba(18, 12, 4, 0.38) 50%,
        rgba(28, 19, 8, 0.22) 55%,
        rgba(38, 28, 14, 0.06) 78%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 6;
}

/* Silkkikirjanmerkki keskitaiteessa */
.book-silk-bookmark {
    position: absolute;
    top: -13px;
    left: calc(50% - 11px);
    width: 22px;
    height: 76px;
    background: linear-gradient(180deg, #7a141b 0%, #b52b34 65%, #841920 100%);
    border-left: 1.5px solid rgba(255, 215, 0, 0.65);
    border-right: 1.5px solid rgba(255, 215, 0, 0.65);
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
    z-index: 7;
    pointer-events: none;
}

/* 3D-sivunkääntölehti */
.page-turn-leaf {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 9;
    pointer-events: none;
    opacity: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: linear-gradient(90deg, #efe4ca 0%, #faf5e8 50%, #e4d4b2 100%);
    box-shadow: 0 0 28px rgba(0, 0, 0, 0.32);
}

.page-turn-leaf.flip-next {
    right: 0;
    transform-origin: left center;
    animation: turnLeafNext 0.55s cubic-bezier(0.45, 0.05, 0.35, 1);
}

.page-turn-leaf.flip-prev {
    left: 0;
    transform-origin: right center;
    animation: turnLeafPrev 0.55s cubic-bezier(0.45, 0.05, 0.35, 1);
}

@keyframes turnLeafNext {
    0% { opacity: 0.96; transform: rotateY(0deg); }
    50% { opacity: 0.98; box-shadow: -14px 0 34px rgba(0, 0, 0, 0.35); }
    100% { opacity: 0; transform: rotateY(-180deg); }
}

@keyframes turnLeafPrev {
    0% { opacity: 0.96; transform: rotateY(0deg); }
    50% { opacity: 0.98; box-shadow: 14px 0 34px rgba(0, 0, 0, 0.35); }
    100% { opacity: 0; transform: rotateY(180deg); }
}

/* Lämpimät pergamenttisivut */
.book-page {
    position: relative;
    padding: 1.55rem 1.8rem 1.25rem;
    color: var(--book-ink);
    display: flex;
    flex-direction: column;
}

.book-page-left {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.55), transparent 60%),
        linear-gradient(90deg, #ece0c6 0%, #f8f2e4 10%, #f7f0e0 86%, #e7d8b8 100%);
    padding-right: 2.35rem;
}

.book-page-right {
    background:
        radial-gradient(circle at 80% 25%, rgba(255, 255, 255, 0.55), transparent 60%),
        linear-gradient(90deg, #e7d8b8 0%, #f7f0e0 14%, #f8f2e4 90%, #ece0c6 100%);
    padding-left: 2.35rem;
}

.page-inner-frame {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(184, 134, 11, 0.32);
    border-radius: 4px;
    padding: 1rem 1.2rem 0.85rem;
    box-shadow: inset 0 0 0 3px rgba(247, 240, 224, 0.85), inset 0 0 0 4px rgba(184, 134, 11, 0.14);
}

.page-running-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.6rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid rgba(168, 124, 24, 0.26);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b5322;
}

.page-head-gold {
    color: #9e6d09;
    font-weight: 800;
}

.page-chapter-badge {
    display: inline-block;
    padding: 0.18rem 0.65rem;
    border-radius: 50rem;
    background: rgba(184, 134, 11, 0.14);
    border: 1px solid rgba(184, 134, 11, 0.35);
    color: #7c5200;
    font-size: 0.68rem;
    font-weight: 800;
}

.btn-book-text-link {
    background: none;
    border: none;
    padding: 0.15rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b5322;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.btn-book-text-link:hover {
    color: #16291f;
    background: rgba(184, 134, 11, 0.14);
}

.book-left-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-right-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Tarinasivun typografia (aito satukirjatuntu!) */
.story-chapter-kicker {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8f620a;
    margin-bottom: 0.35rem;
}

.story-chapter-title {
    font-family: var(--book-serif);
    font-size: clamp(1.65rem, 2.3vw, 2.2rem);
    font-weight: 700;
    line-height: 1.15;
    color: #13281d;
    margin-bottom: 0.85rem;
}

.story-ornament-rule {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    color: #b8860b;
    font-size: 0.82rem;
}

.story-ornament-rule::before,
.story-ornament-rule::after {
    content: '';
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, rgba(184, 134, 11, 0.55), transparent);
}

.door-story-text {
    font-size: 0.99rem;
    line-height: 1.78;
    color: #1f3328;
}

.door-story-text.has-dropcap::first-letter {
    font-family: var(--book-serif);
    float: left;
    font-size: 3.35rem;
    line-height: 0.82;
    font-weight: 700;
    padding-right: 0.45rem;
    padding-top: 0.18rem;
    color: #9e6d09;
}

/* Sivunumerot alhaalla */
.page-folio {
    margin-top: 0.75rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(168, 124, 24, 0.18);
    text-align: center;
    font-family: var(--book-serif);
    font-size: 0.95rem;
    font-style: italic;
    color: #7c6230;
}

/* Alapalkin sivunkääntö- ja jakopainikkeet */
.book-page-controls {
    margin-top: 1.25rem;
    padding-top: 0.85rem;
    border-top: 1px dashed rgba(168, 124, 24, 0.34);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.btn-page-turn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.95rem;
    border-radius: 50rem;
    border: 1px solid rgba(158, 109, 9, 0.55);
    background: linear-gradient(180deg, #fffaf0 0%, #efe2c4 100%);
    color: #182b20;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(60, 42, 10, 0.14);
    transition: all 0.2s ease;
}

.btn-page-turn:hover:not(:disabled),
.btn-page-turn:focus-visible:not(:disabled) {
    background: linear-gradient(135deg, #f5cb4d 0%, #d49a1a 100%);
    border-color: #9e6d09;
    color: #102017;
    transform: translateY(-1px);
    outline: none;
}

.btn-page-turn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-book-share {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.42rem 0.9rem;
    border-radius: 50rem;
    border: 1px solid rgba(17, 138, 95, 0.45);
    background: rgba(17, 168, 114, 0.12);
    color: #0e593e;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-book-share:hover,
.btn-book-share:focus-visible {
    background: #118a5f;
    color: #ffffff;
    outline: none;
}

/* ==========================================================================
   Vasen sivu: Kuvalaatta (Bookplate-kehys) & erikoiskomponentit
   ========================================================================== */
.door-photo-frame {
    position: relative;
    border-radius: 0.65rem;
    overflow: hidden;
    background: #10261b;
    border: 2px solid #c99a2e;
    box-shadow:
        0 0 0 4px #f7f0e0,
        0 0 0 5px rgba(184, 134, 11, 0.42),
        0 14px 28px rgba(32, 22, 8, 0.24);
}

.door-photo-frame.frame-independence {
    border-color: #003580;
    box-shadow:
        0 0 0 4px #f7f0e0,
        0 0 0 5px rgba(0, 53, 128, 0.42),
        0 14px 28px rgba(10, 26, 54, 0.24);
}

.door-photo-frame.frame-finale {
    border-color: #d49a1a;
    box-shadow:
        0 0 0 4px #fff8e3,
        0 0 0 6px rgba(212, 154, 26, 0.6),
        0 16px 32px rgba(60, 40, 6, 0.28);
}

.door-photo-frame img {
    display: block;
    width: 100%;
    max-height: 410px;
    object-fit: contain;
    margin: 0 auto;
    background: radial-gradient(circle at center, #183d2b 0%, #0b1e15 100%);
}

.door-photo-credit {
    position: absolute;
    right: 0.55rem;
    bottom: 0.5rem;
    padding: 0.16rem 0.55rem;
    border-radius: 50rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(8, 20, 14, 0.76);
}

.photo-safety-badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.3rem 0.7rem;
    border-radius: 50rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: #0b2419;
    background: linear-gradient(135deg, #11d493, #7ef5c9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Luukku 5 (Parikuva) & Luukku 9 (Neljän värin kollaasi) */
.somali-collage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
}

.somali-collage-card {
    border-radius: 0.55rem;
    overflow: hidden;
    background: #13281d;
    border: 1.5px solid #c99a2e;
    box-shadow: 0 6px 16px rgba(32, 22, 8, 0.18);
    text-align: center;
}

.somali-collage-card img {
    width: 100%;
    height: 175px;
    object-fit: contain;
    background: #3f4244;
    padding: 0.3rem;
    display: block;
}

.somali-collage-grid.is-duo {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.somali-collage-grid.is-duo .somali-collage-card img {
    height: auto;
    max-height: 195px;
    aspect-ratio: 1200 / 840;
    object-fit: cover;
    object-position: center 25%;
    background: #0a1f16;
    padding: 0;
}

.somali-collage-card figcaption {
    padding: 0.38rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffe993;
}

.collage-credit-line {
    text-align: right;
    font-size: 0.72rem;
    color: var(--book-ink-muted);
    margin-top: 0.4rem;
    font-style: italic;
}

/* Luukku 6: Itsenäisyyspäivän animoidut sinivalkoiset kynttilät & Suomen lippu */
.fi-celebration-stage {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.8rem;
    border-radius: 0.7rem;
    background: linear-gradient(145deg, #0b2345 0%, #0c223c 60%, #08182e 100%);
    border: 1.5px solid #2b6cb0;
    box-shadow: 0 8px 20px rgba(10, 26, 54, 0.25);
    overflow: hidden;
}

.fi-candle-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
}

.fi-candle-svg {
    width: 54px;
    height: 92px;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.fi-flame-group {
    transform-origin: 35px 28px;
    animation: fiFlameDance 2.1s ease-in-out infinite;
}

.fi-candle-delay .fi-flame-group {
    animation-delay: -0.95s;
}

.fi-flame-halo {
    transform-origin: 35px 24px;
    animation: fiHaloBreath 2.4s ease-in-out infinite;
}

.fi-candle-delay .fi-flame-halo {
    animation-delay: -1.1s;
}

@keyframes fiFlameDance {
    0%, 100% { transform: scale(1, 1) rotate(-2deg); }
    25% { transform: scale(0.95, 1.07) rotate(2.5deg); }
    55% { transform: scale(1.04, 0.96) rotate(-1.5deg); }
    80% { transform: scale(0.97, 1.05) rotate(1.8deg); }
}

@keyframes fiHaloBreath {
    0%, 100% { opacity: 0.78; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.14); }
}

.fi-flag-center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.fi-flag-cloth {
    position: relative;
    width: 112px;
    height: 68px;
    background: #ffffff;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    transform-origin: left center;
    animation: fiFlagWave 3.8s ease-in-out infinite;
}

.fi-cross-h {
    position: absolute;
    left: 0;
    right: 0;
    top: 36.4%;
    height: 27.2%;
    background: #002f6c;
}

.fi-cross-v {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 27.8%;
    width: 16.7%;
    background: #002f6c;
}

.fi-flag-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(0,0,0,0.08) 0%, rgba(255,255,255,0.28) 25%, rgba(0,0,0,0.14) 50%, rgba(255,255,255,0.24) 75%, rgba(0,0,0,0.1) 100%);
    background-size: 200% 100%;
    animation: fiFlagSheen 3.2s linear infinite;
}

@keyframes fiFlagWave {
    0%, 100% { transform: perspective(340px) rotateY(4deg) skewY(-1.2deg); }
    50% { transform: perspective(340px) rotateY(-7deg) skewY(1.6deg); }
}

@keyframes fiFlagSheen {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.fi-flag-caption {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #d9eeff;
    text-align: center;
}

/* Oikean sivun lisäkortit pergamentilla (sanakirja, näyttelytiedot, turva, tarkistuslista) */
.somali-dictionary-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.somali-dict-item {
    padding: 0.65rem 0.85rem;
    border-radius: 0.55rem;
    background: rgba(184, 134, 11, 0.09);
    border-left: 3px solid #b8860b;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.somali-dict-term {
    color: #7c5200;
    font-weight: 800;
    font-size: 0.9rem;
}

.somali-dict-meaning {
    color: #21362b;
    font-size: 0.88rem;
}

.somali-event-card {
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    background: rgba(184, 134, 11, 0.1);
    border: 1px solid rgba(184, 134, 11, 0.42);
}

.somali-event-heading {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8f620a;
    margin-bottom: 0.5rem;
}

.somali-event-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.somali-event-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.65rem;
    font-size: 0.86rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(143, 98, 10, 0.16);
}

.somali-event-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.somali-event-row dt {
    min-width: 7.2rem;
    color: #0e593e;
    font-weight: 800;
    margin: 0;
}

.somali-event-row dd {
    flex: 1 1 11rem;
    color: #1a2b22;
    font-weight: 600;
    margin: 0;
}

.somali-safety-box {
    padding: 0.75rem 0.95rem;
    border-radius: 0.6rem;
    background: rgba(17, 168, 114, 0.13);
    border: 1px solid rgba(17, 138, 95, 0.42);
    color: #0f3d2b;
    font-size: 0.88rem;
}

.somali-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.somali-checklist li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.58rem 0.8rem;
    border-radius: 0.55rem;
    background: rgba(184, 134, 11, 0.08);
    border: 1px solid rgba(184, 134, 11, 0.25);
    font-size: 0.9rem;
}

.checklist-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #118a5f;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}

.checklist-text strong {
    color: #8f620a;
}

/* Interaktioiden yhteistyylit pergamenttikirjassa */
.btn-book-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 50rem;
    border: 1px solid #9e6d09;
    background: linear-gradient(135deg, #f8d466 0%, #d49a1a 100%);
    color: #132219;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(143, 98, 10, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-book-action:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(143, 98, 10, 0.35);
}

.btn-book-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.interactive-reveal-box {
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, rgba(17, 168, 114, 0.14), rgba(217, 164, 38, 0.16));
    border: 1px solid rgba(184, 134, 11, 0.45);
    color: #152b20;
    font-weight: 600;
    font-size: 0.92rem;
    animation: revealFadeIn 0.4s ease;
}

@keyframes revealFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.book-stat-badge {
    display: inline-block;
    padding: 0.28rem 0.8rem;
    border-radius: 50rem;
    background: rgba(184, 134, 11, 0.16);
    border: 1px solid rgba(184, 134, 11, 0.4);
    color: #7c5200;
    font-size: 0.78rem;
    font-weight: 800;
}

/* Interaktio 1 (Luukku 4): Huurteen pyyhkiminen */
.frost-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 0.65rem;
    overflow: hidden;
    border: 2px solid #c99a2e;
    box-shadow: 0 0 0 4px #f7f0e0, 0 12px 24px rgba(32, 22, 8, 0.2);
    background: #0a1f16;
    user-select: none;
}

.frost-under-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.frost-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    transition: opacity 0.6s ease;
}

.frost-canvas.is-cleared {
    opacity: 0;
    pointer-events: none;
}

.frost-hint-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 0.5rem 0.95rem;
    border-radius: 50rem;
    background: rgba(10, 26, 20, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    pointer-events: none;
    text-align: center;
}

/* Interaktio 2 (Luukku 10): Somalin 3D-muistipeli (3 paria aidoilla kuvilla) */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.memory-card {
    position: relative;
    aspect-ratio: 4 / 5;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    perspective: 900px;
}

.memory-card:focus-visible {
    outline: 2px solid #b8860b;
    outline-offset: 3px;
    border-radius: 0.65rem;
}

.memory-card-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 0.65rem;
}

.memory-card.is-flipped .memory-card-inner,
.memory-card.is-matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-face {
    position: absolute;
    inset: 0;
    border-radius: 0.65rem;
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-shadow: 0 8px 18px rgba(32, 22, 8, 0.22);
}

.memory-card-back {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #15402b 0%, #0a2216 100%);
    border: 2px solid #c99a2e;
    box-shadow: inset 0 0 0 4px rgba(10, 34, 22, 0.85), inset 0 0 0 5px rgba(229, 184, 50, 0.35), 0 8px 18px rgba(32, 22, 8, 0.22);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.memory-card:hover:not(.is-flipped):not(.is-matched) .memory-card-back {
    border-color: #ffd700;
}

.memory-back-star {
    font-size: 1.8rem;
    color: #e5b832;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.45);
}

.memory-card-front {
    transform: rotateY(180deg);
    background: #10261b;
    border: 2px solid #c99a2e;
}

.memory-card.is-matched .memory-card-front {
    border-color: #11a872;
    box-shadow: 0 0 0 2px rgba(17, 168, 114, 0.45), 0 8px 18px rgba(17, 138, 95, 0.25);
}

.memory-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    display: block;
}

.memory-card-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.25rem 0.35rem;
    background: linear-gradient(to top, rgba(7, 18, 13, 0.9), transparent);
    color: #fff3b0;
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 575.98px) {
    .memory-grid {
        gap: 0.5rem;
    }

    .memory-card {
        aspect-ratio: 1 / 1.12;
    }
}

/* Interaktio 3 (Luukku 15): Somalipennun kasvutarina (4 aitoa vaihetta) */
.growth-photo-fade {
    animation: growthFadeIn 0.35s ease;
}

@keyframes growthFadeIn {
    from { opacity: 0.35; transform: scale(0.985); }
    to { opacity: 1; transform: scale(1); }
}

.growth-step-pill {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    padding: 0.24rem 0.72rem;
    border-radius: 50rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: #16241c;
    background: linear-gradient(135deg, #fff3b0 0%, #e5b228 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.growth-thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.growth-thumb-btn {
    position: relative;
    padding: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid rgba(184, 134, 11, 0.35);
    background: #10261b;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.growth-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.78;
    transition: opacity 0.2s ease;
}

.growth-thumb-btn span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: rgba(10, 26, 18, 0.85);
    color: #ffd700;
    font-size: 0.68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.growth-thumb-btn:hover,
.growth-thumb-btn.is-active {
    border-color: #b8860b;
    box-shadow: 0 0 0 2px rgba(217, 164, 38, 0.45), 0 6px 14px rgba(32, 22, 8, 0.22);
    transform: translateY(-2px);
}

.growth-thumb-btn:hover img,
.growth-thumb-btn.is-active img {
    opacity: 1;
}

.growth-timeline {
    position: relative;
}

.growth-timeline-track {
    position: absolute;
    top: 15px;
    left: 12%;
    right: 12%;
    height: 3px;
    background: rgba(184, 134, 11, 0.22);
    border-radius: 4px;
    z-index: 0;
}

.growth-timeline-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #118a5f 0%, #d49a1a 100%);
    transition: width 0.35s ease;
}

.growth-timeline-steps {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
}

.growth-step-dot {
    background: none;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    color: #5c4d2d;
}

.growth-step-dot span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--book-serif);
    font-size: 1rem;
    font-weight: 700;
    background: #f8f2e4;
    border: 2px solid rgba(184, 134, 11, 0.45);
    color: #7c5200;
    transition: all 0.22s ease;
}

.growth-step-dot small {
    font-size: 0.67rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
}

.growth-step-dot.is-visited span {
    border-color: #118a5f;
    background: rgba(17, 168, 114, 0.14);
    color: #0e593e;
}

.growth-step-dot.is-active span {
    background: linear-gradient(135deg, #fff3b0 0%, #e5b228 55%, #b87c0c 100%);
    border-color: #9e6d09;
    color: #132219;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4);
}

.growth-step-dot.is-active small {
    color: #13281d;
}

.growth-stage-card {
    padding: 0.9rem 1.05rem;
    border-radius: 0.65rem;
    background: rgba(184, 134, 11, 0.08);
    border: 1px solid rgba(184, 134, 11, 0.3);
}

.growth-stage-heading {
    font-family: var(--book-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: #8f620a;
    margin-bottom: 0.35rem;
}

/* Interaktio 4 (Luukku 20): Somalin Talvitesti */
.quiz-question-title {
    font-weight: 800;
    color: #162b20;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.quiz-option-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.78rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(158, 109, 9, 0.3);
    background: rgba(255, 252, 244, 0.72);
    color: #1b2f24;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option-btn:hover {
    border-color: #b8860b;
    background: rgba(248, 212, 102, 0.2);
}

.quiz-option-btn.is-selected {
    border-color: #118a5f;
    background: rgba(17, 168, 114, 0.16);
    color: #0b3324;
}

.quiz-opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    background: rgba(184, 134, 11, 0.18);
    color: #7c5200;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.quiz-result-title {
    font-family: var(--book-serif);
    font-size: 1.85rem;
    font-weight: 700;
    color: #8f620a;
}

/* Luukku 24: Jouluaaton kultainen yhteenveto */
.finale-summary-card {
    position: relative;
    overflow: hidden;
    padding: 1.05rem 1.1rem;
    border-radius: 0.7rem;
    text-align: center;
    background: linear-gradient(145deg, #123424 0%, #0a2016 100%);
    border: 1.5px solid #d49a1a;
    color: #fffef5;
}

.finale-summary-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #ffe885;
    font-weight: 700;
}

.finale-summary-stat {
    font-family: var(--book-serif);
    font-size: 1.65rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0.15rem 0;
}

.finale-summary-stage {
    font-size: 0.88rem;
    color: #9af7d4;
    font-weight: 600;
}

.finale-starburst {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.finale-star-dot {
    position: absolute;
    top: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, #fffde7, #ffd700);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.85);
    animation: finaleStarFall 3.5s linear infinite;
}

@keyframes finaleStarFall {
    0% { transform: translateY(-10px) scale(0.7); opacity: 0; }
    15% { opacity: 0.95; }
    85% { opacity: 0.8; }
    100% { transform: translateY(150px) scale(1.1); opacity: 0; }
}

/* Kelluva kurkkimisesto-ilmoitus */
.peek-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translate(-50%, 130%);
    z-index: 1080;
    width: min(92vw, 35rem);
    padding: 0.95rem 1.35rem;
    border-radius: 1rem;
    background: rgba(11, 28, 20, 0.96);
    border: 1px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 215, 0, 0.18);
    color: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.peek-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.peek-toast.is-easter-egg {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(38, 32, 10, 0.97), rgba(14, 34, 24, 0.97));
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 28px rgba(255, 215, 0, 0.35);
}

.peek-toast-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Some-jakopalkki (WhatsApp, Facebook, Kopioi linkki & Instagram-kuva) */
.calendar-share-bar {
    max-width: 56rem;
    margin-inline: auto;
    padding: 0.9rem 1.25rem;
    border-radius: 1.15rem;
    background: rgba(10, 25, 18, 0.82);
    border: 1px solid rgba(217, 164, 38, 0.34);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.calendar-share-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.15rem;
}

.calendar-share-title {
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffe89e;
}

.calendar-share-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.btn-social-share {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.44rem 0.95rem;
    border-radius: 50rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    color: #f4faf7;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.btn-social-share:hover,
.btn-social-share:focus-visible {
    transform: translateY(-2px);
    outline: none;
}

.btn-share-wa {
    border-color: rgba(37, 211, 102, 0.5);
    background: rgba(37, 211, 102, 0.14);
    color: #a7f3c5;
}

.btn-share-wa:hover {
    background: #25d366;
    color: #0b2014;
    border-color: #25d366;
}

.btn-share-fb {
    border-color: rgba(59, 130, 246, 0.52);
    background: rgba(59, 130, 246, 0.15);
    color: #bfdbfe;
}

.btn-share-fb:hover {
    background: #1877f2;
    color: #ffffff;
    border-color: #1877f2;
}

.btn-share-copy {
    border-color: rgba(255, 215, 0, 0.48);
    background: rgba(255, 215, 0, 0.1);
    color: #ffe89e;
}

.btn-share-copy:hover {
    background: linear-gradient(135deg, #fff3b0, #ffd700);
    color: #132219;
    border-color: #ffd700;
}

.btn-share-ig {
    border-color: rgba(244, 114, 182, 0.5);
    background: rgba(244, 114, 182, 0.14);
    color: #fbcfe8;
}

.btn-share-ig:hover {
    background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
    color: #ffffff;
    border-color: transparent;
}

/* ==========================================================================
   Responsiivisuus: tabletti & puhelin (Vaihtoehto 1: Aito sidottu yksisivuinen kirja)
   ========================================================================== */
@media (max-width: 991.98px) {
    .chapter-ribbon {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    /* Nahkainen selkämys vasemmalla + paksu paperipakka oikealla */
    .open-book-board {
        position: relative;
        padding: 10px 15px 12px 22px;
        border-radius: 10px 14px 14px 10px;
        box-shadow:
            -4px 0 0 #071710,
            0 24px 48px rgba(0, 0, 0, 0.65),
            0 0 32px rgba(217, 164, 38, 0.16),
            inset 10px 0 18px rgba(0, 0, 0, 0.55);
    }

    /* Vasemman reunan kohokuvioitu nahkaselkämys kultavöillä */
    .open-book-board::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 16px;
        border-radius: 9px 0 0 9px;
        background:
            repeating-linear-gradient(
                to bottom,
                transparent 0px,
                transparent 86px,
                rgba(255, 215, 0, 0.52) 86px,
                rgba(145, 98, 12, 0.85) 91px,
                rgba(0, 0, 0, 0.45) 93px,
                transparent 93px,
                transparent 185px
            ),
            linear-gradient(90deg, #05110b 0%, #173e2a 55%, #091d13 100%);
        border-right: 1px solid rgba(255, 215, 0, 0.28);
        pointer-events: none;
        z-index: 3;
    }

    .page-stack-left {
        display: none;
    }

    /* Oikean reunan kullattu paperisivupakka pysyy näkyvissä */
    .page-stack-right {
        display: block;
        right: 4px;
        top: 15px;
        bottom: 17px;
        width: 11px;
        border-radius: 0 5px 5px 0;
        background: repeating-linear-gradient(to left, #c3a974 0px, #c3a974 1.6px, #f2e7cf 1.6px, #f2e7cf 3.2px);
        box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.28), 2px 0 6px rgba(0, 0, 0, 0.35);
    }

    .book-spread {
        grid-template-columns: 1fr;
        min-height: auto;
        perspective: 1400px;
        border-radius: 3px 8px 8px 3px;
    }

    /* Vasemman reunan syvä kirjansidonnan taitevarjo */
    .book-gutter {
        display: block;
        left: 0;
        transform: none;
        width: 30px;
        background: linear-gradient(
            90deg,
            rgba(18, 12, 4, 0.44) 0%,
            rgba(28, 19, 8, 0.22) 32%,
            rgba(38, 28, 14, 0.06) 68%,
            transparent 100%
        );
    }

    /* Punakultainen silkkikirjanmerkki sidonnan yläreunassa */
    .book-silk-bookmark {
        display: block;
        left: 18px;
        top: -10px;
        width: 18px;
        height: 52px;
    }

    /* Täysi 3D-sivunkääntölehti toimii myös mobiilissa! */
    .page-turn-leaf {
        display: block;
        width: 100%;
        left: 0;
        right: 0;
        transform-origin: left center;
        background: linear-gradient(90deg, #dfd0af 0%, #faf5e8 18%, #f6efe0 88%, #dfcea9 100%);
    }

    .page-turn-leaf.flip-next {
        animation: mobileTurnNext 0.56s cubic-bezier(0.45, 0.05, 0.35, 1);
    }

    .page-turn-leaf.flip-prev {
        animation: mobileTurnPrev 0.56s cubic-bezier(0.45, 0.05, 0.35, 1);
    }

    @keyframes mobileTurnNext {
        0% { opacity: 0.96; transform: rotateY(0deg); }
        50% { opacity: 0.98; box-shadow: -12px 0 30px rgba(0, 0, 0, 0.42); }
        100% { opacity: 0; transform: rotateY(-120deg); }
    }

    @keyframes mobileTurnPrev {
        0% { opacity: 0.96; transform: rotateY(-120deg); }
        50% { opacity: 0.98; box-shadow: -12px 0 30px rgba(0, 0, 0, 0.42); }
        100% { opacity: 0; transform: rotateY(0deg); }
    }

    /* Yhtenäinen pergamenttisivu (ei katkoviivaa, yksi kehys ylhäältä alas) */
    .book-page-left {
        padding: 1.05rem 1rem 0 1.45rem;
        background: linear-gradient(90deg, #e2d1ae 0%, #f6eedb 8%, #f8f2e4 92%, #eadbc0 100%);
    }

    .book-page-right {
        position: relative;
        padding: 0 1rem 1.05rem 1.45rem;
        background: linear-gradient(90deg, #e2d1ae 0%, #f6eedb 8%, #f8f2e4 92%, #eadbc0 100%);
    }

    /* Hento taittuva paperinkulma oikeassa alakulmassa kutsuu kääntämään sivun */
    .book-page-right::after {
        content: '';
        position: absolute;
        right: 0;
        bottom: 0;
        width: 30px;
        height: 30px;
        background: linear-gradient(135deg, transparent 46%, rgba(158, 109, 9, 0.22) 48%, #f9f4e7 52%, #d8c398 100%);
        box-shadow: -2px -2px 6px rgba(45, 32, 10, 0.16);
        border-radius: 4px 0 8px 0;
        pointer-events: none;
        z-index: 4;
    }

    .book-page-left .page-inner-frame {
        border-bottom: none;
        border-radius: 4px 4px 0 0;
        padding-bottom: 0.65rem;
        box-shadow: none;
    }

    .book-page-left .page-folio {
        display: none;
    }

    .book-page-right .page-inner-frame {
        border-top: none;
        border-radius: 0 0 4px 4px;
        padding-top: 0.35rem;
        box-shadow: none;
    }

    .book-page-right .page-running-head {
        margin-bottom: 0.7rem;
        padding-top: 0.35rem;
        border-top: 1px solid rgba(168, 124, 24, 0.16);
    }
}

@media (max-width: 575.98px) {
    .chapter-ribbon {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .chapter-seal {
        height: 40px;
        font-size: 1rem;
    }

    .closed-book,
    .closed-book-cover {
        min-height: 480px;
    }

    .closed-book-cover {
        padding: 1.85rem 1.25rem;
    }

    .cover-main-title {
        font-size: 1.9rem;
    }

    .cover-main-title span {
        font-size: 2.3rem;
    }

    .page-inner-frame {
        padding: 0.8rem 0.85rem 0.7rem;
    }

    .somali-collage-card img {
        height: 140px;
    }

    .fi-candle-svg {
        width: 44px;
        height: 76px;
    }

    .fi-flag-cloth {
        width: 92px;
        height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .countdown-dot,
    .page-turn-leaf,
    .open-book-wrap,
    .finale-star-dot,
    .fi-flame-group,
    .fi-flame-halo,
    .fi-flag-cloth,
    .fi-flag-sheen,
    .chapter-seal.is-beacon,
    .chapter-seal.is-beacon::after,
    .chapter-seal.is-active::after {
        animation: none !important;
        transition: none !important;
    }
}
