/* Toybox UI kit: design tokens and shared components (docs/ui/UI_KIT.md).
   Tokens follow docs/ui/mockups/main-b-toybox.html and docs/art/ART_DIRECTION.md.
   Everything inside #tg-stage is laid out in logical canvas pixels; the stage is
   scaled as a whole to fit the window, so sizes here never need media queries. */

:root {
  --ink: #2a2335;
  --ink-2: #4a4058;
  --ink-3: #6a5f74;
  --cream: #fff4dc;
  --cream-2: #f6e3bd;
  --tomato: #ec5b45;
  --tomato-d: #b83a2c;
  --sky: #5ec4ee;
  --sky-d: #2d86b5;
  --sun: #f6c445;
  --sun-d: #d89a2b;
  --mint: #a3d9b1;
  --mint-d: #5fae7b;
  --plum: #9b6bd6;
  --pink: #f27a9b;
  --desk: #e6bf86;
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --lift: 0 5px 0 var(--ink);
  --soft: 0 10px 18px rgba(90, 50, 10, 0.22);
  --card-shadow: 0 5px 0 rgba(42, 35, 53, 0.9), var(--soft);
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}
/* a scene declared {scroll: true} taller than the window (kit.js UI.fit) */
html.tg-scroll { height: auto; overflow-x: hidden; overflow-y: auto; }
html.tg-scroll body { overflow: visible; }
html.tg-scroll #tg-stage canvas { pointer-events: none; touch-action: auto; }
body.tg {
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 240, 210, 0.55), rgba(255, 240, 210, 0) 70%),
    repeating-linear-gradient(0deg, rgba(120, 70, 20, 0) 0 125px, rgba(120, 70, 20, 0.16) 125px 128px),
    repeating-linear-gradient(0deg, rgba(150, 95, 40, 0.05) 0 3px, rgba(150, 95, 40, 0) 3px 9px),
    var(--desk);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--round);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

/* ---- stage and layers ---- */
#tg-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#tg-stage canvas {
  position: absolute !important;
  left: 0;
  top: 0;
  z-index: 2;
  background: transparent;
  touch-action: none;
  outline: none;
}
.tg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#tg-under { z-index: 1; }
#tg-over { z-index: 3; transition: opacity 0.15s; }
#tg-modal { z-index: 4; }
#tg-over.tg-covered, #tg-under.tg-covered { visibility: hidden; }
#tg-over.tg-dimmed { opacity: 0.25; }
#tg-over.tg-dimmed * { pointer-events: none !important; }
.tg-layer button, .tg-layer a, .tg-layer [data-interactive] { pointer-events: auto; }

/* ---- cards ---- */
.tb-card {
  position: absolute;
  box-sizing: border-box;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}
.tb-card.sun { background: var(--sun); border-radius: 18px; }
.tb-card.sky { background: var(--sky); border-radius: 22px; }
.tb-card.tomato { background: var(--tomato); border-radius: 22px; }
.tb-card.mint { background: var(--mint); }
.tb-content {
  position: absolute;
  box-sizing: border-box;
}
.tb-tag {
  position: absolute;
  top: -15px;
  left: 14px;
  padding: 5px 10px 4px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--sun);
  box-shadow: 0 3px 0 var(--ink);
  line-height: 0;
  color: var(--ink);
}
.tb-tag.sky { background: var(--sky); }
.tb-tag.tomato { background: var(--tomato); }
.tb-tag.mint { background: var(--mint); }
.tb-tag.cream { background: var(--cream); }

/* pixel text and icons are inline SVG coloured by currentColor */
.tb-px, .tb-icon { display: inline-block; vertical-align: middle; fill: currentColor; flex: none; }

/* ---- buttons ---- */
.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 10px;
  min-width: 44px;
  min-height: 44px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  box-shadow: var(--lift);
  color: var(--ink);
  font: 700 15px var(--round);
  cursor: pointer;
  position: relative;
  top: 0;
  transition: top 0.05s, box-shadow 0.05s, filter 0.1s;
  -webkit-appearance: none;
  appearance: none;
}
.tb-btn:hover { filter: brightness(1.05); }
.tb-btn:active, .tb-btn.tb-pressed { top: 4px; box-shadow: 0 1px 0 var(--ink); }
.tb-btn:focus { outline: none; }
.tb-btn:focus-visible { outline: 3px solid var(--sky-d); outline-offset: 3px; }
.tb-btn[disabled], .tb-btn.off { opacity: 0.45; cursor: default; filter: none; }
.tb-btn[disabled]:active { top: 0; box-shadow: var(--lift); }
.tb-btn.sky { background: var(--sky); }
.tb-btn.sun { background: var(--sun); }
.tb-btn.mint { background: var(--mint); }
.tb-btn.tomato { background: var(--tomato); color: var(--cream); }
.tb-btn.sq { width: 58px; height: 58px; padding: 0; }
.tb-btn.sm { width: 44px; height: 44px; padding: 0; border-radius: 12px; }
.tb-btn.tall { flex-direction: column; gap: 6px; border-radius: 18px; }
.tb-btn.big {
  height: 70px;
  border-radius: 22px;
  padding: 0 22px;
  box-shadow: 0 6px 0 var(--ink), 0 10px 16px rgba(184, 58, 44, 0.35);
}
.tb-btn.round { border-radius: 50%; }

.tb-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 50px;
  min-width: 64px;
  padding: 0 12px;
  border-radius: 25px;
  border: 3px solid var(--ink);
  background: var(--sun);
  box-shadow: inset 0 -5px 0 var(--sun-d);
  color: var(--ink);
}

