/* ==========================================================================
   Valo saapuu maailmaan – Joulukalenteri (sarim/joulukalenteri/style.css)
   Yhtenäinen taivaallinen yönsininen, metsänvihreä ja lämmin kultatyyli
   ========================================================================== */

:root {
    --cal-bg-deep: #070913;
    --cal-bg-forest: #0f1711;
    --cal-bg-indigo: #141c33;
    --accent-gold: #e2c27c;
    --accent-gold-bright: #ffe6a8;
    --accent-gold-deep: #b88b3a;
    --accent-gold-glow: rgba(226, 194, 124, 0.55);
    --finland-blue: #2d74d8;
    --finland-glow: rgba(74, 152, 255, 0.45);
    --glass-bg: rgba(16, 22, 38, 0.58);
    --glass-bg-strong: rgba(12, 17, 30, 0.84);
    --glass-border: rgba(226, 194, 124, 0.22);
    --glass-border-subtle: rgba(255, 255, 255, 0.1);
    --text-primary: #f8f6f0;
    --text-muted: rgba(235, 232, 222, 0.74);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--cal-bg-deep);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(28, 42, 76, 0.78) 0%, transparent 70%),
        radial-gradient(ellipse 65% 45% at 85% 95%, rgba(18, 42, 32, 0.65) 0%, transparent 70%),
        linear-gradient(180deg, #070a16 0%, #0b1120 48%, #0a1411 100%);
    background-attachment: fixed;
}

/* Taustan tähtikangas */
#starfieldCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Lasipaneelit ja navigaatio (yhtenäinen sarim/home.html & mannalappu.html kanssa) */
.glass-panel {
    background: rgba(13, 18, 32, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border-subtle);
}

.navbar .navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    letter-spacing: -0.4px;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: 0.96rem;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--accent-gold-bright) !important;
    text-shadow: 0 0 12px rgba(226, 194, 124, 0.55);
}

.btn-nav-primary {
    background: linear-gradient(135deg, #2D5A27, #3d7a35);
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn-nav-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 90, 39, 0.45);
    filter: brightness(1.08);
}

/* Typografia */
.font-cinzel {
    font-family: 'Cinzel', serif;
}

.font-playfair {
    font-family: 'Playfair Display', serif;
}

.text-gold {
    color: var(--accent-gold) !important;
}

.text-gold-gradient {
    background: linear-gradient(135deg, #fff6dc 0%, #e2c27c 50%, #c89643 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Pääsisältö */
.calendar-main {
    position: relative;
    z-index: 2;
    flex: 1;
    padding-top: 6.75rem;
    padding-bottom: 4rem;
}

/* Esikatselupalkki */
.preview-banner {
    background: linear-gradient(90deg, rgba(226, 194, 124, 0.16), rgba(45, 90, 39, 0.28), rgba(226, 194, 124, 0.16));
    border: 1px solid rgba(226, 194, 124, 0.42);
    border-radius: 1rem;
    padding: 0.75rem 1.25rem;
}

/* Hero-otsikko */
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-gold-bright);
    background: rgba(226, 194, 124, 0.1);
    border: 1px solid rgba(226, 194, 124, 0.3);
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 0 36px rgba(226, 194, 124, 0.32);
}

.hero-subtitle {
    font-family: 'Playfair Display', serif;
    color: var(--text-muted);
    max-width: 40rem;
    margin-inline: auto;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.15rem;
    border-radius: 999px;
    font-size: 0.9rem;
    background: rgba(16, 22, 38, 0.72);
    border: 1px solid rgba(226, 194, 124, 0.26);
    color: var(--text-primary);
}

/* Web Audio API -äänipainike */
.sound-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    background: rgba(16, 22, 38, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-muted);
    transition: all 0.28s ease;
}

.sound-pill:hover {
    border-color: rgba(226, 194, 124, 0.55);
    color: var(--accent-gold-bright);
}

.sound-pill.is-active {
    background: rgba(226, 194, 124, 0.18);
    border-color: var(--accent-gold-bright);
    color: var(--accent-gold-bright);
    box-shadow: 0 0 18px rgba(226, 194, 124, 0.28);
}

