@font-face { font-family: "Nunito"; font-weight: 600; src: url(fonts/nunito-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-weight: 800; src: url(fonts/nunito-cyrillic-800-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-weight: 600; src: url(fonts/nunito-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF, U+2212, U+25B6; }
@font-face { font-family: "Nunito"; font-weight: 800; src: url(fonts/nunito-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF, U+2212, U+25B6; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #021022; overflow: hidden; font-family: "Nunito", "Segoe UI", Arial, sans-serif; font-weight: 600; }
body { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
b, strong, h1, h2, h3 { font-weight: 800; }

:root { --pan1: rgba(58, 36, 22, .97); --pan2: rgba(34, 21, 12, .97); --line: rgba(255, 205, 140, .55); --soft: #f6dfbd; --dim: #d9b98e; --gold: #ffe39a; }
html, body { background: #120a05; }
#stage {
  position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px;
  transform-origin: 50% 50%; overflow: hidden; background: #1d120a; color: #fff;
}
.bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .7s ease; }
.bg.on { opacity: 1; }

/* ---------- персонажі ---------- */
#chars { position: absolute; inset: 0; pointer-events: none; transition: opacity .4s; z-index: 3; }
.char { position: absolute; transform: translateX(-50%); transition: opacity .45s ease, filter .3s ease; opacity: 0; }
.char.on { opacity: 1; }
.char.dim { filter: brightness(.7) saturate(.85); }
.char > img { display: block; height: 100%; width: auto; position: relative; }
.char.flip { transform: translateX(-50%) scaleX(-1); }
.char.jump > img { animation: jump .9s ease-in-out 2; }
@keyframes jump { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-150px); } }
#stage.tasking #chars { opacity: .15; }
#stage.simon #chars, #stage.hubon #chars { opacity: 0; }
/* пробірка й планета */
.char.spin > img { animation: spinflat 30s linear infinite; }
@keyframes spinflat { from { transform: rotateX(60deg) rotate(0deg); } to { transform: rotateX(60deg) rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.char.hotglow > img { animation: hotglow 2.4s ease-in-out infinite; }
@keyframes hotglow { 0%,100% { filter: drop-shadow(0 0 10px rgba(255,120,40,.6)); } 50% { filter: drop-shadow(0 0 26px rgba(255,150,60,.95)); } }
.char.blink > img { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 0%,100% { filter: drop-shadow(0 0 4px #9fdcff); transform: scale(1); } 50% { filter: drop-shadow(0 0 26px #bfe8ff); transform: scale(1.08); } }
.char.clickme { pointer-events: auto; cursor: pointer; }
.char.icecreep > img {
  -webkit-mask-image: linear-gradient(#000 70%, transparent), linear-gradient(transparent, #000 30%);
  mask-image: linear-gradient(#000 70%, transparent), linear-gradient(transparent, #000 30%);
  mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; mask-position: top, bottom; -webkit-mask-position: top, bottom;
  animation: creep 3.4s ease-in forwards;
}
@keyframes creep { from { mask-size: 100% 0%, 100% 0%; -webkit-mask-size: 100% 0%, 100% 0%; } to { mask-size: 100% 75%, 100% 75%; -webkit-mask-size: 100% 75%, 100% 75%; } }

/* ---------- діалог ---------- */
#dialog {
  position: absolute; z-index: 30; left: 40px; right: 40px; bottom: 24px; min-height: 172px;
  background: rgba(40, 24, 14, .92); border: 3px solid var(--line); 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,.5); 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: #2a1608; box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
#dialog.withava { padding-left: 200px; }
#dialog.withava .name { left: 200px; }
#dialog .ava { display: none; position: absolute; left: 18px; bottom: 14px; width: 168px; height: 196px; background-size: contain; background-repeat: no-repeat; background-position: center bottom; }
#dialog.withava .ava { display: block; }
#dialog .name:empty { display: none; }
#dialog.narr .text { font-style: italic; color: var(--soft); }
#dialog .text b { color: var(--gold); }
#dialog .next {
  position: absolute; right: 26px; bottom: 22px; width: 92px; height: 92px; border-radius: 50%; border: none;
  background: #ffcf4a; color: #2a1608; 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; } }

/* ---------- верхні кнопки ---------- */
#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,.4);
  background: rgba(40, 24, 14, .75); color: #fff; font-size: 24px; font-weight: 800; cursor: pointer; font-family: inherit;
}
#topbar button:hover { background: rgba(90, 55, 30, .9); }

/* ---------- мініпанорама ---------- */
#minibar { position: absolute; top: 16px; left: 18px; z-index: 50; display: none; align-items: center; gap: 12px; cursor: pointer;
  background: rgba(40, 24, 14, .75); border: 2px solid rgba(255,255,255,.3); border-radius: 18px; padding: 7px 14px 7px 8px; }
#minibar.on { display: flex; }
#stage:has(.overlay.on) #minibar, #stage.hubon #minibar, #stage.simon #minibar { visibility: hidden; }
#minibar .tiles { display: flex; gap: 3px; }
.tile { width: 56px; height: 32px; background-size: cover; background-position: center; border-radius: 4px; position: relative; overflow: hidden; transition: filter 1s; }
.tile.grey { filter: grayscale(1) brightness(.45); }
.tile .tice { position: absolute; inset: 0; background-size: cover; opacity: 0; transition: opacity 1s; }
.tile.frozen .tice { opacity: 1; }
.tile.cur { outline: 3px solid var(--gold); outline-offset: -1px; }
#minibar .date { font-size: 21px; font-weight: 800; color: var(--gold); white-space: nowrap; }
#minibar .date:empty { display: none; }
#minibar:hover { border-color: var(--gold); }

/* ---------- панорама ---------- */
#pano { position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; transition: opacity .7s; overflow: hidden; background: #000; }
#stage.hubon #pano { opacity: 1; }
#pano .strip { position: absolute; left: 0; top: 0; height: 900px; width: 16000px; }
.seg { position: absolute; top: 0; width: 1600px; height: 900px; }
.seg .pimg, .seg .ice { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: filter 1.6s ease, opacity 2s ease; }
.seg .ice { opacity: 0; }
.seg.frozen .ice { opacity: 1; }
.seg.grey .pimg { filter: grayscale(1) brightness(.5) contrast(.85); }
.seg.grey .ice, .seg.grey.frozen .pimg { filter: grayscale(.35) brightness(.8); }
.seg .fog { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; pointer-events: none;
  background: radial-gradient(ellipse at 30% 60%, rgba(220,225,235,.35), transparent 60%), radial-gradient(ellipse at 75% 40%, rgba(220,225,235,.3), transparent 55%);
  animation: fogmove 9s ease-in-out infinite alternate; }
.seg.grey .fog { opacity: 1; }
@keyframes fogmove { to { transform: translateX(60px); } }
.seg.noanim *, .seg.noanim { transition: none !important; }
.seg .sparkles { position: absolute; inset: 0; pointer-events: none; }
.spark { position: absolute; width: 22px; height: 22px; background: radial-gradient(circle, #fff 0 20%, #ffe9a8 35%, rgba(255,233,168,0) 70%); animation: twinkle 1.4s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { transform: scale(.2); opacity: 0; } 50% { transform: scale(1.5); opacity: 1; } }

#hubcap { position: absolute; z-index: 26; top: 26px; left: 50%; transform: translateX(-50%); display: none; text-align: center; min-width: 760px; max-width: 1200px;
  background: rgba(30, 18, 10, .78); border: 2px solid var(--line); border-radius: 22px; padding: 12px 34px 14px; }
#stage.hubon #hubcap.on { display: block; animation: pop .4s ease; }
#hubcap .ht { font-size: 40px; font-weight: 800; color: var(--gold); }
#hubcap .hs { font-size: 26px; color: var(--soft); margin-top: 2px; }
#hubcap .hs:empty { display: none; }
#hubnext { position: absolute; z-index: 27; right: 40px; bottom: 180px; display: none; }
#hubnext.on { display: block; animation: pop .3s ease; }
#stage.hubon:has(#dialog.on) #hubnext { display: none; }

/* календар Землі */
#cal { position: absolute; z-index: 26; left: 80px; right: 80px; bottom: 24px; display: none; padding: 12px 26px 16px;
  background: rgba(30, 18, 10, .84); border: 2px solid var(--line); border-radius: 22px; transition: bottom .4s; }
#stage.hubon #cal { display: block; }
#stage.hubon:has(#dialog.on) #cal { bottom: 226px; }
#cal .ch { display: flex; align-items: baseline; gap: 22px; font-size: 22px; color: var(--dim); margin-bottom: 44px; }
#cal .ch b { font-size: 26px; color: var(--gold); }
#cal .ch .ev { flex: 1; color: #fff; font-weight: 800; font-size: 24px; }
#cal .bar { position: relative; display: flex; height: 40px; border-radius: 10px; overflow: visible; }
#cal .mon { position: relative; height: 100%; border-right: 2px solid rgba(30,18,10,.9); background: linear-gradient(180deg, #6b4a2c, #4a3018); display: flex; align-items: center; justify-content: center; }
#cal .mon:first-child { border-radius: 10px 0 0 10px; } #cal .mon:nth-child(12) { border-radius: 0 10px 10px 0; border-right: none; background: linear-gradient(180deg, #8a5a2a, #5a3518); }
#cal .mon span { font-size: 19px; color: #f3dcb8; font-weight: 800; }
#cal .marks { position: absolute; inset: 0; pointer-events: none; }
#cal .mk { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px #ffcf4a; border: 2px solid #3a2414; }
#cal .pin { position: absolute; top: -6px; bottom: -6px; width: 6px; margin-left: -3px; background: #ff6b5b; border-radius: 3px; box-shadow: 0 0 10px #ff6b5b; transition: left 1.4s cubic-bezier(.45,0,.25,1); }
#cal .pin b { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: #ff6b5b; color: #fff; font-size: 22px; padding: 2px 12px; border-radius: 10px; }
#cal .pin b::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -7px; border: 7px solid transparent; border-top-color: #ff6b5b; }

/* ---------- загальні панелі ---------- */
.overlay { position: absolute; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; background: rgba(20, 10, 4, .55); }
.overlay.on { display: flex; }
.panel {
  background: linear-gradient(180deg, var(--pan1), var(--pan2)); border: 3px solid var(--line);
  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: #2a1608; box-shadow: 0 5px 0 #c08a10;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c08a10; }
.btn.blue { background: #8fd0ff; box-shadow: 0 5px 0 #4a8fb8; }
.btn.ghost { background: transparent; color: var(--soft); box-shadow: none; border: 2px solid rgba(246,223,189,.5); font-size: 24px; padding: 10px 22px; }
.btn[disabled] { opacity: .4; cursor: default; }

/* ---------- старт і титри ---------- */
#start { z-index: 60; background: linear-gradient(180deg, rgba(20,10,4,.75), rgba(20,10,4,.05) 34%, rgba(20,10,4,0) 60%, rgba(20,10,4,.65)); flex-direction: column; justify-content: flex-start; }
#start h1 { font-size: 86px; margin: 26px 0 0; text-align: center; line-height: 1.05; text-shadow: 0 6px 30px rgba(0,0,0,.8); color: var(--gold); }
#start h1 small { display: block; font-size: 54px; margin: 0; color: #fff; text-shadow: 0 4px 20px rgba(0,0,0,.9); }
#start h2 { font-size: 28px; margin: 6px 0 0; font-weight: 600; color: var(--soft); text-shadow: 0 2px 10px rgba(0,0,0,.9); flex: 1; }
#start .row { display: flex; gap: 26px; justify-content: center; }
#start .heroes { position: absolute; bottom: 0; left: 0; right: 0; height: 420px; pointer-events: none; }
#start .heroes img { position: absolute; bottom: 20px; height: 330px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)); }
#start .load { margin: 14px 0 26px; font-size: 24px; color: var(--soft); height: 30px; text-shadow: 0 2px 8px #000; }

#titlecard { z-index: 55; flex-direction: column; background: rgba(20,10,4,.72); cursor: pointer; }
#titlecard .t0 { font-size: 34px; font-weight: 800; color: #1d120a; background: var(--gold); padding: 4px 26px; border-radius: 16px; margin-bottom: 18px; }
#titlecard .t0:empty { display: none; }
#titlecard .t1 { font-size: 80px; font-weight: 900; color: var(--gold); text-align: center; text-shadow: 0 6px 30px rgba(0,0,0,.7); animation: pop .5s ease; }
#titlecard .t2 { font-size: 38px; margin-top: 14px; color: var(--soft); }
#titlecard .hint { position: absolute; bottom: 40px; font-size: 24px; color: var(--dim); }

/* ---------- лист ---------- */
#letter { z-index: 45; }
#letter .paper { width: 1000px; padding: 56px 80px 40px; position: relative; color: #4a2c10; animation: unroll .6s ease;
  background: radial-gradient(ellipse at 50% 40%, #fbf1d8, #f0dcae 70%, #dcbf85); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 0 60px rgba(150,100,40,.35); }
#letter .paper::before { content: '🔬'; position: absolute; right: 40px; top: 26px; font-size: 64px; opacity: .8; }
@keyframes unroll { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#letter .ltext { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 34px; line-height: 1.45; }
#letter .ltext p { margin: 0 0 14px; }
#letter .lsign { font-family: Georgia, serif; font-style: italic; font-size: 34px; text-align: right; margin-top: 4px; }
#letter .lnext { display: block; margin: 22px auto 0; }

/* ---------- цікавий факт ---------- */
#fact { z-index: 45; }
#fact .fcard { width: 1080px; padding: 34px 50px 30px; border-radius: 30px; position: relative; animation: pop .35s ease;
  background: linear-gradient(180deg, var(--pan1), var(--pan2)); border: 4px solid var(--gold); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
#fact .flabel { position: absolute; top: -24px; left: 40px; background: var(--gold); color: #2a1608; font-weight: 800; font-size: 26px; padding: 6px 22px; border-radius: 14px; }
#fact .ftitle { font-size: 44px; font-weight: 800; color: var(--gold); margin-bottom: 10px; }
#fact .ftext { font-size: 33px; line-height: 1.42; }
#fact .fnext { display: block; margin: 22px 0 0 auto; }

/* ---------- завдання ---------- */
#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: #8fd0ff; color: #2a1608; white-space: nowrap; }
#task .subject.math { background: #ffcf4a; } #task .subject.mova { background: #ff9fbd; } #task .subject.yds { background: #8be3a8; }
#task .title { font-size: 34px; font-weight: 900; flex: 1; }
#task .partno { font-size: 22px; color: var(--dim); }
#task .prompt { font-size: 29px; line-height: 1.35; margin: 8px 0 12px; color: #fff4e2; }
#task .prompt b { color: var(--gold); }
#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: #8be3a8; } #task .fb.bad { color: #ff9f9f; }
#task .reveal { margin-right: auto; }

.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 var(--line);
  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,.2); }
.opt.ok { border-color: #8be3a8; background: rgba(123,224,162,.25); }
.opt.no { border-color: #ff8f8f; background: rgba(255,120,120,.25); }
.opt.pill { text-align: center; min-width: 170px; font-weight: 800; }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }

.nums { display: flex; flex-direction: column; gap: 20px; 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 .q b { color: var(--gold); }
.nrow input { width: 150px; font-size: 34px; font-family: inherit; font-weight: 800; text-align: center; padding: 8px; border-radius: 14px; border: 3px solid var(--line); background: #fff; color: #2a1608; }
.nrow input.ok { border-color: #2fbf71; background: #dff7e9; }
.nrow input.no { border-color: #e65656; background: #ffe3e3; }
.nrow .unit { min-width: 70px; color: var(--soft); }
.nrow .unit:empty { display: none; }

.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 var(--line); border-radius: 18px; padding: 14px 16px; font-size: 26px; font-weight: 800; 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; }
.card.drag { opacity: .55; border-style: dashed; }
.card.ok { border-color: #8be3a8; 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: var(--dim); margin-top: 14px; }

.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 var(--line); 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: var(--gold); }
.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: 800; padding: 10px 18px; border-radius: 16px; background: #fff3df; color: #2a1608; cursor: grab; border: 3px solid transparent; touch-action: none; }
.chip.sel { border-color: #ffcf4a; box-shadow: 0 0 0 4px rgba(255,207,74,.5); }
.chip.ok { background: #c8f2d8; } .chip.no { background: #ffd0d0; }
.dragghost { position: fixed; pointer-events: none; z-index: 1000; transform-origin: 0 0; opacity: .9; }

.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: var(--gold); font-weight: 800; }
.frow.done .blank { border-color: #8be3a8; color: #8be3a8; }
.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; }

/* шари Землі */
.layersw { display: flex; align-items: center; gap: 30px; height: 100%; }
.lsvg { height: 580px; width: auto; flex: none; }
.lsvg .lz { fill: var(--e); cursor: pointer; transition: fill .6s; }
.lsvg .lz:hover:not(.done) { fill: rgba(255,207,74,.3); }
.lsvg .lq { fill: none; stroke: rgba(255,230,190,.6); stroke-width: 3; stroke-dasharray: 12 9; pointer-events: none; }
.lsvg .lab { pointer-events: none; }
.lsvg .lab line { stroke: var(--gold); stroke-width: 3; }
.lsvg .lab circle { fill: var(--gold); stroke: #2a1608; stroke-width: 2; }
.lsvg .lab text { font: 800 38px Nunito, sans-serif; fill: var(--gold); }
.lcards { flex: 1; display: flex; flex-direction: column; gap: 22px; }
.lcard { font-size: 30px; padding: 18px 24px; text-align: center; }

/* з'єднати пари */
.matchw { display: flex; gap: 60px; justify-content: center; align-items: stretch; }
.mcol { display: flex; flex-direction: column; gap: 22px; width: 520px; }
.mcol.r { width: 600px; }
.mitem { font-weight: 800; text-align: center; min-height: 104px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.mitem small { display: block; font-size: 21px; font-weight: 600; color: var(--dim); }
.mitem.paired { cursor: default; }

/* текст із займенниками */
.tpick { position: relative; font-size: 34px; line-height: 2.05; max-width: 1180px; margin: 0 auto; background: rgba(255,248,232,.07); border-radius: 22px; padding: 26px 36px; }
.tok { background: rgba(255,207,74,.28); border-bottom: 3px dashed #ffcf4a; border-radius: 8px; padding: 0 8px; cursor: pointer; font-weight: 800; color: var(--gold); }
.tok:hover { background: rgba(255,207,74,.45); }
.tok.done { background: rgba(123,224,162,.28); border-bottom: 3px solid #8be3a8; color: #b9f5cd; cursor: default; }
.tmenu { position: absolute; z-index: 5; display: flex; width: max-content; gap: 10px; padding: 10px; background: #3a2414; border: 2px solid var(--gold); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.5); line-height: 1; }
.tmenu .opt { padding: 10px 18px; font-size: 28px; font-weight: 800; }

/* краплинки */
.dropsw { position: relative; height: 100%; display: flex; flex-direction: column; }
.dsky { position: relative; flex: 1; }
.drop2 { position: absolute; width: 170px; height: 160px; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none;
  animation: bob 3s ease-in-out infinite; transition: top .6s ease-in, opacity .6s; z-index: 2; }
.drop2::before { content: ''; position: absolute; inset: 14px; border-radius: 50% 0 50% 50%; transform: rotate(-45deg); background: radial-gradient(circle at 40% 60%, #ffffff 0 6%, #bfe8ff 24%, #5fb3ff 85%); border: 3px solid #e6f6ff; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.drop2 span { position: relative; top: 12px; font-size: 23px; font-weight: 800; color: #0d2a44; }
.drop2.dragging { animation: none; transition: none; z-index: 5; transform: scale(1.08); }
.drop2.no::before { background: radial-gradient(circle at 40% 60%, #fff 0 6%, #ffd0d0 24%, #ff8f8f 85%); }
.drop2.wrongw { opacity: .35; }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.dsea { --lvl: 40%; position: relative; height: 210px; border-radius: 0 0 24px 24px; overflow: hidden; background: rgba(255,255,255,.04); }
.dsea::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--lvl); background: linear-gradient(180deg, #3f8fc0, #154a74); transition: height .8s; }
.dsea .wave { position: absolute; left: -50px; right: -50px; bottom: calc(var(--lvl) - 14px); height: 28px; transition: bottom .8s;
  background: radial-gradient(circle at 20px -6px, transparent 18px, #3f8fc0 19px) 0 0 / 40px 28px repeat-x; animation: wave 3s linear infinite; }
@keyframes wave { to { transform: translateX(40px); } }
.dcount { position: absolute; right: 22px; bottom: 14px; font-size: 26px; font-weight: 800; color: #fff; text-shadow: 0 2px 6px #000; }

/* ---------- меню ---------- */
#menu { z-index: 70; }
#menu .panel { width: 780px; max-height: 860px; overflow: auto; padding: 30px 40px; display: flex; flex-direction: column; gap: 12px; }
#menu h2 { margin: 0 0 6px; font-size: 38px; color: var(--gold); }
#menu .chapters { display: flex; flex-direction: column; gap: 8px; }
#menu .lesson { font-size: 22px; color: var(--dim); margin-top: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
#menu .item { font-family: inherit; text-align: left; font-size: 26px; padding: 9px 20px; border-radius: 14px; border: 2px solid rgba(255,205,140,.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; }

/* ---------- ефекти ---------- */
#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.blue { background: #cfeeff; }
.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; }
.flake { position: absolute; top: -60px; color: #eaf8ff; text-shadow: 0 0 8px #bfe8ff; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(60px, 1000px) rotate(240deg); } }
.tmoon { position: absolute; }
.crumb { position: absolute; animation: crumb 1.3s ease-in forwards; }
@keyframes crumb { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

#hint { position: absolute; z-index: 26; top: 110px; left: 50%; transform: translateX(-50%); display: none; font-size: 32px; font-weight: 800; color: #2a1608;
  background: var(--gold); padding: 12px 30px; border-radius: 18px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
#hint.on { display: block; animation: nudgey 1.2s ease-in-out infinite; }
@keyframes nudgey { 50% { transform: translate(-50%, 8px); } }

#endcard { z-index: 55; flex-direction: column; background: radial-gradient(ellipse at center, rgba(20,10,4,.6), rgba(20,10,4,.88)); }
#endcard .t1 { font-size: 84px; font-weight: 900; color: var(--gold); text-align: center; max-width: 1300px; text-shadow: 0 6px 30px rgba(0,0,0,.7); animation: pop .6s ease; }
#endcard .t1:empty, #endcard .t2:empty { display: none; }
#endcard .t2 { font-size: 36px; margin: 18px 0 40px; color: var(--soft); text-align: center; max-width: 1200px; }
#endcard .row { display: flex; gap: 24px; }

/* ---------- симулятор ---------- */
#sim { position: absolute; inset: 0; z-index: 5; display: none; overflow: hidden; }
#sim.on { display: block; }
#sim.space { background: radial-gradient(ellipse at 22% 30%, #2a1840 0%, #0d0a1e 45%, #04030a 100%); }
#sim img { position: absolute; user-select: none; -webkit-user-drag: none; }
.stars { position: absolute; inset: 0; }
.stars i { position: absolute; border-radius: 50%; background: #fff; animation: tw 3s ease-in-out infinite alternate; }
@keyframes tw { to { opacity: .2; } }
#simmsg { position: absolute; z-index: 26; top: 26px; left: 50%; transform: translateX(-50%); display: none; max-width: 1180px; text-align: center;
  font-size: 32px; font-weight: 800; color: #fff; background: rgba(30, 18, 10, .82); border: 2px solid var(--line); border-radius: 20px; padding: 12px 30px; }
#simmsg.on { display: block; animation: pop .35s ease; }
#stage:has(#dialog.on) #simmsg { display: none; }
#simnext { position: absolute; z-index: 27; right: 40px; bottom: 40px; display: none; }
#simnext.on { display: block; animation: pop .3s ease; }
.simcount { position: absolute; left: 40px; bottom: 34px; font-size: 32px; font-weight: 800; color: var(--gold); background: rgba(30,18,10,.7); padding: 8px 22px; border-radius: 16px; }
/* зліпи планету */
#sim .dust { opacity: .85; animation: spinflat 90s linear infinite; transition: opacity 1s; pointer-events: none; }
.ysun { position: absolute; left: -160px; top: -160px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, #fff9d6 0 12%, #ffd36b 22%, rgba(255,170,60,.35) 45%, transparent 70%); transition: filter 2s; pointer-events: none; }
.ysun.bright { filter: brightness(1.3); }
.core { position: absolute; transition: left .4s, top .4s, width .4s, height .4s, filter .6s; aspect-ratio: 1; pointer-events: none; }
.core img { position: absolute !important; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 1.4s; }
.core .chot { opacity: 0; }
.core.molten .chot { opacity: 1; animation: hotglow 2.4s ease-in-out infinite; }
.core.molten .crock { opacity: 0; }
.core.bump { animation: bumpc .35s; }
@keyframes bumpc { 50% { transform: scale(1.08); } }
#sim img.fly { cursor: pointer; filter: drop-shadow(0 0 6px rgba(255,220,170,.5)); }
#sim img.fly:hover { filter: drop-shadow(0 0 14px rgba(255,220,120,1)); }
#sim img.suck { transition: left .6s ease-in, top .6s ease-in, width .6s ease-in, opacity .6s ease-in; }
/* Тейя */
#sim .earth { z-index: 2; animation: hotglow 2.4s ease-in-out infinite; }
#sim .teya { z-index: 3; filter: drop-shadow(0 0 10px rgba(255,120,80,.5)); }
#sim .deb { z-index: 3; }
#sim .moonb { z-index: 3; }
#sim .moonb.glowm { filter: drop-shadow(0 0 20px rgba(255,255,230,.8)); }
.tpath { position: absolute; left: 0; width: 1400px; border-top: 4px dashed rgba(255,200,150,.55); pointer-events: none; z-index: 1; }
.simflash { position: absolute; inset: 0; background: #fff; z-index: 10; animation: flash .8s forwards; pointer-events: none; }
.tctl { position: absolute; z-index: 6; left: 820px; right: 40px; bottom: 34px; background: rgba(30,18,10,.85); border: 2px solid var(--line); border-radius: 22px; padding: 16px 28px 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.tctl .tl { font-size: 30px; font-weight: 800; color: var(--gold); }
.tctl .trow { display: flex; align-items: center; gap: 16px; width: 100%; font-size: 22px; color: var(--soft); }
.tctl input[type=range] { flex: 1; height: 40px; accent-color: #ffcf4a; cursor: pointer; }
/* остуди планету */
.simbg { inset: 0; width: 100%; height: 100%; transition: filter .3s, opacity 1.8s; }
.simbg.next { opacity: 0; } .simbg.next.on { opacity: 1; }
.simbg.dim { transition: filter 1s; }
.heat { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 85%, rgba(255,90,20,.55), transparent 65%); mix-blend-mode: screen; pointer-events: none; transition: opacity .3s; }
.steam { position: absolute; inset: 0; pointer-events: none; transition: opacity .8s; }
.steam i { position: absolute; bottom: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.55), rgba(255,255,255,0) 70%); animation: steam linear infinite; }
@keyframes steam { from { transform: translateY(0) scale(.5); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-640px) scale(1.8); opacity: 0; } }
.water { position: absolute; left: 0; right: 0; bottom: 0; height: 0; opacity: 0; background: linear-gradient(180deg, rgba(70,110,140,.95), rgba(25,50,75,.98)); transition: height 1.2s ease, opacity 1.5s; pointer-events: none; }
.water .wave { position: absolute; left: -50px; right: -50px; top: -14px; height: 28px; background: radial-gradient(circle at 20px -6px, transparent 18px, rgba(70,110,140,.95) 19px) 0 0 / 40px 28px repeat-x; animation: wave 3s linear infinite; }
.water.gone { opacity: 0 !important; }
.rainl { position: absolute; inset: 0; pointer-events: none; }
.rainl i { position: absolute; width: 3px; height: 26px; border-radius: 2px; background: linear-gradient(transparent, #cfe9ff); animation: rain 1s linear infinite; }
@keyframes rain { from { transform: translateY(0); opacity: .9; } to { transform: translateY(700px); opacity: .2; } }
#sim img.scloud { cursor: pointer; animation: cloudin 1.2s ease backwards; transition: opacity 1.5s, filter .3s; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
#sim img.scloud:hover { filter: drop-shadow(0 0 14px rgba(200,230,255,.9)); }
#sim img.scloud.rainy { animation: cshake .5s; }
#sim img.scloud.gone { opacity: 0; pointer-events: none; }
@keyframes cloudin { from { opacity: 0; transform: scale(.4); } }
@keyframes cshake { 30% { transform: translateY(6px) scale(1.04); } 60% { transform: translateY(-4px); } }
.thermo { position: absolute; z-index: 6; right: 50px; top: 100px; width: 170px; height: 640px; background: rgba(30,18,10,.85); border: 2px solid var(--line); border-radius: 26px; cursor: ns-resize; touch-action: none; transition: opacity 1.2s; }
.thermo .tt { text-align: center; font-size: 22px; color: var(--soft); margin-top: 12px; }
.thermo .tv { text-align: center; font-size: 32px; font-weight: 800; color: var(--gold); }
.thermo .tube { position: absolute; left: 63px; top: 110px; width: 44px; height: 430px; border-radius: 22px; background: rgba(255,255,255,.15); border: 3px solid #fff; }
.thermo .fill { position: absolute; left: 6px; right: 6px; bottom: 0; border-radius: 16px; background: linear-gradient(0deg, #ff5a2e, #ffb04a); }
.thermo .bulb { position: absolute; left: 50px; top: 528px; width: 70px; height: 70px; border-radius: 50%; background: #ff5a2e; border: 3px solid #fff; }
.thermo .knob { position: absolute; left: -26px; width: 90px; height: 64px; border-radius: 20px; background: #ffcf4a; color: #2a1608; font-size: 34px; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 0 #c08a10; animation: nudgey2 1.4s ease-in-out infinite; }
@keyframes nudgey2 { 50% { transform: translateY(10px); } }
.thermo .mark { position: absolute; left: -16px; right: -16px; border-top: 3px dashed #8fd0ff; }
.thermo .mark span { position: absolute; right: -78px; top: -16px; font-size: 20px; color: #8fd0ff; font-weight: 800; }
.thermo.locked { cursor: default; } .thermo.locked .knob { display: none; }
.thermo.gone { opacity: 0; }
/* кисень */
.otint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(60,40,80,.45), rgba(20,30,40,.3)); pointer-events: none; transition: opacity 1s; }
#sim img.strom { cursor: pointer; filter: drop-shadow(0 0 6px rgba(180,255,200,.35)); animation: sglow 1.8s ease-in-out infinite; z-index: 2; }
#sim img.strom.puff { animation: puff .4s; }
#sim img.strom.done { animation: none; cursor: default; filter: none; }
@keyframes sglow { 50% { filter: drop-shadow(0 0 14px rgba(200,255,210,.75)); } }
@keyframes puff { 50% { transform: scale(1.06); } }
.obub { position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.8) 0 18%, rgba(200,255,230,.1) 45%); animation: obub 2.6s ease-out forwards; pointer-events: none; z-index: 3; }
@keyframes obub { to { transform: translate(20px, -420px); opacity: 0; } }
.ometer { position: absolute; z-index: 6; right: 50px; top: 100px; width: 150px; height: 470px; background: rgba(30,18,10,.85); border: 2px solid var(--line); border-radius: 24px; text-align: center; }
.ometer .tt { font-size: 24px; color: var(--soft); margin-top: 12px; }
.ometer .ov { font-size: 34px; font-weight: 800; color: #8be3a8; }
.ometer .obar { position: absolute; left: 50px; top: 110px; bottom: 24px; width: 50px; border-radius: 16px; border: 3px solid #fff; overflow: hidden; background: rgba(255,255,255,.12); }
.ometer .ofill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, #2fbf71, #9cf5c0); transition: height .5s; }
.ometer.full { box-shadow: 0 0 30px #8be3a8; }
#sim .sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 4; }

/* ===================== Урок 2 ===================== */
/* фото в картці факту */
#fact .fimg { float: right; width: 300px; max-height: 300px; object-fit: contain; margin: -10px 0 10px 24px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5)); }
#fact .ftext::after { content: ''; display: block; clear: both; }
/* картки з динозаврами в сортуванні */
.chip:has(img) { width: 172px; text-align: center; padding: 6px 8px; font-size: 21px; }
.chip img { display: block; height: 72px; margin: 0 auto 4px; max-width: 100%; object-fit: contain; pointer-events: none; }
.chip b { display: block; }
.chip span { display: block; font-size: 16px; font-weight: 600; line-height: 1.2; }
.chip u { text-decoration-color: #c08a10; text-decoration-thickness: 3px; text-underline-offset: 4px; }
/* вибір із картинками */
.opts.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; max-width: 1200px; margin: 0 auto; }
.opts.grid .opt { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px; font-size: 22px; font-weight: 800; }
.opts.grid .opt img { height: 108px; max-width: 100%; object-fit: contain; margin-bottom: 4px; pointer-events: none; }
/* прислівники */
.cw { cursor: pointer; border-radius: 8px; padding: 0 3px; transition: background .2s; }
.cw:hover { background: rgba(255,207,74,.2); }
.cw.done { background: rgba(123,224,162,.35); color: #c9f7d8; font-weight: 800; cursor: default; }
.cw.no { background: rgba(255,120,120,.35); }
.cwcount { text-align: center; font-size: 28px; font-weight: 800; color: var(--gold); margin-top: 18px; }
/* мамонт */
.mamw { display: flex; gap: 30px; height: 100%; align-items: center; }
.mamleft { position: relative; width: 560px; height: 520px; flex: none; border: 3px dashed var(--line); border-radius: 26px; background: radial-gradient(ellipse at 50% 80%, rgba(230,245,255,.25), rgba(255,255,255,.03)); }
.mamleft img.m1, .mamleft img.m2 { position: absolute; left: 30px; right: 30px; top: 20px; width: 500px; height: 420px; object-fit: contain; transition: opacity 1.4s; }
.mamleft img.m2 { opacity: 0; }
.mamleft.dressed img.m1 { opacity: 0; } .mamleft.dressed img.m2 { opacity: 1; }
.mamleft.dressed { border-style: solid; border-color: #8be3a8; }
.mbadges { position: absolute; left: 14px; bottom: 50px; display: flex; gap: 8px; }
.mb img { width: 60px; height: 60px; border-radius: 50%; border: 3px solid #8be3a8; animation: pop .4s; }
.mcount { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 24px; font-weight: 800; color: var(--gold); }
.mamcards { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mcard { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 18px; background: rgba(255,255,255,.08); border: 3px solid var(--line); cursor: grab; touch-action: none; font-size: 22px; font-weight: 800; }
.mcard img { width: 76px; height: 76px; border-radius: 50%; pointer-events: none; }
.mcard.used { opacity: .25; cursor: default; border-color: #8be3a8; }
.mcard.no { border-color: #ff8f8f; background: rgba(255,120,120,.25); }
.mcard:last-child:nth-child(odd) { grid-column: span 2; justify-self: center; width: 50%; }
/* календар */
.calw { display: flex; flex-direction: column; gap: 26px; height: 100%; justify-content: center; }
.calpool { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.calcard { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; background: #fff3df; color: #2a1608; font-size: 23px; font-weight: 800; cursor: grab; touch-action: none; border: 3px solid transparent; }
.calcard b { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #2a1608; flex: none; }
.calcard small { font-size: 18px; color: #2f7d4a; }
.calcard small:empty { display: none; }
.calcard.sel { border-color: #ffcf4a; box-shadow: 0 0 0 4px rgba(255,207,74,.5); }
.calcard.no { background: #ffd0d0; }
.calcard.done { background: #c8f2d8; cursor: default; }
.calrow { display: flex; gap: 6px; }
.cm { flex: 1; min-height: 230px; border-radius: 14px; background: rgba(255,255,255,.07); border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 8px 4px; cursor: pointer; }
.cm.dec { flex: 1.8; background: rgba(255,207,74,.1); }
.cm:hover { background: rgba(255,207,74,.18); }
.cmn { font-size: 22px; font-weight: 800; color: var(--gold); margin-bottom: 8px; }
.cmp { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.cpin { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; color: #2a1608; animation: pop .4s; box-shadow: 0 3px 8px rgba(0,0,0,.4); }

/* сцена: вулкани */
.simcv { position: absolute; inset: 0; width: 1600px; height: 900px; }
.simcv.ice { transition: opacity 2.2s; }
.simcv.ice.gone { opacity: 0; }
.blanket { position: absolute; left: 0; right: 0; top: 0; height: 520px; opacity: 0; pointer-events: none; transition: opacity 1.2s;
  background: linear-gradient(180deg, rgba(255,150,80,.75), rgba(255,170,100,.35) 50%, transparent); mix-blend-mode: screen; }
#sim img.volc { cursor: pointer; filter: grayscale(.7) brightness(.7) drop-shadow(0 0 0 rgba(255,140,40,0)); animation: vpulse 1.6s ease-in-out infinite; transition: filter .6s, opacity 2s; z-index: 2; transform-origin: 50% 100%; }
#sim img.volc.awake { animation: vshake .6s; filter: drop-shadow(0 0 24px rgba(255,120,40,.9)); cursor: default; }
#sim img.volc.calm { opacity: 0; }
@keyframes vpulse { 50% { filter: grayscale(.4) brightness(.95) drop-shadow(0 0 14px rgba(255,200,120,.7)); } }
@keyframes vshake { 20%,60% { transform: translateX(-6px) scale(1.04); } 40%,80% { transform: translateX(6px) scale(1.04); } }
.vpuff { position: absolute; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, rgba(120,110,105,.85), rgba(120,110,105,0) 70%); animation: puff2 3.2s ease-out forwards; pointer-events: none; z-index: 3; }
@keyframes puff2 { from { transform: translate(-50%, 0) scale(.4); opacity: 0; } 15% { opacity: 1; } to { transform: translate(calc(-50% + 60px), -380px) scale(3); opacity: 0; } }
.ometer.heatm .ov { color: #ffb04a; }
.ometer.heatm .ofill { background: linear-gradient(0deg, #ff5a2e, #ffd36b); }
.ometer.heatm.full { box-shadow: 0 0 30px #ffb04a; }
/* вибух життя */
#sim img.life { opacity: 0; pointer-events: none; z-index: 2; }
#sim img.jelly { animation: lifein 1.5s forwards, jelly 4s ease-in-out infinite; }
#sim img.trilo { animation: lifein 1.5s forwards, trilo 9s linear infinite alternate; }
#sim img.fish { animation: fish 9s linear infinite; }
@keyframes lifein { to { opacity: .9; } }
@keyframes jelly { 50% { translate: 0 -18px; } }
@keyframes trilo { to { translate: 80px 0; } }
@keyframes fish { 0% { opacity: 0; transform: translateX(0) scaleX(-1); } 8% { opacity: .9; } 80% { opacity: .9; } 100% { opacity: 0; transform: translateX(850px) scaleX(-1); } }
.sprout { position: absolute; width: 18px; height: 26px; border-radius: 50% 0 50% 0; background: linear-gradient(135deg, #9be36b, #3f9a3a); opacity: 0; animation: sprout 1.2s ease-out forwards; z-index: 2; pointer-events: none; }
@keyframes sprout { from { opacity: 0; scale: 0; } to { opacity: 1; scale: 1; } }
/* Пангея */
#sim.ocean { background: radial-gradient(ellipse at 40% 50%, #2f6f9f, #163d63 60%, #0c2440); }
.pgsvg { position: absolute; inset: 0; width: 1600px; height: 900px; }
.pgsvg .tray { fill: rgba(30,18,10,.55); stroke: var(--line); stroke-width: 2; transition: opacity 1s; }
.pgsvg .tray.gone { opacity: 0; }
.pgsvg .slot { fill: rgba(255,255,255,.06); stroke: rgba(255,255,255,.3); stroke-width: 1.5; stroke-dasharray: 6 5; }
.pgsvg .piece { cursor: grab; }
.pgsvg .piece polygon.land { stroke: #3a2414; stroke-width: 1.6; stroke-linejoin: round; }
.pgsvg .piece polygon.shelf { fill: #6aa6bd; stroke: none; opacity: .75; }
.pgsvg .sil polygon { fill: rgba(140,200,225,.12); stroke: rgba(220,240,255,.55); stroke-width: 3; stroke-dasharray: 12 8; transition: fill 1.2s, stroke 1.2s; }
.pgsvg .sil.filled polygon { fill: #6aa6bd; stroke: #3d7690; stroke-dasharray: none; }
.pgsvg .slots { transition: opacity 1s; } .pgsvg .slots.gone { opacity: 0; }
.pgsvg .piece.drag polygon { filter: drop-shadow(0 10px 12px rgba(0,0,0,.5)); }
.pgsvg .piece.placed { cursor: default; }
.pgsvg .plab { font: 800 26px Nunito, sans-serif; fill: #2a1608; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(255,250,235,.7); stroke-width: 4px; }
.pgsvg .mount { fill: #8a5a32; stroke: #4a2c14; stroke-width: 2; transform-box: fill-box; transform-origin: 50% 100%; animation: mountup .8s ease-out backwards; }
@keyframes mountup { from { transform: scaleY(0); } }
.pgsvg .crack { fill: none; stroke: #ff6b3a; stroke-width: 6; stroke-dasharray: 10 6; transition: opacity .4s; opacity: 0; }
.pgsvg .atl { font: 800 23px Nunito, sans-serif; fill: #bfe8ff; text-anchor: middle; opacity: 0; letter-spacing: 1px; }
.tctl.dctl { left: 300px; right: 300px; }
/* гора з мушлею */
#sim.mtnsky { background: linear-gradient(180deg, #2a3a46, #34464f 30%, #2d3d47); }
#sim img.skyfill { left: 0; top: 0; width: 1600px; height: 900px; object-fit: cover; object-position: 50% 0; transform-origin: 50% 0; transform: scale(3); filter: blur(14px) brightness(.95); }
#sim img.zoombg { left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 530px 18px; transform: translate(270px, 260px) scale(1.6);
  -webkit-mask-image: linear-gradient(transparent, #000 9%); mask-image: linear-gradient(transparent, #000 9%); }
#sim img.snpeak { left: 782px; top: 197px; height: 120px; animation: pop .5s; z-index: 2; }
#sim img.srock { left: 838px; top: 262px; width: 100px; cursor: pointer; z-index: 3; filter: drop-shadow(0 0 16px rgba(255,230,140,.9)); animation: pop .5s, rockglow 1.6s ease-in-out infinite; transition: all .8s cubic-bezier(.3,1.3,.5,1); }
@keyframes rockglow { 50% { filter: drop-shadow(0 0 28px rgba(255,235,150,1)); } }
#sim img.srock.big { left: 560px; top: 280px; width: 480px; animation: none; cursor: default; filter: drop-shadow(0 12px 30px rgba(0,0,0,.6)); }
/* астероїд */
#sim img.ast { left: 1500px; top: -260px; width: 260px; z-index: 3; transition: left 2.6s ease-in, top 2.6s ease-in, width 2.6s ease-in; }
#sim img.ast.go { left: 900px; top: 380px; width: 80px; }
.dustl { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 2.5s; background: radial-gradient(ellipse at 60% 50%, rgba(110,95,85,.95), rgba(60,52,48,.98)); }
.dustl.on { opacity: .92; } .dustl.thin { opacity: .35; }
/* збільшена картка динозавра під час перетягування */
.dragghost.zoom { width: 400px !important; padding: 14px 18px 18px; border-radius: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.6); border: 4px solid #ffcf4a; opacity: 1; }
.dragghost.zoom img { height: 250px; }
.dragghost.zoom b { font-size: 34px; }
.dragghost.zoom span { font-size: 23px; line-height: 1.25; margin-top: 4px; }
/* панорама-повторення */
.rev { position: absolute; z-index: 27; top: 400px; width: 90px; height: 90px; border-radius: 50%; border: 3px solid var(--line); background: rgba(30,18,10,.8); color: var(--gold); font-size: 40px; cursor: pointer; display: none; }
.rev.on { display: block; }
.rev:disabled { opacity: .3; cursor: default; }
#revL { left: 30px; } #revR { right: 30px; }
.char.fadein > img { animation: fadein 2.4s ease forwards; opacity: 0; }
@keyframes fadein { to { opacity: 1; } }
/* диплом */
#diploma { z-index: 56; flex-direction: column; background: rgba(20,10,4,.8); overflow: hidden; }
.dip { position: relative; height: 760px; aspect-ratio: 1100 / 1000; animation: pop .6s ease; }
.dip > img { position: relative; width: 100%; height: 100%; display: block; }
.dip::before { content: ''; position: absolute; left: 12%; right: 12%; top: 11%; bottom: 13%; border-radius: 12px; background: radial-gradient(ellipse at 50% 40%, #fffaf0, #f6e7c8); }
.dtext { position: absolute; left: 19%; right: 19%; top: 17%; bottom: 22%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #3a2414; }
.dtext .d1 { font-size: 60px; font-weight: 900; letter-spacing: 3px; text-transform: uppercase; color: #c0392b; }
.dtext .d2 { font-size: 40px; font-weight: 800; color: #1d4f8a; margin-bottom: 10px; }
.dtext .d3 { font-size: 26px; }
.dtext input { font-family: inherit; font-size: 36px; font-weight: 800; text-align: center; width: 90%; margin: 8px 0 12px; padding: 6px 10px; border: none; border-bottom: 3px dashed #a07040; background: transparent; color: #3a2414; outline: none; }
.dtext input::placeholder { color: #b89a78; font-weight: 600; font-size: 26px; }
.dtext .d4 { font-size: 24px; line-height: 1.35; }
.dtext .d5 { font-size: 26px; font-style: italic; font-family: Georgia, serif; margin-top: 12px; }
#diploma .dnext { position: absolute; right: 40px; bottom: 40px; }
.confetti { position: absolute; top: -20px; width: 14px; height: 22px; border-radius: 3px; animation: fall linear forwards; }

.fills:has(.frow:nth-child(7)) { gap: 8px; }
.fills:has(.frow:nth-child(7)) .frow { padding: 6px 18px; }
.fills:has(.frow:nth-child(7)) .frow .ft { font-size: 25px; }
.fills:has(.frow:nth-child(7)) .frow .opt { padding: 5px 14px; font-size: 23px; }
.sort:has(.chip img) .pool { flex-wrap: nowrap; }
#cal .pin.right b { left: auto; right: -10px; transform: none; }
#cal .pin.right b::after { left: auto; right: 6px; }
#cal .pin.left b { left: -10px; transform: none; }
#cal .pin.left b::after { left: 6px; }

/* перегляд панорами посеред уроку: усе інше на паузі */
#stage.peek #dialog, #stage.peek #sim, #stage.peek #simmsg, #stage.peek #simnext, #stage.peek #hint, #stage.peek #chars, #stage.peek #fx { visibility: hidden; }
#stage.peek #hubnext.on { display: block !important; }
#stage.peek #cal { bottom: 24px !important; }
#peekclose { position: absolute; z-index: 60; top: 18px; right: 92px; width: 60px; height: 60px; border-radius: 18px; border: 2px solid var(--gold);
  background: rgba(30,18,10,.85); color: var(--gold); font-size: 30px; font-weight: 900; cursor: pointer; display: none; }
#peekclose.on { display: block; }
#peekclose:hover { background: rgba(90,55,30,.95); }
/* вибух життя — лише у воді */
.lifebox { position: absolute; inset: 0; pointer-events: none; z-index: 2;
  clip-path: polygon(0 528px, 200px 542px, 400px 562px, 600px 606px, 750px 652px, 900px 692px, 1050px 704px, 1150px 744px, 1250px 804px, 1350px 900px, 0 900px); }

#cal .range { position: absolute; top: -6px; bottom: -6px; display: none; border-radius: 8px; background: rgba(255,107,91,.4); border: 3px solid #ff6b5b; box-shadow: 0 0 12px rgba(255,107,91,.7); transition: left 1s, width 1s; }
#cal .range.on { display: block; }
#cal .range b { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: #ff6b5b; color: #fff; font-size: 22px; padding: 2px 12px; border-radius: 10px; }
#cal .range.right b { left: auto; right: -10px; transform: none; }

.dragghost { font-family: Nunito, sans-serif; }

/* ===== «Світ Мурка»: нові завдання і бонуси ===== */
/* бонус «розв'язати чи пропустити» в діалозі */
.achoices { display: flex; gap: 20px; margin-top: 16px; }
.achoices .btn { font-size: 28px; padding: 12px 30px; }
/* сорт за родами: підпис-питання під назвою стовпчика */
.zone .zt small { display: block; font-size: 20px; font-weight: 600; opacity: .8; }
/* схема з відрізками */
.segsvg { display: block; width: 860px; margin: 8px auto 0; }
.segsvg text { font: 800 28px Nunito, sans-serif; fill: #fff3d6; }
/* слайд-довідка */
.slidew { display: flex; gap: 28px; align-items: flex-start; }
.sprev { position: relative; flex: none; width: 600px; height: 380px; background: #fffaf0; color: #2b1d10; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.45); padding: 22px 26px; display: flex; flex-direction: column; }
.sprev .stitle { font-size: 34px; font-weight: 800; color: #b5541c; border-bottom: 4px solid #f0c27a; padding-bottom: 8px; min-height: 52px; }
.sprev .sbody { display: flex; gap: 18px; flex: 1; margin-top: 14px; min-height: 0; }
.sprev .spic { width: 230px; flex: none; border-radius: 12px; background: #f1e6cf; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.sprev .spic img { max-width: 100%; max-height: 260px; object-fit: contain; }
.sprev .sfacts { margin: 0; padding-left: 26px; font-size: 22px; line-height: 1.3; }
.sprev .sfacts li { margin-bottom: 8px; }
.sprev .ph { color: #b9a989; font-style: italic; }
.sprev .stitle.ph { color: #c7b694; }
.sprev .sno { position: absolute; right: 18px; bottom: 10px; font-size: 16px; color: #a8957a; }
.sside { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sside .sg { font-size: 20px; font-weight: 800; color: var(--gold); margin-top: 4px; }
.sopts { display: flex; flex-wrap: wrap; gap: 8px; }
.sopts .opt { font-size: 19px; padding: 6px 12px; min-height: 0; line-height: 1.2; }
.sopts .opt.sel { outline: 4px solid var(--gold); }
.sopts .spick { padding: 4px 10px; }
.sopts .spick img { height: 62px; display: block; pointer-events: none; }
.sopts.f { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sopts.f .opt { text-align: left; font-size: 18px; }
