/* سبق لبق المدرسة — same family-cartoon look as the game: warm paper, thin dark ink lines,
   wobbly cards with a hard pop shadow, sticky notes, notebook paper and a chalkboard. */
:root {
  --paper: #fff7e3; --card: #fffdf7; --ink: #3b2b25; --ink-2: #6f5a4e; --ink-3: #a08b7d; --line: #3b2b25;
  --red: #f25c5c; --sky: #6cc5f0; --sun: #ffd24a; --leaf: #86cf62; --pink: #ff9fb8; --lilac: #c3a8f5; --wood: #c98e5e;
  --o1: #ff8f8f; --o2: #84d0f5; --o3: #ffd75e; --o4: #a2dc7f;
  --note: #fff3b5; --note-blue: #dff2ff; --note-pink: #ffe0e8; --note-green: #e3f6d6;
  --nb-line: #d5e8f5; --nb-margin: #f7a3a3; --tape: rgba(255, 255, 255, .7);
  --pop: 3px 4px 0 rgba(59, 43, 37, .9);
  --wob: 16px 22px 15px 24px / 22px 15px 24px 16px;
  --wob-lg: 24px 32px 22px 34px / 32px 22px 34px 24px;
  --display: "Baloo Bhaijaan 2", "Tajawal", system-ui, sans-serif;
  --body: "Tajawal", "Baloo Bhaijaan 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cpath d='M20 52 Q3 52 7 39 Q4 26 19 26 Q21 11 38 13 Q47 1 63 7 Q79 -1 87 15 Q104 13 105 28 Q119 30 115 43 Q117 54 100 52 Z' fill='white' stroke='%233b2b25' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E");
  --sunface: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M60 6v15M60 99v15M6 60h15M99 60h15M22 22l11 11M87 87l11 11M98 22L87 33M22 98l11-11' stroke='%233b2b25' stroke-width='3' stroke-linecap='round'/%3E%3Ccircle cx='60' cy='60' r='30' fill='%23ffd24a' stroke='%233b2b25' stroke-width='3'/%3E%3Cellipse cx='49' cy='56' rx='3.2' ry='4.8' fill='%233b2b25'/%3E%3Cellipse cx='71' cy='56' rx='3.2' ry='4.8' fill='%233b2b25'/%3E%3Cellipse cx='42' cy='67' rx='5.5' ry='3.4' fill='%23f59aa2'/%3E%3Cellipse cx='78' cy='67' rx='5.5' ry='3.4' fill='%23f59aa2'/%3E%3Cpath d='M51 67 Q60 77 69 67' fill='none' stroke='%233b2b25' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  --bunting: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 30'%3E%3Cpath d='M0 3 Q75 15 150 3' fill='none' stroke='%233b2b25' stroke-width='1.6'/%3E%3Cg stroke='%233b2b25' stroke-width='1.4' stroke-linejoin='round'%3E%3Cpath d='M5 4.5 L25 6.5 L14 25 Z' fill='%23f25c5c'/%3E%3Cpath d='M35 7.5 L55 8.8 L45 27 Z' fill='%23ffd24a'/%3E%3Cpath d='M65 9.2 L85 9.2 L75 28 Z' fill='%236cc5f0'/%3E%3Cpath d='M95 8.8 L115 7.5 L105 27 Z' fill='%2386cf62'/%3E%3Cpath d='M125 6.5 L145 4.5 L136 25 Z' fill='%23ff9fb8'/%3E%3C/g%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(242, 92, 92, .13) 1.7px, transparent 2px), radial-gradient(rgba(108, 197, 240, .16) 1.7px, transparent 2px);
  background-size: 30px 30px; background-position: 0 0, 15px 15px; overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: #c63f41; }
img { max-width: 100%; }
::selection { background: rgba(255, 210, 74, .55); }

