body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    font-family: "Segoe UI", Arial, sans-serif;
    text-align: center;
    color: #18384f;
}

body.is-loading .name-screen,
body.is-loading .game-container,
body.is-loading .direct-container {
    visibility: hidden;
}

/* Game loading screen */
.game-loader {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(24, 56, 79, 0.88), rgba(47, 111, 149, 0.82));
    backdrop-filter: blur(4px);
    opacity: 1;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.game-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-card {
    width: min(86vw, 320px);
    padding: 30px 24px 28px;
    box-sizing: border-box;
    border: 1px solid rgba(216, 237, 248, 0.7);
    border-radius: 18px;
    background: rgba(255, 250, 246, 0.94);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.loader-card p {
    margin: 18px 0 14px;
    color: #18384f;
    font-size: 16px;
    font-weight: 800;
}

.loader-cat {
    position: relative;
    width: 96px;
    height: 82px;
    margin: 0 auto;
    animation: loaderFloat 1.6s ease-in-out infinite;
}

.loader-ear {
    position: absolute;
    top: 6px;
    width: 34px;
    height: 34px;
    background: #d8edf8;
    border: 3px solid #2f6f95;
    border-radius: 8px 8px 2px 8px;
}

.loader-ear.left {
    left: 12px;
    transform: rotate(28deg);
}

.loader-ear.right {
    right: 12px;
    transform: rotate(62deg);
}

.loader-face {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 84px;
    height: 68px;
    transform: translateX(-50%);
    border: 3px solid #2f6f95;
    border-radius: 38px 38px 30px 30px;
    background: #f7fbfe;
}

.loader-eye {
    position: absolute;
    top: 26px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #18384f;
    animation: loaderBlink 2.4s ease-in-out infinite;
}

.loader-eye.left {
    left: 24px;
}

.loader-eye.right {
    right: 24px;
}

.loader-nose {
    position: absolute;
    left: 50%;
    top: 38px;
    width: 10px;
    height: 7px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #d98d8a;
}

.loader-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2f6f95;
    animation: loaderDot 1s ease-in-out infinite;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes loaderFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes loaderBlink {
    0%, 88%, 100% { transform: scaleY(1); }
    92%, 96% { transform: scaleY(0.12); }
}

@keyframes loaderDot {
    0%, 100% { transform: translateY(0); opacity: 0.45; }
    50% { transform: translateY(-6px); opacity: 1; }
}

/* Background */
.background {
    position: fixed;
    width: 100%;
    height: 100%;
    background: url('../images/optimized/background.webp') no-repeat center center;
    background-size: cover;
    z-index: -2;
}

.background::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(19, 25, 17, 0.38), rgba(19, 25, 17, 0.18) 45%, rgba(19, 25, 17, 0.42));
    z-index: -1;
}

/* Name entry screen */
.name-screen {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(22, 30, 22, 0.42);
    backdrop-filter: blur(3px);
}

.name-screen.is-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.name-card {
    width: min(92vw, 420px);
    padding: 24px 24px 26px;
    box-sizing: border-box;
    border: 1px solid rgba(216, 237, 248, 0.8);
    border-radius: 18px;
    background: rgba(255, 250, 246, 0.95);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
    text-align: center;
}

.brand-mark {
    width: 78px;
    height: 78px;
    display: block;
    margin: -4px auto 12px;
    border-radius: 22px;
    box-shadow: 0 10px 22px rgba(47, 111, 149, 0.12);
}

.name-card-art {
    width: min(230px, 70%);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 12px 26px rgba(47, 111, 149, 0.16);
}

.name-eyebrow {
    margin: 0 0 8px;
    color: #2f6f95;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.name-card h1 {
    margin: 0 0 18px;
    color: #18384f;
    font-size: 28px;
    line-height: 1.2;
}

.name-input-wrap {
    margin-bottom: 14px;
}

.name-input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    box-sizing: border-box;
    border: 2px solid #d8edf8;
    border-radius: 14px;
    background: #fff;
    color: #18384f;
    font-size: 16px;
    text-align: center;
    outline: none;
}

.name-input-wrap input:focus {
    border-color: #2f6f95;
    box-shadow: 0 0 0 4px rgba(47, 111, 149, 0.14);
}

.name-card button {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 14px;
    background: #2f6f95;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.name-card button:hover {
    background: #255f82;
}

/* Container */
.game-container {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    contain: layout paint;
}

