/* Спільні стилі рушія «Світ Мурка»: сцена, діалог, панелі, картка завдання, мініігри, меню, розділ для батьків.
   Кольори теми застосунок може перевизначити у своєму style.css. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #05060f; overflow: hidden; font-family: "Nunito", "Segoe UI", Arial, sans-serif; }
body { user-select: none; -webkit-user-select: none; touch-action: manipulation; }

#stage {
  position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px;
  transform-origin: 0 0; overflow: hidden; background: #0b1030; color: #fff;
}
.bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .7s ease; }
.bg.on { opacity: 1; }

/* ---------- characters ---------- */
#chars { position: absolute; inset: 0; pointer-events: none; transition: opacity .4s; }
.char { position: absolute; transform: translateX(-50%); transition: opacity .35s ease, filter .3s ease; opacity: 0; }
.char.on { opacity: 1; }
.char.dim { filter: brightness(.72) saturate(.85); }
.char img { display: block; height: 100%; width: auto; }
.char.flip img { transform: scaleX(-1); }
.char.float img { animation: floaty 3.2s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.char.flip.float img { animation: floatyflip 3.2s ease-in-out infinite; }
@keyframes floatyflip { 0%,100% { transform: scaleX(-1) translateY(0); } 50% { transform: scaleX(-1) translateY(-14px); } }
.char.jump img { animation: jump .9s ease-in-out 2; }
@keyframes jump { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-190px); } }
#stage.tasking #chars { opacity: .18; }

/* ---------- dialog ---------- */
#dialog {
  position: absolute; z-index: 10; left: 40px; right: 40px; bottom: 24px; min-height: 172px;
  background: rgba(10, 16, 48, .88); border: 3px solid rgba(160, 200, 255, .55); border-radius: 26px;
  padding: 30px 150px 26px 40px; font-size: 32px; line-height: 1.38; cursor: pointer;
  box-shadow: 0 10px 40px rgba(0,0,0,.45); display: none;
}
#dialog.on { display: block; animation: pop .25s ease; }
#dialog .name {
  position: absolute; top: -26px; left: 34px; padding: 6px 26px; border-radius: 16px; font-weight: 800; font-size: 28px;
  background: #ff9f43; color: #1b1030; box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
