body {
    margin: 0;
    font-family: sans-serif;
    text-align: center;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background: linear-gradient(135deg, #ff9a9e, #fad0c4, #fad0c4);
    color: #fff;
}

body {
    background: linear-gradient(270deg, #ff9a9e, #fecfef, #fcb69f);
    background-size: 600% 600%;
    animation: gradientMove 10s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.screen {
    display: none;
    height: 100vh;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.4s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}


/* buttons */
button {
    padding: 12px 18px;
    border-radius: 10px;
    margin-top: 6px;
    border: none;
    background: hotpink;
    color: white;
    font-size: 16px;
}

button:active {
    transform: scale(0.9);
}

/* full screen */
#intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    background: black;
    color: #fff;
    font-size: 18px;
}

@keyframes flicker {

    0%,
    100% {
        opacity: 1;
    }

    95% {
        opacity: 0.8;
    }

    96% {
        opacity: 1;
    }
}

.hint {
    font-size: 13px;
    color: #111;
    margin-top: -5px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.hintBoss {
    margin-top: 6px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #ffd6e0;
    opacity: 0.9;
}

/* chat box */
#chatBox {
    width: 100%;
    max-width: 400px;
    height: 300px;
    overflow-y: auto;
    padding: 15px;
}

/* messages */
.msg {
    margin: 5px 0;
    white-space: pre-wrap;
}


/* continue button */
#nextBtn {
    margin-top: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: 0.3s;
    font-weight: bold;
}

#cutBtn {
    border-radius: 20px;
    border: none;
    background: linear-gradient(45deg, hotpink, deeppink);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
}

#cutBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px hotpink;
}

/* hover */
#nextBtn:hover {
    background: #fff;
    color: black;
    font-weight: bold;
    box-shadow: 0 0 50px #fff;
}

#levelNextBtn {
    background: linear-gradient(45deg, hotpink, deeppink);
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}

/* login screen layout */
#login {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* heading */
#login h2 {
    margin-bottom: 20px;
    color: white;
    font-size: 22px;
}

/* input */
#nameInput {
    width: 220px;
    padding: 10px;
    border-radius: 10px;
    border: none;
    outline: none;
    text-align: center;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
}

/* button */
#startBtn {
    margin-top: 15px;
    width: 140px;
    padding: 10px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(45deg, hotpink, deeppink);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

/* hover effect */
#startBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px hotpink;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* heart */
.heart {
    position: absolute;
    font-size: 30px;
}

/* memory */
#grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    justify-items: center;
}

/* card */
.card {
    width: 80px;
    height: 80px;
    perspective: 1000px;
    cursor: pointer;
}

.inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.card.open .inner {
    transform: rotateY(180deg);
}

.front,
.back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    backface-visibility: hidden;
}

.front {
    background: hotpink;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 40px;
}

.back {
    transform: rotateY(180deg);
}

.back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}



/* glow on match */
.card.match .inner {
    box-shadow: 0 0 18px gold;
    transform: rotateY(180deg) scale(1.05);
}

/* stronger visible shake */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }

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

.card.shake {
    animation: shake 0.5s;
}


/* slight hover feel */
.inner {
    transition: transform 0.4s ease, box-shadow 0.3s;
}


#scoreUI {
    box-shadow: 0 0 10px hotpink;
    color: hotpink;
}

.progress-container {
    width: 200px;
    height: 10px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: hotpink;
    transition: width 0.3s ease;
}

/* ripple base */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleAnim 0.5s linear;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.glow-animate {
    color: white;
    animation: glowPulse 2s infinite alternate;
}

@keyframes glowPulse {
    from {
        text-shadow:
            0 0 5px #ff9aa2,
            0 0 10px #ff9aa2;
    }

    to {
        text-shadow:
            0 0 15px #ff6f91,
            0 0 25px #ff6f91,
            0 0 40px #ff1493;
    }
}

.name {
    color: #fff;
    text-shadow:
        0 0 10px hotpink,
        0 0 20px hotpink,
        0 0 30px deeppink;
}

.particle {
    position: fixed;
    font-size: 12px;
    pointer-events: none;
    z-index: 99999999;
    transition: all 1s ease;
}

.photoTarget {
    position: absolute;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 100px;
    cursor: pointer;
    transition: transform 0.2s;
    touch-action: manipulation;
}

#char {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 100px;
    z-index: 999;
    transition: transform 0.3s ease;
}

#charBubble {
    position: fixed;
    top: 30px;
    right: 120px;
    max-width: 200px;
    background: white;
    color: black;
    padding: 10px;
    border-radius: 12px;
    display: none;
    z-index: 999;
    font-size: 14px;
}

/* full screen center */
#gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(270deg, #ff9a9e, #fecfef, #fcb69f);
    background-size: 600% 600%;
    animation: gradientMove 10s ease infinite;
    position: fixed;
    inset: 0;
    text-align: center;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#photoGrid {
    position: relative;
    width: 90vw;
    max-width: 400px;
    height: 80vh;
    margin: auto;
}

/* card */
.photoCard {
    position: absolute;
    width: 90px;
    height: 90px;
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
    transition: all 0.5s ease;
}

/* when visible */
.photoCard.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}


