@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

@font-face {
    font-family: 'GmarketSans';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'GmarketSansBold';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700;900&display=swap');

:root {
    --primary-color: #7138F9;
    --accent-color: #FF4D6D;
    --text-color: #FFFFFF;
    --counter-blue: #6223FF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

body {
    background-color: var(--primary-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Common Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 100vh;
}

/* Typography */
h1 {
    font-weight: 900;
    font-size: 4rem;
    line-height: 1.25;
    margin-bottom: 2rem;
    word-break: keep-all;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

p.subtext {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 2rem;
    word-break: keep-all;
    line-height: 1.6;
}

/* Mobile Hero Section */
.hero-image {
    width: 100%;
    max-width: 300px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {

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

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

/* Button Styling */
.heart-button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.4);
    transition: all 0.3s ease;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heart-button:active {
    transform: scale(0.95);
}

.heart-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 77, 109, 0.6);
}

/* Success View */
.success-view {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.success-view.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
}

/* Stage Styles */
.stage-body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stage-container {
    width: 1920px;
    height: 1080px;
    background: #000;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* Don't let flexbox shrink it before JS scales it */
}

.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: opacity 1s ease;
}

.stage-container.active .bg-video {
    opacity: 0;
}

.stage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/public/img/stage_bg.png') !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: cover !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 1s ease;
    z-index: 100;
    overflow: hidden;
}

.stage-content {
    width: 100%;
    height: 100%;
    position: relative;
    /* No background */
}

.stage-asset {
    position: absolute;
    display: block;
}

.stage-logo {
    top: 50px;
    right: 50px;
    width: 200px;
    /* Adjusted size */
    z-index: 10;
}

.stage-subtext {
    top: 66px;
    left: 575px;
    transform: none;
    width: 776px;
    height: 76px;
    z-index: 10;
}

.stage-title {
    top: 210px;
    left: 234px;
    transform: none;
    width: 1391px;
    height: 247px;
    z-index: 10;
}

.stage-footer {
    top: 1009px;
    /* Using top instead of bottom for exact coordinate */
    left: 107px;
    transform: none;
    width: 512px;
    height: 22px;
    z-index: 10;
}

/* Counter Area */
.counter-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 5;
    pointer-events: none;
    /* Let clicks pass through if needed */
}

/* Hand holding phone */
.stage-hand {
    position: absolute;
    bottom: 150px;
    left: 160px;

    /* transform: translateY(-150px); */
    /* Adjusted left position */
    width: 667px;
    /* Adjusted size */
    z-index: 3;
}