/* ---- popups / modals (HTML) ---- */
.tb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 35, 53, 0.55);
  pointer-events: auto;
}
.tb-popup {
  position: absolute;
  box-sizing: border-box;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--ink), 0 16px 30px rgba(20, 10, 30, 0.35);
  padding: 30px 22px 20px;
  pointer-events: auto;
  color: var(--ink);
  font: 600 16px/1.35 var(--round);
}
.tb-popup .tb-close {
  position: absolute;
  top: -20px;
  right: -16px;
}
.tb-popup h2 { margin: 0 0 10px; font: 800 20px var(--round); }
.tb-popup p { margin: 0 0 10px; }
.tb-popup .tb-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 14px; }

/* speech-bubble callout used by the help overlay */
.tb-callout {
  position: absolute;
  box-sizing: border-box;
  padding: 10px 12px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  font: 700 14px/1.3 var(--round);
  color: var(--ink);
  pointer-events: auto;
}
.tb-callout b { color: var(--tomato-d); }
.tb-ring {
  position: absolute;
  box-sizing: border-box;
  border: 3px dashed var(--cream);
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(42, 35, 53, 0.6);
  pointer-events: none;
}

/* loading card */
.tb-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 420px;
  transform: translate(-50%, -50%);
  text-align: center;
}
.tb-bar {
  position: relative;
  height: 26px;
  margin-top: 16px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--cream-2);
  overflow: hidden;
}
.tb-bar > i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--tomato);
  box-shadow: inset 0 -5px 0 var(--tomato-d);
}

/* =================== main game screen =================== */
.gs-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--sun);
  border: 3px solid var(--ink);
  box-shadow: inset 0 -6px 0 var(--sun-d);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.gs-crumb { position: absolute; color: var(--tomato-d); line-height: 0; }
.gs-title { position: absolute; line-height: 0; }
.gs-msg {
  position: absolute;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ink-2);
  overflow: hidden;
}
.gs-msg p { margin: 0 0 4px; }
.gs-sys { position: absolute; display: flex; gap: 12px; }
.gs-sys .tb-btn { width: 88px; height: 74px; }
.gs-sys .tb-btn.gs-sound { width: 72px; }
.gs-portrait .gs-sys { gap: 6px; }
.gs-portrait .gs-sys .tb-btn { width: 46px; height: 46px; padding: 0; }

.gs-cap {
  position: absolute;
  text-align: center;
  font: 700 12px/16px var(--round);
  white-space: nowrap;
  color: var(--ink);
}
/* "?" badge on each tray tile: opens its explainer (js/ui/tile-explainers.js) */
.tb-btn.gs-q {
  position: absolute;
  width: 23px;
  height: 23px;
  min-width: 23px;
  min-height: 23px;
  padding: 0;
  border-width: 2.5px;
  border-radius: 50%;
  box-shadow: 0 2px 0 var(--ink);
  z-index: 2;
}
/* a bigger invisible hit area for fingers */
.tb-btn.gs-q::before { content: ""; position: absolute; inset: -6px; }
.tb-btn.gs-q:active { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
.gs-tools { position: absolute; display: flex; gap: 10px; }
.gs-bin {
  flex: 1;
  height: 62px;
  border-style: dashed;
  box-shadow: none;
  background: var(--cream);
  flex-direction: column;
  gap: 4px;
  padding: 0;
}
.gs-bin small { font: 600 10px/11px var(--round); color: var(--ink-3); }
.gs-bin.hot { background: var(--tomato); color: var(--cream); }
.gs-bin.hot small { color: var(--cream); }
.gs-undo { width: 58px; height: 62px; flex: none; flex-direction: column; gap: 4px; padding: 0; }
.gs-undo small { font: 600 10px/11px var(--round); }

.gs-board-frame {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.35);
  background: var(--mint);
}
.gs-flag {
  position: absolute;
  box-sizing: border-box;
  width: 26px;
  height: 50px;
  background: var(--tomato);
  border: 3px solid var(--ink);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
}
.gs-lock {
  position: absolute;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--cream);
  font: 700 12px var(--round);
  box-shadow: 0 3px 0 var(--ink);
  white-space: nowrap;
}
.gs-locked .gs-lock { display: flex; }

.gs-win {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: #f7e7c6;
}
.gs-dials { position: absolute; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-content: center; }
.gs-dial { width: 70px; text-align: center; }
.gs-dial .chip {
  height: 22px;
  border: 3px solid var(--ink);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  font: 800 12px var(--round);
  letter-spacing: 0.04em;
}
.gs-dial .lcd {
  height: 34px;
  border: 3px solid var(--ink);
  border-radius: 0 0 10px 10px;
  background: var(--ink);
  box-shadow: inset 0 0 0 3px #3b3349;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 800 20px var(--mono);
}
/* the dial shows the level's target number (js/scenes/level.js CounterDials):
   mint ring and glow, mint LCD bezel, a check badge on the corner, one pop */
.gs-dial { position: relative; border-radius: 10px; }
.gs-dial .ok {
  position: absolute;
  right: -13px;
  top: -13px;
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--mint-d);
  color: var(--cream);
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.gs-dial.matched { z-index: 1; box-shadow: 0 0 0 3px var(--cream), 0 0 0 6px var(--mint-d), 0 0 14px 6px rgba(163, 217, 177, 0.85); }
.gs-dial.matched .lcd { box-shadow: inset 0 0 0 3px var(--mint-d); }
.gs-dial.matched .ok { display: flex; }
.gs-dial.pop { animation: gs-dial-pop 0.36s ease-out; }
.gs-dial.pop .ok { animation: gs-dial-ok 0.36s ease-out; }
@keyframes gs-dial-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  70% { transform: scale(0.97); }
  100% { transform: scale(1); }
}
@keyframes gs-dial-ok {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .gs-dial.pop, .gs-dial.pop .ok { animation: none; }
}

