
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: #0b1220;
    color: white;
    font-family: Arial, sans-serif;
    padding: 20px;
}

.navbar {
    max-width: 1100px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 25px;
}

.logo {
    color: white;
    text-decoration: none;
    font-size: 29px;
    font-weight: bold;
}

.logo span {
    color: #38bdf8;
}

.practice-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #94a3b8;
    font-size: 13px;
}

.practice-info span:first-child {
    color: #38bdf8;
    background: #17243a;
    padding: 9px 14px;
    border-radius: 20px;
}

.ad-space {
    width: 100%;
    max-width: 900px;
    min-height: 90px;
    border: 1px dashed #46536b;
    border-radius: 10px;
    margin: 10px auto 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #718096;
    font-size: 13px;
    letter-spacing: 2px;
}

.container {
    max-width: 950px;
    margin: auto;
}

.page-heading {
    margin: 35px 0 28px;
}

.tagline {
    color: #38bdf8;
    font-size: 11px;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.page-heading h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.page-heading p:last-child {
    color: #94a3b8;
    font-size: 14px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 25px;
}

.stat-card {
    background: #151f32;
    border: 1px solid #293850;
    border-radius: 10px;
    padding: 18px;
}

.stat-card small {
    color: #94a3b8;
    font-size: 11px;
    letter-spacing: 1px;
}

.stat-card strong {
    display: block;
    color: #38bdf8;
    font-size: 27px;
    margin-top: 10px;
}

.typing-card {
    background: #151f32;
    border: 1px solid #293850;
    border-radius: 14px;
    padding: 25px;
}

.passage-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
}

.chapter-label {
    color: #38bdf8;
    font-size: 10px;
    letter-spacing: 2px;
}

.passage-heading h2 {
    margin-top: 7px;
    font-size: 20px;
}

.progress-label {
    color: #94a3b8;
    font-size: 12px;
}

.passage-window {
    height: 235px;
    overflow-y: auto;
    background: #0b1220;
    border: 1px solid #34445d;
    border-radius: 10px;
    padding: 22px;
    scroll-behavior: smooth;
}

.passage-text {
    font-size: 19px;
    line-height: 2.15;
    color: #cbd5e1;
    overflow-wrap: break-word;
}

.word {
    border-radius: 4px;
    padding: 2px 1px;
    transition: background 0.1s;
}

.word.correct {
    color: #86efac;
    background: rgba(34, 197, 94, 0.15);
}

.word.current {
    color: white;
    background: rgba(74, 222, 128, 0.25);
    outline: 1px solid #4ade80;
}

.word.error {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.25);
    outline: 1px solid #ef4444;
}

