* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { 
    width: 100%; height: 100vh; overflow: hidden; 
    touch-action: none; overscroll-behavior: none; 
    background-color: #05020a; color: #fff; 
    font-family: 'ZCOOL KuaiLe', 'PingFang SC', 'Helvetica Neue', Helvetica, sans-serif; 
}
.en-font { font-family: 'Caveat', cursive !important; letter-spacing: 2px; }

#webgl-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#css-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; touch-action: none; }

.welcome-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(5, 2, 10, 0.95); backdrop-filter: blur(10px); z-index: 1000; display: flex; justify-content: center; align-items: center; transition: opacity 1s; }
.welcome-box { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); padding: 40px 25px; border-radius: 24px; text-align: center; width: 85%; max-width: 400px; box-shadow: 0 15px 40px rgba(0,0,0,0.6); }
.welcome-box p { font-size: 17px; line-height: 1.8; margin-bottom: 25px; color: #eee; letter-spacing: 1px; }
.cute-btn { font-family: 'ZCOOL KuaiLe', sans-serif; font-size: 16px; background: linear-gradient(135deg, #ff8ca3, #ff6b8b); color: #fff; border: none; padding: 14px 28px; border-radius: 30px; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 15px rgba(255,140,163,0.3); }
.cute-btn:active { transform: scale(0.95); box-shadow: 0 2px 8px rgba(255,140,163,0.2); }

.element { 
    width: 90px; height: 120px; 
    box-shadow: 0px 0px 15px rgba(255,182,193,0.4); 
    border: 2px solid rgba(255,255,255,0.7); 
    border-radius: 8px; cursor: pointer; 
    background-size: cover; background-position: center; 
    transition: box-shadow 0.3s, border-color 0.3s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: auto;
}
.element:hover { box-shadow: 0px 0px 25px rgba(255,255,255,1); border-color: #fff; z-index: 100 !important; }

.ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.header { text-align: center; padding-top: 6vh; pointer-events: auto; }
.badge { display: inline-block; background: rgba(255,255,255,0.12); padding: 6px 18px; border-radius: 20px; font-size: 16px; margin-bottom: 12px; backdrop-filter: blur(5px); color: #ff8ca3; border: 1px solid rgba(255,140,163,0.3); }
.timer-box { font-size: 17px; line-height: 2; margin-bottom: 5px; text-shadow: 0 2px 6px rgba(0,0,0,0.8); letter-spacing: 1px; }
.num { font-size: 30px; margin: 0 4px; color: #ff8ca3; text-shadow: 0 0 10px rgba(255,140,163,0.5); }
.subtitle { font-size: 13px; opacity: 0.6; margin-top: 5px; pointer-events: none; }

.controls { position: absolute; top: 50%; right: 20px; transform: translateY(-50%); display: flex; flex-direction: column; gap: 15px; pointer-events: auto; transition: opacity 0.5s ease-in-out; opacity: 1; }
.controls.hidden { opacity: 0; pointer-events: none; }
.controls button { font-family: 'ZCOOL KuaiLe', sans-serif; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 10px 18px; border-radius: 20px; cursor: pointer; backdrop-filter: blur(4px); font-size: 14px; transition: 0.3s; }
.controls button:active { background: rgba(255,140,163,0.5); border-color: #ff8ca3; }

.lyrics-box { position: absolute; bottom: 12vh; left: 0; right: 0; margin: 0 auto; text-align: center; width: 90%; font-size: 20px; letter-spacing: 1px; text-shadow: 0 2px 8px rgba(0,0,0,0.9); color: #fff; transition: opacity 0.8s ease-in-out; pointer-events: none; line-height: 1.6; }
.quotes-fade-out { opacity: 0 !important; }
.quotes-fade-in { opacity: 1 !important; }

.nav-bar { position: absolute; bottom: 3vh; left: 0; right: 0; display: flex; justify-content: center; gap: 20px; pointer-events: auto; }
.nav-btn { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); padding: 10px 24px; border-radius: 30px; cursor: pointer; backdrop-filter: blur(5px); font-size: 15px; transition: 0.3s; }
.nav-btn:active { background: #ff8ca3; border-color: #ff8ca3; }

@media (max-width: 768px) {
    .header { padding-top: 5vh; }
    .badge { font-size: 14px; padding: 4px 14px; margin-bottom: 10px; }
    .timer-box { font-size: 15px; line-height: 1.8; }
    .num { font-size: 24px; }
    .controls { top: auto; bottom: 16vh; right: 0; left: 0; transform: none; flex-direction: row; justify-content: center; gap: 8px; width: 100%; padding: 0 10px; }
    .controls button { padding: 8px 16px; font-size: 13px; border-radius: 20px; }
    .lyrics-box { bottom: 23vh; font-size: 17px; padding: 0 20px; }
    .nav-bar { bottom: 4vh; gap: 15px; }
    .nav-btn { padding: 10px 22px; font-size: 14px; }
}

.modal { display: none; position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.85); backdrop-filter: blur(8px); pointer-events: auto; opacity: 0; }
.modal-content { background-color: #1a1525; margin: 10vh auto; padding: 25px; border-radius: 20px; width: 90%; max-width: 500px; color: #eee; box-shadow: 0 10px 40px rgba(0,0,0,0.8); border: 1px solid rgba(255,182,193,0.2); max-height: 85vh; overflow-y: auto; pointer-events: auto; transform: scale(0.8); opacity: 0; }
.close { color: #888; float: right; font-size: 34px; font-weight: bold; cursor: pointer; line-height: 1; transition: 0.3s; position: absolute; right: 20px; top: 15px; z-index: 10;}
.close:hover, .close:active { color: #ff8ca3; }
.modal-title { text-align: center; margin-bottom: 25px; font-weight: normal; font-size: 22px; color: #fff; }

.modal.fade-in { animation: modalFadeIn 0.3s ease forwards; }
.modal.fade-out { animation: modalFadeOut 0.3s ease forwards; }
.modal.fade-in .modal-content { animation: modalContentZoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.modal.fade-out .modal-content { animation: modalContentZoomOut 0.3s ease forwards; }

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalContentZoomIn { 
    from { opacity: 0; transform: scale(0.6) translateY(30px); } 
    to { opacity: 1; transform: scale(1) translateY(0); } 
}
@keyframes modalContentZoomOut { 
    from { opacity: 1; transform: scale(1) translateY(0); } 
    to { opacity: 0; transform: scale(0.8) translateY(20px); } 
}

.photo-modal-content { background: transparent; border: none; box-shadow: none; display: flex; justify-content: center; align-items: center; overflow: visible; padding: 0; margin-top: 15vh;}
#enlarged-photo { max-width: 100%; max-height: 75vh; border-radius: 12px; border: 3px solid rgba(255,182,193,0.8); box-shadow: 0 0 30px rgba(0,0,0,0.9); object-fit: contain; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 20px; }
.day-cell { aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); cursor: pointer; font-size: 14px; transition: 0.2s; }
.day-cell.active { background: rgba(255, 182, 193, 0.25); border: 1px solid #ff8ca3; color: #fff; box-shadow: 0 0 10px rgba(255,140,163,0.3); }
.memory-display { background: rgba(0,0,0,0.3); padding: 18px; border-radius: 12px; display: none; border-left: 4px solid #ff8ca3; }
.m-date { color: #ff8ca3; font-size: 16px; margin-bottom: 8px; font-weight: bold; }
.m-text { line-height: 1.6; font-size: 14px; color: #ddd; }

.letter-bg { background-color: #fffafb; color: #333; border: none; background-image: radial-gradient(#ffe6eb 1px, transparent 1px); background-size: 20px 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.5); }
.letter-bg .close { color: #aaa; }
.tag { font-size: 16px; color: #ff8ca3; margin-bottom: 8px; font-weight: bold; }
.letter-bg .modal-title { color: #222; font-size: 26px; margin-bottom: 20px; }
.typewriter-content { font-size: 16px; line-height: 2.2; color: #444; min-height: 220px; }
.typewriter-content::after { content: '|'; animation: blink 1s infinite; color: #ff8ca3; }
.signature { text-align: right; margin-top: 35px; font-size: 24px; color: #ff8ca3; font-weight: bold; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }