/* Masterminds Lab · Japanese for Beginners. Palette: navy text on cream, the books' vermilion for actions. */
@font-face { font-family: Lexend; src: url(/fonts/lexend.3111566a97.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url(/fonts/zenmaru-500.63d644e31a.woff2) format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url(/fonts/zenmaru-700.bbbf756706.woff2) format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Klee One"; src: url(/fonts/klee.be36910b75.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Huninn; src: url(/fonts/huninn.c069ed651e.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #fff8ec; --paper: #fffdf8; --ink: #16213e; --ink-2: #33405f; --muted: #57607a; --line: #ead9bd; --line-2: #f3e6cf;
  --accent: #b3402a; --accent-2: #8f3220; --amber: #f4a623; --amber-soft: #fdecc8; --teal: #1f8f84;
  --s1: #b3402a; --s2: #2f5d8a; --s3: #3d7a4a;
  --radius: 16px; --shadow: 0 1px 2px rgba(22,33,62,.06), 0 8px 24px rgba(22,33,62,.08);
  --sans: Lexend, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ja: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --zh: Lexend, "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;
  --zh-head: Lexend, Huninn, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--sans); text-rendering: optimizeLegibility; }
html[lang="zh-Hant-TW"] body { font-family: var(--zh); line-height: 1.85; letter-spacing: .01em; }
html[lang="zh-Hant-TW"] :is(h1, h2, h3, .btn, .nav, .eyebrow, .brand-t, .lcard-t, .pill, .bookcard-t, .who, .facts, summary) { font-family: var(--zh-head); font-synthesis: none; }
:lang(ja), [lang="ja"] { font-family: var(--ja); font-synthesis: none; }
:lang(ja), :lang(zh-Hant-TW) { line-break: strict; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
ruby { ruby-position: over; }
rt { font-size: max(.58em, .7rem); color: var(--ink-2); font-weight: 500; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 70ch; }
.note { background: var(--amber-soft); border-radius: 12px; padding: 12px 16px; color: var(--ink); font-size: .95rem; max-width: 80ch; }
.eyebrow { font-size: .85rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .6em; }
html[lang="zh-Hant-TW"] .eyebrow { letter-spacing: .04em; text-transform: none; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 18px; border-radius: 999px;
  border: 2px solid var(--ink); color: var(--ink); background: transparent; font-weight: 600; font-size: .98rem; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.big { min-height: 52px; padding: 12px 24px; font-size: 1.05rem; }
.btn.small { min-height: 40px; padding: 7px 14px; font-size: .9rem; }
.btn.on-dark { border-color: var(--bg); color: var(--bg); }
.btn.on-dark:hover { background: var(--bg); color: var(--ink); }
.link { font-weight: 600; }

/* header */
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-t { display: flex; flex-direction: column; font-weight: 700; font-size: 1.05rem; line-height: 1.15; }
.brand-t small { font-weight: 500; font-size: .8rem; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 550; }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.on { background: var(--line-2); }
.nav .lang { border: 1.5px solid var(--line); }
.nav .nav-yt { color: var(--accent); }

/* hero */
.hero { position: relative; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(255,248,236,.97) 0%, rgba(255,248,236,.93) 42%, rgba(255,248,236,.55) 62%, rgba(255,248,236,0) 80%); }
.hero-in { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: end; min-height: 560px; }
.hero-text { padding-block: 64px; max-width: 600px; }
.hero h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); }
.hero .lead { font-size: 1.15rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-people { display: flex; justify-content: center; align-items: flex-end; gap: 0; align-self: end; }
.hero-people img { height: 500px; width: auto; filter: drop-shadow(0 10px 18px rgba(22,33,62,.18)); }
.hero-people img + img { margin-left: -40px; }
.facts { background: var(--ink); color: var(--bg); }
.facts ul { list-style: none; margin: 0; padding: 14px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 24px; }
.facts li { display: flex; align-items: center; gap: 10px; font-weight: 550; font-size: .98rem; }
.facts li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); flex: none; }

section.wrap { margin-block: 64px; }
.how { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 48px; align-items: center; }
.how-img { border-radius: var(--radius); box-shadow: var(--shadow); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: s; }
.steps li { position: relative; display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.steps .step-i { grid-row: span 2; width: 52px; height: 52px; border-radius: 14px; background: var(--amber-soft); color: var(--accent); display: grid; place-items: center; }
.steps h3, .steps h2 { margin: 2px 0 2px; font-size: 1.08rem; }
.steps p { margin: 0; color: var(--ink-2); }
.study .steps { grid-template-columns: repeat(3, 1fr); }
.study .steps li { grid-template-columns: 1fr; }
.study .steps .step-i { grid-row: auto; margin-bottom: 10px; }

/* season cards (home) */
.scards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.scard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.scard img { aspect-ratio: 12 / 5; object-fit: cover; width: 100%; }
.scard-b { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; border-top: 5px solid var(--sc, var(--s1)); }
.scard h3 { font-size: 1.4rem; }
.scard h3 a { color: var(--ink); text-decoration: none; }
.scard h3 a:hover { text-decoration: underline; }
.scard-a { margin-top: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 0; }
.s1 { --sc: var(--s1); } .s2 { --sc: var(--s2); } .s3 { --sc: var(--s3); }
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; }
.faq-grid div { border-top: 2px solid var(--line); padding-top: 14px; }
.faq-grid p { color: var(--ink-2); margin: 0; }

