* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --blue-deep: #051538;
    --blue-mid: #0b1f4a;
    --blue-light: #1e3a8a;
    --gold: #facc15;
    --ivory: #fefce8;
    --white: #f9fafb;
}

body {
    min-height: 100vh;
    background:
            radial-gradient(circle at top, #0b1b44, #020617 55%, #000010 100%);
    display: block;                         /* 👈 niente flex globale */
    padding: 16px 12px 32px;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #f9fafb;
    overflow-x: hidden;
}

.page {
    width: 100%;
    max-width: 480px;                       /* si adatta bene a iPhone */
    margin: 0 auto;
}

/* Carta del calendario (forma verticale) */
.calendar-card {
    position: relative;
    aspect-ratio: 3 / 4.6;
    margin: 0 auto;
    border-radius: 18px;
    border: 2px solid rgba(250, 204, 21, 0.9);
    background:
            linear-gradient(to bottom, #071739 0%, #041023 35%, #020614 100%);
    box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.8),
            0 28px 60px rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.calendar-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 8px 10px 12px;
    background:
            radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.09), transparent 50%),
            radial-gradient(circle at 90% 0%, rgba(255, 255, 255, 0.11), transparent 55%),
            radial-gradient(circle at 50% 100%, rgba(37, 99, 235, 0.3), transparent 75%);
}

/* Fascia superiore con finestrine/stelle */
.top-strip {
    position: relative;
    height: 19%;
    margin-bottom: 4px;
    border-radius: 10px;
    background:
            linear-gradient(to bottom, #020824 0%, #020617 65%, #030712 100%);
    border: 1px solid rgba(15, 23, 42, 0.9);
    box-shadow: inset 0 0 18px rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.top-strip::before {
    /* stelline sparse */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
            radial-gradient(circle at 5% 20%, rgba(255, 255, 255, 0.9) 0, transparent 40%),
            radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.8) 0, transparent 45%),
            radial-gradient(circle at 40% 0%, rgba(255, 255, 255, 0.85) 0, transparent 50%),
            radial-gradient(circle at 60% 10%, rgba(255, 255, 255, 0.95) 0, transparent 45%),
            radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.8) 0, transparent 45%),
            radial-gradient(circle at 95% 10%, rgba(255, 255, 255, 0.8) 0, transparent 40%);
    opacity: 0.75;
    mix-blend-mode: screen;
    pointer-events: none;
}

.top-windows {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
}

.tw-window {
    width: 38px;
    height: 30px;
    border-radius: 6px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.7);
    box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.9),
            0 7px 16px rgba(0, 0, 0, 0.9);
}

.tw-star {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: radial-gradient(circle at 50% 40%, var(--gold), #fbbf24);
    box-shadow:
            0 0 0 2px rgba(250, 250, 210, 0.8),
            0 0 18px rgba(250, 250, 210, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #92400e;
    transform: translateY(-4px);
}

/* Logo / scritta Baci */
.logo-area {
    position: absolute;
    left: 50%;
    top: 12%;
    transform: translate(-50%, 0);
    text-align: center;
    z-index: 2;
}

.logo-baci {
    font-family: "Great Vibes", cursive;
    font-size: 2.2rem;
    color: var(--ivory);
    text-shadow:
            0 0 10px rgba(0, 0, 0, 0.9),
            0 0 18px rgba(191, 219, 254, 0.9);
    letter-spacing: 0.04em;
}

.logo-sub {
    margin-top: 4px;
    font-size: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    opacity: 0.9;
}

.slogan {
    margin-top: 6px;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    text-shadow: 0 0 8px rgba(15, 23, 42, 0.9);
}

/* Area centrale con illustrazione stilizzata */
.scene {
    position: absolute;
    inset: 22% 6% 6% 6%;
    border-radius: 16px;
    padding: 8px 10px 10px;
    background:
            radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.3), transparent 55%),
            radial-gradient(circle at 100% 0%, rgba(191, 219, 254, 0.22), transparent 55%),
            radial-gradient(circle at 50% 100%, rgba(15, 23, 42, 0.95), #020617 78%);
    box-shadow:
            inset 0 0 25px rgba(15, 23, 42, 0.95);
    overflow: hidden;
}

/* neve piccola sullo sfondo scena */
.scene::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
            radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.8) 0, transparent 45%),
            radial-gradient(circle at 40% 5%, rgba(255, 255, 255, 0.7) 0, transparent 50%),
            radial-gradient(circle at 70% 15%, rgba(255, 255, 255, 0.8) 0, transparent 50%),
            radial-gradient(circle at 90% 30%, rgba(255, 255, 255, 0.8) 0, transparent 45%),
            radial-gradient(circle at 20% 60%, rgba(255, 255, 255, 0.7) 0, transparent 50%);
    opacity: 0.4;
    pointer-events: none;
}

/* Casa a sinistra (stilizzata) */
.house {
    position: absolute;
    left: 9%;
    bottom: 20%;
    width: 38%;
    height: 32%;
    background: linear-gradient(to top, #1d3359 0%, #102447 100%);
    border-radius: 4px 4px 8px 8px;
    box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.9),
            0 10px 20px rgba(0, 0, 0, 0.85);
    overflow: hidden;
}

.house::before {
    content: "";
    position: absolute;
    top: -18%;
    left: -3%;
    width: 106%;
    height: 40%;
    border-radius: 999px;
    background: var(--ivory);
    box-shadow:
            0 0 0 1px rgba(148, 163, 184, 0.9),
            0 8px 14px rgba(15, 23, 42, 0.8);
}