/* Rekrytoijan tekninen kortti */
.tech-trigger-btn {
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-size: 0.8rem;
    color: var(--accent-gold-bright);
    background: rgba(226, 194, 124, 0.08);
    border: 1px solid rgba(226, 194, 124, 0.3);
    transition: all 0.25s ease;
}

.tech-trigger-btn:hover {
    background: rgba(226, 194, 124, 0.2);
    border-color: var(--accent-gold-bright);
    color: #fff;
}

.tech-spec-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(226, 194, 124, 0.2);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
}

.tech-spec-card code {
    color: var(--accent-gold-bright);
    background: rgba(226, 194, 124, 0.12);
    padding: 0.08rem 0.35rem;
    border-radius: 0.3rem;
}

.tech-cta-box {
    background: linear-gradient(135deg, rgba(45, 90, 39, 0.26), rgba(226, 194, 124, 0.14));
    border: 1px solid rgba(226, 194, 124, 0.35);
    border-radius: 1rem;
    padding: 1rem 1.2rem;
}

.share-url-input {
    background: rgba(8, 12, 24, 0.85) !important;
    border: 1px solid rgba(226, 194, 124, 0.35) !important;
    color: var(--text-primary) !important;
    font-size: 0.82rem;
}

/* ==========================================================================
   Elävä, päivittäin rakentuva Betlehemin yötaivas (taidemaalauspanoraama)
   ========================================================================== */
.scene-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.bethlehem-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7.2;
    min-height: 270px;
    max-height: 490px;
    background: #060914;
    overflow: hidden;
}

.panorama-stage-img {
    position: absolute;
    inset: -3%;
    width: 106%;
    height: 106%;
    object-fit: cover;
    object-position: center 46%;
    opacity: 0;
    transform: translate3d(var(--px-bg, 0px), var(--py-bg, 0px), 0) scale(1.03);
    transition: opacity 1.45s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    user-select: none;
    will-change: transform, opacity;
}

.panorama-stage-img.is-active {
    opacity: 1;
}

/* Taivaallinen, hengittävä kultainen valonsäde panoraaman ylle */
.panorama-light-beam {
    position: absolute;
    inset: -4%;
    width: 108%;
    height: 108%;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: screen;
    opacity: var(--light-intensity, 0.15);
    transform: translate3d(var(--px-mid, 0px), var(--py-mid, 0px), 0);
    transition: opacity 1.3s ease;
    background:
        radial-gradient(ellipse 42% 38% at 50% 18%, rgba(255, 236, 178, 0.65) 0%, rgba(226, 194, 124, 0.2) 45%, transparent 75%),
        conic-gradient(from 164deg at 50% 16%, transparent 0deg, rgba(255, 232, 168, 0.24) 12deg, rgba(255, 242, 200, 0.36) 16deg, rgba(255, 232, 168, 0.18) 22deg, transparent 34deg);
    animation: beamShimmer 7s ease-in-out infinite alternate;
    will-change: transform;
}

/* Pehmeä vinjetti reunoille ja alaosan luettavuudelle */
.panorama-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background:
        linear-gradient(180deg, rgba(6, 9, 20, 0.36) 0%, transparent 22%, transparent 66%, rgba(6, 9, 20, 0.84) 100%),
        radial-gradient(ellipse 90% 90% at 50% 50%, transparent 62%, rgba(5, 8, 17, 0.52) 100%);
}

