:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-color: #d4af37; /* Gold */
    --hover-color: #f3e5ab;
    --border-color: rgba(212, 175, 55, 0.2);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-ui: 'Inter', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1.3rem;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(30,30,30,0.8) 0%, rgba(5,5,5,1) 100%);
    z-index: -1;
}

#game-container {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: row;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    overflow: hidden;
}

#image-panel {
    width: 40%;
    position: relative;
    background: #000;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
}

#current-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 1s ease-in-out;
}

.image-fade-out {
    opacity: 0 !important;
}

#text-panel {
    width: 60%;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(20,20,20,0.9) 0%, rgba(10,10,10,0.9) 100%);
}

.title {
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin: 0;
    font-size: 2.2rem;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.stats {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.stats .separator {
    margin: 0 10px;
    color: var(--accent-color);
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(0,0,0,0.3);
}

main::-webkit-scrollbar {
    width: 6px;
}
main::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

#story-container {
    flex-grow: 1;
    margin-bottom: 20px;
}

.story-text {
    margin-bottom: 1.5em;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 1s forwards ease-out;
}

.player-choice {
    color: var(--accent-color);
    font-style: italic;
    margin-bottom: 1.5em;
    opacity: 0;
    animation: fadeIn 0.5s forwards ease-out;
    text-align: right;
}

.player-choice::before {
    content: "« ";
}
.player-choice::after {
    content: " »";
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#choices-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: auto;
    border-top: 1px dashed var(--border-color);
    padding-top: 25px;
}

.choice-btn {
    background: rgba(20, 20, 20, 0.8);
    color: var(--text-color);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 15px 25px;
    font-family: var(--font-body);
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.choice-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: bottom;
}

.choice-btn:hover {
    background: rgba(30, 30, 30, 0.9);
    color: var(--hover-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
    transform: translateX(8px);
}

.choice-btn:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

.end-message {
    text-align: center;
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin-top: 30px;
    font-size: 1.8rem;
    letter-spacing: 3px;
}

/* LANDING PAGE STYLES */
#landing-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: #050505;
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.8)), url('assets/cover_poeta_oficial.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 100;
    transition: opacity 0.5s ease-out;
    overflow-y: auto;
    padding: 4rem 0;
}

.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 800px;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4rem;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    text-align: center;
    margin: auto;
}

.landing-cover {
    width: 100%;
    max-width: 500px;
    border-radius: 4px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.landing-vision h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.landing-vision p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.landing-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.dev-logo {
    height: 50px;
    opacity: 0.8;
    filter: grayscale(20%);
    transition: opacity 0.3s, filter 0.3s;
}

.dev-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
}

#start-demo-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    padding: 1rem 2.5rem;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    margin-bottom: 3rem;
}

#start-demo-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.landing-footer {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ddd;
}

/* END SCREEN STYLES */
#end-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    z-index: 200;
    transition: opacity 0.5s ease-out;
    overflow-y: auto;
    padding: 4rem 0;
}
.end-content {
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.2);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    text-align: center;
    max-width: 800px;
    width: 90%;
}
.end-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: #ffd700;
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}
.end-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.end-message {
    font-size: 1.1rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 2rem;
}
.donation-section {
    border-top: 1px solid #333;
    padding-top: 2rem;
}
.donation-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}
.donate-btn {
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    color: white;
    transition: transform 0.2s;
}
.donate-btn:hover {
    transform: translateY(-2px);
}
.kickstarter { background-color: #05ce78; }
.patreon { background-color: #ff424D; }
.kofi { background-color: #13C3FF; }

.qr-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}
.qr-item {
    text-align: center;
}
.qr-item img {
    border: 5px solid white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.qr-item span {
    display: block;
    color: #aaa;
    font-size: 0.9rem;
}

/* NOTEBOOK MODAL */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 300;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}
.notebook-content {
    background: #1a1a1a;
    border: 1px solid #d4af37;
    width: 80%;
    max-width: 800px;
    height: 80vh;
    padding: 2rem;
    border-radius: 4px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
}
.notebook-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg opacity="0.05" xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.5" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23n)"/></svg>');
    pointer-events: none;
}
.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    background: none; border: none;
    color: #d4af37; font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}
.notebook-title {
    font-family: 'Cinzel', serif;
    color: #d4af37;
    font-size: 2rem;
    text-align: center;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 5px;
}
.notebook-desc {
    text-align: center;
    color: #888;
    margin-bottom: 2rem;
    font-style: italic;
}
.notebook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    flex-grow: 1;
}
.concept-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border-radius: 4px;
}
.concept-card:hover {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}
.concept-card.locked {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(100%);
}
.concept-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}
.concept-name {
    font-family: 'Cinzel', serif;
    color: #eee;
    font-weight: bold;
}

/* NOTEBOOK DETAIL VIEW */
.notebook-detail {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.back-btn {
    background: none; border: none;
    color: #888; cursor: pointer;
    align-self: flex-start;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
}
.back-btn:hover { color: #d4af37; }
#detail-title {
    font-family: 'Cinzel', serif;
    color: #d4af37;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
.detail-desc {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* NOTEBOOK TABS */
.notebook-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 10px;
}
.tab-btn {
    background: none;
    border: none;
    color: #888;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px 10px;
}
.tab-btn:hover {
    color: #d4af37;
}
.tab-btn.active {
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* GALLERY GRID */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
}
.gallery-item {
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.8;
}
.gallery-item:hover {
    border-color: #d4af37;
    opacity: 1;
    transform: scale(1.02);
}
.gallery-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}
.gallery-title {
    background: #111;
    color: #eee;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    text-align: center;
    padding: 5px;
    border-top: 1px solid #333;
}

/* EMOTIONS CONTAINER */
.emotions-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
}
.emotion-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    padding: 15px;
    border-radius: 4px;
}
.emotion-header {
    display: flex;
    justify-content: space-between;
    font-family: 'Cinzel', serif;
    color: #d4af37;
    margin-bottom: 10px;
}
.emotion-bar-bg {
    width: 100%;
    height: 4px;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}
.emotion-bar-fill {
    height: 100%;
    background: #d4af37;
    transition: width 1s ease-out;
}
.emotion-desc {
    font-size: 0.9rem;
    color: #aaa;
    font-style: italic;
}

.quote-box {
    border-left: 3px solid #d4af37;
    padding-left: 15px;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
}
.detail-quote {
    font-family: 'Georgia', serif;
    font-style: italic;
    color: #eee;
    line-height: 1.8;
    margin-bottom: 10px;
}
.detail-author {
    color: #d4af37;
    text-align: right;
    font-weight: bold;
    font-family: 'Cinzel', serif;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    #game-container {
        flex-direction: column;
        width: 100%;
        height: 100dvh;
        border: none;
        border-radius: 0;
        margin: 0;
    }

    #image-panel {
        display: none; /* Hide images on mobile to prioritize text */
    }

    #text-panel {
        width: 100%;
        height: 100%;
    }

    header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .title {
        font-size: 1.5rem;
    }

    .stats {
        font-size: 0.8rem;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .stats .separator {
        display: none;
    }

    main {
        padding: 20px 20px 80px 20px;
    }

    .story-text {
        font-size: 1.15rem;
        margin-bottom: 1em;
    }

    #choices-container {
        padding-top: 10px;
        padding-bottom: 40px;
    }

    .choice-btn {
        padding: 12px;
        font-size: 1rem;
    }
    
    /* End Screen Mobile Adjustments */
    .landing-logos {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .sambalab-branding {
        flex-direction: column;
    }
}