/* crumbs */
.crumbs ol { list-style: none; padding: 0; margin: 20px 0 18px; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* course and season pages */
.season { margin-block: 40px 64px; }
.season-banner { width: 100%; aspect-ratio: 12 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.season-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 32px; align-items: start; margin: 28px 0 24px; }
.season-head h2 a { color: var(--ink); text-decoration: none; }
.season-head h2 a:hover { text-decoration: underline; }
.season-head h2, .season-head h1 { border-left: 6px solid var(--sc); padding-left: 14px; }
.bookcard { display: grid; grid-template-columns: 96px 1fr; gap: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.bookcard img { border-radius: 4px; box-shadow: 0 2px 8px rgba(22,33,62,.18); }
.bookcard-t { font-weight: 700; margin: 0; }
.bookcard p.muted { font-size: .9rem; margin-bottom: 10px; }
.lcards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.lcard a { display: flex; flex-direction: column; height: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.lcard a:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.lcard img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.lcard-n { padding: 12px 14px 0; font-size: .82rem; font-weight: 700; color: var(--sc, var(--accent)); text-transform: uppercase; letter-spacing: .05em; }
.lcard-t { padding: 2px 14px 4px; font-weight: 600; line-height: 1.35; }
.lcard-k { padding: 0 14px 14px; color: var(--muted); font-size: .95rem; margin: 0; }
.lrows { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.lrow { display: grid; grid-template-columns: 260px 1fr; gap: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.lrow img { border-radius: 10px; aspect-ratio: 16 / 9; object-fit: cover; }
.lrow h3 { margin-bottom: 2px; }
.lrow h3 a { color: var(--ink); text-decoration: none; }
.lrow h3 a:hover { text-decoration: underline; }
.lrow .lcard-k { padding: 0; margin-bottom: 6px; }
.lrow p.small { margin: 6px 0 0; }

/* lesson page */
.lesson-head { margin-bottom: 22px; }
.lesson-head h1 { margin-bottom: .35em; }
.h1-n { display: block; font-size: .5em; color: var(--sc); font-weight: 700; letter-spacing: .02em; margin-bottom: 4px; }
.pill { display: inline-block; background: var(--sc); color: #fff; padding: 4px 12px; border-radius: 999px; text-decoration: none; margin-right: 8px; letter-spacing: .03em; }
.pill:hover { color: #fff; filter: brightness(.92); }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; grid-template-areas: "player side"; }
.player { grid-area: player; }
.side { grid-area: side; display: grid; gap: 18px; }
.frame { position: relative; aspect-ratio: 16 / 9; background: #0e1529; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.frame-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.under { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h2 { font-size: 1.15rem; margin-bottom: .4em; }
.workbook { padding-top: 0; overflow: hidden; border-top: 5px solid var(--sc); }
.wb-cover { display: block; height: 230px; margin: 0 -18px 16px; padding: 18px 26px 0; overflow: hidden;
  background: linear-gradient(180deg, var(--line-2), #f8ecd8); border-bottom: 1px solid var(--line); }
.wb-cover:focus-visible { outline-offset: -6px; }
.wb-cover img { width: min(100%, 300px); margin-inline: auto; border-radius: 3px 3px 0 0; box-shadow: 0 4px 14px rgba(22,33,62,.18); transition: transform .2s; transform-origin: 50% 100%; }
.wb-cover:hover img { transform: translateY(-4px) rotate(-1deg); }
.wb-b .btn { width: 100%; margin: 6px 0 10px; }
.wb-b p { margin: 0 0 6px; }
.goals { padding-left: 0; list-style: none; margin: 0; display: grid; gap: 8px; }
.goals li { position: relative; padding-left: 28px; }
.goals li::before { content: ""; position: absolute; left: 0; top: .32em; width: 18px; height: 18px; border-radius: 50%; background: var(--amber-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23b3402a' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / 14px no-repeat; }
.goals.small { font-size: .95rem; gap: 4px; }
.lesson-body { max-width: 860px; margin-top: 48px; }
.lesson-body section { margin-bottom: 44px; }
.dialogue { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.dialogue li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.who { font-weight: 700; font-size: .9rem; padding: 3px 10px; border-radius: 999px; background: var(--line-2); justify-self: start; }
.who-aoi { background: #e3e9f5; color: #1f3566; } .who-sam { background: #f8e1d8; color: #7e2a17; }
.dialogue .ja { font-size: 1.3rem; line-height: 2.1; margin: 0; }
.dialogue .tr { margin: 0; color: var(--ink-2); }
.patterns { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.patterns > li { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--sc); border-radius: 14px; padding: 16px 18px; }
.pat { font-size: 1.35rem; font-weight: 600; line-height: 2.1; margin-bottom: .2em; }
.ex { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.ex li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.ex [lang="ja"] { font-size: 1.12rem; line-height: 2; }
.ex .tr { color: var(--ink-2); }
.chars { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.chars li { width: 76px; height: 76px; display: grid; place-items: center; font: 600 2.6rem/1 "Klee One", var(--ja); color: var(--ink); background-color: var(--paper);
  border: 2px solid var(--ink-2); border-radius: 6px;
  background-image: linear-gradient(to right, transparent calc(50% - .5px), rgba(87,96,122,.35) calc(50% - .5px), rgba(87,96,122,.35) calc(50% + .5px), transparent calc(50% + .5px)),
                    linear-gradient(to bottom, transparent calc(50% - .5px), rgba(87,96,122,.35) calc(50% - .5px), rgba(87,96,122,.35) calc(50% + .5px), transparent calc(50% + .5px)); }
.chars li.wide { width: auto; min-width: 76px; padding: 0 16px; font-size: 1.8rem; background-image: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.words { width: 100%; border-collapse: collapse; }
.words th { text-align: left; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--line-2); padding: 10px 16px; }
html[lang="zh-Hant-TW"] .words th { text-transform: none; letter-spacing: .02em; }
.words td { padding: 10px 16px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.words td:first-child { font-size: 1.2rem; line-height: 2; white-space: nowrap; width: 40%; }
.culture { background: var(--amber-soft); border-radius: var(--radius); padding: 20px 22px; }
.culture p { margin: 0; }
.transcript { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px; }
.transcript summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; }
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary::before { content: "+"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--line-2); font-weight: 700; flex: none; }
.transcript[open] summary::before { content: "–"; }
.transcript summary { font-weight: 600; }
.transcript p { color: var(--ink-2); }
.transcript b { color: var(--ink); }
.transcript .prompt { font-style: italic; color: var(--muted); }
.correction { margin: 14px 0 0; background: #fbe4dc; border-left: 5px solid var(--accent); border-radius: 10px; padding: 12px 16px; font-size: .95rem; }
.lrows-h { margin-top: 8px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 72px; }
.pager a { display: flex; flex-direction: column; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; text-decoration: none; color: var(--ink); font-weight: 600; min-height: 44px; }
.pager a:hover { box-shadow: var(--shadow); color: var(--ink); }
.pager .pager-next { grid-column: 2; text-align: right; }
.pager .muted { font-weight: 500; font-size: .88rem; }

/* prose (about, 404) */
.prose { max-width: 760px; margin-bottom: 72px; }
.prose h2 { margin-top: 1.6em; }

/* footer */
.foot { background: var(--ink); color: #e9e4da; margin-top: 40px; }
.foot a { color: #fff; }
.foot :focus-visible { outline-color: var(--amber); }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-block: 48px 24px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; font-size: 1.1rem; }
.foot-h { font-size: .95rem; color: #fff; margin-bottom: .8em; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-small { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.15); padding-block: 16px 28px; font-size: .85rem; color: #cfc8bb; }
.foot-small p { margin: 0; }

/* phones and tablets */
@media (max-width: 960px) {
  .hero-in { grid-template-columns: 1fr; min-height: 0; }
  .hero-text { padding-block: 40px 24px; }
  .hero::before { background: linear-gradient(180deg, rgba(255,248,236,.96) 0%, rgba(255,248,236,.9) 60%, rgba(255,248,236,.55) 100%); }
  .hero-people { justify-content: flex-end; margin-top: -8px; }
  .hero-people img { height: 300px; }
  .facts ul { grid-template-columns: repeat(2, 1fr); }
  .how { grid-template-columns: 1fr; gap: 24px; }
  .scards { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .season-head { grid-template-columns: 1fr; gap: 18px; }
  .lesson-grid { grid-template-columns: 1fr; grid-template-areas: "player" "side"; gap: 20px; }
  .study .steps { grid-template-columns: 1fr; }
  .study .steps li { grid-template-columns: 52px 1fr; }
  .study .steps .step-i { grid-row: span 2; margin: 0; }
  .lrow { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .top-in { min-height: 60px; gap: 4px 12px; }
  .nav { gap: 2px; font-size: .92rem; }
  .brand-t small { display: none; }
  .nav a { padding: 8px 10px; }
  .nav .nav-yt span { display: none; }
  .hero-people img { height: 220px; }
  .hero-cta .btn { width: 100%; }
  .facts ul { grid-template-columns: 1fr; }
  .dialogue li { grid-template-columns: 1fr; gap: 6px; }
  .dialogue .ja { font-size: 1.2rem; }
  .words td:first-child { white-space: normal; }
  .pager { grid-template-columns: 1fr; }
  .pager .pager-next { grid-column: 1; }
  .chars li { width: 64px; height: 64px; font-size: 2.2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .top, .foot, .player, .pager, .skip { display: none; } body { background: #fff; } }

/* ---------------------------------------------------------------- other series (explore, hubs, video pages) */
.s-japanese { --sc: var(--s1); } .s-space { --sc: #2b4c7e; } .s-workplace { --sc: #2f6b55; } .s-history { --sc: #7a4a2a; }
.s-rubiks { --sc: #6a3d8f; } .s-go { --sc: #3a4656; }
html[lang="zh-Hant-TW"] body.series { --zh-head: var(--zh); }
html[lang="zh-Hant-TW"] body.series :is(h1, h2, h3, .btn, .eyebrow, .pill, .vcard-t, .scard2-n, summary) { font-family: var(--zh); }
html[lang="zh-Hant-TW"] body.series h1 { font-weight: 700; letter-spacing: .02em; }

/* header menu (no script: <details>) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: 999px; font-weight: 550; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.menu[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.menu > summary:hover, .menu > summary.on, .menu[open] > summary { background: var(--line-2); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 8px; display: grid; }
.menu-panel a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.menu-panel a:hover, .menu-panel a[aria-current] { background: var(--line-2); }
.menu-panel a:first-child { font-weight: 650; border-bottom: 1px solid var(--line-2); border-radius: 10px 10px 0 0; margin-bottom: 4px; }

/* series cards (explore, home band) */
.scards2 { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.scard2 a { display: flex; flex-direction: column; height: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.scard2 a:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.scard2 img { width: 100%; aspect-ratio: 12 / 5; object-fit: cover; }
.scard2-b { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; border-top: 4px solid var(--sc); flex: 1; }
.scard2-n { font-weight: 700; font-size: 1.12rem; }
.scard2-p { color: var(--ink-2); font-size: .95rem; }
.scard2-c { margin-top: auto; padding-top: 6px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.more { margin-top: 24px; }

/* video cards */
.vcards { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.vcard a { display: flex; flex-direction: column; height: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.vcard a:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.vcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.vcard-meta { padding: 10px 14px 0; font-size: .8rem; font-weight: 700; color: var(--sc, var(--muted)); text-transform: uppercase; letter-spacing: .04em; }
html[lang="zh-Hant-TW"] .vcard-meta { text-transform: none; letter-spacing: .02em; }
.vcard-t { padding: 2px 14px 14px; font-weight: 600; line-height: 1.4; }
.newest { margin-top: 48px; }

/* hubs */
.hub-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; margin: 8px 0 36px; }
.hub-banner { width: 100%; aspect-ratio: 12 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.hub-text h1 { margin-bottom: .3em; }
.hub-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 0; }
.vpage .pill, .hub .pill { background: var(--sc); color: #fff; }
.shorts { margin-top: 40px; }
.shortlist { list-style: none; padding: 0 0 8px; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 180px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; }
.shortlist li { scroll-snap-align: start; }
.shortlist a { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 600; line-height: 1.35; }
.shortlist img { border-radius: 12px; aspect-ratio: 9 / 16; object-fit: cover; box-shadow: var(--shadow); }

/* video page */
.subtitle { color: var(--muted); font-weight: 500; margin: -.2em 0 .6em; }
.chapters-card { border-top: 5px solid var(--sc); }
.chapters { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 2px; }
.chapters a { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: baseline; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; line-height: 1.35; min-height: 36px; }
.chapters a:hover { background: var(--line-2); color: var(--ink); }
.chapters .t { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--sc); font-size: .9rem; }
.shortcard { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); padding: 12px; }
.shortcard img { border-radius: 10px; aspect-ratio: 9 / 16; object-fit: cover; }
.shortcard > span { display: grid; gap: 4px; }
.shortcard-t { font-weight: 600; line-height: 1.35; }
.shortcard:hover { box-shadow: var(--shadow); color: var(--ink); }
.kids-play { display: block; }
.kids-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--accent); color: #fff; font-weight: 700;
  padding: 14px 26px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.25); white-space: nowrap; }
.kids-play:hover .kids-btn { background: var(--accent-2); }
.lesson-body > .summary { font-size: 1.08rem; max-width: 72ch; }
.say { background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--sc); border-radius: var(--radius); padding: 18px 22px; }
.saylist { padding-left: 1.4em; margin: 10px 0 0; display: grid; gap: 12px; }
.saylist li { font-size: 1.12rem; font-weight: 550; line-height: 1.55; padding-left: 4px; }
.saylist li::marker { color: var(--sc); font-weight: 700; }
ul.plain, ol.plain { padding-left: 1.3em; display: grid; gap: 6px; }
.facts-list.parents { background: var(--amber-soft); border-radius: var(--radius); padding: 18px 22px; }
.about-video { background: var(--line-2); border-radius: 14px; padding: 16px 20px; font-size: .95rem; }
.about-video h2 { font-size: 1.05rem; }
.about-video p { margin: 0 0 .5em; color: var(--ink-2); }
.sources ul { padding-left: 1.2em; display: grid; gap: 6px; font-size: .92rem; color: var(--ink-2); overflow-wrap: anywhere; }
.sources.images { margin-top: -24px; }
.sources h3 { font-size: 1rem; }
.transcript-sec h3 { font-size: 1rem; margin: 1.2em 0 .4em; }
.transcript-sec h3 a { font-variant-numeric: tabular-nums; margin-right: 6px; }
.transcript .tx-ch { content-visibility: auto; contain-intrinsic-size: auto 260px; }
.related { margin-top: 56px; max-width: none; }
.vpage .lesson-body { max-width: 900px; }
.vpage .lesson-body > section, .vpage .lesson-body > p, .vpage .lesson-body > ul { margin-bottom: 36px; }

/* footer with four columns */
.foot-in { grid-template-columns: 1.4fr 1fr 1fr 1fr; }

@media (max-width: 960px) {
  .hub-head { grid-template-columns: 1fr; gap: 18px; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-in > div:first-child { grid-column: 1 / -1; }
  .chapters { max-height: none; }
}
@media (max-width: 560px) {
  .foot-in { grid-template-columns: 1fr; }
  .saylist li { font-size: 1.04rem; }
}

/* ---------------------------------------------------------------- UX review (Codex, 3 Dec 2026) */
.mobile-dl { display: none; margin: 14px 0 0; }
.onpage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 32px 0 0; padding: 10px 14px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; }
.onpage .muted { margin-right: 6px; }
.onpage a { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 550; }
.onpage a:hover { background: var(--line-2); color: var(--ink); }
.lesson-body section[id] { scroll-margin-top: 16px; }
.study-link { margin-top: -12px; font-weight: 600; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
section.season .season-banner { aspect-ratio: 6 / 1; }
.transcript .correction { margin-top: 4px; }
.chapters a { min-height: 44px; align-items: center; }
.vcard-d { padding: 0 14px 14px; margin-top: -8px; color: var(--ink-2); font-size: .92rem; line-height: 1.5; }
@media (hover: none) { .lcard a:hover, .vcard a:hover, .scard2 a:hover, .wb-cover:hover img { transform: none; } }
@media (max-width: 960px) {
  .mobile-dl { display: block; }
  .mobile-dl .btn { width: 100%; }
  .wb-cover { height: 150px; }
  .onpage { border-radius: 16px; }
}
@media (max-width: 560px) {
  .hero-people img { height: 150px; }
  .nav { position: relative; }
  .menu { position: static; }
  .menu-panel { position: absolute; left: 0; right: 0; top: calc(100% + 6px); min-width: 0; }
  .lcards { grid-template-columns: 1fr; gap: 10px; }
  .lcard a { display: grid; grid-template-columns: 110px 1fr; grid-template-rows: auto auto 1fr; column-gap: 12px; }
  .lcard img { grid-row: 1 / 4; height: 100%; aspect-ratio: auto; min-height: 72px; }
  .lcard-n { padding: 8px 10px 0 0; } .lcard-t { padding: 0 10px 0 0; } .lcard-k { padding: 0 10px 8px 0; }
  section.season .season-banner { aspect-ratio: 3 / 1; }
}
.short-tile { display: grid; place-items: center; aspect-ratio: 9 / 16; border-radius: 10px; color: #fff; font-size: 1.6rem;
  background: linear-gradient(160deg, var(--sc), #0e1529); box-shadow: 0 3px 10px rgba(22,33,62,.2); }
.top { position: relative; }
@media (max-width: 700px) { .nav { position: static; } .menu { position: static; } .menu-panel { left: 16px; right: 16px; top: calc(100% + 4px); min-width: 0; } }

/* ===================================================================== Rubik's Cube solver (solver_page.py, site/solver/) */
.solver-page { --sv-plastic: #1e222b; --sv-focus: #6a3d8f; --sv-err: #e11d48;
  --st-white: #f7f8fa; --st-yellow: #f5c829; --st-red: #d93238; --st-orange: #f2741f; --st-blue: #1f64cc; --st-green: #1f9d55; --st-blank: #c9c5bc; }
.sv-head { max-width: 760px; margin: 8px 0 18px; }
.sv-head h1 { margin: 8px 0 6px; }
.solver { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 40px; }
.sv-stage { display: grid; justify-items: center; gap: 8px; }
.sv-view { position: relative; width: min(100%, 360px); aspect-ratio: 1; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #f6efe0 0%, #ede3cf 100%); touch-action: manipulation; }
.sv-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.sv-view .sv-face { position: absolute; inset: 11%; width: 78%; height: 78%; }
.sv-view.has-3d .sv-face { visibility: hidden; }
.sv-plastic { fill: var(--sv-plastic); }
.sv-st { stroke: rgba(0,0,0,.18); stroke-width: 1.5; cursor: pointer; transition: transform .12s ease; transform-box: fill-box; transform-origin: center; }
.sv-st.sv-centre { cursor: default; }
.sv-st:focus-visible { outline: none; stroke: #fff; stroke-width: 5; }
.st-white { fill: var(--st-white); } .st-yellow { fill: var(--st-yellow); } .st-red { fill: var(--st-red); }
.st-orange { fill: var(--st-orange); } .st-blue { fill: var(--st-blue); } .st-green { fill: var(--st-green); }
.st-blank { fill: var(--st-blank); stroke: #8d877b; stroke-width: 2; stroke-dasharray: 7 6; }
.sv-st.err { stroke: var(--sv-err); stroke-width: 6; stroke-dasharray: 10 6; animation: sv-pulse 1.1s ease-in-out infinite; }
@keyframes sv-pulse { 50% { stroke-opacity: .35; } }
.sv-letter { font: 700 30px/1 var(--sans); fill: rgba(0,0,0,.55); pointer-events: none; text-anchor: middle; dominant-baseline: central; }
.sv-hint { margin: 0; text-align: center; color: var(--ink-2); font-size: .95rem; max-width: 36ch; min-height: 2.6em; }
.sv-around { position: absolute; font-size: .72rem; color: var(--ink-2); background: rgba(255,253,248,.85); padding: 2px 6px; border-radius: 6px; pointer-events: none; }
.sv-around.a-up { top: 2%; left: 50%; transform: translateX(-50%); } .sv-around.a-down { bottom: 2%; left: 50%; transform: translateX(-50%); }
.sv-around.a-left { left: 1%; top: 50%; transform: translateY(-50%) rotate(-90deg); } .sv-around.a-right { right: 1%; top: 50%; transform: translateY(-50%) rotate(90deg); }
.sv-panel { display: grid; gap: 12px; align-content: start; }
.sv-faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.sv-facebtn { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  font: inherit; font-size: .72rem; color: var(--ink); cursor: pointer; min-height: 56px; }
.sv-facebtn .sv-fname { display: none; }
.sv-facebtn .sv-fcount { font-variant-numeric: tabular-nums; color: var(--muted); }
.sv-facebtn.on, .sv-facebtn[aria-pressed="true"] { border-color: var(--sv-focus); box-shadow: 0 0 0 2px var(--sv-focus); }
.sv-facebtn.done .sv-fcount { color: var(--teal); font-weight: 600; }
.sv-facebtn.bad { border-color: var(--sv-err); }
.sv-dot, .sv-chip { display: block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.25); }
.sw-white .sv-dot, .sw-white .sv-chip { background: var(--st-white); } .sw-yellow .sv-dot, .sw-yellow .sv-chip { background: var(--st-yellow); }
.sw-red .sv-dot, .sw-red .sv-chip { background: var(--st-red); } .sw-orange .sv-dot, .sw-orange .sv-chip { background: var(--st-orange); }
.sw-blue .sv-dot, .sw-blue .sv-chip { background: var(--st-blue); } .sw-green .sv-dot, .sw-green .sv-chip { background: var(--st-green); }
.sv-palette { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.sv-swatch { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; min-height: 64px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg); font: inherit; font-size: .75rem; color: var(--ink); cursor: pointer; }
.sv-swatch .sv-chip { width: 32px; height: 32px; border-radius: 50%; }
.sv-swatch[aria-pressed="true"] { border-color: var(--sv-focus); box-shadow: 0 0 0 3px var(--sv-focus), 0 0 0 5px #fff inset; }
.sv-swatch .sv-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.sv-swatch.full .sv-count { color: var(--teal); font-weight: 600; }
.sv-swatch.over .sv-count { color: var(--sv-err); font-weight: 700; }
.sv-tools, .sv-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-nav .btn { flex: 1 1 0; }
.btn.ghost { border-color: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: inherit; color: inherit; }
.sv-msg { margin: 0; min-height: 3em; color: var(--ink-2); }
.sv-msg.bad { color: #9f1239; }
.sv-msg.good { color: #11663f; font-weight: 600; }
.sv-fill { justify-self: start; }
.sv-result { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 12px; }
.sv-modes { display: inline-grid; grid-auto-flow: column; gap: 4px; background: var(--line-2); padding: 4px; border-radius: 999px; justify-self: start; max-width: 100%; }
.sv-modes button { border: 0; background: transparent; border-radius: 999px; padding: 9px 14px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; min-height: 44px; }
.sv-modes button[aria-pressed="true"] { background: var(--paper); box-shadow: var(--shadow); font-weight: 600; }
.sv-status { font-size: .85rem; color: var(--muted); margin: 0; }
.sv-step { font-size: 1.25rem; font-weight: 600; margin: 0; }
.sv-kid { font-size: 1.6rem; font-weight: 700; color: var(--sv-focus); margin: 0; }
.sv-code { display: inline-block; font: 600 .85rem/1 ui-monospace, Menlo, monospace; background: var(--line-2); border-radius: 6px; padding: 3px 6px; color: var(--ink-2); }
.sv-banner { background: #efe6f6; border: 1px solid #d9c6ea; color: #3c2160; border-radius: 12px; padding: 10px 12px; margin: 0; }
.sv-holdbadge { font-size: .85rem; color: var(--ink-2); margin: 0; }
.sv-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-controls .btn.primary { flex: 2 1 160px; } .sv-controls .btn { flex: 1 1 90px; }
.sv-speed { display: inline-flex; gap: 4px; align-items: center; font-size: .85rem; color: var(--muted); }
.sv-speed button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 10px; font: inherit; cursor: pointer; }
.sv-speed button[aria-pressed="true"] { border-color: var(--sv-focus); color: var(--sv-focus); font-weight: 600; }
.sv-quests-live { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.sv-quests-live li { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--bg); }
.sv-quests-live li.now { border-color: var(--sv-focus); box-shadow: 0 0 0 2px var(--sv-focus); background: var(--paper); }
.sv-quests-live li.done { color: var(--muted); }
.sv-quests-live li.done .sv-qname::before { content: "★ "; color: var(--amber); }
.sv-qname { font-weight: 600; }
.sv-qgoal { margin: 4px 0; font-size: .92rem; }
.sv-movelist { font: .85rem/1.7 ui-monospace, Menlo, monospace; color: var(--ink-2); word-spacing: .3em; }
.sv-movelist .cur { background: #efe6f6; color: #3c2160; border-radius: 4px; padding: 0 3px; }
.sv-mismatch { display: grid; gap: 8px; border: 1px dashed var(--line); border-radius: 12px; padding: 10px; }
.sv-cta { margin: 10px 0; }
.hub-solver { margin-top: 10px; }
.sv-content section { scroll-margin-top: 80px; }
.sv-content .answer { font-size: 1.05rem; }
.sv-quests { padding-left: 1.2em; } .sv-quests h3 { margin: .8em 0 .2em; font-size: 1.05rem; }
.sv-notation code { font-weight: 700; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 768px) {
  .solver { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); padding: 20px; gap: 20px; }
  .sv-view { width: min(100%, 520px); }
  .sv-facebtn .sv-fname { display: block; font-size: .7rem; }
  .sv-result { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .sv-st.err { animation: none; } .sv-st { transition: none; } }
.solver [hidden] { display: none !important; }
.sv-view.has-3d .sv-around { display: none; }
.sv-view.has-3d { background: radial-gradient(circle at 50% 42%, #fbf6ea 0%, #efe5d1 70%, #e8dcc4 100%); }
.sv-look { justify-self: center; }
@media (min-width: 768px) { .sv-view { width: min(100%, 560px); } }
.solver.is-playing .sv-panel, .solver.is-playing .sv-look, .solver.is-playing .sv-hint { display: none; }
.sv-stepcard { display: grid; gap: 6px; }
.sv-all summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
.sv-shortlist { padding-left: 1.4em; } .sv-shortlist li.cur { background: #efe6f6; border-radius: 6px; }
@media (min-width: 768px) {
  .solver.is-playing .sv-result { grid-column: 2; grid-row: 1; border-top: 0; padding-top: 0; align-content: start; }
}
.sv-panel .sv-palette { order: -2; }
.sv-panel .sv-faces { order: -1; }
@media (max-width: 767px) {
  .sv-view { width: min(100%, 340px); }
  .sv-hint { min-height: 0; font-size: .9rem; }
  .sv-facebtn { min-height: 44px; padding: 4px 2px; }
  .sv-swatch { min-height: 58px; }
  .sv-tools .btn.small { min-height: 36px; padding: 5px 11px; }
}
/* keyboard sticker grid: hidden until it has focus, then shown under the cube so focus is visible */
.sv-kgrid { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sv-kgrid:focus-within { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: auto; height: auto; clip: auto; overflow: visible;
  display: grid; gap: 4px; background: rgba(255,253,248,.95); padding: 6px; border-radius: 12px; box-shadow: var(--shadow); z-index: 2; }
.sv-kgrid [role="row"] { display: grid; grid-template-columns: repeat(3, 28px); gap: 4px; }
.sv-kcell { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(0,0,0,.25); padding: 0; }
.sv-kcell.st-white { background: var(--st-white); } .sv-kcell.st-yellow { background: var(--st-yellow); } .sv-kcell.st-red { background: var(--st-red); }
.sv-kcell.st-orange { background: var(--st-orange); } .sv-kcell.st-blue { background: var(--st-blue); } .sv-kcell.st-green { background: var(--st-green); }
.sv-kcell.st-blank { background: var(--st-blank); }
.sv-kcell:focus-visible { outline: 3px solid var(--sv-focus); outline-offset: 2px; }

/* ===================================================================== Lesson quizzes (quiz_page.py, site/quiz/) */
:root { --qz-ok: #17673f; --qz-ok-bg: #e7f5ec; --qz-bad: #9a3320; --qz-bad-bg: #fdeeea; }
.quiz-page { padding-bottom: 24px; }
.quiz-grid { display: grid; grid-template-columns: minmax(0, 780px) 320px; gap: 28px; align-items: start; margin: 8px 0 36px; }
.quiz-box { background: var(--paper); border: 1px solid var(--line); border-top: 5px solid var(--sc, var(--accent)); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 32px); min-height: 240px; }
.qz-loading { margin: 0; }
.qz { display: grid; gap: 16px; }
.qz-title { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.qz-meta, .qz-best { margin: 0; color: var(--muted); }
.qz-best strong { color: var(--ink); }
.qz-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qz-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0; font-size: .92rem; color: var(--muted); }
.qz-count { font-weight: 700; color: var(--ink); }
.qz-skill, .qz-tag { background: var(--amber-soft); color: var(--ink); border-radius: 999px; padding: 2px 12px; font-weight: 600; }
.qz-tag { background: var(--ink); color: #fff; }
.qz-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.qz-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); background: transparent; }
.qz-dot.now { border-color: var(--sc, var(--accent)); }
.qz-dot.done { background: var(--sc, var(--accent)); border-color: var(--sc, var(--accent)); }
.qz-stem { margin: 4px 0 0; font-size: clamp(1.15rem, 1rem + .8vw, 1.4rem); line-height: 1.35; outline: none; }
.qz-prompt { margin: 0; font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.5rem); line-height: 1.5; font-weight: 600; padding: 10px 16px; background: var(--bg); border-radius: 14px; border: 1px solid var(--line-2); overflow-wrap: anywhere; }
.qz-prompt:not([lang="ja"]) { font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem); }
.qz-card { border-collapse: collapse; width: 100%; font-size: 1.05rem; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.qz-card caption { text-align: left; font-weight: 700; padding: 8px 12px; background: var(--amber-soft); border-radius: 12px 12px 0 0; }
.qz-card td { padding: 8px 12px; border-top: 1px solid var(--line-2); vertical-align: top; }
.qz-opts { display: grid; gap: 10px; }
.qz-opt { display: grid; grid-template-columns: 34px 1fr; grid-template-areas: "key txt" "key mark"; align-items: center; column-gap: 12px; row-gap: 2px; width: 100%; min-height: 56px; text-align: left;
  font: inherit; font-size: 1.1rem; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; cursor: pointer; }
.qz-opt:hover { border-color: var(--ink); }
.qz-opt[aria-disabled="true"] { cursor: default; }
.qz-opt[aria-disabled="true"]:hover { border-color: var(--line); }
.qz-key { grid-area: key; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: .95rem; color: var(--ink-2); }
.qz-txt { grid-area: txt; overflow-wrap: anywhere; line-height: 1.5; }
.qz-txt[lang="ja"] { font-size: 1.2rem; }
.qz-txt.big { font-size: 2rem; line-height: 1.3; }
.qz-mark { grid-area: mark; font-size: .88rem; font-weight: 700; }
.qz-mark:empty { display: none; }
.qz-opt.right { border-color: var(--qz-ok); background: var(--qz-ok-bg); }
.qz-opt.right .qz-mark { color: var(--qz-ok); }
.qz-opt.wrong { border-color: var(--qz-bad); background: var(--qz-bad-bg); }
.qz-opt.wrong .qz-mark { color: var(--qz-bad); }
.qz-opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.qz-fb { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.qz-fb[hidden], .qz-nav [hidden] { display: none; }
.qz-fb p { margin: 0 0 .5em; }
.qz-fb > :last-child { margin-bottom: 0; }
.qz-verdict { font-weight: 800; font-size: 1.1rem; }
.qz-verdict.good { color: var(--qz-ok); } .qz-verdict.bad { color: var(--qz-bad); }
.qz-note { color: var(--ink-2); }
.qz-review { display: inline-block; margin: 2px 0 8px; font-weight: 600; }
.qz-small { font-size: .85rem; color: var(--muted); }
.qz-nav { display: flex; justify-content: flex-end; }
.qz-nav .btn { min-width: 180px; }
.qz-result { gap: 12px; }
.qz-score { margin: 0; font-size: clamp(2.2rem, 1.6rem + 3vw, 3.4rem); font-weight: 800; line-height: 1.1; color: var(--ink); }
.qz-stars { margin: 0; font-size: 1.7rem; letter-spacing: .1em; color: #b87400; }
.qz-msg, .qz-going { margin: 0; max-width: 60ch; }
.qz-going { color: var(--qz-ok); font-weight: 600; }
.qz-missed { margin-top: 8px; display: grid; gap: 8px; }
.qz-missed h3 { margin: 0 0 4px; }
.qz-missed details { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.qz-missed summary { cursor: pointer; font-weight: 600; }
.qz-missed details p { margin: .5em 0 0; }
.qz-badge { display: inline-block; font-size: .82rem; font-weight: 600; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; }
.qz-badge[data-state="done"] { background: var(--qz-ok-bg); border-color: var(--qz-ok); color: var(--qz-ok); }
.qz-badge[data-state="progress"] { background: var(--amber-soft); border-color: var(--amber); color: var(--ink); }
.quiz-card { border-top: 5px solid var(--sc); }
.quiz-card .btn { width: 100%; margin: 6px 0 10px; }
.quiz-card p { margin: 0 0 .4em; }
.quiz-cta { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--sc); border-radius: var(--radius); padding: 18px 22px; margin: 28px 0; }
.quiz-cta h2 { margin: 0 0 .2em; font-size: 1.3rem; } .quiz-cta p { margin: 0; }
.quiz-body { max-width: 780px; }
.quiz-body section { margin-bottom: 28px; }
.qz-sample { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.qz-sample summary { cursor: pointer; font-weight: 600; }
.qz-sample .qz-prompt { font-size: 1.5rem; margin: 10px 0; }
.qz-sample ol { padding-left: 1.4em; }
.quiz-links { padding-left: 1.2em; }
.qz-hub-list { list-style: none; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.qz-hub-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--sc); border-radius: 12px; padding: 10px 14px; }
.qz-hub-row a { display: grid; text-decoration: none; color: var(--ink); min-height: 44px; align-content: center; }
.qz-hub-row a:hover .qz-hub-t { text-decoration: underline; }
.qz-hub-n { font-size: .82rem; font-weight: 700; color: var(--sc); text-transform: uppercase; letter-spacing: .04em; }
.qz-hub-t { font-weight: 600; }
.qz-continue { margin: 0 0 16px; } .qz-continue[hidden] { display: none; }
.quiz-hub .season h2 { border-left: 6px solid var(--sc); padding-left: 14px; margin-top: 28px; }
@media (max-width: 560px) {
  .quiz-box { padding: 16px; border-radius: 14px; }
  .qz-actions .btn, .qz-nav .btn { width: 100%; }
  .qz-opt { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: no-preference) { .qz-opt { transition: border-color .12s, background-color .12s; } }

.quiz-watch { padding: 0 0 16px; overflow: hidden; border-top: 5px solid var(--sc); }
.quiz-watch .qw-img { display: block; }
.quiz-watch img { width: 100%; height: auto; }
.quiz-watch h2, .quiz-watch p, .quiz-watch .btn { margin-left: 18px; margin-right: 18px; }
.quiz-watch h2 { font-size: 1.15rem; margin-top: 14px; margin-bottom: .3em; }
.quiz-watch .btn { width: calc(100% - 36px); margin-top: 6px; margin-bottom: 8px; }
@media (max-width: 1000px) { .quiz-grid { grid-template-columns: 1fr; } .quiz-side { max-width: 520px; } }

.quiz-hero { position: relative; border-radius: 20px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); min-height: 260px; margin: 8px 0 22px; display: flex; align-items: center; }
.quiz-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right 28%; }
.quiz-hero-text { position: relative; max-width: 48%; padding: 28px 32px; }
.quiz-hero-text h1 { margin-bottom: .25em; }
.quiz-hero-text .lead { margin: 0; font-size: 1.05rem; }
@media (max-width: 760px) {
  .quiz-hero { display: block; min-height: 0; }
  .quiz-hero img { position: static; height: 190px; }
  .quiz-hero-text { max-width: none; padding: 18px 18px 22px; }
}
