@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Bangers&family=Chewy&family=Courgette&family=Dancing+Script&family=Fredoka+One&family=Handlee&family=Indie+Flower&family=Kalam:wght@300;400;700&family=Lato:wght@400;700&family=Lobster&family=Luckiest+Guy&family=Merriweather:wght@400;700&family=Montserrat:wght@400;700&family=Nunito:wght@400;700&family=Open+Sans:wght@400;700&family=Oswald:wght@400;700&family=Pacifico&family=Patrick+Hand&family=Permanent+Marker&family=Playfair+Display:wght@400;700&family=Poppins:wght@400;700&family=Quicksand:wght@400;700&family=Righteous&family=Russo+One&family=Sacramento&family=Satisfy&family=Titan+One&display=swap');

/* --- 1. FULL SCREEN LOCK --- */
html, body {
    height: 100% !important; width: 100% !important; margin: 0 !important; padding: 0 !important;
    overflow: hidden !important; background-color: var(--bac-bg) !important;
}

/* --- 2. WRAPPER --- */
.bac-wrapper {
    background-color: var(--bac-bg); position: fixed !important; top: 0 !important; left: 0 !important; 
    width: 100vw !important; height: 100vh !important; z-index: 2147483647 !important;
    overflow-y: auto !important; -webkit-overflow-scrolling: touch; padding: 40px 20px; 
    font-family: 'Quicksand', sans-serif; text-align: center; color: var(--bac-text); box-sizing: border-box;
}

.bac-header { margin-bottom: 40px; position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.bac-logo { display: block; margin: 0 auto 20px auto; max-width: 90%; height: auto; object-fit: contain; }

/* --- BALLOONS --- */
#bac-balloons-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: hidden; }
.bac-balloon { position: absolute; bottom: -150px; width: 50px; height: 65px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; opacity: 0.9; box-shadow: inset -5px -5px 10px rgba(0,0,0,0.1); animation: floatUp linear infinite, sway 3s ease-in-out infinite alternate; }
.bac-balloon::before { content: ''; position: absolute; top: 15%; left: 20%; width: 25%; height: 15%; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.1) 80%); transform: rotate(45deg); }
.bac-balloon-knot { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid; border-bottom-color: inherit; border-radius: 2px; }
.bac-balloon-string { position: absolute; bottom: -45px; left: 50%; width: 1px; height: 40px; background: rgba(0,0,0,0.3); transform-origin: top center; animation: stringSway 2s ease-in-out infinite alternate; }
@keyframes floatUp { 0% { transform: translateY(0) rotate(0deg); } 100% { transform: translateY(-120vh) rotate(10deg); } }
@keyframes sway { 0% { margin-left: 0; } 100% { margin-left: 25px; } }
@keyframes stringSway { 0% { transform: rotate(-5deg); } 100% { transform: rotate(5deg); } }

/* --- GRID --- */
.bac-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1200px; margin: 0 auto 40px auto; width: 100%; position: relative; z-index: 2; }

