:root {
  color-scheme: dark;
  --bg: #0e0f12;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  font-family: -apple-system, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

/* Stage fills the panel; the canvas is sized in code at physical (HiDPI)   */
/* resolution and presented 1:1. All interaction is hit-tested on-canvas.   */
#stage {
  position: absolute;
  inset: 0;
}

#panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* The locked screen lives on the canvas. This layer contributes one thing the  */
/* canvas cannot: a real text field, so the customer gets a native caret,       */
/* selection, paste and IME on the key. It is positioned frame by frame from    */
/* src/glitchlab.js onto the box in the artwork, which is why it carries no     */
/* box of its own — no background, no border, nothing that could double up on   */
/* the box already painted underneath it.                                       */
.license-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  /* Only the field itself takes the pointer; ACTIVATE and the rest of the      */
  /* screen are hit-tested on the canvas below.                                 */
  pointer-events: none;
}

.license-gate[hidden],
.license-fallback[hidden] {
  display: none;
}

.license-gate__form {
  display: contents;
}

/* Off-screen but still announced: the canvas is opaque to assistive tech, so   */
/* the heading, label, submit and live status all live here instead.            */
.license-gate__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#licenseKey {
  position: absolute;
  /* Real geometry is written by the renderer every frame; these are only the   */
  /* values that apply for the first paint, before the plate has been fitted.   */
  left: 0;
  top: -100px;
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  pointer-events: auto;
  text-align: center;
  color: #ffe3e3;
  caret-color: #ff2d3a;
  text-shadow:
    0 0 6px rgba(255, 45, 58, 0.85),
    0 0 18px rgba(255, 45, 58, 0.45);
  font-family: "Arial Narrow", "Helvetica Neue", -apple-system, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  /* The panel's own glitch scheduler drives this while a burst is running, so  */
  /* the field tears with the plate instead of floating above it.               */
  transition: none;
}

#licenseKey::placeholder {
  color: rgba(255, 120, 128, 0.42);
  text-shadow: none;
}

#licenseKey::selection {
  background: rgba(255, 45, 58, 0.42);
  color: #fff;
}

/* Canvas gate could not start. The field stops being an overlay on artwork  */
/* that is not there and becomes an ordinary centred box, so a customer can   */
/* still activate rather than being stuck looking at an apology.              */
.license-gate--plain {
  pointer-events: auto;
}

.license-gate--plain #licenseKey {
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  width: min(78%, 280px);
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 45, 58, 0.45);
  border-radius: 8px;
  background: #120c0e;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.license-fallback {
  position: fixed;
  inset: 0;
  /* Under the gate, so the plain field above stays reachable. */
  z-index: 19;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
  background: #0a0709;
  text-align: center;
}

.license-fallback__brand {
  margin: 0 0 10px;
  color: #ff2d3a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.license-fallback__copy {
  /* Sits above the centred plain field rather than under it. */
  margin: 0 0 128px;
  max-width: 300px;
  color: #cbb7b7;
  font-size: 13px;
  line-height: 1.5;
}

/* ---- A card's controls page (src/sheet.js) ---------------------------------- */
/* A blackened steel service plate bolted over the page's sign and well: a      */
/* monitor in the cabinet's riveted neon housing, a gear on a toothed rack for  */
/* each setting, glass pilot lamps for colours, RESET and a neon APPLY. The     */
/* plate, housings, gear and lamps are cut from renders (assets/ui/controls,    */
/* tools/art/cut_controls.py); the light is code, in the page's own colour      */
/* (--rgb / --glow-rgb: PRESETS' amber here, set per page). Geometry, --u and   */
/* every size that has a floor are written by the page as the panel fits the    */
/* cabinet. Written for After Effects 2021's panel browser (Chrome 74): no      */
/* clamp()/min()/max(), no flex gap, no inset, and :focus-visible never sits in */
/* a grouped selector (Chrome 74 drops the whole rule).                         */
.gl-sheet {
  --u: 11px;
  --rgb: 255, 176, 32;
  --glow-rgb: 255, 106, 26;
  --core: #ffd99b;
  --value: #ffe0ad;
  --words: #ffe9c6;
  --good: #ffdfa8;
  --go-core: #ffe7bf;
  --fs-label: 9px;
  --fs-value: 10px;
  --fs-note: 9px;
  --label-w: 80px;
  --rack-h: 26px;
  --lamp: 14px;
  --hs-slice: 69;
  --hs-go: 6px;
  --hs-go-face: 3px;
  --hs-close: 5px;
  --hs-close-face: 2.5px;
  --hs-tab: 4px;
  --hs-tab-face: 2px;
  position: fixed;
  left: 0;
  top: -9999px;
  width: 10px;
  height: 10px;
  z-index: 15;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  background: #0e0c0b;
  color: #b9b2a8;
  font-family: "Arial Narrow", "Helvetica Neue Condensed", Arial, sans-serif;
  font-weight: 700;
  font-size: var(--u);
  user-select: none;
}

