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

html {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
}

body {
    font-family: 'Dancing Script', cursive;
    background: url('assets/images/background.jpg') center center / cover no-repeat;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Decorative corners */
.corner-decor {
    position: fixed;
    z-index: 1;
}

.top-left { top: 0; left: 0; width: 400px; height: 400px; }
.top-right { top: 0; right: 0; width: 400px; height: 400px; }
.bottom-left { bottom: 0; left: 0; width: 380px; height: 380px; }
.bottom-right { bottom: 0; right: 0; width: 380px; height: 380px; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.top-center-decor {
    position: fixed;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.top-center-decor svg {
    width: 150px;
    height: 80px;
}

/* Floral decorations */
.floral-top-left {
    position: fixed;
    top: 0px;
    left: 0px;
    z-index: 5;
}

.floral-top-right {
    position: fixed;
    top: 0px;
    right: 0px;
    z-index: 5;
}

.floral-img {
    width: 180px;
    height: 180px;
    opacity: 0.8;
}

/* Desktop - phóng to floral */
@media (min-width: 1024px) {
    .floral-img {
        width: 250px !important;
        height: 250px !important;
    }
}

.teacherday-image {
    width: 280px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
    /* Tắt animation cho logo 20/11 */
}

@keyframes teacherdayFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

.container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    max-height: 100vh;
    position: relative;
    z-index: 2;
    padding: 20px;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
}

/* Cute Pink Board - Enhanced Design with Multiple Frames */
.cute-board {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    min-height: 300px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    max-width: calc(100vw - 40px);
}

/* Viền khung ngoài cùng - mềm mại và sang trọng */
.outer-frame {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 50%, #fce4ec 100%);
    border-radius: 25px;
    box-shadow: 
        0 20px 40px rgba(255, 105, 180, 0.3),
        0 10px 20px rgba(255, 105, 180, 0.2),
        inset 0 2px 4px rgba(255,255,255,0.8),
        inset 0 -2px 4px rgba(255, 192, 203, 0.3);
    z-index: 1;
}

/* Viền khung giữa */
.middle-frame {
    position: absolute;
    inset: 8px;
    background: linear-gradient(135deg, #f8bbd0 0%, #f48fb1 50%, #f8bbd0 100%);
    border-radius: 20px;
    box-shadow: 
        inset 0 2px 5px rgba(255,105,180,0.2),
        inset 0 -2px 5px rgba(255,255,255,0.4),
        0 0 0 1px rgba(255,255,255,0.3);
    z-index: 2;
}

/* Viền khung trong */
.inner-frame {
    position: absolute;
    inset: 16px;
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 50%, #fce4ec 100%);
    border-radius: 16px;
    box-shadow: 
        inset 0 1px 3px rgba(255,105,180,0.15),
        inset 0 -1px 3px rgba(255,255,255,0.5);
    z-index: 3;
}

/* Bề mặt bảng hồng nhạt - dễ viết chữ */
.board-surface {
    position: absolute;
    inset: 24px;
    background: linear-gradient(135deg, #ffeef5 0%, #ffd6e7 30%, #ffeef5 60%, #ffe0ec 100%);
    border-radius: 12px;
    box-shadow: 
        inset 0 3px 10px rgba(255,182,193,0.2),
        inset 0 0 100px rgba(255,240,245,0.3),
        inset 0 -2px 5px rgba(255,192,203,0.15);
    overflow: hidden;
    /* Tắt hiệu ứng pulse của bảng */
    z-index: 4;
    padding: 40px 50px 80px 50px; /* Thêm padding bottom cho button */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Texture bảng mịn hơn */
.board-texture {
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(255,255,255,0.02) 3px,
            rgba(255,255,255,0.02) 6px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(255,255,255,0.02) 3px,
            rgba(255,255,255,0.02) 6px
        );
    opacity: 0.4;
    z-index: 5;
    pointer-events: none;
}

/* Hiệu ứng lấp lánh nhẹ */
.board-surface::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 50%);
    /* Tắt hiệu ứng shimmer của bảng */
    z-index: 6;
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes boardGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* Board Decorations */
.board-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.board-corner {
    position: absolute;
    font-size: 24px;
    /* Tắt animation cho icon góc */
}

.love-icon {
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

/* Love Button Styles */
.love-button-container {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: buttonFadeIn 1s ease-out;
    width: 100%;
}

/* Desktop (>=1024px) - Đảm bảo button ở vị trí thấp, override tất cả */
@media (min-width: 1024px) {
    .love-button-container {
        bottom: 5px !important;
    }
}

.love-button {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8fab 50%, #ffb3d6 100%);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    box-shadow: 
        0 8px 20px rgba(255, 107, 157, 0.4),
        0 4px 10px rgba(255, 107, 157, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
}

.love-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 12px 25px rgba(255, 107, 157, 0.5),
        0 6px 15px rgba(255, 107, 157, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.love-button:active {
    transform: translateY(-1px) scale(1.02);
}

.button-text {
    position: relative;
    z-index: 2;
}

.button-heart {
    font-size: 1.2rem;
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes buttonFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

@keyframes messageFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes messageFadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.top-left-corner {
    top: 15px;
    left: 15px;
    animation-delay: 0s;
}

.top-right-corner {
    top: 15px;
    right: 15px;
    animation-delay: 1s;
}

.bottom-left-corner {
    bottom: 15px;
    left: 15px;
    animation-delay: 2s;
}

.bottom-right-corner {
    bottom: 15px;
    right: 15px;
    animation-delay: 3s;
}

@keyframes cornerFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-5px) rotate(5deg) scale(1.1);
    }
}

.side-decoration {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.left-side {
    left: 10px;
}

.right-side {
    right: 10px;
}

.deco-item {
    font-size: 18px;
    /* Tắt animation cho icon bên cạnh */
}

.deco-item:nth-child(1) { animation-delay: 0s; }
.deco-item:nth-child(2) { animation-delay: 1s; }
.deco-item:nth-child(3) { animation-delay: 2s; }

@keyframes sideFloat {
    0%, 100% {
        transform: translateX(0) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateX(5px) scale(1.2);
        opacity: 1;
    }
}

.text-container {
    text-align: center;
}

.handwriting-text {
    font-size: clamp(2.5rem, 6.5vw, 4rem);
    color: #d91e5c;
    font-weight: 700;
    line-height: 1.3;
    display: inline-block;
}

.text-line {
    display: block;
    margin: 15px 0;
    position: relative;
}

.text-line.completed {
    animation: lineWave 2s ease-in-out;
}

@keyframes lineWave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-3px);
    }
    75% {
        transform: translateY(3px);
    }
}

.letter {
    display: inline-block;
    position: relative;
    opacity: 0;
    margin: 0 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateY(20px) scale(0.8);
    filter: blur(2px);
}

.letter.writing {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    animation: letterGlow 0.6s ease-out, letterBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes letterGlow {
    0% {
        text-shadow: 0 0 5px #d91e5c, 0 0 10px #d91e5c, 0 0 15px #d91e5c;
    }
    50% {
        text-shadow: 0 0 10px #ff6b9d, 0 0 20px #ff6b9d, 0 0 30px #ff6b9d;
    }
    100% {
        text-shadow: 0 0 5px #d91e5c, 0 0 10px #d91e5c;
    }
}

@keyframes letterBounce {
    0% {
        transform: translateY(20px) scale(0.8);
    }
    50% {
        transform: translateY(-5px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}


.pen-cursor {
    position: fixed;
    width: 35px; height: 35px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform-origin: 5px 30px;
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.25));
    transition: opacity 0.3s;
}

.pen-cursor.active {
    opacity: 1;
    animation: penPulse 0.5s ease-in-out infinite alternate;
}

@keyframes penPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.25));
    }
    100% {
        transform: scale(1.1);
        filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.4));
    }
}