/* Top UI (text + bar) */
.ui-top {
    position: absolute;
    top: 7%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 520px;
    text-align: center;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Text */
#catText {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    margin: 0 auto 12px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    background: rgba(255, 250, 246, 0.88);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
    color: #18384f;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

/* Bar */
.bar-container {
    width: 76%;
    max-width: 320px;
    height: 18px;
    background: rgba(255, 250, 246, 0.58);
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(24, 56, 79, 0.14), 0 8px 20px rgba(0, 0, 0, 0.12);
}

#bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d8edf8, #b7dbef, #2f6f95);
    border-radius: inherit;
    transition: width 0.35s ease;
}

/* CAT POSITION */
.cat-area {
    position: absolute;
    top: 62%; 
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Cat size */
.cat-area img {
    width: 340px; /* bigger */
    max-width: 85%;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.22));
    transform-origin: 50% 90%;
    transition: filter 0.2s ease;
}


/* Buttons container */
.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap; 
    padding: 0 14px;
    box-sizing: border-box;
}

/* Buttons */
.controls, .unlock {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    z-index: 6;
}

/* Buttons style */
.controls button {
    min-width: 94px;
    min-height: 50px;
    padding: 10px 14px;
    border: none;
    border-radius: 999px;
    color: #18384f;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap; 
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.controls button::before {
    display: block;
    margin-bottom: 2px;
    font-size: 19px;
    line-height: 1;
}

.controls button span {
    display: block;
}

.controls button:hover,
.controls button:focus-visible,
#openBtn:hover,
#openBtn:focus-visible,
.name-card button:hover,
.name-card button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
    filter: brightness(1.03);
}

.controls button:active,
#openBtn:active,
.name-card button:active {
    transform: translateY(1px) scale(0.98);
}

.pet-btn {
    background: linear-gradient(180deg, #f7fbfe, #d8edf8);
}

.pet-btn::before {
    content: "♡";
}

.feed-btn {
    background: linear-gradient(180deg, #fff8df, #e8d98f);
}

.feed-btn::before {
    content: "+";
}

.scold-btn {
    background: linear-gradient(180deg, #eaf6fc, #b7dbef);
}

.scold-btn::before {
    content: "!";
}

/* Open button */
#openBtn {
    display: none;
    min-height: 54px;
    padding: 14px 26px;
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #2f6f95, #8bbfdd);
    color: white;
    border: none;
    border-radius: 999px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

#openBtn::before {
    content: "✉ ";
}

.cat-bounce {
    animation: catBounce 0.58s cubic-bezier(.25, .9, .35, 1);
}

.cat-hop {
    animation: catHop 0.64s cubic-bezier(.2, .9, .3, 1);
}

.cat-shake {
    animation: catShake 0.46s ease-in-out;
}

.cat-ending-transition {
    animation: catEndingTransition 0.72s cubic-bezier(.2, .9, .28, 1) both;
}

@keyframes catBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-18px) scale(1.03); }
    62% { transform: translateY(4px) scale(0.99); }
}

@keyframes catHop {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    30% { transform: translateY(-24px) rotate(-2deg) scale(1.04); }
    60% { transform: translateY(3px) rotate(2deg) scale(0.99); }
}

@keyframes catShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    18% { transform: translateX(-10px) rotate(-3deg); }
    36% { transform: translateX(9px) rotate(3deg); }
    54% { transform: translateX(-7px) rotate(-2deg); }
    72% { transform: translateX(5px) rotate(1deg); }
}

@keyframes catEndingTransition {
    0% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.22));
    }
    35% {
        transform: translateY(-8px) scale(1.03);
        filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.2));
    }
    70% {
        transform: translateY(2px) scale(0.995);
    }
    100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.22));
    }
}

/* Mobile optimization */
@media (max-width: 600px) {
    .background {
        background-image: url('../images/mobile/background.webp');
    }


    .loader-card {
        width: min(88vw, 290px);
        padding: 26px 20px 24px;
    }

    .loader-cat {
        width: 84px;
        height: 74px;
    }

    .loader-face {
        width: 74px;
        height: 60px;
    }

    .name-screen {
        padding: 18px;
    }

    .name-card {
        padding: 20px 18px 22px;
        border-radius: 16px;
    }

    .name-card-art {
        width: min(190px, 68%);
        margin-bottom: 14px;
    }

    .name-card h1 {
        font-size: 24px;
    }

    .ui-top {
        top: 3.5%;
        padding: 0 14px;
    }

    #catText {
        min-height: 48px;
        padding: 10px 14px;
        font-size: 15px;
    }

    .cat-area {
        top: 55%; /* sedikit naik biar ada ruang */
    }

    .cat-area img {
        width: 240px;
    }

    .controls, .unlock {
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .controls button {
        min-width: 86px;
        min-height: 44px;
        padding: 7px 9px;
        font-size: 12px;
    }
}