.gl-sheet[hidden] {
  display: none;
}

/* the plate takes on the page's colour, faintly, and the light of the rails beside it */
.gl-sheet::before,
.gl-sheet::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

.gl-sheet::before {
  background: rgb(var(--rgb));
  mix-blend-mode: color;
  opacity: 0.1;
}

.gl-sheet::after {
  background: linear-gradient(90deg, rgba(var(--rgb), 0.08), rgba(var(--rgb), 0) calc(var(--u) * 0.6),
              rgba(var(--rgb), 0) calc(100% - var(--u) * 0.6), rgba(var(--rgb), 0.08));
}

.gl-sheet > * {
  position: relative;
  z-index: 2;
  flex: none;
}

.gl-sheet button,
.gl-sheet input,
.gl-sheet textarea {
  font: inherit;
  color: inherit;
}

.gl-sheet button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  outline: none;
}

/* keyboard focus: a near-white ring every page shows (never the accent) */
.gl-sheet.is-keys button:focus,
.gl-sheet.is-keys textarea:focus {
  outline: 2px solid #f2ede6;
  outline-offset: 1px;
}

.gl-sheet.is-keys .gl-rack:focus-within {
  outline: 2px solid #f2ede6;
  outline-offset: 2px;
}

.gl-sheet__deck {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
}

.gl-sheet > .gl-sheet__deck {
  position: absolute;
  z-index: 0;
}

.gl-sheet > .gl-sheet__sparks {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  display: block;
  pointer-events: none;
}

/* ---- the screen ---- */
.gl-sheet__screen {
  overflow: visible;
}

.gl-sheet__canvas {
  position: absolute;
  display: block;
  background: #050403;
}

.gl-sheet__bezel {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  pointer-events: none;
}

/* A riveted housing (the ACTIVATE frame): its frame drawn from the art, its     */
/* face smoked glass. --hs-w is the corner's width, --hs-face the frame's.       */
.gl-hs {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

.gl-hs::before {
  content: "";
  position: absolute;
  left: var(--hs-face);
  top: var(--hs-face);
  right: var(--hs-face);
  bottom: var(--hs-face);
  background: linear-gradient(180deg, #0c0b0a, #040303);
  pointer-events: none;
}

.gl-hs::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  border-style: solid;
  border-width: var(--hs-w);
  border-image-source: var(--img-housing);
  border-image-slice: var(--hs-slice);
  border-image-width: var(--hs-w);
  border-image-repeat: stretch;
  pointer-events: none;
}

.gl-sheet__go,
.gl-sheet__reset {
  --hs-w: var(--hs-go);
  --hs-face: var(--hs-go-face);
}

.gl-row__arrow,
.gl-row--tools .gl-tool {
  --hs-w: var(--hs-tab);
  --hs-face: var(--hs-tab-face);
}

/* the close block: the housing's top-right corner, an X of neon tube; its hit */
/* area reaches 0.3u past the block                                            */
.gl-sheet__close {
  --hit: calc(var(--u) * 0.3);
  --hs-w: var(--hs-close);
  --hs-face: calc(var(--hs-close-face) + var(--hit));
  position: absolute;
  right: calc(var(--u) * -0.3);
  top: calc(var(--u) * -0.3);
  z-index: 4;
  box-sizing: content-box;
  padding: var(--hit);
}

.gl-sheet__close::after {
  left: var(--hit);
  top: var(--hit);
  right: var(--hit);
  bottom: var(--hit);
}

.gl-sheet__close svg {
  position: relative;
  z-index: 1;
  display: block;
  overflow: visible;
}

.gl-x__tube,
.gl-x__tubeglow,
.gl-x__glow,
.gl-x__mid,
.gl-x__core {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gl-x__tubeglow { stroke: rgb(var(--glow-rgb)); opacity: 0.06; }
.gl-x__tube { stroke: var(--core); opacity: 0.25; }
.gl-x__glow { stroke: rgb(var(--glow-rgb)); opacity: 0.16; }
.gl-x__mid { stroke: rgb(var(--rgb)); opacity: 0.38; }
.gl-x__core { stroke: var(--core); opacity: 0.75; }

.gl-sheet__close:hover .gl-x__tube { opacity: 0.6; }
.gl-sheet__close:hover .gl-x__tubeglow { opacity: 0.14; }
.gl-sheet__close:hover .gl-x__glow { opacity: 0.24; }
.gl-sheet__close:hover .gl-x__mid { opacity: 0.55; }
.gl-sheet__close:hover .gl-x__core { opacity: 1; }
.gl-sheet__close.is-press .gl-x__glow,
.gl-sheet__close.is-press .gl-x__mid,
.gl-sheet__close.is-press .gl-x__core { opacity: 0; }

/* ---- the rows ---- */
.gl-sheet > .gl-sheet__rows {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.gl-sheet__rows::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* the list fades where there is more: at the bottom while more is below, at the top once scrolled */
.gl-sheet__rows.is-more {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--u) * 2.4), rgba(0, 0, 0, 0.06));
  mask-image: linear-gradient(180deg, #000 calc(100% - var(--u) * 2.4), rgba(0, 0, 0, 0.06));
}

.gl-sheet__rows.is-scrolled {
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.06), #000 calc(var(--u) * 1.8));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.06), #000 calc(var(--u) * 1.8));
}

