
:root {
    --cream: #fcf3e3;
    --paper: #fff9ed;
    --red: #a3323d;
    --dark-red: #77232d;
    --green: #3d654c;
    --dark-green: #294735;
    --gold: #c5a16a;
    --ink: #493e30;

    --heading: 'Fraunces', Georgia, serif;
    --body: 'Nunito', Arial, sans-serif;
    --script: 'Great Vibes', cursive;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--body);
    overscroll-behavior: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

button:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

.hidden {
    display: none !important;
}

.app {
    max-width: 460px;
    margin: auto;
    padding: 15px 18px 24px;
    position: relative;
}

.app-header {
    text-align: center;
}

.header-stars {
    color: var(--gold);
    font-size: 20px;
    letter-spacing: 8px;
}

h1, h2, h3 {
    font-family: var(--heading);
    font-weight: 700;
}

.app-header h1 {
    color: var(--red);
    font-size: 49px;
    line-height: .92;
    margin: 6px 0 10px;
    transform: rotate(-2deg);
    text-shadow: 2px 3px 0 #ecd6b6;
}

.app-header p {
    font-size: 14px;
    font-weight: 800;
    margin: 10px 0 0;
    color: var(--green);
}

.tree-section {
    position: relative;
}

.tree-container {
    width: 100%;
    margin: 0 auto;
}

#christmas-tree {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 490 / 535;
    max-height: none;
    overflow: hidden;
    border-radius: 18px;
}

.progress-section {
    margin: 0 18px 15px;
    text-align: center;
}

#progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-green);
    margin: 0 0 8px;
}

.progress-track {
    height: 12px;
    background: #e9dfca;
    border: 2px solid var(--dark-green);
    border-radius: 20px;
    overflow: hidden;
}

.progress-track {
    height: 13px;
    background: #e9ddc6;
    border: 1.5px solid #b99a60;
    border-radius: 20px;
    padding: 2px;
    overflow: hidden;

    box-shadow:
        inset 0 1px 3px #96784920,
        0 2px 4px #96784915;
}

#progress-fill {
    width: 0;
    height: 100%;

    background:
        linear-gradient(
            to bottom,
            #ffffff25,
            #263c2820
        ),
        repeating-linear-gradient(
            -45deg,
            #59765b 0px,
            #59765b 8px,
            #82967a 8px,
            #82967a 16px
        );

    border-radius: 20px;
    transition: width .6s ease;
}

/* Vintage Christmas reading card */

.daily-card {
    position: relative;
    text-align: center;

    background:
        radial-gradient(
            ellipse at 10% 0%,
            #ecd8b750,
            transparent 65%
        ),
        radial-gradient(
            ellipse at 95% 100%,
            #e7cda340,
            transparent 60%
        ),
        var(--paper);

    border: 1px solid #c9ae80;
    border-radius: 12px;

    box-shadow:
        0 4px 12px #76522d15,
        inset 0 0 22px #c5a16a12;

    padding: 24px 20px 22px;
    margin: 16px 2px 20px;
}

.daily-card::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid #c5a16a65;
    border-radius: 8px;
    pointer-events: none;
}

.day-label,
.eyebrow {
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 800;
    color: var(--red);
}

.daily-card h2 {
    font-family: var(--heading);
    font-size: 42px;
    font-weight: 600;
    color: var(--dark-green);
    margin: 8px 0 4px;
    line-height: 1.15;
}

.daily-card p {
    font-family: var(--script);
    font-size: 27px;
    color: #895441;
    margin: 6px 0 20px;
    font-weight: 400;
    line-height: 1.3;
}

/* Vintage buttons */

.button {
    display: block;
    position: relative;
    width: 100%;
    min-height: 51px;
    padding: 14px 15px;
    border: 1px solid;
    border-radius: 7px;
    color: #fff9ed;
    font-size: 16px;
    font-weight: 700;
    transition: transform .15s, box-shadow .15s;
}

.button::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid #e8c99490;
    border-radius: 4px;
    pointer-events: none;
}

.red-button {
    background: linear-gradient(
        145deg,
        #b0434b,
        #8e2935
    );
    border-color: var(--dark-red);
    box-shadow: 0 3px 6px #77232d25;
}

