@font-face { font-family: 'Handicrafts'; src: url('../fonts/handicrafts-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Handicrafts'; src: url('../fonts/handicrafts-bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
/* LXGW WenKai (OFL), a textbook-style Kai face, subset to the characters in data/zh1.json. */
@font-face { font-family: 'WenKai'; src: url('../fonts/wenkai-zh.woff2') format('woff2'); font-display: swap; }

/* Night-Neon color system (TV Ops brand-kit/tokens.css). Navy surfaces ~85%, text ~10%, gradient/accent ~5%.
   Accents mark state only: primary action, selected/current, correct/wrong, stars. */
:root {
  --navy-deep: #081126;
  --navy: #0B1026;
  --surface: #121D3B;
  --surface-raised: #192542;
  --surface-received: #26324E;
  --border: #344363;

  --orange: #FF9F1C;
  --pink: #FF4D8D;
  --purple: #A855F7;
  --violet: #601CFF;
  --blue: #2386FF;

  --white: #F4F6FF;
  --muted: #AEB9D2;
  --label: #9DB8FF;
  --disabled: #68758F;

  --success: #00D98B;
  --danger: #FF6B7F;

  --gradient-brand: linear-gradient(115deg, #FF9F1C 0%, #FF4D8D 46%, #A855F7 77%, #601CFF 100%);
  --gradient-frame: linear-gradient(110deg, #2386FF 0%, #A855F7 67%, #FF4D8D 100%);
  --gradient-focus: linear-gradient(90deg, #FF9F1C, #FF4D8D, #A855F7);
  --gradient-level: linear-gradient(90deg, #FF4D8D, #A855F7);
  --gradient-backdrop: radial-gradient(circle at 25% 15%, #1A1F4A, #0B1026 55%, #081126);
  --focus-fill: linear-gradient(90deg, #3A1A2C, #261642);
  --disabled-fill: #0F1832;
  --disabled-border: #222D4A;
  --toast: #22305A;
  --glow-pink: 0 0 18px rgba(255, 77, 141, .35);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, .35);

  --radius-card: 22px;
  --radius-control: 16px;
  --radius-field: 14px;

  /* The kit's Arabic face is Noto Sans Arabic; this project keeps The Year of Handicrafts. */
  --font: 'Handicrafts', 'Noto Sans Arabic', 'Geeza Pro', sans-serif;
  --font-zh: 'WenKai', 'Kaiti SC', 'STKaiti', 'PingFang SC', sans-serif;
  --font-pinyin: 'Avenir Next', 'Helvetica Neue', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--navy); }
body {
  margin: 0; min-height: 100dvh; color: var(--white);
  background: var(--gradient-backdrop) fixed, var(--navy);
  font-family: var(--font); font-size: 21px; line-height: 1.7;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

.app { max-width: 920px; margin: 0 auto; padding: 18px 16px 48px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(11, 16, 38, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar h1 { flex: 1; font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 48px; height: 48px; border-radius: var(--radius-control); background: var(--surface-raised); border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
.icon-btn.ghost { background: none; border: 0; }
.pill { background: var(--surface-raised); border: 1px solid var(--border); border-radius: 999px; padding: 2px 14px; font-weight: 700; white-space: nowrap; }

/* buttons — primary = brand gradient with short bold labels (white over the orange end needs the shade) */
.btn { border-radius: var(--radius-control); padding: 12px 22px; font-weight: 700; min-height: 56px; transition: transform .12s ease, box-shadow .12s ease, opacity .12s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.big { font-size: 24px; min-height: 68px; padding: 12px 34px; }
.btn.primary { background: var(--gradient-brand); color: #fff; text-shadow: 0 1px 3px rgba(8, 17, 38, .55); box-shadow: 0 6px 18px -6px rgba(255, 77, 141, .55); }
.btn.soft, .btn.ghost { background: var(--surface-raised); border: 1px solid var(--border); color: var(--white); }
.btn:disabled { opacity: .35; box-shadow: none; }

.eyebrow { color: var(--label); font-weight: 700; font-size: 17px; }
.fine { color: var(--muted); font-size: 16px; }
.center { text-align: center; }

/* start */
.start { text-align: center; padding-top: 6vh; display: grid; justify-items: center; gap: 8px; }
.start .mascot { width: 170px; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 0 24px rgba(168, 85, 247, .35)); }
.start-title { font-size: clamp(44px, 9vw, 68px); font-weight: 700; line-height: 1.25; }
.start-sub { font-size: 22px; color: var(--muted); }
.start-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 22px 0 8px; }
.name-form { display: grid; justify-items: center; gap: 10px; margin-top: 14px; width: min(440px, 100%); }
.name-form label { font-size: 26px; font-weight: 700; }
.name-form input {
  width: 100%; font: inherit; font-size: 28px; text-align: center; padding: 12px 18px; border-radius: var(--radius-control);
  border: 3px solid var(--border); background: var(--surface-raised); color: var(--white); outline: none;
  user-select: text; -webkit-user-select: text;
}
.name-form input::placeholder { color: var(--disabled); }
.name-form input:focus { border-color: transparent; background: linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box, var(--gradient-focus) border-box; }
.name-form .start-actions { margin-top: 6px; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }

/* home */
.hero { display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--surface-received); border-radius: var(--radius-card); padding: 16px 22px; }
.hero-mascot .mascot { width: 116px; display: block; }
.hero-text { flex: 1; }
.hero-text h2 { font-size: 28px; }
.meter { height: 12px; background: var(--surface-raised); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.meter span { display: block; height: 100%; background: var(--gradient-level); border-radius: 99px; }
.motto { text-align: center; color: var(--label); font-weight: 700; margin: 18px 0 6px; }

.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; position: relative; }
.path::before { content: ''; position: absolute; top: 40px; bottom: 40px; right: 52px; border-right: 3px dashed var(--border); }
.step { width: 100%; display: flex; align-items: center; gap: 18px; text-align: right; background: var(--surface); border: 1px solid var(--surface-received); border-radius: var(--radius-card); padding: 16px 18px; position: relative; transition: transform .12s; }
.step:active:not(:disabled) { transform: scale(.99); }
.step-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; flex: none; overflow: hidden; border: 3px solid var(--border); background: var(--surface-raised); }
.step-body { display: grid; }
.step-label { color: var(--muted); font-size: 16px; }
.step-title { font-size: 26px; font-weight: 700; line-height: 1.35; }
.step-meta { font-size: 16px; color: var(--label); }
/* the lesson she should do next: the one gradient-led element on this screen */
.step.is-current { border: 3px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--gradient-brand) border-box; box-shadow: var(--glow-pink); }
.step.is-current .step-icon { border-color: transparent; background: linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box, var(--gradient-focus) border-box; }
.step.is-done .step-icon { border-color: var(--success); }
.step.is-done .step-meta { color: var(--success); }
.step.is-locked { background: var(--disabled-fill); border-color: var(--disabled-border); color: var(--disabled); }
.step.is-locked .step-label, .step.is-locked .step-meta { color: var(--disabled); }
.step.is-locked .step-icon { background: var(--disabled-fill); border-color: var(--disabled-border); }

/* lesson */
.lesson-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.lesson-icon { font-size: 54px; }
.lesson-head h2 { font-size: 27px; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.game-tile { background: var(--surface); border: 1px solid var(--surface-received); border-radius: var(--radius-card); padding: 18px; display: grid; justify-items: center; text-align: center; gap: 4px; transition: transform .12s; }
.game-tile:active { transform: scale(.98); }
.game-icon { font-size: 46px; }
.game-title { font-size: 25px; font-weight: 700; }
.game-goal { font-size: 16px; color: var(--muted); }
.stars { font-size: 26px; letter-spacing: 2px; }
.star { color: var(--border); }
.star.on { color: var(--orange); }
.new-tag { font-size: 15px; background: var(--pink); color: #fff; border-radius: 999px; padding: 0 12px; font-weight: 700; }

/* intro + results */
.intro, .results { text-align: center; display: grid; justify-items: center; gap: 10px; padding-top: 5vh; }
.intro-icon { font-size: 76px; }
.intro h2, .results h2 { font-size: 34px; }
.intro p { font-size: 23px; max-width: 34ch; color: var(--white); }
.results .mascot { width: 150px; }
.big-stars { font-size: 66px; letter-spacing: 6px; }
.big-stars .star.on { animation: pop .5s ease both; text-shadow: 0 0 18px rgba(255, 159, 28, .45); }
.big-stars .star.on:nth-child(2) { animation-delay: .15s; }
.big-stars .star.on:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.25); } }
.score { font-size: 22px; color: var(--muted); }

/* play */
/* Progress bar stays on top; the question block sits in the middle of the remaining height. */
.play { display: flex; flex-direction: column; gap: 16px; min-height: calc(100dvh - 140px); }
.play > .progress { flex: none; margin-bottom: auto; }
.play::after { content: ''; margin-top: auto; }
.progress { height: 10px; background: var(--surface-raised); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gradient-level); border-radius: 99px; transition: width .4s ease; }
.round-title { text-align: center; font-size: 22px; font-weight: 700; color: var(--label); }
.prompt-card { position: relative; background: var(--surface); border: 1px solid var(--surface-received); border-radius: var(--radius-card); padding: 24px 22px 20px; text-align: center; display: grid; justify-items: center; gap: 6px; min-height: 180px; align-content: center; }
.prompt-card.is-retry { border: 2px dashed var(--orange); }
.retry-tag { position: absolute; top: 10px; right: 14px; font-size: 14px; color: var(--orange); background: var(--surface-raised); border: 1px solid var(--border); border-radius: 999px; padding: 0 10px; }
.prompt-icon { font-size: 54px; line-height: 1.1; }
.prompt-text { font-size: clamp(24px, 3.6vw, 32px); font-weight: 700; line-height: 1.6; max-width: 30ch; }
.blank { display: inline-block; min-width: 3.4em; border-bottom: 4px solid var(--pink); color: var(--pink); margin: 0 6px; }
.speak-btn.round { position: absolute; top: 12px; left: 12px; width: 52px; height: 52px; border-radius: 50%; background: var(--surface-raised); border: 1px solid var(--border); }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.options.wide { grid-template-columns: 1fr; }
.options.n3:not(.wide) { grid-template-columns: repeat(3, 1fr); }
.options.bins-3 { grid-template-columns: repeat(3, 1fr); }
.options.bins-4 { grid-template-columns: repeat(2, 1fr); }
.opt { min-height: 76px; padding: 12px 16px; border-radius: 18px; background: var(--surface-raised); border: 2px solid var(--border); color: var(--white); font-size: 23px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; line-height: 1.4; transition: transform .1s, background .2s, border-color .2s; }
.opt:active:not(:disabled) { transform: scale(.97); border-color: var(--purple); }
.bins .opt { flex-direction: column; min-height: 120px; gap: 2px; }
.opt-icon { font-size: 38px; }
.tf .opt { min-height: 96px; font-size: 30px; }
.tf .opt-true .ico { color: var(--success); width: 34px; height: 34px; stroke-width: 2.6; }
.tf .opt-false .ico { color: var(--danger); width: 34px; height: 34px; stroke-width: 2.6; }
.opt.is-right { background: rgba(0, 217, 139, .14); border-color: var(--success); }
.opt.is-wrong { background: rgba(255, 107, 127, .14); border-color: var(--danger); animation: shake .35s; }
.opt:disabled:not(.is-right):not(.is-wrong) { opacity: .4; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.feedback { background: var(--surface); border: 1px solid var(--surface-received); border-radius: var(--radius-card); padding: 16px 20px; display: grid; gap: 6px; justify-items: center; text-align: center; animation: rise .25s ease; }
.fb-title { font-size: 26px; font-weight: 700; }
.fb-title.good { color: var(--success); }
.fb-title.bad { color: var(--orange); } /* gentle "let's learn" for a child, not an error red */
.fb-answer { font-size: 22px; }
.fb-why { font-size: 21px; color: var(--white); max-width: 40ch; }
.feedback .btn { margin-top: 6px; min-width: 200px; }
.page-tag { display: inline-block; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 999px; padding: 2px 14px; font-size: 17px; font-weight: 700; color: var(--label); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

/* flash cards */
.deck { display: grid; justify-items: center; gap: 16px; }
.deck-count { color: var(--muted); }
.flash { width: min(560px, 100%); aspect-ratio: 5 / 3.4; perspective: 1200px; }
.flash-inner { display: block; position: relative; width: 100%; height: 100%; transition: transform .5s ease; transform-style: preserve-3d; }
.flash.is-flipped .flash-inner { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; border-radius: 26px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 20px 26px; box-shadow: var(--shadow-float); }
.flash-front { background: var(--surface); border: 1px solid var(--surface-received); }
.flash-back { border: 3px solid transparent; background: linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box, var(--gradient-frame) border-box; transform: rotateY(180deg); }
.flash-icon { font-size: 72px; line-height: 1.1; }
.flash-term { font-size: clamp(30px, 5vw, 42px); font-weight: 700; }
.flash-term.small { font-size: 24px; color: var(--label); }
.flash-def { font-size: clamp(20px, 3vw, 25px); line-height: 1.7; }
.hint { color: var(--muted); font-size: 16px; }
.deck-nav { display: flex; gap: 12px; }

/* illustrations (generated on the --surface navy, shown as rounded tiles) and drawn icons */
/* The generated navy backgrounds are close to, not exactly, the surfaces they sit on (and the lighter buttons differ
   more), so each picture fades out toward its edges instead of showing a square tile. */
.pic {
  display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 80%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 80%, transparent 100%);
}
.step-icon .pic { -webkit-mask-image: none; mask-image: none; }
.emo { line-height: 1; }
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
.ico.sm { width: .9em; height: .9em; }
.icon-btn .ico { width: 24px; height: 24px; }
.page-tag .ico, .step-meta .ico, .eyebrow .ico { margin-inline-end: 2px; }
.btn .ico { margin-inline-start: 4px; }

.prompt-icon { width: 96px; height: 96px; display: grid; place-items: center; }
.prompt-icon.is-subject { width: 170px; height: 170px; }
.flash-icon { width: 210px; height: 210px; display: grid; place-items: center; }
.opt-icon { width: 64px; height: 64px; display: grid; place-items: center; }
.bins .opt-icon { width: 96px; height: 96px; }
.game-icon { width: 104px; height: 104px; display: grid; place-items: center; }
.intro-icon { width: 150px; height: 150px; display: grid; place-items: center; }
.lesson-icon { width: 84px; height: 84px; display: grid; place-items: center; flex: none; }
.step-icon .pic { border-radius: 50%; transform: scale(1.12); }
.step-icon .ico { width: 30px; height: 30px; color: var(--disabled); }
.speak-btn.round .ico, .deck-nav .speak-btn .ico { width: 26px; height: 26px; color: var(--white); }
.pill .star { font-size: 18px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--toast); border: 1px solid var(--border); color: var(--white); padding: 10px 20px; border-radius: var(--radius-field); box-shadow: var(--shadow-float); z-index: 9; animation: rise .25s; }

/* ---- subjects ---- */
.mascot-pic { display: inline-block; aspect-ratio: 1; vertical-align: middle; }
.start-mascots { display: flex; gap: 6px; }
.start-mascots .mascot { width: 140px; }
.pick-title { text-align: center; font-size: 28px; margin: 10px 0 18px; }
.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.subject-tile { background: var(--surface); border: 1px solid var(--surface-received); border-radius: var(--radius-card); padding: 22px 18px; display: grid; justify-items: center; gap: 4px; text-align: center; transition: transform .12s; }
.subject-tile:active { transform: scale(.98); }
.subject-tile .mascot { width: 130px; }
.subject-tile .game-title { font-size: 30px; }
.motto-gap { height: 18px; }

/* ---- Chinese text: hanzi in the Kai face with pinyin above each word, as in the book ---- */
.zh { font-family: var(--font-zh); font-weight: 400; unicode-bidi: isolate; display: inline-block; line-height: 1.25; }
.zh ruby { ruby-position: over; margin: 0 .06em; }
.zh rt { font-family: var(--font-pinyin); font-size: .42em; font-weight: 500; color: var(--label); letter-spacing: .02em; line-height: 1.4; }
.zh-p { margin: 0 .04em; }
.zh-blank { display: inline-block; width: 2.2em; height: .95em; vertical-align: -.1em; margin: 0 .15em; border-bottom: 4px solid var(--pink); }
.zh-big .zh { font-size: clamp(54px, 11vw, 84px); }
.zh-char .zh { font-size: clamp(80px, 16vw, 120px); }
.prompt-text .zh { font-size: 1.35em; }
.opt .zh { font-size: 1.35em; }
.opt .zh rt { color: var(--muted); }
.opt-sub { display: block; font-size: 17px; color: var(--muted); font-weight: 400; }
.opt-emo { font-size: 1.3em; }
.zh-emoji { font-size: 64px; line-height: 1; width: auto; height: auto; }
.zh-emoji.is-scene { font-size: 40px; max-width: 12em; letter-spacing: 4px; line-height: 1.3; }
.step-title .zh { font-size: 1.15em; }
.step-ar, .lesson-ar { display: block; font-size: 18px; color: var(--muted); font-weight: 400; }
.lesson-head h2 .zh { font-size: 1.4em; }
.flash-zh .zh { font-size: clamp(54px, 10vw, 80px); }
.flash-zh.small .zh { font-size: 40px; }
.flash-def.zh-def { font-size: clamp(32px, 6vw, 46px); font-weight: 700; }
.flash .zh-emoji { font-size: 84px; }

/* dialogue */
.talk-people { display: flex; align-items: flex-end; gap: 14px; justify-content: center; }
.talk-person { display: grid; justify-items: center; gap: 2px; }
.avatar { width: 96px; height: 96px; display: block; }
.talk-person.is-other .avatar { width: 68px; height: 68px; opacity: .9; }
/* imported kawaii pictures: portraits are cropped round like the drawn faces; word pictures sit in the prompt */
.avatar-pic { border-radius: 50%; overflow: hidden; background: var(--surface-raised); }
.avatar-pic .pic { -webkit-mask-image: none; mask-image: none; object-fit: cover; transform: scale(1.08); }
.prompt-icon.zh-pic { width: 170px; height: 170px; }
.talk-people .prompt-icon.zh-pic { width: 120px; height: 120px; }
.talk-name .zh { font-size: 20px; }
.talk-says { display: block; font-size: 17px; color: var(--muted); font-weight: 400; }
.talk-hint { display: block; font-size: 18px; color: var(--label); font-weight: 400; margin-top: 4px; }

/* listening */
.listen-btn { width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; background: var(--gradient-brand); box-shadow: 0 8px 26px -8px rgba(255, 77, 141, .7); animation: pulse 2.2s ease-in-out infinite; }
.listen-btn .ico { width: 56px; height: 56px; color: #fff; }
.listen-btn:active { transform: scale(.95); }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(255, 77, 141, .12); } }

/* sentence order */
.mount { display: grid; gap: 14px; justify-items: center; }
.order { width: 100%; display: grid; gap: 14px; }
.order-line { min-height: 96px; border: 2px dashed var(--border); border-radius: 18px; padding: 10px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; background: var(--surface); }
.order-line.is-right { border: 2px solid var(--success); background: rgba(0, 217, 139, .1); }
.order-line.is-wrong { border: 2px solid var(--danger); animation: shake .35s; }
.order-hint { color: var(--disabled); font-size: 18px; }
.order-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 76px; }
.tile { min-height: 72px; min-width: 64px; padding: 6px 14px; border-radius: 16px; background: var(--surface-raised); border: 2px solid var(--border); box-shadow: 0 3px 0 var(--border); }
.tile .zh { font-size: 34px; }
.tile:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.order-line .tile { border-color: var(--purple); }

/* writing */
.prompt-icon.is-stroke { width: 180px; height: 180px; }
.stroke-pic { width: 100%; height: 100%; }
.trace { display: grid; justify-items: center; gap: 10px; }
.trace-box { position: relative; background: var(--surface); border-radius: 12px; touch-action: none; }
.trace-box .grid, .trace-target { position: absolute; inset: 0; width: 100%; height: 100%; }
.trace-target svg { display: block; }
.trace-status { color: var(--label); font-weight: 700; min-height: 1.7em; }
.trace-title .zh { font-size: 40px; }

@media (max-width: 560px) {
  body { font-size: 19px; }
  .options.bins-3 { grid-template-columns: 1fr; }
  .bins .opt { flex-direction: row; min-height: 72px; }
  .opt { font-size: 21px; }
  .hero { padding: 12px 14px; }
  .hero-mascot .mascot { width: 88px; }
  .path::before { right: 46px; }
  .step-icon { width: 60px; height: 60px; font-size: 30px; }
  .prompt-icon.is-subject, .flash-icon { width: 130px; height: 130px; }
  .bins .opt-icon { width: 52px; height: 52px; }
  .start-mascots .mascot { width: 104px; }
  .avatar { width: 76px; height: 76px; }
  .tile .zh { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* living book (الكتاب الحي): a card on the subject home, and the book itself full-bleed under the top bar */
.books { display: grid; gap: 18px; margin-bottom: 8px; }
.book-card { border-color: var(--purple); }
.book-icon { position: relative; flex: none; }
.book-badge { position: absolute; bottom: -4px; left: -4px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gradient-brand); color: #fff; box-shadow: var(--shadow-float); }
.book-badge svg, .book-badge .ico { width: 18px; height: 18px; color: #fff; }
body.reading .app { max-width: none; padding: 0; }
.book-frame { display: block; width: 100%; height: calc(100dvh - var(--bar-h, 64px)); border: 0; background: var(--navy); }
