/* Minigames sheet: the game's own look (its tokens, flat surfaces, 1.5 to 2 px outlines, no glow, no gradients):
   the mode list with preview images, the first-run card, the game view and the result card.
   Every selector starts with .lab- or #lab. The Lab tokens map to the game tokens of style.css, so the Lab looks the same as the
   Practice screen in light and dark themes. Gold is for stars and the cup rim only. */

#labSheet {
  --lab-gold: var(--gold); --lab-gold-hi: var(--gold); --lab-cream: var(--text); --lab-ink: var(--on-accent);
  --lab-glass: var(--surface); --lab-glass-2: var(--surface2); --lab-edge: var(--line); --lab-teal: var(--accent); --lab-muted: var(--muted);
}
#labSheet .screen-inner { width: min(100%, 640px); position: relative; z-index: 1; }
.lab-card {
  text-align: left; border-radius: 26px; padding: 16px 16px 14px;
}
.lab-card [hidden] { display: none !important; }
.lab-card :focus-visible { outline: 3px solid var(--lab-gold); outline-offset: 2px; }

/* the title is focused by script; its focus ring is not wanted */
.lab-card .lab-title:focus-visible, .lab-card .lab-mode-name:focus-visible, .lab-card .lab-praise:focus-visible,
.lab-card .lab-howto-title:focus-visible { outline: none; }
.lab-title, .lab-mode-name {
  margin: 0; text-align: center; color: var(--lab-cream); font-weight: 900; letter-spacing: 0.2px; outline: none;
}
.lab-title { font-size: 30px; line-height: 1.1; margin-bottom: 4px; }
.lab-note { margin: 6px 0 12px; color: var(--lab-muted); text-align: center; font-size: 14px; font-weight: 700; }
.lab-msg { min-height: 1.2em; color: var(--lab-muted); text-align: center; }
.lab-msg:empty { display: none; }

/* list of modes: preview on the left, text on the right, six chips underneath */
.lab-modes { display: grid; gap: 12px; }
.lab-mode {
  border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 10px; color: var(--lab-cream);
  box-shadow: none;
}
.lab-mode-top { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.lab-preview {
  display: block; width: 96px; height: 170px; object-fit: cover; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface2);
}
.lab-noimg .lab-mode-top { grid-template-columns: minmax(0, 1fr); }
.lab-mode-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.lab-mode-title { margin: 0; font-size: 20px; font-weight: 900; color: var(--lab-cream); }
.lab-blurb { margin: 0; font-size: 14px; font-weight: 700; color: var(--lab-cream); line-height: 1.3; }
.lab-dots { display: flex; gap: 6px; margin-top: 2px; }
.lab-dot {
  width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent;
}
.lab-dot.on { background: var(--accent); border-color: var(--accent); }
.lab-chips { display: grid; grid-template-columns: repeat(6, minmax(40px, 1fr)); gap: 6px; margin-top: 10px; }
.lab-chips-many { grid-template-columns: repeat(4, minmax(48px, 1fr)); }
@media (min-width: 560px) { .lab-chips-many { grid-template-columns: repeat(8, minmax(48px, 1fr)); } }
.lab-chip {
  min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px;
  border-radius: 14px; border: 1.5px solid var(--glass); background: var(--surface); color: var(--text);
  box-shadow: 0 2px 8px var(--shadow); font: inherit; cursor: pointer;
}
.lab-chip.got { border-color: var(--accent); }
.lab-chip:active { transform: scale(0.96); }
.lab-chip-no { font-weight: 900; font-size: 17px; line-height: 1.1; color: var(--lab-cream); }
.lab-chip-stars { font-size: 14px; line-height: 1; letter-spacing: 1px; } /* 1.25 times the old size */
.lab-chip-star.on { color: var(--gold); }
.lab-chip-star.off { color: var(--line); opacity: 0.75; }
.lab-sum { margin: 8px 0 0; color: var(--lab-muted); font-size: 13px; font-weight: 700; }
.lab-close { width: 100%; margin-top: 14px; }