.green-button,
#read-button {
    background: linear-gradient(
        145deg,
        #4b7256,
        #294735
    );
    border-color: var(--dark-green);
    box-shadow: 0 3px 6px #29473525;
}

.button:active {
    transform: translateY(2px);
    box-shadow: none;
}

/* Present */

.gift-icon {
    position: relative;
    width: 70px;
    height: 66px;
    margin: 0 auto 8px;
    animation: gift-wiggle 4s infinite;
}

.gift-box {
    position: absolute;
    width: 58px;
    height: 37px;
    left: 6px;
    bottom: 0;
    background: var(--red);
    border: 2px solid var(--dark-red);
    border-radius: 4px 4px 8px 8px;
    overflow: hidden;
}

.gift-box::after,
.gift-lid::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 100%;
    background: var(--gold);
    left: calc(50% - 6px);
}

.gift-lid {
    position: absolute;
    z-index: 2;
    width: 70px;
    height: 15px;
    left: 0;
    bottom: 30px;
    background: #d34d54;
    border: 2px solid var(--dark-red);
    border-radius: 5px;
}

.gift-bow {
    position: absolute;
    font-size: 32px;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

@keyframes gift-wiggle {
    0%, 75%, 100% { transform: rotate(0); }
    80% { transform: rotate(-7deg); }
    85% { transform: rotate(7deg); }
    90% { transform: rotate(-4deg); }
    95% { transform: rotate(4deg); }
}

/* Navigation */

.bottom-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.bottom-nav button {
    background: #f2ead5;
    border: 2px solid var(--green);
    border-radius: 13px 17px 12px 16px;
    min-height: 65px;
    padding: 7px 3px;
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 3px 0 var(--green);
}

.bottom-nav span {
    display: block;
    font-size: 24px;
    line-height: 1.2;
    color: var(--red);
}

footer {
    text-align: center;
    color: var(--green);
    font-family: var(--heading);
    font-size: 19px;
    margin-top: 20px;
}

/* Modals */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(18, 43, 29, .65);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal-panel {
    position: relative;
    background: var(--cream);
    border: 3px solid var(--dark-green);
    border-radius: 27px 19px 29px 20px;
    box-shadow: 5px 6px 0 var(--dark-green);
    width: 100%;
    max-width: 440px;
    max-height: 88dvh;
    overflow-y: auto;
    padding: 28px 20px 24px;
    text-align: center;
    animation: modal-in .25s ease-out;
}

.modal-panel h2 {
    font-size: 34px;
    line-height: 1.1;
    color: var(--red);
    margin: 12px 0;
}

.modal-panel h3 {
    font-size: 30px;
    color: var(--green);
    margin: 12px 0;
}

.modal-panel p {
    font-size: 16px;
    line-height: 1.6;
}

.close-button {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 37px;
    height: 37px;
    background: transparent;
    border: 0;
    font-size: 31px;
    color: var(--green);
}

@keyframes modal-in {
    from { transform: scale(.93); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Scripture */

.reading-panel {
    text-align: left;
}

.reading-panel h2,
.reading-panel .eyebrow {
    text-align: center;
}

.reading-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 14px 0;
}

.reading-controls button {
    background: var(--paper);
    border: 2px solid var(--green);
    color: var(--green);
    border-radius: 10px;
    font-size: 18px;
    font-weight: 800;
    padding: 7px 20px;
}

#scripture-text {
    font-size: 19px;
    line-height: 1.85;
    margin: 20px 0;
}

.verse {
    margin-bottom: 12px;
}

.verse-number {
    color: var(--red);
    font-weight: 900;
    font-size: .7em;
    vertical-align: super;
    margin-right: 5px;
}

/* Reward */

.unwrap-button {
    background: transparent;
    border: 0;
    padding: 30px;
}

.large-gift {
    transform: scale(1.6);
    margin: 20px auto;
    animation: large-gift-wiggle 2s infinite;
}

@keyframes large-gift-wiggle {
    0%, 100% { transform: scale(1.6) rotate(-4deg); }
    50% { transform: scale(1.6) rotate(4deg); }
}

.reward-art {
    width: 170px;
    height: 170px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    animation: reward-pop .65s ease-out;
}

.reward-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reward-stars {
    color: var(--gold);
    font-size: 28px;
    letter-spacing: 9px;
}

.reference {
    color: var(--red);
    font-weight: 800;
}

@keyframes reward-pop {
    0% { transform: scale(.1) rotate(-20deg); opacity: 0; }
    65% { transform: scale(1.15) rotate(5deg); }
    100% { transform: scale(1); opacity: 1; }
}

/* Calendar */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 11px;
    margin-top: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 2px solid var(--dark-red);
    border-radius: 12px 8px 13px 9px;
    background: #f8e2dc;
    color: var(--dark-red);
    font-weight: 900;
    font-size: 23px;
    box-shadow: 0 3px 0 var(--dark-red);
}