.gs-deck-row { position: absolute; display: flex; align-items: center; gap: 12px; }
.gs-deck-row .sep { flex: 1; }
.gs-speed { display: flex; align-items: center; gap: 8px; }
.gs-run { min-width: 150px; color: var(--cream); }
.gs-portrait .gs-run { min-width: 104px; height: 58px; padding: 0 12px; border-radius: 18px; }
.gs-portrait .gs-deck-row { gap: 7px; }
.gs-portrait .gs-speed { gap: 5px; }
.gs-portrait .tb-btn.sq { width: 50px; height: 50px; }
.gs-portrait .tb-pill { min-width: 52px; height: 44px; padding: 0 6px; }

.gs-score { position: absolute; display: flex; align-items: center; gap: 14px; }
.gs-steps { display: flex; flex-direction: column; align-items: flex-start; min-width: 92px; }
.gs-steps .num { font: 800 34px/1 var(--round); }
.gs-steps .lbl { font: 800 12px var(--round); letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; }
.gs-steps .out { font: 700 12px var(--round); color: var(--tomato-d); margin-top: 3px; white-space: nowrap; }
.gs-goals { display: flex; gap: 8px; margin-left: auto; }
.gs-goal {
  width: 58px;
  height: 74px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: var(--mint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 3px 0 var(--ink);
}
.gs-goal img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
.gs-goal span { font: 800 11px var(--round); white-space: nowrap; }
.gs-goal.off { background: var(--cream-2); border-style: dashed; box-shadow: none; }
.gs-goal.off img { opacity: 0.6; }
.gs-goals.mini .gs-goal { width: 62px; height: 50px; flex-direction: row; gap: 1px; padding: 0 2px; }
.gs-goals.mini .gs-goal img { width: 20px; height: 20px; }
.gs-goals.mini .gs-goal span { font-size: 10px; }
.gs-score.mini .gs-steps .num { font-size: 26px; }
.gs-score.mini .gs-steps { flex-direction: row; align-items: baseline; gap: 6px; min-width: 0; }
.gs-score.mini .gs-steps .out { margin: 0 0 0 4px; }
.gs-hint { font: 600 12px/15px var(--round); color: var(--ink-3); }

/* =================== end-level screen (js/scenes/end-level.js) =================== */
.el-screen {
  position: absolute;
  isolation: isolate;
  overflow: hidden;
  pointer-events: auto;
  background: var(--desk);
  color: var(--ink);
}
.el-land {
  position: absolute;
  left: 0;
  top: 0;
  width: 1024px;
  height: 768px;
  transform-origin: 0 0;
}
.el-land img { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.el-bg { position: absolute; left: 0; top: 0; width: 1024px; height: 768px; }
.el-robot { position: absolute; }
.el-robot img { width: 100%; height: 100%; }
.el-frame {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  background: #9fd3df;
}

.el-card {
  position: absolute;
  box-sizing: border-box;
  padding: 28px 22px 18px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--ink), 0 16px 30px rgba(20, 10, 30, 0.3);
  z-index: 100;
}
.el-head { line-height: 0; color: var(--ink); }
.el-sub { margin-top: 8px; font: 600 15px/20px var(--round); color: var(--ink-2); }
.el-stats { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.el-steps { min-width: 120px; }
.el-steps .num { font-size: 44px; }
.el-steps .best { font: 700 12px var(--round); color: var(--ink-3); margin-top: 4px; white-space: nowrap; }
.el-goals { margin-left: auto; gap: 10px; }
.el-goals .gs-goal { width: 70px; height: 80px; }
.el-goals .gs-goal img { width: 40px; height: 40px; }
.el-goals .gs-goal span { font-size: 12px; }

.el-freed { margin-top: 12px; }
.el-freed-top { display: flex; align-items: baseline; gap: 10px; font: 700 15px var(--round); }
.el-freed-lbl b { font-weight: 800; font-size: 18px; }
.el-gain {
  margin-left: auto;
  padding: 2px 10px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--sun);
  font: 800 12px var(--round);
  box-shadow: 0 2px 0 var(--ink);
}
.el-bar { height: 18px; margin-top: 8px; border-radius: 10px; }
.el-bar > i { background: var(--mint-d); box-shadow: inset 0 -4px 0 #3f8a5b; transition: width 0.9s cubic-bezier(.3, 1.4, .5, 1); }

.el-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.el-actions .tb-btn { height: 56px; padding: 0 16px; }
.el-actions .el-next { margin-left: auto; height: 66px; padding: 0 24px; font-size: 18px; }
.el-actions .el-primary { margin-left: auto; }
.el-portrait .el-actions { flex-wrap: wrap; }
.el-portrait .el-actions .el-next { order: -1; flex: 1 1 100%; margin-left: 0; height: 70px; font-size: 20px; }
.el-portrait .el-actions .el-back, .el-portrait .el-actions .el-sel { flex: 1 1 0; }
.el-portrait .el-actions .el-primary { margin-left: 0; }
.el-portrait .el-sub { font-size: 16px; }

/* entrance: the main robot hops, freed robots drop in with a sparkle */
.el-robot.el-wait { opacity: 0; }
.el-robot.el-drop { animation: el-drop 0.62s cubic-bezier(.3, .0, .6, 1) both; transform-origin: 50% 100%; }
@keyframes el-drop {
  0% { opacity: 0; transform: translateY(-150px) scale(0.9, 1.1); }
  55% { opacity: 1; transform: translateY(0) scale(1.12, 0.86); }
  72% { transform: translateY(-16px) scale(0.96, 1.05); }
  88% { transform: translateY(0) scale(1.04, 0.96); }
  100% { transform: none; }
}
.el-robot.el-hop { animation: el-hop 0.9s ease-out 0.15s both; transform-origin: 50% 100%; }
@keyframes el-hop {
  0% { transform: none; }
  15% { transform: scale(1.06, 0.92); }
  40% { transform: translateY(-34px) scale(0.96, 1.05); }
  65% { transform: translateY(0) scale(1.08, 0.9); }
  82% { transform: translateY(-8px); }
  100% { transform: none; }
}
.el-spark { position: absolute; width: 0; height: 0; pointer-events: none; }
.el-spark i {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  background: var(--sun);
  box-shadow: 0 0 0 2px var(--ink);
  animation: el-spark 0.8s ease-out both;
}
.el-spark i:nth-child(3n+1) { background: var(--cream); }
.el-spark i:nth-child(3n+2) { background: var(--sky); width: 8px; height: 8px; }
@keyframes el-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4) rotate(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(90deg); }
}
.el-newtag {
  position: absolute;
  padding: 4px 8px 3px;
  border: 3px solid var(--ink);
  border-radius: 9px;
  background: var(--sun);
  box-shadow: 0 3px 0 var(--ink);
  line-height: 0;
  animation: el-pop 0.4s cubic-bezier(.3, 1.6, .5, 1) both;
}
.gs-goal.el-pop { animation: el-pop 0.45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes el-pop {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* 'just give up' first-finish celebration */
.el-whoa { text-align: center; }
.el-whoa-title { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--tomato-d); margin: 4px 0 14px; }
.el-whoa p { font-size: 17px; }
.el-whoa-parts { display: flex; justify-content: center; gap: 18px; margin-top: 6px; }
.el-whoa-parts img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  image-rendering: pixelated;
  animation: el-bounce 0.9s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes el-bounce {
  0% { transform: translateY(-40px) scale(0.3); opacity: 0; }
  60% { transform: translateY(4px) scale(1.1); opacity: 1; }
  100% { transform: none; }
}
.el-whoa-box .tb-actions { justify-content: center; }
.el-whoa-box .el-yay { min-width: 140px; height: 56px; font-size: 18px; }
.el-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.el-confetti i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  animation: el-fall 1.8s ease-in both;
}
@keyframes el-fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(900px) rotate(var(--rot)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .el-robot.el-drop, .el-robot.el-hop, .gs-goal.el-pop, .el-newtag, .el-whoa-parts img { animation: none; }
  .el-spark, .el-confetti { display: none; }
  .el-bar > i { transition: none; }
}

