* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Georgia, serif;
    text-align: center;
    color: #861b43;
    background: linear-gradient(135deg, #ffe0eb, #fff5f7, #ffd2df);
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.page {
    width: 100%;
    min-height: 100vh;
    padding: 16px 8px 25px;
    position: relative;
    z-index: 2;
}

.welcome-card,
.appreciation-card,
.final-card {
    width: min(94%, 380px);
    margin: 10px auto;
    padding: 18px 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid white;
    border-radius: 18px;
    box-shadow: 0 5px 15px #b84d7550;
    animation: appear 0.8s ease;
}

.small-heading {
    color: #d13e73;
    letter-spacing: 1px;
    font-size: 11px;
    font-weight: bold;
}

h1 {
    color: #b51e53;
    font-size: clamp(21px, 5vw, 28px);
}

.welcome-text {
    font-size: 14px;
    line-height: 1.6;
}

.sticker-row,
.big-stickers {
    font-size: 27px;
    margin: 8px;
}

.main-button {
    border: none;
    border-radius: 25px;
    padding: 10px 17px;
    margin: 10px 4px;
    background: linear-gradient(135deg, #ff4d88, #c51d58);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px #b51e5350;
    transition: transform 0.2s;
}

.main-button:hover {
    transform: scale(1.03);
}

.poetry-area {
    width: min(94%, 380px);
    margin: 17px auto;
}

.poetry-area h2 {
    color: #b51e53;
    font-size: 19px;
}

.poetry-card {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    margin: 9px 0;
    padding: 10px;
    background: white;
    border-radius: 13px;
    box-shadow: 0 3px 9px #b84d7530;
}

.poetry-card span {
    font-size: 22px;
}

.poetry-card p {
    line-height: 1.5;
    margin: 0;
    font-size: 12px;
}

.puzzle-board {
    width: min(78vw, 290px);
    aspect-ratio: 4 / 5;
    margin: 15px auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    overflow: hidden;
    border: 3px solid white;
    border-radius: 11px;
    background: white;
    box-shadow: 0 4px 14px #a83a6550;
}

.puzzle-piece {
    min-width: 0;
    min-height: 0;
    border: 1px solid white;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

.puzzle-piece.selected {
    outline: 3px solid #ff2f79;
    outline-offset: -3px;
    filter: brightness(1.15);
    transform: scale(0.94);
    z-index: 1;
}

#puzzleInstruction,
.hint {
    font-size: 13px;
}

#puzzleCounter {
    font-size: 15px;
    font-weight: bold;
}

.appreciation-card p {
    font-size: 15px;
    line-height: 1.6;
}

.video-frame {
    width: min(85vw, 340px);
    margin: 14px auto;
    position: relative;
    overflow: hidden;
    border: 3px solid white;
    border-radius: 13px;
    background: #250b15;
    box-shadow: 0 5px 15px #a83a6550;
}

.video-frame video {
    display: block;
    width: 100%;
    max-height: 42vh;
    object-fit: contain;
    background: #250b15;
}

.door {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    pointer-events: none;
}

.door-panel {
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, #6d1535, #c34b72, #751839);
    border: 3px solid #f9c9d8;
    transition: transform 1.5s ease-in-out;
}

.left-door {
    transform-origin: left center;
}

.right-door {
    transform-origin: right center;
}

.door.open .left-door {
    transform: perspective(700px) rotateY(-105deg);
}

.door.open .right-door {
    transform: perspective(700px) rotateY(105deg);
}

#videoStatus {
    font-size: 14px;
}

.final-card {
    margin-top: 7vh;
}

.final-card p {
    font-size: 15px;
    line-height: 1.6;
}

#flowerLayer {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.flower {
    position: absolute;
    top: -40px;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0.15;
    }
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .page {
        padding-left: 6px;
        padding-right: 6px;
    }

    .puzzle-board {
        width: min(78vw, 270px);
    }

    .video-frame {
        width: min(85vw, 320px);
    }
}