/* Layout: one-screen dojo app. Night-indigo ground with faint zellige stars,
   lantern-gold for actions, belt colour as the per-screen signal, scroll-paper for learning cards. */
:root {
  /* Layout: sunny cartoon arcade. Sky-blue world, white cards with thick navy outlines and chunky drop shadows,
     sunshine-yellow actions, one bright colour per game. Round, bubbly type. */
  --ground: #BFE9FF;
  --ground-2: #FFFFFF;
  --ground-3: #EAF6FF;
  --line: #22305A;
  --shadow: #22305A;
  --fg: #22305A;
  --paper: #FFF8E7;
  --paper-2: #FFEFC9;
  --ink: #22305A;
  --muted: #5F6E92;
  --gold: #FFC93C;
  --gold-deep: #E39A00;
  --jade: #19B98B;
  --ember: #FF5A4E;
  --steel: #6E8BFF;
  --good: #2CC56F;
  --bad: #FF5A4E;
  --belt: #F3EFE4;
  --sky-1: #63C7FF;
  --sky-2: #BDEBFF;
  --f-display: "Baloo 2", "Nunito", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --f-body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-ar: "Scheherazade New", "Noto Naskh Arabic", "Geeza Pro", "Arabic Typesetting", "Traditional Arabic", serif;
  --f-quran: "Amiri Quran", "Scheherazade New", "Noto Naskh Arabic", serif;
  --r: 18px;
  color-scheme: light;
}

html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--ground);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='220' viewBox='0 0 520 220'%3E%3Cg fill='%23fff' opacity='.85'%3E%3Cellipse cx='90' cy='60' rx='58' ry='22'/%3E%3Cellipse cx='120' cy='46' rx='36' ry='26'/%3E%3Cellipse cx='66' cy='52' rx='26' ry='18'/%3E%3Cellipse cx='380' cy='150' rx='70' ry='24'/%3E%3Cellipse cx='410' cy='134' rx='40' ry='28'/%3E%3Cellipse cx='352' cy='142' rx='28' ry='19'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76' viewBox='0 0 76 76'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.18' stroke-width='1.4'%3E%3Crect x='24' y='24' width='28' height='28'/%3E%3Crect x='24' y='24' width='28' height='28' transform='rotate(45 38 38)'/%3E%3Ccircle cx='38' cy='38' r='5'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, #E6F7FF 100%);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
#app {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  overscroll-behavior: contain;
}
*, *::before, *::after { box-sizing: border-box; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }

.screen { max-width: 1080px; margin: 0 auto; padding-block: 14px 40px; display: flex; flex-direction: column; gap: 18px; }
.ar { font-family: var(--f-ar); line-height: 1.7; font-weight: 400; }
.qr { font-family: var(--f-quran); line-height: 2.1; }
.ico { display: inline-flex; width: 1.2em; height: 1.2em; flex: none; }
.ico svg { width: 100%; height: 100%; display: block; }

.eyebrow { font-family: var(--f-body); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.section-title { font-family: var(--f-display); font-weight: 800; letter-spacing: .02em; font-size: 1.5rem; margin: 6px 0 -6px; color: var(--fg); text-wrap: balance; }
.page-title { font-family: var(--f-display); font-weight: 800; font-size: clamp(2rem, 6vw, 3rem); line-height: 1; margin: 0; }
.note { color: var(--muted); margin: 0; max-width: 65ch; }
.note.center { text-align: center; margin-inline: auto; }
.note.warn, .warn { color: var(--gold); }

/* bilingual meaning */
.bi { display: inline-flex; flex-direction: column; gap: 2px; }
.m-other { font-size: .82em; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 48px; padding: .7em 1.15em; border-radius: 14px;
  font-family: var(--f-body); font-weight: 600; font-size: 1rem; line-height: 1.1;
  background: var(--ground-3); color: var(--fg); border: 3px solid var(--line);
  box-shadow: 0 4px 0 var(--shadow); cursor: pointer; transition: transform .07s ease, box-shadow .07s ease, filter .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.btn.primary { background: var(--gold); color: #1F1605; border-color: #F7D488; box-shadow: 0 4px 0 var(--gold-deep); }
.btn.primary:active { box-shadow: 0 1px 0 var(--gold-deep); }
.btn.ghost { background: transparent; }
.btn.big { min-height: 58px; font-size: 1.12rem; padding: .85em 1.6em; border-radius: 16px; }
.btn.small { min-height: 40px; padding: .5em .9em; font-size: .92rem; }
.btn.danger { background: #4B1A17; border-color: #8B2E26; color: #FFD9D3; }
.btn.dim { opacity: .55; }
.btn[disabled] { opacity: .45; cursor: default; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 14px; display: inline-grid; place-items: center;
  background: var(--ground-2); border: 3px solid var(--line); color: var(--fg); cursor: pointer; font-size: 1.25rem;
  box-shadow: 0 3px 0 var(--shadow);
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }

.chip { display: inline-flex; align-items: center; gap: .35em; padding: .35em .7em; border-radius: 999px; background: var(--ground-2); border: 3px solid var(--line); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.gold { color: var(--gold); }
.chip.ember { color: var(--ember); }
.chip b { color: var(--fg); }

.stars { display: inline-flex; gap: 2px; color: #3A4466; }
.stars .st { display: inline-flex; }
.stars .st.on { color: var(--gold); }
.big-stars { font-size: 2.6rem; gap: 8px; }
.big-stars .st.on { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.big-stars .st:nth-child(2) { animation-delay: .15s; }
.big-stars .st:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { transform: scale(.2) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }

.ninja, .sensei { display: inline-block; flex: none; }
.ninja svg, .sensei svg { display: block; }
.belt-svg { display: block; width: 100%; aspect-ratio: 300 / 74; max-width: 100%; }
.belt-svg svg { display: block; }

/* ---------- start ---------- */
.start { min-height: 100%; justify-content: flex-start; }
.start-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lang-toggle { display: inline-flex; background: var(--ground-2); border: 3px solid var(--line); border-radius: 12px; padding: 3px; }
.lang-toggle button { border: 0; background: transparent; padding: .45em .8em; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--muted); min-height: 38px; }
.lang-toggle button.on { background: var(--gold); color: #1F1605; }
.start-hero { position: relative; text-align: center; padding-block: 24px 8px; }
.hero-ar { font-family: var(--f-ar); font-size: clamp(7rem, 26vw, 13rem); line-height: 1; color: rgba(31, 163, 138, .16); position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.logo { position: relative; margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(3.4rem, 13vw, 6.4rem); line-height: .86; letter-spacing: -.01em; display: flex; flex-direction: column; align-items: center; }
.logo span { display: block; }
.logo-b { color: var(--gold); -webkit-text-stroke: 0; text-shadow: 4px 4px 0 var(--shadow); transform: skewX(-6deg); }
.tagline { position: relative; margin: 10px 0 0; color: var(--muted); font-weight: 500; }
.profile-list { display: flex; flex-direction: column; gap: 14px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.profile-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px; border-radius: var(--r);
  background: var(--ground-2); border: 3px solid var(--line); cursor: pointer; box-shadow: 0 5px 0 var(--shadow);
}
.profile-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--shadow); }
.profile-card.add { border-style: dashed; background: transparent; justify-content: center; }
.profile-card .plus { font-family: var(--f-display); font-size: 3rem; line-height: 1; color: var(--gold); }
.pc-name { font-weight: 700; font-size: 1.1rem; }
.pc-belt { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.pc-belt i { width: 22px; height: 8px; border-radius: 3px; display: inline-block; }

.new-ninja { display: flex; flex-direction: column; gap: 12px; align-items: stretch; max-width: 460px; width: 100%; margin: 0 auto; background: var(--ground-2); border: 3px solid var(--line); border-radius: 22px; padding: 22px; }
.modal-card .new-ninja { border: 0; padding: 0; background: transparent; }
.new-ninja .section-title { margin: 0; text-align: center; }
.nn-preview { display: grid; place-items: center; }
.lbl { font-weight: 600; font-size: .9rem; color: var(--muted); }
input[type="text"], select {
  font: inherit; font-size: 1.1rem; padding: .7em .9em; border-radius: 12px; border: 3px solid var(--line);
  background: var(--ground); color: var(--fg); min-height: 52px; width: 100%;
}
input[type="text"]:focus, select:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.band-pick { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--line); cursor: pointer; }
.swatch.on { border-color: var(--fg); box-shadow: 0 0 0 4px rgba(233, 180, 76, .45); }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar.plain { justify-content: space-between; }
.tb-ninja { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 0; min-height: 48px; }
.tb-name { font-family: var(--f-display); font-weight: 800; font-size: 1.4rem; }
.tb-stats { display: flex; gap: 8px; }
.tb-nav { display: flex; gap: 8px; margin-left: auto; }

/* ---------- hub ---------- */
.belt-hero {
  position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: center;
  padding: 20px; border-radius: 24px; background: linear-gradient(135deg, var(--ground-2), var(--ground-3)); border: 3px solid var(--line); overflow: hidden;
}
.belt-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--belt); }
.bh-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bh-title { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: .95; }
.bh-belt { max-width: 360px; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
.bh-count { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.bh-sensei { display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
.bubble { position: relative; background: var(--paper); color: var(--ink); border-radius: 16px; padding: 12px 14px; font-weight: 500; font-size: .95rem; margin-bottom: 30px; }
.bubble::before { content: ""; position: absolute; left: -9px; bottom: 14px; border: 9px solid transparent; border-right-color: var(--paper); border-left: 0; }

.lesson-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.ls-tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 14px; min-height: 48px;
  background: var(--ground-2); border: 3px solid var(--line); cursor: pointer; color: var(--fg);
}
.ls-tab .ls-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ground-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.ls-tab.done .ls-n { background: var(--belt); color: #111; }
.ls-tab.on { border-color: var(--gold); background: #FFF4CF; }
.ls-t { font-weight: 600; white-space: nowrap; }
.ls-s { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ls-tab[disabled] { opacity: .45; cursor: default; }

.lesson-card {
  background: var(--paper); color: var(--ink); border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 6px 0 var(--line); position: relative;
}
.lesson-card .eyebrow { color: #7A6A4A; }
.lc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lc-title { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.lc-artitle, .h-ar { font-family: var(--f-ar); font-style: normal; text-transform: none; font-size: .9em; margin-left: .4em; display: inline-block; }
.lc-preview { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; min-height: 3rem; }
.lc-g { font-size: 2.3rem; line-height: 1.4; }
.lc-ayah { font-size: 1.7rem; }

.rooms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.room-tile {
  --c: var(--gold);
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; border-radius: 20px; min-height: 160px; text-align: left;
  background: var(--ground-2); border: 3px solid var(--line); cursor: pointer; box-shadow: 0 5px 0 var(--shadow); position: relative; overflow: hidden;
}
.room-tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--c); opacity: .12; }
.room-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--shadow); }
.room-tile:hover { border-color: var(--c); }
.r-slash { --c: var(--ember); }
.r-brush { --c: var(--gold); }
.r-echo { --c: var(--jade); }
.r-duel { --c: var(--steel); }
.rt-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--c); color: var(--ink); font-size: 1.8rem; }
.rt-name { font-family: var(--f-display); font-weight: 800; font-size: 1.7rem; line-height: 1; }
.rt-desc { color: var(--muted); font-size: .9rem; flex: 1; }
.rt-stars { font-size: 1.25rem; }

.exam-btn {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 20px; text-align: left; cursor: pointer;
  background: var(--ground-2); border: 3px dashed var(--line); color: var(--fg); min-height: 72px;
}
.exam-btn[disabled] { cursor: default; opacity: .7; }
.exam-btn.ready { border: 2px solid var(--gold); background: linear-gradient(90deg, rgba(233, 180, 76, .2), transparent); animation: glow 2.2s ease-in-out infinite; }
.exam-btn.passed { border-style: solid; border-color: var(--jade); }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(233, 180, 76, .18); } }
.ex-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--belt); color: #111; font-size: 1.6rem; flex: none; }
.ex-text { display: flex; flex-direction: column; }
.ex-text b { font-family: var(--f-display); font-weight: 800; font-size: 1.4rem; line-height: 1.1; }
.ex-text small { color: var(--muted); font-size: .9rem; }

.belt-path { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.bp-belt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; background: var(--ground-2); border: 3px solid var(--line); cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--fg); min-height: 72px; text-align: center; }
.bp-belt i { width: 100%; max-width: 64px; height: 12px; border-radius: 4px; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.bp-belt.on { border-color: var(--gold); }
.bp-belt.passed i { outline: 2px solid var(--jade); outline-offset: 2px; }
.bp-belt[disabled] { opacity: .45; cursor: default; }
.bp-belt .ico { font-size: .9rem; color: var(--muted); }

.intro-modal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.intro-modal h2 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 2.2rem; }
.intro-modal p { margin: 0 0 8px; font-size: 1.1rem; }

/* ---------- learn ---------- */
.learn-head h1 { margin: 2px 0 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1; }
.learn-head h1 .ar { font-style: normal; text-transform: none; }
.rule-card { display: flex; gap: 14px; align-items: flex-start; background: var(--ground-2); border: 3px solid var(--line); border-left: 6px solid var(--belt); border-radius: 18px; padding: 14px 16px; }
.rule-card > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.rule-text { margin: 0; font-size: 1.08rem; max-width: 65ch; }
.carousel { display: grid; place-items: center; }
.carousel-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--gold); }
.learn-foot { display: flex; justify-content: center; padding-top: 8px; }

