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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #172033;
    min-height: 100vh;
}


/* HEADER */

.header {
    background: #123c8c;
    color: white;
    padding: 18px 6%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-weight: 800;
    letter-spacing: 1px;
}

.header-title {
    font-weight: 600;
}


/* GENERAL */

main {
    min-height: calc(100vh - 140px);
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}


/* HERO */

.hero {
    max-width: 1100px;
    margin: auto;
    padding: 70px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    color: #123c8c;
    margin-bottom: 15px;
}

.hero > p {
    font-size: 20px;
    color: #555;
    margin-bottom: 50px;
}


/* MODE CARDS */

.mode-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.mode-card {
    background: white;
    border: none;
    border-radius: 18px;
    padding: 40px 30px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: 0.25s;
}

.mode-card:hover {
    transform: translateY(-6px);
}

.mode-icon {
    font-size: 55px;
    margin-bottom: 20px;
}

.mode-card h2 {
    color: #123c8c;
    margin-bottom: 12px;
}

.mode-card p {
    color: #666;
    margin-bottom: 25px;
}

.mode-card span {
    color: #d48b00;
    font-weight: bold;
}


/* PANELS */

.test-panel,
.result-panel {
    max-width: 900px;
    margin: 70px auto;
    background: white;
    padding: 45px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.test-panel h1,
.result-panel h1 {
    color: #123c8c;
    margin-bottom: 15px;
}

.test-panel p {
    color: #666;
    margin-bottom: 30px;
}


/* BUTTONS */

button {
    background: #123c8c;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    margin: 6px;
}

button:hover {
    opacity: 0.9;
}

.secondary,
.back-button {
    background: #777;
}


/* DURATION */

.duration-buttons {
    margin: 30px 0;
}


/* TEST */

.test-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
}

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

.test-top > div {
    background: white;
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.06);
}

.test-top small,
.result-grid small {
    display: block;
    color: #777;
    margin-bottom: 7px;
}

.test-top strong {
    font-size: 28px;
    color: #123c8c;
}


/* PASSAGE */

.passage {
    background: white;
    padding: 30px;
    border-radius: 15px;
    font-size: 20px;
    line-height: 1.8;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.06);
}


/* TEXT AREA */

textarea {
    width: 100%;
    min-height: 220px;
    border: 3px solid #dfe5ef;
    border-radius: 15px;
    padding: 25px;
    font-size: 20px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
}

textarea:focus {
    border-color: #123c8c;
}


/* RESULT */

.main-score {
    margin: 35px 0;
}

.main-score small {
    color: #777;
}

.main-score div {
    font-size: 80px;
    font-weight: 800;
    color: #123c8c;
}

.main-score span {
    font-size: 20px;
    color: #555;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.result-grid > div {
    background: #f4f7fb;
    padding: 20px;
    border-radius: 10px;
}

.result-grid strong {
    font-size: 25px;
}


/* FOOTER */

footer {
    text-align: center;
    padding: 25px;
    color: #777;
}


/* MOBILE */

@media (max-width: 700px) {

    .header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .hero h1 {
        font-size: 36px;
    }

    .mode-container {
        grid-template-columns: 1fr;
    }

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

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

    .test-panel,
    .result-panel {
        margin: 30px 15px;
        padding: 25px;
    }

}
/* =================================
   VERSION 1.2
   PROFESSIONAL TYPING INTERFACE
================================= */


/* FIVE STATISTICS */

.test-top {
    grid-template-columns: repeat(5, 1fr);
}


/* PASSAGE */

.passage {
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
}


/* TYPING CHARACTERS */

.typing-char {
    position: relative;
}


.typing-char.correct {
    color: #16803c;
}


.typing-char.incorrect {
    color: #d62828;
    background: #ffe1e1;
    border-radius: 3px;
}


.typing-char.current {
    background: #fff0b3;
    border-radius: 3px;
}


.typing-char.current::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 1.3em;
    background: #123c8c;
    left: 0;
    top: 0;
    animation: cursorBlink 1s infinite;
}


@keyframes cursorBlink {

    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }

}


/* PROGRESS */

