* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #0d0d0d;
    color: white;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Sửa lại class ẩn để hỗ trợ animation mượt mà */
.hidden {
    display: none !important;
    opacity: 0;
}

/* Nút bấm chung */
button {
    margin-top: 35px;
    padding: 12px 35px;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: bold;
    color: white;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    opacity: 1;
    /* Đảm bảo hiển thị khi bỏ hidden */
}

button:hover {
    background: rgba(255, 255, 255, 0.15);
}

#open-btn {
    background: rgba(255, 166, 175, 0.2);
    border: 1px solid rgba(255, 200, 210, 0.8);
    box-shadow: 0 0 15px rgba(255, 166, 175, 0.5), 0 0 30px rgba(255, 166, 175, 0.3);
    animation: pulsePink 2s infinite;
    transition: opacity 0.5s ease;
}

@keyframes pulsePink {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 166, 175, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(255, 166, 175, 0.8), 0 0 45px rgba(255, 166, 175, 0.5);
    }
}

#countdown-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    transition: opacity 1s ease;
    background-color: #24141c;
    background-image:
        radial-gradient(circle at 50% 40%, rgba(182, 116, 131, 0.45) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(104, 60, 88, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(145, 92, 102, 0.3) 0%, transparent 50%);
}

#petals-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.content-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    /* Giảm nhẹ để vừa màn hình mobile hơn */
    margin-bottom: 30px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px #ffccdd;
    text-align: center;
    line-height: 1.2;
    font-style: italic;
}

.timer {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.time-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px 20px;
    text-align: center;
    min-width: 85px;
}

.time-box span {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.time-box p {
    font-size: 0.7rem;
    color: #ddd;
    margin-top: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#cake-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s ease-out;
    z-index: 10;
    background: radial-gradient(circle at center, #2a2a2a 0%, #0d0d0d 60%);
}

.fade-in {
    animation: fadeIn 1.5s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.cake-container {
    position: relative;
    cursor: pointer;
    text-align: center;
    margin-bottom: 60px;
    /* Tạo không gian an toàn cho nút phía dưới */
}

.cake-img {
    max-width: 400px;
    max-height: 400px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.hint {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    font-size: 1.2rem;
    color: #ccc;
    animation: textPulse 1.5s infinite;
    transition: opacity 0.4s ease;
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

#wish-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 5;
    background-color: #050505;
}

#matrix-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#messages-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    text-align: center;
    z-index: 2;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.message-line {
    font-size: 2.8rem;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    color: #ffffff;
    text-shadow: 0 0 10px #fff, 0 0 20px #ff66b2, 0 0 30px #ff3399;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    text-align: center;
    line-height: 1.4;
}

#wish-btn {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    transition: opacity 0.5s ease;
}

/* Style cho dòng chữ nhỏ dưới đồng hồ */
.sub-hint {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    /* Màu trắng mờ tinh tế */
    margin-top: 15px;
    margin-bottom: 5px;
    letter-spacing: 1px;
    font-style: italic;
    text-align: center;
    animation: pulseGlow 2.5s infinite ease-in-out;
}

/* Hiệu ứng mờ tỏ nhẹ nhàng cho dòng chữ */
@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.5;
        text-shadow: 0 0 5px rgba(255, 192, 203, 0);
    }

    50% {
        opacity: 0.9;
        text-shadow: 0 0 8px rgba(255, 192, 203, 0.6);
        /* Ánh hồng nhẹ */
    }
}

/* Style cho dòng chữ nhắc ước nguyện dưới bánh kem */
.sub-hint-cake {
    font-size: 1rem;
    color: rgba(255, 182, 193, 0.8);
    /* Màu hồng nhạt mờ lãng mạn */
    margin-top: 8px;
    /* Khoảng cách giữa câu trên và câu dưới */
    font-style: italic;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 182, 193, 0.3);
    transition: opacity 0.4s ease;
}
/* Hiệu ứng nhấp nháy giật sáng theo nhịp cho câu cuối cùng */
.music-flash {
    animation: flashGlow 1.2s infinite ease-in-out !important;
    /* Lặp vô hạn cho đến khi tắt trang */
}

@keyframes flashGlow {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.98);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px #ff66b2;
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
        /* Hơi phình to nhẹ khi sáng rực lên */
        text-shadow: 0 0 20px #fff, 0 0 40px #ff66b2, 0 0 60px #ff3399, 0 0 80px #ff007f;
        /* Giật sáng rực rỡ */
    }
}