/* =====================================================================
   style.css  —  HOW THE SITE LOOKS
   Change the colors in :root below to restyle every page at once.
   ===================================================================== */

/* ===== Colors & fonts: change these to restyle the whole site ===== */
:root {
  --paper: #FBF8F3;
  --white: #FFFFFF;
  --ink: #1C1917;
  --muted: #57534E;
  --line: #E7E1D8;
  --soft: #EFE9E0;
  --accent: #B42318;       /* Chinese red. Try #0F6E56 (jade) or #1D4ED8 (blue) */
  --accent-dark: #7A1A12;
  --good: #166534; --good-bg: #DCFCE7;
  --bad: #912018;  --bad-bg: #FEE4E2;
  --head: 'Space Grotesk', Inter, system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --zh: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.5; }
img { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.zh { font-family: var(--zh); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--head); line-height: 1.1; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }

/* ===== Header & dropdown menu ===== */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: relative; z-index: 20; }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 20px; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--zh); font-size: 22px; }
.menu-toggle { display: none; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.links > li > a, .drop-btn { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-radius: 8px; color: var(--ink); text-decoration: none; font: 500 15px var(--body); background: none; border: 0; cursor: pointer; }
.links > li > a:hover, .drop-btn:hover, .drop.open .drop-btn { background: var(--soft); color: var(--ink); }
.links .cta { background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 18px; font-weight: 600; margin-left: 8px; }
.links .cta:hover { background: #000; color: #fff; }
.drop { position: relative; }
.drop-panel { display: none; position: absolute; top: calc(100% + 6px); left: 0; width: 300px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(28,25,23,.14); padding: 8px; list-style: none; margin: 0; }
.drop.open .drop-panel { display: block; }
.drop-panel a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.drop-panel a:hover { background: var(--paper); color: var(--ink); }
.drop-panel strong { display: block; font-size: 15px; }
.drop-panel small { color: var(--muted); font-size: 13px; }
.drop-panel .zh { color: var(--accent); font-size: 18px; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font: 600 15px var(--body); color: var(--ink); cursor: pointer; }
  .links { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 8px; }
  .nav.open .links { display: flex; }
  .links .cta { margin: 8px 0 0; justify-content: center; }
  .drop-panel { position: static; width: 100%; box-shadow: none; margin-top: 4px; }
}

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 15px 24px; border-radius: 999px; font: 600 16px var(--body); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-main { background: var(--accent); color: #fff; }
.btn-main:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: var(--white); color: var(--ink); border-color: #D6CFC4; }
.btn-ghost:hover { background: var(--soft); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; padding: 12px 18px; font-size: 14px; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ===== Sections ===== */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 72px; padding-bottom: 64px; }
.hero-text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 22px; }
.hero-text .kicker { color: var(--accent); font-weight: 600; font-size: 15px; }
.hero h1 { font-size: clamp(38px, 6vw, 56px); }
.hero p.lead { font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 34em; }
.hero-video { flex: 1 1 460px; margin: 0; }
.hero-video figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--ink); color: #D6D3D1; display: grid; place-items: center; text-align: center; padding: 20px; font-size: 14px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.band { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 32px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-head h2 { font-size: 36px; }
.section-head p { margin-top: 8px; font-size: 17px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; }
.level-card { display: flex; flex-direction: column; gap: 16px; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); }
.level-card:hover { border-color: var(--accent); color: var(--ink); }
.level-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.level-top h3 { font-size: 22px; }
.level-word { text-align: right; }
.level-word .zh { display: block; font-size: 30px; color: var(--accent); line-height: 1.2; }
.level-word small { color: var(--muted); font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { padding: 6px 12px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 500; }

.game-card { display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.game-card .zh { font-size: 40px; color: var(--accent); line-height: 1; }
.game-card h3 { font-size: 22px; }
.game-card p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.game-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; font-size: 13px; color: var(--muted); font-weight: 500; }
.soon { padding: 8px 14px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 600; }

.xp-box { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.bar { display: block; width: 140px; height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s; }

.about { background: var(--ink); color: #fff; }
.about .section { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 48px; }
.about-photo { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; background: #3A3532; display: grid; place-items: center; color: #D6D3D1; font-size: 14px; flex: 0 0 auto; }
.about-text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 16px; }
.about-text h2 { font-size: 36px; }
.about-text p { color: #D6D3D1; font-size: 17px; line-height: 1.65; max-width: 38em; }
.about .btn-ghost { background: transparent; color: #fff; border-color: #78716C; }
.about .btn-ghost:hover { background: #2A2522; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 40px; padding-bottom: 40px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* ===== Level pages ===== */
.page-head { padding-top: 56px; padding-bottom: 8px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.page-head h1 { font-size: clamp(36px, 5vw, 52px); }
.page-head p { margin-top: 10px; font-size: 18px; color: var(--muted); }
.page-head .zh { font-size: 64px; color: var(--accent); line-height: 1; }
.two-col { display: flex; flex-wrap: wrap; gap: 32px; }
.two-col > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.two-col > aside { flex: 1 1 280px; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 22px; }
.vocab { width: 100%; border-collapse: collapse; font-size: 15px; }
.vocab td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.vocab td:first-child { font-family: var(--zh); font-size: 20px; }
.table-scroll { overflow-x: auto; }

/* ===== Game ===== */
.game-wrap { max-width: 520px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 18px; }
.game-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.lv-pill { padding: 6px 10px; background: var(--ink); color: #fff; border-radius: 8px; font-weight: 700; font-size: 13px; }
.game-top .bar { flex: 1 1 auto; width: auto; height: 10px; }
.game-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.hearts { color: var(--accent); font-size: 20px; letter-spacing: 2px; }
.timer { padding: 8px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; min-width: 64px; text-align: center; }
.timer.low { background: var(--accent); }
.q-card { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 32px 20px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.q-card .zh { font-size: clamp(64px, 18vw, 88px); line-height: 1.1; }
.q-card .py { font-size: 18px; color: var(--muted); }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.opt { min-height: 64px; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--white); font: 600 16px var(--body); color: var(--ink); cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opt.right { border-color: #15803D; background: var(--good-bg); }
.opt.wrong { border-color: var(--accent); background: var(--bad-bg); }
.opt:disabled { cursor: default; }
.feedback { padding: 16px; border-radius: 16px; min-height: 56px; font-size: 15px; }
.feedback.good { background: var(--good-bg); color: var(--good); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback.idle { background: var(--white); border: 1px dashed #D6CFC4; color: var(--muted); text-align: center; }
.result { text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.result .big { font-family: var(--head); font-size: 56px; font-weight: 700; }
.levelup { padding: 10px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* =====================================================================
   ADDED IN VERSION 2
   ===================================================================== */

/* "Soon" label in the dropdown and on level cards */
.soon-tag { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--soft); color: var(--muted); vertical-align: middle; }
.level-card.locked { opacity: .72; }
.level-card.locked:hover { border-color: var(--line); }

/* "Not available yet" popup */
.popup { border: 0; border-radius: 18px; padding: 28px; max-width: 420px; width: calc(100% - 40px); box-shadow: 0 24px 60px rgba(28,25,23,.25); color: var(--ink); font-family: var(--body); }
.popup::backdrop { background: rgba(28,25,23,.45); }
.popup h2 { font-size: 22px; margin-bottom: 10px; }
.popup p { color: var(--muted); margin-bottom: 20px; line-height: 1.6; }

/* About section: credentials */
.creds { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 4px 0 0; padding: 0; }
.creds li { color: #D6D3D1; font-size: 16px; padding-left: 22px; position: relative; line-height: 1.5; }
.creds li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* Contact section */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.contact-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.contact-card h3 { font-size: 20px; }
.contact-card .value { font-size: 18px; font-weight: 600; word-break: break-all; }
.contact-card .btn { align-self: flex-start; padding: 11px 18px; font-size: 14px; }

/* Level page */
.topics { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.set-list { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.set-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 600; }
.set-list a:hover { border-color: var(--accent); color: var(--ink); }
.set-list small { font-weight: 500; color: var(--muted); white-space: nowrap; }
.set-list .done { color: var(--good); }
.notice { background: var(--white); border: 1px dashed #D6CFC4; border-radius: 16px; padding: 32px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; margin: 48px 0; }

/* Practice page */
.practice-wrap { max-width: 640px; margin: 0 auto; padding: 32px 20px 56px; display: flex; flex-direction: column; gap: 18px; }
.progress-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.progress-line .bar { flex: 1 1 auto; width: auto; }
.q-text { font-size: 20px; font-weight: 600; line-height: 1.45; }
.q-zh { font-family: var(--zh); font-size: 40px; line-height: 1.3; }
.options.stack { grid-template-columns: 1fr; }
.options.stack .opt { text-align: left; min-height: 56px; }
.explain { font-size: 15px; line-height: 1.6; }
.review-list { text-align: left; width: 100%; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.review-list li { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; }

/* =====================================================================
   NSO CLASSES (added in version 3)
   ===================================================================== */
.badge { display: inline-block; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: #FDECEA; color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.nso-intro { padding-top: 64px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; }
.nso-intro h1 { font-size: clamp(36px, 5vw, 52px); }
.nso-intro .lead { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 40em; }

/* Class list */
.class-list { display: flex; flex-direction: column; gap: 14px; }
.class-card { display: flex; gap: 20px; align-items: flex-start; padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); }
.band .class-card { background: var(--paper); }
.class-card:hover { border-color: var(--accent); color: var(--ink); }
.class-num { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--head); font-weight: 700; font-size: 22px; }
.class-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.class-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; }
.class-title { font-family: var(--head); font-weight: 700; font-size: 20px; line-height: 1.25; }
.tag-done { padding: 3px 10px; border-radius: 999px; background: var(--good-bg); color: var(--good); font-size: 12px; font-weight: 600; }

/* One class page */
.class-page { padding-top: 32px; padding-bottom: 24px; }
.class-page .back { display: inline-block; margin-bottom: 18px; font-weight: 500; }
.class-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.class-head h1 { font-size: clamp(30px, 4.5vw, 44px); }
.class-page .video { max-width: 960px; }

/* "Your teacher" card */
.teacher-card { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding: 28px; margin-bottom: 48px; background: var(--ink); color: #fff; border-radius: 20px; }
.teacher-card img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.teacher-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 10px; }
.teacher-text h2 { font-size: 24px; }
.teacher-text p { color: #D6D3D1; line-height: 1.6; max-width: 44em; }
.teacher-card .btn-ghost { background: transparent; color: #fff; border-color: #78716C; padding: 11px 18px; font-size: 14px; }
.teacher-card .btn-ghost:hover { background: #2A2522; color: #fff; }

/* =====================================================================
   CLEANER PRACTICE PAGE (version 4)
   Wider column, short title, answers in two columns on big screens
   (they stack into one column on phones automatically).
   ===================================================================== */
.practice-wrap { max-width: 820px; padding-top: 28px; gap: 20px; }
.back-link { align-self: flex-start; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--accent); }
.quiz-head { display: flex; flex-direction: column; gap: 6px; }
.quiz-label { font-size: 14px; font-weight: 600; color: var(--accent); }
.quiz-head h1 { font-size: clamp(26px, 4vw, 34px); }
.practice-wrap .progress-line .bar { height: 6px; }
.practice-wrap .q-card { padding: 24px 28px; text-align: left; gap: 8px; border-radius: 18px; }
.practice-wrap .q-zh { font-size: 36px; }
.practice-wrap .q-text { font-size: 21px; }
.practice-wrap .options.stack { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.practice-wrap .opt { min-height: 60px; padding: 14px 18px; font-size: 16px; line-height: 1.35; }
.practice-wrap .feedback { border-radius: 14px; }

/* =====================================================================
   GAMES AND QUIZZES PAGES (version 5)
   ===================================================================== */
.hub { padding-top: 36px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 24px; }
.hub-head h1 { font-size: clamp(32px, 5vw, 46px); }
.hub-head p { margin-top: 8px; font-size: 17px; color: var(--muted); }
.hub-sub { font-size: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* One game per row, with its rounds */
.game-list { display: flex; flex-direction: column; gap: 18px; }
.game-card-head { display: flex; gap: 16px; align-items: center; }
.game-card-head .zh { font-size: 40px; line-height: 1; color: var(--accent); }
.game-card-head h3 { font-size: 22px; }
.game-card-head p { color: var(--muted); font-size: 15px; margin-top: 2px; }
.soon-card { opacity: .75; }

/* Round buttons: number, title, stars */
.rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.round { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); text-decoration: none; }
a.round:hover { border-color: var(--accent); color: var(--ink); }
.round-num { font-family: var(--head); font-weight: 700; font-size: 22px; }
.round-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.round-stars { font-size: 16px; color: #B7791F; letter-spacing: 2px; }
.round.done { border-color: #E9D5A6; background: #FFFBEB; }
.round.locked { color: var(--muted); background: var(--soft); border-style: dashed; cursor: not-allowed; }
.round.locked .round-stars { font-size: 13px; letter-spacing: 0; color: var(--muted); }
.round-progress { font-size: 14px; }

/* Game result: big stars */
.stars-big { font-size: 44px; letter-spacing: 6px; color: #B7791F; line-height: 1; }

/* Home page: the two big Games / Quizzes cards */
.big-link { text-decoration: none; color: var(--ink); }
.big-link:hover { border-color: var(--accent); color: var(--ink); }
.big-link .btn { align-self: flex-start; margin-top: auto; }

.quiz-list { max-width: 760px; }

/* =====================================================================
   MINIMAL ROUND TILES (version 6) — these override the styles above
   ===================================================================== */
.game-list { gap: 16px; }
.game-card-head { align-items: center; }
.game-card-head > div { flex: 1 1 auto; }
.game-card-head .zh { font-size: 32px; }
.game-card-head h3 { font-size: 20px; }
.star-total { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }

.rounds { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.round { gap: 6px; padding: 12px 14px; border-radius: 12px; background: transparent; border: 1px solid var(--line); }
a.round:hover { border-color: var(--ink); }
.round.done { background: transparent; border-color: var(--line); }
.round-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.round-num { font-size: 15px; font-weight: 700; color: var(--muted); font-family: var(--body); }
.round-title { font-size: 15px; font-weight: 600; }
.round-stars { font-size: 13px; letter-spacing: 1px; color: #B7791F; }
.round.locked { background: transparent; border-style: solid; opacity: .5; cursor: not-allowed; }
.round-lock { display: inline-flex; color: var(--muted); }

.soon-line { color: var(--muted); font-size: 15px; }
.soon-line span { font-family: var(--zh); }

/* =====================================================================
   QUIZ TYPES (version 7): reading text, instructions, group headings
   ===================================================================== */
.quiz-instructions { color: var(--muted); font-size: 16px; margin-top: 4px; }
.passage { font-family: var(--zh); font-size: 20px; line-height: 1.9; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 8px; }
.quiz-group { font-size: 18px; margin-top: 12px; margin-bottom: -4px; color: var(--muted); }
.practice-wrap .opt:lang(zh), .practice-wrap .opt { font-family: var(--body), var(--zh); }

/* =====================================================================
   BREADCRUMBS (version 8): "Quizzes › HSK 1 › Quiz 5"
   ===================================================================== */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 500; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.crumb-sep { color: #A8A29E; }
.class-page .crumbs { margin-bottom: 18px; }

/* =====================================================================
   QUIZ LIST SIZES (version 9)
   Hierarchy: page title > section heading > quiz row > details
   ===================================================================== */
.hub .quiz-group { font-size: 24px; color: var(--ink); margin: 32px 0 -6px; }
.hub .quiz-list { gap: 8px; }
.hub .quiz-list a { font-size: 17px; font-weight: 600; padding: 14px 18px; border-radius: 12px; background: var(--white); }
.hub .quiz-list small { font-size: 14px; font-weight: 500; }
.quiz-num { color: var(--muted); font-weight: 500; margin-right: 10px; }

/* =====================================================================
   QUIZ TOPICS WITH NUMBERED QUIZZES (version 10)
   ===================================================================== */
.topic-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 12px 18px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.topic-title { font-size: 17px; font-weight: 600; }
.quiz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-chip { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; background: var(--paper); }
.quiz-chip:hover { border-color: var(--ink); color: var(--ink); }
.quiz-chip.tried { border-color: #D6CFC4; }
.quiz-chip.done { background: var(--good-bg); color: var(--good); border-color: transparent; }

/* =====================================================================
   QUIZ SETS AS TILES (version 11) — same look as game rounds
   ===================================================================== */
.quiz-tiles { margin-top: 4px; }
.quiz-tile { background: var(--white); }
.quiz-tile .round-num { font-size: 14px; }
.tile-score { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tile-score.done { color: var(--good); }
.tile-score.tried { color: var(--ink); }
.quiz-tile.done { border-color: #BBE5C8; }

/* =====================================================================
   LEVEL HUB, LESSONS, VOCABULARY (version 12)
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Level hub: four cards */
.hub .page-head .zh { font-size: 56px; color: var(--accent); line-height: 1; }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.hub-card { display: flex; flex-direction: column; gap: 8px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); text-decoration: none; }
.hub-card:hover { border-color: var(--accent); color: var(--ink); }
.hub-card.locked { opacity: .55; }
.hub-card.locked:hover { border-color: var(--line); }
.hub-icon { font-family: var(--zh); font-size: 36px; color: var(--accent); line-height: 1; }
.hub-title { font-family: var(--head); font-weight: 700; font-size: 22px; }
.hub-info { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.hub-info .bar { width: 100%; height: 6px; }
.hub-info .bar > span { background: var(--good); }

/* Under-video buttons (lessons) */
.video-nav { max-width: 960px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 16px; }
.class-page .crumbs { margin-bottom: 18px; }

/* 🔊 buttons */
.say { border: 0; background: transparent; font-size: 18px; cursor: pointer; padding: 6px; border-radius: 8px; line-height: 1; }
.say:hover { background: var(--soft); }

/* Vocabulary header */
.vocab-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.vocab-head h1 { font-size: clamp(30px, 4.5vw, 42px); }
#vocab-progress { min-width: 260px; flex: 0 1 380px; display: flex; flex-direction: column; gap: 8px; }
.stack-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--soft); }
.stack-bar .known { background: var(--good); }
.stack-bar .unknown { background: var(--accent); }
.vocab-counts { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #D6CFC4; flex: 0 0 auto; }
.dot.known { background: var(--good); }
.dot.unknown { background: var(--accent); }

/* Tabs: Word list | Flashcards */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 18px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }

/* Word list: the bar that stays at the top while scrolling */
.vocab-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.vocab-bar select, .vocab-bar input { font: 15px var(--body); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); }
.vocab-bar input { flex: 1 1 200px; }
.vocab-bar .btn { padding: 10px 16px; font-size: 14px; }
.vocab-bar .btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.word-topic { margin-top: 24px; }
.word-topic h2 { font-size: 20px; margin-bottom: 6px; }
.word-topic h2 small { font-family: var(--body); font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.word-row { display: grid; grid-template-columns: 14px minmax(70px, 120px) minmax(90px, 150px) 1fr auto; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.w-zh { font-family: var(--zh); font-size: 22px; }
.w-py { color: var(--muted); }
.meaning { transition: filter .15s; }
.meaning.hidden { filter: blur(6px); cursor: pointer; user-select: none; }
@media (max-width: 560px) {
  .word-row { grid-template-columns: 14px 1fr auto; }
  .w-py, .meaning { grid-column: 2; }
  .w-zh { grid-column: 2; }
  .word-row .say { grid-column: 3; grid-row: 1; }
}

/* Flashcards: setup */
.card-setup { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.direction { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.direction button { font: 600 14px var(--body); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer; }
.direction button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.deck { font: inherit; text-align: left; cursor: pointer; background: var(--white); }
.deck:hover { border-color: var(--ink); }
.deck.special { border-color: var(--accent); }
.deck.done { border-color: #BBE5C8; }

/* Flashcards: one card */
.flash { max-width: 560px; margin: 8px auto 0; display: flex; flex-direction: column; gap: 18px; }
.flash .progress-line .bar { height: 6px; }
.flash .progress-line .bar > span { background: var(--good); }
.link-btn { border: 0; background: none; color: var(--muted); font: 500 14px var(--body); cursor: pointer; text-decoration: underline; }
.flash-card { min-height: 260px; background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.card-zh { font-family: var(--zh); font-size: clamp(56px, 16vw, 84px); line-height: 1.15; }
.card-en { font-family: var(--head); font-size: 34px; font-weight: 700; }
.answer { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.card-py { font-size: 22px; color: var(--muted); }
.card-meaning { font-size: 22px; font-weight: 600; }
.answer .say { font-size: 26px; }
.flash-show { width: 100%; }
.flash-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rate-no { background: var(--bad-bg); color: var(--bad); }
.rate-no:hover { background: #FDD5D1; color: var(--bad); }
.rate-yes { background: var(--good-bg); color: var(--good); }
.rate-yes:hover { background: #C6F6D5; color: var(--good); }
.key-hint { font-size: 13px; text-align: center; }
@media (hover: none) { .key-hint { display: none; } }

/* =====================================================================
   FOOTER AT THE BOTTOM (version 13)
   On short pages the footer used to sit in the middle of the screen.
   Now the page is a column as tall as the screen, and the footer is
   pushed to the bottom. Footer links are calmer (grey, no underline).
   ===================================================================== */
body { display: flex; flex-direction: column; min-height: 100vh; }
body > main { width: 100%; }
#site-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--white); }
.site-footer { padding-top: 28px; padding-bottom: 28px; font-size: 14px; }
.site-footer nav { gap: 10px 24px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

/* "Prefer learning in Nepali?" line on the level hub: smaller */
.hub > p.muted { font-size: 15px; }

/* =====================================================================
   LEVEL CARDS: no fake buttons (version 14)
   The whole card is a link, so labels inside are plain text, not pills.
   ===================================================================== */
.level-card { gap: 10px; }
.level-card h3 { font-size: 22px; }
.level-card .level-top .muted { font-size: 15px; margin-top: 4px; }
.level-word .zh { white-space: nowrap; }
.card-note { font-size: 14px; font-weight: 600; color: var(--muted); }
.level-card .tags span { padding: 0; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--muted); }

/* =====================================================================
   CLASS / LESSON CARDS (version 15)
   Hierarchy: title big, "Class 2 · date" small, summary small and grey.
   Used on the NSO classes page and the lessons list.
   ===================================================================== */
.class-list { gap: 12px; }
.class-card { gap: 18px; padding: 20px 22px; background: var(--white); }
.class-num { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.class-body { gap: 4px; }
.class-meta { font-size: 13px; color: var(--muted); }
.class-meta strong { color: var(--muted); font-weight: 600; }
.class-title { font-size: 22px; line-height: 1.25; margin-bottom: 2px; }
.class-body > .muted { font-size: 15px; line-height: 1.5; }

/* =====================================================================
   Nepali & NSO: course cards, compact rows, part buttons (version 16)
   ===================================================================== */
.course-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.course-tag { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: #FDECEA; color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.course-tag.own { background: var(--soft); color: var(--ink); }
.hub-card .hub-info strong { color: var(--ink); font-weight: 600; }

/* One course: one line per video */
.row-list { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.row-link { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; padding: 14px 18px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); }
.row-link:first-child { border-top: 0; }
.row-link:hover { background: var(--paper); color: var(--ink); }
.row-num { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.row-title { font-weight: 600; font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.row-date { font-size: 14px; color: var(--muted); white-space: nowrap; }
.row-tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.row-tag.done { background: var(--good-bg); color: var(--good); }
.row-new { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; }

/* Part 1 / Part 2 buttons above the video */
.part-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.part-buttons button { font: 600 14px var(--body); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer; }
.part-buttons button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