.progress-container {
    margin: 15px 0 25px;
}


.progress-bar {
    height: 8px;
    background: #e4e8ef;
    border-radius: 10px;
    overflow: hidden;
}


#progressFill {
    height: 100%;
    width: 0%;
    background: #123c8c;
    transition: width 0.15s ease;
}


.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: #777;
}


/* BETTER TYPING BOX */

textarea {
    background: #ffffff;
    transition: border-color 0.2s;
}


textarea:focus {
    border-color: #123c8c;
    box-shadow: 0 0 0 3px rgba(18, 60, 140, 0.08);
}


/* DESKTOP */

@media (min-width: 1000px) {

    .test-container {
        max-width: 1250px;
    }

}


/* TABLET */

@media (max-width: 900px) {

    .test-top {
        grid-template-columns: repeat(3, 1fr);
    }

}


/* MOBILE */

@media (max-width: 600px) {

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

    .passage {
        font-size: 18px;
        line-height: 1.7;
        max-height: 250px;
    }

    .progress-text {
        font-size: 12px;
    }

}
/* =================================
   VERSION 1.3
   PAPER → SCREEN
================================= */


/* TEST MODE LABEL */

.test-mode-label {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: #123c8c;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}


/* PAPER DESCRIPTION */

.paper-description {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}


/* PAPER INSTRUCTIONS */

.paper-instructions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}


.paper-instructions > div {
    background: #f4f7fb;
    padding: 20px;
    border-radius: 12px;
}


.paper-instructions strong {
    display: block;
    color: #123c8c;
    font-size: 14px;
    margin-bottom: 8px;
}


.paper-instructions span {
    color: #555;
}


/* PAPER PASSAGE LIST */

.paper-passage-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 30px 0;
}


.paper-passage-card {
    background: #ffffff;
    border: 2px solid #e4e8ef;
    border-radius: 14px;
    padding: 22px;
    text-align: left;
    transition: 0.2s;
}


.paper-passage-card:hover {
    border-color: #123c8c;
    transform: translateY(-3px);
}


.paper-passage-card h3 {
    color: #123c8c;
    margin-bottom: 8px;
}


.paper-passage-card p {
    color: #777;
    font-size: 14px;
    margin-bottom: 15px;
}


.paper-passage-card button {
    font-size: 14px;
    padding: 10px 16px;
}


/* PAPER TYPING MODE */

.paper-typing-notice {
    background: #fff7df;
    border-left: 5px solid #f4b400;
    padding: 15px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
    color: #555;
}


.paper-typing-notice strong {
    color: #123c8c;
}


/* HIDE REFERENCE PASSAGE */

.paper-mode-hidden {
    display: none !important;
}


/* MOBILE */

@media (max-width: 700px) {

    .paper-instructions {
        grid-template-columns: 1fr;
    }

    .paper-passage-list {
        grid-template-columns: 1fr;
    }

}
/* =================================
   VERSION 1.4
   PASSAGE FILTERS
================================= */

.passage-filters {

    display: grid;

    grid-template-columns:
        2fr 1fr 1fr;

    gap: 15px;

    margin: 30px 0 15px;

    padding: 20px;

    background: #f4f7fb;

    border-radius: 14px;

}


.filter-group {

    text-align: left;

}


.filter-group label {

    display: block;

    font-size: 13px;

    font-weight: 700;

    color: #123c8c;

    margin-bottom: 7px;

}


.filter-group input,
.filter-group select {

    width: 100%;

    box-sizing: border-box;

    padding: 12px 14px;

    border: 1px solid #d9dfe8;

    border-radius: 8px;

    background: #ffffff;

    font-size: 14px;

    outline: none;

}


.filter-group input:focus,
.filter-group select:focus {

    border-color: #123c8c;

    box-shadow:
        0 0 0 3px
        rgba(18, 60, 140, 0.08);

}


.passage-result-count {

    text-align: left;

    font-size: 14px;

    font-weight: 600;

    color: #666;

    margin: 15px 0;

}


.no-passages {

    grid-column: 1 / -1;

    padding: 40px 20px;

    background: #f8f8f8;

    border-radius: 12px;

    color: #777;

    text-align: center;

}