/* Automaattisesti ilmestyvä taivaallinen valoenkeli yötaivaalla */
.panorama-angel-wrap {
    position: absolute;
    top: 4%;
    right: 9%;
    width: clamp(120px, 21vw, 240px);
    aspect-ratio: 1 / 1;
    z-index: 3;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0;
    transform: translate3d(var(--px-mid, 0px), calc(var(--py-mid, 0px) + 14px), 0) scale(0.92);
    transition: opacity 2s cubic-bezier(0.22, 1, 0.36, 1), transform 2s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

.panorama-angel-wrap.is-visible {
    opacity: 0.92;
    transform: translate3d(var(--px-mid, 0px), var(--py-mid, 0px), 0) scale(1);
}

.panorama-angel-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: contrast(1.16) brightness(1.06) drop-shadow(0 0 22px rgba(255, 232, 170, 0.5));
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 50%, rgba(0, 0, 0, 0.82) 66%, transparent 80%);
    mask-image: radial-gradient(circle at 50% 45%, #000 50%, rgba(0, 0, 0, 0.82) 66%, transparent 80%);
    animation: angelFloat 6.5s ease-in-out infinite alternate;
}

.angel-whisper-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    max-width: min(94%, 520px);
    padding: 0.48rem 1.15rem;
    border-radius: 999px;
    font-size: 0.92rem;
    line-height: 1.35;
    color: #fff5d9;
    background: rgba(16, 22, 38, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 232, 170, 0.44);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 18px rgba(226, 194, 124, 0.14);
    animation: whisperFadeIn 0.8s ease;
}

@keyframes whisperFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes angelFloat {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-9px) scale(1.025); }
}

/* Elävä tähti- ja kultahippucanvas panoraaman päällä */
.panorama-fx-canvas {
    position: absolute;
    inset: -4%;
    width: 108%;
    height: 108%;
    pointer-events: none;
    z-index: 4;
    transform: translate3d(var(--px-fg, 0px), var(--py-fg, 0px), 0);
    will-change: transform;
}

/* Ylävasemman luku-merkki */
.panorama-chapter-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--accent-gold-bright);
    background: rgba(8, 12, 24, 0.68);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 194, 124, 0.36);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* Alareunan 4 vaiheen napit */
.panorama-chapters-bar {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0.95rem;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}

.chapter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(8, 12, 24, 0.66);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(240, 236, 224, 0.62);
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.28s ease;
}

.chapter-pill .chapter-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
}

.chapter-pill.is-unlocked {
    color: rgba(248, 244, 234, 0.9);
    border-color: rgba(226, 194, 124, 0.36);
}

.chapter-pill.is-unlocked .chapter-dot {
    background: var(--accent-gold);
    box-shadow: 0 0 8px rgba(226, 194, 124, 0.8);
}

.chapter-pill.is-active {
    color: #fff6dc;
    background: rgba(226, 194, 124, 0.24);
    border-color: var(--accent-gold-bright);
    box-shadow: 0 4px 18px rgba(226, 194, 124, 0.28);
}

.chapter-pill.is-active .chapter-dot {
    background: #fff6dc;
    box-shadow: 0 0 10px #fff2c2;
}

.chapter-pill:hover {
    border-color: rgba(226, 194, 124, 0.65);
    color: #fff;
}

@keyframes slowPanoramaBreath {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.045);
    }
}

@keyframes beamShimmer {
    0% {
        filter: brightness(0.92);
    }

    100% {
        filter: brightness(1.16);
    }
}

.scene-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}

.scene-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #b88b3a, #e2c27c, #fff0c2);
    box-shadow: 0 0 14px rgba(226, 194, 124, 0.7);
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   4 Syttyvää Adventtikynttilää
   ========================================================================== */
.advent-section-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.75rem 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.advent-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.candle-card {
    position: relative;
    background: rgba(10, 15, 28, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    padding: 1.25rem 0.75rem 1rem;
    text-align: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 235px;
    width: 100%;
}

.candle-card:hover {
    transform: translateY(-4px);
    border-color: rgba(226, 194, 124, 0.45);
}

.candle-card.is-lit {
    border-color: rgba(226, 194, 124, 0.55);
    background: radial-gradient(circle at 50% 25%, rgba(226, 194, 124, 0.16), rgba(10, 15, 28, 0.78) 72%);
    box-shadow: 0 12px 32px rgba(226, 194, 124, 0.14);
}

.candle-card.is-finland.is-lit {
    border-color: rgba(114, 178, 255, 0.62);
    background: radial-gradient(circle at 50% 25%, rgba(74, 152, 255, 0.2), rgba(10, 15, 28, 0.8) 72%);
    box-shadow: 0 12px 32px rgba(74, 152, 255, 0.2);
}

.candle-card.is-locked {
    opacity: 0.72;
}

.candle-visual {
    position: relative;
    height: 112px;
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0.85rem;
}

.candle-flame-wrap {
    position: relative;
    width: 24px;
    height: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: -1px;
}

/* Liekin pehmeä hehku suoraan liekin keskipisteessä */
.candle-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.35);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 228, 145, 0.72) 0%, rgba(255, 175, 64, 0.26) 44%, transparent 72%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.candle-card.is-lit .candle-halo {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: haloPulse 3.2s ease-in-out infinite;
}

