:root {
  --navy: #1b365d;
  --navy-2: #0d1c33;
  --teal: #0f6b5c;
  --teal-2: #14a38a;
  --gold: #e0b45a;
  --slate: #334155;
  --muted: #64748b;
  --line: #cbd5e1;
  --bg: #0f1a2b;
  --card: #f4f7fb;
  --red: #b91c1c;
  --red-bg: #fecaca;
  --amber: #92400e;
  --amber-bg: #fef3c7;
  --green: #166534;
  --green-bg: #dcfce7;
  --blue-bg: #dbeafe;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--kp-font, Outfit, "Noto Sans", "Noto Sans Arabic", "Noto Sans Ethiopic", system-ui, sans-serif);
  background:
    radial-gradient(900px 420px at 8% -20%, #1a4a40 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 0%, #4a3210 0%, transparent 48%),
    var(--bg);
  color: #e8eef4;
  font-size: 16px;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, .choice:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
h1, h2, h3 { margin: 0 0 .4rem; color: #f8fafc; }
.hidden { display: none !important; }
.top {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px;
  direction: ltr;
  background: #0a1628; color: #fff; padding: 8px 16px; min-height: 48px;
  position: sticky; top: 0; z-index: 30;
  border-bottom: 3px solid var(--gold);
}
#btn-menu {
  direction: ltr;
  position: relative;
  left: 0;
  margin-left: 0;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 48px;
  min-width: 48px;
  flex: 0 0 auto;
}
.menu-mark { font-size: 1.15rem; line-height: 1; }
.brand { font-weight: 800; letter-spacing: .08em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand em { color: var(--gold); font-style: normal; }
.pill {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  background: #12382f; color: #7dffd4; font-size: .72rem; font-weight: 800;
}
.meta { font-size: .85rem; opacity: .9; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.hero { text-align: center; padding: 12px 8px 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.02em; text-shadow: 0 4px 0 #000; }
body.big-type { font-size: 20px; }
body.big-type .btn, body.big-type .choice, body.big-type .poke { min-height: 48px; font-size: 1.05em; }
body.big-type h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.top-tools { gap: 6px; }
.top-tools .btn { min-height: 44px; }
.btn[aria-pressed="true"] { outline: 3px solid var(--gold); outline-offset: 2px; }
.aide-card {
  background: #fff7ed; color: #1b365d; border: 3px solid var(--gold);
  border-radius: 16px; padding: 12px 16px; margin: 0 0 12px;
}
.aide-card h3 { color: #1b365d; margin: 0 0 6px; }
.glow { box-shadow: 0 0 0 4px #e0b45a, 0 8px 18px rgba(224,180,90,.45) !important; }
@media (prefers-reduced-motion: reduce) {
  .stage-frame.shake, .callout.pop { animation: none !important; }
}
.ladder {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  list-style: none; padding: 0; margin: 12px 0 0;
}
.ladder li {
  background: #0b1c33; border: 1px solid #234; color: #e8eef4;
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 6px;
}
.picto-svg { width: 28px; height: 28px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.picto-svg.xl { width: 56px; height: 56px; }
.guide {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #0b1c33; border: 3px solid var(--gold); border-radius: 16px;
  padding: 10px 14px; margin: 0 0 12px;
}
.guide-copy { flex: 1; min-width: 160px; }
.btn.speak {
  min-width: 44px; min-height: 44px; padding: 8px 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--gold); color: var(--navy-2); flex-shrink: 0;
}
.btn.speak.on { background: var(--navy); color: #fff; }
.btn.speak .picto-svg { width: 22px; height: 22px; }
.idea-row { display: flex; align-items: center; gap: 8px; }
.idea-row .hint { margin: 0; flex: 1; }
#door-idea.speaking, .guide-line.speaking, .guide-sub.speaking {
  background: rgba(224, 180, 90, .22);
  border-radius: 6px;
  box-shadow: inset 3px 0 0 var(--gold);
}

.guide-kicker { margin: 0; font-size: 12px; font-weight: 800; color: var(--gold); text-transform: uppercase; }
.guide-line { margin: 2px 0 0; font-size: clamp(1.15rem, 3vw, 1.5rem); font-weight: 900; color: #fff; }
.guide-ex { text-align: center; }
#example { width: 180px; height: 72px; border-radius: 8px; background: #071018; display: block; border: 1px solid #234; }
.choice { display: flex; align-items: center; gap: 10px; }
.palette .btn { display: inline-flex; align-items: center; gap: 6px; }
.block { gap: 8px; }
.glow { animation: glowpulse 1.1s ease-in-out infinite; }
@keyframes glowpulse {
  0%, 100% { box-shadow: 0 0 0 4px #e0b45a; }
  50% { box-shadow: 0 0 0 8px #fde68a; }
}
@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; }
}
.ladder li:nth-child(1) { border-color: var(--gold); color: var(--gold); }
.block.empty { background: transparent; border: 1px dashed #4b5d74; color: #c9d6e3; justify-content: center; }
.door-btn.go { background: linear-gradient(180deg, #22c55e, #15803d); }
.hero-bot { max-width: 420px; margin: 0 auto 8px; }
.hero-bot canvas { width: 100%; border-radius: 16px; display: block; background: #071018; border: 2px solid #234; }
.join { max-width: 480px; margin: 0 auto; }
.card {
  background: var(--card); color: var(--slate);
  border: 1px solid #1b365d33; border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px;
}
.card h2, .card h3 { color: var(--navy); }
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.btn {
  border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 800;
  background: var(--teal); color: #fff;
}
.btn:hover { background: var(--teal-2); }
.btn.navy { background: var(--navy); }
.btn.gold { background: var(--gold); color: var(--navy-2); }
.btn.ghost { background: transparent; color: #e8eef4; border: 1px solid #4b5d74; }
.top .btn.ghost { color: #fff; }
.btn.danger { background: var(--red); }
.btn.warn { background: #b45309; }
.btn.go {
  background: linear-gradient(180deg, #22c55e, #15803d);
  box-shadow: 0 0 0 2px #14532d, 0 8px 18px rgba(21, 128, 61, .35);
  letter-spacing: .06em;
}
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.teacher-head { justify-content: space-between; align-items: flex-end; margin-bottom: 4px; }
label { display: block; font-size: 12px; font-weight: 800; color: #c9d6e3; margin: 8px 0 4px; text-transform: uppercase; }
input { width: 100%; border: 2px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; color: var(--navy); }
.k { font-size: 11px; font-weight: 800; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; background: #f8fafc; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.chip { padding: 4px 10px; border-radius: 999px; background: #1e293b; font-size: 12px; font-weight: 800; color: #e8eef4; }
.chip.on { background: var(--gold); color: #1b365d; }
.chip.done { background: var(--teal); color: #fff; }
.mode-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 4px 0 8px;
}
.mode-tabs .chip {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  border-radius: 12px;
}
.play { display: flex; flex-direction: column; gap: 10px; }
.play .stage, .play .prove { min-width: 0; }
.one-board .guide-ex { display: none !important; }
.one-board .guide { padding: 8px 12px; margin: 0 0 8px; }
.one-board .picto-svg.xl { width: 40px; height: 40px; }
.one-board .guide-line { font-size: clamp(1rem, 2.4vw, 1.25rem); }
.student-tools { margin: 0; }
.student-tools .btn { min-height: 44px; }
.clue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.clue-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--navy);
  font-weight: 800;
  font-size: 13px;
  border: 1px solid #cbd5e1;
}
.clue-chip .picto-svg { width: 22px; height: 22px; }
.clue-chip.pending { background: #eef2f7; color: var(--slate); }
.clue-chip.pass { background: var(--green-bg); color: var(--green); border-color: #86efac; }
.clue-chip.fail { background: var(--red-bg); color: var(--red); border-color: #fca5a5; }
canvas#world {
  display: block;
  width: min(100%, calc(min(28vh, 220px) * 2));
  height: auto;
  max-height: min(28vh, 220px);
  margin-inline: auto;
  background: #071018;
  border-radius: 12px;
}
.choice { min-height: 44px; }
.prove h3 { margin-bottom: 6px; }
.stage-frame { position: relative; }
.stage-frame.shake { animation: shake .28s linear; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.callout {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  font-weight: 900; font-size: clamp(1.6rem, 5vw, 2.6rem); letter-spacing: .06em;
  color: #fff; text-shadow: 0 3px 0 #000, 0 0 18px #000;
  pointer-events: none; white-space: nowrap;
}
.callout.good { color: #86efac; }
.callout.bad { color: #fca5a5; }
.callout.pop { animation: pop .45s ease-out; }
@keyframes pop {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.quest-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.heat { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--gold); }
.heat-track { width: 140px; height: 10px; background: #1e293b; border-radius: 99px; overflow: hidden; border: 1px solid #334155; }
.heat-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f59e0b, #ef4444); transition: width .3s; }
.choices { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.choice {
  text-align: left; border: 2px solid #cbd5e1; background: #fff;
  border-radius: 12px; padding: 12px 14px; font-weight: 800; color: var(--navy); width: 100%;
}
.choice.picked { border-color: var(--teal); background: #d1fae5; }
.blocks { display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.block {
  background: #12324a; color: #e8f4ff; border-radius: 8px; padding: 8px 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.block .poke {
  background: var(--gold); color: var(--navy-2); border: 0;
  border-radius: 8px; font-weight: 900; padding: 4px 12px; min-width: 44px; min-height: 44px;
  font-size: 16px;
}
.block .poke:disabled { opacity: .85; }
.teacher-notes { margin: 8px 0 0; max-width: 52ch; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0; }
.kpi { background: #0b1c33; border: 1px solid #234; border-radius: 12px; text-align: center; padding: 8px; color: #e8eef4; }
.kpi b { display: block; font-size: 22px; color: #fff; }
.kpi span { font-size: 11px; font-weight: 800; color: #c9d6e3; text-transform: uppercase; }
.kpi.hot b { color: var(--gold); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: var(--navy); color: #fff; text-align: left; padding: 6px 8px; }
.table td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; color: var(--slate); }
.status { font-weight: 800; padding: 2px 6px; border-radius: 6px; font-size: 12px; }
.st-red { background: var(--red-bg); color: var(--red); }
.st-amber { background: var(--amber-bg); color: var(--amber); }
.st-green { background: var(--green-bg); color: var(--green); }
.st-gray { background: #e2e8f0; color: var(--slate); }
.st-blue { background: var(--blue-bg); color: #1e3a8a; }
.log { max-height: 280px; overflow: auto; font-size: 13px; color: var(--slate); }
.log div { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.test { padding: 6px 0; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--slate); }
.test.pass { color: var(--green); }
.test.fail { color: var(--red); }
.banner { background: #7f1d1d; color: #fff; text-align: center; padding: 16px; font-size: 22px; font-weight: 800; border-radius: 10px; margin-bottom: 8px; }
.banner.spot { background: #0f766e; font-size: 16px; }
.hint { color: #c9d6e3; font-size: 13px; }
.aide-card .hint, .card .hint { color: #1b365d; }
.footer-note { text-align: center; color: #c9d6e3; font-size: .8rem; padding: 1.2rem; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .top { flex-wrap: wrap; }
  .meta { order: 3; width: 100%; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .heat-track { display: none; }
  .card { padding: 12px; }
  .quest-bar { gap: 6px; }
  .mode-tabs { margin: 2px 0 6px; }
}
@media (max-height: 800px) {
  .wrap { padding: 10px 16px; }
  canvas#world {
    width: min(100%, calc(min(24vh, 180px) * 2));
    max-height: min(24vh, 180px);
  }
  .quest-bar h2 { font-size: 1.05rem; }
  .heat-track { width: 88px; }
}
body.big-type .mode-tabs .chip { min-height: 48px; min-width: 48px; }
body.big-type .clue-chip { min-height: 44px; font-size: 1.05em; }
body.big-type canvas#world {
  width: min(100%, calc(min(26vh, 200px) * 2));
  max-height: min(26vh, 200px);
}
body.big-type .top-tools .btn { min-height: 48px; }


/* CUT A touch-first — hide keycaps (KZ 1.25.0: also phone-width + any-pointer coarse) */
@media (pointer: coarse), (any-pointer: coarse), (hover: none), (max-width: 640px) {
  .k { display: none !important; }
}
body.touch-ui .k { display: none !important; }
body.touch-ui .btn.go,
body.touch-ui .btn.gold,
body.touch-ui #btn-predict,
body.touch-ui #btn-run-example,
body.touch-ui #btn-run-mine,
body.touch-ui #btn-probe,
body.touch-ui #btn-student {
  min-height: 52px;
  min-width: 48px;
  font-size: 1.05rem;
  padding: 12px 16px;
}
body.touch-ui .student-tools {
  gap: 10px;
}
@media (max-width: 640px) and (orientation: landscape) {
  body.touch-ui .student-tools {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--paper, #fff);
    padding: 8px 0 env(safe-area-inset-bottom, 8px);
  }
}


/* CUT B arena door */
.arena-door {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: calc(100dvh - 72px);
}
.arena-stage {
  position: relative;
  min-height: min(55dvh, 420px);
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid #234;
  background: #071018;
}
.arena-stage canvas {
  width: 100%;
  height: 100%;
  min-height: min(55dvh, 420px);
  display: block;
  object-fit: cover;
}
.arena-tag {
  position: absolute;
  left: 16px;
  bottom: 12px;
  margin: 0;
  font-weight: 900;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: #e8f7ff;
  text-shadow: 0 2px 0 #000;
  pointer-events: none;
}
.arena-join {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.btn.xl {
  width: 100%;
  min-height: 56px;
  font-size: 1.25rem;
  font-weight: 900;
  padding: 14px 18px;
}
.join-more {
  margin: 14px 0 8px;
  text-align: left;
}
.join-more summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--muted, #64748b);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.join-more[open] summary { margin-bottom: 8px; }
.doors-strip {
  margin: 8px 0 4px;
  font-size: 0.9rem;
}
.teacher-row {
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}
@media (min-width: 900px) {
  .arena-door {
    grid-template-columns: 1.4fr 0.9fr;
    align-items: center;
  }
  .arena-stage { min-height: min(62dvh, 520px); }
  .arena-stage canvas { min-height: min(62dvh, 520px); }
}
/* student: stage bias */
.one-board .play {
  display: grid;
  gap: 12px;
}
@media (min-width: 900px) {
  .one-board .play {
    grid-template-columns: 1.3fr 0.9fr;
    align-items: start;
  }
  .one-board .card.stage {
    min-height: 55dvh;
  }
}


/* CUT C plate */
.callout {
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(7, 16, 24, 0.82);
  border: 2px solid #345;
}
.callout.good {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}
.callout.bad {
  border-color: #f87171;
}

/* KZ 1.25.0 — OK and Watch stay fat. Keycaps hide on a phone. */
#btn-predict,
#btn-run-example {
  min-height: 48px;
  min-width: 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
}
@media (max-width: 900px) {
  .k { display: none !important; }
}

/* KZ 1.25.0 — Guess Door 1 plates. Code, then Options, then Output. */
.one-board .play,
.zones {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 900px) {
  .one-board .play {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    grid-template-columns: none;
  }
  .one-board .card.stage {
    min-height: 0;
  }
}
.one-board .play,
.zones {
  align-items: stretch;
  width: 100%;
}
.zone {
  width: 100%;
  align-self: stretch;
  border: 2px solid #1b365d;
  margin: 0;
}
.zone-code .blocks { min-height: 0; }
.zone-code .blank-code { width: 100%; }
.zone-output .stage-frame { display: flex; justify-content: center; }
.zone-output .clue-chips { justify-content: center; }
.zone-label {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 8px;
  background: #e0b45a;
  color: #1b365d;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.zone-ask { margin: 0 0 8px; }
#zone-options .choice,
#zone-options .palette .btn,
.palette .btn,
.block .btn,
#cost-fields .btn {
  min-height: 44px;
  min-width: 44px;
}
.block.empty.blank-code {
  min-height: 48px;
  padding: 14px 12px;
  background: #f8fafc;
  color: #1b365d;
  border: 2px dashed #1b365d;
  font-weight: 800;
  text-align: center;
  justify-content: center;
}

/* KZ 1.25.0 — short Chromebook: bot picture on the first screen. Order stays code, Options, Output. */
@media (max-height: 820px) {
  .one-board.wrap { padding-top: 8px; padding-bottom: 8px; }
  .one-board .quest-bar { gap: 8px; }
  .one-board .guide { padding: 4px 10px; margin: 0 0 4px; }
  .one-board .guide-kicker,
  #guide-sub { display: none; }
  .one-board .guide .picto-svg.xl { width: 28px; height: 28px; }
  .one-board .guide-line { font-size: 1rem; }
  .one-board .mode-tabs { margin: 2px 0 4px; }
  .one-board .play,
  .one-board .zones { gap: 6px; }
  .one-board .zone { padding: 8px 12px; }
  .one-board .zone-label { min-height: 24px; margin: 0 0 4px; padding: 2px 10px; }
  .one-board .choices { gap: 4px; margin: 4px 0; }
  .one-board #zone-options .choice,
  .one-board #btn-predict,
  .one-board #btn-run-example {
    min-height: 44px;
    padding: 6px 12px;
  }
  .one-board canvas#world {
    width: min(100%, 320px);
    max-height: 112px;
  }
  .one-board .clue-chips { margin-top: 4px; gap: 4px; }
  .one-board .clue-chip { min-height: 28px; padding: 2px 8px; }
}

.settings { position: relative; }
.settings-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(340px, 92vw);
  background: #0f1a2b;
  color: #f8fafc;
  border: 2px solid #e0b45a;
  border-radius: 12px;
  padding: 10px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.set-label { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #e0b45a; }
.set-row { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-panel .btn {
  min-height: 44px;
  color: #fff;
  border: 2px solid #4b5d74;
  background: #132033;
}
.set-row .btn { flex: 1 1 100%; min-width: 0; white-space: normal; text-align: start; height: auto; overflow: visible; }
.settings-panel .btn[aria-pressed="true"] {
  border-color: #e0b45a;
  box-shadow: inset 0 0 0 2px #e0b45a;
}

/* KZ 1.25.1 — header spans the top. Menu stays on the physical left. */
.app-shell { display: flex; flex-direction: column; align-items: stretch; min-height: 100vh; }
.app-main { display: flex; flex-direction: row; align-items: stretch; flex: 1; min-width: 0; }
.board { flex: 1; min-width: 0; }
.side {
  flex: 0 0 200px;
  width: 200px;
  background: #0a1628;
  border-right: 3px solid var(--gold);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 26;
}
.side .btn, .side .menu-link {
  min-height: 48px;
  min-width: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  background: transparent;
  border: 2px solid #4b5d74;
  white-space: normal;
  height: auto;
  overflow: visible;
  text-align: start;
}
.side .settings-panel { position: static; width: 100%; }
.whats-new {
  margin: 0;
  padding: 8px 4px;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.5;
  color: #e8eef4;
}
.whats-new b { display: block; color: var(--gold); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
.footer-whats { text-align: center; color: #c9d6e3; padding: 0 16px 1.2rem; }
.footer-whats b { display: inline; margin-right: .4rem; }
.landing-only {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 14px;
  padding: 28px 16px 48px;
}
.start-line {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
}
.alias-line { margin: 0; min-height: 1.2em; color: var(--gold); font-weight: 900; font-size: 1.2rem; }
#btn-student, #btn-hub-signin, #btn-hub-back {
  width: auto;
  max-width: 360px;
  min-height: 52px;
  min-width: 200px;
  padding: 14px 28px;
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#btn-hub-signin, #btn-hub-back {
  background: var(--gold);
  color: var(--navy-2);
  border-radius: 14px;
}
#teacher-code {
  display: block;
  min-height: 48px;
  width: min(220px, 100%);
  margin: 6px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid var(--gold);
  background: #0b1c33;
  color: #fff;
}
.kz-help {
  margin: 0 16px 24px;
  padding: 14px 16px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: #0b1c33;
  color: #fff;
  max-width: 36rem;
}
@media (max-width: 800px) {
  .side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 88vw);
    transform: translateX(-110%);
    overflow: auto;
  }
  body.menu-open .side { transform: none; }
  body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 24;
  }
}
@media (min-width: 801px) {
  .side { position: sticky; top: 67px; align-self: flex-start; min-height: calc(100vh - 67px); }
}
/* Bar CSS lives on apps.kulibert.net. The door origins 404 that file, so the same rules live here. */
.kb-bar{
  position:fixed;top:0;left:0;right:0;z-index:60;height:48px;
  display:flex;align-items:center;gap:.4rem;padding:0 .45rem;
  background:#050814;color:#e8f7ff;
  font-family:Outfit,system-ui,-apple-system,"Segoe UI",sans-serif;
  border-bottom:1px solid #1e3a55;box-sizing:border-box;
}
.kb-home,.kb-help,.kb-settings{
  min-width:44px;min-height:44px;height:44px;padding:0 .7rem;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:999px;border:1px solid #24506d;background:#0b152c;color:#e8f7ff;
  font:700 .85rem/1 Outfit,system-ui,sans-serif;text-decoration:none;cursor:pointer;
}
.kb-plate{flex:1 1 auto;min-width:0;font-weight:700;font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kb-alias{
  margin-left:auto;max-width:9rem;min-height:44px;height:44px;padding:0 .7rem;
  display:inline-flex;align-items:center;border-radius:999px;border:1px solid #24506d;
  background:#0b152c;color:#e8f7ff;font:650 .8rem/1 Outfit,system-ui,sans-serif;
}
.kb-settings[hidden],.kb-toast[hidden]{display:none !important}
body.kb-on{padding-top:48px}
html.kb-framed body.kb-on{padding-top:0}
body.kb-on .top { top: 48px; }
body.kb-on .side { top: 48px; }
@media (min-width: 801px) {
  body.kb-on .side { top: 115px; min-height: calc(100vh - 115px); }
}
body.touch-ui #btn-student,
body.touch-ui #btn-hub-signin,
body.touch-ui #btn-hub-back {
  min-width: 200px;
  min-height: 52px;
  font-size: 1.25rem;
  padding: 14px 28px;
}

.kz-caption {
  min-height: 1.3em;
  margin: 6px 0 0;
  font-weight: 800;
  color: #1b365d;
}
html[lang="ar"],
html[lang="fa-AF"],
html[lang="ti"] { line-height: 1.5; }
html[dir="rtl"] .app-shell { direction: ltr; flex-direction: column; }
html[dir="rtl"] .app-main { direction: ltr; flex-direction: row; }
html[dir="rtl"] .top,
html[dir="rtl"] #btn-menu { direction: ltr; text-align: left; }
html[dir="rtl"] .board,
html[dir="rtl"] .side,
html[dir="rtl"] .settings-panel,
html[dir="rtl"] .start-line,
html[dir="rtl"] .kz-help,
html[dir="rtl"] #guide,
html[dir="rtl"] .kz-caption { direction: rtl; text-align: start; }
html[dir="rtl"] .zones,
html[dir="rtl"] .zone-code,
html[dir="rtl"] .blocks,
html[dir="rtl"] .palette,
html[dir="rtl"] .stage-frame,
html[dir="rtl"] .play,
html[dir="rtl"] .brand { direction: ltr; text-align: left; }
.brand bdi, .brand { unicode-bidi: isolate; }
body, .help-rtl, .start-line, .side, .settings-panel {
  font-family: var(--kp-font), "Noto Sans", "Noto Sans Arabic", "Noto Sans Ethiopic", "Segoe UI", Arial, sans-serif;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://apps.kulibert.net/fonts/noto-sans-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://apps.kulibert.net/fonts/noto-sans-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Noto Sans Ethiopic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://apps.kulibert.net/fonts/noto-sans-ethiopic-700.woff2") format("woff2");
  unicode-range: U+1200-1399, U+2D80-2DDE, U+AB00-AB2E;
}

@media (max-height: 700px) {
  body.short-fit .board {
    height: calc(100dvh - 48px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.short-fit #start-line,
  body.short-fit #alias-line,
  body.short-fit #screen-student .quest-bar,
  body.short-fit #screen-student .guide,
  body.short-fit #screen-student .mode-tabs,
  body.short-fit #screen-student .zone-code,
  body.short-fit #screen-student .zone-label,
  body.short-fit #screen-student .clue-chips,
  body.short-fit #modify-wrap > .row:not(#palette),
  body.short-fit #trade-wrap { display: none !important; }
  body.short-fit #screen-student.one-board {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0;
  }
  body.short-fit #zone-output {
    max-height: 60vh;
    overflow: hidden;
    padding: 0 8px;
  }
  body.short-fit canvas#world {
    display: block;
    width: 100%;
    height: min(60vh, calc(100vh - 160px));
    max-height: min(60vh, calc(100vh - 160px));
  }
  body.short-fit #zone-options {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 60px;
    z-index: 30;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    height: 48px;
    padding: 0;
    overflow: hidden;
    background: #0f1a2b;
  }
  body.short-fit #choices { display: flex !important; flex-direction: row; flex: 0 1 auto; gap: 6px; margin: 0; min-width: 0; }
  body.short-fit #modify-wrap { display: flex !important; flex: 0 0 auto; }
  body.short-fit .choice { width: auto; min-height: 44px; min-width: 44px; padding: 6px 8px; }
  body.short-fit #screen-landing {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 4px;
    z-index: 30;
    padding: 0;
  }
  body.short-fit #palette { display: flex; flex-wrap: nowrap; gap: 6px; }
  body.short-fit #btn-student { min-height: 52px; }
}