@media (max-width: 700px) {

    .passage-filters {

        grid-template-columns: 1fr;

    }

}
/* =========================================
   VERSION 1.5 - PAPER TEST SETUP
   ========================================= */

.paper-setup-panel {
    max-width: 850px;
    margin: 0 auto;
}

.paper-setup-panel h1 {
    text-align: center;
    margin-bottom: 10px;
}

.selected-passage-info {
    margin: 30px 0;
    padding: 25px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.selected-passage-info h2 {
    margin: 0 0 20px;
    text-align: center;
    color: #123c8c;
    font-size: 24px;
}

.passage-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.info-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}

.info-box span {
    display: block;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.info-box strong {
    display: block;
    font-size: 18px;
    color: #123c8c;
}

.duration-section {
    margin: 30px 0;
    text-align: center;
}

.duration-section h2 {
    margin-bottom: 20px;
    color: #1e293b;
}

.duration-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.duration-btn {
    padding: 15px 10px;
    border: 2px solid #dbe3ef;
    border-radius: 12px;
    background: white;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.duration-btn:hover {
    border-color: #123c8c;
    transform: translateY(-2px);
}

.duration-btn.selected {
    background: #123c8c;
    color: white;
    border-color: #123c8c;
    box-shadow: 0 5px 15px rgba(18, 60, 140, 0.20);
}

.setup-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.setup-actions button {
    min-width: 180px;
}


/* Mobile Responsive */

@media (max-width: 700px) {

    .passage-info-grid {
        grid-template-columns: 1fr;
    }

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

    .setup-actions {
        flex-direction: column;
    }

    .setup-actions button {
        width: 100%;
    }

    .selected-passage-info {
        padding: 18px;
    }

    .selected-passage-info h2 {
        font-size: 20px;
    }
}
/* =========================================
   VERSION 1.6 - PAPER TEST INSTRUCTIONS
   ========================================= */

.paper-test-rules {
    margin: 25px 0;
    padding: 20px 25px;
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-left: 5px solid #123c8c;
    border-radius: 12px;
}

.paper-test-rules h3 {
    margin: 0 0 15px;
    color: #123c8c;
    font-size: 19px;
}

.paper-test-rules ul {
    margin: 0;
    padding-left: 25px;
}

.paper-test-rules li {
    margin-bottom: 9px;
    color: #475569;
    font-size: 15px;
    line-height: 1.5;
}

.paper-test-rules li:last-child {
    margin-bottom: 0;
}

.paper-test-rules strong {
    color: #123c8c;
}


/* Mobile */

@media (max-width: 700px) {

    .paper-test-rules {
        padding: 18px;
    }

    .paper-test-rules li {
        font-size: 14px;
    }
}
/* =========================================
   VERSION 1.7 - RESULT TEST INFORMATION
   ========================================= */

.result-test-info {
    margin: 15px auto 25px;
    text-align: center;
}

.result-test-info h2 {
    margin: 0 0 8px;
    color: #123c8c;
    font-size: 24px;
    font-weight: 700;
}

.result-test-info p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
    font-weight: 600;
}


/* Mobile */

@media (max-width: 700px) {

    .result-test-info h2 {
        font-size: 20px;
    }

    .result-test-info p {
        font-size: 14px;
    }
}
/* =========================================
   VERSION 1.7 - GROSS WPM RESULT
   ========================================= */

.gross-score {
    margin: 25px auto 20px;
    text-align: center;
}

.gross-score small {
    display: block;
    margin-bottom: 8px;
    color: #123c8c;
    font-size: 14px;
    font-weight: 600;
}

.gross-score div {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    color: #123c8c;
}

.gross-score span {
    display: block;
    margin-top: 4px;
    color: #475569;
    font-size: 16px;
}
/* =========================================
   VERSION 2.1 - PERFORMANCE DASHBOARD
   ========================================= */

#performanceScreen {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px 50px;
}


/* =========================================
   PERFORMANCE HEADER
   ========================================= */

.performance-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.performance-header > div {
    flex: 1;
}