/* Liekki */
.candle-flame {
    position: relative;
    width: 15px;
    height: 30px;
    border-radius: 50% 50% 45% 45% / 68% 68% 32% 32%;
    background: radial-gradient(circle at 50% 74%, #ffffff 0%, #fff4b8 34%, #ffb73b 70%, rgba(255, 118, 0, 0.9) 100%);
    box-shadow: 0 0 14px rgba(255, 206, 86, 0.95), 0 0 34px rgba(255, 162, 46, 0.55);
    opacity: 0;
    transform: scaleY(0.15);
    transform-origin: bottom center;
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.candle-flame::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 11px;
    border-radius: 50% 50% 45% 45%;
    background: radial-gradient(circle at 50% 75%, rgba(125, 185, 255, 0.75) 0%, #ffffff 65%, transparent 100%);
}

.candle-card.is-lit .candle-flame {
    opacity: 1;
    transform: scaleY(1);
    animation: flameFlicker 2.4s ease-in-out infinite;
}

.candle-card:nth-child(2) .candle-flame { animation-delay: -0.6s; }
.candle-card:nth-child(3) .candle-flame { animation-delay: -1.3s; }
.candle-card:nth-child(4) .candle-flame { animation-delay: -1.9s; }

.candle-wick {
    width: 2px;
    height: 7px;
    background: #2b241d;
    border-radius: 2px;
}

.candle-wax {
    width: 30px;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(90deg, #d7c7a8 0%, #faf3e3 36%, #e7d8bc 72%, #b59f7c 100%);
    box-shadow: inset 0 3px 6px rgba(255, 255, 255, 0.55), 0 6px 14px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
}

.candle-card.is-lit .candle-wax::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 16px;
    background: linear-gradient(180deg, rgba(255, 214, 118, 0.52), transparent);
    pointer-events: none;
}

/* 2. adventin sinivalkoinen kynttilä (Suomen itsenäisyyspäivä) */
.candle-card.is-finland .candle-wax {
    background: linear-gradient(180deg, #f8fbff 0%, #f1f6ff 56%, #2468cc 56%, #184a99 100%);
    box-shadow: inset 0 3px 6px rgba(255, 255, 255, 0.65), 0 6px 14px rgba(0, 0, 0, 0.45);
}

.candle-wax.h-1 {
    height: 64px;
}

.candle-wax.h-2 {
    height: 58px;
}

.candle-wax.h-3 {
    height: 52px;
}

.candle-wax.h-4 {
    height: 46px;
}

.candle-holder {
    width: 48px;
    height: 9px;
    border-radius: 4px 4px 10px 10px;
    background: linear-gradient(90deg, #8a6423, #e8ca85, #b08335);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.candle-status-tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-top: 0.45rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.candle-card.is-lit .candle-status-tag {
    background: rgba(226, 194, 124, 0.2);
    color: var(--accent-gold-bright);
}

.candle-card.is-finland.is-lit .candle-status-tag {
    background: rgba(74, 152, 255, 0.22);
    color: #cfe4ff;
}

/* ==========================================================================
   24 Luukun Joulukalenteri-ruudukko
   ========================================================================== */
.doors-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    perspective: 1200px;
}

.door-tile {
    position: relative;
    min-height: 148px;
    border-radius: 1.15rem;
    padding: 1rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: linear-gradient(155deg, rgba(22, 31, 56, 0.76), rgba(10, 15, 28, 0.88));
    color: var(--text-primary);
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
    -webkit-tap-highlight-color: transparent;
}

.door-bg-art {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 22%;
    z-index: 0;
    opacity: 0.24;
    filter: brightness(0.76) saturate(0.85);
    transform: scale(1.01);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, filter 0.4s ease;
    pointer-events: none;
}

.door-tile.is-available .door-bg-art,
.door-tile.is-today .door-bg-art {
    opacity: 0.36;
    filter: brightness(0.82) saturate(1);
}

.door-tile.is-opened .door-bg-art {
    opacity: 0.44;
    filter: brightness(0.8) saturate(1.05);
}

.door-tile:hover .door-bg-art {
    opacity: 0.54;
    transform: scale(1.08);
    filter: brightness(0.88) saturate(1.1);
}

.door-inner {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.88);
}

.door-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(7, 10, 22, 0.54) 0%, rgba(7, 10, 22, 0.36) 46%, rgba(7, 10, 22, 0.82) 100%);
    opacity: 1;
    transition: background 0.35s ease;
    pointer-events: none;
}