/* sky */
.sky { position: absolute; inset: 0 0 auto; height: 520px; pointer-events: none; z-index: -1; overflow: hidden;
  background: linear-gradient(180deg, #d6efff 0, #eaf7ff 120px, rgba(255, 247, 227, 0) 300px); }
.sky .cloud { position: absolute; background: var(--cloud) no-repeat center / contain; }
.sky .c1 { width: 180px; height: 90px; top: 70px; inset-inline-start: 4vw; animation: drift 70s linear infinite alternate; }
.sky .c2 { width: 130px; height: 65px; top: 160px; inset-inline-start: 50vw; animation: drift 90s linear infinite alternate-reverse; }
.sky .sun { position: absolute; width: 110px; height: 110px; top: 70px; inset-inline-end: 3vw; background: var(--sunface) no-repeat center / contain; animation: sunbob 6s ease-in-out infinite; }
body.inapp .sky .cloud { display: none; }
body.inapp .sky { height: 300px; }
@keyframes drift { to { transform: translateX(14vw); } }
@keyframes sunbob { 50% { transform: rotate(8deg) translateY(4px); } }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 10px 20px; background: rgba(255, 247, 227, .96); border-bottom: 2.5px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: 44px; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.brand b { font-family: var(--display); font-size: 1.35rem; color: #c63f41; }
.brand small { font-weight: 800; font-size: .8rem; color: var(--ink-2); }
.top-tools { display: flex; align-items: center; gap: 8px; }
#user-chip { display: flex; gap: 6px; }
.pill-btn { display: inline-flex; align-items: center; gap: .35em; min-height: 38px; padding: .35em .95em; border-radius: 999px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); font-weight: 800; font-size: .9rem; cursor: pointer;
  white-space: nowrap; box-shadow: 0 2px 0 var(--line); text-decoration: none; }
.pill-btn img { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); }

#app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; min-height: 60vh; }

/* buttons */
.btn { --b: var(--card); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .6em 1.3em; border: 2.5px solid var(--line); border-radius: var(--wob); background: var(--b); color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.1; text-decoration: none; cursor: pointer;
  user-select: none; box-shadow: 0 5px 0 var(--line); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:hover { filter: brightness(1.04) saturate(1.05); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.5); }
.btn:focus-visible, .pill-btn:focus-visible, .opt:focus-visible, .chip-pick:focus-visible { outline: 3px dashed var(--red); outline-offset: 4px; }
.btn-primary { --b: var(--sun); } .btn-sky { --b: var(--sky); } .btn-ok { --b: var(--leaf); } .btn-danger { --b: var(--red); color: #fff; }
.btn-lg { min-height: 56px; font-size: 1.15rem; padding: .7em 1.6em; } .btn-xl { min-height: 64px; font-size: 1.3rem; padding: .75em 1.8em; }
.btn-sm { min-height: 38px; font-size: .92rem; padding: .4em .9em; border-width: 2px; box-shadow: 0 3px 0 var(--line); }
.btn-block { width: 100%; }
.link { background: none; border: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline wavy; text-decoration-color: var(--pink); text-underline-offset: 4px; padding: .4em; font-weight: 700; }
.g-btn { --b: #fff; }
.g-btn svg { width: 22px; height: 22px; }

.chip { display: inline-flex; align-items: center; gap: .35em; padding: .2em .75em; border-radius: 999px; border: 2px solid var(--line);
  background: var(--card); font-weight: 800; font-size: .82rem; white-space: nowrap; }
.chip.ok { background: var(--note-green); } .chip.warn { background: var(--note); } .chip.bad { background: #ffdede; } .chip.wait { background: var(--note-blue); }
.muted { color: var(--ink-3); }
.char { display: inline-block; line-height: 0; }
.char svg { width: 100%; height: auto; overflow: visible; }
.char svg ellipse[fill="#d8d8d8"] { fill: rgba(59, 43, 37, .14); }
.char .sil { display: none; }

/* headings */
.band-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 0 0 8px; text-align: center; }
.band-title.squig { display: block; width: fit-content; margin-inline: auto; padding-bottom: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8'%3E%3Cpath d='M0 4 Q5 0 10 4 T20 4 T30 4 T40 4' fill='none' stroke='%23f25c5c' stroke-width='2.4'/%3E%3C/svg%3E") repeat-x bottom / 40px 8px; }
.band-sub { color: var(--ink-2); text-align: center; max-width: 62ch; margin: 0 auto 22px; font-size: 1.05rem; }
.band { padding: 54px 0 4px; }

/* ===================== landing */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 30px; padding: 54px 0 20px; }
.eyebrow { display: inline-flex; padding: 5px 14px; border-radius: 6px; background: var(--sun); border: 2px solid var(--line); font-weight: 800; font-size: .9rem;
  transform: rotate(-2deg); box-shadow: var(--pop); }
.wordmark { margin: 14px 0 4px; font-family: var(--display); font-weight: 800; line-height: 1.02; font-size: clamp(3rem, 8vw, 5.4rem);
  color: var(--red); -webkit-text-stroke: 2px var(--line); text-shadow: 4px 5px 0 var(--line); }
.wordmark small { display: block; font-size: .48em; color: #2f5d47; -webkit-text-stroke: 1.5px var(--line); text-shadow: 3px 3px 0 var(--line); }
.hero-tag { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink-2); max-width: 36ch; margin: 10px 0 22px; font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { color: var(--ink-3); font-weight: 700; margin-top: 14px; font-size: .95rem; }
.hero-art { position: relative; display: grid; place-items: center; }
.board { position: relative; width: min(100%, 460px); aspect-ratio: 1.25; border-radius: 16px; background: #2f5d47; border: 12px solid var(--wood);
  outline: 2.5px solid var(--line); box-shadow: 6px 8px 0 rgba(59, 43, 37, .9); color: #f4f1e6; padding: 26px 26px 0; overflow: hidden; }
.board .q { font-family: var(--display); font-size: 1.35rem; font-weight: 700; margin: 0 0 12px; }
.board .abc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-weight: 800; }
.board .abc span { border: 2px dashed rgba(244, 241, 230, .55); border-radius: 10px; padding: 6px 10px; }
.board .abc span.yes { border-style: solid; background: rgba(134, 207, 98, .3); }
.board .chalk { position: absolute; bottom: -2px; inset-inline-start: 20px; width: 70px; height: 12px; background: #fff; border-radius: 4px; border: 2px solid var(--line); }
.hero-art .char { position: absolute; width: 150px; bottom: -34px; inset-inline-end: -20px; }
.hero-art .books { position: absolute; bottom: -26px; inset-inline-start: -14px; display: flex; align-items: flex-end; gap: 3px; }
.spine { display: block; width: 26px; border: 2px solid var(--line); border-radius: 4px 4px 2px 2px; box-shadow: 2px 2px 0 var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 26px; }
.step { position: relative; padding: 30px 22px 22px; border-radius: 4px 4px 18px 4px; background: var(--note); border: 2px solid var(--line); box-shadow: var(--pop); transform: rotate(-1.5deg); }
.step:nth-child(2) { background: var(--note-blue); transform: rotate(1.2deg); } .step:nth-child(3) { background: var(--note-pink); transform: rotate(-.8deg); }
.step::before { content: ""; position: absolute; top: -12px; left: 50%; width: 86px; height: 24px; transform: translateX(-50%) rotate(-3deg); background: var(--tape); border: 1.5px dashed rgba(59, 43, 37, .35); }
.step .n { position: absolute; top: -16px; inset-inline-end: 14px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red); color: #fff; border: 2px solid var(--line); font-family: var(--display); font-weight: 800; }
.step .ico { font-size: 2.1rem; line-height: 1; margin-bottom: 8px; }
.step h3 { font-family: var(--display); margin: 0 0 4px; font-size: 1.25rem; } .step p { margin: 0; color: var(--ink-2); }

.subjects { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.subj { --c: var(--sky); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 12px; border-radius: var(--wob);
  background: color-mix(in srgb, var(--c) 30%, #fff); border: 2.5px solid var(--line); box-shadow: var(--pop); font-weight: 800; text-align: center; }
.subj .ico { font-size: 1.9rem; line-height: 1; }
.price-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 30px; border-radius: var(--wob-lg);
  background: var(--card); border: 2.5px solid var(--line); box-shadow: var(--pop); }
.price-card .kd { font-family: var(--display); font-weight: 800; font-size: 3rem; color: #c63f41; line-height: 1; }
.price-card ul { margin: 0; padding-inline-start: 1.1em; color: var(--ink-2); font-weight: 600; }
.notebook { padding: 20px 46px 20px 22px; border-radius: 6px 6px 20px 6px; border: 2px solid var(--line); box-shadow: var(--pop); background-color: #fffef9;
  background-image: linear-gradient(90deg, transparent 32px, var(--nb-margin) 32px, var(--nb-margin) 34px, transparent 34px), repeating-linear-gradient(180deg, transparent 0 27px, var(--nb-line) 27px 28px); }
[dir="rtl"] .notebook { padding: 20px 22px 20px 46px; background-image: linear-gradient(270deg, transparent 32px, var(--nb-margin) 32px, var(--nb-margin) 34px, transparent 34px), repeating-linear-gradient(180deg, transparent 0 27px, var(--nb-line) 27px 28px); }
.notebook h3 { font-family: var(--display); margin: 0 0 6px; font-size: 1.25rem; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ===================== library */
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 40px 0 14px; flex-wrap: wrap; }
.lib-head h1 { font-family: var(--display); font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0; line-height: 1.1; }
.lib-head p { margin: 4px 0 0; color: var(--ink-2); font-weight: 600; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 10px 0 30px; }
.shelf .subj { cursor: pointer; padding: 16px 10px 14px; transition: transform .1s; border-radius: var(--wob); font: inherit; color: var(--ink); }
.shelf .subj:hover { transform: translateY(-3px) rotate(-1deg); }
.shelf .subj b { font-family: var(--display); font-size: 1.1rem; }
.shelf .subj small { color: var(--ink-2); font-weight: 700; }
.shelf .subj.all { --c: var(--sun); }
.shelf .subj:disabled { opacity: .45; cursor: default; transform: none; }
.section-h { font-family: var(--display); font-size: 1.4rem; margin: 6px 0 12px; display: flex; align-items: center; gap: 10px; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.bookcard { --c: var(--sky); position: relative; display: flex; gap: 12px; padding: 12px; border-radius: var(--wob); background: var(--card);
  border: 2.5px solid var(--line); box-shadow: var(--pop); text-decoration: none; color: var(--ink); cursor: pointer; text-align: start; font: inherit; }
.bookcard:hover { transform: translateY(-2px); }
.cover { flex: none; width: 76px; aspect-ratio: .74; border-radius: 4px 8px 8px 4px; border: 2px solid var(--line); background: color-mix(in srgb, var(--c) 45%, #fff);
  overflow: hidden; display: grid; place-items: center; font-size: 2rem; box-shadow: inset 7px 0 0 rgba(59, 43, 37, .18); }
[dir="rtl"] .cover { border-radius: 8px 4px 4px 8px; box-shadow: inset -7px 0 0 rgba(59, 43, 37, .18); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.bookcard .meta { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bookcard b { font-family: var(--display); font-size: 1.08rem; line-height: 1.25; overflow-wrap: anywhere; }
.bar { height: 12px; border-radius: 99px; border: 2px solid var(--line); background: #fff; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--leaf) 0 8px, #6fc048 8px 16px); transition: width .4s; animation: barmove 1s linear infinite; }
@keyframes barmove { to { background-position: 22px 0; } }
.add-card { display: grid; place-items: center; gap: 4px; min-height: 130px; border: 2.5px dashed var(--line); border-radius: var(--wob); background: rgba(255, 255, 255, .55);
  cursor: pointer; font-family: var(--display); font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.add-card .plus { width: 44px; height: 44px; border-radius: 50%; background: var(--sun); border: 2.5px solid var(--line); display: grid; place-items: center; font-size: 1.7rem; box-shadow: 0 3px 0 var(--line); }
.empty { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 26px; border-radius: var(--wob-lg); background: var(--card); border: 2.5px solid var(--line); box-shadow: var(--pop); }
.empty .char { width: 130px; }
.empty h2 { font-family: var(--display); margin: 0 0 6px; }

/* ===================== sheets (upload) */
.sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(59, 43, 37, .35); }
.sheet-card { width: min(580px, 100%); max-height: min(92vh, 940px); overflow: auto; padding: 22px; border-radius: var(--wob-lg); background: var(--card);
  border: 2.5px solid var(--line); box-shadow: 5px 6px 0 var(--line); animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.9) rotate(-1deg); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { font-family: var(--display); margin: 0; font-size: 1.5rem; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 1.1rem; box-shadow: 0 2px 0 var(--line); }
.drop { display: grid; place-items: center; gap: 6px; padding: 26px 16px; text-align: center; border: 2.5px dashed var(--line); border-radius: var(--wob);
  background: var(--note-blue); cursor: pointer; transition: background .2s; }
.drop.over { background: var(--note); }
.drop .big { font-size: 2.4rem; line-height: 1; }
.drop b { font-family: var(--display); font-size: 1.15rem; }
.drop.has { background: var(--note-green); }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field > span { font-weight: 800; color: var(--ink-2); font-size: .95rem; }
.field input, .field select { width: 100%; min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 700; font-size: 1rem; }
.field input:focus, .field select:focus { outline: 3px solid var(--sun); }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick { --c: var(--sky); display: inline-flex; align-items: center; gap: .4em; padding: .45em .9em; border-radius: 999px; border: 2px solid var(--line);
  background: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 2px 0 var(--line); }
.chip-pick[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 45%, #fff); transform: translateY(-1px); box-shadow: 0 3px 0 var(--line); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range-row input { width: 92px; }
.note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--note); border: 2px solid var(--line); font-weight: 700; font-size: .93rem; }
.err { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #ffdede; border: 2px solid var(--line); font-weight: 800; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }

/* ===================== book page */
.book-top { display: grid; grid-template-columns: auto 1fr; gap: 22px; padding: 36px 0 18px; align-items: start; }
.book-top .cover { width: 140px; font-size: 3rem; }
.book-top h1 { font-family: var(--display); margin: 0 0 6px; font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.15; overflow-wrap: anywhere; }
.book-top .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.timeline { display: grid; gap: 10px; margin: 6px 0 18px; padding: 0; list-style: none; }
.timeline li { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-3); }
.timeline li .dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; font-size: .9rem; flex: none; }
.timeline li.done { color: var(--ink); } .timeline li.done .dot { background: var(--leaf); }
.timeline li.now { color: var(--ink); } .timeline li.now .dot { background: var(--sun); animation: sunbob 1.6s ease-in-out infinite; }
.work-card { padding: 18px 20px; border-radius: var(--wob-lg); background: var(--note-blue); border: 2.5px solid var(--line); box-shadow: var(--pop); display: grid; gap: 10px; }
.work-card .bar { height: 18px; }
.work-card .char { width: 74px; }
.work-row { display: flex; gap: 14px; align-items: center; }
.qlist { display: grid; gap: 10px; margin-top: 12px; }
.qitem { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 2px solid var(--line); }
.qitem.off { opacity: .45; }
.qitem b { font-family: var(--display); }
.qitem .ans { color: #2e7d32; font-weight: 800; } .qitem .wr { color: var(--ink-3); font-size: .9rem; }

/* ===================== play */
.play { max-width: 760px; margin: 0 auto; padding-top: 26px; }
.track { position: relative; height: 66px; margin: 8px 0 18px; }
.track .road { position: absolute; inset: auto 0 10px; height: 14px; border-radius: 99px; border: 2px solid var(--line); background: #fff;
  background-image: repeating-linear-gradient(90deg, transparent 0 14px, rgba(59, 43, 37, .12) 14px 16px); }
.track .flag { position: absolute; bottom: 4px; inset-inline-end: -6px; font-size: 1.9rem; }
.track .runner { position: absolute; bottom: 14px; width: 54px; inset-inline-start: calc(var(--p, 0) * (100% - 70px)); transition: inset-inline-start .6s cubic-bezier(.3, 1.4, .5, 1); }
.track .runner.hop svg { animation: hop .6s ease-out; }
@keyframes hop { 40% { transform: translateY(-30%) rotate(-6deg); } }
.qcard { position: relative; padding: 22px 22px 20px 50px; }
[dir="rtl"] .qcard { padding: 22px 50px 20px 22px; }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.qtext { font-family: var(--display); font-weight: 700; font-size: clamp(1.3rem, 3.4vw, 1.9rem); line-height: 1.35; margin: 4px 0 16px; overflow-wrap: anywhere; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { --o: var(--o1); position: relative; display: flex; align-items: center; gap: 10px; min-height: 70px; padding: 10px 14px; border-radius: var(--wob);
  background: var(--o); border: 2.5px solid var(--line); box-shadow: 0 5px 0 var(--line); font-weight: 800; font-size: 1.12rem; line-height: 1.3; text-align: start;
  cursor: pointer; transition: transform .08s, box-shadow .08s, opacity .3s; color: var(--ink); }
.opt:nth-child(2) { --o: var(--o2); } .opt:nth-child(3) { --o: var(--o3); } .opt:nth-child(4) { --o: var(--o4); }
.opt .sh { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); font-size: .9rem; }
.opt > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.opt:disabled { cursor: default; }
.opt.gone { opacity: .35; }
.opt.right { outline: 4px solid #2e7d32; outline-offset: 2px; animation: win .5s ease-out; }
.opt.right::after { content: "✓"; position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--leaf); border: 2px solid var(--line); font-weight: 900; }
.opt.wrong { animation: shake .4s; outline: 4px solid var(--red); outline-offset: 2px; }
@keyframes win { 40% { transform: scale(1.04) rotate(-1deg); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.feedback { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); font-weight: 700; }
.feedback.good { background: var(--note-green); } .feedback.bad { background: var(--note-pink); }
.feedback .char { width: 54px; flex: none; }
.play-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.score { font-family: var(--display); font-size: 1.2rem; font-weight: 800; }
.result { text-align: center; padding: 30px 20px; border-radius: var(--wob-lg); background: var(--card); border: 2.5px solid var(--line); box-shadow: var(--pop); }
.result .char { width: 160px; }
.result .stars { font-size: 2.6rem; letter-spacing: 6px; margin: 6px 0; }
.result h2 { font-family: var(--display); margin: 4px 0; font-size: 2rem; }
.confetti { position: fixed; top: -20px; width: 10px; height: 16px; z-index: 90; border: 1.5px solid var(--line); border-radius: 3px; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(110vh) rotate(680deg); } }

/* misc */
#toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(92vw, 520px); padding: 12px 20px; border-radius: 14px;
  background: var(--ink); color: #fff; font-weight: 700; text-align: center; box-shadow: var(--pop); }
.foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; max-width: 1180px; margin: 30px auto 0; padding: 22px 20px 30px;
  border-top: 2.5px dashed rgba(59, 43, 37, .35); color: var(--ink-2); font-weight: 700; font-size: .92rem; }
.foot a { color: var(--ink-2); }
.page-text { max-width: 760px; margin: 0 auto; padding-top: 30px; }
.page-text h1 { font-family: var(--display); } .page-text h2 { font-family: var(--display); color: #c63f41; margin-top: 26px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 30px; }
  .hero-tag { margin-inline: auto; } .hero-cta { justify-content: center; }
  .hero-art { margin: 10px auto 40px; max-width: 420px; width: 100%; }
  .steps, .trust { grid-template-columns: 1fr; }
  .subjects { grid-template-columns: repeat(4, 1fr); }
  .price-card { flex-direction: column; text-align: center; }
}
@media (max-width: 600px) {
  #app { padding: 0 14px 30px; } .top { padding: 8px 14px; }
  .brand small { display: none; } .brand img { width: 38px; height: 38px; } .brand b { font-size: 1.15rem; }
  .top-tools { gap: 6px; } .pill-btn { min-height: 34px; padding: .25em .7em; font-size: .82rem; }
  .pill-btn .nm { display: none; }
  .sky .sun { width: 70px; height: 70px; top: 64px; inset-inline-end: 8px; opacity: .9; } .sky .c2 { display: none; }
  .hero-art .char { inset-inline-end: 0; width: 120px; } .hero-art .books { inset-inline-start: 0; }
  .lib-head { padding-top: 28px; }
  .subjects { grid-template-columns: repeat(3, 1fr); }
  .shelf { grid-template-columns: repeat(2, 1fr); }
  .books { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr; }
  .opt { min-height: 60px; }
  .row2 { grid-template-columns: 1fr; }
  .book-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .book-top .chips { justify-content: center; }
  .empty { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .qcard { padding: 18px 16px 16px 40px; } [dir="rtl"] .qcard { padding: 18px 40px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