/* Courier cat scene polish */
.cat-area {
    top: 57%;
    width: min(92vw, 460px);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

#catText.speech-bubble {
    position: relative;
    z-index: 3;
    width: min(88vw, 420px);
    min-height: 64px;
    padding: 14px 18px;
    margin: 0 auto 18px;
    border: 2px solid rgba(47, 111, 149, 0.26);
    border-radius: 22px;
    background: rgba(255, 250, 246, 0.94);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

#catText.speech-bubble.is-silent {
    opacity: 0;
    transform: translateY(8px);
}

#catText.speech-bubble::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -15px;
    width: 26px;
    height: 26px;
    transform: translateX(-50%) rotate(45deg);
    z-index: -1;
    border-right: 2px solid rgba(47, 111, 149, 0.26);
    border-bottom: 2px solid rgba(47, 111, 149, 0.26);
    background: rgba(255, 250, 246, 0.94);
}

.cat-area.cat-arriving img {
    animation: courierArrive 2.45s cubic-bezier(.18, .85, .22, 1) both;
}

.action-scene {
    position: absolute;
    left: 50%;
    top: 55%;
    z-index: 2;
    width: 360px;
    max-width: 86vw;
    height: 260px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.action-hand,
.action-food,
.action-pointer,
.snack-bite {
    position: absolute;
    opacity: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.action-hand,
.action-pointer {
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.2));
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.action-hand {
    width: 230px;
    height: 128px;
    background-image: url("../images/game/hand-pet.webp");
}

.action-food {
    right: 38px;
    top: 126px;
    width: 168px;
    height: 126px;
    background-image: url("../images/game/food-bowl.webp");
    filter: drop-shadow(0 13px 18px rgba(0, 0, 0, 0.2));
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.snack-bite {
    right: 106px;
    top: 108px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #9a6b35;
}

.bite-two {
    right: 88px;
    top: 116px;
}

.action-pointer {
    right: -34px;
    top: 50px;
    width: 150px;
    height: 178px;
    transform-origin: left center;
    background-image: url("../images/game/hand-point.webp");
}

.action-scene.is-petting .action-hand {
    left: -36px;
    top: 28px;
    animation: petHand 1.45s ease-in-out both;
}

.action-scene.is-feeding .action-food {
    animation: foodOffer 1.7s ease-in-out both;
}

.action-scene.is-feeding .snack-bite {
    animation: snackBite 1.7s ease-in-out both;
}

.action-scene.is-feeding .bite-two {
    animation-delay: 0.12s;
}

.action-scene.is-scolding .action-pointer {
    animation: scoldPoint 1.35s ease-in-out both;
}

.controls.is-waiting button,
.controls button:disabled {
    opacity: 0.62;
    cursor: wait;
    transform: none;
}

.feed-btn::before {
    content: "○";
}

@keyframes courierArrive {
    0% {
        opacity: 0;
        transform: translateX(-12px) translateY(-92px) scale(0.3);
        filter: blur(1.6px) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.08));
    }
    24% {
        opacity: 1;
        transform: translateX(10px) translateY(-66px) scale(0.45) rotate(-0.5deg);
    }
    48% {
        transform: translateX(-7px) translateY(-40px) scale(0.62) rotate(0.45deg);
        filter: blur(0.6px) drop-shadow(0 10px 13px rgba(0, 0, 0, 0.13));
    }
    72% {
        transform: translateX(5px) translateY(-16px) scale(0.82) rotate(-0.35deg);
        filter: blur(0) drop-shadow(0 18px 22px rgba(0, 0, 0, 0.2));
    }
    88% {
        transform: translateX(-2px) translateY(-4px) scale(0.95) rotate(0.2deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1);
    }
}

