@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400&family=Newsreader:ital,wght@1,300&display=swap');

/* --- Universal Box Sizing --- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* --- GLOBAL & GENERAL STYLES --- */
body {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    color: #333;
    background-color: #f4f7f6;
    text-align: center;
    overflow-x: hidden;
    animation: fadeInPage 0.7s ease-in-out;
}

@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-container, .menu-container { 
    padding: 20px; 
    box-sizing: border-box; 
    padding-top: 70px;
}

h1 { margin: 0; font-size: 2.5em; color: #2c3e50; }
p { margin: 10px 0 30px 0; font-size: 1.2em; color: #5c5c5c; }
.back-link { position: absolute; top: 20px; left: 20px; text-decoration: none; font-size: 1.1em; color: #3498db; padding: 8px 12px; background-color: rgba(255, 255, 255, 0.2); border-radius: 20px; backdrop-filter: blur(5px); transition: all 0.2s ease; z-index: 100;}
.back-link:hover { background-color: rgba(255, 255, 255, 0.4); }
canvas { box-shadow: 0 5px 15px rgba(0,0,0,0.2); border-radius: 10px; }

/* --- TOP NAVIGATION BAR STYLES --- */
.top-navigation-bar { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    padding: 15px 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    z-index: 1001; 
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 15px; }
.header-btn, .nav-btn { 
    padding: 8px 18px; 
    background-color: rgba(255, 255, 255, 0.2); 
    border: 1px solid rgba(255, 255, 255, 0.3); 
    border-radius: 20px; 
    font-size: 0.9em; 
    font-weight: 500; 
    text-decoration: none; 
    color: #ffffff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    transition: all 0.2s; 
}
.header-btn:hover, .nav-btn:hover { transform: translateY(-2px); background-color: rgba(255, 255, 255, 0.4); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.donate-btn { background-color: #3498db; color: #ffffff; border: none; }
.menu-toggle { position: relative; width: 40px; height: 30px; background: transparent; border: none; cursor: pointer; display: flex; flex-direction: column; justify-content: space-around; }
.menu-toggle span { width: 100%; height: 3px; background-color: #ffffff; border-radius: 2px; transition: all 0.3s ease-in-out; transform-origin: center; }
.menu-toggle.open span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* --- NAVIGATION CENTER BRAND --- */
.nav-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.nav-brand {
    color: #ffffff;
    font-family: 'Newsreader', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 2.8em;
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
    letter-spacing: -1.5px;
}

/* --- FEELINGS JOURNAL PAGE STYLES --- */
.journal-body { 
    justify-content: flex-start; 
    padding-top: 25vh; 
    position: relative;
    background-color: #0c1445; 
}

/* Creates a dedicated, fixed layer for the background image */
.journal-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/background.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.journal-header { text-align: center; margin-bottom: 30px; max-width: 600px; transition: opacity 0.5s ease; position: relative; z-index: 20; }
main { width: 100%; max-width: 600px; position: relative; transition: opacity 0.5s ease; }
.input-area { position: relative; overflow: hidden; display: flex; margin-bottom: 25px; transition: background-color 0.3s ease-in-out; border-radius: 12px; }
#feeling-input { min-height: 150px; width: 100%; padding: 20px; border-radius: 12px; font-family: 'Inter', sans-serif; font-size: 1.1em; resize: vertical; transition: opacity 0.3s; z-index: 10; position: relative; background-color: rgba(255, 255, 255, 0.2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.3); color: #ffffff; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
#feeling-input::placeholder { color: rgba(255, 255, 255, 0.7); }
#feeling-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5); background-color: rgba(255, 255, 255, 0.3); }
.button-group { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.release-btn { padding: 15px 20px; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(5px); color: white; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; font-size: 1em; font-weight: 500; cursor: pointer; transition: all 0.3s; }
.release-btn:hover { background-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px); }

#fire-video, #ocean-video { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: none; 
    z-index: 11; 
    border-radius: 12px; 
}
#fire-video { mix-blend-mode: screen; }
.anim-fade-out { animation: fadeOut 0.8s forwards; } @keyframes fadeOut { to { opacity: 0; transform: scale(0.9); } }
.anim-flush-away { animation: flushAway 1s forwards cubic-bezier(0.68, -0.55, 0.27, 1.55); } @keyframes flushAway { to { transform: scale(0) rotate(720deg); opacity: 0; } }

.history-menu { height: 100%; width: 280px; position: fixed; z-index: 1000; top: 0; left: -280px; background-color: rgba(0, 0, 0, 0.25); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-right: 1px solid rgba(255, 255, 255, 0.2); overflow-x: hidden; transition: 0.5s; padding-top: 60px; }
.history-menu.open { left: 0; }
.history-menu h2 { padding: 0 32px; color: #ffffff;}
#history-list { list-style-type: none; padding: 0; }
#history-list li { padding: 12px 15px 12px 32px; display: flex; justify-content: space-between; align-items: center; font-size: 16px; color: #ffffff; border-bottom: 1px solid rgba(255, 255, 255, 0.1); cursor: pointer; transition: background-color 0.2s; }
#history-list li:hover { background-color: rgba(255, 255, 255, 0.1); }
#history-list li .note-text { flex-grow: 1; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; margin-right: 15px; min-width: 0; }
.delete-btn { background: none; border: none; color: #e74c3c; font-size: 24px; font-weight: bold; cursor: pointer; padding: 0; border-radius: 50%; transition: all 0.2s; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.mobile-nav-links { display: none; }
.menu-divider { border: none; border-top: 1px solid rgba(255, 255, 255, 0.2); margin: 15px 0; }
.mobile-only-link { color: #ffffff; padding: 12px 15px 12px 32px; text-decoration: none; font-size: 16px; display: block; transition: background-color 0.2s; }
.mobile-only-link:hover { background-color: rgba(255, 255, 255, 0.1); }
.modal { display: none; position: fixed; z-index: 1002; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: #fefefe; margin: 15% auto; padding: 20px 30px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 8px; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.3); animation: fadeIn 0.5s; }
.modal-close-btn { color: #aaa; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; }
.modal-close-btn:hover, .modal-close-btn:focus { color: black; text-decoration: none; cursor: pointer; }
#modal-note-text { font-size: 1.1em; line-height: 1.6; white-space: pre-wrap; overflow-wrap: break-word; }

/* --- SITE FOOTER STYLES --- */
.site-footer { width: 100%; text-align: center; padding: 20px 0; margin-top: auto; color: rgba(255, 255, 255, 0.5); font-size: 0.9em; }

/* --- RESPONSIVE STYLES FOR SMALL SCREENS --- */
@media (max-width: 1200px) {
    .nav-right,
    .nav-left .nav-btn {
        display: none; 
    }
    .mobile-nav-links {
        display: block; 
    }
    .top-navigation-bar {
        padding: 15px;
    }
}

@media (max-width: 640px) {
    .journal-header,
    main {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        font-size: 1.8em;
    }
    .journal-header h1 {
        font-size: 2em; 
    }
    .button-group {
        grid-template-columns: 1fr;
    }
}