.gl-sheet__rows.is-scrolled.is-more {
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.06), #000 calc(var(--u) * 1.8), #000 calc(100% - var(--u) * 2.4), rgba(0, 0, 0, 0.06));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.06), #000 calc(var(--u) * 1.8), #000 calc(100% - var(--u) * 2.4), rgba(0, 0, 0, 0.06));
}

/* the scroll tube, on the plate's right edge */
.gl-sheet > .gl-sheet__scroll {
  position: absolute;
  z-index: 3;
  display: none;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.gl-sheet > .gl-sheet__scroll.is-on {
  display: block;
}

.gl-sheet__thumb {
  display: block;
  width: 100%;
  border-radius: 99px;
  background: rgba(var(--rgb), 0.7);
  box-shadow: 0 0 3px rgba(var(--rgb), 0.9);
}

.gl-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin-bottom: calc(var(--u) * 0.3);
}

.gl-row[hidden] {
  display: none;
}

/* engraved, not lit: the light is in the values */
.gl-row__label {
  flex: none;
  width: var(--label-w);
  box-sizing: border-box;
  padding-right: calc(var(--u) * 0.4);
  font-size: var(--fs-label);
  line-height: calc(var(--u) * 1.25);
  letter-spacing: 0.12em;
  color: #b9b2a8;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 -1px 0 rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

/* a recessed glass window with the value lit in it */
.gl-row__readout,
.gl-row__value {
  box-sizing: border-box;
  background: #050403;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px #000;
  font-size: var(--fs-value);
  font-variant-numeric: tabular-nums;
  color: var(--value);
  text-shadow: 0 0 calc(var(--u) * 0.45) rgba(var(--rgb), 0.55);
  white-space: nowrap;
}

.gl-row__readout {
  flex: none;
  order: 2;
  min-width: calc(var(--u) * 3.4);
  height: calc(var(--u) * 1.5);
  line-height: calc(var(--u) * 1.5 - 2px);
  margin-left: calc(var(--u) * 0.5);
  padding: 0 calc(var(--u) * 0.35);
  text-align: right;
  letter-spacing: 0.04em;
}

/* the rack: a canvas the page draws, over the real (invisible) range input */
.gl-row__slide {
  position: relative;
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  height: var(--rack-h);
  cursor: grab;
  touch-action: none;
}

.gl-row__slide.is-grab {
  cursor: grabbing;
}

.gl-rack__c {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
}

.gl-row__range {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.gl-sheet.is-busy .gl-sheet__rows {
  opacity: 0.55;
  pointer-events: none;
}

/* ---- choices: a readout window between two steel tabs ---- */
.gl-row__choice {
  display: flex;
  align-items: center;
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
}

.gl-row__arrow {
  flex: none;
  width: calc(var(--u) * 1.6);
  height: calc(var(--u) * 1.7);
}

.gl-row__arrow svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 64%;
  height: 64%;
  margin: 0 auto;
  overflow: visible;
}

.gl-chev__lo,
.gl-chev__hi {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* engraved: a dark cut with its lit lower lip */
.gl-chev__lo { stroke: #000; stroke-width: 2.1; transform: translateY(-0.5px); }
.gl-chev__hi { stroke: #b9b2a8; stroke-width: 1.4; }
.gl-row__arrow:hover .gl-chev__hi { stroke: #f2ede6; }
.gl-row__arrow:active svg { top: 1px; }

.gl-row__value {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: calc(var(--u) * 1.7);
  margin: 0 calc(var(--u) * 0.3);
  padding: 0 calc(var(--u) * 0.2);
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.1em;
}

.gl-reel {
  display: block;
  line-height: calc(var(--u) * 1.7 - 2px);
}

/* a slot reel: the old value up and out, the new one in from below (140 ms) */
.gl-row__value.is-rolling .gl-reel {
  animation: gl-reel-in 140ms ease-out;
}

.gl-row__value.is-rolling::before {
  content: attr(data-old);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  line-height: calc(var(--u) * 1.7 - 2px);
  animation: gl-reel-out 140ms ease-in forwards;
}

.gl-row__value.is-rolling.is-down .gl-reel { animation-name: gl-reel-in-down; }
.gl-row__value.is-rolling.is-down::before { animation-name: gl-reel-out-down; }

@keyframes gl-reel-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes gl-reel-out { from { transform: translateY(0); } to { transform: translateY(-100%); opacity: 0; } }
@keyframes gl-reel-in-down { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes gl-reel-out-down { from { transform: translateY(0); } to { transform: translateY(100%); opacity: 0; } }

/* ---- colours: glass pilot lamps ---- */
.gl-row__swatches {
  display: flex;
  align-items: center;
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  height: calc(var(--lamp) + var(--u) * 0.6);
}

.gl-swatch,
.gl-swatch-pick {
  --lamp-dim: var(--c-off);
  position: relative;
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.gl-swatch:hover,
.gl-swatch-pick:hover {
  --lamp-dim: var(--c-mid);
}

.gl-lamp {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--lamp);
  height: var(--lamp);
  margin: calc(var(--lamp) / -2) 0 0 calc(var(--lamp) / -2);
  isolation: isolate;
  pointer-events: none;
}

.gl-lamp i {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.gl-lamp__off {
  background: radial-gradient(circle closest-side, var(--lamp-dim) 0, var(--lamp-dim) 80%, rgba(0, 0, 0, 0) 84%);
}

.gl-lamp__on {
  opacity: 0;
  background: radial-gradient(circle closest-side, #fff 0, var(--c) 34%, var(--c) 80%, rgba(0, 0, 0, 0) 84%);
  transition: opacity 150ms ease-out;
}

/* the faceted glass over the colour (an overlay map, mean 50% grey) */
.gl-lamp__glass {
  background: var(--img-lens) center / 100% 100% no-repeat;
  mix-blend-mode: overlay;
}

.gl-lamp__ring {
  background: var(--img-ring) center / 100% 100% no-repeat;
}

/* the one that is on: lit, and a bright notch on its ring at 12 o'clock (a shape cue, not only colour) */
.gl-lamp .gl-lamp__notch {
  left: calc(50% - 1px);
  width: 2px;
  height: 22%;
  top: -6%;
  border-radius: 1px;
  background: #fffaf2;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.9);
  opacity: 0;
}

.gl-swatch.is-on .gl-lamp__on,
.gl-swatch-pick.is-on .gl-lamp__on {
  opacity: 1;
  transition: none;
}

.gl-swatch.is-on .gl-lamp__notch,
.gl-swatch-pick.is-on .gl-lamp__notch {
  opacity: 0.95;
}

/* struck on: two flickers, then steady */
.gl-swatch.is-strike .gl-lamp__on,
.gl-swatch-pick.is-strike .gl-lamp__on {
  animation: gl-strike 72ms steps(1, end);
}

@keyframes gl-strike {
  0% { opacity: 1; }
  25% { opacity: 0.15; }
  50% { opacity: 0.9; }
  75% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* any colour: a dim spectrum; once picked, that colour lit inside a thin spectrum ring */
.gl-lamp--any .gl-lamp__off {
  left: 9%;
  top: 9%;
  width: 82%;
  height: 82%;
  background: conic-gradient(#ff2a2a, #ffb020, #c6ff1a, #29e6ff, #6b5bff, #ff3df2, #ff2a2a);
  opacity: 0.4;
}

.gl-swatch-pick:hover .gl-lamp--any .gl-lamp__off {
  opacity: 0.62;
}

.gl-lamp--any .gl-lamp__on {
  left: 9%;
  top: 9%;
  width: 82%;
  height: 82%;
  background: radial-gradient(circle closest-side, var(--c, #fff) 0, var(--c, #fff) 84%, rgba(0, 0, 0, 0) 86%),
              conic-gradient(#ff2a2a, #ffb020, #c6ff1a, #29e6ff, #6b5bff, #ff3df2, #ff2a2a);
}

.gl-swatch-pick .gl-swatch--pick {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* ---- words: a recessed smoked-glass slot ---- */
.gl-row--text {
  flex-wrap: wrap;
}

.gl-row--text .gl-row__label {
  width: 100%;
}

.gl-row__slot {
  width: 100%;
  background: #050506;
  box-shadow: inset 0 1px 3px #000, inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  -webkit-clip-path: polygon(calc(var(--u) * 0.45) 0, calc(100% - var(--u) * 0.45) 0, 100% calc(var(--u) * 0.45), 100% calc(100% - var(--u) * 0.45),
                             calc(100% - var(--u) * 0.45) 100%, calc(var(--u) * 0.45) 100%, 0 calc(100% - var(--u) * 0.45), 0 calc(var(--u) * 0.45));
  clip-path: polygon(calc(var(--u) * 0.45) 0, calc(100% - var(--u) * 0.45) 0, 100% calc(var(--u) * 0.45), 100% calc(100% - var(--u) * 0.45),
                     calc(100% - var(--u) * 0.45) 100%, calc(var(--u) * 0.45) 100%, 0 calc(100% - var(--u) * 0.45), 0 calc(var(--u) * 0.45));
}

.gl-row__slot:focus-within {
  box-shadow: inset 0 1px 3px #000, inset 0 0 0 1px rgba(var(--rgb), 0.7);
}

.gl-row__words {
  display: block;
  width: 100%;
  box-sizing: border-box;
  resize: none;
  margin: 0;
  border: 0;
  outline: none;
  background: transparent;
  padding: calc(var(--u) * 0.45) calc(var(--u) * 0.6);
  font-weight: 700;
  font-size: var(--fs-value);
  letter-spacing: 0.06em;
  line-height: 1.3;
  color: var(--words);
  caret-color: rgb(var(--rgb));
  user-select: text;
}

.gl-row__words::placeholder {
  color: rgba(185, 178, 168, 0.4);
}

/* ---- a page's own tools (BLOB TRACK's SHUFFLE) ---- */
.gl-row--tools {
  justify-content: flex-end;
}

.gl-row--tools .gl-tool {
  height: calc(var(--u) * 1.9);
  padding: 0 calc(var(--u) * 0.9);
}

.gl-row--tools .gl-tool + .gl-tool {
  margin-left: calc(var(--u) * 0.5);
}

/* MORE / LESS: on the left, a page's own tools on the right */
.gl-row--tools .gl-tool--more {
  margin-right: auto;
}

/* engraved words on steel (RESET, SHUFFLE) */
.gl-tool__text {
  position: relative;
  z-index: 1;
  font-size: var(--fs-note);
  letter-spacing: 0.14em;
  margin-right: -0.14em;
  color: #b9b2a8;
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}

.gl-tool:hover .gl-tool__text {
  color: #e8e2d8;
}

.gl-tool:active .gl-tool__text {
  top: 1px;
}

.gl-tool:active::before {
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.85);
}

.gl-tool[disabled] {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

/* ---- the footer: RESET and APPLY, and the line under them ---- */
.gl-sheet__actions {
  display: flex;
  align-items: stretch;
}

.gl-sheet__resetbox {
  display: block;
  flex: none;
}

.gl-sheet__reset {
  display: block;
  width: 100%;
  height: 100%;
}

.gl-sheet__go {
  flex: none;
  display: block;
  height: 100%;
}

.gl-sheet__go::before {
  background: radial-gradient(120% 90% at 50% 0%, rgba(var(--rgb), 0.07), rgba(0, 0, 0, 0) 70%), linear-gradient(180deg, #0b0a09, #030303);
}

.gl-go__tube {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: block;
  pointer-events: none;
}

/* the words: neon in the button's colour */
.gl-sheet__gotext {
  position: relative;
  z-index: 3;
  display: block;
  text-align: center;
  white-space: nowrap;
  font-weight: 700;
  color: var(--go-core);
  text-shadow: 0 0 calc(var(--u) * 0.15) rgb(var(--rgb)), 0 0 calc(var(--u) * 0.5) rgb(var(--rgb)), 0 0 calc(var(--u) * 1.1) rgba(var(--glow-rgb), 0.55);
}

/* big enough to read as tube: outlined letters, like ACTIVATE */
.gl-sheet__go.is-tube-letters .gl-sheet__gotext {
  color: transparent;
  -webkit-text-stroke: 0.09em var(--go-core);
}

.gl-sheet__go:hover .gl-sheet__gotext {
  color: #fff8ee;
}

.gl-sheet__go.is-tube-letters:hover .gl-sheet__gotext {
  color: transparent;
  -webkit-text-stroke-color: #fff8ee;
}

.gl-sheet__go.is-dark .gl-sheet__gotext {
  opacity: 0.2;
}

.gl-sheet.is-busy .gl-sheet__go {
  cursor: progress;
}

.gl-sheet.is-busy .gl-sheet__gotext {
  opacity: 0.4;
}

/* what APPLY will do, what is happening, what went wrong: one line, the fullest wording that fits */
.gl-sheet__note {
  margin: 0;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  font-size: var(--fs-note);
  letter-spacing: 0.04em;
  color: #a39c92;
}

.gl-sheet__note[data-say] {
  font-size: 0;
}

.gl-sheet__note[data-say]::before {
  content: attr(data-say);
  font-size: var(--fs-note);
}

.gl-sheet__note.is-two {
  white-space: normal;
}

.gl-sheet__note.is-bad {
  color: #ff7a6e;
}

.gl-sheet__note.is-good {
  color: var(--good);
}

/* ---- narrow (a panel docked small): each label over its control ---- */
.gl-sheet.is-narrow .gl-row {
  flex-wrap: wrap;
  margin-bottom: calc(var(--u) * 0.35);
}

.gl-sheet.is-narrow .gl-row__label {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.gl-sheet.is-narrow .gl-row--range .gl-row__readout {
  order: 1;
  min-width: calc(var(--u) * 3);
  height: calc(var(--u) * 1.3);
  line-height: calc(var(--u) * 1.3 - 2px);
}

.gl-sheet.is-narrow .gl-row--range .gl-row__slide {
  order: 2;
  flex: none;
  width: 100%;
  margin-top: calc(var(--u) * 0.15);
}

.gl-sheet.is-narrow .gl-row--choice .gl-row__label,
.gl-sheet.is-narrow .gl-row--colours .gl-row__label {
  width: 100%;
  flex: none;
}

.gl-sheet.is-narrow .gl-row__choice,
.gl-sheet.is-narrow .gl-row__swatches {
  flex: none;
  width: 100%;
}

/* the lamp that is on throws a little of its light on the plate */
.gl-lamp {
  border-radius: 50%;
}

.gl-swatch.is-on .gl-lamp,
.gl-swatch-pick.is-on .gl-lamp {
  box-shadow: 0 0 calc(var(--u) * 0.55) calc(var(--u) * -0.05) var(--c);
}

/* ---- the box (src/box/box.js): one canvas draws the whole panel; the old cabinet's stage stays hidden ---------------- */
.gl-box #stage { display: none; }
#box { display: none; }
.gl-box #box {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
/* the licence key: the form's own field laid over the TV while locked; the TV draws the letters, so the field is clear */
.gl-box #licenseKey {
  position: fixed;
  box-sizing: border-box;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  text-shadow: none;
  letter-spacing: 0;
  font: 13px/1 Menlo, Consolas, monospace;
  cursor: text;
}
.gl-box #licenseKey::selection { background: transparent; color: transparent; }
.gl-box #licenseKey::placeholder { color: transparent; }
/* a setting's words: a field over its place on the display, which draws the letters */
#boxWords {
  position: fixed;
  display: none;
  z-index: 10;
  box-sizing: border-box;
  margin: 0;
  padding: 0 6px;
  border: 0;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font: 700 13px/1 Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}
#boxWords::selection { background: transparent; color: transparent; }
/* HAND FRAME: the pad its corners are dragged on, over its picture on the TV (it draws nothing itself) */
#boxPad {
  position: fixed;
  display: none;
  z-index: 9;
  opacity: 0;
  touch-action: none;
}
