@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyah/thmanyahsans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyah/thmanyahsans-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyah/thmanyahsans-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyah/thmanyahsans-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --navy: #434e78;
    --blue: #607b8f;
    --blue-ink: #4e6678;
    --blue-soft: #a3b5c2;
    --accent: #e97f4a;
    --accent-ink: #934519;
    --yellow: #f7e396;
    --yellow-soft: #fcf7e3;
    --ink: #2e3552;
    --muted: #5f677a;
    --line: #dce1e8;
    --surface: #ffffff;
    --background: #f6f7fa;
    --green: #177b50;
    --green-soft: #e8f7ef;
    --red: #b42318;
    --red-soft: #ffebe9;
    --orange: #8d431e;
    --orange-soft: #fdf0e8;
    --shadow: 0 18px 55px rgba(67,78,120, .09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: 'Thmanyah Sans', Tahoma, Arial, sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-ink); text-decoration: none; }
a:hover { color: var(--navy); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.container { width: min(1160px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(220,225,232, .9);
    backdrop-filter: blur(14px);
}

.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; color: var(--navy); flex-shrink: 0; }
.brand:hover { color: var(--navy); }
.brand-logo { display: block; width: auto; height: 62px; object-fit: contain; }

.header-actions { display: flex; align-items: center; gap: 22px; font-weight: 700; font-size: 14px; }
.header-actions form { margin: 0; }
.link-button { padding: 0; border: 0; background: none; color: var(--blue-ink); font-weight: 700; }
.link-button:hover { color: var(--navy); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 24px;
    color: #fff;
    background: var(--navy);
    border: 1px solid var(--navy);
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(67,78,120, .15);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { color: #fff; background: var(--blue-ink); border-color: var(--blue-ink); transform: translateY(-1px); box-shadow: 0 13px 28px rgba(67,78,120, .2); }
.button-small { min-height: 40px; padding: 7px 17px; font-size: 13px; }
.button-outline { color: var(--navy); background: #fff; border-color: #bbc6d1; box-shadow: none; }
.button-outline:hover { color: var(--navy); background: var(--yellow-soft); border-color: var(--yellow); }
.button-block { width: 100%; }
.button-danger { color: #fff; background: var(--red); border-color: var(--red); box-shadow: none; }
.button-danger:hover { background: #8f1d14; border-color: #8f1d14; }

.hero { overflow: hidden; background: linear-gradient(135deg, #fafbfd 0%, #f0f4f6 54%, #fcf7e3 100%); border-bottom: 1px solid var(--line); }
.hero-grid { min-height: 620px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 50px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--blue-ink); font-size: 13px; font-weight: 800; letter-spacing: .3px; }
.eyebrow::before { content: ''; width: 28px; height: 4px; border-radius: 9px; background: var(--yellow); }
.hero-copy h1 { margin: 20px 0 20px; color: var(--navy); font-size: clamp(42px, 5.5vw, 72px); line-height: 1.22; letter-spacing: -2px; }
.hero-copy h1 span { color: var(--blue-ink); }
.hero-copy p { max-width: 610px; margin: 0; color: var(--muted); font-size: 18px; line-height: 2; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; }

.book-scene { position: relative; width: 100%; height: 460px; }
.sun { position: absolute; width: 320px; height: 320px; border-radius: 50%; background: var(--yellow); opacity: .88; top: 45px; left: 50%; transform: translateX(-50%); box-shadow: 0 0 0 35px rgba(247,227,150, .13); }
.book { position: absolute; left: 50%; border-radius: 8px 20px 20px 8px; box-shadow: 0 24px 35px rgba(67,78,120, .2); transform-origin: center; }
.book-back { width: 330px; height: 74px; bottom: 92px; background: #f7e396; border: 9px solid var(--navy); transform: translateX(-54%) rotate(-5deg); }
.book-middle { width: 350px; height: 82px; bottom: 145px; background: #fff; border: 10px solid var(--blue-soft); transform: translateX(-47%) rotate(5deg); }
.book-front { width: 255px; height: 300px; bottom: 180px; background: var(--blue); border: 9px solid var(--navy); transform: translateX(-47%) rotate(-7deg); display: grid; place-items: center; }
.book-front::before { content: ''; position: absolute; inset: 18px 25px; border: 2px solid rgba(255,255,255,.4); }
.book-front span { width: 90px; height: 90px; display: grid; place-items: center; background: var(--yellow); color: var(--navy); font-size: 50px; font-weight: 900; border-radius: 50%; }
.reading-line { position: absolute; width: 430px; height: 22px; bottom: 68px; left: 50%; transform: translateX(-50%); border-radius: 50%; background: rgba(67,78,120, .16); filter: blur(9px); }
.floating-card { position: absolute; z-index: 4; padding: 9px 16px; border-radius: 10px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 800; box-shadow: 0 13px 28px rgba(67,78,120, .15); }
.card-one { right: 0; top: 110px; transform: rotate(7deg); }
.card-two { left: 8px; top: 220px; transform: rotate(-8deg); }

.section { padding: 90px 0 110px; background: #fff; }
.section-heading { text-align: center; margin-bottom: 40px; }
.section-heading .eyebrow { justify-content: center; }
.section-heading h2 { margin: 14px 0 0; color: var(--navy); font-size: clamp(30px, 4vw, 44px); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { position: relative; padding: 28px; min-height: 225px; border: 1px solid var(--line); border-radius: 18px; background: #fff; overflow: hidden; }
.feature-card.featured { background: var(--navy); color: #fff; border-color: var(--navy); transform: translateY(-9px); box-shadow: var(--shadow); }
.feature-card > span { display: inline-block; margin-bottom: 25px; color: var(--yellow); font-size: 14px; font-weight: 900; }
.feature-card:not(.featured) > span { color: var(--blue-ink); }
.feature-card h3 { margin: 0 0 10px; color: inherit; font-size: 22px; }
.feature-card:not(.featured) h3 { color: var(--navy); }
.feature-card p { margin: 0; color: inherit; opacity: .78; }

.auth-section { min-height: calc(100vh - 150px); padding: 70px 0 90px; background: linear-gradient(135deg, #f3f5f8 0%, #fcf8e9 100%); }
.auth-centered { display: flex; align-items: center; }
.auth-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 65px; align-items: center; }
.auth-intro h1 { margin: 17px 0; color: var(--navy); font-size: clamp(36px, 5vw, 56px); line-height: 1.35; }
.auth-intro > p { color: var(--muted); font-size: 17px; line-height: 2; }
.quote-card { margin-top: 30px; padding: 23px; color: var(--navy); background: rgba(255,255,255,.7); border-right: 5px solid var(--yellow); border-radius: 14px; font-weight: 700; }
.narrow-container { max-width: 580px; }
.form-card, .success-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 4vw, 42px); box-shadow: var(--shadow); }
.login-card { max-width: 540px; margin-inline: auto; }
.form-icon { width: 66px; height: 66px; margin: -6px auto 20px; display: grid; place-items: center; color: var(--navy); background: var(--yellow); border: 7px solid var(--yellow-soft); border-radius: 50%; font-size: 31px; font-weight: 900; }
.form-heading { text-align: center; margin-bottom: 26px; }
.form-heading h1, .form-heading h2 { margin: 0 0 4px; color: var(--navy); font-size: 28px; }
.form-heading p { margin: 0; color: var(--muted); }
.field { margin-bottom: 18px; }
.field label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 7px; color: var(--navy); font-size: 14px; font-weight: 800; }
.field label span { color: var(--red); }
.field label em { color: var(--muted); font-size: 11px; font-style: normal; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-height: 49px; padding: 10px 13px; color: var(--ink); background: #fff; border: 1px solid #c4ccd8; border-radius: 10px; outline: 0; }
.field textarea { resize: vertical; }
.field select { appearance: auto; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(96,123,143,.1); }
.field-error, .field-hint { display: block; margin-top: 5px; font-size: 12px; }
.field-error { color: var(--red); font-weight: 700; }
.field-hint { color: var(--muted); }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--blue); }
.form-footer { margin: 19px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.form-footer a { font-weight: 800; }
.password-help { margin: -8px 0 14px; font-size: 13px; font-weight: 800; }
.success-card { padding-block: 60px; text-align: center; }
.success-icon { width: 82px; height: 82px; display: grid; place-items: center; margin: 0 auto 21px; color: var(--green); background: var(--green-soft); border-radius: 50%; font-size: 40px; font-weight: 900; }
.success-card h1 { margin: 15px 0 10px; color: var(--navy); font-size: 34px; }
.success-card p { margin: 0 auto 27px; max-width: 460px; color: var(--muted); }

.dashboard-section { min-height: calc(100vh - 150px); padding: 55px 0 90px; }
.page-heading, .dashboard-welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.page-heading h1, .dashboard-welcome h1 { margin: 9px 0 3px; color: var(--navy); font-size: clamp(30px, 4vw, 42px); }
.page-heading p, .dashboard-welcome p { margin: 0; color: var(--muted); }
.stats-grid { display: grid; gap: 16px; margin-bottom: 25px; }
.admin-stats { grid-template-columns: repeat(4, 1fr); }
.student-stats { grid-template-columns: repeat(3, 1fr); }
.student-stats.has-rank { grid-template-columns: repeat(4, 1fr); }
.stat-card { min-height: 156px; padding: 23px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgba(67,78,120,.05); }
.stat-card > span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-card strong { display: inline-block; margin: 9px 0 1px; color: var(--navy); font-size: 42px; line-height: 1.2; }
.stat-card .stat-word { font-size: 30px; }
.stat-card small { display: block; color: var(--muted); }
.stat-card.primary { border-top: 5px solid var(--blue); }
.stat-card.warning { border-top: 5px solid var(--yellow); }
.stat-card.success { border-top: 5px solid #53b889; }
.stat-card.danger { border-top: 5px solid #df827a; }
.stat-card-link { display: block; transition: transform .2s ease, box-shadow .2s ease; }
.stat-card-link:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 13px 32px rgba(67,78,120,.1); }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 260px; }
.review-actions form { margin: 0; }
.rejected-task-list { display: grid; gap: 14px; }
.rejected-task-card { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr); gap: 24px; align-items: end; padding: 20px; border: 1px solid #f0c4c0; border-radius: 14px; background: var(--red-soft); }
.rejected-task-card h3 { margin: 9px 0 2px; color: var(--navy); }
.rejected-task-card p { margin: 0; }
.rejected-task-card small { color: var(--muted); }
.resubmission-form { display: flex; align-items: end; gap: 12px; }
.resubmission-form .field { flex: 1; margin: 0; }

.panel { margin-top: 22px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 35px rgba(67,78,120,.06); overflow: hidden; }
.panel-heading { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0 0 2px; color: var(--navy); font-size: 21px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.panel-heading > a { font-weight: 800; font-size: 13px; }
.panel-empty { padding: 55px 20px; text-align: center; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 15px 20px; text-align: right; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); background: #fafbfd; font-size: 12px; }
td strong, td small { display: block; }
td small { margin-top: 2px; color: var(--muted); font-size: 11px; }
tbody tr:hover { background: #f7f8fb; }
.table-link { font-weight: 800; white-space: nowrap; }
.status-badge { display: inline-flex; min-height: 31px; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.status-badge.success { color: var(--green); background: var(--green-soft); }
.status-badge.warning { color: var(--orange); background: var(--orange-soft); }
.status-badge.danger { color: var(--red); background: var(--red-soft); }
.status-badge.muted { color: #5f677a; background: #f0f2f5; }

.filter-panel { padding: 20px; overflow: visible; }
.filter-grid { display: grid; grid-template-columns: 1.4fr .8fr .8fr auto; gap: 13px; align-items: end; }
.filter-grid .field { margin: 0; }
.filter-actions { min-height: 49px; display: flex; align-items: center; gap: 12px; }
.filter-actions .button { min-height: 49px; }
.filter-actions > a { font-size: 13px; font-weight: 800; }
.pagination { padding: 18px 24px; }
.pagination-links { display: flex; align-items: center; justify-content: center; gap: 15px; color: var(--muted); font-size: 13px; }
.pagination-links a, .pagination-disabled { display: inline-flex; min-height: 38px; align-items: center; padding: 6px 14px; border: 1px solid var(--line); border-radius: 9px; font-weight: 800; }
.pagination-disabled { opacity: .45; }
.narrow-admin { max-width: 920px; }
.admin-form-card { padding: 32px; }
.student-meta { display: flex; flex-wrap: wrap; gap: 10px 25px; margin: 3px 0 24px; padding: 15px; color: var(--muted); background: #f6f7fa; border-radius: 10px; font-size: 12px; }
.alert { margin: 0 0 18px; padding: 14px 17px; border-radius: 11px; font-weight: 700; }
.alert.success { color: var(--green); background: var(--green-soft); border: 1px solid #b5e2ca; }
.alert.danger { color: var(--red); background: var(--red-soft); border: 1px solid #f1b6b1; }
.alert.warning { color: var(--orange); background: var(--orange-soft); border: 1px solid #f7e396; }
.alert.info { color: var(--blue-ink); background: #f0f4f6; border: 1px solid #d1dbe3; }
.secondary-action-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.heading-actions { display: flex; gap: 10px; }
.book-cell { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.book-cell img { width: 43px; height: 58px; object-fit: cover; border-radius: 5px; background: #f0f2f5; }
.rank-cell, .student-name-cell, .table-actions { display: flex; align-items: center; gap: 10px; }
.rank-cell img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: var(--background); }
.student-name-cell { flex-wrap: wrap; }
.table-actions { gap: 14px; }
.mini-rank, .title-rank, .rank-badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d1dbe3; border-radius: 999px; color: var(--blue-ink); background: #f0f4f6; font-size: 11px; font-weight: 900; }
.mini-rank { padding: 2px 8px; }
.mini-rank img { width: 18px; height: 18px; object-fit: contain; }
.title-rank { width: 39px; height: 39px; margin-inline-start: 8px; padding: 5px; justify-content: center; vertical-align: middle; }
.title-rank img { width: 27px; height: 27px; object-fit: contain; }
.rank-summary > div { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.rank-summary img { width: 48px; height: 48px; object-fit: contain; }
.rank-summary strong { margin: 0; }
.current-rank-icon { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px; padding: 10px 14px; color: var(--muted); background: #f6f7fa; border-radius: 12px; font-size: 13px; }
.current-rank-icon img { width: 52px; height: 52px; object-fit: contain; }
.start-panel { margin-bottom: 25px; }
.start-reading-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 15px; align-items: end; padding: 24px; }
.start-reading-form .field { margin: 0; }
.visual-book-form { display: block; }
.visual-book-form > .field { max-width: 620px; margin: 24px 0 18px; }
.book-picker { margin: 0; padding: 0; border: 0; }
.book-picker legend { margin-bottom: 13px; color: var(--navy); font-size: 14px; font-weight: 800; }
.book-picker legend span { color: var(--red); }
.book-choice-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.book-choice { position: relative; min-width: 0; }
.book-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.book-choice label { position: relative; isolation: isolate; display: flex; height: 100%; min-height: 360px; flex-direction: column; overflow: hidden; background: #fff; border: 2px solid var(--line); border-radius: 15px; cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.book-choice label:hover { transform: translateY(-3px); border-color: var(--blue-soft); box-shadow: 0 12px 28px rgba(67,78,120,.12); }
.book-choice input:focus-visible + label { outline: 3px solid rgba(96,123,143,.25); outline-offset: 3px; }
.book-choice input:checked + label { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(96,123,143,.12), 0 14px 30px rgba(67,78,120,.12); }
.book-choice input:checked + label::after { content: '✓ تم الاختيار'; position: absolute; z-index: 2; top: 10px; right: 10px; padding: 4px 9px; color: #fff; background: var(--blue-ink); border-radius: 999px; font-size: 10px; font-weight: 900; }
.book-choice-cover { width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; padding: 10px; background: linear-gradient(145deg, #f6f7fa, #e9edf2); border-bottom: 1px solid var(--line); }
.book-choice-cover img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center; }
.book-choice-details { display: flex; min-width: 0; flex: 1; flex-direction: column; padding: 13px; }
.book-choice label strong { color: var(--navy); font-size: 14px; line-height: 1.5; }
.book-choice-details strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.book-choice label small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.book-choice label em { margin-top: auto; padding-top: 8px; color: var(--blue-ink); font-size: 11px; font-style: normal; font-weight: 800; }
.active-reading { display: grid; grid-template-columns: 250px 1fr; gap: 32px; margin-bottom: 28px; padding: 30px; background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--yellow); border-radius: 20px; box-shadow: var(--shadow); }
.active-reading.overdue { border-top-color: var(--red); }
.active-cover img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: #f0f2f5; box-shadow: 0 15px 30px rgba(67,78,120,.15); }
.active-details h2 { margin: 12px 0 4px; color: var(--navy); font-size: 30px; }
.active-details > p { margin: 0; color: var(--muted); }
.reading-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.reading-meta span { padding: 5px 10px; color: var(--blue-ink); background: #f0f4f6; border-radius: 8px; font-size: 12px; font-weight: 800; }
.task-description, .task-preview { margin-top: 14px; padding: 13px 15px; color: var(--ink); background: #f6f7fa; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.task-description p, .task-preview p { margin: 3px 0 0; color: var(--muted); }
.task-preview[hidden] { display: none; }
.countdown { display: flex; flex-direction: column; margin: 18px 0; padding: 18px; background: var(--navy); color: #fff; border-radius: 13px; }
.countdown > span, .countdown small { opacity: .72; font-size: 12px; }
.countdown strong { margin: 3px 0; color: var(--yellow); font-size: 25px; }
.late-note { margin-bottom: 16px; padding: 12px 14px; color: var(--red); background: var(--red-soft); border-radius: 9px; font-size: 13px; font-weight: 700; }
.submission-form { padding-top: 18px; border-top: 1px solid var(--line); }
.submission-form .field { margin-bottom: 12px; }
.empty-state { padding: 70px 20px; text-align: center; background: #fff; border: 1px dashed #bbc6d1; border-radius: 18px; }
.empty-book { width: 78px; height: 90px; margin: 0 auto 20px; display: grid; place-items: center; color: var(--navy); background: var(--yellow); border: 7px solid var(--blue); border-radius: 5px 13px 13px 5px; font-size: 36px; font-weight: 900; }
.empty-state h2 { margin: 0 0 5px; color: var(--navy); }
.empty-state p { margin: 0 auto; max-width: 600px; color: var(--muted); }

.leaderboard-page { overflow: hidden; padding: 18px 0 24px; background: radial-gradient(circle at 50% -5%, #fff 0, transparent 38%), linear-gradient(135deg, #fdfbf4 0%, #fdfaf1 58%, #fcf7e3 100%); }
.leaderboard-shell { width: min(1280px, calc(100% - 40px)); margin-inline: auto; }
.leaderboard-hero { position: relative; min-height: 160px; display: flex; align-items: center; justify-content: center; }
.leaderboard-brand { position: absolute; top: 8px; left: 10px; width: 170px; display: flex; flex-direction: column; align-items: center; color: var(--navy); }
.leaderboard-brand:hover { color: var(--navy); }
.leaderboard-brand img { display: block; width: 155px; height: auto; }
.leaderboard-brand span { margin-top: 1px; font-size: 13px; font-weight: 800; }
.leaderboard-book-art { position: absolute; top: -4px; right: 4px; width: 285px; opacity: .78; }
.leaderboard-book-art svg { display: block; width: 100%; }
.leaderboard-book-art path { stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.leaderboard-heading { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; text-align: center; }
.leaderboard-heading h1 { margin: 0; color: var(--navy); font-size: clamp(42px, 4.2vw, 64px); line-height: 1.15; letter-spacing: -.8px; }
.leaderboard-heading p { margin: 4px 0 0; color: var(--navy); font-size: clamp(18px, 1.7vw, 25px); font-weight: 800; }
.leaderboard-divider { max-width: 720px; height: 18px; display: flex; align-items: center; margin: 0 auto 16px; color: var(--accent); }
.leaderboard-divider::before, .leaderboard-divider::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--accent)); }
.leaderboard-divider::after { background: linear-gradient(90deg, var(--accent), transparent); }
.leaderboard-divider span { padding: 0 7px; font-size: 22px; }
.leaderboard-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; margin-bottom: 20px; }
.podium-card { position: relative; isolation: isolate; min-width: 0; min-height: 170px; display: flex; direction: ltr; align-items: center; gap: 20px; padding: 24px 26px; color: var(--navy); background: rgba(255,255,255,.93); border: 1.5px solid #f1b28b; border-radius: 16px; box-shadow: 0 13px 35px rgba(67,78,120,.055); transition: transform .2s ease, box-shadow .2s ease; }
.podium-card:hover { color: var(--navy); transform: translateY(-2px); box-shadow: 0 17px 42px rgba(67,78,120,.11); }
.podium-card.position-1 { grid-column: 2; grid-row: 1; background: linear-gradient(110deg, #fcf7e3, #fff 55%); box-shadow: 0 15px 40px rgba(233,127,74,.12); }
.podium-card.position-2 { grid-column: 1; grid-row: 1; }
.podium-card.position-3 { grid-column: 3; grid-row: 1; }
.podium-medal { position: relative; z-index: 2; flex: 0 0 88px; width: 88px; height: 88px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--blue), var(--navy)); border: 7px solid var(--yellow); border-radius: 50%; box-shadow: 0 7px 0 var(--navy), 0 12px 20px rgba(67,78,120,.22); }
.podium-medal::before, .podium-medal::after { content: ''; position: absolute; z-index: -1; bottom: -37px; width: 29px; height: 45px; background: var(--navy); }
.podium-medal::before { right: 9px; transform: rotate(-7deg); clip-path: polygon(0 0,100% 0,100% 100%,50% 76%,0 100%); }
.podium-medal::after { left: 9px; transform: rotate(7deg); clip-path: polygon(0 0,100% 0,100% 100%,50% 76%,0 100%); }
.position-1 .podium-medal { color: var(--ink); background: linear-gradient(145deg, #f0a17c, var(--accent)); border-color: #f7c4aa; box-shadow: 0 8px 0 #b95e32, 0 15px 24px rgba(233,127,74,.24); }
.position-1 .podium-medal::before, .position-1 .podium-medal::after { background: var(--accent); }
.podium-medal b { font-size: 27px; letter-spacing: 1px; }
.podium-student { min-width: 0; flex: 1; direction: rtl; text-align: center; }
.podium-student > strong { display: block; color: var(--navy); font-size: clamp(19px, 1.7vw, 26px); line-height: 1.4; overflow-wrap: anywhere; }
.podium-student > small { display: block; margin: 2px 0 10px; color: var(--navy); font-size: 13px; }
.podium-student > small b { color: var(--accent-ink); font-size: 20px; }
.podium-rank { min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 14px; color: #fff; background: var(--navy); border-radius: 999px; font-size: 13px; font-weight: 800; }
.podium-rank img { width: 22px; height: 22px; object-fit: contain; }
.podium-rank.no-rank { color: var(--muted); background: #f0f2f5; }
.podium-laurel { position: absolute; right: 15px; top: 50%; color: var(--accent); font-size: 43px; line-height: 1; transform: translateY(-50%) rotate(-22deg); opacity: .82; }
.leaderboard-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.level-panel { position: relative; min-width: 0; min-height: 340px; overflow: hidden; background: rgba(255,255,255,.96); border: 1.5px solid #f1b28b; border-radius: 12px; box-shadow: 0 9px 28px rgba(67,78,120,.04); }
.level-panel::before, .level-panel::after { content: ''; position: absolute; z-index: 2; bottom: 4px; width: 18px; height: 18px; border-bottom: 2px solid var(--accent); }
.level-panel::before { right: 5px; border-right: 2px solid var(--accent); border-radius: 0 0 8px 0; }
.level-panel::after { left: 5px; border-left: 2px solid var(--accent); border-radius: 0 0 0 8px; }
.level-panel-header { position: relative; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 16px; color: #fff; background: linear-gradient(105deg, var(--navy), #3b456a); }
.level-panel-header::before, .level-panel-header::after { content: ''; position: absolute; top: 0; width: 20px; height: 20px; background: var(--accent); clip-path: polygon(0 0,100% 0,0 100%); }
.level-panel-header::before { left: 0; }
.level-panel-header::after { right: 0; transform: scaleX(-1); }
.level-panel-header small { order: 2; color: rgba(255,255,255,.78); font-size: 12px; white-space: nowrap; }
.level-title { min-width: 0; order: 1; display: inline-flex; align-items: center; gap: 8px; }
.level-title img { width: 28px; height: 28px; object-fit: contain; }
.level-title strong { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.level-students { min-height: 275px; margin: 0; padding: 14px 18px 20px; list-style: none; }
.level-students li { border-bottom: 1px solid var(--line); }
.level-students li:last-child { border-bottom: 0; }
.level-students a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--navy); }
.level-students a:hover strong { color: var(--blue-ink); }
.level-students strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.level-students a span { flex-shrink: 0; color: var(--navy); font-size: 13px; font-weight: 900; }
.level-empty { display: grid; min-height: 235px; place-items: center; color: var(--muted); border: 0 !important; font-size: 14px; text-align: center; }
.level-panel-unranked .level-panel-header { background: linear-gradient(105deg, var(--muted), #4e5669); }
.leaderboard-closing { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 22px; color: var(--navy); text-align: center; }
.leaderboard-closing span { max-width: 320px; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--accent)); }
.leaderboard-closing span:last-child { background: linear-gradient(90deg, var(--accent), transparent); }
.leaderboard-closing b { color: var(--accent); font-size: 24px; }
.leaderboard-closing strong { font-size: clamp(18px, 2vw, 28px); }
.student-profile-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.active-student-reading { display: flex; align-items: center; gap: 20px; padding: 22px 24px; }
.active-student-reading > img { width: 86px; height: 116px; object-fit: cover; border-radius: 9px; }
.active-student-reading h3 { margin: 8px 0 0; color: var(--navy); font-size: 22px; }
.active-student-reading p { margin: 0; color: var(--muted); }

.site-footer { padding: 24px 0; color: rgba(255,255,255,.75); background: var(--navy); font-size: 12px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 980px) {
    .hero-grid, .auth-grid { grid-template-columns: 1fr; }
    .hero-grid { padding: 70px 0 20px; }
    .hero-copy { text-align: center; }
    .hero-copy p { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .book-scene { height: 420px; }
    .auth-grid { max-width: 700px; }
    .auth-intro { text-align: center; }
    .quote-card { display: none; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .filter-grid { grid-template-columns: repeat(2, 1fr); }
    .start-reading-form { grid-template-columns: 1fr 1fr; }
    .start-reading-form .button { grid-column: 1 / -1; }
    .book-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .leaderboard-shell { width: min(calc(100% - 40px), 1160px); }
    .leaderboard-brand { width: 165px; }
    .leaderboard-brand img { width: 150px; }
    .leaderboard-brand span { font-size: 12px; }
    .leaderboard-book-art { width: 265px; }
    .leaderboard-podium { gap: 14px; }
    .podium-card { gap: 15px; padding: 25px 20px; }
    .podium-medal { flex-basis: 82px; width: 82px; height: 82px; }
    .podium-laurel { display: none; }
    .leaderboard-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .student-stats.has-rank { grid-template-columns: repeat(2, 1fr); }
    .header-actions { gap: 12px; font-size: 12px; }
}

@media (max-width: 720px) {
    .site-header { position: static; }
    .header-inner { min-height: 70px; }
    .header-actions > a:not(.button) { display: none; }
    .feature-grid, .student-stats, .student-profile-summary { grid-template-columns: 1fr; }
    .feature-card.featured { transform: none; }
    .form-row, .filter-grid, .start-reading-form { grid-template-columns: 1fr; gap: 0; }
    .active-reading { grid-template-columns: 1fr; padding: 21px; }
    .active-cover { max-width: 210px; margin-inline: auto; }
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1; }
    .filter-actions { margin-top: 5px; }
    .page-heading, .dashboard-welcome { align-items: flex-start; flex-direction: column; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
    .book-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .leaderboard-page { padding-top: 17px; }
    .leaderboard-shell { width: min(calc(100% - 24px), 1160px); }
    .leaderboard-hero { min-height: 315px; align-items: flex-end; padding-bottom: 20px; }
    .leaderboard-brand { position: absolute; top: 0; left: 50%; width: 150px; transform: translateX(-50%); }
    .leaderboard-brand img { width: 135px; }
    .leaderboard-book-art { display: none; }
    .leaderboard-heading h1 { font-size: 45px; }
    .leaderboard-heading p { font-size: 17px; }
    .leaderboard-divider { margin-bottom: 24px; }
    .leaderboard-podium { grid-template-columns: 1fr; }
    .podium-card.position-1, .podium-card.position-2, .podium-card.position-3 { grid-column: 1; grid-row: auto; }
    .podium-card.position-1 { order: 1; }
    .podium-card.position-2 { order: 2; }
    .podium-card.position-3 { order: 3; }
    .podium-card { min-height: 160px; padding-inline: 28px; }
    .podium-student > strong { font-size: 22px; }
    .leaderboard-levels { grid-template-columns: 1fr; }
    .level-panel { min-height: 0; }
    .level-students { min-height: 0; }
    .level-empty { min-height: 150px; }
    .leaderboard-closing span { display: none; }
    .active-student-reading { align-items: flex-start; }
    .rejected-task-card { grid-template-columns: 1fr; }
    .resubmission-form { align-items: stretch; flex-direction: column; }
    .stat-card { min-height: 135px; }
    .site-footer .container { flex-direction: column; text-align: center; gap: 2px; }
}

@media (max-width: 480px) {
    .container { width: min(100% - 22px, 1160px); }
    .brand-logo { height: 50px; }
    .header-actions { gap: 8px; }
    .button-small { padding-inline: 11px; }
    .hero-grid { min-height: 0; }
    .hero-copy h1 { font-size: 38px; }
    .hero-actions { flex-direction: column; }
    .book-scene { transform: scale(.78); margin: -35px 0 -50px; }
    .podium-card { gap: 15px; padding: 25px 18px; }
    .podium-medal { flex-basis: 76px; width: 76px; height: 76px; border-width: 6px; }
    .podium-medal b { font-size: 24px; }
    .podium-rank { min-width: 115px; }
    .level-panel-header { padding-inline: 16px; }
    .auth-section, .dashboard-section { padding-top: 35px; }
    .form-card { padding: 23px 17px; }
    .admin-stats { grid-template-columns: 1fr; }
    .book-choice-grid { gap: 10px; }
    .book-choice label { min-height: 300px; }
    .book-choice-cover { padding: 7px; }
    .book-choice-details { padding: 10px; }
}