@keyframes bubblePop {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.9);
    }
    70% {
        opacity: 1;
        transform: translateY(-2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes petHand {
    0% { opacity: 0; transform: translate(-130px, 14px) rotate(-5deg) scale(0.92); }
    18% { opacity: 1; transform: translate(48px, -6px) rotate(1deg) scale(1); }
    40% { opacity: 1; transform: translate(112px, 2px) rotate(4deg) scale(1.02); }
    62% { opacity: 1; transform: translate(54px, -8px) rotate(0deg) scale(1); }
    84% { opacity: 1; transform: translate(116px, 0) rotate(4deg) scale(1.02); }
    100% { opacity: 0; transform: translate(168px, 4px) rotate(7deg) scale(0.98); }
}

@keyframes foodOffer {
    0% { opacity: 0; transform: translate(120px, 54px) scale(0.72); }
    22% { opacity: 1; transform: translate(10px, 10px) scale(0.92); }
    54% { opacity: 1; transform: translate(-42px, 0) scale(0.92); }
    74% { opacity: 1; transform: translate(-50px, 4px) scale(0.86); }
    100% { opacity: 0; transform: translate(-58px, 18px) scale(0.78); }
}

@keyframes snackBite {
    0%, 24% { opacity: 0; transform: translate(18px, 26px) scale(0.4); }
    34%, 52% { opacity: 1; transform: translate(-10px, 2px) scale(1); }
    70%, 100% { opacity: 0; transform: translate(-42px, -16px) scale(0.35); }
}

@keyframes scoldPoint {
    0% { opacity: 0; transform: translate(104px, 34px) rotate(-42deg) scale(0.9); }
    20% { opacity: 1; transform: translate(16px, 10px) rotate(-54deg) scale(1); }
    38% { transform: translate(-8px, 6px) rotate(-60deg) scale(1.02); }
    56% { transform: translate(10px, 12px) rotate(-52deg) scale(1); }
    72% { opacity: 1; transform: translate(-6px, 8px) rotate(-58deg) scale(1.02); }
    100% { opacity: 0; transform: translate(96px, 32px) rotate(-42deg) scale(0.94); }
}

@media (max-width: 600px) {
    .cat-area {
        top: 46%;
        width: 96vw;
    }

    #catText.speech-bubble {
        width: min(90vw, 340px);
        min-height: 52px;
        padding: 12px 14px;
        margin-bottom: 12px;
        font-size: 14px;
    }

    .action-scene {
        top: 54%;
        width: 280px;
        height: 210px;
    }

    .action-hand {
        width: 176px;
        height: 98px;
    }

    .action-scene.is-petting .action-hand {
        left: -58px;
        top: 34px;
    }

    .action-food {
        right: 20px;
        top: 98px;
        width: 128px;
        height: 96px;
        filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.16));
    }

    .action-scene.is-feeding .action-food {
        animation: foodOfferMobile 1.45s ease-in-out both;
    }

    .action-scene.is-feeding .snack-bite {
        animation: snackBiteMobile 1.45s ease-in-out both;
    }

    .cat-hop {
        animation: catHopMobile 0.58s cubic-bezier(.2, .9, .3, 1);
    }

    .action-pointer {
        right: -12px;
        top: 82px;
        width: 118px;
        height: 140px;
        filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.16));
    }

    .action-scene.is-scolding .action-pointer {
        animation: scoldPointMobile 1.18s ease-in-out both;
    }

    .cat-shake {
        animation: catShakeMobile 0.42s ease-in-out;
    }
}

@keyframes foodOfferMobile {
    0% { opacity: 0; transform: translate(42px, 22px) scale(0.86); }
    22% { opacity: 1; transform: translate(8px, 6px) scale(0.94); }
    58% { opacity: 1; transform: translate(-12px, 2px) scale(0.94); }
    78% { opacity: 1; transform: translate(-16px, 4px) scale(0.9); }
    100% { opacity: 0; transform: translate(-18px, 8px) scale(0.86); }
}

@keyframes snackBiteMobile {
    0%, 28% { opacity: 0; transform: translate(10px, 16px) scale(0.35); }
    40%, 58% { opacity: 1; transform: translate(-8px, 0) scale(0.78); }
    78%, 100% { opacity: 0; transform: translate(-24px, -10px) scale(0.3); }
}

@keyframes catHopMobile {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    34% { transform: translateY(-10px) rotate(-1deg) scale(1.02); }
    66% { transform: translateY(2px) rotate(1deg) scale(0.995); }
}

