@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Kalam:wght@300;400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&display=swap');

body {
    background-color: #3d3a34;
    font-family: 'Kalam', cursive;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    perspective: 1500px;
}


#book-cover {
    width: 400px;
    height: 550px;
    background-color: #4a413a;
    border: 1px solid #2f2a25;
    border-left: 10px solid #2f2a25;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    position: absolute;
    z-index: 100;
    transform-origin: left center;
    transition: transform 1s ease-in-out, opacity 0.5s ease-in-out;
    transform-style: preserve-3d;
}

.page-static {
    width: 400px;
    height: 550px;
    background-color: #fdfdfa;
    padding: 30px 40px;
    box-sizing: border-box;
    color: #333;
    position: absolute;
    z-index: 99;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    transition: opacity 0.5s ease-out;
}
.cover-content { display: flex; justify-content: center; align-items: center; flex-direction: column; text-align: center; color: #e8e4d8; border: 2px solid #e8e4d8; position: absolute; top: 20px; right: 20px; bottom: 20px; left: 20px; background-color: #4a413a; }
.cover-content h1 { font-family: 'Cinzel', serif; font-size: 2.2rem; margin: 0; }
.cover-content .author { font-family: 'Kalam', cursive; font-size: 1.2rem; margin-top: 20px; border-top: 1px solid #e8e4d8; padding-top: 10px; }
.book-pages { position: absolute; top: 5px; right: 5px; bottom: 5px; left: 0; background: #fdfdfa; box-shadow: inset 2px 0 5px rgba(0,0,0,0.2); }
.book-pages span { position: absolute; background: #fdfdfa; border: 1px solid #eee; box-shadow: inset 1px 0 2px rgba(0,0,0,0.1); }
.book-pages span:nth-child(1) { top: 2px; right: 2px; bottom: 2px; left: 2px; }
.book-pages span:nth-child(2) { top: 4px; right: 4px; bottom: 4px; left: 4px; }
.book-pages span:nth-child(3) { top: 6px; right: 6px; bottom: 6px; left: 6px; }

#book-cover.opened { transform: rotateY(-140deg); }
.hidden { opacity: 0; pointer-events: none; }
#compiler-wrapper { width: 100%; max-width: 1400px; position: absolute; opacity: 0; visibility: hidden; transform: scale(0.95); transition: opacity 0.5s ease-out, transform 0.5s ease-out, visibility 0s 0.5s; }
#compiler-wrapper.visible { opacity: 1; visibility: visible; transform: scale(1); }



.journal-page {
    font-family: 'Caveat', cursive;
    font-size: 15px;
    color: #222;
}
.journal-page h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    border-bottom: 2px solid #555;
    padding-bottom: 5px;
}
.evidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 15px;
}
.evidence-grid label {
    display: flex;
    align-items: center;
}
.evidence-grid input {
    margin-right: 10px;
}
.separator {
    border: none;
    border-top: 2px solid #555;
    margin: 20px 0;
}
.journal-subtitle {
    margin: 0 0 15px 0;
    font-size: 18px;
    text-align: center;
}
.ghost-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    font-size: 20px;
}
.ghost-grid .circled {
    border: 2px solid #222;
    border-radius: 50px;
    padding: 0 10px;
    margin: -2px -10px;
}



.back-link-container { width: 100%; margin-bottom: 15px; }
.back-link { text-decoration: none; color: #e8e4d8; font-size: 1.2rem; padding: 5px 10px; transition: background-color 0.2s; }
.back-link:hover { background-color: rgba(255, 255, 255, 0.1); border-radius: 5px; }
.notebook { display: flex; width: 100%; height: 75vh; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); border: 1px solid #ccc; }
.page { flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.page-left { padding: 0; border-right: 1px dashed #aaa; }
.editor-container { position: relative; width: 100%; height: 100%; background-image: repeating-linear-gradient(to bottom, transparent, transparent 29px, #d3e0ea 30px); background-size: 100% 30px; padding: 40px 20px 20px 40px; box-sizing: border-box; }
.editor-container::before { content: ''; position: absolute; top: 0; left: 30px; width: 1px; height: 100%; background-color: #ffb3b3; }
.line-number-tooltip { position: absolute; left: 2px; height: 30px; display: flex; align-items: center; padding: 0 5px; font-family: 'Courier New', Courier, monospace; font-size: 12px; color: #aaa; z-index: 3; opacity: 0; transition: opacity 0.2s; }
.line-number-tooltip.visible { opacity: 1; }
.editor { position: absolute; top: 40px; left: 40px; bottom: 20px; right: 20px; width: auto; height: auto; z-index: 2; border: none; background: transparent; outline: none; resize: none; font-family: 'Kalam', cursive; font-size: 18px; line-height: 30px; color: #2c3e50; padding: 0; background-image: none; }
.page-right { padding: 0; }
.renderer { flex: 1; width: 100%; height: 100%; border: none; background-color: #fff; }
.console { height: 100px; flex-shrink: 0; background-color: #f7f7f7; border-top: 1px solid #ccc; padding: 10px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; overflow-y: auto; font-family: 'Courier New', Courier, monospace; color: #333; }
.console .error { color: #e74c3c; }
.console .log { color: #2980b9; }
.run-button { margin-top: 20px; padding: 10px 25px; font-family: 'Kalam', cursive; font-size: 1.2rem; border: 2px solid #e8e4d8; color: #e8e4d8; background-color: transparent; cursor: pointer; transition: all 0.2s; }
.run-button:hover { background-color: #e8e4d8; color: #333; }