/* Golang Course's shared styles: the cabinet and lessons, the «spread» layout.
   Include with: <link rel="stylesheet" href="/css/lesson.css">.
   Anything specific to a lesson (puzzles, games) is written in the lesson itself and uses the variables below.
   Only computers with a keyboard are supported; phones and tablets get a placeholder.

   There is one theme — «Sky», light: its colours are the variables below. */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- «Sky» ---------- */
:root {
  --bg: #EEF4FB; --bg-alt: #F3F7FC; --card: #FFFFFF; --ink: #17324A; --ink-soft: #5A7088; --line: #DCE6F0;
  --sky: #1CACD1; --sky-deep: #1F7FC0; --on-sky-deep: #FFFFFF; --sun: #FFC93C;
  --coral: #FF6B55; --coral-deep: #E2503B; --on-coral: #FFFFFF; --leaf: #2EAD72; --on-leaf: #FFFFFF; --warn: #F2A900;
  --code-bg: #10263A; --code-ink: #E2EEF6; --code-ink-soft: #7F9BB0; --term-bg: #0B1D2D;
  --tok-kw: #FF8A78; --tok-fn: #5CCBF0; --tok-str: #FFD166; --tok-num: #7EE0A6; --tok-cm: #7F9BB0;
  --shadow: 0 10px 30px -18px rgba(23, 50, 74, .35);
  --radius: 16px;
  --font: 'Rubik', system-ui, sans-serif;
  --head: var(--font);
  --page-image: radial-gradient(700px 240px at 12% 0%, color-mix(in srgb, #fff 70%, transparent), transparent 70%);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1rem/1.55 var(--font); /* 16 px in the cabinet; lessons have a larger root (see lesson.html) */
  background-image: var(--page-image);
  background-attachment: fixed;
}
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; color: var(--ink); }
a { color: inherit; }
button { font: inherit; }
code, .mono { font-family: 'JetBrains Mono', monospace; }
[hidden] { display: none !important; }

/* ---------- Phones and tablets: not supported ----------
   A tablet is recognised not only by its width (an iPad in landscape is wider than many laptops) but by its
   screen: touch, no mouse. A narrow window on a computer gets the placeholder too — a lesson needs a big screen. */
.phone-stub { display: none; }
@media (max-width: 1023px), (max-height: 599px), (hover: none) and (pointer: coarse) {
  .app { display: none !important; }
  .phone-stub {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    min-height: 100vh; padding: 32px 24px; text-align: center;
  }
  .phone-stub svg { width: 110px; height: 110px; }
  .phone-stub h1 { font-size: 1.5rem; }
  .phone-stub p { margin: 0; color: var(--ink-soft); max-width: 32ch; }
}

/* ---------- Skeleton: header + a full-height «spread» ---------- */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.l-top {
  flex-shrink: 0; display: flex; align-items: center; gap: 20px; padding: 10px 24px;
  background: color-mix(in srgb, var(--card) 85%, transparent); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.2rem; text-decoration: none; }
.brand svg { width: 32px; height: 32px; }
.crumb { font-size: .92rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crumb a { color: var(--sky-deep); text-decoration: none; font-weight: 500; }
.crumb b { color: var(--ink); font-weight: 500; }
.l-steps { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.l-steps > span {
  display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 500; color: var(--ink-soft);
  padding: 5px 11px; border-radius: 999px; background: var(--bg-alt); white-space: nowrap;
}
.l-steps > span.done { color: var(--leaf); }
.l-steps > span.cur { background: var(--sky-deep); color: var(--on-sky-deep); }
.l-steps i { font-style: normal; font-weight: 600; }
@media (max-width: 1100px) { .l-steps > span:not(.cur) .lbl { display: none; } }
.save-status { margin-left: auto; font-size: .82rem; color: var(--ink-soft); white-space: nowrap; }
.save-status.ok { color: var(--leaf); }
.save-status.err { color: var(--coral-deep); }
.save-status + .l-steps { margin-left: 0; }

.app > main { flex: 1; min-height: 0; display: flex; }
.stage { flex: 1; min-height: 0; min-width: 0; }

.spread { display: grid; grid-template-columns: minmax(360px, .95fr) 1.05fr; }
.page {
  overflow: auto; padding: 26px 30px 0; display: flex; flex-direction: column; gap: 18px;
  background: var(--card); border-right: 1px solid var(--line);
}
.page > * { max-width: 720px; }
.work { min-height: 0; min-width: 0; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }

/* The «Back / Next» buttons are always visible at the bottom of the page */
.nav {
  margin-top: auto; position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 10px;
  padding: 14px 0 20px; background: linear-gradient(transparent, var(--card) 14px);
}

.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sky-deep); margin: 0 0 6px; }
.stage-title { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.lead { margin: 0; color: var(--ink-soft); }

/* ---------- Gosha speaks ---------- */
.golang-course-row { display: flex; gap: 14px; align-items: flex-start; }
.golang-course-avatar { flex-shrink: 0; width: 60px; height: 60px; }
.golang-course-bubble {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 12px 16px;
}
.golang-course-bubble p { margin: 0; }
.golang-course-bubble p + p { margin-top: 8px; }
.golang-course-bubble strong { color: var(--sky-deep); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; font-size: 1rem;
  padding: 12px 24px; border-radius: 999px; border: none; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--coral); color: var(--on-coral); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--coral) 80%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--coral-deep); }
