@font-face {
    font-family: "UTM-Azkia";
    src: url("/assets/fonts/UTM-Azkia.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "Ephesis-Regular";
    src: url("/assets/fonts/Ephesis-Regular.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "VNF-Shelia-Regular";
    src: url("/assets/fonts/VNF-Shelia-Regular.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "UTM-Cafeta";
    src: url("/assets/fonts/UTM-Cafeta.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "LNTH-RaphLanokFuture";
    src: url("/assets/fonts/LNTH-RaphLanokFuture.otf") format("opentype");
    font-display: swap;
}

.font-azkia {
    font-family: "UTM-Azkia", sans-serif;
}

.font-ephesis {
    font-family: "Ephesis-Regular", sans-serif;
}

.font-shelia {
    font-family: "VNF-Shelia-Regular", sans-serif;
}

.font-cafeta {
    font-family: "UTM-Cafeta", sans-serif;
}

.font-raphlanok {
    font-family: "LNTH-RaphLanokFuture", sans-serif;
}

.font-roboto {
    font-family: "Roboto", sans-serif;
}

.font-barlow {
    font-family: "Barlow", sans-serif;
}

.font-arial {
    font-family: "Arial", sans-serif;
}

.font-abril-fatface {
    font-family: "Abril Fatface", sans-serif;
}
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.active-heart {
    position: relative;
}

.active-heart::before {
    content: "";
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 94px;
    height: 94px;
    background: center center / cover no-repeat scroll content-box border-box url(/assets/images/heart.webp);
    filter: contrast(0%) grayscale(0%) hue-rotate(0deg) invert(0%) saturate(100%) sepia(0%) opacity(100%) brightness(200%);
    animation: fadeInOut 2s ease-in-out infinite;
}
@keyframes fadeInOut {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.heart-couple::before {
    content: "";
    position: absolute;
    top: -64px;
    width: 146px;
    height: 146px;
    left: 50%;
    margin-left: -73px; /* width / 2 = 146 / 2 = 73px */
    transform-origin: center center;
    background: center center / cover no-repeat scroll content-box border-box url(/assets/images/heart.webp);
    filter: contrast(0%) grayscale(0%) hue-rotate(0deg) invert(0%) saturate(100%) sepia(0%) opacity(100%) brightness(200%);
    animation: zoomInOutHeartCouple 2.5s ease-in-out infinite;
}

@keyframes zoomInOutHeartCouple {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.active-heart-couple::before {
    content: "";
    position: absolute;
    top: -50%;
    left: 54%;
}

.line-heart {
    overflow: hidden;
    position: absolute;
    right: -172px;
    top: -28px;
}

.line-heart img {
    filter: contrast(0%) grayscale(0%) hue-rotate(0deg) invert(0%) saturate(100%) sepia(0%) opacity(100%) brightness(200%) blur(0px);
}

.split-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
}

.split-right {
    position: absolute;
    top: 0;
    right: 0;
}
.processing-wedding::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    text-align: center;
}
.processing-wedding::after {
    content: "Đang diễn ra";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 24px;
    font-weight: bold;
}

@keyframes slideLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Animation trượt sang phải */
@keyframes slideRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

@keyframes hiddenAnimation {
    from {
        display: block;
    }
    to {
        display: none;
    }
}

.animate-slide-left {
    animation: slideLeft 3.5s ease-in-out forwards;
}

.animate-slide-right {
    animation: slideRight 3.5s ease-in-out forwards;
}
.animate-hidden {
    animation: hiddenAnimation 2s ease-in-out forwards;
}

/* Mobile: cỡ chữ ổn định khi xoay / pinch; giảm độ trễ chạm */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Nút nhạc góc phải — icon xoay khi đang phát */
@keyframes music-toggle-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.music-toggle-btn {
    position: fixed;
    /* Dưới lớp cửa mở (z-10 trong index.html), cao hơn nội dung in-flow mặc định */
    z-index: 5;
    top: max(0.75rem, env(safe-area-inset-top, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    color: #7a1d25;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 2px 12px rgba(47, 43, 42, 0.12),
        0 0 0 2px rgba(122, 29, 37, 0.2);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.music-toggle-btn:active {
    transform: scale(0.94);
}

.music-toggle-btn:focus-visible {
    outline: 2px solid #7a1d25;
    outline-offset: 2px;
}

.music-toggle-btn__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.music-toggle-btn__icon {
    display: block;
    transform-origin: center center;
}

.music-toggle-btn.is-playing .music-toggle-btn__icon {
    animation: music-toggle-spin 12s linear infinite;
}

/* Nút mừng cưới — icon hộp quà rung rinh */
@keyframes gift-money-wiggle {
    0%,
    100% {
        transform: rotate(0deg) translateY(0);
    }
    12% {
        transform: rotate(-14deg) translateY(1px);
    }
    24% {
        transform: rotate(12deg) translateY(0);
    }
    36% {
        transform: rotate(-10deg) translateY(1px);
    }
    48% {
        transform: rotate(8deg) translateY(0);
    }
    60% {
        transform: rotate(-5deg) translateY(0);
    }
    72% {
        transform: rotate(3deg) translateY(0);
    }
}

.gift-money-btn__icon {
    display: inline-flex;
    line-height: 0;
    transform-origin: 50% 10%;
    animation: gift-money-wiggle 2.8s ease-in-out infinite;
}

.gift-money-btn:hover .gift-money-btn__icon,
.gift-money-btn:focus-visible .gift-money-btn__icon {
    animation-duration: 1.1s;
}

@media (prefers-reduced-motion: reduce) {
    .gift-money-btn__icon {
        animation: none;
    }
}