.performance-header h1 {
    margin: 0;
    font-size: 32px;
    color: #123c8c;
}

.performance-header p {
    margin: 6px 0 0;
    color: #666;
    font-size: 15px;
}


/* =========================================
   STATISTICS CARDS
   ========================================= */

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

.performance-stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 18px;
    text-align: center;
    border: 1px solid #e2e6ee;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.06);
}

.performance-stat-card span {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
}

.performance-stat-card small {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #666;
}

.performance-stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    color: #123c8c;
}


/* =========================================
   AVERAGE PERFORMANCE
   ========================================= */

.average-performance {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 25px;
    margin-bottom: 25px;
    border: 1px solid #e2e6ee;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.06);
}

.average-performance h2 {
    margin: 0 0 18px;
    color: #123c8c;
    font-size: 21px;
}

.average-value {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.average-value strong {
    font-size: 38px;
    color: #123c8c;
}

.average-value span {
    color: #666;
    font-size: 15px;
}


/* =========================================
   TEST HISTORY
   ========================================= */

.history-section {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    border: 1px solid #e2e6ee;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.06);
}

.history-header {
    margin-bottom: 18px;
}

.history-header h2 {
    margin: 0;
    color: #123c8c;
    font-size: 21px;
}


/* =========================================
   HISTORY TABLE
   ========================================= */

.history-table-container {
    width: 100%;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
    font-size: 14px;
}

.history-table th {
    background: #123c8c;
    color: #ffffff;
    padding: 13px 12px;
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.history-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #e8ebf0;
    color: #333;
    vertical-align: middle;
}

.history-table tbody tr:hover {
    background: #f5f8fc;
}


/* Passage column */

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    min-width: 260px;
    max-width: 350px;
}

.history-table td:nth-child(2) {
    white-space: normal;
    line-height: 1.4;
}


/* Mode */

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    text-transform: uppercase;
    font-weight: 600;
}


/* WPM */

.history-table th:nth-child(5),
.history-table td:nth-child(5) {
    font-weight: 700;
    color: #123c8c;
}


/* Accuracy */

.history-table th:nth-child(6),
.history-table td:nth-child(6) {
    font-weight: 600;
}


/* =========================================
   PERFORMANCE CARD ON HOME SCREEN
   ========================================= */

.performance-card {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 25px;
    padding: 22px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e6ee;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.06);
}

.performance-icon {
    font-size: 38px;
}

.performance-content {
    flex: 1;
}

.performance-content h2 {
    margin: 0 0 5px;
    color: #123c8c;
}

.performance-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}


/* =========================================
   MOBILE RESPONSIVE
   ========================================= */

@media (max-width: 900px) {

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

}

@media (max-width: 600px) {

    #performanceScreen {
        padding: 20px 14px 40px;
    }

    .performance-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .performance-header h1 {
        font-size: 27px;
    }

    .performance-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .performance-stat-card {
        padding: 18px 10px;
    }

    .performance-stat-card strong {
        font-size: 25px;
    }

    .history-section {
        padding: 15px;
    }

    .performance-card {
        flex-direction: column;
        text-align: center;
    }

    .performance-content {
        flex: none;
    }

}
/* Fix Test History column alignment */

.history-table th,
.history-table td {
    text-align: left;
    vertical-align: middle;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4),
.history-table th:nth-child(5),
.history-table td:nth-child(5),
.history-table th:nth-child(6),
.history-table td:nth-child(6),
.history-table th:nth-child(7),
.history-table td:nth-child(7) {
    text-align: center;
}

.history-table th:nth-child(5) {
    min-width: 100px;
}

.history-table th:nth-child(6) {
    min-width: 100px;
}

.history-table th:nth-child(7) {
    min-width: 90px;
}
/* =========================================
   FIX HISTORY TABLE COLUMN WIDTHS
   ========================================= */

.history-table {
    table-layout: fixed;
    width: 100%;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
    width: 18%;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    width: 31%;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    width: 10%;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
    width: 9%;
}

.history-table th:nth-child(5),
.history-table td:nth-child(5) {
    width: 11%;
}