@keyframes scoldPointMobile {
    0% { opacity: 0; transform: translate(48px, 18px) rotate(-40deg) scale(0.9); }
    22% { opacity: 1; transform: translate(8px, 6px) rotate(-50deg) scale(0.96); }
    44% { transform: translate(-4px, 4px) rotate(-54deg) scale(0.98); }
    66% { opacity: 1; transform: translate(4px, 6px) rotate(-49deg) scale(0.96); }
    100% { opacity: 0; transform: translate(46px, 16px) rotate(-40deg) scale(0.9); }
}

@keyframes catShakeMobile {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    22% { transform: translateX(-4px) rotate(-1deg); }
    44% { transform: translateX(4px) rotate(1deg); }
    66% { transform: translateX(-3px) rotate(-0.7deg); }
    82% { transform: translateX(2px) rotate(0.5deg); }
}

/* Direct invitation page for guests who prefer a simpler flow */
.home-page .background::after {
    background: linear-gradient(180deg, rgba(24, 56, 79, 0.46), rgba(24, 56, 79, 0.18) 42%, rgba(24, 56, 79, 0.52));
}

.home-name-screen {
    background: rgba(24, 56, 79, 0.34);
}

.home-name-card {
    width: min(92vw, 460px);
    padding: 22px 24px 26px;
    border-color: rgba(216, 237, 248, 0.95);
}

.home-photo-frame {
    position: relative;
    width: min(270px, 74%);
    aspect-ratio: 4 / 5;
    margin: 0 auto 18px;
    padding: 10px;
    border: 1px solid rgba(95, 168, 211, 0.28);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(216, 237, 248, 0.55));
    box-shadow: 0 16px 34px rgba(31, 79, 109, 0.18);
    box-sizing: border-box;
}

.home-photo-frame::before,
.home-photo-frame::after {
    content: "";
    position: absolute;
    width: 42px;
    height: 42px;
    border: 2px solid rgba(95, 168, 211, 0.4);
    pointer-events: none;
}

.home-photo-frame::before {
    top: 18px;
    left: 18px;
    border-right: 0;
    border-bottom: 0;
    border-radius: 16px 0 0;
}

.home-photo-frame::after {
    right: 18px;
    bottom: 18px;
    border-left: 0;
    border-top: 0;
    border-radius: 0 0 16px;
}

.home-photo-frame picture {
    display: block;
    width: 100%;
    height: 100%;
}

.home-couple-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

.direct-container {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    contain: layout paint;
}

.direct-cat-area {
    top: 50%;
    height: min(72vh, 560px);
    justify-content: flex-end;
}

.direct-cat-area #catText.speech-bubble {
    width: min(88vw, 500px);
    min-height: 82px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.55;
    flex: 0 0 auto;
}

.direct-cat-area img {
    flex: 0 0 auto;
}

.direct-unlock {
    bottom: calc(36px + env(safe-area-inset-bottom, 0px));
}

.direct-unlock #openBtn {
    display: none;
}

.home-page #openBtn::before {
    content: "";
}

.home-ornament {
    position: absolute;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    border: 1px solid rgba(216, 237, 248, 0.35);
    pointer-events: none;
    opacity: 0.75;
}

.home-ornament::before,
.home-ornament::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.home-ornament::before {
    inset: 28px;
    border: 1px solid rgba(95, 168, 211, 0.28);
}

.home-ornament::after {
    inset: 76px;
    background: rgba(216, 237, 248, 0.22);
}

.home-ornament-left {
    left: max(-80px, calc((100vw - 980px) / 2 - 120px));
    top: 16%;
}

.home-ornament-right {
    right: max(-86px, calc((100vw - 980px) / 2 - 130px));
    bottom: 16%;
}

@media (max-width: 600px) {
    .home-name-card {
        padding: 18px 18px 22px;
    }

    .home-photo-frame {
        width: min(230px, 72%);
        margin-bottom: 14px;
        padding: 8px;
        border-radius: 22px;
    }

    .home-couple-photo {
        border-radius: 15px;
    }

    .direct-cat-area {
        top: 45%;
        width: 96vw;
        height: min(68vh, 500px);
    }

    .direct-cat-area #catText.speech-bubble {
        width: min(90vw, 350px);
        min-height: 78px;
        font-size: 14px;
        line-height: 1.5;
    }

    .direct-unlock {
        bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }

    .home-ornament {
        width: 150px;
        height: 150px;
        opacity: 0.45;
    }
}