.calendar-day.completed {
    background: var(--green);
    border-color: var(--dark-green);
    color: white;
    box-shadow: 0 3px 0 var(--dark-green);
}

.calendar-day:disabled {
    opacity: .4;
    cursor: default;
    box-shadow: none;
}

.calendar-day small {
    display: block;
    font-size: 11px;
}

/* Decoration options */

.decoration-row {
    background: var(--paper);
    border: 2px solid var(--green);
    border-radius: 16px 12px 18px 12px;
    margin: 14px 0;
    padding: 15px;
}

.decoration-row h3 {
    font-family: var(--body);
    font-size: 17px;
    margin: 0 0 10px;
}

.color-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.color-swatch {
    width: 39px;
    height: 39px;
    border: 2px solid #8a7962;
    border-radius: 50%;
}

.color-swatch.selected {
    outline: 3px solid var(--green);
    outline-offset: 3px;
}

.locked {
    opacity: .55;
}

.locked p {
    font-size: 13px;
    margin: 0;
}

/* Ornament placement */

.placement-message {
    background: var(--gold);
    border: 2px solid #a77a25;
    border-radius: 14px;
    text-align: center;
    padding: 10px;
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 10px;
}

.snap-point {
    fill: #fff0a3;
    stroke: #d7a137;
    stroke-width: 2;
    cursor: pointer;
    animation: glow-point 1.5s infinite alternate;
}

@keyframes glow-point {
    from { opacity: .5; }
    to { opacity: 1; }
}

.tree-ornament {
    cursor: pointer;
}

.tree-light {
    animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0%, 20% {
        opacity: .65;
        filter: drop-shadow(0 0 1px #ffe6a0);
    }

    75%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 4px #ffe6a0);
    }
}
/* Snow */

#snow-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.snowflake {
    position: absolute;
    top: -30px;
    color: #b8c6b2;
    opacity: .45;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    to { transform: translate(30px, 110vh) rotate(180deg); }
}

/* Notifications */

.toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: var(--green);
    color: white;
    border: 2px solid var(--dark-green);
    border-radius: 15px;
    padding: 14px 20px;
    width: max-content;
    max-width: 90%;
    font-weight: 800;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
.scripture-copyright {
    font-size: 11px;
    line-height: 1.5;
    color: #827b6b;
    border-top: 1px solid #ded5c3;
    padding-top: 18px;
    margin-top: 25px;
}
.unwrap-button.opening .large-gift {
    animation: gift-open-shake .8s ease forwards;
}

.unwrap-button.opening .gift-lid,
.unwrap-button.opening .gift-bow {
    animation: gift-lid-fly .8s ease forwards;
}

.unwrap-button.opening .gift-box {
    animation: gift-box-open .8s ease forwards;
}

@keyframes gift-open-shake {
    0% { transform: scale(1.6) rotate(0); }
    15% { transform: scale(1.7) rotate(-9deg); }
    30% { transform: scale(1.7) rotate(9deg); }
    45% { transform: scale(1.8) rotate(0); }
    100% { transform: scale(1.6); }
}

@keyframes gift-lid-fly {
    0%, 40% {
        translate: 0 0;
        rotate: 0deg;
        opacity: 1;
    }

    100% {
        translate: 35px -100px;
        rotate: 35deg;
        opacity: 0;
    }
}

@keyframes gift-box-open {
    0%, 45% {
        transform: scale(1);
        opacity: 1;
    }

    70% {
        transform: scale(1.15, .85);
        opacity: 1;
    }

    100% {
        transform: scale(.7);
        opacity: 0;
    }
}