.history-table th:nth-child(6),
.history-table td:nth-child(6) {
    width: 11%;
}

.history-table th:nth-child(7),
.history-table td:nth-child(7) {
    width: 10%;
}

.history-table th {
    white-space: nowrap;
    text-align: center;
}

.history-table td:nth-child(1),
.history-table td:nth-child(2) {
    text-align: left;
}

.history-table td:nth-child(3),
.history-table td:nth-child(4),
.history-table td:nth-child(5),
.history-table td:nth-child(6),
.history-table td:nth-child(7) {
    text-align: center;
}
/* =========================================
   VERSION 2.1 - HISTORY TABLE ALIGNMENT
   ========================================= */

.history-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    table-layout: auto;
}

.history-table th,
.history-table td {
    padding: 13px 12px;
    vertical-align: middle;
}

.history-table th {
    white-space: nowrap;
    text-align: left;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
    min-width: 170px;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    min-width: 280px;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    min-width: 90px;
    text-align: center;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
    min-width: 70px;
    text-align: center;
}

.history-table th:nth-child(5),
.history-table td:nth-child(5) {
    min-width: 90px;
    text-align: center;
}

.history-table th:nth-child(6),
.history-table td:nth-child(6) {
    min-width: 100px;
    text-align: center;
}

.history-table th:nth-child(7),
.history-table td:nth-child(7) {
    min-width: 80px;
    text-align: center;
}
/* Fix Net WPM header visibility */
.history-table th:nth-child(5) {
    color: #ffffff;
}
/* =========================================
   VERSION 2.1 - HISTORY FILTERS
   ========================================= */

.history-filters {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f5f8fc;
    border: 1px solid #e2e6ee;
    border-radius: 10px;
}

.history-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-filter-group label {
    font-size: 12px;
    font-weight: 700;
    color: #555;
}

.history-filter-group select {
    min-width: 180px;
    padding: 10px 12px;
    border: 1px solid #cfd6e2;
    border-radius: 7px;
    background: #ffffff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.history-filter-group select:focus {
    border-color: #123c8c;
    box-shadow: 0 0 0 2px rgba(18, 60, 140, 0.1);
}


/* Mobile */

@media (max-width: 600px) {

    .history-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .history-filter-group select {
        width: 100%;
    }

}
/* =========================================
   VERSION 2.1 - CLEAR HISTORY BUTTON
   ========================================= */

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.clear-history-button {
    padding: 9px 14px;
    border: 1px solid #d9534f;
    border-radius: 7px;
    background: #ffffff;
    color: #d9534f;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.clear-history-button:hover {
    background: #d9534f;
    color: #ffffff;
}

@media (max-width: 600px) {
    .history-header {
        align-items: flex-start;
        flex-direction: column;
    }
}
/* SCREEN → SCREEN PASSAGE LIBRARY */

#screenPassageScreen {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px 50px;
}

.passage-library-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.passage-library-header h1 {
    margin: 0;
}

.passage-library-header p {
    margin: 6px 0 0;
    color: #666;
}

.passage-library-intro {
    margin-bottom: 25px;
}

.passage-library-intro h2 {
    margin-bottom: 8px;
}

.passage-library-intro p {
    color: #666;
}

.passage-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.passage-card {
    background: #ffffff;
    border: 1px solid #e2e6ee;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.passage-card-content {
    flex: 1;
}

.passage-card h3 {
    margin: 0 0 8px;
    color: #123c8c;
}

.passage-category {
    margin: 0 0 12px;
    color: #666;
}

.passage-meta {
    display: flex;
    gap: 18px;
    font-size: 14px;
    color: #555;
}

.passage-card button {
    white-space: nowrap;
}

@media (max-width: 768px) {

    .passage-list {
        grid-template-columns: 1fr;
    }

    .passage-card {
        flex-direction: column;
        align-items: stretch;
    }

    .passage-card button {
        width: 100%;
    }

    .passage-library-header {
        align-items: flex-start;
    }
}
/* IMPROVED SCREEN PASSAGE CARDS */

.passage-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid #e1e6ef;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.passage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.09);
}

