/* ==========================================================
   نِبراس — الأنماط المشتركة
   كل مرحلة لها عالم: w-home / w-primary / w-middle / w-secondary
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- عوالم المراحل ---------- */
body {
  --font: 'Readex Pro', 'Segoe UI', Tahoma, sans-serif;
  --bg: #FFF8EE;
  --surface: #FFFFFF;
  --ink: #23204A;
  --muted: #6B6890;
  --accent: #FFB627;
  --accent-ink: #23204A;
  --accent-2: #FF7A45;
  --good: #2BB673;
  --bad: #EF4E5B;
  --line: #23204A;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 4px 0 rgba(35, 32, 74, .9);
  --focus: #3A86FF;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}

/* الابتدائي: سماء صافية وملصقات ممتلئة */
body.w-primary {
  --font: 'Baloo Bhaijaan 2', 'Readex Pro', 'Segoe UI', sans-serif;
  --bg: #DDF3FF;
  --surface: #FFFFFF;
  --ink: #1D2B53;
  --muted: #4E5F8C;
  --accent: #FFCE3D;
  --accent-ink: #1D2B53;
  --accent-2: #FF6B6B;
  --sky: #3AB4F2;
  --grass: #59C36A;
  --berry: #A06CD5;
  --good: #2EAD5B;
  --bad: #F0504F;
  --line: #1D2B53;
  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 5px 0 #1D2B53;
  background:
    radial-gradient(circle at 12% 8%, #fff 0 60px, transparent 61px),
    radial-gradient(circle at 18% 10%, #fff 0 42px, transparent 43px),
    radial-gradient(circle at 86% 14%, #fff 0 50px, transparent 51px),
    linear-gradient(#BFE9FF, #DDF3FF 320px);
  background-attachment: fixed;
}

/* المتوسط: ملفات مهمات وأختام */
body.w-middle {
  --font: 'Readex Pro', 'Segoe UI', sans-serif;
  --bg: #DDF5EC;
  --surface: #FFFFFF;
  --ink: #0B3F3C;
  --muted: #42706B;
  --accent: #FFA62B;
  --accent-ink: #2B1600;
  --accent-2: #F25F5C;
  --teal: #12857A;
  --good: #12A36A;
  --bad: #E2414E;
  --line: #0B3F3C;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 3px 0 #0B3F3C;
  background:
    repeating-linear-gradient(-45deg, transparent 0 22px, rgba(11, 63, 60, .035) 22px 23px),
    #DDF5EC;
}

/* الثانوي: لوحة مخططات هندسية */
body.w-secondary {
  --font: 'IBM Plex Sans Arabic', 'Readex Pro', 'Segoe UI', sans-serif;
  --bg: #0E2A47;
  --surface: #12355A;
  --ink: #EAF4FF;
  --muted: #9CC2E5;
  --accent: #FF8A3D;
  --accent-ink: #1A0B00;
  --accent-2: #7CC4FF;
  --good: #4BE39A;
  --bad: #FF6B7A;
  --line: #7CC4FF;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: none;
  --focus: #FFD166;
  background-color: #0E2A47;
  background-image:
    linear-gradient(rgba(124, 196, 255, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 196, 255, .09) 1px, transparent 1px),
    linear-gradient(rgba(124, 196, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 196, 255, .04) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-attachment: fixed;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 .8em; }

/* ---------- الأزرار ---------- */
.btn {
  --b: var(--surface);
  --c: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 2px solid var(--line);
  background: var(--b); color: var(--c);
  padding: .55em 1.3em; border-radius: 999px;
  font-weight: 700; font-size: 1rem; line-height: 1.4;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, background .2s;
  text-decoration: none; user-select: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-accent { --b: var(--accent); --c: var(--accent-ink); }
.btn-good { --b: var(--good); --c: #fff; }
.btn-lg { font-size: 1.2rem; padding: .7em 1.8em; }
.btn-sm { font-size: .9rem; padding: .3em .9em; }
.btn-icon { padding: .45em; width: 2.6em; height: 2.6em; border-radius: 50%; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
body.w-secondary .btn { border-width: 1px; border-radius: var(--radius); }
body.w-secondary .btn-accent { border-color: var(--accent); }
body.w-middle .btn { border-radius: var(--radius); }

.chip {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .15em .8em; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line);
  font-weight: 700; font-size: .9rem;
}
body.w-secondary .chip { border-width: 1px; border-radius: var(--radius); }

/* ---------- شريط الدرس العلوي ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(12px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid color-mix(in srgb, var(--line) 18%, transparent);
}
.topbar .crumbs { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.topbar .crumbs small { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumbs strong { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .tools { display: flex; gap: 8px; align-items: center; }
.xp-chip { gap: .5em; }
.xp-chip .lvl { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 .55em; }
.xp-chip .bar { width: 64px; height: 8px; border-radius: 8px; background: color-mix(in srgb, var(--line) 15%, transparent); overflow: hidden; }
.xp-chip .bar i { display: block; height: 100%; background: var(--good); border-radius: 8px; transition: width .6s ease; }
.toggle[aria-pressed="false"] { opacity: .5; }

/* ---------- المراحل داخل الدرس ---------- */
.lesson-wrap { max-width: 1120px; margin: 0 auto; padding: 18px clamp(12px, 3vw, 28px) 120px; }
.stepper {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin: 6px 0 22px; padding: 0; list-style: none;
}
.stepper button {
  display: flex; align-items: center; gap: .5em;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: .3em 1em .3em .5em; font-weight: 700; font-size: .95rem;
}
.stepper button .n {
  display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%;
  background: color-mix(in srgb, var(--line) 12%, transparent); font-size: .85rem;
}
.stepper button[aria-current="step"] { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.stepper button.done .n { background: var(--good); color: #fff; }
body.w-secondary .stepper button { border-width: 1px; border-radius: var(--radius); }
body.w-middle .stepper button { border-radius: var(--radius); }

.step { display: none; animation: stepIn .35s ease both; }
.step.active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.step-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.step-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0; }
.step-head p { margin: .2em 0 0; color: var(--muted); max-width: 62ch; }

.panel {
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius); padding: clamp(14px, 2.4vw, 24px);
  box-shadow: var(--shadow);
}
body.w-secondary .panel { border-width: 1px; background: rgba(18, 53, 90, .88); }

.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px clamp(12px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-top: 2px solid color-mix(in srgb, var(--line) 15%, transparent);
}
.bottom-nav .progress { flex: 1; height: 10px; border-radius: 10px; background: color-mix(in srgb, var(--line) 12%, transparent); overflow: hidden; max-width: 420px; }
.bottom-nav .progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s ease; border-radius: 10px; }

/* ---------- الكسر الرأسي ---------- */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; font-weight: 800; margin: 0 .15em; }
.frac > span { padding: 0 .2em; }
.frac > span:first-child { border-bottom: .09em solid currentColor; }

/* ---------- الشخصية والفقاعة ---------- */
.mascot { width: 100%; height: auto; overflow: visible; }
.mascot .glow { animation: glow 2.6s ease-in-out infinite; transform-origin: center; }
.mascot .body { animation: bob 3s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes glow { 50% { opacity: .55; transform: scale(1.08); } }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-2deg); } }

.say {
  position: fixed; z-index: 60; inset-inline-start: 18px; bottom: 82px;
  display: flex; align-items: flex-end; gap: 6px; width: max-content; max-width: min(440px, calc(100vw - 36px));
  pointer-events: none; opacity: 0; transform: translateY(16px) scale(.96);
  transition: opacity .25s ease, transform .25s ease;
}
.say.show { opacity: 1; transform: none; pointer-events: auto; }
.say .who { width: 64px; flex: none; }
.say .say-text { flex: 0 1 auto; min-width: 0; }
.say .say-text {
  background: #fff; color: #1D2B53; border: 2px solid #1D2B53; border-radius: 18px 18px 18px 4px;
  padding: 10px 14px; font-weight: 600; box-shadow: 0 4px 0 #1D2B53; font-size: 1rem;
}
[dir="rtl"] .say .say-text { border-radius: 18px 18px 4px 18px; }

/* ---------- نافذة منبثقة ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(15, 18, 45, .55); backdrop-filter: blur(4px);
  animation: fade .2s ease;
}
.modal {
  width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); color: var(--ink); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  animation: pop .3s cubic-bezier(.2, 1.4, .4, 1);
  text-align: center;
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }

.reward .stars { display: flex; justify-content: center; gap: 10px; margin: 10px 0 6px; }
.reward .stars svg { width: 64px; height: 64px; }
.reward .stars .on { animation: starIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.reward .stars .on:nth-child(2) { animation-delay: .25s; }
.reward .stars .on:nth-child(3) { animation-delay: .5s; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.reward .badge-won { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 14px 0; padding: 10px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.reward .badge-won svg { width: 54px; height: 54px; }
.reward .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

.xp-float {
  position: fixed; z-index: 120; pointer-events: none; font-weight: 800; font-size: 1.4rem;
  color: var(--good); text-shadow: 0 2px 0 #fff, 0 0 12px rgba(255, 255, 255, .8);
  animation: floatUp 1.2s ease-out forwards;
}
@keyframes floatUp { to { transform: translateY(-70px); opacity: 0; } }

.confetti { position: fixed; inset: 0; z-index: 110; pointer-events: none; }

/* ---------- مشغل المشاهد (فيديو تفاعلي) ---------- */
.scene-player {
  max-width: min(100%, calc((100vh - 400px) * 1.7778)); min-width: min(100%, 520px); margin: 0 auto;
  border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: #0f1430; box-shadow: var(--shadow); position: relative;
}
.scene-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; }
.scene-stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-caption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 14px 20px 16px;
  background: linear-gradient(transparent, rgba(10, 12, 35, .82) 35%);
  color: #fff; font-size: clamp(1rem, 2.2vw, 1.35rem); font-weight: 600; min-height: 3.4em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.scene-controls { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #0f1430; color: #fff; }
.scene-controls button {
  background: rgba(255, 255, 255, .12); border: 0; color: #fff; border-radius: 999px;
  width: 40px; height: 40px; display: grid; place-items: center;
}
.scene-controls button:hover { background: rgba(255, 255, 255, .22); }
.scene-controls svg { width: 20px; height: 20px; }
.scene-bars { flex: 1; display: flex; gap: 4px; direction: rtl; }
.scene-bars span { flex: 1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .2); overflow: hidden; cursor: pointer; }
.scene-bars span i { display: block; height: 100%; width: 0; background: var(--accent); }
.scene-big-play {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 12, 35, .35);
  border: 0; color: #fff; z-index: 5;
}
.scene-big-play span {
  display: flex; align-items: center; gap: 10px; background: var(--accent); color: var(--accent-ink);
  padding: 14px 28px; border-radius: 999px; font-weight: 800; font-size: 1.3rem; box-shadow: 0 6px 0 rgba(0, 0, 0, .35);
}
.scene-big-play svg { width: 26px; height: 26px; }

/* ---------- الاختبار ---------- */
.quiz { max-width: 780px; margin: 0 auto; }
.quiz-pips { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.quiz-pips span { width: 34px; height: 8px; border-radius: 8px; background: color-mix(in srgb, var(--line) 15%, transparent); }
.quiz-pips span.ok { background: var(--good); }
.quiz-pips span.no { background: var(--bad); }
.quiz-pips span.cur { background: var(--accent); }
.quiz-q { font-size: clamp(1.2rem, 2.5vw, 1.5rem); font-weight: 700; margin-bottom: 14px; text-align: center; }
.quiz-visual { display: grid; place-items: center; margin: 0 auto 16px; max-width: 360px; }
.quiz-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.quiz-choices button {
  text-align: start; padding: 14px 18px; font-size: 1.1rem; font-weight: 600;
  background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; min-height: 64px;
  transition: transform .12s;
}
.quiz-choices button:hover { transform: translateY(-2px); }
.quiz-choices button .k {
  display: grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--line) 10%, transparent); font-weight: 800;
}
.quiz-choices button.right { background: var(--good); color: #fff; border-color: var(--good); }
.quiz-choices button.wrong { background: var(--bad); color: #fff; border-color: var(--bad); animation: shake .4s; }
.quiz-choices button.dim { opacity: .45; }
body.w-secondary .quiz-choices button { border-width: 1px; }
.quiz-explain {
  margin-top: 16px; padding: 14px 18px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border: 2px dashed var(--line);
  display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- أدوات صغيرة ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; }

.missions { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.missions li {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 2px dashed color-mix(in srgb, var(--line) 40%, transparent); font-weight: 600;
}
.missions li .tick {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none;
  display: grid; place-items: center; color: transparent; font-size: 14px;
}
.missions li.done { border-style: solid; border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.missions li.done .tick { background: var(--good); border-color: var(--good); color: #fff; animation: pop .3s; }

.range { display: grid; gap: 4px; }
.range label { display: flex; justify-content: space-between; font-weight: 600; }
.range output { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }

.hud { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hud .chip { font-size: 1.05rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.quiz-choices .frac { font-size: 1.45rem; }
.quiz-q .frac { font-size: 1.25em; }
@media (max-width: 560px) {
  .xp-chip .pts { display: none; }
  .xp-chip .bar { width: 40px; }
  .topbar .crumbs small { display: none; }
  .stepper button { font-size: .85rem; padding: .25em .8em .25em .4em; }
}
.quiz-q .quiz-listen { vertical-align: middle; width: 2.2em; height: 2.2em; padding: .35em; margin-inline-start: 6px; }

/* حركة بطيئة للصور داخل المشاهد (تأثير كين برنز) */
.kb { transform-box: fill-box; transform-origin: center; animation: kb 10s ease-out forwards; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.08); } }
.halo { paint-order: stroke; stroke: #fff; stroke-width: 10px; stroke-linejoin: round; }
.topbar .narrator { white-space: nowrap; }
@media (max-width: 560px) { .topbar .narrator { display: none; } }

/* ---------- عُدّة الدروس ---------- */
.kit-cards { display: grid; gap: 16px; }
.kit-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: center; animation: stepIn .45s ease both; }
.kit-card:nth-child(even) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.kit-card:nth-child(even) .kit-visual { order: 2; }
.kit-card .kit-visual { display: grid; place-items: center; gap: 10px; min-height: 120px; }
.kit-card .kit-visual svg { max-width: 100%; height: auto; }
.kit-card h3 { font-size: 1.4rem; margin-bottom: .3em; }
.kit-card .kit-text > div { font-size: 1.12rem; line-height: 1.9; }
.kit-card .kit-listen { margin-top: 10px; }
.kit-card:not(:has(.kit-visual)) { grid-template-columns: 1fr; }
@media (max-width: 760px) { .kit-card, .kit-card:nth-child(even) { grid-template-columns: 1fr; } .kit-card:nth-child(even) .kit-visual { order: 0; } }
.big-eq { font-size: 2.6rem; font-weight: 800; display: flex; align-items: center; gap: 14px; justify-content: center; }
.big-eq .frac { font-size: 1em; }

.kit-tile {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 1.15rem; box-shadow: var(--shadow); transition: transform .12s;
}
.kit-tile:hover { transform: translateY(-2px); }
.kit-tile .frac { font-size: 1.45rem; }
.kit-tile svg { height: 64px; width: auto; }
.kit-tile.sel { outline: 4px solid var(--accent); outline-offset: 2px; }
.kit-tile.ok { background: color-mix(in srgb, var(--good) 18%, var(--surface)); border-color: var(--good); box-shadow: none; }
.kit-tile.bad, .kit-bin.bad { animation: shake .35s; border-color: var(--bad); }
.kit-match { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kit-match .col { display: grid; gap: 12px; }
.kit-classify .pool, .kit-order .pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; min-height: 70px; }
.kit-classify .bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kit-bin {
  min-height: 150px; border: 3px dashed color-mix(in srgb, var(--line) 50%, transparent); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--ink); padding: 10px; display: grid; align-content: start; gap: 8px;
}
.kit-bin strong { font-size: 1.2rem; }
.kit-bin .got { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.kit-bin .got .kit-tile { min-height: 44px; font-size: .95rem; padding: 6px 10px; }
.kit-order .slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.slot-o { min-height: 110px; border: 3px dashed color-mix(in srgb, var(--line) 40%, transparent); border-radius: var(--radius-sm); display: grid; place-items: center; position: relative; padding: 6px; }
.slot-o .n { position: absolute; top: 4px; inset-inline-start: 8px; font-weight: 800; color: var(--muted); }
.remember { display: grid; grid-template-columns: 100px 1fr; gap: 16px; align-items: center; margin-bottom: 18px; }
.remember ul { margin: 0; padding-inline-start: 1.2em; }
.result .stars { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.result .stars svg { width: 54px; height: 54px; }
.kit-player { margin-bottom: 8px; }
svg [style*="animation:pop"] { transform-box: fill-box; transform-origin: center; }
.btn.shake { animation: shake .35s; }
.qbox { display: inline-block; width: 1.3em; height: 1.3em; border: 3px dashed currentColor; border-radius: 8px; vertical-align: middle; margin: 0 .2em; }
.rel { font-weight: 800; margin: 0 .2em; }
.topbar .class-timer { font-variant-numeric: tabular-nums; min-width: 92px; }
.topbar .class-timer.running { --b: color-mix(in srgb, var(--good) 25%, var(--surface)); }
.topbar .class-timer.late { --b: color-mix(in srgb, var(--bad) 25%, var(--surface)); }
@media (max-width: 640px) { .topbar .class-timer { min-width: 0; font-size: .8rem; } }
/* خطوات الكتاب */
.step-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.step-min { white-space: nowrap; flex: none; }
.kit-src { color: var(--muted); font-size: .95rem; margin: -6px 0 12px; }
.kit-qa, .kit-practice { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.qa, .pr { display: grid; gap: 10px; align-content: start; }
.qa-q, .pr-q { display: flex; gap: 10px; font-size: 1.15rem; line-height: 1.8; font-weight: 600; }
.qa-n { flex: none; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.qa-a { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--good) 14%, var(--surface)); font-size: 1.1rem; line-height: 1.8; }
.qa-v, .pr-v, .ex-v { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.qa-v svg, .pr-v svg, .ex-v svg { max-width: 100%; height: auto; }
.qa [data-r], .pr [data-r] { justify-self: start; }
.ex { margin-bottom: 14px; }
.ex h3 { font-size: 1.3rem; margin-bottom: 6px; }
.ex-p { font-size: 1.2rem; line-height: 1.9; font-weight: 600; }
.ex-steps { list-style: arabic-indic; margin: 10px 0; padding-inline-start: 1.6em; display: grid; gap: 8px; font-size: 1.15rem; line-height: 1.9; }
.ex-steps li.pop { animation: stepIn .35s ease both; }
.ex-ans { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--good) 16%, var(--surface)); font-weight: 800; font-size: 1.2rem; margin-bottom: 10px; }
.bookv-bar { justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bookv-bar .pg { display: flex; flex-wrap: wrap; gap: 6px; }
.bookv-bar [aria-pressed="true"] { --b: var(--accent); --c: #fff; }
.bookv-frame { height: min(78vh, 900px); border-radius: 14px; overflow: hidden; background: #E9ECF2; }
.bookv-frame iframe { width: 100%; height: 100%; border: 0; }
.wrap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .wrap-grid { grid-template-columns: 1fr; } }
.wrap-list { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; font-size: 1.12rem; line-height: 1.8; }

/* ---------- السبورة الذكية ---------- */
.nb-open { overflow: hidden; }
.nb-board { position: fixed; inset: 0; z-index: 900; background: #E8EDF4; display: grid; grid-template-rows: auto 1fr; font-family: inherit; color: #1D2B53; }
.nb-board[hidden] { display: none; }
.nb-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 10px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.nb-bar .grp { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nb-bar button { min-width: 40px; height: 40px; border: 2px solid #D5DCE8; background: #fff; border-radius: 10px; font: inherit; font-size: 1.05rem; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; color: #1D2B53; }
.nb-bar button span { font-size: .78rem; font-weight: 700; }
.nb-bar button[aria-pressed="true"] { background: #FFD23F; border-color: #1D2B53; }
.nb-bar button:hover { border-color: #1E88C7; }
.nb-bar .sw { width: 30px; min-width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 3px solid #D5DCE8; }
.nb-bar .sw[aria-pressed="true"] { border-color: #1D2B53; outline: 3px solid #FFD23F; }
.nb-bar input[type=color] { width: 34px; height: 34px; padding: 0; border: 0; background: none; }
.nb-bar select { height: 40px; border-radius: 10px; border: 2px solid #D5DCE8; font: inherit; padding: 0 6px; }
.nb-bar .pg { min-width: 54px; text-align: center; font-weight: 800; }
.nb-bar .close { background: #E2414E; color: #fff; border-color: #E2414E; }
.nb-body { display: grid; grid-template-columns: 260px 1fr; min-height: 0; }
.nb-side { background: #fff; border-inline-start: 1px solid #D5DCE8; overflow-y: auto; padding: 8px; display: grid; align-content: start; gap: 8px; }
.nb-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.nb-tabs button { font: inherit; font-size: .82rem; font-weight: 700; padding: 5px 8px; border-radius: 999px; border: 2px solid #D5DCE8; background: #F5F7FB; cursor: pointer; color: #1D2B53; }
.nb-tabs button[aria-pressed="true"] { background: #1D2B53; color: #fff; border-color: #1D2B53; }
.nb-tpl { display: flex; flex-wrap: wrap; gap: 5px; }
.nb-tpl .btn { font-size: .85rem; padding: 6px 10px; }
.nb-symgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; }
.nb-symgrid button { direction: ltr; unicode-bidi: isolate; height: 42px; font-size: 1.25rem; border: 1.5px solid #D5DCE8; border-radius: 8px; background: #fff; cursor: pointer; font-family: inherit; color: #1D2B53; }
.nb-symgrid button:hover { background: #FFF6D6; border-color: #FFB627; }
.nb-stage { position: relative; min-height: 0; }
.nb-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.nb-board.stamping .nb-stage canvas { cursor: copy; }
.nb-input { position: absolute; width: 340px; background: #fff; border: 3px solid #1E88C7; border-radius: 14px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.2); display: grid; gap: 6px; z-index: 3; }
.nb-input[hidden] { display: none; }
.nb-input textarea { font: 700 1.3rem/1.6 "Readex Pro", sans-serif; border: 0; outline: none; resize: vertical; }
.nb-input .ins { display: flex; flex-wrap: wrap; gap: 3px; }
.nb-input .ins button { direction: ltr; unicode-bidi: isolate; min-width: 30px; height: 30px; border: 1px solid #D5DCE8; border-radius: 6px; background: #F5F7FB; cursor: pointer; font-size: 1rem; }
.nb-form { position: absolute; top: 16px; inset-inline-start: 16px; width: 330px; z-index: 4; display: grid; gap: 8px; color: #1D2B53; background: #fff; }
.nb-form[hidden] { display: none; }
.nb-form label { display: grid; gap: 3px; font-weight: 700; font-size: .92rem; }
.nb-form input { font: inherit; padding: 6px 8px; border-radius: 8px; border: 2px solid #D5DCE8; }
.nb-form .nb-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.nb-pt { position: absolute; inset: 10px; z-index: 5; overflow: auto; background: #fff; color: #1D2B53; display: grid; gap: 8px; align-content: start; }
.nb-pt[hidden] { display: none; }
.pt-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pt-grid { display: grid; grid-template-columns: repeat(18, minmax(46px, 1fr)); grid-template-rows: repeat(9, auto); gap: 3px; direction: ltr; }
.pt-el { border: 1.5px solid #1D2B53; border-radius: 6px; padding: 2px 1px; cursor: pointer; display: grid; text-align: center; line-height: 1.1; font-family: inherit; color: #1D2B53; }
.pt-el small { font-size: .62rem; } .pt-el b { font-size: 1.05rem; } .pt-el i { font-size: .55rem; font-style: normal; white-space: nowrap; overflow: hidden; }
.pt-el:hover { transform: scale(1.12); position: relative; z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.pt-gap { font-size: .8rem; font-weight: 700; align-self: center; text-align: center; color: #5B6B82; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .85rem; }
.pt-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-inline-end: 4px; vertical-align: middle; border: 1px solid #1D2B53; }
.pt-info { font-size: 1.05rem; padding: 8px; border-radius: 10px; background: #F5F7FB; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 800px) { .nb-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .nb-side { max-height: 32vh; order: 2; } .nb-bar button span { display: none; } }
.topbar .board-btn { font-weight: 800; }
.wu-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 14px; }
.wu-top h3 { font-size: 1.2rem; margin-bottom: 6px; }
.wu-top p { font-size: 1.12rem; line-height: 1.9; margin: 0 0 6px; }
.wu-top ul { margin: 0; padding-inline-start: 1.2em; line-height: 1.8; }
.wu-idea { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.wu-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.wu-chips .chip { font-size: 1.05rem; font-weight: 800; }
.wu-defs { margin: 8px 0 0; display: grid; gap: 4px; }
.wu-defs dt { font-weight: 800; }
.wu-defs dd { margin: 0 0 6px; line-height: 1.7; }
.wu-hook { background: color-mix(in srgb, #9B5DE5 12%, var(--surface)); }
.wu-sub { font-size: 1.2rem; margin: 6px 0 10px; }
/* أدوات القسمة */
.sh-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 1.2rem; }
.sh-pool { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 56px; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); margin-bottom: 12px; }
.sh-it { font-size: 1.8rem; line-height: 1; }
.sh-plates { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.sh-plate { min-height: 130px; border: 3px dashed var(--line); border-radius: 50% / 40%; background: var(--surface); display: grid; align-content: start; justify-items: center; gap: 4px; padding: 10px; cursor: pointer; font: inherit; color: var(--ink); }
.sh-plate div { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.sh-plate .sh-it { font-size: 1.4rem; }
.sh-plate b { font-size: 1.3rem; }
.sh-eq { text-align: center; font-size: 1.4rem; font-weight: 800; min-height: 1.6em; margin: 12px 0; }
.ar-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: center; }
@media (max-width: 700px) { .ar-wrap { grid-template-columns: 1fr; } }
.ar-ctl { display: grid; gap: 12px; font-weight: 800; }
.ar-grid { display: grid; gap: 6px; justify-items: center; max-width: 520px; margin: auto; font-size: 1.8rem; color: #E2414E; }
.ar-facts { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; font-size: 1.15rem; }
.dr-top { display: flex; justify-content: center; gap: 10px; }
.dr-q { font-size: 3rem; font-weight: 800; margin: 18px 0; }
.dr-ch { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.dr-ch .btn { min-width: 90px; font-size: 1.6rem; }
.ldiv { display: inline-flex; align-items: flex-end; gap: 2px; font-weight: 800; font-size: 1.35em; vertical-align: middle; margin: 0 .2em; }
.ld-box { display: inline-grid; }
.ld-q { text-align: center; line-height: 1.1; color: #1E88C7; font-size: 1em; min-height: 1.1em; }
.ld-dd { border-top: 3px solid currentColor; border-inline-start: 3px solid currentColor; border-start-start-radius: 0 0; padding: 0 .3em 0 .35em; border-radius: 10px 0 0 0; line-height: 1.3; }
.kgroups { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.kg { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 120px; justify-content: center; padding: 6px 8px; border: 3px solid var(--line); border-radius: 18px; background: var(--surface); }
.kg i { font-style: normal; font-size: 1.4rem; line-height: 1; }
.eqn { white-space: nowrap; font-weight: 800; }
.kgrid { display: inline-grid; gap: 4px; padding: 8px 10px; border: 3px solid var(--line); border-radius: 16px; background: var(--surface); direction: ltr; }
.kgrid i { font-style: normal; font-size: 1.35rem; line-height: 1; }
.big-eq .ldiv { font-size: 1em; }
.money { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.money b { display: inline-grid; place-items: center; width: 64px; height: 34px; border-radius: 6px; background: #7FC8A9; color: #10372A; border: 2px solid #2E7D5B; font-size: .95rem; }
.dice { width: 96px; height: 96px; border-radius: 20px; background: #fff; border: 4px solid #1D2B53; display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; color: #1D2B53; box-shadow: 0 6px 0 #1D2B53; }
.ktable { border-collapse: collapse; margin: 8px auto; font-weight: 700; background: var(--surface); }
.ktable th, .ktable td { border: 2px solid var(--line); padding: 6px 10px; text-align: center; min-width: 2.2em; }
.ktable th { background: #E8F1FF; }
.ktable td.hit { background: #FFE08A; outline: 3px solid #E2414E; outline-offset: -3px; border-radius: 50%; }
.tb-lab select { font: inherit; padding: 4px 8px; border-radius: 10px; border: 2px solid var(--line); }
.tb-wrap { overflow-x: auto; }
.gl-wrap { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; }
.gl-grid { display: grid; gap: 0; width: min(560px, 92vw); border: 2px solid #1D2B53; background: #fff; direction: ltr; }
.gl-grid button { aspect-ratio: 1; border: 1px solid #9DB8E0; background: #fff; padding: 0; cursor: pointer; }
.gl-grid button.on { background: #8EC5FF; border-color: #1D2B53; }
.gl-info { display: grid; gap: 10px; text-align: center; }
.gl-info > div { background: var(--surface); border: 3px solid var(--line); border-radius: 16px; padding: 8px 18px; display: grid; }
.gl-info b { font-size: 2rem; }
.bk-chain { text-align: center; font-size: 1.5rem; font-weight: 800; margin: 12px 0; direction: ltr; }
.bk-chain .st { display: inline-block; min-width: 2.2em; padding: 4px 10px; border: 3px solid #1D2B53; border-radius: 12px; background: #FFF6D6; }
.bk-chain .op { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #DDEBFF; }
.bk-log { display: grid; gap: 6px; justify-items: center; font-size: 1.3rem; margin-top: 10px; }
/* التهيئة الموسّعة */
.wu-prior { background: color-mix(in srgb, #2EAD5B 10%, var(--surface)); }
.wu-life { background: color-mix(in srgb, #FFB627 14%, var(--surface)); }
.wu-fact { background: color-mix(in srgb, #FF8FAB 14%, var(--surface)); }
.wu-starter { background: color-mix(in srgb, #3A86FF 10%, var(--surface)); }
.wu-starter ol, .wu-starter ul { margin: 0; padding-inline-start: 1.3em; line-height: 1.85; list-style: arabic-indic; }
.wu-mist { background: color-mix(in srgb, #E2414E 8%, var(--surface)); }
.wu-life-g { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wu-life-g > div { display: flex; gap: 8px; align-items: flex-start; background: var(--surface); border-radius: 14px; padding: 8px; border: 2px solid var(--line); }
.wu-life-g span { font-size: 1.7rem; line-height: 1; }
.wu-life-g p { margin: 0; font-size: 1rem !important; line-height: 1.6 !important; }
.wu-mx { display: grid; gap: 2px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 1.02rem; line-height: 1.7; }
.wu-mx .bad { color: #C62839; } .wu-mx .good { color: #1E7B45; font-weight: 700; }
.wu-mental { text-align: center; background: color-mix(in srgb, #9B5DE5 10%, var(--surface)); }
.wu-flash { min-height: 96px; display: grid; place-items: center; margin: 6px 0 10px; border-radius: 18px; background: #1D2B53; color: #fff; font-size: 2rem; font-weight: 800; cursor: pointer; padding: 10px; }
.wu-fa { color: #FFE08A; }
.wu-plan { margin: 4px 0 14px; }
.wu-tl { display: flex; gap: 4px; flex-wrap: wrap; }
.wu-tli { min-width: 92px; display: grid; gap: 2px; text-align: center; padding: 8px 6px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 2px solid var(--line); }
.wu-tli b { font-size: .95rem; } .wu-tli small { color: var(--muted); }
.wu-teacher { margin-bottom: 12px; } .wu-teacher summary { cursor: pointer; font-weight: 800; font-size: 1.1rem; }
.wu-teacher ul { line-height: 1.9; margin: 8px 0 0; }
.digi { display: inline-block; direction: ltr; font-family: "Courier New", monospace; font-weight: 800; background: #1D2B53; color: #7CFFB2; padding: 2px 12px; border-radius: 10px; letter-spacing: 1px; }
.btn.digi { font-size: 1.4rem; }
.pseq { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; align-items: center; direction: rtl; }
.pt { width: 40px; height: 40px; }
.pq { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 3px dashed #1D2B53; border-radius: 10px; font-size: 1.5rem; }
.ptiles { display: inline-grid; gap: 2px; direction: ltr; }
.ptiles i { width: 28px; height: 28px; border: 2px solid #1D2B53; border-radius: 4px; }
.sym-g { display: inline-grid; gap: 2px; direction: ltr; margin: 12px auto; }
.sym-g button { width: 40px; height: 40px; border: 1px solid #9DB8E0; background: #fff; padding: 0; cursor: pointer; }
.sym-g button.on { background: #8EC5FF; }
.sym-g button.fix.on { background: #FFB3C1; }
.sym-g button.ax { border-right: 4px dashed #E2414E; }
.sym-g button[disabled] { cursor: default; }
.tally { font-family: "Courier New", monospace; font-weight: 800; letter-spacing: 1px; direction: ltr; display: inline-block; }
.tally s { text-decoration-thickness: 2px; }
.picto .pr { text-align: start; font-size: 1.5rem; min-width: 180px; }
.picto .ph { display: inline-block; width: .55em; overflow: hidden; vertical-align: bottom; }
.picto .pk { font-size: .95rem; background: #FFF6D6; }
.pb-wrap { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.pb-btn { white-space: nowrap; } .pb-btn .btn { margin: 1px; }
.lst { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.bb-ctl { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; } .bb-ctl .btn { padding: 2px 8px; }
.bag { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 10px 14px; border: 3px solid #9AA5B1; border-radius: 20px 20px 34px 34px; background: #F4F7FB; font-size: 1.5rem; letter-spacing: 2px; max-width: 240px; }
.echain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 10px 0; min-height: 2.4em; }
.echain span { background: #FFF6D6; border: 2px solid #1D2B53; border-radius: 12px; padding: 4px 10px; font-weight: 800; }
.echain b { color: #E2414E; font-size: 1.3rem; }
.bloodtube { display: inline-flex; flex-direction: column; width: 110px; height: 220px; border: 4px solid #1D2B53; border-radius: 0 0 40px 40px; overflow: hidden; font-weight: 800; font-size: .9rem; }
.bloodtube span { display: grid; place-items: center; text-align: center; }
.bloodtube span:first-child { background: #FFE08A; } .bloodtube span:last-child { background: #C62839; color: #fff; }
.bact { font-size: 1.6rem; line-height: 1.3; max-width: 640px; margin: 10px auto; min-height: 60px; word-break: break-all; }
.meal-plate { width: 300px; min-height: 150px; margin: 14px auto; border-radius: 50%; background: radial-gradient(circle, #fff 55%, #E3EEF6 56%, #fff 70%); border: 4px solid #CFDDE8; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px; padding: 28px; font-size: 2rem; aspect-ratio: 1; }
.meal-plate span { cursor: pointer; } .meal-plate em { font-size: .95rem; color: #789; }
.chip.ok { background: #D7F5E1; color: #136B36; } .chip.bad { background: #FFE0E0; color: #A31D1D; }
.digsite { border-collapse: collapse; margin: 0 auto; }
.digsite th { width: 34px; font-weight: 800; color: #6B4A1E; }
.digsite td { width: 56px; height: 56px; text-align: center; font-size: 1.9rem; cursor: pointer; border: 2px dashed #A9783F; background: repeating-linear-gradient(45deg, #E8C48A 0 8px, #DDB377 8px 16px); }
.digsite td:hover { outline: 3px solid #FFB627; }
.digsite td.dug { background: #8B5A2B; color: #FFE7C2; cursor: default; }
.plantlab { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.plantlab .pot { width: 150px; text-align: center; border: 2px solid var(--line, #CFDDE8); border-radius: 14px; padding: 8px; background: #fff; }
.plantlab .pot .pl { font-size: 3rem; line-height: 1; transition: transform .6s ease, filter .6s ease; transform-origin: bottom center; }
.beaker { position: relative; width: 150px; height: 190px; border: 4px solid #5B7083; border-top: none; border-radius: 0 0 22px 22px; overflow: hidden; background: #F7FBFF; }
.beaker .liq { position: absolute; inset: 30px 0 0 0; transition: background .4s; }
.beaker .sed { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: repeating-radial-gradient(circle at 30% 40%, #fff 0 2px, #EDE3C8 2px 5px); transition: height .4s; }
.ptube { width: 88px; vertical-align: top; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px; cursor: pointer; }
.ptube .tb { width: 34px; height: 96px; border: 3px solid #5B7083; border-top: none; border-radius: 0 0 17px 17px; background: #EEF5FA; transition: background .5s; }
.ptube small { font-weight: 700; max-width: 84px; text-align: center; line-height: 1.2; }
.phbar { display: flex; margin: 10px auto; max-width: 640px; border-radius: 10px; overflow: hidden; border: 2px solid #1D2B53; }
.phbar span { flex: 1; text-align: center; font-weight: 800; padding: 6px 0; color: #fff; text-shadow: 0 1px 2px #0006; position: relative; }
.phbar span.on { outline: 4px solid #1D2B53; outline-offset: -4px; }
.dropzone { position: relative; width: 300px; height: 260px; margin: 12px auto; border-radius: 14px; background: linear-gradient(#EAF4FF, #F8FBFF); border: 2px solid #CFDDE8; overflow: hidden; }
.dropzone .obj { position: absolute; top: 6px; font-size: 2.2rem; line-height: 1; }
.dropzone .obj[data-a] { left: 70px; } .dropzone .obj[data-b] { left: 190px; }
.dropzone .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: #8B6B4A; }
.rulerlab svg { width: min(560px, 100%); height: auto; }
body.w-secondary .ktable th { background: rgba(120, 170, 255, .18); color: inherit; }
body.w-secondary .ktable td.hit { color: #1D2B53; }
body.w-secondary .plantlab .pot, body.w-secondary .meal-plate { color: #1D2B53; }
body.w-secondary .dropzone { border-color: #3B5578; }
.ruler-drop { position: relative; width: 160px; height: 300px; margin: 8px auto; border-radius: 12px; background: linear-gradient(#EAF4FF, #F8FBFF); overflow: hidden; border: 2px solid #3B5578; }
.rd-ruler { position: absolute; left: 62px; top: 10px; width: 34px; height: 200px; background: repeating-linear-gradient(#F2C511 0 3px, #1D2B53 3px 4px, #F2C511 4px 20px); border: 2px solid #8A6D00; border-radius: 3px; }
.rd-hand { position: absolute; left: 50px; top: 215px; font-size: 2.6rem; }
.wu-lk { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.wu-lk > div { border: 1px solid rgba(127,140,160,.3); border-radius: 10px; padding: 8px 10px; }
.wu-lk p { margin: 4px 0 0; font-size: .92rem; }
.wu-pre { margin-top: 12px; }
.wu-pr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed rgba(127,140,160,.35); }
.wu-pr p { margin: 0; }
.wu-prw { grid-column: 1 / -1; font-size: .92rem; padding: 6px 10px; border-radius: 8px; }
.wu-prw.good { background: rgba(46,173,91,.16); } .wu-prw.bad { background: rgba(226,65,78,.16); }
.btn-bad { background: #E2414E !important; color: #fff !important; }
.panel select { color: #1D2B53; background: #fff; border: 1px solid #9FB3C8; border-radius: 8px; padding: 4px 8px; font: inherit; }