.door-tile:hover {
    transform: translateY(-5px) rotateX(3deg);
    border-color: rgba(226, 194, 124, 0.5);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45), 0 0 22px rgba(226, 194, 124, 0.16);
}

.door-tile:hover::before {
    background: linear-gradient(180deg, rgba(7, 10, 22, 0.42) 0%, rgba(226, 194, 124, 0.1) 46%, rgba(7, 10, 22, 0.76) 100%);
}

.door-tile:focus-visible,
.candle-card:focus-visible {
    outline: 2px solid var(--accent-gold-bright);
    outline-offset: 3px;
}

/* Luukun eri tilat */
.door-tile.is-available {
    border-color: rgba(226, 194, 124, 0.55);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 18px rgba(226, 194, 124, 0.18);
}

.door-tile.is-today {
    border: 1.5px solid var(--accent-gold-bright);
    background: linear-gradient(155deg, rgba(64, 52, 26, 0.86), rgba(18, 28, 48, 0.94));
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.48), 0 0 28px rgba(255, 224, 140, 0.45), inset 0 0 18px rgba(255, 232, 168, 0.16);
    animation: todayGlow 2.8s ease-in-out infinite;
    z-index: 2;
}

.door-tile.is-today::after {
    content: "";
    position: absolute;
    top: -40%;
    left: -130%;
    width: 75%;
    height: 180%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 244, 206, 0.08) 38%,
        rgba(255, 248, 220, 0.42) 50%,
        rgba(255, 244, 206, 0.08) 62%,
        transparent 100%
    );
    transform: rotate(18deg);
    pointer-events: none;
    animation: todayShimmerSweep 3.8s ease-in-out infinite;
}

.door-tile.is-today .door-number {
    color: #fff9e6;
    text-shadow: 0 0 22px rgba(255, 228, 148, 0.9), 0 0 8px rgba(255, 255, 255, 0.55);
}

.door-today-badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f5d88e, #ffeab3);
    color: #141724;
    box-shadow: 0 0 14px rgba(255, 226, 148, 0.65);
}

.candle-card.is-today-candle {
    border: 1.5px solid var(--accent-gold-bright);
    box-shadow: 0 12px 34px rgba(226, 194, 124, 0.34), 0 0 24px rgba(255, 226, 148, 0.3);
}

@keyframes todayShimmerSweep {
    0% { left: -130%; }
    48%, 100% { left: 165%; }
}

.door-tile.is-opened {
    background: linear-gradient(155deg, rgba(36, 42, 62, 0.78), rgba(16, 26, 24, 0.88));
    border-color: rgba(226, 194, 124, 0.65);
}

.door-tile.is-opened::before {
    opacity: 0.85;
}

.door-tile.is-locked {
    background: linear-gradient(155deg, rgba(14, 19, 34, 0.66), rgba(8, 11, 20, 0.82));
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(248, 246, 240, 0.64);
}