/* A button waiting for the task to be done ([data-needs], usually «Дальше» / Next) is invisible until it is:
   its place in the row is kept, and when it appears it shakes and glows (.nudge) */
[data-needs]:disabled { visibility: hidden; }
/* …but the guided tour shows it while talking about it — the way it will appear: orange */
[data-needs]:disabled.guide-target { visibility: visible; }
/* «Show-only» buttons: visible only while the guided tour talks about them */
.guide-only { visibility: hidden; pointer-events: none; }
.guide-only.guide-target { visibility: visible; }
.btn-primary[data-needs]:disabled.guide-target {
  background: var(--coral); color: var(--on-coral); border: none; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--coral) 80%, transparent);
}
/* A disabled «Дальше» is grey: plainly waiting, while another button is the one to press */
.btn-primary:disabled { opacity: 1; background: var(--bg-alt); color: var(--ink-soft); border: 2px dashed var(--line); box-shadow: none; }
/* «Дальше» has just unlocked: it shakes briefly and glows with a ring — «press me» */
.btn.nudge { animation: nudge-shake .6s ease-in-out 3, nudge-glow 1.2s ease-out 4; }
@keyframes nudge-shake {
  0%, 100% { transform: none; }
  15% { transform: translateX(-5px) rotate(-1.5deg); }
  35% { transform: translateX(5px) rotate(1.5deg); }
  55% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
@keyframes nudge-glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--coral) 70%, transparent); }
  100% { box-shadow: 0 0 0 18px color-mix(in srgb, var(--coral) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .btn.nudge { animation: nudge-glow 1.2s ease-out 4; } }
.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-run { position: relative; background: var(--leaf); color: var(--on-leaf); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--leaf) 85%, transparent); }
.btn-run:hover { background: color-mix(in srgb, var(--leaf) 82%, #000); }
.btn-run svg { width: 16px; height: 16px; }
/* No focus ring on «Запустить»: it shows up after keyboard use (Ctrl+Enter, the guide's arrows) and looks
   like a stray frame; the button already stands out by its colour and pulse */
.btn-run:focus, .btn-run:focus-visible { outline: none; }
/* «Запустить» (Run) hasn't been pressed yet: the button pulses gently, and if the child does nothing for a while
   a hand appears over it (lesson.js, attention) */
.btn-run.attn { animation: run-pulse 1.6s ease-in-out infinite; }
@keyframes run-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--leaf) 55%, transparent); transform: scale(1); }
  50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--leaf) 0%, transparent); transform: scale(1.04); }
}
.attn-hand {
  position: absolute; left: 50%; top: 100%; z-index: 5; pointer-events: none; font-size: 2rem; line-height: 1;
  transform: translateX(-50%); animation: hand-tap 1s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
}
@keyframes hand-tap { 0%, 100% { margin-top: 6px; } 50% { margin-top: -4px; } }
@media (prefers-reduced-motion: reduce) { .btn-run.attn { animation: none; box-shadow: 0 0 0 5px color-mix(in srgb, var(--leaf) 35%, transparent); } .attn-hand { animation: none; } }
/* «Начать заново» (Start over) — on the same row as «Запустить», at the right edge and another colour (blue), so they aren't confused */
.btn-reset { background: color-mix(in srgb, var(--sky) 16%, var(--card)); color: var(--sky-deep); border: 2px solid color-mix(in srgb, var(--sky) 45%, var(--line)); }
.btn-reset:hover { background: color-mix(in srgb, var(--sky) 28%, var(--card)); border-color: var(--sky-deep); }
.btn-reset svg { width: 14px; height: 14px; }
.btn-sm { padding: 8px 11px; font-size: .84rem; gap: 5px; }
/* The editor's helper buttons («Покажи, как надо», «Начать заново») — on the right, level with «Запустить» */
.run-side { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.run-side .demo-btn { align-self: auto; padding: 8px 11px; font-size: .84rem; white-space: nowrap; }
.demo-btn { align-self: flex-start; padding: 9px 18px; font-size: .92rem; background: var(--bg-alt); color: var(--ink); border: 1px solid var(--line); }
.demo-btn:hover { border-color: var(--sky-deep); }

/* ---------- Read-only code (the story) ---------- */
.code-card { background: var(--code-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); flex-shrink: 0; }
.code-topbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.code-topbar i, .editor-topbar i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.code-topbar .fname, .editor-topbar .fname { margin-left: 6px; font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--code-ink-soft); }
.code-card pre {
  margin: 0; padding: 18px 20px; font-family: 'JetBrains Mono', monospace; font-size: .95rem; line-height: 1.7;
  color: var(--code-ink); white-space: pre-wrap; word-break: break-word;
}
.tok-kw { color: var(--tok-kw); font-weight: 600; }
.tok-fn { color: var(--tok-fn); font-weight: 600; }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-cm { color: var(--tok-cm); font-style: italic; }

