* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primary-red: #b41a1a;
    --primary-yellow: #ffcc00;
    --secondary-yellow: #ffeb99;
    --light-yellow: #fff9e6;
    --dark-red: #8b0000;
    --gold: #d4af37;
    --moon-glow: #fff9e6;
    --star-color: #ffffff;
    --section-bg: rgba(255, 255, 255, 0.05);
}
/* fallback để tránh flash trắng trên Safari */
body { background-color:#1c1a17; background-attachment: scroll; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }

body {
    font-family: 'Comfortaa', cursive;
    background: linear-gradient(to bottom, #0F0F0F,#1C1A17, #2A2621,#3D3328);
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}
/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a2a, #1a1a4a);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}
.loading-content {
    text-align: center;
}
.moon-loader {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Parallax layers */
.parallax {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}
#fireworks-canvas {
    /* Đặt canvas cố định và phủ lên toàn bộ trang */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
   
    /* Đặt ở lớp trên cùng để không bị che khuất */
    z-index: 9999;
   
    /* Cho phép click xuyên qua canvas vào các phần tử bên dưới */
    pointer-events: none;
   
    /* Mặc định ẩn đi, chỉ hiện ra khi được kích hoạt bằng JavaScript */
    display: none;
}
#cursor-stars-canvas {
    /* Đặt canvas cố định, phủ lên toàn bộ trang */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
   
    /* Đặt ở lớp siêu trên cùng để nó hiện trên mọi thứ khác */
    z-index: 10000;
   
    /* Rất quan trọng: Cho phép click chuột "xuyên qua" canvas,
      nếu không bạn sẽ không thể bấm vào các nút bên dưới. */
    pointer-events: none;
}
body {
    /* Thêm thuộc tính này vào body để ẩn con trỏ chuột mặc định đi,
      tạo cảm giác chỉ có vệt sáng là con trỏ duy nhất. */
    cursor: none;
}
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, var(--star-color), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--star-color), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--star-color), transparent),
        radial-gradient(1px 1px at 130px 80px, var(--star-color), transparent),
        radial-gradient(2px 2px at 160px 30px, var(--star-color), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.moon {
    position: absolute;
    top: 10%;
    right: 10%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--moon-glow), var(--secondary-yellow));
    border-radius: 50%;
    box-shadow:
        0 0 60px var(--primary-yellow),
        0 0 100px rgba(255, 204, 0, 0.3);
    animation: float 6s ease-in-out infinite;
    filter: blur(0.5px);
}
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    opacity: 0.7;
    filter: blur(2px);
}
.cloud-1 {
    width: 120px;
    height: 40px;
    top: 20%;
    left: 5%;
    animation: drift 25s linear infinite;
}
.cloud-2 {
    width: 180px;
    height: 60px;
    top: 40%;
    right: 5%;
    animation: drift 30s linear infinite reverse;
}
.cloud-3 {
    width: 100px;
    height: 30px;
    top: 70%;
    left: 10%;
    animation: drift 20s linear infinite;
}
/* Floating Elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}
.floating-lantern,
.floating-cake,
.floating-rabbit,
.floating-star {
    position: absolute;
    font-size: 24px;
    opacity: 0.7;
    animation: floatAround 20s linear infinite;
}
.floating-lantern {
    top: 20%;
    left: 5%;
    animation-delay: 0s;
}
.floating-cake {
    top: 60%;
    left: 10%;
    animation-delay: -5s;
}
.floating-rabbit {
    top: 40%;
    right: 8%;
    animation-delay: -10s;
}
.floating-star {
    top: 80%;
    right: 5%;
    animation-delay: -15s;
}
@keyframes floatAround {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(100px, 50px) rotate(90deg);
    }
    50% {
        transform: translate(50px, 100px) rotate(180deg);
    }
    75% {
        transform: translate(-50px, 50px) rotate(270deg);
    }
}
/* Navigation Dots */
.nav-dots {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.dot.active {
    background: var(--primary-yellow);
    transform: scale(1.3);
    box-shadow: 0 0 10px var(--primary-yellow);
}
.dot:hover {
    background: var(--secondary-yellow);
    transform: scale(1.2);
}
/* Sections */
section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 80px 20px;
}
.section-container {
    max-width: 2000px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero {
    padding-top: 120px;
}
.hero-content {
    position: relative;
    z-index: 2;
}
h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--primary-yellow), var(--secondary-yellow), var(--primary-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: shimmer 3s ease-in-out infinite;
}
.glow-text {
    text-shadow:
        0 0 20px var(--primary-yellow),
        0 0 40px var(--primary-yellow),
        0 0 60px var(--primary-yellow);
}
@keyframes shimmer {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 200% center;
    }
}
h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--secondary-yellow);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}
.subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    max-width: 800px;
    line-height: 1.6;
    opacity: 0.9;
}
.centered-subtitle {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
/* Portrait placeholder */
.portrait {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 4px solid var(--gold);
    background: linear-gradient(45deg, var(--primary-red), var(--primary-yellow));
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
    overflow: hidden;
    box-shadow:
        0 0 30px var(--primary-yellow),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    position: relative;
    animation: portraitGlow 3s ease-in-out infinite alternate;
}
@keyframes portraitGlow {
    0% {
        box-shadow:
            0 0 20px var(--primary-yellow),
            inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
    100% {
        box-shadow:
            0 0 40px var(--primary-yellow),
            0 0 60px rgba(255, 204, 0, 0.3),
            inset 0 0 20px rgba(255, 255, 255, 0.3);
    }
}
.portrait-placeholder {
    color: white;
    text-align: center;
    padding: 20px;
}
.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}
/* Scroll Indicator */
.scroll-indicator {
    margin-top: 50px;
    animation: bounce 2s infinite;
}
.scroll-arrow {
    width: 30px;
    height: 30px;
    border-right: 3px solid var(--primary-yellow);
    border-bottom: 3px solid var(--primary-yellow);
    transform: rotate(45deg);
    margin: 0 auto;
}
/* Typewriter effect */
.typewriter {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.3rem;
    line-height: 1.8;
    text-align: left;
    background: var(--section-bg);
    padding: 40px;
    border-radius: 20px;
    border-left: 5px solid var(--primary-yellow);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.cursor {
    display: inline-block;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-yellow), var(--secondary-yellow));
    margin-left: 5px;
    animation: blink 1s infinite;
}
/* Wish section */
.wish-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}
.wish-input {
    width: 100%;
    padding: 20px;
    border: 2px solid var(--primary-yellow);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'Comfortaa', cursive;
    font-size: 1.1rem;
    margin-bottom: 25px;
    resize: none;
    height: 150px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.wish-input:focus {
    outline: none;
    border-color: var(--secondary-yellow);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
    transform: translateY(-2px);
}
.wish-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}
/* Buttons */
.btn {
    position: relative;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-family: 'Comfortaa', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.magic-btn {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red), var(--primary-red));
    background-size: 200% auto;
    animation: gradientShift 3s ease infinite;
}
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 200% center;
    }
}
.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}
.magic-btn:hover .btn-glow {
    left: 100%;
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 204, 0, 0.3);
}
.btn:active {
    transform: translateY(-1px);
}
.secondary-btn {
    background: linear-gradient(135deg, #666, #888);
}
.lantern-release {
    margin-top: 50px;
    position: relative;
    height: 100vh; /* Tăng chiều cao container để phù hợp với đèn lồng bay hết web */
    width: 100%;
    overflow: visible; /* Cho phép đèn lồng bay ra ngoài container */
}
/* Wish History (now Moon Palace) */
.wish-history {
    margin-top: 40px;
    padding: 20px;
    background: var(--section-bg);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}
.moon-palace {
    position: relative;
    height: 200px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}
.hanging-lantern {
    
    top: 0;
    cursor: pointer;
    animation: sway 3s ease-in-out infinite alternate;
}
.lantern-body {
    font-size: 120px;
}
.wish-detail {
    display: none;
    position: absolute;
    top: 50px;
    left: -50px;
    width: 200px;
    background: rgba(255, 255, 255, 0.8);
    color: black;
    padding: 10px;
    border-radius: 10px;
}
.hanging-lantern:hover .wish-detail {
    display: block;
}
.prayer-note {
    font-style: italic;
    color: var(--primary-brown);
}
@keyframes sway {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}
/* Moon Scene Overlay */
.moon-scene-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.moon-scene-content {
    background: linear-gradient(to bottom, #0a0a2a, #1a1a4a);
    padding: 40px;
    border-radius: 20px;
    display: flex;
    justify-content: space-around;
    width: 80%;
    max-width: 800px;
}
.character {
    position: relative;
    text-align: center;
}
.character-img {
    width: 250px; /* Giảm kích thước để vừa overlay */
    height: auto;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5); /* Ánh sáng vàng quanh nhân vật */
    transition: transform 0.5s ease; /* Hiệu ứng hover */
}
.character:hover .character-img {
    transform: scale(1.05); /* Phóng to khi hover */
}

.speech-bubble {
    display: none;
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: black;
    padding: 10px;
    border-radius: 10px;
    width: 150px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.speech-bubble:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    border: 5px solid transparent;
    border-top-color: white;
}
.animate-bubble {
    animation: fadeIn 1s ease-in-out;
}
.prayer-effect {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 0, 0.3);
    animation: sparkle 2s ease-in-out;
}
.prayer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
}
.animate-prayer {
    display: block;
}
@keyframes sparkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; box-shadow: 0 0 20px yellow; }
}
/* Secret letter */
.secret-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}
.password-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.password-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--primary-yellow);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'Comfortaa', cursive;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.password-input:focus {
    outline: none;
    border-color: var(--secondary-yellow);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
}
.secret-btn {
    padding: 15px 25px;
}
.hint-text {
    color: var(--secondary-yellow);
    font-style: italic;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}
