
:root {
    --background: #18121b;
    --surface: #281e2c;
    --text: #f5e8e8;
    --muted: #bca9b8;
    --accent: #d4a574;
    --border: #493747;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

body.light-mode {
    --background: #f9f2e9;
    --surface: #ffffff;
    --text: #382b30;
    --muted: #75636b;
    --accent: #a06443;
    --border: #e2d3ca;
}

header {
    position: relative;
    text-align: center;
    padding: 30px 20px;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-family: Georgia, serif;
    color: var(--accent);
    font-size: 32px;
    margin: 0;
}

header p {
    color: var(--muted);
    margin: 5px 0;
}

#theme-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 12px;
}

main {
    max-width: 850px;
    margin: auto;
    padding: 20px;
}

#welcome {
    text-align: center;
    padding: 25px 15px;
}

h2 {
    font-family: Georgia, serif;
    color: var(--accent);
}

#welcome p {
    color: var(--muted);
}

.book-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    max-width: 360px;
    margin: 20px auto;
    text-align: center;
}

.book-cover {
    height: 240px;
    border-radius: 12px;
    background: linear-gradient(
        145deg, #21121e, #69283e, #261322
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.book-card h3 {
    font-family: Georgia, serif;
    font-size: 24px;
    color: var(--accent);
}

.book-card p,
.book-card span {
    color: var(--muted);
}

button {
    background: var(--accent);
    color: #201820;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
}

button:hover {
    opacity: 0.85;
}

button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#read-button {
    display: block;
    width: 100%;
    margin: 20px 0 0;
}

#reader {
    max-width: 720px;
    margin: auto;
}

#chapter-title {
    text-align: center;
    margin: 35px 0;
}

#chapter-content {
    font-family: Georgia, serif;
    font-size: 20px;
    line-height: 1.9;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    padding: 10px 0 30px;
}

footer {
    text-align: center;
    padding: 25px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
    header h1 {
        font-size: 26px;
    }

    main {
        padding: 15px;
    }

    .book-cover {
        height: 200px;
    }

    #chapter-content {
        font-size: 18px;
    }
}
