@import url('https://fonts.googleapis.com/css2?family=Almendra:ital,wght@0,400;0,700;1,400;1,700&display=swap');
:root {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --accent-color: white;
    --card-text: #222;
    --border-color: #555;
}

body {
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Almendra', serif, Arial; 
    background-image: url('../Images/damask-vintage-pattern-background.jpg');
    background-size: 1100px;
}


.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 80vh;
    box-sizing: border-box;
}


.centered-title {
    text-align: center;
    

    font-size: 46px;
    color: #dfc8a1; 
    margin-bottom: 40px;
    letter-spacing: 2px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
}

/*Series View*/
.series-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

/*Wood Button*/
.action-btn, .topic-btn {

    background-color: #5c4033; 
    background-image: url('../Images/wood_texture2.webp'); 
    background-size: 100%;
    background-position: center;

    color: #f0f0f0; 
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9); 
    font-family: inherit;
    font-size: 1.2rem;

    border: 2px solid #2b170a; 
    box-shadow: 
        inset 0 0 15px rgba(0,0,0,0.6), 
        3px 3px 6px rgba(0,0,0,0.5);    
    
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s, box-shadow 0.1s;
}

.action-btn {
    padding: 15px 30px;
    border-radius: 6px;
}

#back-btn { 
    margin-bottom: 20px; 
    padding: 10px 20px; 
    font-size: 1rem; 
}


.lore-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 50px;
}


.topics-column {
    display: flex;
    flex-direction: column;
}


.topic-btn {
    padding: 15px;
    text-align: left;
    margin-bottom: 6px; 
    border-radius: 4px;
}




.action-btn:hover, .topic-btn:hover { 
    filter: brightness(1.25); 
}


.action-btn:active, .topic-btn:active {
    transform: scale(0.98);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}


.topic-btn.active { 

    box-shadow: inset 0 0 25px rgba(0,0,0,0.9);
    border-color: var(--accent-color);
    color: var(--accent-color); 
    filter: brightness(0.8);
}



.lore-box {
  
    background-color: #e6dcb8;
    background-image: url('../Images/paper.webp');
    background-size: cover;
    background-position: center;
    color: var(--card-text); 
    
    border: 3px solid #333; 
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    height: 500px; 
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3), 5px 5px 15px rgba(0,0,0,0.5);
}

.lore-header {
    border-bottom: 2px solid rgba(0,0,0,0.4); 
    padding: 20px;
    text-align: center;
}

.lore-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.lore-body {
    flex: 1;
    padding: 30px;
    padding-top: 0px;
    padding-bottom: 0px;
    overflow-y: auto;
    white-space: pre-wrap; 
    font-size: 1.1rem;
    line-height: 1.6;
}


.lore-body::-webkit-scrollbar {
    width: 8px;
}
.lore-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1); 
}
.lore-body::-webkit-scrollbar-thumb {
    background: var(--accent-color); 
    border-radius: 4px;
}

.lore-footer {
    border-top: 2px solid rgba(0,0,0,0.4);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-arrow {
    background: transparent;
    border: none;
    color: var(--card-text); 
    font-size: 1.5rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: color 0.2s, transform 0.1s;
}

.nav-arrow:hover:not(:disabled) { 
    color: var(--accent-color); 
    transform: scale(1.1);
}

.nav-arrow:disabled { 
    color: rgba(0,0,0,0.2); 
    cursor: default; 
}

#page-indicator {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Order Puzzle Module */

.order-puzzle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
    padding-top: 10px;
}

.poem-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 60px;
    width: 100%;
    max-width: 600px;

    padding: 20px 25px;
    box-sizing: border-box;

    background-color: rgba(0, 0, 0, 0.05);
    border: 2px dashed rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.15);
}

.poem-display:empty::before {
    content: "— arrange the fragments below —";
    font-style: italic;
    opacity: 0.45;
    font-size: 1rem;
}
.poem-line {
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--card-text);
    cursor: pointer;
    transition: opacity 0.2s;
    margin: 0;
}

.poem-line:hover {
    opacity: 0.6;
}

.puzzle-instructions {
    margin: 0;
    font-style: italic;
    color: var(--card-text);
}

.puzzle-pool {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 0;
}

.puzzle-pool-item {
    color: var(--card-text);
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.puzzle-pool-item:hover {
    text-decoration: underline;
    opacity: 0.75;
}

#puzzle-check-btn {
    background-color: #5c4033;
    background-image: url('../Images/wood_texture2.webp');
    background-size: 100%;
    background-position: center;

    color: #f0f0f0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    font-family: inherit;
    font-size: 1.1rem;

    padding: 12px 26px;
    border: 2px solid #2b170a;
    border-radius: 6px;
    box-shadow:
        inset 0 0 15px rgba(0,0,0,0.6),
        3px 3px 6px rgba(0,0,0,0.5);

    cursor: pointer;
    transition: filter 0.2s, transform 0.1s, box-shadow 0.1s;
}

#puzzle-check-btn:hover:not(:disabled) {
    filter: brightness(1.25);
}

#puzzle-check-btn:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

#puzzle-check-btn:disabled {
    filter: brightness(0.8);
    box-shadow: inset 0 0 25px rgba(0,0,0,0.9);
    cursor: default;
}

#puzzle-result {
    margin: 0;
    font-weight: bold;
    color: #8b0000;
    min-height: 1.2em;
}
.puzzle-intro {
    margin: 0;
    font-style: bold;
    font-size: 2rem;
    line-height: 1.6;
    color: var(--card-text);
    max-width: 600px;
}
.poem-line {
    display: flex;
    gap: 12px;
    align-items: baseline;
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--card-text);
    margin: 0;
}

.poem-line.filled {
    cursor: pointer;
    transition: opacity 0.2s;
}

.poem-line.filled:hover {
    opacity: 0.6;
}

.poem-number {
    font-style: normal;
    font-weight: bold;
    min-width: 1.5em;
    text-align: right;
    opacity: 0.7;
}

.poem-line.empty .poem-text {
    display: inline-block;
    min-width: 200px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.35);
}
/*page 3*/
.completion-check {
    text-align: center;
}

.completion-message {
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--card-text);
    margin-bottom: 15px;
}

.completion-missing-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.completion-missing-list li {
    font-weight: bold;
    color: #8b0000;
}

.completion-check.complete .completion-message {
    color: #2b5c2b;
    font-weight: bold;
}
@media (max-width: 900px) {
    .lore-layout {
        grid-template-columns: 110px 1fr;
        gap: 15px;
    }

    .topic-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .lore-box {
        height: 400px;
    }

    .lore-header h2 {
        font-size: 1.15rem;
    }

    .centered-title {
        font-size: 30px;
        margin-bottom: 25px;
    }
}