.item-card {
  background: var(--paper); color: var(--ink); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 5px 0 var(--line); cursor: pointer; text-align: center; min-width: 0; position: relative;
}
.item-card:active { transform: translateY(2px); box-shadow: 0 3px 0 var(--line); }
.item-card.big { width: min(100%, 520px); padding: 22px 20px 20px; gap: 8px; }
.ic-glyph { font-size: 4.2rem; line-height: 1.35; }
.item-card.big .ic-glyph { font-size: clamp(5rem, 22vw, 8rem); line-height: 1.25; }
.ic-tr { font-family: var(--f-display); font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; color: #5A4A2A; }
.ic-hint { font-size: .98rem; max-width: 40ch; }
.ic-forms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; margin-top: 6px; direction: rtl; }
.ic-forms .f { display: flex; flex-direction: column; align-items: center; background: #EADDC2; border-radius: 12px; padding: 4px 2px; }
.f-g { font-size: 2.4rem; line-height: 1.5; }
.ic-forms small { font-size: .72rem; color: #6A5A3A; direction: ltr; }
.ex-btn { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "em ar sp" "em mean sp"; align-items: center; gap: 0 12px; width: 100%; margin-top: 8px; padding: 10px 14px; border-radius: 14px; border: 2px solid #D7C59E; background: #FBF4E4; cursor: pointer; text-align: left; color: var(--ink); }
.ex-em { grid-area: em; font-size: 2.4rem; }
.ex-ar { grid-area: ar; font-size: 1.9rem; line-height: 1.4; text-align: right; }
.ex-mean { grid-area: mean; font-size: .9rem; text-align: right; }
.ex-btn .ico { grid-area: sp; color: var(--gold-deep); }
.ic-long { display: flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; color: #6A5A3A; }
.ic-long i { width: 22px; height: 6px; border-radius: 3px; background: var(--gold); }
.ic-em { font-size: 3rem; line-height: 1.1; display: flex; align-items: center; gap: 8px; }
.item-card.big .ic-em { font-size: 4.4rem; }
.ic-sub { font-size: 2rem; color: #5A4A2A; }
.ic-word { font-size: 2.4rem; line-height: 1.5; }
.item-card.big .ic-word { font-size: clamp(3.2rem, 12vw, 4.6rem); }
.ic-phrase { font-size: 1.8rem; line-height: 1.6; }
.item-card.big .ic-phrase { font-size: clamp(2.2rem, 8vw, 3.2rem); }
.ic-mean { font-weight: 600; font-size: 1rem; }
.ic-mean.small { font-weight: 500; font-size: .85rem; color: #5A4A2A; }
.item-card .m-other { color: #7A6A4A; }
.ic-cat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #EADDC2; font-weight: 600; font-size: .85rem; }
.ic-ayah-n { position: absolute; top: 12px; left: 14px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--gold-deep); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.ic-ayah { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.ic-listen { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--gold-deep); font-size: .9rem; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.item-grid.ayahs { grid-template-columns: 1fr; }
.item-grid .item-card.big { width: 100%; }
.mushaf { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.mushaf .item-card.big { width: 100%; }
.bismillah { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 2rem; color: var(--gold); }
.mini-play { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); background: var(--ground-2); color: var(--fg); display: inline-grid; place-items: center; cursor: pointer; font-size: 1.1rem; flex: none; }

/* ---------- rooms ---------- */
#app[data-screen="slash"], #app[data-screen="brush"], #app[data-screen="duel"], #app[data-screen="exam"], #app[data-screen="echo"], #app[data-screen="order"] { overflow: hidden; }
.screen.room { height: 100%; padding-block: 10px; gap: 10px; }
.room-head { display: flex; align-items: center; gap: 12px; }
.rh-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.rh-title > .rh-name { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; line-height: 1; }
.rh-title .ico { color: var(--belt); font-size: 1.4rem; }
.rh-title small { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-right { display: flex; align-items: center; gap: 10px; }
.hearts { display: flex; gap: 3px; font-size: 1.5rem; color: #39425F; }
.hrt.on { color: var(--ember); }
.score { font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: right; }

.prompt-bar, .brush-info {
  display: flex; align-items: center; gap: 12px; background: var(--ground-2); border: 3px solid var(--line); border-radius: 18px; padding: 10px 12px; min-height: 76px; flex-wrap: wrap;
}
.pb-speaker { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--gold); color: #1F1605; display: grid; place-items: center; font-size: 1.5rem; cursor: pointer; flex: none; box-shadow: 0 3px 0 var(--gold-deep); }
.pb-speaker:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-deep); }
.pb-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pb-text small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.pb-text span { font-weight: 700; font-size: 1.15rem; }
.pb-visual { display: flex; align-items: center; }
.pv-tr { font-family: var(--f-display); font-weight: 800; font-size: 1.8rem; color: var(--gold); }
.pv-emoji { font-size: 2.6rem; display: flex; align-items: center; gap: 8px; }
.pv-sub { font-size: 1.8rem; color: var(--gold); }
.pv-mean { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; max-width: 34ch; }
.pv-icon { font-size: 2rem; }
.pv-cat { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.2rem; padding: 6px 12px; border-radius: 12px; background: var(--ground-3); }
.pv-cloze, .q-box .pv-cloze { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.cloze-line { display: flex; align-items: center; gap: 10px; font-size: 2rem; direction: rtl; }
.blank { display: inline-grid; place-items: center; min-width: 2.6em; height: 1.4em; border-radius: 10px; border: 2px dashed var(--gold); color: var(--gold); font-size: .9em; padding: 0 .3em; }
.cloze-hint { color: var(--muted); font-weight: 600; }
.pb-answer { display: flex; align-items: center; gap: 10px; padding: 4px 12px; border-radius: 12px; background: rgba(233, 180, 76, .14); color: var(--gold); font-weight: 700; }
.pb-answer small { color: var(--muted); }
.pa-ar { font-size: 2rem; line-height: 1.3; color: var(--fg); }

.stage {
  position: relative; flex: 1; min-height: 280px; border-radius: 22px; overflow: hidden; border: 3px solid var(--line);
  background:
    radial-gradient(circle at 82% 16%, #FFE68A 0 7%, transparent 7.5%),
    radial-gradient(ellipse at 50% 125%, rgba(255, 201, 60, .55), transparent 60%),
    linear-gradient(180deg, #4F7BFF 0%, #8A6BFF 60%, #C37BFF 100%);
}
.arena { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; cursor: crosshair; }
.combo-pop { position: absolute; top: 18%; left: 0; right: 0; text-align: center; pointer-events: none; font-family: var(--f-display); font-weight: 800; font-size: clamp(2rem, 7vw, 3.6rem); color: var(--gold); opacity: 0; text-shadow: 3px 3px 0 var(--shadow); }
.combo-pop.go { animation: combo .9s ease-out both; }
@keyframes combo { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; transform: scale(1.08); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }

/* order (calm) */
.order-area { display: flex; flex-direction: column; gap: 16px; flex: 1; overflow-y: auto; }
.order-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ayah-no { color: var(--muted); font-weight: 600; }
.order-line { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 16px; background: var(--paper); color: var(--ink); border-radius: 18px; min-height: 90px; box-shadow: 0 5px 0 var(--line); }
.slot { font-family: var(--f-quran); font-size: 1.9rem; line-height: 1.9; min-width: 2.4em; text-align: center; border-bottom: 3px dotted #C9B58C; color: #C9B58C; }
.slot.filled { color: var(--ink); border-bottom-color: transparent; animation: pop .35s ease-out both; }
.order-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.word-tile { padding: 6px 16px; border-radius: 14px; background: var(--ground-2); border: 3px solid var(--line); cursor: pointer; font-size: 1.7rem; min-height: 56px; color: var(--fg); box-shadow: 0 4px 0 var(--shadow); }
.word-tile.used { visibility: hidden; }
.word-tile.nope { animation: nope .35s; border-color: var(--steel); }
@keyframes nope { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.order-done { text-align: center; font-weight: 600; color: var(--fg); font-size: 1.05rem; }

/* brush */
.bi-target { display: flex; flex-direction: column; align-items: center; padding: 0 10px; }
.bt-ar { font-size: 2.4rem; line-height: 1.3; color: var(--gold); }
.bi-target small { color: var(--muted); font-weight: 600; }
.brush-wrap { position: relative; flex: 1; min-height: 240px; border-radius: 22px; overflow: hidden; border: 3px solid var(--line); background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.08), transparent 60%), linear-gradient(180deg, #2E6B58, #24594A); border: 10px solid #B9773D; box-shadow: inset 0 0 0 3px #8C5427, 0 6px 0 var(--shadow); }
.brush-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.brush-fg { touch-action: none; cursor: crosshair; }
.brush-tools { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.trace-pop { position: absolute; inset: auto 0 18px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; animation: pop .4s ease-out both; }
.trace-pop .stars { font-size: 2.4rem; }
.trace-pop b { font-family: var(--f-display); font-size: 1.8rem; text-shadow: 2px 2px 0 var(--shadow); }

/* echo */
.echo-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; overflow-y: auto; padding-bottom: 10px; }
.echo-status { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; color: var(--fg); text-align: center; }
.echo-status b { font-family: var(--f-display); font-weight: 800; font-size: 1.9rem; line-height: 1.05; }
.echo-card { background: var(--paper); color: var(--ink); border-radius: 24px; padding: 18px 26px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 6px 0 var(--line); max-width: 100%; }
.ec-em { font-size: 3.4rem; }
.ec-glyph { font-size: clamp(5rem, 20vw, 7.5rem); line-height: 1.25; }
.ec-word { font-size: clamp(3rem, 12vw, 4.4rem); line-height: 1.4; }
.ec-phrase { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.6; text-align: center; }
.ec-ayah { font-size: clamp(1.8rem, 5vw, 2.6rem); text-align: center; }
.ec-tr { font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; color: #5A4A2A; }
.ec-mean { font-weight: 600; text-align: center; }
.ring { width: 86px; height: 86px; opacity: .25; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .r-bg { fill: none; stroke: var(--line); stroke-width: 10; }
.ring .r-fg { fill: none; stroke: var(--jade); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; }
.ring.go { opacity: 1; }
.ring.go .r-fg { animation: ringfill var(--secs, 3s) linear forwards; }
@keyframes ringfill { to { stroke-dashoffset: 0; } }
.echo-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ear-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: min(100%, 560px); }
.ear-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px; border-radius: 20px; background: var(--paper); color: var(--ink); border: 4px solid transparent; cursor: pointer; box-shadow: 0 5px 0 var(--line); }
.ear-opt.right { border-color: var(--good); }
.ear-opt.wrong { border-color: var(--bad); opacity: .8; }
.eo-ar { font-size: clamp(3rem, 12vw, 4.6rem); line-height: 1.35; }
.eo-ayah { font-size: 1.5rem; }
.ear-opt small { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; color: #5A4A2A; }

/* duel */
.qprog { display: flex; gap: 4px; }
.qprog i { width: 10px; height: 10px; border-radius: 3px; background: var(--line); }
.qprog i.ok { background: var(--good); }
.qprog i.no { background: var(--bad); }
.duel-arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 18px; background: linear-gradient(90deg, rgba(233, 180, 76, .08), transparent 40%, transparent 60%, rgba(142, 162, 218, .1)); }
.duel-arena.calm { display: none; }
.duel-arena.struck { animation: struck .4s; }
@keyframes struck { 0% { background-color: rgba(239, 90, 67, .45); } 100% { background-color: transparent; } }
.fighter { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fighter small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.shadow-ninja { filter: brightness(.35) drop-shadow(0 0 10px rgba(142, 162, 218, .55)); transform: scaleX(-1); }
.shadow-ninja.hit { animation: hit .35s; }
@keyframes hit { 30% { transform: scaleX(-1) translateX(-12px) rotate(8deg); filter: brightness(1.4) drop-shadow(0 0 14px var(--ember)); } }
.vs { font-family: var(--f-display); font-weight: 800; font-size: 1.8rem; color: var(--gold); }
.hp { width: 90px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.hp i { display: block; height: 100%; background: var(--steel); transition: width .3s; }
.timer { height: 8px; border-radius: 4px; background: var(--ground-2); overflow: hidden; border: 1px solid var(--line); }
.timer i { display: block; height: 100%; width: 100%; background: var(--jade); transition: width .1s linear; }
.timer.low i { background: var(--ember); }
.q-box { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; flex: 1; justify-content: center; min-height: 0; overflow-y: auto; }
.q-label { color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.q-prompt { font-weight: 700; font-size: 1.2rem; text-wrap: balance; }
.q-big { display: flex; justify-content: center; align-items: center; background: var(--paper); color: var(--ink); border-radius: 22px; padding: 12px 24px; box-shadow: 0 5px 0 var(--line); max-width: 100%; }
.q-big.q-listen { background: transparent; box-shadow: none; }
.q-speaker { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--gold); color: #1F1605; font-size: 2.6rem; display: grid; place-items: center; cursor: pointer; box-shadow: 0 5px 0 var(--gold-deep); }
.glyph-xl { font-size: clamp(4.6rem, 18vw, 7rem); line-height: 1.25; }
.word-xl { font-size: clamp(3rem, 12vw, 4.4rem); line-height: 1.4; }
.phrase-xl { font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.6; }
.word-l { font-size: 2.6rem; line-height: 1.4; }
.q-word { display: flex; align-items: center; gap: 14px; }
.q-em { font-size: 2.6rem; }
.q-em-xl { font-size: clamp(4rem, 15vw, 5.5rem); line-height: 1.1; display: flex; align-items: center; gap: 12px; }
.q-sub { font-size: .6em; color: #5A4A2A; }
.q-mean { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.25rem; }
.q-class { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.q-class .ar { padding-bottom: .15em; }
.q-small { font-size: .9rem; font-weight: 500; color: #5A4A2A; }
.q-ayah { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: 1.8rem; }
.ayah-l { font-size: clamp(1.6rem, 4.6vw, 2.2rem); }
.q-big .pv-cloze { align-items: center; }
.q-big .cloze-hint { color: #5A4A2A; }
.q-big .blank { border-color: var(--gold-deep); color: var(--gold-deep); }
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opt-grid[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt {
  min-height: 72px; border-radius: 18px; border: 3px solid var(--line); background: var(--ground-2); color: var(--fg); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 6px 10px; box-shadow: 0 4px 0 var(--shadow); text-align: center; min-width: 0;
}
.opt:not([disabled]):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.opt[disabled] { cursor: default; }
.opt.k-ar .ar { font-size: clamp(1.8rem, 7vw, 2.8rem); line-height: 1.35; }
.opt.k-qr .qr { font-size: 1.8rem; line-height: 1.6; }
.opt.k-emoji span { font-size: 2.6rem; }
.opt.k-ui span { font-weight: 700; font-size: 1.1rem; overflow-wrap: anywhere; }
.opt.right { border-color: var(--good); background: rgba(67, 211, 140, .16); }
.opt.wrong { border-color: var(--bad); background: rgba(255, 106, 87, .14); animation: nope .35s; }

/* ---------- modal / result ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(34, 48, 90, .55); backdrop-filter: blur(4px); }
.modal-card { width: min(100%, 520px); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--ground-2); border: 3px solid var(--line); border-radius: 26px; padding: 24px; box-shadow: 0 12px 0 var(--shadow); animation: rise .25s ease-out both; position: relative; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
.result, .ceremony, .gate, .confirm { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.result h2, .ceremony h2, .gate h2 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 2rem; line-height: 1.05; text-wrap: balance; }
.res-gain { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 700; font-size: 1.15rem; }
.res-detail { margin: 0; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.new-stripe { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 16px; background: var(--ground-3); }
.new-stripe .belt-svg { max-width: 300px; }
.res-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.ceremony { overflow: hidden; }
.cer-belt { width: min(100%, 360px); animation: tie 1s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes tie { from { transform: scaleX(.2) rotate(-6deg); opacity: 0; } }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: .2; } }
.gate p { margin: 0; font-size: 1.1rem; }
.gate .ico { font-size: 2rem; color: var(--gold); }
.err { color: var(--bad); min-height: 1.4em; margin: 0; }
.confirm p { font-size: 1.1rem; margin: 0; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: 0 6px 0 rgba(0, 0, 0, .4); max-width: min(92vw, 520px); text-align: center; animation: rise .25s ease-out both; }
.toast.out { opacity: 0; transition: opacity .5s; }

/* ---------- exam intro / rest ---------- */
.ei-body, .rest { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding-top: 10px; }
.ei-body h1, .rest h1 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1; }
.ei-body p, .rest p { max-width: 46ch; font-size: 1.1rem; margin: 0; }
.ei-belt { width: min(100%, 380px); }
.rest { min-height: 100%; justify-content: center; }

/* ---------- library / armoury ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 3px solid var(--line); background: var(--ground-2); cursor: pointer; font-weight: 600; min-height: 44px; }
.tab i { width: 20px; height: 8px; border-radius: 3px; background: var(--c); }
.tab.on { border-color: var(--gold); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 18px; background: var(--ground-2); border: 3px solid var(--line); text-align: center; }
.shop-item.on { border-color: var(--gold); }
.shop-item small { color: var(--muted); }
.trail-prev { display: block; width: 100%; height: 72px; border-radius: 12px; background-color: var(--ground) !important; position: relative; }
.trail-prev { clip-path: polygon(0 62%, 100% 30%, 100% 44%, 0 72%); }
.tag { font-size: .85rem; font-weight: 700; color: var(--gold); padding: .5em .8em; }

/* ---------- parent ---------- */
.panel { background: var(--ground-2); border: 3px solid var(--line); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.panel h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: 6px; }
.panel > .btn { align-self: flex-start; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); min-height: 48px; cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-row select { width: auto; min-width: 150px; }
.switch { appearance: none; -webkit-appearance: none; width: 54px; height: 32px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); transition: transform .15s; }
.switch:checked { background: var(--jade); }
.switch:checked::after { transform: translateX(22px); }
.kv { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kv .ok { color: var(--good); }
.kv .off { color: var(--gold); font-weight: 600; text-align: right; max-width: 60%; }
.kid { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.kid-head { display: flex; align-items: center; gap: 12px; }
.kid-head > div { display: flex; flex-direction: column; }
.kid-head small { color: var(--muted); }
.kid-belts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.kb { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--ground-3); font-size: .9rem; font-variant-numeric: tabular-nums; }
.kb i { width: 18px; height: 8px; border-radius: 3px; flex: none; }
.kb span { flex: 1; }
.kb em { color: var(--jade); font-style: normal; font-weight: 700; }
.weak h3 { margin: 4px 0; font-size: 1rem; }
.weak { display: flex; flex-direction: column; gap: 6px; }
.weak-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 12px; border-radius: 12px; background: var(--paper); color: var(--ink); border: 0; cursor: pointer; text-align: left; }
.weak-item .ar, .weak-item .qr { font-size: 1.8rem; line-height: 1.5; }
.weak-item small { color: #5A4A2A; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- v2: hub, missions, games ---------- */
.chip.jade { color: var(--jade); cursor: pointer; font: inherit; font-weight: 600; }
.btn.paper { background: #FBF4E4; color: var(--ink); border-color: #D7C59E; box-shadow: 0 4px 0 var(--line); }
.chest-btn { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; align-items: center; gap: 0; background: var(--gold); color: #1F1605; border: 0; border-radius: 16px; padding: 6px 10px 4px; cursor: pointer; box-shadow: 0 4px 0 var(--gold-deep); animation: bob 1.6s ease-in-out infinite; }
.chest-btn span { font-size: 1.8rem; line-height: 1.1; }
.chest-btn small { font-weight: 700; font-size: .72rem; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-3deg); } }
.chest-open { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.chest-open h2 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 2rem; }
.chest-em { font-size: 5rem; line-height: 1.1; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.chest-em.burst { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.res-gain.big { font-size: 1.8rem; }

.lc-wordchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 6px; border-radius: 999px; background: #EADDC2; }
.lc-wordchip .ar { font-size: 1.5rem; line-height: 1.5; }
.lc-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.mission-btn { display: inline-flex; align-items: center; gap: 12px; padding: 10px 20px 10px 10px; border-radius: 18px; border: 0; cursor: pointer; background: var(--ink); color: var(--fg); box-shadow: 0 5px 0 #000; text-align: left; min-height: 64px; }
.mission-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; }
.mb-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--gold); color: #1F1605; font-size: 1.5rem; }
.mb-text { display: flex; flex-direction: column; }
.mb-text b { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; line-height: 1; }
.mb-text small { color: var(--muted); font-size: .82rem; }
.lc-progress { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 180px; }
.lc-progress small { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: #6A5A3A; }
.lc-progress .ico { color: var(--gold-deep); }
.lp-bar { height: 12px; border-radius: 6px; background: #E0D2B2; overflow: hidden; }
.lp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #F6CF7A); border-radius: 6px; transition: width .4s; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.game-tile { --c: var(--gold); position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; min-height: 128px; border-radius: 18px; text-align: left; cursor: pointer; background: var(--ground-2); border: 3px solid var(--line); box-shadow: 0 4px 0 var(--shadow); }
.game-tile::after { content: ""; position: absolute; right: -26px; top: -26px; width: 84px; height: 84px; border-radius: 50%; background: var(--c); opacity: .14; }
.game-tile:hover { border-color: var(--c); }
.game-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.gt-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--c); color: var(--ink); font-size: 1.4rem; }
.gt-name { font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; line-height: 1; }
.gt-desc { color: var(--muted); font-size: .8rem; flex: 1; }
.gt-stars { font-size: 1rem; }

/* learn: example words */
.ex-head { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 6px; gap: 8px; }
.ex-head small { color: #6A5A3A; font-weight: 600; }
.ex-more { border: 0; background: none; color: var(--gold-deep); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; padding: 6px; }
.ex-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.wchip { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 4px; border-radius: 14px; border: 2px solid #D7C59E; background: #FBF4E4; cursor: pointer; color: var(--ink); min-width: 0; }
.wc-em { font-size: 2rem; line-height: 1.2; }
.wc-ar { font-size: 1.6rem; line-height: 1.5; }
.wchip small { font-size: .74rem; color: #6A5A3A; overflow-wrap: anywhere; text-align: center; }
.ic-em.dim { opacity: .55; }
.item-grid.words { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* game host */
.room-body { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.game-intro { --c: var(--gold); flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 20px; }
.gi-icon { display: grid; place-items: center; width: 110px; height: 110px; border-radius: 30px; background: var(--c); color: var(--ink); font-size: 3.6rem; box-shadow: 0 8px 0 rgba(0, 0, 0, .35); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.gi-boss { font-size: 4.2rem; line-height: 1; filter: drop-shadow(0 0 12px var(--belt)); }
.game-intro h2 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(2.2rem, 7vw, 3.2rem); line-height: 1; }
.game-intro p { margin: 0 0 8px; font-size: 1.15rem; max-width: 40ch; }
.mission-dots { display: flex; gap: 6px; }
.mission-dots .md { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ground-2); border: 3px solid var(--line); color: var(--muted); font-size: 1rem; }
.mission-dots .md.on { border-color: var(--gold); color: var(--gold); }
.mission-dots .md.done { background: var(--jade); border-color: var(--jade); color: var(--ink); }
.stage-clear .btn { margin-top: 6px; }
.me-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--ground-3); }
.me-row span:not(.ico):not(.stars):not(.st) { flex: 1; text-align: left; font-weight: 600; }
.me-row .stars { font-size: 1.1rem; }
.new-words { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nw-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.nw-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 1.1rem; }
.nw-chip .ar { font-size: 1.3rem; line-height: 1.5; }
.new-words small { color: var(--jade); font-weight: 700; }

/* prompt visuals */
.pv-word { display: flex; align-items: center; gap: 10px; }
.pv-word .pv-icon { font-size: 2.4rem; }
.pv-ar { font-size: 2.2rem; line-height: 1.4; color: var(--fg); }
.q-big .pv-ar { color: var(--ink); font-size: 2.8rem; }
.pv-word.small .pv-icon { font-size: 1.6rem; }
.pv-word.small .pv-ar { font-size: 1.5rem; color: inherit; }
.q-where { display: flex; align-items: center; gap: 18px; }
.glyph-l { font-size: 3.6rem; line-height: 1.3; color: var(--gold-deep); }
.pv-icon.ar { font-family: var(--f-ar); }
.face-emoji { font-size: 2.4rem; line-height: 1.1; }
.face-ui { font-weight: 700; }
.face-sound { display: grid; place-items: center; font-size: 2rem; color: var(--gold-deep); }

/* rooftop run */
.run-stage { background: linear-gradient(180deg, #0A1028, #12193A); touch-action: none; }

/* window whack */
.whack-target { display: flex; align-items: center; gap: 12px; background: var(--ground-2); border: 3px solid var(--line); border-radius: 18px; padding: 8px 12px; min-height: 76px; }
.whack-target.pulse { animation: tpulse .6s; }
@keyframes tpulse { 30% { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(233, 180, 76, .35); transform: scale(1.02); } }
.wt-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wt-text small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.wt-text b { font-size: 1.1rem; }
.wt-goal { display: grid; place-items: center; min-width: 72px; height: 64px; padding: 0 12px; border-radius: 14px; background: var(--paper); color: var(--ink); }
.wt-glyph.ar { font-size: 2.4rem; line-height: 1.3; }
.wt-visual .pv-word .pv-ar { font-size: 1.6rem; }
.whack-wrap { position: relative; flex: 1; display: flex; min-height: 0; }
.whack-grid { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 12px; min-height: 260px; padding: 14px; border-radius: 22px; background: linear-gradient(180deg, #C98B4E, #A86A35); border: 4px solid #7A4A22; box-shadow: inset 0 0 0 6px #8E5A2C, 0 6px 0 #4A2C12; }
.win { position: relative; overflow: hidden; border-radius: 50% 50% 12px 12px / 30% 30% 12px 12px; border: 4px solid #5B3B1C; padding: 0; cursor: pointer; background: #1A2340; min-height: 70px; touch-action: manipulation; perspective: 400px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .25); }
.win-face { position: absolute; inset: 0; display: grid; place-items: center; background: var(--paper); color: var(--ink); transition: background .15s; }
.win-face .wf.ar { font-size: clamp(2.4rem, 9vw, 3.6rem); line-height: 1.3; }
.win-face .face-emoji { font-size: clamp(2rem, 8vw, 3rem); }
.win-face .pv-word { flex-direction: column; gap: 0; }
.win-face .pv-word .pv-ar { color: var(--ink); font-size: clamp(1.3rem, 5vw, 1.8rem); }
.shutter { position: absolute; top: 0; bottom: 0; width: 50%; background: repeating-linear-gradient(0deg, #2F7DE1 0 9px, #2668BF 9px 11px); border: 2px solid #1D4F91; transition: transform .22s ease-out; z-index: 2; }
.shutter.l { left: 0; transform-origin: left center; }
.shutter.r { right: 0; transform-origin: right center; }
.win.up .shutter.l { transform: rotateY(-105deg); }
.win.up .shutter.r { transform: rotateY(105deg); }
.win.knock { animation: knock .25s; }
@keyframes knock { 30% { transform: translateX(-3px) rotate(-2deg); } 70% { transform: translateX(3px) rotate(2deg); } }
.win.hit .win-face { background: #BFF0D2; }
.win.miss .win-face { background: #F8C4BC; }
.win.miss { animation: knock .3s; }
.win-stamp { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; font-size: clamp(3rem, 12vw, 4.6rem); font-weight: 900; pointer-events: none; }
.win.hit .win-stamp { color: #13924F; animation: pop .3s ease-out both; text-shadow: 0 2px 0 #fff; }
.win.miss .win-stamp { color: #C2342A; animation: pop .3s ease-out both; text-shadow: 0 2px 0 #fff; }
.float-pt { position: absolute; z-index: 4; left: 50%; top: 20%; transform: translateX(-50%); font-family: var(--f-display); font-weight: 800; font-size: 1.8rem; pointer-events: none; animation: floatup .9s ease-out forwards; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.float-pt.good { color: var(--gold); }
.float-pt.bad { color: #fff; }
@keyframes floatup { to { transform: translate(-50%, -60px); opacity: 0; } }
.whack-banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .2s; }
.whack-banner.show { opacity: 1; }
.wb-in { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 34px; border-radius: 24px; background: var(--paper); color: var(--ink); box-shadow: 0 10px 0 rgba(0, 0, 0, .35); animation: pop .35s ease-out both; }
.wb-in small { font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #6A5A3A; }
.wb-glyph.ar { font-size: 4.4rem; line-height: 1.3; }

/* memory */
.mem-grid { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-content: center; perspective: 900px; }
.mem-grid.small { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 640px; margin: 0 auto; width: 100%; }
.mcard { aspect-ratio: 4 / 5; max-height: 26vh; border: 0; padding: 0; background: none; cursor: pointer; }
.mc-inner { position: relative; width: 100%; height: 100%; transition: transform .35s; transform-style: preserve-3d; }
.mcard.open .mc-inner, .mcard.done .mc-inner { transform: rotateY(180deg); }
.mc-back, .mc-front { position: absolute; inset: 0; border-radius: 16px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mc-back { background: repeating-linear-gradient(45deg, #3E8BFF 0 12px, #5A9DFF 12px 24px); border: 3px solid var(--line); color: var(--gold); font-size: 2rem; }
.mc-front { transform: rotateY(180deg); background: var(--paper); color: var(--ink); border: 3px solid #D7C59E; padding: 6px; }
.mc-front.sound { background: #FBF4E4; }
.mcard.done .mc-front { border-color: var(--good); background: #E7F7EC; }
.mcf.ar { font-size: clamp(1.8rem, 6vw, 2.8rem); line-height: 1.3; }
.mc-front.quran .qr { font-size: clamp(1rem, 3vw, 1.4rem); line-height: 1.8; text-align: center; }
.mcf.face-ui { font-size: .9rem; text-align: center; }
.mcf.face-emoji { font-size: clamp(2rem, 7vw, 3rem); }
.mc-front .pv-word { flex-direction: column; gap: 0; }

/* sorting dojo */
.sort-stage { flex: 1; display: grid; grid-template-columns: 1fr minmax(0, 1.2fr) 1fr; gap: 12px; align-items: center; min-height: 0; }
.bin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 180px; height: 100%; max-height: 360px; border-radius: 22px; border: 3px dashed var(--line); background: var(--ground-2); cursor: pointer; color: var(--fg); padding: 10px; transition: border-color .15s, background .15s; }
.bin:hover { border-color: var(--gold); }
.bin small { font-weight: 600; color: var(--muted); text-align: center; }
.bin-glyph, .bin-ar { font-size: clamp(3rem, 12vw, 4rem); line-height: 1.3; }
.bin-icon { font-size: 2.6rem; }
.bin-count { font-family: var(--f-display); font-size: 1.6rem; color: var(--gold); }
.bin.glow { border-color: var(--good); background: rgba(67, 211, 140, .14); border-style: solid; }
.bin.bad { border-color: var(--bad); background: rgba(255, 106, 87, .12); }
.bin.hint { border-color: var(--good); border-style: solid; }
.sort-card-slot { display: grid; place-items: center; min-height: 200px; }
.sort-card { min-width: 170px; min-height: 170px; justify-content: center; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--paper); color: var(--ink); border-radius: 22px; padding: 18px 22px; box-shadow: 0 6px 0 var(--line); touch-action: pan-y; transition: transform .45s ease-in, opacity .45s; animation: pop .35s ease-out both; max-width: 100%; }
.sort-card .mini-play { position: absolute; top: -14px; right: -14px; }
.sort-card.fly-left { transform: translateX(-60vw) rotate(-20deg); opacity: 0; }
.sort-card.fly-right { transform: translateX(60vw) rotate(20deg); opacity: 0; }
.sort-card.nope { animation: nope .35s; }
.sc-word { display: flex; flex-direction: column; align-items: center; }
.sc-em { font-size: 3rem; line-height: 1.2; transition: opacity .2s; }
.sc-em.small { font-size: 2rem; }
.sc-em.hidden { opacity: 0; }
.sc-ar { font-size: clamp(3rem, 12vw, 4rem); line-height: 1.4; }

/* word smith */
.smith-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; overflow-y: auto; }
.smith-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--paper); color: var(--ink); border-radius: 24px; padding: 18px 26px; box-shadow: 0 6px 0 var(--line); max-width: 100%; }
.smith-card.wide { width: min(100%, 720px); }
.smith-card .mini-play { position: absolute; top: -14px; right: -14px; }
.smith-card.done { box-shadow: 0 6px 0 var(--jade); }
.smith-em { font-size: 3.4rem; line-height: 1.1; }
.smith-em.small { font-size: 2.2rem; }
.smith-name, .smith-mean { font-weight: 600; color: #5A4A2A; text-align: center; }
.smith-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 80px; }
.smith-ar { font-size: clamp(2.6rem, 9vw, 4rem); line-height: 1.4; }
.smith-line .slot:not(.big) { min-width: 1.3em; font-size: 2.4rem; line-height: 1.5; border: 2px dashed #C9B58C; border-radius: 10px; }
.slot { font-family: var(--f-ar); font-size: 1.9rem; line-height: 1.9; min-width: 1.6em; text-align: center; border-bottom: 3px dotted #C9B58C; color: #C9B58C; }
.slot.big { min-width: 1.4em; font-size: 2.6rem; border: 3px dashed var(--gold-deep); border-radius: 12px; color: var(--gold-deep); line-height: 1.4; }
.smith-opts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: min(100%, 640px); }
.smith-opts .opt { flex: 1 1 110px; }
.tile-l { width: 64px; height: 72px; border-radius: 16px; border: 3px solid var(--line); background: var(--ground-2); color: var(--fg); font-family: var(--f-ar); font-size: 2.2rem; cursor: pointer; box-shadow: 0 4px 0 var(--shadow); }
.tile-l.used { visibility: hidden; }
.tile-l.nope { animation: nope .35s; border-color: var(--bad); }

/* lightning */
.blitz-label { text-align: center; font-weight: 700; font-size: 1.2rem; }
.blitz-card { flex: 0 1 auto; min-height: 220px; max-height: 340px; width: min(100%, 760px); margin: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; background: var(--paper); color: var(--ink); border-radius: 24px; padding: 14px; box-shadow: 0 6px 0 var(--line); min-height: 180px; border: 4px solid transparent; }
.blitz-card.in { animation: pop .25s ease-out both; }
.blitz-card.ok { border-color: var(--good); }
.blitz-card.bad { border-color: var(--bad); animation: nope .35s; }
.bc-left, .bc-right { display: grid; place-items: center; min-width: 0; text-align: center; }
.bc-eq { font-family: var(--f-display); font-size: 2.2rem; color: var(--line); }
.bcf.ar { font-size: clamp(3.2rem, 11vw, 5.4rem); line-height: 1.35; }
.bcf.face-emoji { font-size: clamp(3rem, 10vw, 4.4rem); }
.bcf.face-ui { font-size: 1.2rem; }
.bc-right .pv-word { flex-direction: column; gap: 0; }
.bc-right .pv-word .pv-icon { font-size: 3.4rem; }
.bc-right .pv-word .pv-ar { font-size: 2.8rem; color: var(--ink); }
.blitz-row { width: min(100%, 760px); margin: 0 auto; }
.blitz-combo { text-align: center; min-height: 1.6em; font-family: var(--f-display); font-weight: 800; font-size: 1.4rem; color: var(--gold); }
.blitz-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.blitz-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 84px; border-radius: 20px; border: 0; cursor: pointer; font-family: var(--f-display); font-weight: 800; font-size: 1.7rem; color: var(--ink); box-shadow: 0 5px 0 rgba(0, 0, 0, .4); }
.blitz-btn .ico { font-size: 2rem; }
.blitz-btn.yes { background: var(--good); }
.blitz-btn.no { background: var(--bad); }
.blitz-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .4); }

/* boss fight */
.boss-arena { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 20px; background: radial-gradient(ellipse at 80% 50%, color-mix(in srgb, var(--aura) 30%, transparent), transparent 60%), var(--ground-2); border: 3px solid var(--line); overflow: hidden; }
.boss-arena.calm { display: none; }
.boss-arena.struck { animation: struck .45s; }
@keyframes struck { 0% { background-color: rgba(239, 90, 67, .55); } 100% { background-color: transparent; } }
.bf-you { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bf-boss { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.boss-fig { font-size: clamp(3.6rem, 12vw, 5.4rem); line-height: 1; filter: drop-shadow(0 0 14px var(--aura)) drop-shadow(0 6px 0 rgba(0, 0, 0, .5)); animation: hover 2.4s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-6px); } }
.boss-fig.hit { animation: bosshit .4s; }
@keyframes bosshit { 30% { transform: translateX(14px) rotate(10deg) scale(.92); filter: brightness(2) drop-shadow(0 0 20px var(--ember)); } }
.boss-fig.attack { animation: bossatk .45s; }
@keyframes bossatk { 40% { transform: translateX(-60px) scale(1.2); } }
.boss-fig.down { animation: none; transform: rotate(90deg) translateY(20px); opacity: .4; transition: all .6s; }
.boss-name { font-family: var(--f-display); font-weight: 800; font-size: 1.1rem; }
.hpbar { width: min(220px, 40vw); height: 12px; border-radius: 6px; background: #3A1A1A; overflow: hidden; border: 2px solid #000; }
.hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #EF5A43, #F5A43A); transition: width .35s; }
.slash-fx { position: absolute; inset: 0; pointer-events: none; }
.slash-fx.go::after { content: ""; position: absolute; right: 8%; top: 50%; width: 46%; height: 6px; border-radius: 3px; background: linear-gradient(90deg, transparent, #fff, var(--gold)); transform: rotate(-24deg); animation: slashfx .35s ease-out both; }
@keyframes slashfx { from { opacity: 0; transform: translateX(-40px) rotate(-24deg) scaleX(.3); } 50% { opacity: 1; } to { opacity: 0; transform: translateX(30px) rotate(-24deg) scaleX(1); } }
.crit { position: absolute; right: 18%; top: 6px; font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; color: var(--gold); opacity: 0; pointer-events: none; text-shadow: 2px 2px 0 #000; }
.crit.go { animation: combo .9s ease-out both; }
.ei-boss { font-size: 6rem; line-height: 1; filter: drop-shadow(0 0 18px var(--belt)); animation: hover 2.4s ease-in-out infinite; }
.ei-bossname { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; color: var(--gold); }

/* collection album */
.coll-count { display: flex; align-items: center; gap: 12px; }
.coll-count .lp-bar { flex: 1; background: var(--ground-3); }
.coll-count b { white-space: nowrap; }
.st-count { font-family: var(--f-body); font-style: normal; font-size: .9rem; color: var(--muted); text-transform: none; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.acard { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 4px; border-radius: 14px; border: 3px dashed var(--line); background: var(--ground-2); color: var(--muted); cursor: pointer; min-width: 0; }
.acard .ac-em { font-size: 1.8rem; line-height: 1.2; filter: grayscale(1) brightness(.5); }
.acard .ac-ar { font-size: 1.4rem; line-height: 1.5; opacity: .6; }
.acard small { font-size: .72rem; overflow-wrap: anywhere; text-align: center; }
.acard.have { border: 2px solid #D7C59E; background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.acard.have .ac-em { filter: none; }
.acard.have .ac-ar { opacity: 1; }
.album.letters .ac-glyph { font-size: 2.6rem; line-height: 1.3; }
.album.letters b { font-family: var(--f-display); font-size: 1.1rem; }
.tabs.small .tab { min-height: 38px; font-size: .9rem; }

/* parent: voices */
.voice-row { flex-wrap: wrap; cursor: default; }
.vr-ctrl { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 260px; justify-content: flex-end; }
.vr-ctrl select { width: auto; max-width: 100%; min-width: 0; flex: 1; font-size: .95rem; }
.icon-btn.small { width: 44px; height: 44px; font-size: 1.1rem; }

/* ---------- v3: navigation, lesson path, steps ---------- */
.screen.with-nav { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
.main-nav { position: sticky; top: 6px; z-index: 30; display: flex; justify-content: center; gap: 4px; width: 100%; max-width: 620px; margin: 4px auto 6px; padding: 5px 6px; background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px); border: 3px solid var(--line); border-radius: 22px; }
.bn-item { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-weight: 700; font-size: .8rem; cursor: pointer; min-height: 56px; }
.bn-ico { display: grid; place-items: center; font-size: 1.5rem; width: 46px; height: 30px; border-radius: 999px; transition: background .15s; }
.bn-item.on { color: var(--fg); }
.bn-item.on .bn-ico { background: var(--gold); color: #1F1605; }
.lesson-path { display: flex; gap: 0; overflow-x: auto; padding: 6px 4px 10px; scrollbar-width: thin; }
.lp-node { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; border: 0; background: none; color: var(--fg); cursor: pointer; padding: 0; }
.lp-node::before { content: ""; position: absolute; top: 27px; left: -50%; width: 100%; height: 6px; background: var(--line); z-index: 0; }
.lp-node:first-child::before { display: none; }
.lp-node.done::before, .lp-node.on::before { background: var(--belt); }
.lpn-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--ground-3); border: 4px solid var(--line); font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; box-shadow: 0 4px 0 var(--shadow); }
.lp-node.done .lpn-dot { background: var(--belt); color: #111; border-color: var(--belt); }
.lp-node.on .lpn-dot { border-color: var(--gold); background: #FFF4CF; transform: scale(1.1); box-shadow: 0 0 0 6px rgba(233, 180, 76, .25), 0 4px 0 var(--shadow); animation: glow 2.2s ease-in-out infinite; }
.lp-node.done.on .lpn-dot { background: var(--belt); }
.lp-node.locked { opacity: .45; cursor: default; }
.lpn-t { font-size: .78rem; font-weight: 600; text-align: center; line-height: 1.2; max-width: 92px; }
.lc-steps { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.step-arrow { display: grid; place-items: center; color: var(--line); font-size: 1.4rem; }
.step-btn { flex: 1 1 220px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; border: 3px solid transparent; cursor: pointer; text-align: left; min-height: 72px; box-shadow: 0 5px 0 rgba(0, 0, 0, .25); }
.step-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.step-btn.explain { background: #FBF4E4; border-color: #D7C59E; color: var(--ink); }
.step-btn.explain.next { border-color: var(--gold); animation: glow 2.2s ease-in-out infinite; }
.step-btn.mission { background: var(--ink); color: var(--fg); }
.step-btn.mission.next { border-color: var(--gold); }
.step-btn.mission.locked { opacity: .55; }
.sb-n { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 14px; background: var(--gold); color: #1F1605; font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; }
.step-btn.explain.done .sb-n { background: var(--jade); color: #fff; }
.step-btn.locked .sb-n { background: var(--line); color: var(--muted); }
.sb-t { display: flex; flex-direction: column; min-width: 0; }
.sb-t small { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.sb-t b { font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; line-height: 1.05; }
.sb-t em { font-style: normal; font-size: .8rem; opacity: .75; }
.games-grid.locked .game-tile { opacity: .55; }
.gt-lock { color: var(--muted); font-size: 1.1rem; }
.rh-explain { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; min-height: 44px; border-radius: 14px; border: 3px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--shadow); }
.rh-explain .ico { color: var(--gold-deep); }
.gi-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.dots .dot { width: 14px; height: 14px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.dots .dot.seen { background: #6B7BA8; }
.dots .dot.on { background: var(--gold); transform: scale(1.25); }
.carousel-nav .btn.big { min-height: 58px; font-size: 1.1rem; }
.bp-belt.master { cursor: default; }
.bp-belt.master em { color: var(--gold); font-style: normal; }
.belt-path { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---------- 3D runner ---------- */
.stage3d { background: #F7C88A; touch-action: none; }
.arena3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.run-loading { flex: 1; display: grid; place-items: center; font-size: 2rem; color: var(--gold); }
.run-coins { font-size: 1rem; }
.run-coins .score { font-size: 1.1rem; min-width: 0; }
.camel-meter { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(13, 19, 34, .72); color: #fff; font-size: 1.3rem; }
.cm-bar { width: min(160px, 30vw); height: 10px; border-radius: 5px; background: #C2463A; overflow: hidden; }
.cm-bar i { display: block; height: 100%; background: var(--good); transition: width .3s; }
.camel-meter.danger { animation: tpulse .8s infinite; }
.stage3d .combo-pop { color: #fff; text-shadow: 3px 3px 0 #7A4A22; top: 30%; }
.run-hint { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: rgba(13, 19, 34, .78); color: #fff; font-weight: 700; white-space: nowrap; transition: opacity .4s; pointer-events: none; }
.run-hint.hide { opacity: 0; }
.lane-btn { position: absolute; bottom: 14px; width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .8); background: rgba(13, 19, 34, .45); color: #fff; font-size: 1.6rem; display: grid; place-items: center; cursor: pointer; }
.lane-btn.left { left: 14px; }
.lane-btn.right { right: 14px; }
.lane-btn.jump { left: 50%; transform: translateX(-50%); font-weight: 900; }
.lane-btn:active { background: rgba(255, 201, 60, .85); }

/* ---------- Quran ---------- */
.screen.quran, .screen.surah { --belt: #1FA38A; }
.q-hero { position: relative; overflow: hidden; display: flex; gap: 18px; align-items: center; padding: 22px; border-radius: 24px; background: radial-gradient(ellipse at 90% 10%, rgba(233, 180, 76, .25), transparent 55%), linear-gradient(135deg, #2FD3A0, #12A87E); border: 3px solid var(--line); box-shadow: 0 6px 0 var(--shadow); color: #fff; }
.q-hero h1 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(2.4rem, 7vw, 3.4rem); line-height: 1; }
.q-hero p { margin: 6px 0 0; max-width: 46ch; color: #F0FFF9; font-weight: 600; }
.qh-orn { flex: none; display: grid; place-items: center; width: 110px; height: 110px; border-radius: 50%; border: 3px solid var(--gold); color: var(--gold); background: rgba(0, 0, 0, .15); }
.qh-orn .qr { font-size: 1.6rem; line-height: 1.6; }
.reciter-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rc { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 16px; border: 3px solid var(--line); background: var(--ground-2); color: var(--fg); cursor: pointer; text-align: left; }
.rc small { color: var(--muted); }
.rc.on { border-color: var(--jade); background: #DDF7EE; box-shadow: 0 0 0 3px rgba(31, 163, 138, .3); }
.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.surah-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 3px solid var(--line); background: var(--ground-2); color: var(--fg); cursor: pointer; text-align: left; box-shadow: 0 4px 0 var(--shadow); }
.surah-card:hover { border-color: var(--jade); }
.surah-card.learned { border-color: var(--jade); }
.sc-num { display: grid; place-items: center; width: 44px; height: 44px; flex: none; transform: rotate(45deg); border: 2px solid var(--gold); border-radius: 8px; font-weight: 800; color: var(--gold); }
.sc-num { font-variant-numeric: tabular-nums; }
.sc-names { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sc-ar { font-size: 1.5rem; line-height: 1.7; color: var(--gold); }
.sc-names small { color: var(--muted); }
.sc-learned { display: inline-flex; align-items: center; gap: 4px; color: var(--jade); font-weight: 700; font-size: .85rem; }
.sh-title { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sh-ar { font-size: 2rem; line-height: 1.6; color: var(--gold); }
.sh-title small { color: var(--muted); }
.screen.surah { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
.q-toggles { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.qt { padding: 8px 16px; border-radius: 999px; border: 3px solid var(--line); background: var(--ground-2); color: var(--muted); font-weight: 700; cursor: pointer; min-height: 44px; }
.qt.on { border-color: var(--jade); color: var(--fg); background: #DDF7EE; }
.ayah-list { display: flex; flex-direction: column; gap: 10px; background: var(--paper); color: var(--ink); border-radius: 24px; padding: 14px; box-shadow: 0 6px 0 var(--line); border: 6px double #C9A867; }
.ayah-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 16px; border: 3px solid transparent; background: transparent; color: var(--ink); cursor: pointer; text-align: center; }
.ayah-row:hover { background: #F6ECD5; }
.ayah-row.now { border-color: var(--jade); background: #E3F4EE; }
.ayah-row.bism { justify-content: center; }
.ar-bism { font-size: 1.8rem; line-height: 2; color: #7A5A1A; }
.ay-n { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-top: 10px; border-radius: 50%; border: 2px solid #B98420; color: #7A5A1A; font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums; }
.ay-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ay-ar { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 2.1; }
.ay-mean { font-size: .95rem; color: #5A4A2A; }
.ayah-list.hide-meaning .ay-mean { display: none; }
.ayah-list.hide-text .ay-ar { filter: blur(9px); transition: filter .2s; }
.ayah-list.hide-text .ayah-row:hover .ay-ar, .ayah-list.hide-text .ayah-row.now .ay-ar { filter: none; }
.q-practice { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.qp-btn { --c: var(--jade); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 18px; border: 3px solid var(--line); background: var(--ground-2); color: var(--fg); cursor: pointer; box-shadow: 0 4px 0 var(--shadow); }
.qp-btn b { font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; }
.player-bar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px); border-top: 3px solid var(--line); }
.pl-row { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pl-main { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--gold); color: #1F1605; font-size: 1.8rem; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 var(--gold-deep); }
.pl-main.on { background: var(--jade); color: #fff; box-shadow: 0 4px 0 #11695A; }
.pl-skip { width: 46px; height: 46px; }
.pl-opts { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; justify-content: center; }
.pl-opts label { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.pl-opts small { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pl-chip { min-width: 64px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--jade); background: #DDF7EE; color: var(--fg); font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-variant-numeric: tabular-nums; }
.pl-sel { min-height: 40px; width: auto; padding: 0 10px; font-size: .95rem; border-radius: 999px; background: #DDF7EE; border-color: var(--jade); }
.note.small { font-size: .8rem; }
.learned-btn .ico { margin-right: 2px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .belt-path { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .step-arrow { display: none; }
  .lp-node { width: 78px; }
  .lpn-dot { width: 50px; height: 50px; font-size: 1.3rem; }
  .lp-node::before { top: 23px; }
  .rh-explain span:not(.ico) { display: none; }
  .rh-explain { padding: 0 10px; }
  .q-hero { flex-direction: column; text-align: center; }
  .qh-orn { width: 84px; height: 84px; }
  .pl-opts { width: 100%; }
  .belt-path { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lane-btn { width: 56px; height: 56px; }
  .sort-stage { grid-template-columns: 1fr 1fr; grid-template-areas: "card card" "a b"; }
  .sort-card-slot { grid-area: card; min-height: 170px; }
  .bin-0 { grid-area: a; min-height: 130px; }
  .bin-1 { grid-area: b; min-height: 130px; }
  .mem-grid, .mem-grid.small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mcard { max-height: 21vh; }
  .room-head { flex-wrap: wrap; row-gap: 6px; }
  .mission-dots { order: 3; width: 100%; justify-content: center; }
  .smith-card .mini-play, .sort-card .mini-play { top: 6px; right: 6px; }
  .smith-card { padding: 18px 16px; width: 100%; }
  .smith-line .slot:not(.big) { min-width: 1.1em; font-size: 2rem; }
  .tile-l { width: 58px; height: 64px; font-size: 2rem; }
  .whack-grid { gap: 8px; padding: 10px; }
  .wt-goal { min-width: 56px; height: 54px; }
  .wt-glyph.ar { font-size: 2rem; }
  .boss-arena { padding: 8px 10px; }
  .mission-dots .md { width: 28px; height: 28px; font-size: .85rem; }
  .lc-foot { flex-direction: column; align-items: stretch; }
  .mission-btn { justify-content: flex-start; }
  .chest-btn { top: 10px; right: 10px; }
  .blitz-btn { min-height: 70px; font-size: 1.4rem; }
  .ex-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .belt-hero { grid-template-columns: 1fr; padding: 16px 16px 16px 22px; }
  .bh-sensei .bubble { margin-bottom: 18px; }
  .tb-name { font-size: 1.15rem; }
  .tb-nav { gap: 6px; }
  .room-tile { min-height: 140px; padding: 14px; }
  .rt-name { font-size: 1.4rem; }
  .rh-title small { display: none; }
  .prompt-bar { min-height: 64px; }
  .pb-speaker { width: 46px; height: 46px; }
  .opt { min-height: 62px; }
  .opt-grid[data-n="3"] { grid-template-columns: 1fr; }
  .q-speaker { width: 80px; height: 80px; }
  .lc-title { font-size: 1.6rem; }
}
@media (max-width: 420px) {
  .belt-path { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tb-stats .chip { padding: .3em .55em; }
  .hearts { font-size: 1.2rem; }
  .duel-arena .ninja { width: 48px !important; height: 48px !important; }
}
@media (max-height: 560px) {
  .duel-arena { display: none; }
  .ec-glyph { font-size: 4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .ring.go .r-fg { animation: ringfill var(--secs, 3s) linear forwards !important; }
}

/* ================= v4: kid-friendly cartoon finish ================= */
:root { --muted: #4D5C82; }
.section-title, .page-title { color: var(--ink); text-shadow: 0 2px 0 rgba(255, 255, 255, .7); }
.section-title { font-size: 1.7rem; font-weight: 800; letter-spacing: 0; }
.page-title { font-size: clamp(2.4rem, 7vw, 3.4rem); font-weight: 800; }
.eyebrow { color: var(--muted); font-weight: 800; }
.note { color: var(--muted); font-weight: 600; }

/* chunky cartoon buttons */
.btn { background: #fff; color: var(--ink); border: 3px solid var(--line); box-shadow: 0 5px 0 var(--shadow); border-radius: 16px; font-weight: 800; }
.btn:active { box-shadow: 0 2px 0 var(--shadow); }
.btn.primary { background: var(--gold); color: var(--ink); border-color: var(--line); box-shadow: 0 5px 0 var(--shadow); }
.btn.primary:active { box-shadow: 0 2px 0 var(--shadow); }
.btn.ghost { background: #fff; }
.btn.paper { background: var(--paper-2); color: var(--ink); border-color: var(--line); box-shadow: 0 5px 0 var(--shadow); }
.btn.danger { background: #FFE1DE; color: #A3261C; border-color: var(--line); }
.btn.big { font-size: 1.2rem; border-radius: 20px; }
.icon-btn { background: #fff; border: 3px solid var(--line); box-shadow: 0 4px 0 var(--shadow); color: var(--ink); }
.chip { background: #fff; border: 3px solid var(--line); box-shadow: 0 3px 0 var(--shadow); color: var(--ink); font-weight: 800; }
.chip.gold { color: #C27C00; } .chip.ember { color: #E2453A; } .chip.jade { color: #0E8E69; }
.chip b { color: var(--ink); }
.lang-toggle { background: #fff; border: 3px solid var(--line); box-shadow: 0 3px 0 var(--shadow); }
.lang-toggle button.on { color: var(--ink); }
input[type="text"], select { background: #fff; color: var(--ink); border: 3px solid var(--line); }

/* every card gets a cartoon outline */
.lesson-card, .item-card, .echo-card, .q-big, .order-line, .sort-card, .smith-card, .blitz-card, .mc-front, .ear-opt, .bubble, .acard.have,
.weak-item, .toast, .wchip, .ex-btn, .new-ninja, .profile-card, .game-tile, .room-tile, .shop-item, .panel, .kid, .surah-card, .rc, .qp-btn, .modal-card {
  border: 3px solid var(--line);
}
.lesson-card, .item-card, .echo-card, .q-big, .sort-card, .smith-card, .blitz-card, .ear-opt, .order-line, .profile-card, .game-tile, .room-tile, .shop-item, .surah-card, .qp-btn, .rc {
  box-shadow: 0 6px 0 var(--shadow);
}
.modal-card { box-shadow: 0 10px 0 var(--shadow); border-radius: 28px; }
.panel, .kid { box-shadow: 0 5px 0 var(--shadow); }
.kid { border-radius: 18px; padding: 12px; }
.lesson-card { background: var(--paper); border-radius: 28px; }
.bubble { border-width: 3px; box-shadow: 0 4px 0 var(--shadow); font-weight: 700; }
.bubble::before { left: -12px; border-right-color: var(--line); }
.toast { box-shadow: 0 5px 0 var(--shadow); }

/* start screen logo: chunky game logo */
.hero-ar { color: rgba(255, 255, 255, .55); }
.logo span { color: #fff; text-shadow: 0 6px 0 var(--line), 3px 3px 0 var(--line), -3px 3px 0 var(--line), 3px -3px 0 var(--line), -3px -3px 0 var(--line), 0 -3px 0 var(--line), 3px 0 0 var(--line), -3px 0 0 var(--line); letter-spacing: .02em; }
.logo .logo-b { color: var(--gold); transform: rotate(-3deg); text-shadow: 0 6px 0 var(--line), 3px 3px 0 var(--line), -3px 3px 0 var(--line), 3px -3px 0 var(--line), -3px -3px 0 var(--line), 0 -3px 0 var(--line), 3px 0 0 var(--line), -3px 0 0 var(--line); }
.tagline { color: var(--ink); font-weight: 800; font-size: 1.1rem; }
.profile-card { background: #fff; }
.profile-card.add { background: rgba(255, 255, 255, .55); border-style: dashed; box-shadow: none; }
.profile-card .plus { color: var(--ink); }
.swatch { border-color: var(--line); }
.swatch.on { border-color: var(--line); box-shadow: 0 0 0 5px var(--gold); }

/* top bar */
.tb-name { color: var(--ink); font-size: 1.5rem; }
.tb-ninja .ninja { background: #fff; border: 3px solid var(--line); border-radius: 50%; box-shadow: 0 3px 0 var(--shadow); }

/* hub */
.belt-hero { background: #fff; border: 3px solid var(--line); box-shadow: 0 6px 0 var(--shadow); border-radius: 28px;
  background-image: radial-gradient(circle at 92% 18%, rgba(255, 201, 60, .35), transparent 35%), radial-gradient(circle at 70% 110%, rgba(99, 199, 255, .35), transparent 45%); }
.belt-hero::before { width: 12px; border-right: 3px solid var(--line); }
.bh-title { color: var(--ink); font-size: clamp(2.4rem, 6vw, 3.6rem); }
.bh-belt { filter: drop-shadow(0 5px 0 rgba(34, 48, 90, .55)); }
.bh-count { color: var(--muted); font-weight: 800; }
.chest-btn { border: 3px solid var(--line); box-shadow: 0 4px 0 var(--shadow); }
.lp-node { color: var(--ink); }
.lp-node::before { background: rgba(34, 48, 90, .25); height: 8px; border-radius: 4px; }
.lpn-dot { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 800; }
.lp-node.done .lpn-dot { border-color: var(--line); }
.lp-node.on .lpn-dot { background: var(--gold); border-color: var(--line); box-shadow: 0 0 0 6px rgba(255, 255, 255, .8), 0 4px 0 var(--shadow); }
.lp-node.locked .lpn-dot { background: #DDE6F5; color: #8592B3; }
.lpn-t { font-weight: 800; }
.step-btn { border: 3px solid var(--line); box-shadow: 0 5px 0 var(--shadow); }
.step-btn:active { box-shadow: 0 2px 0 var(--shadow); }
.step-btn.explain { background: var(--paper-2); border-color: var(--line); }
.step-btn.explain.next { border-color: var(--line); box-shadow: 0 0 0 5px rgba(255, 201, 60, .7), 0 5px 0 var(--shadow); }
.step-btn.mission { background: var(--good); color: #fff; }
.step-btn.mission .sb-t small, .step-btn.mission .sb-t em { color: rgba(255, 255, 255, .92); opacity: 1; }
.step-btn.mission.next { border-color: var(--line); box-shadow: 0 0 0 5px rgba(44, 197, 111, .35), 0 5px 0 var(--shadow); }
.step-btn.mission.locked { background: #DDE6F5; color: #6B7899; opacity: 1; }
.step-btn.mission.locked .sb-t small, .step-btn.mission.locked .sb-t em { color: #6B7899; }
.sb-n { border: 3px solid var(--line); color: var(--ink); }
.step-btn.locked .sb-n { background: #fff; color: #8592B3; }
.step-arrow { color: var(--line); }
.mission-btn { background: var(--good); color: #fff; border: 3px solid var(--line); box-shadow: 0 5px 0 var(--shadow); }
.mission-btn .mb-text small { color: rgba(255, 255, 255, .9); }
.mb-icon { border: 3px solid var(--line); color: var(--ink); }
.lp-bar { background: #E5ECF8; border: 2px solid var(--line); height: 16px; border-radius: 8px; }
.lp-bar i { background: linear-gradient(90deg, #FFC93C, #FFB020); border-radius: 6px; }
.lc-progress small { color: var(--muted); font-weight: 800; }
.game-tile { background: #fff; border-radius: 22px; }
.game-tile::after { opacity: .22; }
.gt-icon, .rt-icon, .gi-icon { border: 3px solid var(--line); box-shadow: 0 3px 0 var(--shadow); color: #fff; }
.gt-name { color: var(--ink); font-size: 1.35rem; }
.gt-desc { color: var(--muted); font-weight: 600; }
.games-grid.locked .game-tile { filter: grayscale(.7); opacity: .7; }
.exam-btn { background: #fff; border: 3px dashed var(--line); color: var(--ink); }
.exam-btn.ready { border-style: solid; background: #FFF4CF; box-shadow: 0 5px 0 var(--shadow); }
.exam-btn.passed { border-style: solid; border-color: var(--line); background: #E3F9EE; }
.ex-icon { border: 3px solid var(--line); }
.ex-text small { color: var(--muted); font-weight: 700; }
.bp-belt { background: #fff; color: var(--ink); font-weight: 800; }
.bp-belt.on { border-color: var(--line); background: #FFF4CF; box-shadow: 0 4px 0 var(--shadow); }
.bp-belt i { border: 2px solid var(--line); }

/* bottom navigation */
.main-nav { box-shadow: 0 5px 0 var(--shadow); }
.bn-item { color: var(--muted); font-weight: 800; }
.bn-item.on { color: var(--ink); }
.bn-item.on .bn-ico { background: var(--gold); color: var(--ink); box-shadow: 0 0 0 3px var(--line); }

/* learning cards */
.rule-card { background: #fff; border: 3px solid var(--line); border-left: 10px solid var(--belt); box-shadow: 0 5px 0 var(--shadow); border-radius: 22px; }
.rule-text { color: var(--ink); font-weight: 700; font-size: 1.12rem; }
.item-card { background: var(--paper); }
.item-card:active { box-shadow: 0 3px 0 var(--shadow); }
.ic-tr, .ec-tr, .smith-name, .smith-mean { color: #8A5A00; }
.ic-forms .f { background: #FFE9B8; border: 2px solid var(--line); }
.dots i { background: rgba(34, 48, 90, .25); }
.dots i.on { background: var(--ink); }
.ls-tab { background: #fff; color: var(--ink); }

/* game screens */
.room-head .rh-title > .rh-name { color: var(--ink); }
.rh-title .ico { color: var(--ink); }
.rh-title small { color: var(--muted); font-weight: 700; }
.score { color: var(--ink); text-shadow: 0 2px 0 #fff; }
.hearts { color: #C9D3E6; }
.stars { color: #C9D3E6; }
.prompt-bar, .brush-info, .whack-target { background: #fff; border: 3px solid var(--line); box-shadow: 0 5px 0 var(--shadow); color: var(--ink); }
.pb-speaker, .q-speaker { border: 3px solid var(--line); box-shadow: 0 4px 0 var(--shadow); color: var(--ink); }
.pb-text small { color: var(--muted); font-weight: 800; }
.pv-tr { color: #C27C00; }
.pv-ar { color: var(--ink); }
.pv-cat { background: var(--ground-3); border: 2px solid var(--line); }
.stage { border: 3px solid var(--line); box-shadow: 0 6px 0 var(--shadow); }
.combo-pop { color: #fff; text-shadow: 0 4px 0 var(--line), 2px 2px 0 var(--line), -2px 2px 0 var(--line), 2px -2px 0 var(--line), -2px -2px 0 var(--line); }
.timer { background: #fff; border: 3px solid var(--line); height: 14px; border-radius: 8px; }
.timer i { background: var(--good); border-radius: 6px; }
.timer.low i { background: var(--bad); }
.opt { background: #fff; color: var(--ink); border: 3px solid var(--line); box-shadow: 0 5px 0 var(--shadow); border-radius: 20px; }
.opt.k-ui span { font-weight: 800; }
.opt.right { background: #D8F7E4; border-color: #138A4B; }
.opt.wrong { background: #FFE1DE; border-color: #C2342A; }
.q-label { color: var(--muted); font-weight: 800; }
.q-prompt { color: var(--ink); font-weight: 800; font-size: 1.3rem; }
.q-big { background: var(--paper); }
.q-big.q-listen { border: 0; box-shadow: none; background: transparent; }
.game-intro h2 { color: var(--ink); }
.game-intro p { color: var(--ink); font-weight: 700; }
.mission-dots .md { background: #fff; border: 3px solid var(--line); color: var(--muted); }
.mission-dots .md.on { background: var(--gold); color: var(--ink); border-color: var(--line); }
.mission-dots .md.done { background: var(--good); color: #fff; border-color: var(--line); }
.me-row { background: var(--ground-3); border: 2px solid var(--line); }
.res-gain { color: #C27C00; font-weight: 800; }
.result h2, .ceremony h2, .gate h2, .chest-open h2 { color: var(--ink); }
.new-stripe { background: var(--ground-3); border: 2px solid var(--line); }
.nw-chip { border: 2px solid var(--line); }
.new-words small { color: #0E8E69; }

/* game pieces */
.word-tile, .tile-l { background: #fff; color: var(--ink); border: 3px solid var(--line); box-shadow: 0 4px 0 var(--shadow); }
.order-bank .word-tile .qr, .word-tile .ar { color: var(--ink); }
.order-line { background: var(--paper); }
.slot { color: #B9A57E; border-bottom-color: #B9A57E; }
.bin { background: #fff; color: var(--ink); border: 4px dashed var(--line); }
.bin small { color: var(--muted); font-weight: 800; }
.bin-count { color: #C27C00; }
.bin.glow { background: #D8F7E4; border-color: #138A4B; }
.bin.bad { background: #FFE1DE; border-color: #C2342A; }
.bin.hint { border-color: #138A4B; }
.sort-card { background: var(--paper); }
.smith-card { background: var(--paper); }
.mc-back { border: 3px solid var(--line); color: #FFE27A; box-shadow: 0 4px 0 var(--shadow); }
.mc-front { background: var(--paper); }
.blitz-card { background: var(--paper); }
.blitz-label { color: var(--ink); font-weight: 800; }
.blitz-btn { border: 3px solid var(--line); box-shadow: 0 5px 0 var(--shadow); color: #fff; text-shadow: 0 2px 0 rgba(34, 48, 90, .5); }
.blitz-combo { color: #fff; text-shadow: 0 3px 0 var(--line); }
.echo-status, .echo-status b { color: var(--ink); }
.ear-opt { background: var(--paper); }
.ring .r-bg { stroke: #DDE6F5; }
.boss-arena { background-color: #fff; border: 3px solid var(--line); box-shadow: 0 5px 0 var(--shadow); }
.boss-name { color: var(--ink); }
.hpbar { border: 3px solid var(--line); background: #FFE1DE; }
.ei-bossname { color: #C27C00; }
.trace-pop b { color: #fff; text-shadow: 0 3px 0 var(--line); }

/* collection, shop, parent */
.acard { background: rgba(255, 255, 255, .55); border: 3px dashed rgba(34, 48, 90, .35); color: var(--muted); }
.acard.have { background: var(--paper); box-shadow: 0 4px 0 var(--shadow); }
.coll-count .lp-bar { background: #fff; }
.tab { background: #fff; border: 3px solid var(--line); color: var(--ink); font-weight: 800; }
.tab.on { background: var(--gold); border-color: var(--line); box-shadow: 0 3px 0 var(--shadow); }
.shop-item { background: #fff; }
.shop-item.on { background: #FFF4CF; border-color: var(--line); }
.panel { background: #fff; border-radius: 22px; }
.panel h2 { color: var(--ink); }
.set-row { border-bottom: 2px solid #E5ECF8; color: var(--ink); font-weight: 700; }
.switch { background: #C9D3E6; border: 2px solid var(--line); }
.switch::after { background: #fff; border: 2px solid var(--line); top: 2px; left: 2px; }
.kb { background: var(--ground-3); border: 2px solid var(--line); }

/* Quran (calm but bright) */
.q-hero h1, .q-hero .eyebrow { color: #fff; text-shadow: 0 3px 0 rgba(34, 48, 90, .45); }
.qh-orn { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .15); }
.rc { background: #fff; color: var(--ink); }
.rc.on { background: #DDF7EE; border-color: var(--line); box-shadow: 0 0 0 4px rgba(25, 185, 139, .45), 0 6px 0 var(--shadow); }
.surah-card { background: #fff; }
.surah-card.learned { background: #E3F9EE; border-color: var(--line); }
.sc-num { border-color: #C27C00; color: #C27C00; background: #FFF4CF; }
.sc-ar, .sh-ar { color: #C27C00; }
.sh-title b { color: var(--ink); }
.qt { background: #fff; border: 3px solid var(--line); color: var(--muted); }
.qt.on { background: var(--jade); color: #fff; border-color: var(--line); }
.ayah-list { border: 3px solid var(--line); box-shadow: 0 6px 0 var(--shadow); }
.qp-btn { background: #fff; color: var(--ink); }
.pl-chip, .pl-sel { background: #fff; color: var(--ink); border: 3px solid var(--line); }
.pl-main { border: 3px solid var(--line); box-shadow: 0 4px 0 var(--shadow); color: var(--ink); }
.pl-main.on { box-shadow: 0 4px 0 var(--shadow); }

@media (prefers-reduced-motion: reduce) { .logo .logo-b { transform: none; } }

.sort-card .sc-ar { font-size: clamp(3rem, 12vw, 4rem); line-height: 1.4; color: var(--ink); }
.sh-ar { display: block; margin-bottom: 6px; }

/* ===== v5: letter shapes in real words, Shape hunt, clear win / lose ===== */
.ic-forms { align-items: stretch; }
.ic-forms.two { grid-template-columns: repeat(2, 1fr); }
.ic-forms .f { gap: 2px; padding: 6px 4px 8px; justify-content: flex-start; }
.ic-forms .f small { font-weight: 800; color: #6A4A00; }
.f-ex { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; margin-top: 4px; padding: 4px 2px 6px; border: 2px dashed #E3B860; border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; direction: ltr; min-height: 44px; }
.f-ex:hover { border-style: solid; }
.f-ex:active { transform: translateY(1px); }
.f-em { font-size: 1.7rem; line-height: 1.2; }
.f-word { font-size: 1.65rem; line-height: 1.5; }
.f-ex small { font-size: .7rem; font-weight: 700; color: #6A5A3A; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.hl-word { color: var(--ink); }
.hl-word .hl { color: #E0457B; }
.gap-word { display: inline-flex; align-items: center; gap: 2px; direction: rtl; font-size: clamp(2.6rem, 9vw, 3.6rem); line-height: 1.5; }
.gap-word .ar { color: var(--ink); }
.gap-slot { display: inline-grid; place-items: center; min-width: 1.15em; height: 1.15em; padding: 0 .1em; border: 4px dashed #E0457B; border-radius: 16px; background: #FFF0F5; color: #E0457B; font-family: var(--f-display); font-weight: 800; font-size: .72em; line-height: 1; animation: gapPulse 1.4s ease-in-out infinite; }
@keyframes gapPulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .gap-slot { animation: none; } }
.shape-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; width: 100%; min-height: 100%; padding: 12px 4px 20px; }
.shape-card { min-width: min(100%, 360px); }
.shape-line { min-height: 1.6em; display: flex; align-items: center; justify-content: center; }
.shape-full { font-size: clamp(2.6rem, 9vw, 3.6rem); line-height: 1.5; animation: popIn .35s ease-out; }
@keyframes popIn { from { transform: scale(.8); opacity: .3; } }
.shape-hint { margin: 0; min-height: 1.3em; font-weight: 800; color: #8A5A00; text-align: center; max-width: 34ch; }
.shape-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: min(100%, 640px); direction: rtl; }
.shape-opts:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 360px); }
.shape-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 104px; padding: 6px 4px; }
.shape-glyph { font-size: clamp(2.6rem, 8vw, 3.4rem); line-height: 1.4; }
.shape-label { font-size: .8rem; font-weight: 800; color: #6A5A3A; direction: ltr; visibility: hidden; }
.shape-opt.show-label .shape-label { visibility: visible; }
.opt.hint { border-color: #138A4B; border-style: dashed; animation: hintPulse 1s ease-in-out infinite; }
@keyframes hintPulse { 50% { transform: translateY(-3px); } }
@media (max-width: 560px) {
  .shape-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ic-forms:not(.two) { grid-template-columns: repeat(2, 1fr); }
}
.res-sub { margin: -2px 0 0; font-weight: 800; color: #8A5A00; }
.result.lost h2 { color: #C2342A; }
.result.lost .big-stars { opacity: .55; }
.me-row.miss { background: #FFE1DE; }

/* ===== v6: 3D stages for Slash, Window whack and the Boss fight ===== */
.slash3d { background: #E9A2B0; }
.trail3d { z-index: 2; }
.slash3d .combo-pop { z-index: 3; }
.whack3d { background: #A8DBFF; cursor: pointer; }
.whack3d .arena3d { cursor: pointer; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.fx-layer .float-pt { transform: translate(-50%, 0); }
.whack3d .whack-banner { z-index: 4; }
.boss-arena.a3d { display: block; height: clamp(170px, 30vh, 280px); padding: 0; background: #2A2550; }
.boss-arena.a3d .boss3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.boss-arena.a3d .bf-you { position: absolute; left: 10px; bottom: 8px; z-index: 1; padding: 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, .85); border: 2px solid var(--line); }
.boss-arena.a3d .bf-you .ninja { display: none; }
.boss-arena.a3d .bf-boss { position: absolute; right: 10px; bottom: 8px; z-index: 1; padding: 6px 10px; border-radius: 14px; background: rgba(255, 255, 255, .85); border: 2px solid var(--line); min-width: min(46%, 220px); }
.boss-arena.a3d .boss-fig { display: none; }
.boss-arena.a3d .slash-fx { display: none; }
.boss-arena.a3d .crit { z-index: 2; top: 12%; right: 22%; }
@media (max-width: 560px) { .boss-arena.a3d { height: clamp(150px, 26vh, 210px); } }
.sort3d { background: #BDE6FF; min-height: 320px; }
.sort3d .arena3d { cursor: pointer; }
.bin.bin3d { position: absolute; z-index: 2; transform: translate(-50%, 0); min-height: 0; height: auto; max-height: none; width: min(42%, 220px); padding: 6px 10px; border-width: 3px; border-style: solid; border-radius: 16px; flex-direction: row; gap: 10px; box-shadow: 0 4px 0 var(--shadow); }
.bin.bin3d small { font-size: .85rem; line-height: 1.15; }
.bin.bin3d .bin-count { font-size: 1.3rem; }
.sort3d-play { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2; }

/* ===== v7: nav under the top bar; room at the bottom for host overlays when signed out ===== */
.main-nav .bn-item { min-height: 50px; }
html.host-guest .screen { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
html.host-guest .screen.room { padding-bottom: 92px; }
.leave-box .res-actions { justify-content: center; }
html.host-guest .player-bar { bottom: 92px; left: 10px; right: 10px; border: 3px solid var(--line); border-radius: 20px; padding-bottom: 10px; }
html.host-guest .screen.surah { padding-bottom: 220px; }
html.host-guest .toast { bottom: 100px; }

/* ===== v8: accessibility (contrast, headings, item card button) ===== */
.sh-name { margin: 0; font-size: 1.05rem; font-weight: 800; font-family: var(--f-body, inherit); }
.step-btn.mission.locked { color: #46516E; }
.step-btn.mission.locked .sb-t small, .step-btn.mission.locked .sb-t em { color: #46516E; }
.ex-more { color: #8A5A00; }
.tag { color: #7A4F00; }
.shop-item.on .tag { color: #7A4F00; }
.btn.dim { opacity: 1; color: #4A5470; background: #EEF1F7; }
.sc-num { color: #8A5A00; border-color: #B07400; }
.res-gain { color: #8A5A00; }
.qt.on { background: #0E7F5F; color: #fff; }
.item-card { position: relative; }
.ic-play { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--line); background: var(--gold); color: var(--ink); font-size: 1.1rem; cursor: pointer; box-shadow: 0 3px 0 var(--shadow); }
.item-card:not(.big) .ic-play { width: 32px; height: 32px; font-size: .9rem; top: 6px; right: 6px; }

/* ===== v8: medals, Sensei's tip ===== */
.medal-toast { position: fixed; z-index: 80; top: max(14px, env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 12px; border-radius: 999px; border: 3px solid var(--line); background: #FFF4CF; color: var(--ink); box-shadow: 0 6px 0 var(--shadow); cursor: pointer; font: inherit; animation: medalIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.medal-toast.out { animation: medalOut .4s ease-in both; }
.mt-em { font-size: 2.2rem; line-height: 1; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #fff; border: 3px solid var(--line); }
.mt-text { display: flex; flex-direction: column; text-align: left; }
.mt-text small { font-weight: 800; color: #8A5A00; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.mt-text b { font-family: var(--f-display); font-size: 1.25rem; line-height: 1.1; }
@keyframes medalIn { from { transform: translate(-50%, -120%); } }
@keyframes medalOut { to { transform: translate(-50%, -140%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .medal-toast, .medal-toast.out { animation: none; } }
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px; border-radius: 20px; border: 3px dashed #9AA6C4; background: rgba(255, 255, 255, .7); color: #46516E; }
.medal.have { border: 3px solid var(--line); background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--shadow); }
.md-em { font-size: 2.4rem; line-height: 1.2; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #EEF1F7; }
.medal.have .md-em { background: #FFE9A8; box-shadow: inset 0 0 0 3px #E39A00; }
.medal b { font-family: var(--f-display); font-size: 1.05rem; line-height: 1.1; }
.medal small { font-size: .8rem; font-weight: 600; line-height: 1.25; }
.sensei-tip { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 16px; border-radius: 24px; border: 3px solid var(--line); background: #FFF8E7; box-shadow: 0 6px 0 var(--shadow); }
.st-head { display: flex; align-items: center; gap: 12px; }
.st-head h2 { margin: 0; font-family: var(--f-display); font-size: 1.35rem; line-height: 1.1; }
.st-head .eyebrow { color: #8A5A00; }
.tip-chips { display: flex; flex-wrap: wrap; gap: 8px; direction: rtl; }
.tip-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 16px; border: 3px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--shadow); font: inherit; }
.tip-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }
.tc-em { font-size: 1.4rem; }
.tc-ar { font-size: 1.7rem; line-height: 1.5; }
.sensei-tip > .btn { align-self: flex-start; }
.set-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; margin: 4px 0; border-radius: 12px; background: #FFF4CF; font-size: .9rem; font-weight: 600; }
.step-btn.mission { background: #12804A; }
.step-btn.mission.locked { background: #DDE6F5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.modal-card.sheet-card { width: min(100%, 720px); }
.letter-sheet { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-height: 84vh; overflow-y: auto; overflow-x: hidden; }
.letter-sheet .item-card.big { width: 100%; }
.sheet-body { width: 100%; display: flex; justify-content: center; }
:focus-visible { outline: 4px solid #22305A; outline-offset: 3px; }
.btn.primary:focus-visible, .step-btn:focus-visible { outline-color: #22305A; }

/* ===== v9: answer buttons for canvas games (shown when a keyboard reaches them), help sheet ===== */
.a11y-answers { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 6; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px; border-radius: 18px; background: rgba(255, 255, 255, .96); border: 3px solid var(--line); box-shadow: 0 5px 0 var(--shadow);
  clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.a11y-answers:focus-within { clip-path: none; width: auto; height: auto; overflow: visible; white-space: normal; }
.a11y-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 4px 14px; border-radius: 14px; border: 3px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.a11y-face { font-size: 1.6rem; line-height: 1.4; }
.a11y-n { font-size: .9rem; }
.modal-card.help-card { width: min(100%, 860px); }
.help-sheet { display: flex; flex-direction: column; gap: 12px; }
.help-sheet h2 { margin: 0; font-family: var(--f-display); font-size: 1.6rem; line-height: 1.1; }
.help-sheet .rule-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 18px; background: #FFF8E7; border: 3px solid var(--line); }
.help-sheet .rule-text { margin: 0 0 8px; }
.help-grid { max-height: 46vh; overflow-y: auto; padding: 4px; }
.help-foot { display: flex; justify-content: center; }

/* ================= school edition: pupil sign-in, tests, teacher area ================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.linkish { background: none; border: 0; padding: 4px 2px; color: #1F4FB8; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 700; min-height: 32px; text-align: start; }
.linkish.strong { color: var(--ink); text-decoration-thickness: 2px; }
input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea {
  background: #fff; color: var(--ink); border: 3px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; width: 100%; min-height: 48px;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.ar-input { font-family: var(--f-ar); font-size: 1.35rem; }
.muted { color: var(--muted); }
.err { color: #B3261E; font-weight: 700; }
.ok { color: #12804A; } .miss { color: #A3261C; }

/* ---------- welcome and pupil sign-in ---------- */
.welcome .who-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; width: 100%; max-width: 720px; margin: 0 auto; }
.who-btn { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: #fff; border: 3px solid var(--line); border-radius: 24px; box-shadow: 0 6px 0 var(--shadow); cursor: pointer; text-align: start; min-height: 104px; }
.who-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--shadow); }
.who-btn.pupil { background: var(--gold); }
.who-btn b { display: block; font-family: var(--f-display); font-size: 1.45rem; line-height: 1.1; }
.who-btn small { display: block; color: var(--ink); opacity: .85; font-weight: 700; }
.who-btn svg { flex: none; }
.demo-note { max-width: 720px; margin: 0 auto; background: var(--paper); border: 3px dashed var(--line); border-radius: 18px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.demo-note p { margin: 0; }
.code-form { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 420px; margin: 0 auto; background: #fff; border: 3px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: 0 6px 0 var(--shadow); }
.lbl.big { font-family: var(--f-display); font-size: 1.4rem; color: var(--ink); }
.code-input { text-align: center; font-family: var(--f-display); font-size: 2.4rem !important; letter-spacing: .3em; text-transform: uppercase; padding: 8px 4px 8px calc(4px + .3em) !important; min-height: 72px; }
.section-title.center { text-align: center; }
.profile-grid.names { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.profile-grid.names .profile-card { min-height: 130px; }
.pin-card { width: min(100%, 400px); }
.pin-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pin-box h2 { margin: 0; font-family: var(--f-display); font-size: 1.6rem; }
.pin-dots { display: flex; gap: 14px; }
.pin-dots i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); background: #fff; transition: background .12s; }
.pin-dots i.on { background: var(--ink); }
.pin-dots.shake { animation: pinshake .4s; }
@keyframes pinshake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pin-msg { margin: 0; min-height: 1.5em; font-weight: 700; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.pin-key { height: 66px; border-radius: 18px; border: 3px solid var(--line); background: #fff; box-shadow: 0 4px 0 var(--shadow); font-family: var(--f-display); font-size: 1.8rem; font-weight: 800; cursor: pointer; }
.pin-key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.pin-key.del { background: var(--paper-2); }
.pin-box.busy .pin-keys { opacity: .5; pointer-events: none; }
.me-box { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.me-box h2 { margin: 0; }
.first-band { align-items: center; }
html.ln-offline .topbar::after { content: "offline"; font-size: .75rem; font-weight: 800; color: #fff; background: var(--muted); border-radius: 8px; padding: 2px 8px; }

/* bottom nav badge */
.bn-ico { position: relative; }
.bn-badge { position: absolute; top: -6px; right: -10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ember); color: #fff; font-size: .72rem; line-height: 20px; text-align: center; border: 2px solid #fff; }
.bn-badge[hidden] { display: none; }
@media (max-width: 420px) { .bn-item { font-size: .72rem; } }

/* ---------- pupil tests ---------- */
.exam-cards { display: flex; flex-direction: column; gap: 12px; }
.exam-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; background: #fff; border: 3px solid var(--line); border-radius: 20px; box-shadow: 0 5px 0 var(--shadow); text-align: start; }
button.exam-card { cursor: pointer; }
button.exam-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--shadow); }
.exam-card .ec-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; background: var(--ground-3); border: 3px solid var(--line); flex: none; }
.exam-card.open .ec-icon { background: var(--gold); }
.exam-card.done .ec-icon { background: #C9F3DB; }
.exam-card.fresh { border-color: var(--good); }
.exam-card .ec-text { flex: 1; display: flex; flex-direction: column; }
.exam-card b { font-family: var(--f-display); font-size: 1.2rem; line-height: 1.2; }
.exam-card small { color: var(--muted); font-weight: 700; }
.exam-card .ec-due { color: #A3261C; }
.exam-card.closed, .exam-card.waiting { opacity: .85; box-shadow: none; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 24px; color: var(--muted); font-weight: 700; }
.exam-take, .exam-result-view { max-width: 820px; }
.exam-top { flex-wrap: nowrap; }
.exam-top .page-title { flex: 1; font-size: 1.3rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.et-saved { font-size: .85rem; font-weight: 800; color: #12804A; white-space: nowrap; }
.et-saved.busy { color: var(--muted); }
.et-body { display: flex; flex-direction: column; gap: 16px; }
.et-dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.et-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.et-dots i.done { background: var(--jade); }
.et-dots i.on { outline: 3px solid var(--gold); outline-offset: 1px; }
.et-card { background: #fff; border: 3px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: 0 6px 0 var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.et-card.intro { align-items: center; text-align: center; }
.et-card h2 { margin: 0; font-family: var(--f-display); }
.et-instr { white-space: pre-wrap; font-size: 1.1rem; margin: 0; }
.qv { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.qv-head { display: flex; align-items: flex-start; gap: 10px; }
.qv-n { font-family: var(--f-display); font-weight: 800; }
.qv-prompt { flex: 1; margin: 0; font-size: 1.25rem; font-weight: 800; white-space: pre-wrap; }
.qv.compact .qv-prompt { font-size: 1.05rem; }
.qv-em { font-size: 4.2rem; line-height: 1; text-align: center; }
.qv.compact .qv-em { font-size: 2.6rem; }
.qv-ar { font-family: var(--f-ar); font-size: 2.6rem; line-height: 1.7; text-align: center; background: var(--paper); border: 3px solid var(--line); border-radius: 18px; padding: 6px 14px; }
.qv-ar.read { font-size: 3rem; }
.qv.compact .qv-ar { font-size: 1.9rem; }
.qv-hint { margin: 0; text-align: center; color: var(--muted); font-weight: 700; }
.et-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.et-opt { min-height: 72px; padding: 10px 14px; border: 3px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 5px 0 var(--shadow); font-size: 1.15rem; font-weight: 800; cursor: pointer; }
.et-opts.ar .et-opt { font-size: 2rem; }
.et-opt .opt-ar { font-family: var(--f-ar); font-size: 2rem; line-height: 1.5; }
.et-opt.on { background: var(--gold); outline: 4px solid var(--ink); outline-offset: -8px; }
.et-opt:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--shadow); }
.et-text { font-family: var(--f-ar); font-size: 1.8rem; min-height: 90px; }
.et-answer { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.et-answer > .btn { align-self: flex-start; }
.et-nav { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.et-review { margin: 0; padding-inline-start: 1.4em; display: flex; flex-direction: column; gap: 4px; }
.et-review b { margin-inline-start: 6px; }
.et-done { text-align: center; align-items: center; display: flex; flex-direction: column; gap: 10px; background: #fff; border: 3px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: 0 6px 0 var(--shadow); }
.ar-kbd { display: flex; flex-direction: column; gap: 6px; background: var(--ground-3); border: 3px solid var(--line); border-radius: 18px; padding: 8px; }
.ak-row { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.ak { min-width: 44px; height: 48px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-family: var(--f-ar); font-size: 1.5rem; cursor: pointer; padding: 0 6px; box-shadow: 0 3px 0 var(--shadow); }
.ak:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }
.ak.mark { background: var(--paper); }
.ak.space { min-width: 120px; }
.ak.del { min-width: 64px; font-family: var(--f-body); }
.rec { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rec-btn { background: #FFE1DE !important; }
.rec-btn .ico { color: #D0261A; }
.rec-btn.stop { background: #fff !important; }
.rec-btn.stop .ico { color: var(--ink); }
.rec-dot { width: 18px; height: 18px; border-radius: 50%; background: #D0261A; animation: recpulse 1s infinite; }
@keyframes recpulse { 50% { opacity: .3; } }
.rec-clock { font-family: var(--f-display); font-size: 1.6rem; min-width: 3.2em; }
.rec-status { flex-basis: 100%; font-weight: 700; color: var(--muted); min-height: 1.4em; }
.rec-audio { width: min(100%, 360px); height: 44px; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 4px solid var(--ground-3); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.score-card { align-items: center; text-align: center; }
.score-card.won { background: #EFFFF5; }
.score-big { font-family: var(--f-display); font-size: 3.4rem; font-weight: 800; line-height: 1; }
.score-big small { font-size: 1.6rem; color: var(--muted); }
.rq-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rq-pts { font-family: var(--f-display); font-size: 1.2rem; padding: 2px 12px; border-radius: 12px; border: 2px solid var(--line); }
.rq-pts.full { background: #C9F3DB; } .rq-pts.part { background: var(--paper-2); } .rq-pts.none { background: #FFE1DE; }
.ab { display: flex; flex-direction: column; gap: 8px; }
.ab-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ab-opt { display: inline-flex; flex-direction: column; align-items: center; min-width: 70px; padding: 6px 12px; border: 2px solid #C5CCE0; border-radius: 12px; background: #fff; }
.ab-opt .opt-ar { font-family: var(--f-ar); font-size: 1.6rem; line-height: 1.5; }
.ab-opt small { font-size: .75rem; font-weight: 800; }
.ab-opt.chosen { border-color: var(--ink); border-width: 3px; }
.ab-opt.right { background: #C9F3DB; border-color: #12804A; }
.ab-opt.wrong { background: #FFE1DE; border-color: #A3261C; }
.ab-text { font-size: 1.2rem; padding: 8px 12px; border: 2px solid #C5CCE0; border-radius: 12px; background: var(--ground-3); white-space: pre-wrap; }
.ab-text.ar { font-family: var(--f-ar); font-size: 1.8rem; }
.ab-model { margin: 0; font-weight: 700; }
.ab-model .ar { font-family: var(--f-ar); font-size: 1.5rem; }
.ab-feedback { background: var(--paper); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ab-feedback span { white-space: pre-wrap; }
.ab-feedback.big { width: 100%; text-align: start; font-size: 1.05rem; }

/* ---------- teacher area: calmer, denser ---------- */
#app[data-screen^="staff"] { background: #F2F6FB; }
.screen.staff { max-width: 1180px; gap: 14px; }
.staff-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 8px 12px; }
.st-brand { display: flex; align-items: baseline; gap: 8px; }
.st-brand b { font-family: var(--f-display); font-size: 1.3rem; letter-spacing: .02em; }
.st-brand b span { color: #9A5A00; }
.st-brand small { font-weight: 800; color: var(--muted); }
.staff-nav { display: flex; gap: 6px; }
.staff-nav button { display: inline-flex; align-items: center; gap: 4px; border: 2px solid transparent; background: none; border-radius: 10px; padding: 6px 12px; font-weight: 800; cursor: pointer; min-height: 44px; }
.staff-nav button.on { background: var(--gold); border-color: var(--line); }
.st-me { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.staff .btn { box-shadow: 0 3px 0 var(--shadow); border-width: 2px; }
.staff .btn.small { min-height: 40px; }
.staff .panel { border-width: 2px; box-shadow: 0 3px 0 rgba(34, 48, 90, .25); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-weight: 700; color: var(--muted); }
.crumbs > * + *::before { content: "›"; margin-inline-end: 6px; color: var(--muted); }
.crumbs .linkish { padding: 0; min-height: 0; }
.staff-main { display: flex; flex-direction: column; gap: 14px; }
.staff-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.staff-head h1 { margin: 0; font-family: var(--f-display); font-size: 1.7rem; display: flex; align-items: center; gap: 8px; }
.staff-card.narrow { max-width: 460px; margin: 20px auto; width: 100%; }
.staff-card h1 { margin: 0; font-family: var(--f-display); font-size: 1.5rem; }
.staff-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.staff-dlg { display: flex; flex-direction: column; gap: 12px; }
.staff-dlg h2 { margin: 0; }
.fld { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.fld > label, .lbl-s { font-weight: 800; font-size: .92rem; }
.fld .help { color: var(--muted); font-weight: 600; }
.fld.pts { flex: 0 0 auto; }
.banner { background: #FFF4CC; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner.warn { background: #FFE9D6; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.class-card { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 14px 16px; background: #fff; border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 3px 0 var(--shadow); cursor: pointer; }
.class-card b { font-family: var(--f-display); font-size: 1.3rem; }
.class-card.archived { opacity: .6; }
.cc-code, .code-chip b { font-family: var(--f-display); font-weight: 800; letter-spacing: .12em; }
.cc-code { align-self: flex-start; background: var(--paper-2); border: 2px solid var(--line); border-radius: 8px; padding: 0 8px; }
.cc-teachers { color: var(--muted); }
.code-chip { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 4px 12px; font-weight: 700; }
.code-big { font-family: var(--f-display); font-size: 2.6rem; letter-spacing: .2em; margin: 0; }
.staff-tabs .tab { border-width: 2px; }
.staff-tabs .tab.on { background: var(--gold); border-color: var(--line); }
.tab-body { display: flex; flex-direction: column; gap: 14px; }
.tool-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-row select { width: auto; min-height: 40px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-row.wrap { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.stat { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; }
.stat b { font-family: var(--f-display); font-size: 1.5rem; line-height: 1.2; }
.stat small { color: var(--muted); font-weight: 700; }
.table-wrap { overflow-x: auto; background: #fff; border: 2px solid var(--line); border-radius: 14px; }
.staff-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.staff-table th, .staff-table td { padding: 8px 10px; text-align: start; border-bottom: 1px solid #DDE3EF; vertical-align: middle; }
.staff-table thead th { background: var(--ground-3); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink); white-space: nowrap; }
.staff-table tbody th { font-weight: 800; white-space: nowrap; }
.staff-table tbody th svg { vertical-align: middle; }
.staff-table tr.none { color: var(--muted); }
.staff-table td.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.staff-table tbody tr:hover { background: #F7FAFF; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pin-cell { font-family: var(--f-display); font-weight: 800; letter-spacing: .15em; }
.belt-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; white-space: nowrap; }
.belt-chip i { width: 26px; height: 10px; border-radius: 4px; background: var(--c); border: 1.5px solid var(--line); }
.meter { display: inline-flex; align-items: center; gap: 8px; }
.meter .track { display: block; width: 80px; height: 10px; border-radius: 5px; background: #E4EAF4; overflow: hidden; }
.meter .track i { display: block; height: 100%; background: var(--jade); min-width: 3px; }
.meter b { font-size: .85rem; }
.weak-chips { display: inline-flex; gap: 4px; }
.wk { background: #FFF1EF; border: 1.5px solid #E8B4AE; border-radius: 8px; padding: 0 6px; }
.wk .ar { font-family: var(--f-ar); font-size: 1.15rem; }
.add-pupils textarea { max-width: 420px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; min-height: 40px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.res-actions.left { justify-content: flex-start; }
.danger-text { color: #A3261C !important; }
.status-chip { display: inline-block; border: 2px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: .8rem; font-weight: 800; background: #fff; white-space: nowrap; }
.status-chip.open, .status-chip.submitted { background: var(--gold); }
.status-chip.draft, .status-chip.none, .status-chip.in_progress { background: #E9EDF5; }
.status-chip.closed { background: #D9DEEA; }
.status-chip.graded { background: #DDF0FF; }
.status-chip.returned { background: #C9F3DB; }
.exam-row-staff { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.exam-row-staff h2 { font-family: var(--f-display); }
.ers-main { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.belt-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid #E4EAF4; }
.bl-name { min-width: 220px; }
.bl-lessons { display: flex; gap: 4px; flex-wrap: wrap; }
.bl-l { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; border: 2px solid #C5CCE0; color: var(--muted); }
.bl-l.some { background: var(--paper-2); border-color: var(--gold-deep); color: var(--ink); }
.bl-l.done { background: var(--jade); border-color: var(--line); color: #fff; }
.weak-list { display: flex; flex-wrap: wrap; gap: 8px; }
.weak-list .weak-item { display: flex; flex-direction: column; align-items: center; padding: 6px 12px; border: 2px solid #E8B4AE; background: #FFF6F5; border-radius: 12px; }
.weak-list .ar { font-family: var(--f-ar); font-size: 1.6rem; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.plain-list.activity li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini-stars { display: inline-flex; font-size: .85rem; vertical-align: middle; }
/* test builder and marking */
.q-list { display: flex; flex-direction: column; gap: 12px; }
.q-edit { gap: 12px; }
.qe-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qe-head b { font-family: var(--f-display); font-size: 1.15rem; }
.qe-tools { display: flex; gap: 6px; }
.qe-tools .up .ico { transform: rotate(90deg); } .qe-tools .down .ico { transform: rotate(90deg); }
.qe-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.qe-row > .fld { flex: 1 1 140px; min-width: 110px; }
.qe-row > .fld:first-child { flex: 3 1 260px; }
.pts-input { width: 96px !important; text-align: center; font-weight: 800; }
.qe-opts { display: flex; flex-direction: column; gap: 6px; }
.qe-opt { display: flex; align-items: center; gap: 8px; }
.qe-opt input[type="radio"] { width: 22px; height: 22px; accent-color: #12804A; flex: none; }
.qe-opt .qe-right { font-size: .8rem; font-weight: 800; color: var(--muted); width: 3.6em; flex: none; }
.qe-opt.right .qe-right { color: #12804A; }
.qe-opt.right input[type="text"] { border-color: #12804A; background: #F1FFF7; }
.qe-preview { display: flex; flex-direction: column; gap: 8px; background: var(--ground-3); border-radius: 12px; padding: 10px; }
.add-q { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gen-box select { width: 100%; }
.save-bar { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 0; }
.save-bar.sticky { position: sticky; bottom: 0; background: rgba(242, 246, 251, .96); border-top: 2px solid var(--line); padding: 10px 4px; z-index: 5; justify-content: space-between; }
.sb-total { font-weight: 800; }
.mark-total { font-family: var(--f-display); font-size: 1.3rem; }
.mark-q { gap: 12px; }
.mark-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.pts-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.quick-pts { display: flex; gap: 4px; }
.auto-tag { font-size: .8rem; font-weight: 800; border-radius: 8px; padding: 1px 8px; border: 2px solid var(--line); }
.auto-tag.ok { background: #C9F3DB; } .auto-tag.no { background: #FFE1DE; }
.teacher-card.pending { border-color: var(--gold-deep); background: #FFFBEA; }
.tc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tc-role select { width: auto; min-height: 40px; }
@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .staff-head h1 { font-size: 1.35rem; }
  .pin-keys { grid-template-columns: repeat(3, 70px); }
  .row-actions { justify-content: flex-start; }
  .save-bar.sticky { flex-direction: column; align-items: stretch; }
}

/* ---------- printed login cards ---------- */
.print-sheet { display: none; }
@media print {
  body { overflow: visible; background: #fff !important; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; padding: 4mm; }
  .print-card { border: 1.5px dashed #000; border-radius: 4mm; padding: 5mm; break-inside: avoid; font-family: var(--f-body); color: #000; }
  .pc-brand { font-family: var(--f-display); font-weight: 800; font-size: 14pt; }
  .pc-url { font-size: 9pt; margin-bottom: 3mm; word-break: break-all; }
  .print-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 1mm 4mm; align-items: baseline; }
  .print-card dt { font-size: 9pt; }
  .print-card dd { margin: 0; font-weight: 800; font-size: 13pt; }
  .print-card dd.big { font-size: 20pt; letter-spacing: .15em; }
}

/* the mission button's small lines need full white on a slightly darker green */
.step-btn.mission:not(.locked) { background: #0F7342; }
.step-btn.mission:not(.locked) .sb-t small, .step-btn.mission:not(.locked) .sb-t em { color: #fff; opacity: 1; }
.kv .ok, .kv b.ok, b.ok { color: #12804A; }

/* ---------- the school's own name and logo ---------- */
.brand-chip { display: inline-flex; align-items: center; gap: 10px; background: #fff; border: 3px solid var(--line); border-radius: 999px; padding: 4px 16px 4px 4px; box-shadow: 0 4px 0 var(--shadow); font-family: var(--f-display); font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.brand-chip img { border-radius: 50%; display: block; }
.brand-chip.hero { flex-direction: column; gap: 4px; padding: 10px 22px 8px; border-radius: 24px; font-size: 1.2rem; margin-bottom: 6px; }
.start-hero .brand-chip.hero { align-self: center; }
.topbar.plain .brand-chip { font-size: .95rem; }
.st-brand { align-items: center; }
.st-brand img { border-radius: 50%; }
.print-card .pc-head { display: flex; align-items: center; gap: 3mm; margin-bottom: 1mm; }
.print-card .pc-head img { width: 14mm; height: 14mm; }
.print-card .pc-school { font-size: 9pt; font-weight: 700; }
@media (max-width: 420px) { .topbar.plain .brand-chip span { display: none; } .topbar.plain .brand-chip { padding: 4px; } }