.door-tile.is-finland {
    border-color: rgba(114, 178, 255, 0.52);
    background: linear-gradient(155deg, rgba(18, 42, 86, 0.82), rgba(10, 18, 38, 0.92));
}

.door-tile.is-advent:not(.is-finland) {
    border-color: rgba(226, 194, 124, 0.42);
}

/* Luukku 24 – Jouluaaton erityinen loppuhuipennus */
.door-tile.is-finale {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(70, 50, 20, 0.76) 0%, rgba(22, 31, 56, 0.9) 55%, rgba(16, 36, 26, 0.9) 100%);
    border: 1px solid rgba(255, 230, 168, 0.65);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5), 0 0 28px rgba(226, 194, 124, 0.22);
}

.door-number {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-gold-bright);
    text-shadow: 0 0 14px rgba(226, 194, 124, 0.35);
}

.door-tile.is-locked .door-number {
    color: rgba(226, 194, 124, 0.58);
    text-shadow: none;
}

.door-tile.is-finland .door-number {
    color: #dbeaff;
    text-shadow: 0 0 16px rgba(90, 165, 255, 0.55);
}

.door-badge {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(226, 194, 124, 0.16);
    color: var(--accent-gold-bright);
    border: 1px solid rgba(226, 194, 124, 0.32);
}

.door-tile.is-finland .door-badge {
    background: rgba(74, 152, 255, 0.24);
    color: #e3f0ff;
    border-color: rgba(130, 188, 255, 0.48);
}

.door-subtitle {
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.door-status-icon {
    font-size: 1.15rem;
    color: var(--accent-gold);
}

.door-tile.is-locked .door-status-icon {
    color: rgba(255, 255, 255, 0.35);
}

.door-tile.is-shaking {
    animation: gentleShake 0.45s ease;
}

.door-tile.is-opening {
    animation: doorReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Modaali-ikkuna (luukku & adventtikynttilä)
   ========================================================================== */
.modal-content.calendar-modal {
    background: linear-gradient(165deg, rgba(18, 25, 45, 0.97), rgba(10, 16, 26, 0.98));
    border: 1px solid rgba(226, 194, 124, 0.38);
    border-radius: 1.5rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 40px rgba(226, 194, 124, 0.14);
    overflow: hidden;
}

.modal-artwork-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 450px;
    overflow: hidden;
    background: #070a16;
    border-bottom: 1px solid rgba(226, 194, 124, 0.24);
}

.modal-artwork-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.modal-artwork-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 9, 19, 0) 0%, rgba(7, 9, 19, 0) 56%, rgba(12, 18, 32, 0.86) 100%);
    pointer-events: none;
}

.modal-scripture-box {
    background: rgba(226, 194, 124, 0.08);
    border-left: 3px solid var(--accent-gold);
    border-radius: 0 0.85rem 0.85rem 0;
    padding: 1rem 1.2rem;
}

.modal-reflection-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.9rem;
    padding: 0.95rem 1.15rem;
}

.modal-milestone-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: rgba(226, 194, 124, 0.13);
    border: 1px solid rgba(226, 194, 124, 0.3);
    color: var(--accent-gold-bright);
}

/* Jouluevankeliumi & Siunauskortti (24.12.) */
.gospel-box {
    background: rgba(8, 12, 24, 0.72);
    border: 1px solid rgba(226, 194, 124, 0.32);
    border-radius: 1rem;
    padding: 1.25rem;
}

.blessing-card {
    background: radial-gradient(circle at 50% 0%, rgba(226, 194, 124, 0.2), rgba(14, 24, 24, 0.85) 75%);
    border: 1px solid rgba(255, 230, 168, 0.5);
    border-radius: 1.15rem;
    padding: 1.35rem;
    text-align: center;
}

