/* FAMICOM Reader Styles - Game-like reading experience */

/* Reader-specific body override */
body.reader-mode {
    background: #f0e0c0;
    color: #2c2c54;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Reader Header - FAMICOM Menu Bar */
.reader-header {
    background: #e84040;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 4px solid #b02020;
    border-top: 3px solid #ffcc00;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
    position: relative;
}

.book-title {
    font-size: 1rem;
    color: #fff;
    font-family: 'DungGeunMo', monospace;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
}

.view-toggle-btn {
    background: #44aa44;
    color: white;
    padding: 0.5rem 1rem;
    border: 3px solid #2c882c;
    text-decoration: none;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 44px;
    font-family: 'DungGeunMo', monospace;
    font-size: 0.85rem;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
}

.view-toggle-btn:hover {
    background: #339933;
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}

.exit-btn {
    background: #4488cc;
    color: white;
    padding: 0.5rem 1rem;
    border: 3px solid #2c6090;
    text-decoration: none;
    transition: all 0.1s;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-family: 'DungGeunMo', monospace;
    font-size: 0.85rem;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
}

.exit-btn:hover {
    background: #3377bb;
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}

/* Reader Content - RPG Game Screen */
.reader-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.page-number {
    color: #e84040;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-family: 'DungGeunMo', monospace;
}

.page-number::before {
    content: '[ ';
}

.page-number::after {
    content: ' ]';
}

/* Page Type Indicators - FAMICOM Badges */
.page-type-indicator {
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-weight: bold;
    font-family: 'DungGeunMo', monospace;
    font-size: 0.9rem;
    border: 3px solid;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

.page-type-indicator.ending {
    background: #44aa44;
    color: white;
    border-color: #2c882c;
}

.page-type-indicator.ending::before {
    content: '★ ';
}

.page-type-indicator.death {
    background: #e84040;
    color: white;
    border-color: #b02020;
}

.page-type-indicator.death::before {
    content: '☠ ';
}

.page-type-indicator.failure {
    background: #e88840;
    color: white;
    border-color: #c06820;
}

.page-type-indicator.failure::before {
    content: '💔 ';
}

.page-type-indicator.checkpoint {
    background: #ffcc00;
    color: #2c2c54;
    border-color: #d4a800;
}

.page-type-indicator.checkpoint::before {
    content: '▲ ';
}

/* Page Content - FAMICOM Text Box */
.page-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #e84040;
    font-family: 'DungGeunMo', monospace;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.15);
    letter-spacing: 2px;
}

.page-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border: 4px solid #2c2c54;
    margin-bottom: 2rem;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
}

.page-image::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #e84040;
    pointer-events: none;
}

.page-content .inline-image {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    position: relative;
}

.page-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    text-align: left;
    white-space: pre-wrap;
    max-width: 700px;
    background: #fff8e8;
    color: #2c2c54;
    padding: 2rem;
    border: 4px solid #2c2c54;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
    position: relative;
    font-family: 'DungGeunMo', monospace;
}

.page-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #e84040;
    pointer-events: none;
}

/* Choices - FAMICOM Menu Items */
.choices-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 600px;
}

.choice-btn {
    background: #4488cc;
    color: #fff;
    padding: 1.25rem 2rem;
    border: 3px solid #2c6090;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    transition: all 0.1s;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-family: 'DungGeunMo', monospace;
    position: relative;
}

.choice-btn::before {
    content: '▶ ';
    margin-right: 0.5rem;
    color: #fff;
}

.choice-btn:hover {
    background: #e84040;
    border-color: #b02020;
    color: #fff;
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 rgba(0,0,0,0.25);
}

.choice-btn:hover::before {
    color: #fff;
}

.choice-btn:active {
    transform: translate(3px, 3px);
    box-shadow: none;
}

/* Next Book Button - Special Style */
.next-book-btn {
    background: #e84040;
    border-color: #b02020;
}

.next-book-btn::before {
    content: '📖 ';
}

.next-book-btn:hover {
    background: #d73030;
}

/* Ending Messages - FAMICOM Dialog */
.ending-message {
    text-align: center;
    margin-top: 2rem;
    background: #fff8e8;
    padding: 2rem;
    border: 4px solid #2c2c54;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
    position: relative;
}

.ending-message::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #e84040;
    pointer-events: none;
}

.ending-message h2 {
    color: #e84040;
    font-family: 'DungGeunMo', monospace;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}

.ending-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Progress Display - FAMICOM HP/MP Bar Style */
.progress-info {
    background: #fff8e8;
    padding: 1rem;
    border: 3px solid #2c2c54;
    margin-bottom: 1rem;
    font-family: 'DungGeunMo', monospace;
    font-size: 0.85rem;
    color: #2c2c54;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
}

.progress-bar {
    height: 20px;
    background: #d0c0a0;
    border: 2px solid #2c2c54;
    margin-top: 0.5rem;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: #44aa44;
    transition: width 0.3s;
}

/* Mobile Responsive - Smaller RPG UI */
@media (max-width: 767px) {
    .reader-header {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .book-title {
        font-size: 0.85rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .header-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .view-toggle-btn,
    .exit-btn {
        flex: 1;
        justify-content: center;
        padding: 0.75rem;
        font-size: 0.75rem;
        border-width: 2px;
        box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
    }

    .reader-content {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .page-content {
        font-size: 0.9rem;
        line-height: 1.6;
        padding: 1rem;
        border-width: 3px;
        box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    }

    .page-image {
        max-width: 100%;
        border-width: 3px;
        box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    }

    .choice-btn {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
        min-height: 44px;
        border-width: 3px;
        box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    }

    .choice-btn:hover {
        transform: translate(1px, 1px);
        box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
    }

    .ending-actions {
        flex-direction: column;
        width: 100%;
    }

    .ending-actions .choice-btn {
        width: 100%;
    }

    .ending-message {
        padding: 1rem;
        border-width: 3px;
        box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    }
}

/* Very small screens */
@media (max-width: 375px) {
    .page-title {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .page-content {
        font-size: 0.85rem;
    }

    .choice-btn {
        font-size: 0.85rem;
    }
}