/* =================== intro storybook (js/scenes/intro.js) =================== */
.in-root {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
}
.in-book {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 22px 18px;
  gap: 16px;
  border-radius: 22px;
}
.in-portrait { flex-direction: column; gap: 40px; }
.in-landscape { box-sizing: border-box; padding-top: 14px; }
.in-logo { line-height: 0; color: var(--ink); filter: drop-shadow(0 4px 0 rgba(255, 244, 220, 0.7)); }
.in-tag { color: var(--cream); left: 24px; }
.in-pic {
  position: relative;
  flex: none;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 0 0 5px var(--cream-2);
}
.in-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.45s ease, transform 0.9s ease;
}
.in-img.on { opacity: 1; transform: scale(1); }
.in-words { display: grid; width: 100%; }
.in-text {
  grid-area: 1 / 1;
  margin: 0;
  align-self: center;
  text-align: center;
  font: 800 25px/1.32 var(--round);
  color: var(--ink);
  text-wrap: balance;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease 0.1s, transform 0.5s ease 0.1s;
}
.in-text.on { opacity: 1; transform: none; }
.in-portrait .in-text { font-size: 27px; }
.in-foot {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
}
.in-skip { min-width: 96px; height: 52px; }
.in-next { min-width: 150px; height: 58px; font-size: 18px; gap: 10px; }
.in-dots { flex: 1; display: flex; justify-content: center; gap: 12px; }
.in-dots i {
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--cream-2);
  transition: background 0.3s, transform 0.3s;
}
.in-dots i.on { background: var(--tomato); transform: scale(1.25); }
.in-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* =================== about (js/scenes/about.js) =================== */
.ab-root {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 384px 1fr;
  grid-template-rows: auto 1fr;
  gap: 26px 24px;
  padding: 22px 28px 30px;
  align-items: start;
}
.ab-portrait {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  gap: 30px;
  padding: 20px 18px 30px;
}
.ab-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
}
.ab-back { height: 58px; padding: 0 16px 0 12px; font-size: 16px; }
.ab-title { flex: 1; margin: 0; text-align: center; line-height: 0; color: var(--ink); }
.ab-spacer { width: 120px; }
.ab-portrait .ab-spacer { width: 0; }
.ab-portrait .ab-title { text-align: right; padding-right: 6px; }
.ab-side, .ab-text {
  position: relative;
  padding: 26px 20px 20px;
  border-radius: 20px;
}
.ab-photo {
  border: 3px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
  line-height: 0;
  box-shadow: 0 0 0 5px var(--cream-2);
}
.ab-photo img { width: 100%; height: auto; }
.ab-caption {
  margin: 12px 2px 16px;
  font: 600 13px/1.35 var(--round);
  color: var(--ink-3);
  text-align: center;
}
.ab-links { display: flex; flex-direction: column; gap: 14px; }
.ab-portrait .ab-links { flex-direction: row; }
.ab-portrait .ab-links .ab-link { flex: 1; min-width: 0; }
.ab-link {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  height: auto;
  padding: 9px 16px 10px;
  text-decoration: none;
}
.ab-link b { font: 800 17px var(--round); }
.ab-link small { font: 600 12px var(--round); color: var(--ink-2); overflow-wrap: anywhere; }
.ab-text {
  font: 600 15.5px/1.45 var(--round);
  color: var(--ink-2);
  user-select: text;
  -webkit-user-select: text;
}
.ab-text p { margin: 0 0 12px; }
.ab-text a { color: var(--sky-d); font-weight: 800; }
.ab-text a:focus-visible { outline: 3px solid var(--sky-d); outline-offset: 2px; border-radius: 4px; }
.ab-text h2 { margin: 18px 0 8px; font: 800 17px var(--round); color: var(--ink); }
.ab-text ul { margin: 0; padding: 0; list-style: none; }
.ab-text li {
  position: relative;
  margin: 0 0 9px;
  padding-left: 22px;
}
.ab-text li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--tomato);
}
.ab-text li:nth-child(2n)::before { background: var(--sky); }
.ab-text li:nth-child(3n)::before { background: var(--sun); }
.ab-text li b { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .in-img, .in-text, .in-dots i { transition: none; }
}