#dialog .name:empty { display: none; }
#dialog.narr .text { font-style: italic; color: #d6e4ff; }
#dialog .next {
  position: absolute; right: 26px; bottom: 22px; width: 92px; height: 92px; border-radius: 50%; border: none;
  background: #ffcf4a; color: #1b1030; font-size: 44px; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 #c08a10;
  animation: nudge 1.4s ease-in-out infinite;
}
@keyframes nudge { 0%,100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
@keyframes pop { from { transform: scale(.97); opacity: .3; } to { transform: scale(1); opacity: 1; } }

/* ---------- top buttons ---------- */
#topbar { position: absolute; top: 18px; right: 18px; display: flex; gap: 12px; z-index: 50; }
#topbar button {
  height: 60px; min-width: 60px; padding: 0 18px; border-radius: 18px; border: 2px solid rgba(255,255,255,.35);
  background: rgba(10, 16, 48, .75); color: #fff; font-size: 24px; font-weight: 700; cursor: pointer; font-family: inherit;
}
#topbar button:hover { background: rgba(40, 60, 130, .9); }
#topbar .pulse { animation: pulse 1s ease-in-out 3; }
#stage:has(#start.on) #topbar { visibility: hidden; }
@keyframes pulse { 50% { background: #ffcf4a; color: #1b1030; } }

/* ---------- generic overlay ---------- */
.overlay { position: absolute; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; background: rgba(3, 6, 22, .6); }
.overlay.on { display: flex; }
.panel {
  background: linear-gradient(180deg, rgba(22, 32, 82, .97), rgba(12, 18, 52, .97)); border: 3px solid rgba(160, 200, 255, .5);
  border-radius: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.6); color: #fff; position: relative;
}
.btn {
  font-family: inherit; font-size: 30px; font-weight: 800; padding: 14px 34px; border-radius: 20px; border: none; cursor: pointer;
  background: #ffcf4a; color: #1b1030; box-shadow: 0 5px 0 #c08a10;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c08a10; }
.btn.blue { background: #5fb3ff; box-shadow: 0 5px 0 #2d6fb0; }
.btn.ghost { background: transparent; color: #cfe0ff; box-shadow: none; border: 2px solid rgba(207,224,255,.5); font-size: 24px; padding: 10px 22px; }
.btn[disabled] { opacity: .4; cursor: default; }

/* ---------- start / title screens ---------- */
#start { z-index: 60; background: radial-gradient(ellipse at center, rgba(10,16,48,.35), rgba(3,6,22,.85)); flex-direction: column; }
#start h1 { font-size: 92px; margin: 0; text-align: center; line-height: 1.05; text-shadow: 0 6px 30px rgba(0,0,0,.7); color: #ffe9a8; }
#start h2 { font-size: 34px; margin: 18px 0 40px; font-weight: 600; color: #d6e4ff; }
#start .row { display: flex; gap: 26px; }
#start .heroes { position: absolute; bottom: 0; left: 0; right: 0; height: 420px; pointer-events: none; }
#start .heroes img { position: absolute; bottom: 20px; height: 380px; }
#start .copy { position: absolute; left: 0; right: 0; text-align: center; bottom: 12px; z-index: 2; font-size: 18px; color: #d6e4ff; opacity: .8; text-shadow: 0 1px 4px rgba(0,0,0,.9); pointer-events: none; }
#start .load { margin-top: 30px; font-size: 24px; color: #9fb6e8; height: 30px; }

#titlecard { z-index: 55; flex-direction: column; background: rgba(3,6,22,.72); cursor: pointer; }
#titlecard .t1 { font-size: 78px; font-weight: 900; color: #ffe9a8; text-align: center; text-shadow: 0 6px 30px rgba(0,0,0,.7); animation: pop .5s ease; }
#titlecard .t2 { font-size: 40px; margin-top: 18px; color: #d6e4ff; }
#titlecard .hint { position: absolute; bottom: 40px; font-size: 24px; color: #9fb6e8; }

/* ---------- task panel ---------- */
#task .panel { width: 1340px; height: 820px; padding: 28px 40px 24px; display: flex; flex-direction: column; }
#task .head { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; }
#task .subject { padding: 6px 18px; border-radius: 14px; font-size: 22px; font-weight: 800; background: #5fb3ff; color: #0b1030; white-space: nowrap; }
#task .subject.math { background: #ffcf4a; } #task .subject.mova { background: #ff8fb1; } #task .subject.yds { background: #7be0a2; } #task .subject.inf { background: #c3a6ff; }
#task .title { font-size: 34px; font-weight: 900; flex: 1; }
#task .partno { font-size: 22px; color: #9fb6e8; }
#task .prompt { font-size: 29px; line-height: 1.35; margin: 8px 0 12px; color: #eaf1ff; }
#task .body { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
#task .foot { display: flex; align-items: center; gap: 18px; min-height: 76px; }
#task .fb { flex: 1; font-size: 30px; font-weight: 800; }
#task .fb.good { color: #7be0a2; } #task .fb.bad { color: #ff8f8f; } #task .fb.tip { color: #ffe39a; font-size: 26px; line-height: 1.3; }
#task .reveal { margin-right: auto; }

/* choice */
.opts { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.opts.col { flex-direction: column; align-items: stretch; max-width: 1000px; margin: 0 auto; width: 100%; }
.opt {
  font-family: inherit; font-size: 30px; padding: 18px 28px; border-radius: 20px; border: 3px solid rgba(160,200,255,.5);
  background: rgba(255,255,255,.08); color: #fff; cursor: pointer; text-align: left; transition: background .15s, transform .15s;
}
.opt:hover { background: rgba(255,255,255,.16); }
.opt.sel { border-color: #ffcf4a; background: rgba(255,207,74,.18); }
.opt.ok { border-color: #7be0a2; background: rgba(123,224,162,.28); }
.opt.no { border-color: #ff8f8f; background: rgba(255,120,120,.25); }
.opt.pill { text-align: center; min-width: 170px; font-weight: 700; }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }

/* numbers */
.nums { display: flex; flex-direction: column; gap: 22px; max-width: 1150px; margin: 0 auto; width: 100%; }
.nrow { display: flex; align-items: center; gap: 18px; font-size: 30px; background: rgba(255,255,255,.06); padding: 14px 22px; border-radius: 18px; }
.nrow .q { flex: 1; line-height: 1.3; }
.nrow input {
  width: 150px; font-size: 34px; font-family: inherit; font-weight: 800; text-align: center; padding: 8px; border-radius: 14px;
  border: 3px solid rgba(160,200,255,.6); background: #fff; color: #0b1030;
}
.nrow input.ok { border-color: #2fbf71; background: #dff7e9; }
.nrow input.no { border-color: #e65656; background: #ffe3e3; }
.nrow .unit { min-width: 70px; color: #cfe0ff; }
/* [[N]] — відповідь попередньої дії: «?», поки її не обчислили */
.nrow .ref { display: inline-block; min-width: 1.6em; padding: 0 .25em; border-radius: 10px; text-align: center; font-weight: 800; color: #ffe9a8; background: rgba(255,207,74,.18); border: 2px dashed rgba(255,207,74,.7); line-height: 1.15; }
.nrow .ref.on { color: #7be0a2; background: rgba(123,224,162,.16); border: 2px solid rgba(123,224,162,.7); animation: refpop .45s ease; }
@keyframes refpop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* order */
.order { display: flex; gap: 14px; justify-content: center; flex-wrap: nowrap; align-items: stretch; }
.order.col { flex-direction: column; align-items: center; }
.card {
  background: rgba(255,255,255,.1); border: 3px solid rgba(160,200,255,.5); border-radius: 18px; padding: 14px 16px;
  font-size: 26px; font-weight: 700; cursor: grab; text-align: center; touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.order.col .card { width: 640px; font-size: 30px; }
.order.wrap { flex-wrap: wrap; max-width: 1100px; margin: 0 auto; row-gap: 22px; }
.order.arrows { gap: 58px; }
.order.arrows .card { position: relative; }
.order.arrows .card:not(:last-child)::after { content: '→'; position: absolute; right: -48px; top: 50%; transform: translateY(-50%); font-size: 42px; color: #ffe9a8; pointer-events: none; }
.card.drag { opacity: .55; border-style: dashed; }
.card.ok { border-color: #7be0a2; background: rgba(123,224,162,.25); }
.card.no { border-color: #ff8f8f; background: rgba(255,120,120,.22); }
.arrowhint { text-align: center; font-size: 24px; color: #9fb6e8; margin-top: 14px; }

/* sort */
.sort { display: flex; flex-direction: column; gap: 18px; height: 100%; }
.pool { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; min-height: 70px; padding: 10px; border-radius: 18px; background: rgba(255,255,255,.05); }
.zones { display: flex; gap: 18px; flex: 1; min-height: 0; }
.zone { flex: 1; border: 3px dashed rgba(160,200,255,.6); border-radius: 22px; padding: 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; background: rgba(255,255,255,.04); cursor: pointer; }
.zone .zt { font-size: 28px; font-weight: 900; color: #ffe9a8; }
.zone .zc { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.zone.hover { background: rgba(255,207,74,.15); border-color: #ffcf4a; }
.chip {
  font-size: 26px; font-weight: 700; padding: 10px 18px; border-radius: 16px; background: #eaf1ff; color: #0b1030; cursor: grab;
  border: 3px solid transparent; touch-action: none;
}
.chip.sel { border-color: #ffcf4a; box-shadow: 0 0 0 4px rgba(255,207,74,.4); }
.chip.ok { background: #c8f2d8; } .chip.no { background: #ffd0d0; }
.dragghost { position: fixed; pointer-events: none; z-index: 1000; transform-origin: 0 0; opacity: .9; }

/* build */
.answer { min-height: 92px; border-bottom: 4px solid rgba(160,200,255,.6); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; padding: 10px; margin-bottom: 26px; font-size: 30px; }
.answer.ok { border-color: #7be0a2; }

/* fill rows */
.fills { display: flex; flex-direction: column; gap: 16px; max-width: 1200px; margin: 0 auto; width: 100%; }
.frow { display: flex; align-items: center; gap: 16px; background: rgba(255,255,255,.06); border-radius: 18px; padding: 12px 20px; }
.frow .ft { flex: 1; font-size: 28px; line-height: 1.3; }
.frow .blank { display: inline-block; min-width: 120px; border-bottom: 3px solid #ffcf4a; text-align: center; color: #ffe9a8; font-weight: 800; }
.frow.done .blank { border-color: #7be0a2; color: #7be0a2; }
.frow .fo { display: flex; gap: 10px; }
.frow .opt { padding: 8px 18px; font-size: 26px; text-align: center; min-width: 64px; }
.frow.done .fo { visibility: hidden; }

/* blocks: програма для виконавця */
.blocks { display: flex; gap: 36px; align-items: center; justify-content: center; }
.bgrid { display: grid; gap: 6px; background: rgba(0,0,0,.25); padding: 8px; border-radius: 18px; position: relative; flex: none; }
.bgrid .cell { background: rgba(233, 140, 90, .55); border-radius: 12px; position: relative; display: flex; align-items: center; justify-content: center; font-size: 18px; color: rgba(255,255,255,.6); }
.bgrid.w-ice .cell { background: rgba(170, 215, 255, .45); } .bgrid.w-water .cell { background: rgba(120, 200, 140, .45); }
.bgrid .cell.wall::after { content: ""; width: 70%; height: 70%; border-radius: 50%; }
.bgrid.w-crater .cell.wall::after { background: radial-gradient(circle at 40% 40%, #5a2a17, #8a4a2c 60%, #c97a50); box-shadow: inset 4px 6px 10px rgba(0,0,0,.6); }
.bgrid.w-rock .cell.wall::after { border-radius: 40% 50% 35% 45%; background: radial-gradient(circle at 35% 30%, #a9a39a, #6f6a63 70%); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.bgrid.w-ice .cell.wall::after { border-radius: 14px; background: linear-gradient(135deg, #f4fbff, #9fd4f5); box-shadow: inset 0 0 0 3px #d9f0ff; }
.bgrid.w-water .cell.wall::after { width: 90%; height: 80%; border-radius: 40%; background: radial-gradient(circle at 50% 40%, #6fc3ff, #2b7cc4); }
.bgrid .cell.goalcell { box-shadow: inset 0 0 0 4px #ffcf4a; }
.bgrid .cell.hit { animation: hit .6s; } @keyframes hit { 30% { background: #ff6b6b; } }
.bgrid .actor { position: absolute; transform: translateX(-50%); transition: left .36s ease, top .36s ease; z-index: 3; pointer-events: none; }
.bgrid .actor .hull { display: block; width: 100%; position: relative; z-index: 1; }
/* батискаф: пілот у віконці під склом (як на сцені й на карті Атласу) */
.bgrid .actor .porthole { position: absolute; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 60%, #2f6f8f, #123a52); }
.bgrid .actor .pilot { position: absolute; left: 50%; top: 2%; height: 180%; width: auto; transform: translateX(-50%); }
.bgrid .actor .glass { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(ellipse at 30% 24%, rgba(255,255,255,.75) 0 7%, rgba(255,255,255,.18) 16%, rgba(255,255,255,0) 32%); box-shadow: inset 0 0 6px rgba(0,40,70,.45); }
.blocks.solved .bpal, .blocks.solved .bbtns { opacity: .45; pointer-events: none; }
.bgrid img.goal { position: absolute; transform: translateX(-50%); z-index: 1; pointer-events: none; }
.bgrid .item { position: absolute; transform: translateX(-50%); z-index: 2; transition: opacity .3s, transform .3s; pointer-events: none; }
.bgrid .item.got { opacity: 0; transform: translateX(-50%) scale(1.6); }
.bpanel { width: 560px; display: flex; flex-direction: column; gap: 11px; }
.blabel { font-size: 24px; color: #cfe0ff; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; white-space: nowrap; }
.blabel small { font-size: 16px; color: #8aa0cc; }
.bprog { min-height: 110px; max-height: 300px; overflow-y: auto; background: rgba(255,255,255,.07); border-radius: 18px; padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; align-items: flex-start; font-size: 36px; cursor: default; }
.bprog .blk { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: #eaf1ff; color: #0b1030; border-radius: 12px; font-weight: 900; cursor: pointer; }
.bprog .blk.cur { background: #ffcf4a; }
.bprog .rempty { font-size: 22px; color: #8aa0cc; align-self: center; padding: 0 6px; }
.bprog .rep { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; border: 3px dashed rgba(195,166,255,.7); background: rgba(195,166,255,.12); position: relative; cursor: pointer; }
.bprog .rep.active { border-style: solid; border-color: #c3a6ff; box-shadow: 0 0 0 4px rgba(195,166,255,.3); }
.bprog .rhead { font-family: inherit; font-size: 24px; font-weight: 900; border: none; border-radius: 10px; background: #c3a6ff; color: #1b1030; padding: 8px 10px; cursor: pointer; }
.bprog .rbody { display: flex; flex-wrap: wrap; gap: 6px; min-width: 60px; }
.bprog .rdel { font-family: inherit; border: none; background: transparent; color: #cfe0ff; font-size: 20px; cursor: pointer; padding: 4px; }
.bpal { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bpal .btn { font-size: 22px; padding: 10px 16px; }
.bpal .btn.blue { width: 80px; font-size: 34px; padding: 6px 0; }
.bpal .btn.rep-btn { background: #c3a6ff; box-shadow: 0 5px 0 #7d5fc4; }
.bbtns { display: flex; gap: 12px; justify-content: center; }
.bbtns .btn { font-size: 24px; padding: 10px 18px; }
.bcnt { text-align: center; font-size: 22px; color: #9fb6e8; min-height: 26px; }
/* blocks: умова «Якщо», дії, зони поля */
.bgrid.w-deep .cell { background: rgba(80, 170, 220, .45); }
.bgrid .cell.z-dark { background: rgba(8, 22, 60, .92); color: rgba(160, 200, 255, .75); transition: background .3s; }
.bgrid .cell.z-dark.lit { background: radial-gradient(circle, rgba(255, 240, 170, .9), rgba(70, 120, 170, .7) 72%); color: #0b1030; }
.bgrid .actor.f-light { filter: drop-shadow(0 0 10px #ffe9a8) drop-shadow(0 0 26px #ffd84a); }
.bprog .blk.act { background: #ffe39a; }
.bprog .iff { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; padding: 8px 40px 8px 10px; border-radius: 14px; border: 3px dashed rgba(123,224,162,.75); background: rgba(123,224,162,.1); position: relative; }
.bprog .iff.flash { box-shadow: 0 0 0 4px #7be0a2; }
.bprog .ihead { font-size: 22px; color: #bff3d2; }
.bprog .ihead b { color: #fff; }
.bprog .ibr { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 10px; border: 2px dashed rgba(123,224,162,.35); cursor: pointer; min-height: 52px; }
.bprog .ibr.active { border: 2px solid #7be0a2; background: rgba(123,224,162,.18); }
.bprog .itag { font-size: 20px; color: #bff3d2; min-width: 78px; }
.bprog .iff > .rdel { position: absolute; top: 6px; right: 6px; }
.bprog .rep .iff { flex-basis: auto; }
.bpal .btn.if-btn { background: #7be0a2; box-shadow: 0 5px 0 #3e9a64; }
.bpal .btn.act-btn { background: #ffe39a; box-shadow: 0 5px 0 #c9a23a; }

/* bars */
.bars svg text { font-family: inherit; fill: #eaf1ff; }

/* menu */
#menu .panel { width: 760px; padding: 30px 40px; display: flex; flex-direction: column; gap: 12px; }
#menu h2 { margin: 0 0 6px; font-size: 38px; color: #ffe9a8; }
#menu .lesson { font-size: 22px; color: #9fb6e8; margin-top: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
#menu .item { font-family: inherit; text-align: left; font-size: 27px; padding: 10px 20px; border-radius: 14px; border: 2px solid rgba(160,200,255,.35); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }
#menu .item:hover { background: rgba(255,255,255,.16); }
#menu .item.cur { border-color: #ffcf4a; }
#menu .row { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
#menu .close { position: absolute; top: 16px; right: 20px; }
/* довгий список глав прокручується всередині панелі: заголовок, ✕ і кнопки внизу завжди на екрані */
#menu .panel { max-height: 860px; box-sizing: border-box; }
#menu .chapters { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 10px; margin-right: -10px; }
#menu .chapters::-webkit-scrollbar { width: 10px; }
#menu .chapters::-webkit-scrollbar-thumb { background: rgba(160,200,255,.45); border-radius: 6px; }
#menu .chapters { scrollbar-color: rgba(160,200,255,.45) transparent; }
/* кнопка ☰ лишається над відкритим меню, щоб ним же меню й закрити */
#stage:has(#menu.on) #topbar { z-index: 80; }

/* fx */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
#fx img { position: absolute; }
.shakeStage { animation: stageShake .6s; }
@keyframes stageShake { 10%,50%,90% { translate: -12px 6px; } 30%,70% { translate: 12px -6px; } 0%,100% { translate: 0 0; } }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 25; }
.flash.go { animation: flash .7s; }
@keyframes flash { 15% { opacity: .85; } 100% { opacity: 0; } }
.dark { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity 1.2s; pointer-events: none; z-index: 24; }
.dark.on { opacity: 1; }

#endcard { z-index: 55; flex-direction: column; justify-content: flex-start; padding-top: 110px; background: linear-gradient(180deg, rgba(3,6,22,.75), rgba(3,6,22,.15) 60%); }
#endcard .t1 { font-size: 64px; font-weight: 900; color: #ffe9a8; text-align: center; max-width: 1300px; text-shadow: 0 6px 30px rgba(0,0,0,.7); }
#endcard .t2 { font-size: 34px; margin: 18px 0 36px; color: #d6e4ff; text-align: center; max-width: 1200px; }

/* ділення кутом */
.ldiv { --ld-w: 62px; display: grid; grid-auto-rows: 70px; justify-content: center; align-items: center; margin: 6px auto 0; font-size: 44px; font-weight: 800; }
.ldd, .ldm { text-align: center; }
.ldm { color: #cfe0ff; transform: translate(10px, -30px); font-size: 40px; }
.ldr { align-self: stretch; display: flex; flex-direction: column; }
.ldb { height: 70px; display: flex; align-items: center; padding-left: 14px; border-left: 4px solid #e9f0ff; border-bottom: 4px solid #e9f0ff; }
.ldq { display: flex; gap: 0; padding: 4px 0 0 14px; }
.ldc { width: 54px; height: 60px; margin: 0 4px; font-size: 38px; font-family: inherit; font-weight: 800; text-align: center; padding: 0; border-radius: 10px;
  border: 3px solid rgba(160,200,255,.6); background: #fff; color: #0b1030; }
.ldline { align-self: end; height: 4px; background: #e9f0ff; margin: 0 2px -3px; border-radius: 2px; pointer-events: none; }
.ldc.ok { border-color: #2fbf71; background: #dff7e9; } .ldc.no { border-color: #e65656; background: #ffe3e3; }

/* розділ для батьків */
#parents { z-index: 70; }
#parents .panel { width: 1260px; height: 820px; padding: 30px 44px; display: flex; flex-direction: column; }
#parents h2 { margin: 0 0 10px; font-size: 40px; color: #ffe9a8; }
#parents .close { position: absolute; top: 18px; right: 22px; }
#parents .gate { margin: auto; text-align: center; font-size: 30px; }
#parents .gate .grow { display: flex; gap: 16px; justify-content: center; margin-top: 10px; }
#parents .gate input { width: 180px; font-size: 36px; font-family: inherit; font-weight: 800; text-align: center; border-radius: 14px; border: 3px solid rgba(160,200,255,.6); padding: 8px; }
#parents .gate .err { color: #ff8f8f; min-height: 40px; font-size: 26px; }
#parents .main { display: none; flex-direction: column; min-height: 0; flex: 1; }
#parents.open .gate { display: none; } #parents.open .main { display: flex; }
#parents .sum { font-size: 26px; color: #d6e4ff; margin-bottom: 14px; line-height: 1.4; }
#parents .tabs { display: flex; gap: 10px; margin-bottom: 14px; }
#parents .tab { font-family: inherit; font-size: 24px; font-weight: 800; padding: 10px 24px; border-radius: 14px; border: 2px solid rgba(160,200,255,.35); background: rgba(255,255,255,.06); color: #cfe0ff; cursor: pointer; }
#parents .tab.on { background: #ffcf4a; color: #1b1030; border-color: #ffcf4a; }
#parents .pane { display: none; flex: 1; overflow-y: auto; font-size: 24px; padding-right: 8px; }
#parents .pane.on { display: block; }
#parents table { width: 100%; border-collapse: collapse; }
#parents td, #parents th { text-align: left; padding: 9px 10px; border-bottom: 1px solid rgba(160,200,255,.2); vertical-align: top; }
#parents th { color: #9fb6e8; font-size: 20px; text-transform: uppercase; letter-spacing: 1px; }
#parents td.no { color: #9fb6e8; width: 50px; } #parents td .codes { color: #8aa0cc; font-size: 18px; }
#parents .r-good { color: #7be0a2; font-weight: 800; } #parents .r-mid { color: #ffe39a; font-weight: 800; }
#parents .r-bad { color: #ff8f8f; font-weight: 800; } #parents .r-none { color: #8aa0cc; }
#parents .set section { margin-bottom: 26px; }
#parents .set h3 { margin: 0 0 8px; font-size: 28px; color: #ffe9a8; }
#parents .set p { margin: 6px 0; color: #d6e4ff; line-height: 1.4; }
#parents .set .line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#parents .set .wk { font-size: 34px; font-weight: 900; min-width: 70px; text-align: center; }
#parents .set .btn.sel { outline: 3px solid #ffcf4a; color: #ffe9a8; }
#parents .ch .lesson { font-size: 22px; color: #9fb6e8; margin: 12px 0 6px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
#parents .ch .item { display: block; width: 100%; margin-bottom: 8px; font-family: inherit; text-align: left; font-size: 26px; padding: 10px 20px; border-radius: 14px; border: 2px solid rgba(160,200,255,.35); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }
#menu .resume { align-self: center; margin: 6px 0; }

/* телефон вертикально */
#rotate { display: none; position: fixed; inset: 0; z-index: 100; background: #05060f; color: #ffe9a8; flex-direction: column; align-items: center; justify-content: center; font-family: inherit; text-align: center; }
#rotate div { font-size: 64px; } #rotate p { font-size: 24px; color: #d6e4ff; margin: 16px 30px; }
@media (orientation: portrait) and (max-width: 820px) { #rotate { display: flex; } }