/* image */
.photoCard img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    background-position: top;
    box-shadow:
        0 0 10px hotpink,
        0 0 20px deeppink,
        0 0 30px pink;
}

/* container */
#dreamBg {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

/* layers */
.layer {
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    background-size: cover;
    background-position: center;
}

.layer-back {
    background: url("images/dream.jpg") center/cover no-repeat;
    filter: blur(4px) brightness(0.9);
    animation: moveSlow 30s linear infinite;
}

.layer-front {
    background: radial-gradient(circle at 50% 50%, rgba(255, 192, 203, 0.3), transparent);
    animation: moveFast 20s linear infinite;
}

/* movement */
@keyframes moveSlow {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-2%, -3%);
    }

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

@keyframes moveFast {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(3%, 2%);
    }

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

@keyframes hitShake {
    0% {
        transform: translateX(0);
    }

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

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

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

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

img.shake {
    animation: hitShake 0.3s;
}

#finalBtn {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 25px;
    border-radius: 25px;
    border: none;

    background: linear-gradient(45deg, hotpink, deeppink);
    color: white;
    font-size: 14px;

    cursor: pointer;
    z-index: 1000;
}

#final {
    text-align: center;
}

/* hover */
#finalBtn:hover {
    transform: translateX(-50%) scale(1.1);
}

#yesBtn,
#noBtn,
#cuteYes,
#cuteNo,
#deserveYes,
#deserveNo {
    padding: 12px 22px;
    margin: 10px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#yesBtn {
    background: linear-gradient(45deg, hotpink, deeppink);
    color: white;
    box-shadow: 0 0 15px hotpink;
}

/* hover effect */
#yesBtn:hover,
#cuteYes:hover,
#deserveYes:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px hotpink, 0 0 40px deeppink;
}

#noBtn,
#cuteNo,
#deserveNo {
    padding: 12px 22px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: bold;
    background: linear-gradient(45deg, #444, #222);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
}

#noBtn:hover,
#cuteNo:hover,
#deserveNo:hover {
    transform: scale(1.05) rotate(-2deg);
    background: linear-gradient(45deg, #ff4d4d, #cc0000);
    box-shadow: 0 0 20px red, 0 0 30px darkred;
}

/* click feel */
#noBtn:active {
    transform: scale(0.95);
}

#retryBtn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, hotpink, deeppink);
    box-shadow: 0 0 15px hotpink;
    cursor: pointer;
    transition: all 0.3s ease;
}

#retryBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px hotpink, 0 0 40px deeppink;
}

#retryBtn:active {
    transform: scale(0.95);
}

.finalContent {
    text-align: center;
    color: white;
}

.mainText {
    font-size: 26px;
    margin-bottom: 5px;
    color: #fff;
}

#magicText {
    font-size: 34px;
    color: hotpink;
    text-shadow: 0 0 10px white;
}

.cakeScene {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 40px auto;
}

.cake {
    width: 220px;
    height: auto;
    position: absolute;
    left: 0;
    top: 0;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.left {
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0% 100%);
}

.right {
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.cakeScene::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle,
            rgba(255, 105, 180, 0.5),
            rgba(255, 105, 180, 0.2),
            transparent);
    filter: blur(50px);
    z-index: 0;
}

.cakeScene {
    animation: floatCake 4s ease-in-out infinite;
}

@keyframes floatCake {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.knife {
    position: absolute;
    width: 140px;
    height: 6px;
    background: linear-gradient(90deg, #aaa, #fff, #aaa);
    border-radius: 5px;
    box-shadow:
        0 0 15px white,
        0 0 30px rgba(255, 255, 255, 0.5);
    top: 90px;
    left: -20px;
    transform: rotate(-25deg);
    opacity: 0;
}

.insideMsg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    text-shadow:
        0 0 10px hotpink,
        0 0 20px deeppink,
        0 0 30px pink;
    transition: 1s;
    z-index: 3;
}

#emotionalScreen {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1a001a, #000);
    overflow: hidden;
}

.emotionalBox {
    max-width: 320px;
    padding: 20px;
    font-size: 20px;
    line-height: 1.7;
    text-align: center;
    color: #fff;
    text-shadow:
        0 0 10px hotpink,
        0 0 20px deeppink,
        0 0 30px pink;

    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


#galleryTimer {
    position: absolute;
    text-align: center;
    bottom: 40px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

#emotionalText {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    height: 100vh;
    margin-top: 350px;
    transition: transform 0.6s ease;
    overflow-y: auto;
    scroll-behavior: smooth;

    justify-content: flex-start;
}

/* each message */
.msgLine {
    opacity: 0;
    transform: translateY(20px);

    transition: 0.5s ease;

    color: white;
    font-size: 18px;

    text-shadow:
        0 0 10px hotpink,
        0 0 20px deeppink;
}

#emotionalText {
    animation: floatText 6s ease-in-out infinite;
}

@keyframes floatText {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0);
    }
}

/* visible */
.msgLine.show {
    opacity: 1;
    transform: translateY(0);
}

#dateReveal {
    position: fixed;
    inset: 0;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#cinemaCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
}

#dateHint {
    position: fixed;
    bottom: 40px;
    width: 100%;
    text-align: center;
    color: white;
    opacity: 0;
    transition: opacity 1.5s;
}