.secret-content {
    display: none;
    margin-top: 30px;
    animation: slideUp 0.5s ease;
}
.letter-paper {
    background: linear-gradient(to bottom, #fff9e6, #ffeb99);
    padding: 40px;
    border-radius: 15px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 0 50px rgba(255, 204, 0, 0.1);
    position: relative;
    color: #8b4513;
    text-align: left;
}
.letter-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><path d="M0,0 L100,0 L100,100 L0,100 Z" fill="none" stroke="%238b4513" stroke-width="1"/></svg>');
    pointer-events: none;
}
.letter-content {
    position: relative;
    z-index: 1;
}
.letter-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.1rem;
}
.letter-signature {
    text-align: right;
    margin-top: 30px;
    font-style: italic;
}
.signature-name {
    font-weight: bold;
    color: var(--primary-red);
}
/* Fireworks */
.fireworks-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: none;
}
/* Footer */
footer {
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    position: relative;
}
.footer-content {
    max-width: 800px;
    margin: 0 auto;
}
.footer-moon {
    font-size: 3rem;
    margin-top: 20px;
    animation: float 4s ease-in-out infinite;
}
.signature {
    font-size: 1.5rem;
    color: var(--primary-yellow);
    margin-top: 20px;
    font-weight: bold;
}
/* Music Control */
.music-control {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
}
.music-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.music-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}
.volume-control {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    display: none;
}
.music-control:hover .volume-control {
    display: block;
}
#volume-slider {
    width: 100px;
}
/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
@keyframes drift {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(calc(100vw + 100px)); }
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Đèn lồng bay lên (cập nhật để giống thật hơn với đung đưa và flicker ánh sáng) */
@keyframes wishFly {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    20% {
        transform: translateY(-150px) rotate(7deg) scale(1.1); /* Tăng scale để to hơn khi bay */
    }
    50% {
        transform: translateY(-400px) translateX(30px) rotate(-7deg) scale(1.05);
    }
    80% {
        transform: translateY(-800px) translateX(-15px) rotate(5deg) scale(1);
        opacity: 0.9;
    }
    100% {
        transform: translateY(-200vh) rotate(0deg) scale(0.7); /* Tăng khoảng cách bay để hết web */
        opacity: 0;
    }
}
/* Hiệu ứng đung đưa cho tua rua */
@keyframes swing {
    0% {
        transform: rotate(-7deg); /* Đung đưa mạnh hơn */
    }
    100% {
        transform: rotate(7deg);
    }
}
/* Hiệu ứng nhấp nháy ánh sáng bên trong đèn lồng */
@keyframes flicker {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}
/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .subtitle { font-size: 1.1rem; }
    .typewriter { font-size: 1.1rem; padding: 25px; }
    .password-group { flex-direction: column; }
    .nav-dots { display: none; }
    .fireworks-controls { flex-direction: column; }
    .music-control { bottom: 10px; left: 10px; }
    .lantern-release { height: 100vh; } /* Giữ chiều cao cho mobile */
    .moon-scene-content {
        flex-direction: column;
        padding: 20px;
    }
}
.portrait img {
    /* Các thuộc tính định dạng khác cho ảnh (nếu có) */
    width: 100%; /* Giả sử ảnh chiếm 100% khung cha */
    height: 100%;
    object-fit: cover; /* Đảm bảo ảnh vừa khung mà không bị méo */
    border-radius: 50%; /* Để ảnh có hình tròn */
    
    /* Dòng này để tăng độ sáng */
    filter: brightness(1.45); /* Tăng độ sáng lên 30% (1.3 = 130%) */
    /* Bạn có thể thử các giá trị khác như brightness(1.1) hoặc brightness(1.5) */
}
.falling-photo {
    position: fixed; /* Vị trí cố định để rơi trên toàn màn hình */
    top: -150px; /* Bắt đầu từ phía trên màn hình */
    z-index: 9998; /* Nằm dưới pháo hoa nhưng trên các nội dung khác */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    pointer-events: none; /* Để không click vào ảnh được */
    height: auto; /* Giữ đúng tỷ lệ ảnh */
}