/* «legend» hints */
.legend { display: grid; gap: 10px; }
.legend .row { display: flex; align-items: flex-start; gap: 12px; }
.legend .swatch {
  flex-shrink: 0; min-width: 38px; height: 28px; padding: 0 6px; border-radius: 8px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: .74rem; font-weight: 600;
  background: var(--code-bg);
}
.swatch.kw { color: var(--tok-kw); } .swatch.fn { color: var(--tok-fn); } .swatch.str { color: var(--tok-str); }
.swatch.num { color: var(--tok-num); } .swatch.cm { color: var(--tok-cm); }
.legend .row p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.legend .row p strong { color: var(--ink); font-weight: 600; }

/* «code → screen» */
.mini-term { background: var(--term-bg); border-radius: 14px; padding: 12px 16px; font-family: 'JetBrains Mono', monospace; font-size: .9rem; color: var(--code-ink); }
.mini-term .ttl { font-size: .74rem; color: var(--code-ink-soft); margin-bottom: 6px; }
.mini-term div + div { margin-top: 4px; }
.mini-term .n { display: inline-block; width: 1.4em; color: var(--sun); }
.work-label { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 4px 0 -6px; }

/* ---------- Tasks ---------- */
.task-card { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.task-card > p { margin: 0; font-weight: 500; }
/* The task is done: the card turns green, «Что сделано» (Done), with the success text at its bottom */
.task-card.done { background: color-mix(in srgb, var(--leaf) 14%, var(--card)); border-color: color-mix(in srgb, var(--leaf) 40%, transparent); }
.task-card .success-banner { background: none; border: none; border-top: 1px solid color-mix(in srgb, var(--leaf) 35%, transparent); border-radius: 0; padding: 10px 0 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: .97rem; }
.checklist li::before {
  content: ''; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px; border: 2px solid var(--line); background: var(--card);
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: var(--on-leaf);
}
.checklist li.ok::before { content: '✓'; background: var(--leaf); border-color: var(--leaf); }
.checklist li.ok > span { color: var(--ink-soft); }
.checklist .opt { font-size: .78rem; font-weight: 600; color: var(--warn); margin-left: 4px; }
.checklist code, .task-card code, .tip code, .feedback code {
  font-size: .85em; background: var(--card); border: 1px solid var(--line); padding: 0 6px; border-radius: 6px;
}
.tip { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: .94rem; background: color-mix(in srgb, var(--sun) 25%, var(--card)); }
.success-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-weight: 500;
  background: color-mix(in srgb, var(--leaf) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--leaf) 40%, transparent);
}