/* buttons: the game's primary (accent) and secondary (surface) buttons; round icons in the game header */
.lab-btn-gold, .lab-btn-glass {
  appearance: none; min-height: 50px; padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 900; font-size: 18px;
  cursor: pointer; text-align: center; transition: transform 120ms;
}
.lab-btn-gold {
  border: 2px solid transparent; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px var(--accent-glow);
}
.lab-btn-glass {
  border: 1.5px solid var(--glass); background: var(--surface); color: var(--text); box-shadow: 0 2px 8px var(--shadow);
}
.lab-btn-gold:active, .lab-btn-glass:active, .lab-round:active { transform: scale(0.96); }
.lab-btn-gold:disabled, .lab-btn-glass:disabled { opacity: 0.5; cursor: default; }
.lab-btn-gold:focus-visible, .lab-btn-glass:focus-visible, .lab-round:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lab-round {
  flex: 0 0 auto; width: 52px; height: 52px; min-width: 44px; min-height: 44px; border-radius: 50%; padding: 0; position: relative;
  border: 1.5px solid var(--glass); cursor: pointer; color: var(--text); font: inherit; font-size: 24px; font-weight: 900;
  background: var(--surface); box-shadow: 0 2px 8px var(--shadow);
}
.lab-round-back::before {
  content: ""; position: absolute; left: 21px; top: 17px; width: 12px; height: 12px;
  border-left: 3px solid var(--text); border-bottom: 3px solid var(--text); transform: rotate(45deg);
}

/* game view */
.lab-game { position: relative; display: flex; flex-direction: column; gap: 8px; }
.lab-game-head { display: flex; align-items: center; gap: 10px; }
.lab-game-title { flex: 1 1 auto; min-width: 0; }
.lab-mode-name { font-size: 26px; line-height: 1.1; }
.lab-level-title { margin: 4px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--lab-muted); }
.lab-goal {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 auto; max-width: 92%; min-height: 0;
  border: 0; background: none; box-shadow: none; padding: 2px 8px; color: var(--text); font-weight: 900; font-size: 15px;
}
.lab-goal-txt { min-width: 0; }
.lab-stage {
  position: relative; width: 100%; height: clamp(230px, 50vh, 600px); display: flex; align-items: center; justify-content: center;
  border: 0; background: none; box-shadow: none; border-radius: 0; overflow: visible;
}
.lab-canvas { display: block; max-width: 100%; max-height: 100%; touch-action: none; }
/* info panel: a block strip under the board; digits are set in the text colour (span.lab-num) */
.lab-info {
  display: block; margin: 0; min-height: 46px; padding: 10px 16px; border-radius: 14px; text-align: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--lab-cream); font-size: 15px; font-weight: 800;
}
.lab-num { color: inherit; font-weight: 900; font-size: 1em; padding: 0; }
.lab-fail { color: var(--danger); text-align: center; font-weight: 800; }
.lab-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0 0; }
.lab-actions .lab-btn-gold, .lab-actions .lab-btn-glass { flex: 1 1 130px; }
.lab-result {
  margin-top: 6px; padding: 14px; border-radius: 22px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 8px 24px var(--shadow); text-align: center;
}
.lab-praise { margin: 0; font-size: 28px; font-weight: 900; color: var(--gold); outline: none; }
.lab-result-stars { margin: 4px 0; font-size: 24px; letter-spacing: 0; color: var(--gold); }
.lab-result-text { margin: 0 0 10px; color: var(--lab-muted); font-weight: 700; }

/* first-run card: a card over the game view, not a full-screen slab */
.lab-howto {
  position: absolute; inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 380px); height: auto; max-height: 92%;
  z-index: 4; display: flex; flex-direction: column; gap: 12px; align-items: stretch; justify-content: center;
  padding: 18px; border-radius: 24px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 8px 24px var(--shadow);
  overflow: auto;
}
.lab-howto-title { margin: 0; text-align: center; font-size: 26px; font-weight: 900; color: var(--lab-cream); outline: none; }
.lab-howto-list { margin: 0; padding: 0 0 0 20px; display: grid; gap: 10px; font-size: 17px; font-weight: 700; color: var(--lab-cream); }
.lab-howto-line::marker { color: var(--accent); }
.lab-howto-demo { min-height: 0; }
.lab-howto-demo:empty { display: none; }
.lab-howto-ok { align-self: center; min-width: 200px; }