/* MỰC SÁT CHÂN CHỮ - ĐÃ TỐI ƯU TỪNG PIXEL */
.ink-trail {
    position: fixed;
    width: 3.5px; height: 3.5px;
    background: radial-gradient(circle, #d91e5c 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: fadeInk 0.8s ease-out forwards;
}

@keyframes fadeInk {
    0% { opacity: 0.9; transform: scale(1); }
    100% { opacity: 0; transform: scale(2.2); }
}

.date {
    font-size: 1.3em;
    color: #ff1167;
    font-family: 'Pacifico', cursive;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Đảm bảo thông báo xoay ngang chỉ hiển thị trên mobile/tablet */
.rotate-notice {
    display: none;
}

/* Large Desktop (1200px+) - Default styles already defined above */
@media (min-width: 1200px) {
    .cute-board {
        max-width: 1000px;
    }
    .board-surface {
        padding: 60px 70px;
    }
    .teacherday-image {
        width: 320px;
        height: 160px;
    }
}

/* Desktop lớn (1025px+) - Đảm bảo không hiển thị thông báo xoay ngang */
@media (min-width: 1025px) {
    .rotate-notice {
        display: none !important;
    }
}

/* Desktop & Laptop (1025px - 1199px) */
@media (min-width: 1025px) and (max-width: 1199px) {
    .corner-decor { 
        width: 350px !important; 
        height: 350px !important; 
    }
    .top-center-decor {
        top: 5px;
    }
    .top-center-decor svg { 
        width: 120px; 
        height: 70px; 
    }
    .teacherday-image {
        width: 220px;
        height: 110px;
    }
    .handwriting-text {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    .cute-board {
        max-width: 900px;
    }
    .board-surface {
        padding: 50px 60px;
    }
}

/* Tablet Landscape (768px - 991px) */
@media (max-width: 991px) {
    .corner-decor { 
        width: 280px !important; 
        height: 280px !important; 
    }
    .top-center-decor {
        top: 5px;
    }
    .top-center-decor svg { 
        width: 100px; 
        height: 60px; 
    }
    .teacherday-image {
        width: 180px;
        height: 90px;
    }
    .handwriting-text {
        font-size: clamp(1.8rem, 4.5vw, 2.5rem);
    }
    .letter { 
        margin: 0 1px; 
    }
    .container {
        padding: 15px;
    }
}

/* Mobile/Tablet Landscape (768px - 1368px) */
@media (min-width: 768px) and (max-width: 1368px) and (orientation: landscape) {
    .top-center-decor {
        top: 0px;
    }
    .cute-board {
        min-height: 60px !important;
        max-width: 70%;
        aspect-ratio: none !important;
    }
    .board-surface {
        padding: 4px 12px 60px 12px; /* Thêm padding bottom cho button */
    }
    
    /* Button responsive cho tablet landscape */
    .love-button-container {
        bottom: 35px;
    }
    
    .love-button {
        padding: 8px 20px;
        font-size: 1.2rem;
    }
    
    .button-text {
        font-size: 1.1rem;
    }
    
    .button-heart {
        font-size: 1rem;
    }
    
}



/* Mobile và Tablet Portrait (<=1024px) - CHỈ HIỂN THỊ THÔNG BÁO XOAY NGANG */
@media (max-width: 1024px) and (orientation: portrait) {
    .rotate-notice {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.9);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        font-family: Arial, sans-serif;
    }
    
    .rotate-notice img {
        width: 180px;
        height: auto;
        margin-bottom: 20px;
        border-radius: 10px;
    }
    
    .rotate-notice h2 {
        color: white;
        font-size: 20px;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .rotate-notice p {
        color: #ff9eb8;
        font-size: 16px;
        text-align: center;
        margin: 0;
    }
    
    .container {
        display: none;
    }
}

/* Mobile và Tablet Landscape (<=1023px) */
@media (max-width: 1023px) and (orientation: landscape) {
    .rotate-notice {
        display: none;
    }
    
    .corner-decor { 
        width: 200px !important; 
        height: 200px !important; 
    }
    .top-center-decor {
        top: 0px;
    }
    .top-center-decor svg { 
        width: 80px; 
        height: 50px; 
    }
    .teacherday-image {
        width: 80px;
        height: 50px;
    }
    .handwriting-text {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
    .container {
        padding: 10px;
    }
    .cute-board {
        min-height: 80px;
        max-width: 90%;
    }
    .board-surface {
        padding: 8px 12px 50px 12px; /* Thêm padding bottom cho button */
    }
    
    /* Button responsive cho mobile landscape */
    .love-button-container {
        bottom: 20%; /* Đẩy lên 20% */
    }
    
    .love-button {
        padding: 6px 16px;
        font-size: 1.1rem;
    }
    
    .button-text {
        font-size: 1rem;
    }
    
    .button-heart {
        font-size: 0.9rem;
    }
    
}

/* Tablet Landscape lớn (1024px - 1368px) - Chỉ áp dụng cho tablet, không phải desktop */
@media (min-width: 1024px) and (max-width: 1368px) and (orientation: landscape) {
    /* Chỉ áp dụng cho tablet, không override desktop */
}

/* Mobile Landscape nhỏ (640px - 667px) */
@media (min-width: 640px) and (max-width: 667px) and (orientation: landscape) {
    .love-button-container {
        bottom: 20px;
    }
    
    .love-button {
        padding: 5px 14px;
        font-size: 1rem;
    }
    
    .button-text {
        font-size: 0.9rem;
    }
    
    .button-heart {
        font-size: 0.8rem;
    }
}

/* Mobile Portrait (320px - 480px) - HIỂN THỊ THÔNG BÁO XOAY NGANG */
@media (max-width: 480px) and (orientation: portrait) {
    .rotate-notice {
        display: flex !important;
    }
    
    .rotate-notice img {
        width: 150px;
        margin-bottom: 15px;
    }
    
    .rotate-notice h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .rotate-notice p {
        font-size: 14px;
    }
}

/* Mobile Landscape (320px - 480px) */
@media (max-width: 480px) and (orientation: landscape) {
    .corner-decor { 
        width: 160px !important; 
        height: 160px !important; 
    }
    .top-center-decor {
        top: 0px;
    }
    .top-center-decor svg { 
        width: 60px; 
        height: 40px; 
    }
    .teacherday-image {
        width: 60px;
        height: 40px;
    }
    .handwriting-text {
        font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    }
    .container {
        padding: 8px;
    }
    .letter { 
        margin: 0 0.5px; 
    }
    .cute-board {
        min-height: 100px;
        max-width: 90%;
    }
    .board-surface {
        padding: 8px 12px;
    }
    .love-button-container {
        bottom: 20px;
    }
}

/* Extra small devices (320px and below) */
@media (max-width: 320px) {
    .handwriting-text {
        font-size: clamp(1rem, 3vw, 1.5rem);
    }
    .container {
        padding: 5px;
    }
}

/* ===== DECORATIVE EFFECTS ===== */

/* Removed all floating animations to prevent conflicts with Tulipanes */

/* Responsive adjustments for board elements */
@media (max-width: 768px) {
    /* Cute board responsive */
    .cute-board {
        max-width: 75%;
        min-height: 200px;
    }
    .board-surface {
        padding: 25px 30px;
    }
    
    .board-corner {
        font-size: 20px;
    }
    
    .deco-item {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    /* Cute board mobile */
    .cute-board {
        max-width: 85%;
        min-height: 180px;
    }
    .board-surface {
        padding: 20px 25px;
        border-radius: 20px;
    }
    
    .board-corner {
        font-size: 18px;
    }
    
    .deco-item {
        font-size: 14px;
    }
    
    .side-decoration {
        gap: 15px;
    }
}