/* ---------- Editor ---------- */
.sandbox { display: grid; grid-template-rows: minmax(0, 1.4fr) auto minmax(0, 1fr); }
/* Command buttons under the editor take a row of their own */
.sandbox:has(> .chips) { grid-template-rows: minmax(0, 1.4fr) auto auto minmax(0, 1fr); }
.editor-card { display: flex; flex-direction: column; min-height: 0; background: var(--code-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.editor-topbar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.reset-btn {
  margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.2); color: var(--code-ink-soft);
  font-size: .78rem; padding: 4px 12px; border-radius: 999px; cursor: pointer;
}
.reset-btn:hover { color: var(--code-ink); border-color: rgba(255,255,255,.45); }
.code-editor { position: relative; flex: 1; min-height: 180px; }
.code-editor pre, .code-editor textarea {
  position: absolute; inset: 0; margin: 0; padding: 16px 20px; border: none; width: 100%; height: 100%; overflow: auto;
  font-family: 'JetBrains Mono', monospace; font-size: .9375rem; line-height: 1.75; white-space: pre-wrap; word-break: break-word; tab-size: 4;
}
.code-editor pre { color: var(--code-ink); pointer-events: none; }
.code-editor textarea { background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--code-ink); resize: none; }
.code-editor textarea:focus { outline: none; }