.passage-number {
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #123c8c;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
}

.passage-card-content {
    flex: 1;
    min-width: 0;
}

.passage-card h3 {
    margin: 0 0 7px;
    color: #123c8c;
    font-size: 18px;
    line-height: 1.35;
}

.passage-category {
    margin: 0 0 12px;
    color: #666;
    font-size: 14px;
}

.passage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.word-info,
.difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f3f6fa;
    color: #555;
    font-size: 13px;
    font-weight: 600;
}

.passage-start-button {
    flex-shrink: 0;
    white-space: nowrap;
}

/* MOBILE */

@media (max-width: 768px) {

    .passage-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .passage-card-content {
        width: calc(100% - 68px);
    }

    .passage-start-button {
        width: 100%;
        margin-top: 5px;
    }

}
.selected-screen-passage-info {
    margin: 20px 0;
    padding: 18px 20px;
    background: #f5f8fc;
    border: 1px solid #dfe5ef;
    border-radius: 12px;
}

.selected-screen-passage-info h2 {
    margin: 0 0 8px;
    color: #123c8c;
    font-size: 20px;
}

.selected-screen-passage-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* SCREEN → SCREEN PASSAGE FILTERS */

.screen-passage-filters {
    display: flex;
    gap: 16px;
    margin: 25px 0 12px;
    padding: 16px;
    background: #f5f8fc;
    border: 1px solid #e2e6ee;
    border-radius: 12px;
}

.screen-filter-group {
    flex: 1;
}

.screen-filter-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.screen-filter-group input,
.screen-filter-group select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d5dbe5;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
    box-sizing: border-box;
}

.screen-filter-group input:focus,
.screen-filter-group select:focus {
    outline: none;
    border-color: #123c8c;
}

.screen-passage-result-count {
    margin: 12px 0 18px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.screen-passage-no-results {
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fb;
    border: 1px dashed #cfd5df;
    border-radius: 12px;
    margin-bottom: 20px;
}

.screen-passage-no-results h3 {
    margin: 0 0 8px;
    color: #123c8c;
}

.screen-passage-no-results p {
    margin: 0;
    color: #666;
}

@media (max-width: 768px) {

    .screen-passage-filters {
        flex-direction: column;
    }

}
.passage-library-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.passage-library-intro-content {
    flex: 1;
}

.random-passage-button {
    flex-shrink: 0;
    background: #123c8c;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.random-passage-button:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {

    .passage-library-intro {
        flex-direction: column;
        align-items: stretch;
    }

    .random-passage-button {
        width: 100%;
    }

}
/* ================================
   SUPPORT FREE EDUCATION
   ================================ */

.support-card {
    margin: 30px 0;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e3e8f0;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(18, 60, 140, 0.08);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 35px;
}

.support-content {
    flex: 1;
}

.support-content h2 {
    margin: 0 0 12px;
    color: #123c8c;
    font-size: 24px;
}

.support-content p {
    margin: 8px 0;
    color: #555;
    line-height: 1.6;
    font-size: 15px;
}

.support-icon {
    font-size: 34px;
    margin-bottom: 5px;
}

.support-note {
    color: #123c8c !important;
}

.support-payment {
    width: 230px;
    text-align: center;
    flex-shrink: 0;
    padding: 18px;
    background: #f5f8fc;
    border-radius: 14px;
}

.upi-qr {
    width: 190px;
    height: 190px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
}

.upi-label {
    margin: 5px 0;
    font-weight: 700;
    color: #123c8c;
    font-size: 16px;
}

.upi-id {
    margin: 8px 0;
    color: #444;
    font-size: 14px;
    word-break: break-word;
}

.upi-id strong {
    color: #123c8c;
}

.support-thanks {
    margin: 10px 0 0;
    color: #666;
    font-size: 13px;
}

/* Mobile */
@media (max-width: 768px) {

    .support-card {
        flex-direction: column;
        text-align: center;
        padding: 22px;
    }

    .support-payment {
        width: 100%;
        max-width: 280px;
    }

    .upi-qr {
        width: 200px;
        height: 200px;
    }

}