/* Định nghĩa hoạt ảnh rơi và xoay */
@keyframes fallAndRotate {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        /* Rơi xuống hết màn hình và cộng thêm 150px để biến mất hoàn toàn */
        transform: translateY(calc(100vh + 150px)) rotate(720deg); /* Xoay 2 vòng */
        opacity: 0;
    }
/* --- Moon Scene glow & layout upgrade --- */
.moon-scene-overlay {
    backdrop-filter: blur(6px) saturate(120%);
    background: radial-gradient(1200px 800px at 50% 60%, rgba(255,255,200,0.15), rgba(0,0,0,0.75));
    animation: fadeIn 400ms ease;
  }
  
  .moon-scene-content {
    gap: 28px;
    align-items: flex-end;
    border: 1px solid rgba(255, 240, 200, 0.15);
    box-shadow: 0 12px 60px rgba(255, 220, 120, 0.15), inset 0 0 40px rgba(255, 240, 180, 0.05);
  }
  
  /* Nhân vật nổi nhẹ + đổ bóng vàng ấm */
  .character-img {
    filter: drop-shadow(0 6px 24px rgba(255, 210, 90, 0.45));
    animation: float 5.5s ease-in-out infinite;
    will-change: transform, filter;
  }
  .character.hang {
    /* Tuỳ chỉnh nhanh */
    --halo-color1: rgba(255, 236, 200, 0.50);  /* lõi sáng */
    --halo-color2: rgba(255, 210, 120, 0.20);  /* viền mờ */
    --halo-cx: 52%;         /* tâm halo theo trục X (0%...100%) */
    --halo-cy: 42%;         /* tâm halo theo trục Y */
    --halo-stop2: 46%;      /* bán kính vùng chuyển màu 1 */
    --halo-stop3: 72%;      /* bán kính tan biến */
    --halo-blur: 22px;      /* độ mờ */
    --halo-scale: 1;        /* phóng to/thu nhỏ halo */
    --halo-rotate: 0deg;    /* xoay elip halo */
  }
  /* Vầng hào quang sau nhân vật */
  .character.hang::before {
    content: "";
    position: absolute;
    inset: -12% -8% -6% -8%;
    background:
      radial-gradient(
        circle at var(--halo-cx) var(--halo-cy),
        var(--halo-color1),
        var(--halo-color2) var(--halo-stop2),
        transparent var(--halo-stop3)
      );
    filter: blur(var(--halo-blur));
    transform: rotate(var(--halo-rotate)) scale(var(--halo-scale));
    border-radius: 24px;
    z-index: -1;
    transition: .6s ease; /* mượt khi đổi biến */
  }
  .character.hang.halo-golden {
    --halo-color1: rgba(255, 239, 190, .55);
    --halo-color2: rgba(255, 205, 80,  .22);
  }
  .character.hang.halo-moonbow::after {
  content:"";
  position:absolute;
  inset:-12% -8% -6% -8%;
  /* vòng tròn ngoài + mặt nạ tạo “nhẫn” */
  background:
    radial-gradient(circle at 50% 60%, rgba(255,255,255,.25), transparent 66%),
    conic-gradient(from 0deg at 50% 60%,
      #ffd166, #ff6b6b, #c77dff, #6ec6ff, #8bd450, #ffd166);
  -webkit-mask: radial-gradient(circle at 50% 60%,
      transparent 47%, black 49%, black 65%, transparent 67%);
          mask: radial-gradient(circle at 50% 60%,
      transparent 47%, black 49%, black 65%, transparent 67%);
  filter: drop-shadow(0 0 12px rgba(255,240,160,.4));
  border-radius: 24px;
  z-index:-1;
  animation: haloSpin 18s linear infinite;
}

@keyframes haloSpin {
  to { transform: rotate(360deg); }
}
  /* Bong bóng thoại đẹp + “đuôi” cong */
  .speech-bubble {
    display: none;
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #fff, #fffbe8);
    color: #3b2f17;
    padding: 12px 14px;
    border-radius: 14px;
    min-width: 180px; max-width: 260px;
    box-shadow: 0 8px 26px rgba(0,0,0,0.25);
    border: 1px solid rgba(180,150,60,0.35);
    font-weight: 500;
  }
  .speech-bubble::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.15));
  }
  
  /* Text đang gõ */
  .typing-caret {
    display: inline-block; width: 6px; height: 1em; margin-left: 2px;
    background: linear-gradient(#ffcc00, #ffd45a);
    animation: blink .9s step-end infinite;
  }
  
  /* Hạt sáng cầu nguyện */
  .prayer-effect {
    pointer-events: none;
    background: radial-gradient(240px 240px at 50% 50%, rgba(255,230,120,0.25), transparent 60%);
    mix-blend-mode: screen;
    animation: prayerPulse 2.2s ease-in-out infinite;
    border-radius: 50%;
  }
  
  /* Sao lấp lánh trong overlay (JS sẽ thêm .sparkle-star) */
  .sparkle-star {
    position: absolute; width: 4px; height: 4px; border-radius: 50%;
    background: #fff; opacity: .8;
    box-shadow: 0 0 12px rgba(255,255,200,.9), 0 0 24px rgba(255,240,160,.6);
    animation: twinkleOverlay 1.8s ease-in-out infinite;
  }
  
  /* Bảng tên dưới chân nhân vật */
  .nameplate {
    margin-top: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #ffe08a;
    text-shadow: 0 0 12px rgba(255,210,90,.35);
  }
  
  /* Mobile tinh gọn */
  @media (max-width: 540px) {
    .character-img { width: 200px; }
    .speech-bubble { top: -60px; max-width: 70vw; font-size: .95rem; }
  }
.cloud { will-change: transform; }
@keyframes drift {
  0% { transform: translateX(-20vw) translateZ(0) scale(1); }
  100% { transform: translateX(120vw) translateZ(0) scale(1.1); }
}
.moon { will-change: transform; transform: translateZ(0); }
.prayer-spark { position:absolute; width:6px; height:6px; border-radius:50%; background: radial-gradient(circle, #fff9c4, transparent); box-shadow:0 0 12px #fff3aa; opacity:0; animation: sparkIn 1s ease-in-out infinite; }
@keyframes sparkIn { 0%{opacity:0; transform:scale(.6);}50%{opacity:1; transform:scale(1.2);}100%{opacity:0; transform:scale(.8);} }

  /* Extra keyframes */
  @keyframes prayerPulse {
    0% { transform: scale(.92); opacity: .35;}
    50% { transform: scale(1.06); opacity: .75; }
    100% { transform: scale(.92); opacity: .35;}
  }
  @keyframes twinkleOverlay {
    0%,100% { transform: scale(1); opacity: .7; }
    50% { transform: scale(1.5); opacity: 1; }
  }
  
}