/* Counter Box */
.counter-wrapper {
    position: absolute;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 60px;
    padding: 20px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 600px;
    height: 250px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.counter-box {
    font-family: 'GmarketSansBold', sans-serif;
    /* Using bold font */
    color: var(--counter-blue);
    font-size: 11rem;
    font-weight: 900;
    display: flex;
    align-items: baseline;
    gap: 0;
    letter-spacing: -0.05em;
    line-height: 1;
    overflow: hidden;
    /* Hide rolling digits outside the box */
    height: 11rem;
    /* Fixed height to match font size approx */
}

/* Individual digit container (window) */
.digit-container {
    display: inline-block;
    height: 1em;
    /* Matches font-size of counter-box */
    overflow: hidden;
    position: relative;
    vertical-align: bottom;
}

/* Strip of numbers 0-9 */
.digit-strip {
    display: flex;
    flex-direction: column;
    transition: transform 1.5s cubic-bezier(0.1, 1, 0.2, 1);
    /* Ease-out "settle" effect */
    transform: translateY(0);
    will-change: transform;
}

.digit-strip span {
    display: block;
    height: 1em;
    line-height: 1;
    text-align: center;
}

.counter-suffix {
    font-size: 5rem;
    font-weight: 900;
    margin-left: 0.5rem;
    transform: translateY(-1rem);
    color: var(--counter-blue);
}

.stage-heart {
    position: absolute;
    bottom: 300px;
    /* Floating near counter */
    left: 50%;
    transform: translateX(230px);
    width: 220px;
    z-index: 20;
    /* Above counter */
    animation: floatHeart 3s ease-in-out infinite;
}

@keyframes floatHeart {

    0%,
    100% {
        transform: translateX(230px) translateY(0) rotate(10deg);
    }

    50% {
        transform: translateX(230px) translateY(-20px) rotate(10deg);
    }
}

.stage-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Hearts removed */

/* Footer */
footer {
    margin-top: auto;
    padding: 2rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Responsive */
/* Mobile View Specifics */
/* Mobile View Specifics */
.mobile-body {
    background-color: var(--primary-color);
    background-image: url('/public/img/stage_bg.png');
    /* Moved to Body */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Prevent bg scroll */
    overflow: hidden;
    /* Prevent scrolling */
    touch-action: none;
    /* Disable native touch actions like zooming */
    display: flex;
    justify-content: center;
    /* Horizontally center */
    align-items: flex-start;
    /* Vertically align to top */
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    /* Fallback and dynamic viewport height */
    margin: 0;
}

.mobile-container {
    width: 720px;
    height: 1280px;
    /* Fixed Base Resolution */
    flex-shrink: 0;
    /* Prevent flexbox from squashing it */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Header top, footer bottom */
    align-items: center;
    padding: 0;
    /* Padding moved to .mobile-view */
    /* Fixed padding for base res */
    text-align: center;
    transform-origin: top center;
    /* Scale from top center */
    /* background-image: removed; */
    /* background-size: cover; */
    /* box-shadow: removed; */
}

.mobile-view {
    width: 100%;
    height: 100%;
    position: absolute;
    /* Stack for transition */
    top: 0;
    left: 0;
    padding: 0px 40px 60px 40px;
    /* Moved padding here */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.mobile-view.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
    /* Subtle zoom out */
    z-index: 1;
}

.mobile-view.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    z-index: 2;
}

/* Assets Positioning Helper */
.m-asset {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.m-title {
    width: 80%;
    margin-top: 80px;
    /* 40px -> 15px */
    margin-bottom: 25px;
    /* 2vh -> 25px */
}

.m-subtext {
    width: 90%;
    margin-bottom: 25px;
    /* 2vh -> 25px */
    margin-top: 30px;
    /* Reduced from 50px */
}

.m-heart-img {
    width: 100%;
    /* Adjust based on look */
    /* animation: float 3s ease-in-out infinite; */
    transform: translateY(10px);
    animation: floatMobileHeart 3s ease-in-out infinite;
}

@keyframes floatMobileHeart {

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

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

/* Heart Button Customization */
.m-heart-btn {
    background: #FF4D6D;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 30px 40px;
    /* Increased height (15px -> 30px vertical padding = +30px height) */
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.4);
    cursor: pointer;
    margin-top: -30px;
    /* Overlap with hand image if needed */
    z-index: 10;
    width: 70%;
    transform: translateY(-80px);
}

.m-btm-text {
    width: 90%;
    margin-bottom: 25px;
    z-index: 10;
}

.m-footer {
    width: 70%;
    margin-top: auto;
    margin-bottom: 25px;
    opacity: 0.8;
}

/* Result View Specifics */
.m-result-bubble {
    width: 90%;
    margin-top: 100px;
    margin-bottom: 25px;
    animation: floatBubble 3s ease-in-out infinite;
}

@keyframes floatBubble {

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

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

.m-lady {
    width: 90%;
    margin-top: 25px;
    /* 2vh -> 25px */
    transform: translateY(-60px);
}

.m-result-footer {
    width: 80%;
    margin-top: auto;
    margin-bottom: 60px;
    /* 5vh -> 60px */
}

/* Responsive adjustments */
@media (min-width: 481px) {
    .mobile-body {
        background-image: url('/public/img/stage_bg.png');
        background-size: cover;
        background-position: center;
    }

    .mobile-container {
        /* background-image: url('/public/img/mobile_bg.png'); */
        background: transparent;
        /* Explicitly transparent */
        background-size: cover;
        /* box-shadow: 0 0 50px rgba(0, 0, 0, 0.5); */
    }
}