/* short landscape screens (568 x 320): the stage takes the left column, the text and buttons the right */
@media (orientation: landscape) and (max-height: 500px) {
  #labSheet .screen-inner { width: min(100%, 780px); }
  .lab-card { padding: 12px 14px; }
  .lab-title { font-size: 24px; }
  .lab-game { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 6px 14px; align-items: start; }
  .lab-game-head { grid-column: 1 / -1; }
  .lab-goal { grid-column: 2; grid-row: 2; margin: 0; max-width: none; font-size: 14px; }
  .lab-stage { grid-column: 1; grid-row: 2 / span 4; height: 72vh; min-height: 170px; }
  .lab-info { grid-column: 2; grid-row: 3; min-height: 40px; font-size: 16px; }
  .lab-actions, .lab-fail, .lab-result { grid-column: 2; }
  .lab-result { margin-top: 0; }
  .lab-mode-top { grid-template-columns: 72px minmax(0, 1fr); }
  .lab-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } /* two columns of cards on short screens */
  .lab-preview { width: 72px; height: 128px; }
}

/* ---------- full-screen game view: class lab-play on #labSheet while a level is open ----------
   The sheet fills the viewport (100dvh, 100vh fallback, safe-area insets), the intro and the list are hidden, the sheet does not
   scroll behind the game, and the stage takes all the space left over (fitCanvas letterboxes the board inside it).
   Every control keeps 24 px or more from the screen edge: 12 px sheet padding plus 12 px card padding. */
#labSheet.lab-play {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
}
#labSheet.lab-play .screen-inner { width: 100%; height: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; }
#labSheet.lab-play .lab-card {
  flex: 1 1 auto; min-height: 0; height: 100%; display: flex; flex-direction: column; padding: 8px; border-radius: 18px;
}
#labSheet.lab-play .lab-title, #labSheet.lab-play .lab-note, #labSheet.lab-play .lab-msg, #labSheet.lab-play .lab-list { display: none !important; }
#labSheet.lab-play .lab-game { flex: 1 1 auto; min-height: 0; height: 100%; gap: 6px; }
#labSheet.lab-play .lab-game-head { gap: 8px; }
#labSheet.lab-play .lab-round { width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 20px; }
#labSheet.lab-play .lab-round-back::before { left: 17px; top: 14px; }
#labSheet.lab-play .lab-mode-name { font-size: 20px; }
#labSheet.lab-play .lab-level-title { margin-top: 2px; font-size: 12px; }
#labSheet.lab-play .lab-goal { margin: 0 auto; max-width: 100%; padding: 2px 8px; font-size: 14px; line-height: 1.2; }
/* the stage takes the leftover space; !important beats inline sizes a mode may set on its container (sling sets aspect-ratio and max-height) */
#labSheet.lab-play .lab-stage-wrap { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
#labSheet.lab-play .lab-stage {
  flex: 1 1 0 !important; min-height: 0 !important; height: auto !important; max-height: none !important; aspect-ratio: auto !important;
}
#labSheet.lab-play .lab-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#labSheet.lab-play .lab-info { flex: 1 1 150px; min-height: 84px; margin: 0; padding: 6px 12px; font-size: 15px; } /* room for four lines, so a long hint never resizes the board */
#labSheet.lab-play .lab-goal { min-height: 44px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; } /* room for two lines */
#labSheet.lab-play .lab-actions { margin: 0; flex: 0 0 auto; flex-wrap: nowrap; gap: 8px; }
#labSheet.lab-play .lab-actions .lab-btn-gold, #labSheet.lab-play .lab-actions .lab-btn-glass {
  flex: 0 0 auto; min-height: 44px; padding: 8px 14px; font-size: 15px;
}
#labSheet.lab-play .lab-fail { flex: 1 1 100%; font-size: 13px; margin: 0; }
#labSheet.lab-play .lab-result {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 380px); z-index: 5; margin: 0;
}