/* =================== level selector (js/scenes/level-selector.js) =================== */
.ls-root { position: absolute; inset: 0; }
.ls-measure {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  white-space: nowrap;
}
.ls-name-m { font: 700 13px var(--round); }
.ls-portrait .ls-name-m { font-size: 18px; }
.ls-chip-m { font: 700 12px var(--round); }

/* header */
.ls-hdr-in {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 10px 0 18px;
}
.ls-title { margin: 0; line-height: 0; color: var(--ink); }
.ls-count {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px 0 8px;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: var(--sun);
  box-shadow: inset 0 -5px 0 var(--sun-d);
}
.ls-count-ic { display: flex; align-items: center; gap: 1px; }
.ls-count-ic img { height: 22px; width: auto; image-rendering: pixelated; }
.ls-count-n { display: flex; flex-direction: column; line-height: 1; }
.ls-count-n b { font: 800 17px var(--round); }
.ls-count-n small { font: 700 10px var(--round); color: var(--ink-2); margin-top: 1px; white-space: nowrap; }
.ls-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 12px var(--round);
  color: var(--ink-3);
  margin-left: auto;
}
.ls-legend > span:not(.ls-key) { margin-right: 6px; }
.ls-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 18px;
  box-sizing: border-box;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fffdf6;
  box-shadow: 0 2px 0 var(--ink);
  color: var(--ink);
}
.ls-key.solved { background: var(--mint); }
.ls-key.locked { background: transparent; border-style: dashed; border-color: var(--ink-3); box-shadow: none; color: var(--ink-3); }
.ls-sys { display: flex; gap: 10px; align-items: center; }
.ls-sys .tb-btn { height: 44px; }
.ls-hdr-in.ls-hdr-portrait {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "title sys" "count legend";
  align-content: center;
  gap: 12px 10px;
  padding: 0 12px 0 16px;
}
.ls-hdr-portrait .ls-title { grid-area: title; }
.ls-hdr-portrait .ls-sys { grid-area: sys; justify-self: end; gap: 6px; }
/* five buttons (with the Look switch) share the row with the title */
.ls-hdr-portrait .ls-sys .tb-btn { width: 46px; height: 52px; }
.ls-hdr-portrait .ls-count { grid-area: count; }
.ls-hdr-portrait .ls-legend { grid-area: legend; justify-self: end; }