.house-window {
    position: absolute;
    width: 16%;
    height: 24%;
    background: #facc15;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}

.house-window:nth-child(1) { left: 10%; top: 20%; }
.house-window:nth-child(2) { left: 32%; top: 20%; }
.house-window:nth-child(3) { left: 55%; top: 20%; }
.house-window:nth-child(4) { left: 10%; top: 52%; }
.house-window:nth-child(5) { left: 32%; top: 52%; }
.house-window:nth-child(6) { left: 55%; top: 52%; }

/* albero a destra */
.tree {
    position: absolute;
    right: 8%;
    bottom: 14%;
    width: 38%;
    height: 45%;
}

.tree-triangle {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80%;
    height: 100%;
    background: linear-gradient(to top, #091a3b, #102a5b);
    clip-path: polygon(50% 0%, 100% 85%, 0% 85%);
    box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.9),
            0 14px 28px rgba(0, 0, 0, 0.9);
}

.tree::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -8%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: radial-gradient(circle at 50% 40%, var(--gold), #fbbf24);
    box-shadow:
            0 0 0 2px rgba(250, 250, 210, 0.9),
            0 0 18px rgba(250, 250, 210, 0.95);
}

.tree-lights {
    position: absolute;
    inset: 20% 18% 18% 18%;
    border-radius: 999px;
    border: 1px dashed rgba(249, 250, 251, 0.9);
    border-top: none;
    border-left: none;
    border-right: none;
    transform: rotate(12deg);
    opacity: 0.7;
}

/* neve e collinetta in basso */
.ground {
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: -4%;
    height: 28%;
    background: radial-gradient(circle at 50% -20%, var(--ivory), transparent 60%);
    opacity: 0.92;
}

/* area delle “finestrelle” numerate (bottoni) */
.doors-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.door {
    position: absolute;
    width: 11%;
    height: 9%;
    border-radius: 4px;
    border: 1px solid rgba(248, 250, 252, 0.9);
    background: rgba(15, 23, 42, 0.45);
    color: var(--ivory);
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(15, 23, 42, 0.9);
    pointer-events: auto;
    transition:
            transform 0.12s ease,
            box-shadow 0.12s ease,
            background 0.12s ease,
            border-color 0.12s ease,
            opacity 0.12s ease;
}

.door:hover {
    transform: translateY(-1px);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.9);
    border-color: var(--gold);
}

.door.locked {
    /*opacity: 0.4;*/
    cursor: wait;
    border-style: dashed;
}

.door.locked:hover {
    transform: none;
    box-shadow: 0 0 5px rgba(15, 23, 42, 0.9);
    border-color: rgba(248, 250, 252, 0.7);
}

.door.locked::after {
    /*content: "🔒";*/
    position: absolute;
    bottom: -0.9em;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
}


.door.today {
    /*border-color: var(--gold);*/
    /*box-shadow:
      0 0 0 1px rgba(250, 250, 210, 0.8),
      0 6px 14px rgba(0, 0, 0, 0.95);*/
    /*background: rgba(15, 23, 42, 0.9);*/
    border-style: dashed;
}
/*
    .door.today::before {
      content: "★";
      position: absolute;
      top: -0.9em;
      right: -0.3em;
      font-size: 0.55rem;
      color: var(--gold);
      text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    }
    */

/* Modal scratch */
.modal {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), rgba(3, 7, 18, 0.98));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 40;
}

.hidden {
    display: none !important;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    background: radial-gradient(circle at top, #020617, #020617);
    border-radius: 24px;
    border: 2px solid rgba(250, 204, 21, 0.9);
    padding: 18px 18px 20px;
    position: relative;
    box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.9),
            0 30px 70px rgba(0, 0, 0, 0.95);
    transform: translateY(14px) scale(0.94);
    opacity: 0;
    animation: modalIn 0.23s ease-out forwards;
}

@keyframes modalIn {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-inner {
    position: relative;
    z-index: 1;
}

.modal-close {
    position: absolute;
    right: 10px;
    top: 8px;
    border: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-day {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.85;
    margin-bottom: 4px;
}

.modal-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.scratch-wrapper {
    position: relative;
    margin-top: 10px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(248, 250, 252, 0.8);
    background: #020617;
    height: 220px;
}

.surprise-content {
    position: absolute;
    inset: 0;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
    line-height: 1.4;
    z-index: 0;
}

.surprise-content span {
    max-width: 90%;
}

#scratchCanvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    touch-action: none;
    transition: opacity 0.45s ease;
}

.scratch-wrapper.cleared #scratchCanvas {
    opacity: 0;
    pointer-events: none;
}

.scratch-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
            120deg,
            rgba(148, 163, 184, 0.8),
            rgba(248, 250, 252, 0.9),
            rgba(148, 163, 184, 0.8)
    );
    mix-blend-mode: screen;
    opacity: 0.5;
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

.scratch-wrapper.cleared::before {
    opacity: 0;
    animation: none;
}

@keyframes shimmer {
    0%, 100% {
        transform: translateX(-12%);
    }
    50% {
        transform: translateX(12%);
    }
}

.scratch-hint {
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scratch-hint span {
    font-size: 1rem;
}

/* Neve generale sul body */
.snowflake {
    position: fixed;
    top: -10px;
    border-radius: 999px;
    pointer-events: none;
    background: #f9fafb;
    filter: blur(0.6px);
    z-index: 0;
    mix-blend-mode: screen;
    opacity: 0.7;
    animation-name: fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes fall {
    to {
        transform: translate3d(var(--offsetX), 105vh, 0);
        opacity: 0;
    }
}