.reward-panel {
    overflow-x: hidden;
}
.placement-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #fff0bd;
    border: 3px solid #a77a25;
    border-radius: 19px 12px 20px 14px;
    box-shadow: 3px 4px 0 #a77a25;
    padding: 12px;
    margin: 8px 0 18px;
    animation: modal-in .3s ease-out;
}

#placement-preview {
    width: 55px;
    height: 55px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

#placement-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.placement-instructions {
    text-align: left;
}

.placement-instructions strong {
    display: block;
    color: var(--dark-green);
    font-size: 17px;
}

.placement-instructions span {
    display: block;
    font-size: 13px;
    margin-top: 3px;
}

.snap-point {
    fill: #fff5c6;
    stroke: #e6bd56;
    stroke-width: 3;
    filter: drop-shadow(0 0 5px #ffe99c);
}
.tree-ornament.newly-placed {
    transform-box: fill-box;
    transform-origin: center;
    animation: ornament-bounce .55s ease-out;
}

@keyframes ornament-bounce {
    0% {
        transform: scale(.3) rotate(-15deg);
        opacity: 0;
    }

    55% {
        transform: scale(1.25) rotate(8deg);
        opacity: 1;
    }

    80% {
        transform: scale(.95) rotate(-4deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

/* Milestone bonus presents */

.milestone-panel {
    background: #fff5dc;
    border-color: #b18a32;
    box-shadow: 5px 6px 0 #b18a32;
    overflow-x: hidden;
}

.bonus-banner {
    display: inline-block;
    background: var(--red);
    color: white;
    border: 2px solid var(--dark-red);
    border-radius: 9px 15px 8px 13px;
    padding: 9px 19px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 2px;
    transform: rotate(-3deg);
    box-shadow: 2px 3px 0 var(--dark-red);
    margin-bottom: 12px;
}

.bonus-gift .gift-box {
    background: #337c4d;
    border-color: #173f2a;
}

.bonus-gift .gift-lid {
    background: #4b9c60;
    border-color: #173f2a;
}

#milestone-art {
    width: 180px;
    height: 150px;
    margin: 15px auto;
    animation: reward-pop .65s ease-out;
}

#milestone-art svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.choose-color-title {
    font-family: var(--body);
    font-size: 17px !important;
    font-weight: 900;
    margin-top: 24px !important;
}

#milestone-colors {
    margin: 18px 0 28px;
}

#milestone-colors .color-swatch {
    width: 44px;
    height: 44px;
}

.decoration-appear {
    animation: decoration-magic 1.5s ease-out;
}

@keyframes decoration-magic {
    0% {
        opacity: 0;
    }

    35% {
        opacity: 1;
        filter: drop-shadow(0 0 12px #ffe9a0);
    }

    65% {
        filter: drop-shadow(0 0 7px #ffe9a0);
    }

    100% {
        opacity: 1;
        filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .decoration-appear,
    #milestone-art {
        animation: none;
    }
}

.progress-section {
    margin-top: 12px;
}

.app-header {
    padding-bottom: 0;
    margin-bottom: 0;
}
.tree-container {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #d8c4a8;
    box-shadow: 0 4px 18px rgba(104, 78, 49, .08);
    background: #f5e7d2;
}
.tree-container {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
}
/* Watercolor holly corners */

.holly-corner {
    position: absolute;
    width: 27%;
    max-width: 115px;
    height: auto;
    pointer-events: none;
    z-index: 1;
}

.holly-left {
    top: 10px;
    left: 10px;
}

.holly-right {
    top: 10px;
    right: 10px;
    transform: scaleX(-1);
}
.daily-card .day-label {
    font-family: var(--heading);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2.5px;
    color: var(--red);
    margin: 10px 0 4px;
}

.daily-card {
    padding-top: 30px;
}
/* Watercolor Christmas present */

.watercolor-gift {
    width: 145px;
    margin: 0 auto 4px;
    animation: gift-wiggle 4s infinite;
}

.watercolor-gift img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 3px 3px rgba(100, 65, 35, .10));
}
/* Animated fireplace */

#fireplace-layer {
    pointer-events: none;
}

.fireplace-glow {
    animation: hearth-glow 3s ease-in-out infinite alternate;
}