.legend {
    display: flex;
    gap: 22px;
    margin: 17px 0 25px;
    color: #94a3b8;
    font-size: 12px;
    flex-wrap: wrap;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.green-dot {
    background: #4ade80;
}

.current-dot {
    background: #86efac;
}

.red-dot {
    background: #ef4444;
}

.input-label {
    display: block;
    color: #38bdf8;
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

textarea {
    width: 100%;
    min-height: 115px;
    resize: vertical;
    background: #0b1220;
    color: white;
    border: 1px solid #34445d;
    border-radius: 9px;
    padding: 17px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    outline: none;
}

textarea:focus {
    border-color: #38bdf8;
}

textarea::placeholder {
    color: #64748b;
}

.controls {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.controls button,
.result-box button {
    padding: 13px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    border: none;
}

.reset-btn {
    color: #cbd5e1;
    background: #293850;
}

.finish-btn,
.result-box button {
    color: white;
    background: #0284c7;
}

.finish-btn:hover,
.result-box button:hover {
    background: #0369a1;
}

.result-box {
    display: none;
    margin-top: 25px;
    background: #0b1220;
    border: 1px solid #38bdf8;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.result-box h2 {
    color: #38bdf8;
    margin-bottom: 10px;
}

.result-box p {
    color: #94a3b8;
    margin-bottom: 22px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 22px;
    color: #94a3b8;
    font-size: 13px;
}

.result-stats strong {
    display: block;
    color: #38bdf8;
    font-size: 25px;
    margin-top: 8px;
}

.result-box a {
    display: block;
    color: #38bdf8;
    margin-top: 18px;
    font-size: 13px;
    text-decoration: none;
}

.bottom-ad {
    margin-top: 35px;
}

footer {
    text-align: center;
    color: #718096;
    font-size: 12px;
    padding: 25px 0;
}

@media (max-width: 650px) {
    body {
        padding: 12px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .typing-card {
        padding: 15px;
    }

    .passage-window {
        height: 235px;
        padding: 15px;
    }

    .passage-text {
        font-size: 16px;
    }

    .page-heading h1 {
        font-size: 27px;
    }

    .passage-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Three-column advertisement layout */

.practice-layout {
    max-width: 1400px;
    margin: auto;
    display: grid;
    grid-template-columns: 160px minmax(0, 950px) 160px;
    justify-content: center;
    align-items: start;
    gap: 20px;
}

.practice-main {
    width: 100%;
    min-width: 0;
}

.side-ad {
    min-height: 350px;
    border: 1px dashed #46536b;
    border-radius: 10px;
    color: #718096;
    font-size: 12px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    position: sticky;
    top: 20px;
}

/* Tablet and mobile */

@media (max-width: 1050px) {
    .practice-layout {
        grid-template-columns: minmax(0, 950px);
    }

    .side-ad {
        display: none;
    }
}
/* ===== FULL SCREEN RESPONSIVE PRACTICE LAYOUT ===== */

.practice-layout {
    width: calc(100% - 48px);
    max-width: 1750px;
    margin: 25px auto;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 150px;
    gap: 24px;
    align-items: start;
}

.practice-main {
    width: 100%;
    min-width: 0;
}

/* Remove the narrow fixed width from the main container */
.practice-main .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}

/* Advertisement areas */
.side-ad {
    width: 100%;
    min-height: 380px;
    position: sticky;
    top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
}

/* Typing section */
.typing-card {
    width: 100%;
}

/* Larger paragraph viewing area */
.passage-window {
    width: 100%;
    min-height: 320px;
    max-height: 420px;
    overflow-y: auto;
}

/* Responsive layout for smaller screens */
@media (max-width: 1100px) {
    .practice-layout {
        grid-template-columns: minmax(0, 1fr);
        width: calc(100% - 32px);
    }

    .side-ad {
        display: none;
    }
}

@media (max-width: 600px) {
    .practice-layout {
        width: calc(100% - 20px);
        margin: 15px auto;
    }

    .passage-window {
        min-height: 250px;
        max-height: 350px;
    }
}.exercise-picker-label { display:flex; flex-direction:column; gap:6px; color:#94a3b8; font-size:12px; }
.exercise-picker-label select { background:#17243a; color:#fff; border:1px solid #34445d; border-radius:7px; padding:8px; max-width:220px; }
.passage-text .word { white-space:pre-wrap; }

/* Paragraph presentation for the expanded exercise library */
.passage-window { height: 360px; min-height: 300px; max-height: 460px; }
.passage-text { display:block; width:100%; white-space:pre-wrap; overflow-wrap:anywhere; line-height:2.0; font-size:18px; }
.passage-text .word { white-space:pre-wrap; }
@media (max-width:600px) { .passage-window { height:300px; min-height:250px; } .passage-text { font-size:16px; } }


/* Continuous paragraph session: keep reading width comfortable so each passage
   naturally occupies several lines and paragraph boundaries remain visible. */
.passage-window { max-height: 460px; overflow-y: auto; }
.passage-text { max-width: 980px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.passage-text .word { white-space: normal; }
@media (max-width: 700px) { .passage-text { line-height: 1.85; } }
