/* Shared style of the rocket lessons (/lab/fractions/, /lab/notables/). */
:root { --bg: #fdf6e3; --paper: #fff; --ink: #1f2937; --muted: #6b7280; --line: #e5e7eb; --accent: #f59e0b; --accent2: #3b82f6; --ok: #16a34a; --bad: #dc2626; --sky1: #0b1026; --sky2: #1e3a8a; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
a { color: var(--accent2); }
button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; padding: 10px 18px; background: var(--accent); color: #1f2937; font-weight: 700; box-shadow: 0 2px 0 #b45309; }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
button.ghost { background: #fff; border: 2px solid var(--line); box-shadow: none; }
input[type=number] { font: inherit; width: 4.2em; text-align: center; border: 2px solid #cbd5e1; border-radius: 10px; padding: 6px; font-size: 22px; font-weight: 700; }
input[type=number]:focus { outline: 3px solid #fde68a; border-color: var(--accent); }

.top { padding: 18px 16px 8px; max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 20px; }
.top h1 { margin: 0; font-size: 30px; line-height: 1.15; }
.top .crumbs { font-size: 14px; color: var(--muted); width: 100%; }
.top p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.top .tools { margin-left: auto; display: flex; gap: 8px; }
.top .tools button { background: #fff; border: 2px solid var(--line); box-shadow: none; padding: 6px 12px; font-size: 15px; }

.layout { max-width: 1240px; margin: 0 auto; padding: 8px 16px 60px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
#dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.dot { padding: 3px; background: transparent; box-shadow: none; border-radius: 8px; position: relative; opacity: .9; }
.dot.cur { outline: 3px solid var(--accent); background: #fff7ed; }
.dot.locked { opacity: .35; filter: grayscale(1); }
.dot .tick { position: absolute; right: -2px; top: -4px; background: var(--ok); color: #fff; font-size: 11px; border-radius: 50%; width: 17px; height: 17px; line-height: 17px; text-align: center; }

.section { background: var(--paper); border-radius: 18px; padding: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.05); }
.sec-head { display: flex; gap: 18px; align-items: flex-start; }
.badge { text-align: center; flex: 0 0 auto; }
.cardname { font-size: 12px; color: var(--muted); margin-top: 2px; font-style: italic; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); font-weight: 700; }
h2 { margin: 2px 0 6px; font-size: 26px; line-height: 1.2; }
.intro { margin: 0; color: #374151; }
.steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.step { position: relative; display: grid; grid-template-columns: minmax(0, auto) minmax(220px, 1fr); gap: 16px; align-items: center; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px 14px 44px; }
.step .num { position: absolute; left: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.step .vis:empty { display: none; }
.step:has(> .vis:empty), .step:not(:has(.vis)) { grid-template-columns: 1fr; }
.vis { display: flex; flex-wrap: wrap; justify-content: center; }
.vrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; }
figure { margin: 0; text-align: center; }
figcaption { font-size: 15px; color: #374151; margin-top: 2px; }
.op { font-size: 30px; font-weight: 800; color: #374151; }
.emoji { font-size: 34px; line-height: 1; }
.bigeq { font-size: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center; }
.bigeq .arrow { font-size: 14px; color: var(--muted); border: 1px dashed #cbd5e1; border-radius: 8px; padding: 2px 8px; }
.bigeq .tables { font-size: 18px; text-align: left; line-height: 1.7; }
.wrong { color: var(--bad); font-weight: 900; font-size: 26px; }
.ok { color: var(--ok); font-weight: 900; }
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; margin: 0 3px; font-weight: 700; }
.fr .n { border-bottom: 2px solid currentColor; padding: 0 4px; }
.fr .d { padding: 0 4px; }
.txt { font-size: 18px; }
.rule, .real { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 14px; }
.rule { background: #fef3c7; border: 2px solid #fcd34d; }
.real { background: #ecfdf5; border: 2px solid #86efac; }
.ic { font-size: 28px; line-height: 1; }
.exercise { margin-top: 20px; border: 3px dashed var(--accent2); border-radius: 16px; padding: 16px 18px; background: #eff6ff; }
.exercise h3 { margin: 0 0 8px; font-size: 20px; }
.exercise .q { font-size: 21px; margin: 10px 0; }
.answer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.answer.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.frac-input { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.frac-input .line { width: 4.2em; height: 3px; background: var(--ink); border-radius: 2px; }
.frac-input .fixed { font-size: 22px; font-weight: 700; padding: 6px; }
.fill { font-size: 24px; font-weight: 700; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.fill .fi { width: 3.2em; margin: 0 2px; }
.area text { font-family: "Segoe UI", system-ui, sans-serif; }
.work { display: grid; gap: 4px; font-size: 21px; }
.wl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.we { min-width: 200px; }
.wt { font-size: 13px; color: var(--muted); border: 1px dashed #cbd5e1; border-radius: 8px; padding: 1px 8px; }
.wl:not(:first-child) .we::before { content: "= "; color: var(--muted); }
.stack { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 4px; }
.stack > span { padding: 2px 8px; } .stack > span:first-child { border-bottom: 3px solid currentColor; }
.ti { font: inherit; font-size: 22px; font-weight: 700; border: 2px solid #cbd5e1; border-radius: 10px; padding: 6px 10px; width: 12em; max-width: 100%; }
.ti:focus { outline: 3px solid #fde68a; border-color: var(--accent); }
.syl { display: inline-flex; gap: 4px; margin: 4px 6px; font-size: 26px; font-weight: 700; }
.syl > span { padding: 4px 10px; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.syl > span.hit { background: var(--accent); border-color: #b45309; }
.wd { font-size: 30px; font-weight: 700; margin: 4px 10px; letter-spacing: .02em; }
.wd .key { color: #dc2626; text-decoration: underline; text-decoration-thickness: 3px; }
.wd .hole { display: inline-block; min-width: .8em; border-bottom: 3px solid #dc2626; color: transparent; }
.opt { background: #fff; border: 2px solid #bfdbfe; box-shadow: none; font-size: 20px; }
.opt.right { background: #dcfce7; border-color: var(--ok); }
.opt.wrongopt { background: #fee2e2; border-color: var(--bad); }
.feedback { margin-top: 10px; font-size: 18px; min-height: 1.2em; }
.feedback.ok { color: #166534; } .feedback.bad { color: #991b1b; }
.feedback.big { font-size: 22px; }
.muted { color: var(--muted); font-weight: 400; }
.secnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.lockmsg { font-size: 14px; color: var(--muted); flex: 1; }
.launch { font-size: 24px; padding: 14px 28px; background: linear-gradient(#fb7185, #e11d48); color: #fff; box-shadow: 0 3px 0 #9f1239; margin-top: 10px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* rocket column */
.rocket-col { position: sticky; top: 10px; background: linear-gradient(var(--sky1), var(--sky2)); color: #e2e8f0; border-radius: 18px; padding: 14px; overflow: hidden; }
.rocket-col h3 { margin: 0 0 4px; font-size: 18px; }
#rocket-count { font-size: 14px; color: #cbd5e1; }
.bar { height: 8px; background: rgba(255,255,255,.15); border-radius: 4px; margin: 8px 0; overflow: hidden; }
#rocket-bar { height: 100%; background: var(--accent); width: 0; transition: width .5s; }
#rocket-wrap { position: relative; }
#rocket { width: 100%; height: auto; display: block; }
#rocket-list { list-style: none; padding: 0; margin: 8px 0 0; columns: 2; font-size: 13px; color: #94a3b8; }
#rocket-list li.on { color: #fde68a; }
.piece { opacity: 0; transform: translateY(-14px); transition: opacity .6s, transform .6s; }
.piece.built { opacity: 1; transform: none; }
.piece.pop { animation: pop .7s; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.stars polygon { animation: twinkle 2.2s infinite; } .stars polygon:nth-child(2n) { animation-delay: .7s; } .stars polygon:nth-child(3n) { animation-delay: 1.3s; }
@keyframes twinkle { 50% { opacity: .35; } }
#piece-13.built .flame { animation: flick .18s infinite alternate; transform-origin: 120px 372px; }
@keyframes flick { to { transform: scaleY(1.25) scaleX(.9); } }
#rocket.launch #ship { animation: lift 3s ease-in forwards; }
@keyframes lift { 0% { transform: translateY(0); } 15% { transform: translateY(4px) translateX(2px); } 25% { transform: translateY(0) translateX(-2px); } 100% { transform: translateY(-560px); } }
#reward { margin-top: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 14px; padding: 12px 14px; text-align: center; }
.rw-head { font-size: 14px; color: #cbd5e1; font-weight: 700; }
.rw-big { font-size: 40px; font-weight: 900; color: #fde68a; line-height: 1.1; } .rw-big small { font-size: 18px; font-weight: 700; }
.rw-sub { font-size: 12px; color: #94a3b8; }
.rw-all { margin-top: 8px; font-size: 14px; color: #e2e8f0; }
.rw-hint { margin-top: 8px; font-size: 12px; color: #94a3b8; line-height: 1.35; }
.plus { color: #fde68a; }
.langlink { font-size: 14px; color: var(--muted); } .langlink a { font-weight: 700; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 80px); background: #1f2937; color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 17px; transition: transform .4s; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,.3); white-space: nowrap; }
#toast.show { transform: translate(-50%, 0); }
footer { max-width: 1240px; margin: 0 auto; padding: 0 16px 30px; color: var(--muted); font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
footer button { background: none; box-shadow: none; padding: 0; color: var(--accent2); font-weight: 400; text-decoration: underline; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .rocket-col { position: static; display: grid; grid-template-columns: 120px 1fr; gap: 0 12px; align-items: center; }
  .rocket-col h3, .rocket-col #rocket-count, .rocket-col .bar, .rocket-col #reward { grid-column: 2; }
  #rocket-wrap { grid-column: 1; grid-row: 1 / span 4; }
  #rocket-list { grid-column: 2; }
  .step { grid-template-columns: 1fr; padding-left: 16px; padding-top: 40px; }
  .top h1 { font-size: 24px; }
  body { font-size: 17px; }
}
@media (max-width: 480px) { .pie { width: 92px; height: 92px; } .section { padding: 16px 12px; } .bar { max-width: 100%; } }