.btn-gold {
    background: linear-gradient(135deg, #d7b162, #f2d591);
    color: #12151f !important;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(226, 194, 124, 0.35);
}

.btn-outline-gold {
    color: var(--accent-gold-bright);
    border: 1px solid rgba(226, 194, 124, 0.45);
    background: rgba(226, 194, 124, 0.06);
    border-radius: 999px;
    padding: 0.45rem 1.05rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-outline-gold:hover {
    background: rgba(226, 194, 124, 0.18);
    border-color: var(--accent-gold-bright);
    color: #fff;
}

/* Lämmin odotusviesti-toast */
.warm-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%) translateY(120%);
    z-index: 1090;
    max-width: min(92vw, 460px);
    background: rgba(15, 22, 40, 0.96);
    border: 1px solid rgba(226, 194, 124, 0.5);
    border-radius: 999px;
    padding: 0.8rem 1.35rem;
    color: var(--text-primary);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.warm-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Alatunniste */
.calendar-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 10, 19, 0.72);
    backdrop-filter: blur(10px);
}

/* ==========================================================================
   Animaatiot
   ========================================================================== */
@keyframes flameFlicker {

    0%,
    100% {
        transform: scaleX(1) scaleY(1) rotate(-1deg);
    }

    25% {
        transform: scaleX(0.94) scaleY(1.06) rotate(1.5deg);
    }

    50% {
        transform: scaleX(1.04) scaleY(0.96) rotate(-1.5deg);
    }

    75% {
        transform: scaleX(0.97) scaleY(1.04) rotate(1deg);
    }
}

@keyframes haloPulse {

    0%,
    100% {
        opacity: 0.82;
        transform: translate(-50%, -50%) scale(0.95);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.09);
    }
}

@keyframes starTwinkle {

    0%,
    100% {
        opacity: 0.65;
    }

    50% {
        opacity: 1;
    }
}

@keyframes starRadiance {

    0%,
    100% {
        transform: scale(1.18);
        filter: drop-shadow(0 0 10px rgba(255, 232, 165, 0.8));
    }

    50% {
        transform: scale(1.3);
        filter: drop-shadow(0 0 22px rgba(255, 240, 190, 1));
    }
}

@keyframes todayGlow {

    0%,
    100% {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 16px rgba(226, 194, 124, 0.25);
    }

    50% {
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45), 0 0 28px rgba(255, 230, 168, 0.55);
    }
}

@keyframes gentleShake {

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

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-3px);
    }
}

@keyframes doorReveal {
    0% {
        transform: rotateY(0deg) scale(1);
    }

    45% {
        transform: rotateY(-18deg) scale(1.04);
    }

    100% {
        transform: rotateY(0deg) scale(1);
    }
}

/* ==========================================================================
   Mobiili ja responsiivisuus (kaikki laitteet)
   ========================================================================== */
@media (max-width: 1199.98px) {
    .doors-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

@media (max-width: 767.98px) {
    .calendar-main {
        padding-top: 6rem;
    }

    .doors-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .door-tile {
        min-height: 130px;
        padding: 0.85rem 0.6rem;
    }

    .door-number {
        font-size: 1.75rem;
    }

    .door-tile.is-finale {
        grid-column: span 3;
        min-height: 142px;
    }

    .bethlehem-viewport {
        aspect-ratio: 16 / 11;
        min-height: 275px;
    }

    .panorama-chapter-badge {
        top: 0.65rem;
        left: 0.65rem;
        font-size: 0.72rem;
        padding: 0.3rem 0.7rem;
    }

    .panorama-angel-wrap {
        top: 6%;
        right: 3%;
        width: clamp(92px, 27vw, 140px);
    }

    .angel-whisper-pill {
        font-size: 0.82rem;
        padding: 0.4rem 0.9rem;
        border-radius: 1rem;
    }

    .modal-artwork-wrap {
        min-height: 190px;
    }

    .panorama-chapters-bar {
        bottom: 0.6rem;
        gap: 0.3rem;
    }

    .chapter-pill {
        font-size: 0.68rem;
        padding: 0.25rem 0.55rem;
    }
}

@media (max-width: 479.98px) {
    .doors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.7rem;
    }

    .door-tile.is-finale {
        grid-column: span 2;
    }

    .candle-card {
        min-height: 215px;
        padding: 1rem 0.5rem 0.85rem;
    }
}

/* Saavutettavuus: vähennetty liike */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}