/* track cards: a light tint of the track colour, the tag in full colour */
.tb-card.ls-card { border-radius: 20px; }
.tb-card.ls-sun { background: #fff0c8; }
.tb-card.ls-sky { background: #dcf1fb; }
.tb-card.ls-mint { background: #e2f4e6; }
.tb-card.ls-tomato { background: #fde3dc; }
.tb-card.ls-plum { background: #ece2f8; }
.tb-card.ls-card-locked { background: var(--cream-2); border-style: dashed; box-shadow: none; }
.tb-tag.plum { background: var(--plum); color: var(--cream); }
.ls-chips { position: absolute; top: -13px; display: flex; gap: 6px; }
.ls-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px 0 7px;
  box-sizing: border-box;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--cream);
  font: 700 12px var(--round);
  color: var(--ink);
  white-space: nowrap;
}
.ls-chip.ok { background: var(--mint); }
.ls-chip.need { background: var(--cream-2); border-style: dashed; color: var(--ink-2); }
.ls-prog { position: absolute; top: -13px; right: 14px; padding: 0 9px; }

/* level nodes */
.tb-btn.ls-node {
  position: absolute;
  min-width: 0;
  min-height: 0;
  padding: 0 10px;
  gap: 8px;
  border-radius: 12px;
  background: #fffdf6;
  box-shadow: 0 4px 0 var(--ink);
  font: 700 13px var(--round);
  white-space: nowrap;
  z-index: 1;
}
.tb-btn.ls-node:active { top: auto; transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ls-name { overflow: hidden; text-overflow: ellipsis; }
.ls-landscape .tb-btn.ls-node.solved { padding-bottom: 8px; }
.tb-btn.ls-node.solved { background: var(--mint); }
.tb-btn.ls-node.locked {
  background: rgba(255, 253, 246, 0.45);
  border-style: dashed;
  border-color: var(--ink-3);
  color: var(--ink-3);
  box-shadow: none;
  cursor: help;
}
.tb-btn.ls-node.locked:active { transform: none; }
.tb-btn.ls-node.next {
  background: var(--sun);
  box-shadow: 0 4px 0 var(--ink), 0 0 0 6px rgba(246, 196, 69, 0.55);
  animation: ls-bob 1.6s ease-in-out infinite;
  z-index: 2;
}
@keyframes ls-bob {
  0%, 100% { box-shadow: 0 4px 0 var(--ink), 0 0 0 4px rgba(236, 91, 69, 0.0); }
  50% { box-shadow: 0 4px 0 var(--ink), 0 0 0 7px rgba(236, 91, 69, 0.45); }
}
.ls-next {
  position: absolute;
  left: -8px;
  top: -13px;
  padding: 3px 5px 2px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--tomato);
  color: var(--cream);
  line-height: 0;
  box-shadow: 0 2px 0 var(--ink);
}
.ls-lock {
  position: absolute;
  right: -13px;
  top: -10px;
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  border: 2px dashed var(--ink-3);
  border-radius: 50%;
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  line-height: 0;
}
.ls-lock .tb-icon { width: 11px; height: 11px; }
/* parts earned: a tab hanging under the node (landscape) or inline (portrait) */
.ls-parts {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ls-parts img { width: auto; image-rendering: pixelated; }
.ls-parts img.no { filter: grayscale(1); opacity: 0.32; }
.ls-parts.tab {
  position: absolute;
  left: 50%;
  bottom: -13px;
  transform: translateX(-50%);
  height: 20px;
  padding: 0 4px;
  box-sizing: border-box;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--cream);
}
.ls-parts.tab img { height: 14px; }
.ls-parts.inline { margin-left: auto; gap: 4px; }
.ls-parts.inline img { height: 24px; }

/* portrait nodes: one level per row, name on the left */
.ls-portrait .tb-btn.ls-node {
  justify-content: flex-start;
  padding: 0 12px 0 16px;
  border-radius: 14px;
  font-size: 18px;
}
.ls-portrait .ls-lock { position: static; margin-left: auto; width: 28px; height: 28px; }
.ls-portrait .ls-lock .tb-icon { width: 14px; height: 14px; }
.ls-go {
  margin-left: auto;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--tomato);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 3px;
}
.ls-portrait .ls-next { left: -10px; top: -12px; }

/* paths: a dark casing with a coloured core; locked paths are dashed */
.ls-paths { position: absolute; left: 0; top: 0; overflow: visible; }
.ls-path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ls-path.casing { stroke: var(--ink); stroke-width: 7; }
.ls-path.open { stroke: var(--sun); stroke-width: 3; }
.ls-path.solved { stroke: var(--mint); stroke-width: 3; }
.ls-path.locked { stroke: var(--ink-3); stroke-width: 2.5; stroke-dasharray: 4 5; opacity: 0.6; }
.ls-portrait .ls-path.casing { stroke-width: 8; }
.ls-portrait .ls-path.open, .ls-portrait .ls-path.solved { stroke-width: 4; }
.ls-portrait .ls-path.locked { stroke-width: 3; }
.ls-why p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .tb-btn.ls-node.next { animation: none; }
}

/* =================== tile explainers (js/ui/tile-explainers.js) =================== */
.tb-popup.tx-card { padding: 26px 20px 18px; }
.tx-tags { position: absolute; top: -15px; left: 14px; display: flex; gap: 8px; }
.tx-tags .tb-tag { position: static; }
.tx-stage {
  padding: 3px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--sky);
  box-shadow: inset 0 -5px 0 rgba(45, 134, 181, 0.45);
  line-height: 0;
}
#tg-stage .tx-stage canvas { position: relative !important; display: block; z-index: auto; touch-action: auto; }
.tx-point {
  margin: 14px 0 8px !important;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #ffe9a8;
  font: 800 16px/1.3 var(--round);
  color: var(--ink);
}
.tx-text { margin: 0 2px 4px !important; font: 600 15px/1.4 var(--round); color: var(--ink-2); }
.tx-nav { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.tx-nav .tb-btn { min-width: 96px; }
.tx-dots { display: flex; gap: 6px; margin-right: auto; order: -1; }
.tx-dots i { width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 50%; background: var(--cream-2); }
.tx-dots i.on { background: var(--tomato); }

/* =================== look chooser (js/scenes/skin-chooser.js) ===================
   The page chrome follows the current skin; each card always shows its own
   look (fixed colours), so both previews read side by side in either skin. */
.sk-root {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 32px 30px;
  gap: 14px;
}
.sk-portrait { padding: 22px 16px 26px; gap: 12px; }
.sk-head { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 58px; }
.sk-back { height: 58px; padding: 0 16px 0 12px; }
.sk-title { flex: 1; margin: 0; text-align: center; line-height: 0; color: var(--ink); }
.sk-spacer { width: 112px; }
.sk-portrait .sk-spacer { width: 44px; }
.sk-sub { margin: 0 0 12px; font: 600 16px/1.35 var(--round); color: var(--ink-2); text-align: center; }
.sk-cards { display: flex; gap: 40px; justify-content: center; }
.sk-portrait .sk-cards { flex-direction: column; gap: 24px; width: 100%; }
.sk-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: 440px;
  box-sizing: border-box;
  margin: 0;
  padding: 18px 18px 20px;
  cursor: pointer;
  text-align: left;
  pointer-events: auto;
  position: relative;
  top: 0;
  transition: top 0.08s, box-shadow 0.08s, transform 0.12s;
  -webkit-appearance: none;
  appearance: none;
}
.sk-portrait .sk-card { width: 100%; padding: 14px 14px 16px; gap: 12px; }
.sk-card:focus { outline: none; }
.sk-card:focus-visible { outline: 4px solid #2d86b5; outline-offset: 5px; }
.sk-text { display: flex; flex-direction: column; gap: 8px; }
.sk-name { line-height: 0; }
.sk-blurb { font: 600 15px/1.35 var(--round); }
.sk-go { line-height: 0; align-self: flex-start; padding: 7px 10px; margin-top: 4px; }
.sk-portrait .sk-blurb { font-size: 14px; }

/* the toybox card: cream, chunky ink, a tomato button */
.sk-toybox {
  background: #fff4dc;
  border: 3px solid #2a2335;
  border-radius: 20px;
  box-shadow: 0 6px 0 #2a2335, 0 12px 20px rgba(90, 50, 10, 0.22);
  color: #2a2335;
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  text-shadow: none;
}
.sk-toybox:hover { transform: translateY(-2px); }
.sk-toybox:active { top: 4px; box-shadow: 0 2px 0 #2a2335; }
.sk-toybox .sk-blurb { color: #4a4058; font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif; }
.sk-toybox .sk-name svg { filter: none; }
.sk-toybox .sk-go { background: #ec5b45; color: #fff4dc; border: 3px solid #2a2335; border-radius: 12px; box-shadow: 0 3px 0 #2a2335; }
/* the retro card (tg-wtv.8): dark glass on the circuit-board desk, a green
   terminal frame, an amber prompt; its mini screen shows the windows' own hues */
.sk-retro {
  background:
    linear-gradient(rgba(3, 8, 5, 0.82), rgba(3, 8, 5, 0.82)),
    url("../images/retro/pcb.png") 0 0 / 256px 256px repeat,
    #07130d;
  border: 1px solid #33ff66;
  border-radius: 2px;
  box-shadow: 0 0 0 4px #020604, 0 0 18px rgba(51, 255, 102, 0.25);
  color: #33ff66;
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  text-shadow: 0 0 3px rgba(51, 255, 102, 0.45);
}
.sk-retro:hover { box-shadow: 0 0 0 4px #020604, 0 0 26px rgba(51, 255, 102, 0.45); }
.sk-retro:active { top: 2px; }
.sk-retro .sk-name svg { filter: drop-shadow(0 0 2px rgba(51, 255, 102, 0.6)); }
.sk-retro .sk-blurb { color: #2bd957; font-weight: 500; font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace; }
.sk-retro .sk-go { color: #ffb000; border: 1px solid #ffb000; filter: drop-shadow(0 0 3px rgba(255, 176, 0, 0.6)); }
.sk-current .sk-go { opacity: 0.75; }

/* mini game screen, drawn with boxes (percentages of a 16:10 frame) */
.sk-pv { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; flex: none; box-sizing: border-box; }
.sk-portrait .sk-pv { aspect-ratio: 16 / 8; }
.sk-pv i, .sk-pv div { position: absolute; display: block; box-sizing: border-box; }
.sk-pv-hdr { left: 3%; top: 4%; width: 94%; height: 14%; }
.sk-pv-badge { left: 2%; top: 14%; width: 7.5%; height: 72%; }
.sk-portrait .sk-pv-badge { width: 6%; }
.sk-pv-line { left: 12%; top: 26%; width: 40%; height: 18%; }
.sk-pv-line.short { top: 58%; width: 24%; }
.sk-pv-tray { left: 3%; top: 22%; width: 15%; height: 54%; }
.sk-pv-tile { width: 36%; height: 17%; }
.sk-pv-tile:nth-child(odd) { left: 10%; }
.sk-pv-tile:nth-child(even) { left: 54%; }
.sk-pv-tile:nth-child(1), .sk-pv-tile:nth-child(2) { top: 10%; }
.sk-pv-tile:nth-child(3), .sk-pv-tile:nth-child(4) { top: 33%; }
.sk-pv-tile:nth-child(5), .sk-pv-tile:nth-child(6) { top: 56%; }
.sk-pv-mat { left: 20.5%; top: 22%; width: 48%; height: 54%; }
.sk-pv-board { left: 50%; top: 50%; height: 82%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.sk-pv-belt { width: 16.66%; height: 16.66%; }
.sk-pv-marker { left: 18%; top: 52%; width: 10%; height: 10%; transform: rotate(45deg); }
.sk-pv-cell { left: 71%; top: 22%; width: 26%; height: 54%; }
.sk-pv-win { left: 12%; top: 10%; width: 76%; height: 52%; }
.sk-pv-robot { left: 36%; top: 26%; width: 28%; height: 46%; }
.sk-pv-dials { left: 10%; top: 70%; width: 80%; height: 22%; }
.sk-pv-dial { top: 0; width: 44%; height: 100%; }
.sk-pv-dial.red { left: 0; }
.sk-pv-dial.blue { right: 0; }
.sk-pv-deck { left: 3%; top: 80%; width: 94%; height: 16%; }
.sk-pv-run { left: 2%; top: 16%; width: 20%; height: 68%; }
.sk-pv-key { top: 16%; width: 7%; height: 68%; }
.sk-pv-key:nth-child(2) { left: 26%; }
.sk-pv-key:nth-child(3) { left: 35%; }
.sk-pv-key:nth-child(4) { left: 44%; }

.sk-toybox .sk-pv { background: #e6bf86; border: 2px solid #2a2335; border-radius: 10px; }
.sk-toybox .sk-pv-hdr, .sk-toybox .sk-pv-deck { background: #fff4dc; border: 2px solid #2a2335; border-radius: 6px; }
.sk-toybox .sk-pv-badge { background: #f6c445; border: 2px solid #2a2335; border-radius: 50%; }
.sk-toybox .sk-pv-line { background: #2a2335; border-radius: 3px; }
.sk-toybox .sk-pv-line.short { background: #6a5f74; }
.sk-toybox .sk-pv-tray { background: #f6c445; border: 2px solid #2a2335; border-radius: 6px; }
.sk-toybox .sk-pv-tile { background: #a3d9b1; border: 2px solid #2a2335; border-radius: 3px; }
.sk-toybox .sk-pv-tile:nth-child(3) { background: #ec5b45; }
.sk-toybox .sk-pv-tile:nth-child(6) { background: #5ec4ee; }
.sk-toybox .sk-pv-mat { background: #5ec4ee; border: 2px solid #2a2335; border-radius: 8px; }
.sk-toybox .sk-pv-board {
  background: repeating-linear-gradient(90deg, rgba(42, 35, 53, 0.12) 0 1px, transparent 1px 16.66%),
    repeating-linear-gradient(0deg, rgba(42, 35, 53, 0.12) 0 1px, transparent 1px 16.66%), #a3d9b1;
  border: 2px solid #2a2335;
}
.sk-toybox .sk-pv-belt { background: #4a4058; border: 1px solid #2a2335; }
.sk-toybox .sk-pv-belt::after { content: ""; position: absolute; inset: 35% 20%; background: #f6c445; }
.sk-toybox .sk-pv-marker { background: #f6c445; border: 2px solid #2a2335; }
.sk-toybox .sk-pv-cell { background: #ec5b45; border: 2px solid #2a2335; border-radius: 8px; }
.sk-toybox .sk-pv-win { background: #f7e7c6; border: 2px solid #2a2335; border-radius: 4px; }
.sk-toybox .sk-pv-robot { background: #5ec4ee; border: 2px solid #2a2335; border-radius: 4px; }
.sk-toybox .sk-pv-dial { background: #2a2335; border-radius: 4px; border-top: 5px solid #ec5b45; }
.sk-toybox .sk-pv-dial.blue { border-top-color: #2d86b5; }
.sk-toybox .sk-pv-run { background: #ec5b45; border: 2px solid #2a2335; border-radius: 6px; }
.sk-toybox .sk-pv-key { background: #fff4dc; border: 2px solid #2a2335; border-radius: 4px; }

/* retro mini screen (tg-wtv.8): circuit-board desk, a green terminal header,
   an amber tray, a teal board with copper belts, an ice-blue robot cell, a
   gunmetal deck with coloured keys (css/retro.css "panel hues") */
.sk-retro .sk-pv { background: url("../images/retro/pcb.png") 0 0 / 128px 128px repeat, #07130d; border: 1px solid #23706c; }
.sk-retro .sk-pv-hdr { background: #06110a; border: 1px solid #33ff66; }
.sk-retro .sk-pv-badge { border: 1px solid #33ff66; }
.sk-retro .sk-pv-line { background: #33ff66; box-shadow: 0 0 3px rgba(51, 255, 102, 0.6); height: 12%; }
.sk-retro .sk-pv-line.short { background: #1a9c40; box-shadow: none; }
.sk-retro .sk-pv-tray { background: #150e03; border: 1px solid #ffb000; }
.sk-retro .sk-pv-tile { background: #0c2a33; border: 1px solid #9a6a10; }
.sk-retro .sk-pv-tile:nth-child(3) { background: #ff5c50; border-color: #041014; }
.sk-retro .sk-pv-tile:nth-child(6) { background: #58a6ff; border-color: #041014; }
.sk-retro .sk-pv-mat { background: #081a1f; border: 1px solid #5fe0d8; }
.sk-retro .sk-pv-board {
  background: repeating-linear-gradient(90deg, rgba(95, 224, 216, 0.16) 0 1px, transparent 1px 16.66%),
    repeating-linear-gradient(0deg, rgba(95, 224, 216, 0.16) 0 1px, transparent 1px 16.66%), #0c2a33;
  border: 1px solid #3a8a92;
}
.sk-retro .sk-pv-belt { border: 1px solid #a66a30; background: #4f3319; }
.sk-retro .sk-pv-belt::after { content: ""; position: absolute; inset: 40% 22%; background: #d8b27c; }
.sk-retro .sk-pv-marker { background: #fff6c8; border: 1px solid #ffd23a; box-shadow: 0 0 6px #ffd23a; }
.sk-retro .sk-pv-cell { background: #0c1520; border: 1px solid #8fd0ff; }
.sk-retro .sk-pv-win { background: #1a2634; border: 1px solid #8fd0ff; }
.sk-retro .sk-pv-robot { background: #0f1720; border: 1px solid #eef4f7; }
.sk-retro .sk-pv-dial { background: #05080b; border: 1px solid #ff5c50; }
.sk-retro .sk-pv-dial.blue { border-color: #58a6ff; }
.sk-retro .sk-pv-deck { background: linear-gradient(180deg, #2a3038, #15181d); border: 1px solid #4b5560; }
.sk-retro .sk-pv-run { background: #c8461e; border: 1px solid #0b0d10; }
.sk-retro .sk-pv-key { background: #2f7a4a; border: 1px solid #0b0d10; }
.sk-retro .sk-pv-key:nth-child(4) { background: #24728a; }
.sk-retro .sk-pv::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
  pointer-events: none;
}

/* the Look switch in About (js/scenes/about.js) */
.ab-look { margin-top: 14px; }
.ab-look .tb-btn { width: 100%; height: 48px; }
@media (prefers-reduced-motion: reduce) {
  .sk-card { transition: none; }
  .sk-toybox:hover { transform: none; }
}