.fire-flame {
    transform-box: fill-box;
    transform-origin: center bottom;
    opacity: .8;
    animation: flame-flicker 1.8s ease-in-out infinite alternate;
}

.flame-one {
    animation-duration: 1.7s;
}

.flame-two {
    animation-duration: 2.3s;
    animation-delay: -.8s;
}

.flame-three {
    animation-duration: 1.4s;
    animation-delay: -.4s;
}

@keyframes flame-flicker {
    0% {
        transform: scale(.95, .85) skewX(-4deg);
        opacity: .40;
    }

    50% {
        transform: scale(1.05, 1.15) skewX(3deg);
        opacity: .70;
    }

    100% {
        transform: scale(.9, .95) skewX(-2deg);
        opacity: .50;
    }
}
@keyframes hearth-glow {
    from {
        opacity: .4;
    }

    to {
        opacity: .85;
    }
}
/* Ambient fireplace illumination */

.ambient-fire-glow {
    mix-blend-mode: normal;
    animation: ambient-fire-flicker 3s ease-in-out infinite;
}

@keyframes ambient-fire-flicker {
    0%, 100% { opacity: .25; }
    20% { opacity: .85; }
    40% { opacity: .40; }
    60% { opacity: .95; }
    80% { opacity: .50; }
}
/* Flickering mantel candles */

.candle-flame {
    transform-box: fill-box;
    transform-origin: center bottom;
    animation: candle-flicker 1.8s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 2px #ffc568);
}

.candle-halo {
    animation: candle-glow-pulse 2.4s ease-in-out infinite alternate;
}

.second-candle {
    animation-delay: -.9s;
}

@keyframes candle-flicker {
    0% {
        transform: scale(.90, .95) skewX(-15deg);
        opacity: .75;
    }
    25% {
        transform: scale(.80, 1.15) skewX(12deg);
        opacity: 1;
    }
    50% {
        transform: scale(1, .85) skewX(-8deg);
        opacity: .85;
    }
    75% {
        transform: scale(.85, 1.10) skewX(20deg);
        opacity: .95;
    }
    100% {
        transform: scale(.95, 1) skewX(-12deg);
        opacity: .80;
    }
}

@keyframes candle-glow-pulse {
    from { opacity: .30; }
    to { opacity: .85; }
}

.lantern-flame {
    animation-duration: 1.4s;
    animation-delay: -.5s;
}

.lantern-glow {
    animation-duration: 2s;
    animation-delay: -.7s;
}
#ambient-firelight,
.fireplace-glow {
    display: none;
}
/* Snowfall outside the window */

.window-flake {
    fill: #fffdf5;
    opacity: .85;
    animation: window-snowfall var(--duration) linear infinite;
    animation-delay: var(--delay);
}

@keyframes window-snowfall {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(4px, 65px);
    }

    50% {
        transform: translate(-2px, 130px);
    }

    75% {
        transform: translate(5px, 195px);
    }

    100% {
        transform: translate(8px, 260px);
    }
}
/* Christmas star selection */

.star-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin: 12px auto;
}

.star-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 12px;
    background: #fff9ed;
    border: 1.5px solid #d8c6a3;
    border-radius: 10px;
    cursor: pointer;

    font-family: var(--heading);
    font-size: 15px;
    color: var(--ink);
}

.star-option img,
.reward-art .star-option img {
    width: 65px;
    height: 65px;
    object-fit: contain;
}

.star-option.selected {
    background: #f3ead5;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px #c5a16a;
}

#reward-art:has(.star-options) {
    width: 100%;
    height: auto;
    max-width: none;
    display: block;
}

#reward-art:has(.star-options) h3 {
    font-size: 19px;
    color: var(--dark-green);
}
.tree-container {
    padding: 5px;
    background: #fff5e3;
    border: 1.5px solid #b99a60;
    border-radius: 23px;
    box-shadow:
        0 0 0 3px #e7d4b4,
        0 5px 14px rgba(100, 70, 35, .12);
}

#christmas-tree {
    border: 1px solid #c5a16a;
    border-radius: 17px;
}
#scripture-text p,
#scripture-text .verse {
    font-size: inherit;
    line-height: 1.85;
}