/* the side column (grid column 2) holds, from the top: the head (row 1), the goal (row 2), a mode panel (rows 3 and 4: the aim pad,
   the Balance readout and tip), the info and the buttons (row 5). The stage spans every row, so the board gets the full height.
   The stage wrapper and a mode's panel box are display: contents, so their children are the grid items. */
@media (max-height: 420px), (orientation: landscape) {
  #labSheet.lab-play .lab-game {
    display: grid; grid-template-columns: minmax(0, 70fr) minmax(0, 30fr); grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
    column-gap: 10px; row-gap: 6px;
  }
  #labSheet.lab-play .lab-stage-wrap { display: contents; }
  #labSheet.lab-play .lab-stage { grid-column: 1; grid-row: 1 / -1; align-self: stretch; min-width: 0; }
  #labSheet.lab-play .lab-game-head { grid-column: 2; grid-row: 1; }
  #labSheet.lab-play .lab-goal { grid-column: 2; grid-row: 2; font-size: 13px; }
  #labSheet.lab-play .lab-bottom { grid-column: 2; grid-row: 5; flex-direction: column; align-items: stretch; align-self: start; }
  #labSheet.lab-play .lab-info { flex: 0 0 auto; }
  #labSheet.lab-play .lab-goal { padding: 2px 6px; }
  #labSheet.lab-play .lab-info { min-height: 40px; padding: 4px 10px; font-size: 14px; }
  #labSheet.lab-play .lab-actions { flex-direction: row; flex-wrap: nowrap; gap: 6px; }
  #labSheet.lab-play .lab-actions .lab-btn-gold, #labSheet.lab-play .lab-actions .lab-btn-glass {
    flex: 1 1 0; min-width: 0; padding: 6px 8px; font-size: 14px;
  }
  #labSheet.lab-play .lab-level-title { display: none; }
  #labSheet.lab-play .lab-game-head { gap: 6px; }
  #labSheet.lab-play .lab-round { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  #labSheet.lab-play .lab-round-back::before { left: 17px; top: 14px; }
  #labSheet.lab-play .lab-mode-name { font-size: 16px; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  .lab-card *, .lab-card *::before, .lab-card *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .lab-mode, .lab-chip, .lab-stage, .lab-result, .lab-info, .lab-goal, .lab-howto { border: 2px solid CanvasText; }
  .lab-chip.got, .lab-goal { border-color: Highlight; }
  .lab-btn-gold, .lab-btn-glass, .lab-round { border: 2px solid ButtonText; }
}

/* mode panels in the game view. The mode files keep to their own prefix, so their placements live here:
   the Slingshot aim pad, the Balance board, readout and tip, and the Maze Jar board (see the landscape grid above) */
@media (max-height: 420px), (orientation: landscape) {
  #labSheet.lab-play .lab-sling-pad { grid-column: 2; grid-row: 3; align-self: start; min-height: 0; padding: 6px 10px; }
  #labSheet.lab-play .lab-stage:has(> .lab-balance-root) { display: contents; }
  #labSheet.lab-play .lab-balance-root { display: contents; }
  #labSheet.lab-play .lab-balance-board { grid-column: 1; grid-row: 1 / -1; align-self: stretch; min-height: 0; min-width: 0; }
  #labSheet.lab-play .lab-balance-readout { grid-column: 2; grid-row: 3; justify-self: center; margin: 0; }
  #labSheet.lab-play .lab-balance-tip { grid-column: 2; grid-row: 4; margin: 0; min-height: 0; }
}
/* portrait: the Balance board is 360 x 300 (balance.js crops the empty top) at the screen width, and the board, readout and tip sit as one
   group centred between the goal and the bottom bar; the tip keeps two lines so nothing jumps. The Maze Jar has no side padding */
@media (orientation: portrait) {
  #labSheet.lab-play .lab-balance-root { justify-content: center; }
  #labSheet.lab-play .lab-balance-board { flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 360 / 300; max-height: 100%; }
  #labSheet.lab-play .lab-balance-tip { min-height: 2.6em; }
  #labSheet.lab-play .lab-maze { padding: 0; }
}