.run-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Program output ---------- */
.terminal { display: flex; flex-direction: column; min-height: 0; background: var(--term-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.term-head { padding: 9px 14px; font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--code-ink-soft); border-bottom: 1px solid rgba(255,255,255,.08); }
.term-body {
  flex: 1; overflow: auto; padding: 14px 18px; min-height: 110px;
  font-family: 'JetBrains Mono', monospace; font-size: .9375rem; color: var(--code-ink); display: flex; flex-direction: column; gap: 6px;
}
.term-line { display: flex; gap: 8px; opacity: 0; transform: translateY(4px); animation: rise .32s ease forwards; }
.term-line .mark { color: #5BD69B; flex-shrink: 0; }
/* Spaces a program prints are kept: pictures made of symbols are shifted with them */
.term-line .mark + span { white-space: pre-wrap; }
.term-line.blank { min-height: 1.2em; }
.term-line.blank .mark { opacity: .35; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .term-line { animation: none; opacity: 1; transform: none; } }
.term-empty { color: var(--code-ink-soft); font-style: italic; font-size: .9rem; }
.term-error { color: #FFD166; font-size: .92rem; line-height: 1.5; }
.term-error code { background: rgba(255,255,255,.08); padding: 0 5px; border-radius: 4px; }
.term-error .ico { margin-right: 6px; }
/* A program that asks (fmt.Scan): the child's answers, and the field for the next one */
.term-line.still { animation: none; opacity: 1; transform: none; }
.term-answer, .term-answer .mark { color: var(--sun); }
.term-answer .mark + span { font-weight: 700; }
.term-ask { display: flex; align-items: center; gap: 8px; }
.term-ask label { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.term-ask .mark { color: var(--sun); flex-shrink: 0; }
.term-ask input {
  flex: 1; min-width: 0; font: inherit; font-weight: 700; color: var(--sun); background: rgba(255,255,255,.06);
  border: 2px solid color-mix(in srgb, var(--sun) 55%, transparent); border-radius: 10px; padding: 6px 10px; caret-color: var(--sun);
  animation: ask-glow 1.6s ease-in-out infinite;
}
.term-ask input::placeholder { color: var(--code-ink-soft); font-weight: 400; font-style: italic; }
.term-ask input:focus { outline: none; border-color: var(--sun); }
.term-ask .term-send {
  font: inherit; font-weight: 800; cursor: pointer; border: none; border-radius: 10px; height: 36px; min-width: 44px;
  background: var(--sun); color: #17324A;
}
.term-ask .term-send:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.term-ask.sent input { animation: none; opacity: .7; }
.term-ask.sent .term-send { visibility: hidden; }
@keyframes ask-glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .term-ask input { animation: none; } }

/* ---------- Lesson finale ---------- */
.finale { display: flex; align-items: center; justify-content: center; overflow: auto; padding: 32px; }
.complete-wrap { text-align: center; max-width: 620px; }
.star-pop { font-size: 4.5rem; display: inline-block; animation: pop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .star-pop { animation: none; } }
.complete-wrap h2 { font-size: 2.2rem; margin-top: 8px; }
.complete-wrap .sub { color: var(--ink-soft); margin: 10px auto 0; max-width: 46ch; }
.complete-ctas { display: flex; gap: 14px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }

/* ---------- The program's frame around the editor (the frame option in lesson.js) ---------- */
.frame-part {
  position: relative; margin: 0; padding: 4px 20px; font-family: 'JetBrains Mono', monospace; font-size: .85rem; line-height: 1.6;
  white-space: pre; color: var(--code-ink); background: rgba(255,255,255,.05); opacity: .55; user-select: none; flex-shrink: 0;
}
.frame-head { padding-top: 10px; border-bottom: 1px dashed rgba(255,255,255,.18); }
.frame-foot { padding-bottom: 8px; border-top: 1px dashed rgba(255,255,255,.18); }
.frame-lock { position: absolute; right: 14px; top: 8px; font-size: .9rem; }
.frame-foot .frame-lock { display: none; }
.editor-card:has(.frame-head) .code-editor textarea, .editor-card:has(.frame-head) .code-editor pre { padding-left: 44px; } /* commands sit inside the frame — slightly to the right */

/* ---------- Command buttons ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chips-label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); width: 100%; margin-bottom: -2px; }
.chip {
  font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; min-height: 52px;
  font-size: 1.05rem; font-weight: 600; color: var(--ink); background: var(--card); border: 2px solid var(--sky); border-radius: 14px;
  box-shadow: 0 3px 0 var(--sky); transition: transform .08s, box-shadow .08s;
}
.chip:hover { background: color-mix(in srgb, var(--sky) 14%, var(--card)); }
.chip:active { transform: translateY(3px); box-shadow: none; }
.chip:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.chip code { font-family: 'JetBrains Mono', monospace; font-size: .85em; color: var(--sky-deep); }

/* ---------- Voice ---------- */
.has-say { position: relative; padding-right: 58px; }
.say-btn {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--card); font-size: 1.1rem; cursor: pointer; line-height: 1;
}
.say-btn:hover { border-color: var(--sky); }
.say-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ---------- Short lines for younger children ---------- */
.big-say { font-size: 1.25rem; line-height: 1.5; }
.big-say strong { color: var(--sky-deep); }

/* ---------- Guided tour (js/golang-course-guide.js): the page is dimmed, the part in question framed, a hint next to it ---------- */
.guide-layer { position: fixed; inset: 0; z-index: 300; }
.guide-spot {
  position: fixed; z-index: 301; pointer-events: none; border-radius: 20px; border: 3px solid var(--sun);
  box-shadow: 0 0 0 9999px rgba(12, 32, 52, .55); transition: top .25s, left .25s, width .25s, height .25s;
}
.guide-spot.none { top: 50%; left: 50%; width: 0; height: 0; border: 0; } /* a step without a part of the page — just the dimming */
.guide-tip {
  position: fixed; z-index: 302; width: 440px; max-width: calc(100vw - 24px); padding: 16px 18px; display: grid;
  grid-template-columns: 48px 1fr; gap: 12px; align-items: start; transition: top .25s, left .25s;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.guide-tip svg { width: 48px; height: 48px; }
.guide-tip b { display: block; font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.guide-tip p { margin: 0; color: var(--ink-soft); line-height: 1.45; font-size: .95rem; }
/* Buttons never overflow: if they don't fit in the row they wrap to the next one, on the right */
.guide-tip .g-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.guide-tip .g-foot .btn { flex-shrink: 0; }
.guide-tip .g-step { font-size: .82rem; color: var(--ink-soft); margin-right: auto; white-space: nowrap; }
.guide-tip .btn { padding: 7px 14px; font-size: .9rem; }
.guide-tip .btn:focus:not(:focus-visible) { outline: none; }
.guide-tip .g-skip { background: none; border: none; font: inherit; font-size: .85rem; color: var(--ink-soft); text-decoration: underline; cursor: pointer; padding: 4px; }
@media (prefers-reduced-motion: reduce) { .guide-spot, .guide-tip { transition: none; } }

/* ---------- Lesson kit (js/lesson-kit.js) ---------- */
.kit-predict, .kit-examples { display: flex; flex-direction: column; gap: 14px; }
.kit-guesses { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kit-guess {
  font: inherit; text-align: left; cursor: pointer; padding: 10px 12px; border-radius: 14px; background: var(--term-bg);
  color: var(--code-ink); border: 3px solid transparent; font-family: 'JetBrains Mono', monospace; font-size: .9rem; line-height: 1.6;
  display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); white-space: pre;
}
.kit-gl { font-size: .78rem; color: var(--code-ink-soft); margin-bottom: 4px; }
.kit-guess:hover:not(:disabled) { border-color: var(--sky); }
.kit-guess:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.kit-guess:disabled { cursor: default; }
.kit-guess.right { border-color: var(--leaf); }
.kit-guess.wrong { border-color: var(--coral); }
.kit-msg { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--bg-alt); border: 1px solid var(--line); }
.kit-msg.ok { background: color-mix(in srgb, var(--leaf) 14%, var(--card)); border-color: color-mix(in srgb, var(--leaf) 40%, transparent); }
.kit-msg.err { background: color-mix(in srgb, var(--coral) 12%, var(--card)); border-color: color-mix(in srgb, var(--coral) 40%, transparent); }
.kit-note p { margin: 0; }
.kit-count { font-size: .9rem; color: var(--ink-soft); margin: 0 0 4px; }
.kit-rounds { display: flex; gap: 6px; }
.kit-rounds i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.kit-rounds i.done { background: var(--leaf); }
.kit-rounds i.cur { box-shadow: 0 0 0 2px var(--sky-deep); }
.kit-ex-title { margin: 0; font-size: 1.15rem; }
.kit-ex-title span { margin-right: 6px; font-size: .85rem; font-weight: 500; color: var(--ink-soft); }
.kit-ex-nav { display: flex; gap: 10px; }
.kit-ex-nav .btn-primary { margin-left: auto; }
.kit-ex-nav [hidden] { display: none; } /* .btn's display would show a hidden button */
.kit-examples .code-card pre { max-height: 320px; overflow: auto; }

/* Code is shown as typed: no ligatures, so <= isn't drawn as ≤ (there's no such key) — JetBrains Mono's
   ligatures live in «calt» */
pre, code, textarea, .term-body, .kit-guess { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