/* --- DOOR CARDS --- */
.bac-door { background: var(--bac-card-bg); border-radius: 20px; padding: 20px; min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(0,0,0,0.05); cursor: pointer; position: relative; box-sizing: border-box; transition: transform 0.2s; }
.bac-door:hover { transform: translateY(-5px); }
.bac-door.state-locked { background: #e0e0e0; cursor: not-allowed; color: #888; }
.bac-door.state-locked .bac-lock-icon { font-size: 3.5rem; margin-bottom: 10px; opacity: 0.5; }

/* --- OPENED/CLOSED --- */
.bac-content-hidden { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.bac-content-revealed { display: none !important; }
.bac-door.is-opened { background: #ffffff; border: none; box-shadow: 0 4px 20px rgba(0,0,0,0.1); display: flex !important; flex-direction: column; align-items: center; justify-content: center; min-height: 250px; }
.bac-door.is-opened .bac-content-hidden, .bac-door.is-opened .bac-locked-content { display: none !important; }
.bac-door.is-opened .bac-content-revealed { display: flex !important; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.bac-door.is-opened .bac-emoji { margin-bottom: 15px; display: block; line-height: 1; flex-shrink: 0; }
.bac-door.is-opened .bac-countdown { font-family: var(--bac-font-title); font-weight: 800; margin-bottom: 10px; line-height: 1.2; display: block; }
.bac-door.is-opened .bac-preview-msg { font-family: var(--bac-font-body); line-height: 1.4; font-weight: 700; display: block; white-space: normal; }

.bac-settings-gear { position: fixed; bottom: 30px; left: 30px; z-index: 2147483647; font-size: 4rem; color: rgba(0,0,0,0.2); text-decoration: none; transition: all 0.3s ease; line-height: 1; }
.bac-settings-gear:hover { color: #e91e63; opacity: 1; transform: rotate(90deg) scale(1.1); }

/* --- MODAL --- */
.bac-modal { display: none; position: fixed; z-index: 2147483647 !important; top: 0; left: 0; width: 100vw; height: 100vh; background: transparent; flex-direction: column; align-items: center; justify-content: center; }
.bac-modal.open { display: flex !important; }
.bac-modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); z-index: 1; }
.bac-modal-body { position: relative; z-index: 10; width: 100%; display: flex; flex-direction: column; align-items: center; }

/* MODAL CONTENT */
.bac-modal-content { 
    background: #ffffff; /* PURE WHITE */
    width: 60vw; height: 70vh; min-height: 500px; 
    display: flex; flex-direction: row; border-radius: 20px; overflow: hidden; box-shadow: 0 50px 100px rgba(0,0,0,0.7); 
}
.bac-modal-left { 
    flex: 1; 
    background-size: contain; 
    background-repeat: no-repeat; 
    background-position: left center; 
    background-color: transparent; 
}
.bac-modal-right { 
    flex: 1; padding: 40px; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    text-align: center; 
    background: transparent; 
    overflow-y: auto; 
}

/* Typography Defaults (Specifics injected via JS now) */
.bac-modal-emoji { margin-bottom: 2vh; animation: bounce 2s infinite; display: block; line-height: 1; }
.bac-modal-days { font-weight: 800; margin-bottom: 2vh; line-height: 1.2; }
.bac-msg-box { font-weight: 700; line-height: 1.4; margin-bottom: 2vh; }
.bac-msg-sub { margin-bottom: 20px; opacity: 0.8; }

.bac-modal-close-btn { 
    margin-top: 25px; background: #e91e63; color: #fff; border: none; padding: 15px 60px; 
    border-radius: 50px; font-size: 1.1rem; font-weight: bold; cursor: pointer; text-transform: uppercase; transition: all 0.3s ease; 
}
.bac-modal-close-btn:hover { background: #ffffff !important; color: #000000 !important; box-shadow: 0 5px 15px rgba(0,0,0,0.2); transform: translateY(-2px); }

.bac-locked-modal { width: 400px !important; height: 400px !important; max-width: 90vw !important; max-height: 90vh !important; display: flex !important; flex-direction: column !important; justify-content: center !important; align-items: center !important; padding: 40px !important; text-align: center; border-radius: 30px !important; background: #fff; }
.bac-locked-day-badge { background: #eee; padding: 8px 20px; border-radius: 20px; font-weight: 800; display: inline-block; margin-bottom: 20px; }
.bac-locked-title { font-size: 2rem; font-weight: 900; margin: 0; }

.bac-attachment-area { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; width: 100%; display: flex; flex-direction: column; align-items: center; }
.bac-att-btn { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white !important; padding: 12px 30px; border-radius: 50px; text-decoration: none; font-weight: bold; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: transform 0.2s; display: inline-block; }
.bac-att-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.3); }
.bac-giftcard-box { background: #f9f9f9; border: 2px dashed #ccc; padding: 15px; border-radius: 8px; width: 100%; max-width: 300px; text-align: center; }
.bac-gift-label { font-weight: 700; color: #777; margin-bottom: 5px; font-size: 0.9rem; }
.bac-gift-code { font-family: monospace; font-size: 1.2rem; background: #fff; padding: 10px; border-radius: 4px; border: 1px solid #ddd; cursor: pointer; color: #333; font-weight: bold; }
.bac-gift-code:hover { background: #f0f0f0; border-color: #bbb; }

@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-15px);} 60% {transform: translateY(-7px);} }
@media (max-width: 900px) { .bac-grid { grid-template-columns: repeat(2, 1fr); } .bac-modal-content { flex-direction: column; width: 90vw; height: auto; } .bac-modal-left { min-height: 200px; width: 100%; } }