/* ---------- colour themes (2026-11): every minigame has its own two-colour palette; the window gets a glowing gradient frame, a
   soft nebula and a few stars. All of it is static (no animation, no filters over canvases), so it costs no battery.
   --m1 / --m2 are the mode colours; the list uses .lab-mode[data-mode], the game view uses #labSheet[data-mode] (set by index.js). ---------- */
#labSheet, .lab-mode { --m1: var(--accent); --m2: var(--ghost); }
#labSheet[data-mode="sumten"], .lab-mode[data-mode="sumten"] { --m1: #C46A00; --m2: #C2255C; }
#labSheet[data-mode="maze"], .lab-mode[data-mode="maze"] { --m1: #0E8A57; --m2: #0B7578; }
#labSheet[data-mode="tilt"], .lab-mode[data-mode="tilt"] { --m1: #6A3FD8; --m2: #C2258F; }
#labSheet[data-mode="balance"], .lab-mode[data-mode="balance"] { --m1: #C2501C; --m2: #9A6A00; }
#labSheet[data-mode="sling"], .lab-mode[data-mode="sling"] { --m1: #0B6FB3; --m2: #4A3FD0; }
@media (prefers-color-scheme: dark) {
  #labSheet[data-mode="sumten"], .lab-mode[data-mode="sumten"] { --m1: #FFB84A; --m2: #FF6FA0; }
  #labSheet[data-mode="maze"], .lab-mode[data-mode="maze"] { --m1: #4ADE9A; --m2: #3FD8E8; }
  #labSheet[data-mode="tilt"], .lab-mode[data-mode="tilt"] { --m1: #B28CFF; --m2: #FF7AD9; }
  #labSheet[data-mode="balance"], .lab-mode[data-mode="balance"] { --m1: #FF9B6B; --m2: #FFD36B; }
  #labSheet[data-mode="sling"], .lab-mode[data-mode="sling"] { --m1: #5CC8FF; --m2: #8F8FFF; }
}

/* the window: gradient frame (border-box trick), nebula glows in the two mode colours, a sprinkle of stars, outer glow */
.lab-card {
  border: 2px solid transparent;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, color-mix(in srgb, var(--text) 70%, transparent), transparent 100%),
    radial-gradient(1px 1px at 78% 9%, color-mix(in srgb, var(--text) 60%, transparent), transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 42%, color-mix(in srgb, var(--text) 55%, transparent), transparent 100%),
    radial-gradient(1px 1px at 8% 66%, color-mix(in srgb, var(--text) 55%, transparent), transparent 100%),
    radial-gradient(1.5px 1.5px at 64% 88%, color-mix(in srgb, var(--text) 60%, transparent), transparent 100%),
    radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--m1) 22%, transparent), transparent 62%),
    radial-gradient(120% 60% at 100% 100%, color-mix(in srgb, var(--m2) 22%, transparent), transparent 62%),
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--m1), var(--m2) 55%, var(--m1)) border-box;
  background-clip: padding-box, padding-box, padding-box, padding-box, padding-box, padding-box, padding-box, padding-box, border-box;
  box-shadow: 0 0 26px color-mix(in srgb, var(--m1) 30%, transparent), 0 14px 40px var(--shadow);
}
/* the title and the mode names in the two mode colours */
.lab-title, .lab-mode-name, .lab-mode-title, .lab-howto-title {
  background: linear-gradient(90deg, var(--m1), var(--m2)); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.lab-mode-title { display: inline-block; }

/* list cards: a thin gradient edge, a tinted corner, a glowing preview */
.lab-mode {
  border: 2px solid transparent;
  background:
    radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--m1) 16%, transparent), transparent 70%),
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--m1) 70%, var(--line)), color-mix(in srgb, var(--m2) 70%, var(--line))) border-box;
  background-clip: padding-box, padding-box, border-box;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--m2) 14%, transparent);
}
.lab-preview { border: 0; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--m1) 60%, transparent), 0 4px 16px color-mix(in srgb, var(--m2) 35%, transparent); }
.lab-dot.on { background: var(--m1); border-color: var(--m1); box-shadow: 0 0 6px color-mix(in srgb, var(--m1) 70%, transparent); }
.lab-chip { border-color: color-mix(in srgb, var(--m1) 35%, var(--line)); background: color-mix(in srgb, var(--m1) 8%, var(--surface)); }
.lab-chip.got { border-color: var(--m1); box-shadow: 0 0 10px color-mix(in srgb, var(--m1) 35%, transparent); }

/* buttons: the primary one is a gradient pill with a glow; the others are tinted glass */
.lab-btn-gold {
  background: linear-gradient(135deg, var(--m1), var(--m2)); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--m1) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.lab-btn-glass, .lab-round {
  border-color: color-mix(in srgb, var(--m1) 45%, var(--glass)); background: color-mix(in srgb, var(--m1) 9%, var(--surface));
}
.lab-btn-gold:focus-visible, .lab-btn-glass:focus-visible, .lab-round:focus-visible { outline-color: var(--m1); }

/* the board, the goal line and the info strip */
.lab-canvas { border-radius: 18px; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--m1) 55%, transparent), 0 0 22px color-mix(in srgb, var(--m2) 28%, transparent); }
.lab-info {
  border: 1.5px solid color-mix(in srgb, var(--m1) 40%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--m1) 14%, var(--surface)), color-mix(in srgb, var(--m2) 10%, var(--surface)));
}
.lab-sling-pad { border-color: color-mix(in srgb, var(--m1) 55%, var(--line)); background: color-mix(in srgb, var(--m1) 6%, transparent); }
.lab-sling-cell.on, .lab-sling-pip { background: var(--m1); }
.lab-sling-pip { border-color: var(--m1); }

/* the result card and the first-run card: the same gradient frame as the window, a bigger glow */
.lab-result, .lab-howto {
  border: 2px solid transparent;
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--m1) 24%, transparent), transparent 70%),
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--m1), var(--m2)) border-box;
  background-clip: padding-box, padding-box, border-box;
  box-shadow: 0 0 34px color-mix(in srgb, var(--m1) 38%, transparent), 0 12px 30px var(--shadow);
}
.lab-praise { text-shadow: 0 0 14px color-mix(in srgb, var(--gold) 55%, transparent); }
.lab-howto-line::marker { color: var(--m1); }

@media (forced-colors: active) {
  .lab-card, .lab-mode, .lab-result, .lab-howto { background: Canvas; border: 2px solid CanvasText; }
  .lab-title, .lab-mode-name, .lab-mode-title, .lab-howto-title { background: none; -webkit-text-fill-color: currentColor; color: CanvasText; }
}

/* difficulty row on a mode card: the label, then five balls that are green (easy), yellow (medium) or red (hard) */
.lab-diff { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.lab-diff-label { font-size: 12px; font-weight: 800; color: var(--lab-muted); }
.lab-diff .lab-dots { margin-top: 0; }
.lab-dots[data-level="easy"] .lab-dot.on { background: #1E9E5A; border-color: #1E9E5A; box-shadow: 0 0 6px rgba(30, 158, 90, 0.55); }
.lab-dots[data-level="medium"] .lab-dot.on { background: #D9A300; border-color: #D9A300; box-shadow: 0 0 6px rgba(217, 163, 0, 0.55); }
.lab-dots[data-level="hard"] .lab-dot.on { background: #E0392D; border-color: #E0392D; box-shadow: 0 0 6px rgba(224, 57, 45, 0.55); }
@media (prefers-color-scheme: dark) {
  .lab-dots[data-level="easy"] .lab-dot.on { background: #4ADE80; border-color: #4ADE80; box-shadow: 0 0 6px rgba(74, 222, 128, 0.6); }
  .lab-dots[data-level="medium"] .lab-dot.on { background: #FFD43B; border-color: #FFD43B; box-shadow: 0 0 6px rgba(255, 212, 59, 0.6); }
  .lab-dots[data-level="hard"] .lab-dot.on { background: #FF5A4E; border-color: #FF5A4E; box-shadow: 0 0 6px rgba(255, 90, 78, 0.6); }
}
