/* DOM layout and accessible controls. src/native-ui.ts paints the game's own widgets and hinted glyphs. */
:root {
  --ink: #f1ede2;
  --ink-dim: #c9c3b2;
  --gold: #c4b454; /* the game's gold accent */
  --gold-light: #e7d98a;
  --text: 'Source Sans 3', 'Source Sans Pro', system-ui, sans-serif;
  --slab: 'Roboto Slab', Georgia, serif;
  --serif: 'Lora', Georgia, serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #0b0908;
  color: var(--ink);
  font-family: var(--text);
}
#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 0.4em;
  margin: 0 0.1em;
  border-radius: 5px;
  font: 700 0.8em var(--text);
  line-height: 1.5;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(196, 180, 84, 0.55);
  text-align: center;
}
button {
  cursor: pointer;
}

/* The fallback stays plain while the native pack loads. Never layer pre-rendered border images under the
   native canvas: their different slice geometry shows through as stray gold corners. */
.gpanel {
  border: 0;
  position: relative;
  padding: 16px;
  background: #171913;
}
.gpanel.window {
  padding: 26px;
}
.gbutton {
  position: relative;
  border: 0;
  min-height: 52px;
  background: #5e5842;
  color: #fff;
  font: 600 17px var(--text);
  padding: 0 20px;
  transition:
    transform 100ms,
    filter 100ms;
}
.gbutton:disabled {
  cursor: default;
  color: #888;
}
.gbutton:hover {
  filter: brightness(1.12);
}
.gbutton:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}
/* the info card's soft back */
.gcard {
  border: 0;
  padding: 14px 18px;
  background: #171913;
}

#fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 1;
  pointer-events: none;
  transition: opacity 600ms ease;
  z-index: 5;
}
/* (a soft darkening behind a chapter's card, so its title reads over a bright room) */
#card::before {
  content: '';
  position: absolute;
  inset: -60px -10vw;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}
#flash {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  mix-blend-mode: screen;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}
#ui > * {
  pointer-events: auto;
}

/* the goal and, under it, the chapter's crumbs and clock; both away while the story frames a shot */
#hud {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
  transition: opacity 500ms;
}
body.cinema #hud {
  opacity: 0 !important;
  pointer-events: none !important;
}
body.cutscene #hud {
  opacity: 0 !important;
  pointer-events: none !important;
}

#stats {
  font: 700 15px var(--text);
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 300ms;
  pointer-events: none;
}
#stats.on {
  opacity: 1;
}
#stats .sep {
  color: var(--gold);
}
#stats .time {
  font-variant-numeric: tabular-nums;
}

#corner {
  position: absolute;
  display: flex;
  gap: 6px;
}
#corner .gbutton {
  height: 44px;
  font-size: 14px;
  transition:
    opacity 500ms,
    transform 100ms,
    filter 100ms;
}
#menu {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
body.in-game #menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
} /* (in cutscenes and dialogue too: the sound stays to hand) */

/* the cinema bars: down while the story frames its shots */
#bars i {
  position: fixed;
  left: 0;
  right: 0;
  height: 11vh;
  background: #000;
  z-index: 6;
  pointer-events: none;
  transition: transform 700ms cubic-bezier(0.3, 0, 0.2, 1);
}
#bars i:first-child {
  top: 0;
  transform: translateY(-101%);
}
#bars i:last-child {
  bottom: 0;
  transform: translateY(101%);
}
/* (eyelids: coming round, the picture seen between two lids, their edges curved and soft, opening and shutting; the
   picture behind them blurred until the eyes focus) */
/* (the cartoon's ending: the picture shut in a closing circle) */
.iris {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}
#eyelids {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  display: none;
}
#eyelids.on {
  display: block;
}
#eyelids i {
  position: absolute;
  left: -10vw;
  right: -10vw;
  height: 62vh;
  background: #000;
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 9vh 7vh #000;
}
#eyelids i:first-child {
  top: -12vh;
  border-radius: 0 0 50% 50% / 0 0 34% 34%;
}
#eyelids i:last-child {
  bottom: -12vh;
  border-radius: 50% 50% 0 0 / 34% 34% 0 0;
}
#view.blurred {
  transition: filter 600ms ease;
  filter: blur(var(--wake-blur, 0px));
}
body.office #view.blurred {
  filter: blur(var(--wake-blur, 0px)) brightness(0.78) contrast(1.1) saturate(0.72);
}
body.cinema #bars i {
  transform: none;
}

#card {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translate(-50%, -50%) scale(0.96);
  text-align: center;
  opacity: 0;
  transition:
    opacity 700ms,
    transform 900ms;
  pointer-events: none;
  width: min(90vw, 760px);
  text-shadow:
    0 2px 16px rgba(0, 0, 0, 0.9),
    0 0 2px #000;
}
#card.on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
#card .kicker {
  font: 700 14px var(--text);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}
#card .title {
  font: 700 clamp(38px, 7vw, 68px) / 1.05 var(--slab);
  margin: 6px 0;
}
#card .sub {
  font: italic 500 clamp(15px, 2.2vw, 20px) var(--serif);
  color: var(--ink-dim);
}

#speech {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 16px);
  width: min(760px, calc(100vw - 28px));
  min-height: 120px;
  padding: 4px 10px 8px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 200ms,
    transform 200ms;
}
#speech.on {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
#speech .who {
  font: 700 15px var(--text);
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 4px;
}
#speech.rat .who {
  color: #9fe3ef;
}
#speech.narrator .who {
  color: #c7b8e6;
}
#speech.narrator .body {
  font: italic 500 18px/1.45 var(--serif);
}
#speech .body {
  font: 400 19px/1.45 var(--text);
  min-height: 2.9em;
}
#speech .more {
  position: absolute;
  right: 4px;
  bottom: -6px;
  color: var(--gold);
  opacity: 0;
  font-size: 18px;
}
#speech.done:not(.choosing) .more {
  opacity: 1;
  animation: bob 900ms ease-in-out infinite;
}
@keyframes bob {
  50% {
    transform: translateY(4px);
  }
}

/* (from the middle of the screen down; lifted only as far as a short screen needs to keep a long load's words, and an
   error's, on it) */
#loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, min(0px, calc(50dvh - 100% - max(12px, env(safe-area-inset-bottom)))));
  width: min(360px, 80vw);
  text-align: center;
  opacity: 0;
  transition: opacity 300ms;
  pointer-events: none;
  z-index: 8;
}
/* (up only after a moment, so a quick load never blinks it; away at once) */
#loading.on {
  opacity: 1;
  transition-delay: 180ms;
}
#loading .label {
  font: 600 15px var(--text);
  color: var(--ink-dim);
  margin-bottom: 10px;
}
#loading .err {
  font: 600 13px var(--text);
  color: #e8a28f;
  margin-top: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
/* the loader: a rat running in its wheel, and how far along. Each moving part is a picture of its own (index.html),
   laid over the others and turned or moved whole: the browser runs those animations on its compositor, so the wheel
   keeps turning while the page is busy loading a room (parts animated inside one picture waited on the page) */
#loading .runner {
  position: relative;
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 6px;
}
#loading .runner .part,
#loading .runner .rat {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: 120px;
  overflow: visible;
}
#loading .wheel .stand path {
  fill: none;
  stroke: #6d5a33;
  stroke-width: 4;
  stroke-linecap: round;
}
#loading .wheel .spin {
  transform-origin: 60px 60px;
  animation: wheel-spin 1.1s linear infinite;
}
#loading .wheel .rim {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3.2;
}
#loading .wheel .rim.inner {
  stroke: rgba(196, 180, 84, 0.45);
  stroke-width: 1.4;
}
#loading .wheel .spokes {
  stroke: rgba(196, 180, 84, 0.55);
  stroke-width: 1.6;
}
#loading .wheel .hub,
#loading .wheel .rungs circle {
  fill: var(--gold-light);
}
#loading .runner .rat {
  animation: rat-bob 0.275s ease-in-out infinite alternate;
}
#loading .runner .body,
#loading .runner .head {
  fill: #8a8090;
}
#loading .runner .ear {
  fill: #e8aaaa;
  stroke: #8a8090;
  stroke-width: 1.4;
}
#loading .runner .eye {
  fill: #111;
}
#loading .runner .nose {
  fill: #e9a4a4;
}
#loading .runner .tail path {
  fill: none;
  stroke: #d99a9a;
  stroke-width: 2.2;
  stroke-linecap: round;
}
#loading .runner .tail {
  animation: rat-tail 0.55s ease-in-out infinite alternate;
  transform-origin: 41px 88px;
}
#loading .runner .leg path {
  stroke: #d99a9a;
  stroke-width: 2.6;
  stroke-linecap: round;
}
/* (each leg swung about its hip, the top of its stroke) */
#loading .runner .leg {
  animation: rat-leg 0.275s ease-in-out infinite alternate;
}
#loading .runner .leg.a {
  transform-origin: 66px 93px;
}
#loading .runner .leg.b {
  transform-origin: 46px 93px;
  animation-direction: alternate-reverse;
}
#loading .runner .leg.c {
  transform-origin: 58px 94px;
  animation-direction: alternate-reverse;
}
#loading .runner .leg.d {
  transform-origin: 54.5px 94px;
}
/* (once unlocked: a barrel rolling along, end on, the rat running inside it, instead of the wheel) */
#loading .barrel-run {
  display: none;
}
.barrel-unlocked #loading .wheel {
  display: none;
}
.barrel-unlocked #loading .barrel-run {
  display: block;
}
#loading .barrel-run .roll {
  transform-origin: 60px 60px;
  animation: barrel-roll 2.4s linear infinite;
}
#loading .barrel-run .inside {
  fill: url(#barrel-in);
}
#loading .barrel-run .far {
  fill: #1a110a;
  stroke: rgba(0, 0, 0, 0.5);
  stroke-width: 1;
}
#loading .barrel-run .staves {
  stroke: rgba(10, 6, 3, 0.55);
  stroke-width: 1.2;
}
#loading .barrel-run .rim {
  fill: none;
  stroke: #9a6c3c;
  stroke-width: 5;
}
#loading .barrel-run .joints {
  stroke: #4a3018;
  stroke-width: 1.2;
}
#loading .barrel-run .hoop {
  fill: none;
  stroke: #3c3a3e;
  stroke-width: 2.2;
}
#loading .barrel-run .rivets circle {
  fill: var(--gold-light);
}
#loading .barrel-run .ground path {
  fill: none;
  stroke: #6d5a33;
  stroke-width: 2.4;
  stroke-linecap: round;
}
/* (the tufts going by under the barrel, within the ground's strip) */
#loading .barrel-run .tufts-clip {
  position: absolute;
  left: 2px;
  top: 100px;
  width: 116px;
  height: 20px;
  overflow: hidden;
}
#loading .barrel-run .tufts {
  left: -2px;
  top: -100px;
  animation: barrel-ground 0.24s linear infinite;
}
#loading .barrel-run .tufts path {
  fill: none;
  stroke: rgba(109, 90, 51, 0.6);
  stroke-width: 1.6;
  stroke-linecap: round;
}
@keyframes barrel-roll {
  to {
    transform: rotate(360deg);
  }
}
@keyframes barrel-ground {
  to {
    transform: translateX(-30px);
  }
}
@keyframes wheel-spin {
  to {
    transform: rotate(-360deg);
  }
}
@keyframes rat-bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-1.6px);
  }
}
@keyframes rat-leg {
  from {
    transform: rotate(-32deg);
  }
  to {
    transform: rotate(32deg);
  }
}
@keyframes rat-tail {
  from {
    transform: rotate(-6deg);
  }
  to {
    transform: rotate(8deg);
  }
}
#loading .pct {
  font: 700 30px/1 var(--slab);
  color: var(--gold-light);
  text-shadow: 0 2px 0 #000;
  margin-bottom: 6px;
}
/* (a load that runs long: a word under the number (loader.ts), the loader's own face; its dots count one, two, three,
   the second and third kept in their room while hidden, so the words never jiggle; still, with motion reduced) */
#loading .patience {
  font: 600 15px/1.35 var(--text);
  color: var(--ink-dim);
  text-shadow: 0 1px 0 #000;
  margin: 4px auto 0;
  text-wrap: balance;
}
#loading .patience .dots i {
  font-style: normal;
}
#loading .patience .dots i:nth-child(2) {
  animation: patience-two 1.5s step-end infinite;
}
#loading .patience .dots i:nth-child(3) {
  animation: patience-three 1.5s step-end infinite;
}
@keyframes patience-two {
  0% {
    visibility: hidden;
  }
  33.333%,
  100% {
    visibility: visible;
  }
}
@keyframes patience-three {
  0% {
    visibility: hidden;
  }
  66.667%,
  100% {
    visibility: visible;
  }
}
@media (prefers-reduced-motion: reduce) {
  #loading .patience .dots i:nth-child(n) {
    animation: none;
  }
}

/* ---- names and markers over heads (the game's nameplate face) ---- */
#labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}
#labels .label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
#labels .name {
  font: 700 15px var(--slab);
  color: #fff;
  opacity: 0;
  transition: opacity 200ms;
  text-shadow:
    1px 1px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    0 0 6px rgba(0, 0, 0, 0.7);
}
#labels .label.named .name {
  opacity: 1;
}
/* (a label speaking, its bubble pinned on the head: over the other labels, and the whole layer over the prompts while it
   does; its own name and marker away (game.ts)) */
#labels .label.speaking {
  z-index: 1;
}
#labels .label.speaking .name,
#labels .label.speaking .marker {
  visibility: hidden;
}
#labels:has(.label.speaking) {
  z-index: 8;
}
/* (a player's total level under the name, until the native plate draws it) */
#labels .name[data-level]:not(.native-nameplate)::after {
  content: attr(data-level);
  display: block;
  font-size: 11px;
  color: #c0c0c0;
  text-align: center;
}
#labels .marker {
  width: 50px;
  height: 50px;
  animation: markerbob 1s ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}
#labels .marker.off {
  display: none;
}
@keyframes markerbob {
  50% {
    transform: translateY(-7px);
  }
}
/* Ambient speech is drawn by the same native bubble widget as dialogue; this is its loading fallback. */
#labels .bark {
  position: relative;
  display: block;
  font: 400 16px var(--slab);
  max-width: 336px;
  white-space: normal;
  text-align: center;
}
#labels .bark:empty,
#labels .bark[data-empty='true'] {
  display: none;
}
#labels .bark.native-bark {
  isolation: isolate;
  padding: 0;
  background: none;
  color: transparent;
  text-shadow: none;
  max-width: none;
}

/* ---- results, title, ending ---- */
#results {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms;
  z-index: 9;
}
#results.on {
  opacity: 1;
  pointer-events: auto;
}
#results .window {
  min-width: min(380px, 90vw);
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  text-align: center;
  padding: 6px 14px;
}
/* (its rows scrolled, on a screen too short for all of it, under the client's scroll bar: native-ui.ts) */
#results .results-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#results .kicker {
  font: 700 12px var(--text);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}
#results .title {
  font: 700 28px var(--slab);
  margin: 4px 0 6px;
}
#results .stars {
  font-size: 44px;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.15);
}
#results.on .stars .on {
  color: var(--gold-light);
  text-shadow: 0 0 12px rgba(231, 217, 138, 0.8);
  display: inline-block;
  animation: starpop 0.5s ease both;
}
@keyframes starpop {
  0% {
    transform: scale(0.2);
    opacity: 0;
  }
  70% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
#results .rows {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  font: 600 16px var(--text);
}
#results .rows div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink-dim);
}
#results .rows div.ok b {
  color: var(--gold-light);
}
#results .best {
  margin-top: 8px;
  font: 600 13px var(--text);
  color: var(--ink-dim);
}
#results .best:empty {
  display: none;
}
#results .next {
  align-self: center;
  margin-top: 16px;
  min-width: 210px;
  font: 600 17px var(--text);
  color: var(--ink);
  opacity: 1;
}
#results.on .next {
  animation: nextin 400ms 1.2s ease both;
}
@keyframes nextin {
  to {
    opacity: 1;
  }
}

#title {
  position: fixed;
  inset: 0;
  z-index: 9;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  padding: 16px;
  transition:
    opacity 600ms,
    visibility 0s linear 600ms;
}
#title.ready {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 600ms,
    visibility 0s;
}
/* (it fades away before it is hidden: the menu never just vanishes, nor stays over the wheel) */
#title.gone {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 400ms,
    visibility 0s linear 400ms;
}
#title .window {
  text-align: center;
  max-width: 620px;
}
#title h1 {
  margin: 8px 0 28px;
  font: 700 clamp(44px, 8vw, 76px) / 0.95 var(--slab);
  color: #fff;
  text-shadow:
    0 3px 0 #000,
    0 8px 30px rgba(0, 0, 0, 0.8);
}
#title h1 .l3 {
  color: var(--gold-light);
}
#start {
  height: 64px;
  font-size: 22px;
  padding: 0 22px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 500ms,
    transform 100ms,
    filter 100ms;
}
#title.ready #start {
  opacity: 1;
  pointer-events: auto;
}

#pause {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
#pause.on {
  opacity: 1;
  pointer-events: auto;
}
#pause .window {
  text-align: center;
  max-width: 520px;
}
#pause h2 {
  font: 700 28px var(--slab);
  margin: 6px 0 12px;
  color: var(--gold-light);
}
#pause .buttons {
  justify-content: center;
  flex-wrap: wrap;
}
#pause .gbutton:disabled {
  filter: grayscale(1) brightness(0.7);
  cursor: default;
}

#victory,
#error {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms;
}
#victory.on,
#error.on {
  opacity: 1;
  pointer-events: auto;
}
#victory .window,
#error .window {
  text-align: center;
  padding: 8px 20px 14px;
  max-width: 520px;
}
#victory .marker {
  width: 72px;
  height: 72px;
  animation: markerbob 1.4s ease-in-out infinite;
}
#victory h2,
#error h2 {
  font: 700 28px var(--slab);
  margin: 8px 0;
  color: var(--gold-light);
}
#victory .chapters {
  display: grid;
  gap: 4px;
  margin: 12px auto 4px;
  max-width: 340px;
  font: 600 16px var(--text);
}
#victory .chapters div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink-dim);
}
#victory .chapters b {
  color: var(--gold-light);
  letter-spacing: 2px;
}
#victory .chapters i {
  font-style: normal;
  color: rgba(255, 255, 255, 0.15);
}
#victory .stats {
  font: 600 16px var(--text);
  color: var(--ink);
}
.credits {
  font: 500 12px/1.45 var(--text);
  color: var(--ink-dim);
  opacity: 0.75;
  margin: 14px auto 0;
  max-width: 460px;
}
#victory button {
  height: 58px;
  padding: 0 18px;
}
#error .tip {
  color: var(--ink-dim);
  font-size: 14px;
}
#error .error-body {
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Native widgets are painted by Brighter Atlas's client UI implementation (ui/). The DOM remains the
   source of layout, semantics and input. Each small canvas shares one WebGL backend in src/native-ui.ts. */
.native-widget {
  position: absolute;
  display: block;
  pointer-events: none;
  z-index: -1;
  max-width: none;
}
/* a scroll view with the client's own scroll bar (native-ui.ts scrollView): the browser's hidden, as everywhere; room
   kept at its right for the bar while it shows, the bar over that room, still while the words scroll */
.native-scroll.scrolls {
  padding-right: calc(var(--native-scroll-w, 12px) + 8px) !important;
} /* (over each view's own padding) */
.native-scrollbar {
  position: absolute;
  z-index: 2;
  touch-action: none;
  cursor: default;
}
.native-panel,
.native-button,
#room-plate {
  isolation: isolate;
}
.native-panel {
  border-image: none;
  background: none;
}
.native-frame::before {
  display: none;
}
.native-button {
  position: relative;
  isolation: isolate;
  border-image: none !important;
  color: transparent !important;
  text-shadow: none !important;
  background: none;
  filter: none;
}
.native-button > :not(canvas) {
  opacity: 0;
}
.native-button:hover,
.native-button:active {
  filter: none;
  transform: none;
}
.native-button:focus-visible {
  outline: none;
} /* the native hover frame also marks keyboard focus */
#room-plate {
  position: absolute;
  width: min(560px, 72vw);
  height: 58px;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity 350ms;
}
body.on-title #room-plate,
body:not(.playing):not(.cinema) #room-plate {
  opacity: 0;
}
/* (in a cinematic scene, the room's name in the letterbox's top bar, rather than over the picture) */
body.cinema #room-plate {
  top: max(4px, calc(5.5vh - 29px));
}
#speech.native-bubble {
  border: 0;
  padding: 0;
  background: none;
  isolation: isolate;
  bottom: max(26px, env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  transition:
    opacity 150ms,
    transform 180ms;
}
#speech.native-bubble.on {
  transform: translate(-50%, 0);
}
#speech.native-bubble::before {
  display: none;
}
#speech.native-bubble > .who,
#speech.native-bubble > .body,
#speech.native-bubble > .more {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  white-space: nowrap;
}
#speech.native-bubble:focus-visible {
  outline: none;
}
/* Compact native dock panels keep progress readable without covering the scene. */
#stats {
  font-weight: 400;
}
.native-hud {
  color: transparent !important;
  text-shadow: none !important;
}
.native-hud > :not(canvas) {
  visibility: hidden;
}
#stats.native-hud > :not(canvas) {
  visibility: visible;
  opacity: 0;
}
#corner .gbutton {
  min-height: 44px;
  min-width: 100px;
}
body:not(.in-game) #corner {
  display: none;
}
#corner {
  z-index: 60;
}
#speech {
  cursor: default;
}
#title .window {
  padding: 28px 36px;
  width: min(620px, calc(100vw - 40px));
}
/* The native frame extends outside its DOM box. Only inner content may scroll: clipping the window
   creates grey browser scrollbars across the game's right and bottom gold frame. */
#title .title-content {
  max-height: calc(100dvh - 116px);
  overflow-y: auto;
}
.title-buttons {
  display: grid;
  justify-items: center;
  gap: 9px;
}
#title .title-buttons .gbutton {
  width: min(280px, 100%);
}
#start {
  width: 280px;
  max-width: 100%;
}
#start.taupe {
  height: 52px;
  font-size: 17px;
}
/* (the saved game: Continue, where the run is, and New game's are-you-sure) */
#continue-run {
  width: 280px;
  max-width: 100%;
  height: 64px;
  font-size: 22px;
  padding: 0 22px;
}
#save-info {
  margin: -4px 0 4px;
  font: 600 16px var(--text);
  color: var(--ink-dim);
  text-shadow: 0 1px 2px #000;
}
#new-run {
  position: fixed;
  inset: 0;
  z-index: 31;
  display: grid;
  place-items: center;
  background: #000a;
  padding: 16px;
}
#new-run[hidden] {
  display: none;
}
#new-run .window {
  width: min(440px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 26px 20px;
  text-align: center;
}
#new-run h2 {
  margin: 0 0 10px;
  font: 700 24px var(--slab);
  color: var(--gold-light);
}
#new-run .new-run-text {
  margin: 0 auto 20px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  font: 500 16px/1.4 var(--text);
  color: var(--ink);
}
#new-run .new-run-text b {
  color: var(--gold-light);
  font-weight: 600;
}
#new-run .new-run-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#new-run .new-run-buttons .gbutton {
  min-width: 0;
  height: 48px;
  min-height: 48px;
  font-size: 16px;
  padding: 0 10px;
}
/* (iPhone Safari, in the browser: how to play it full screen) */
#install-hint {
  grid-column: 1 / -1;
  margin: 14px auto 0;
  max-width: 420px;
  font: 500 13px/1.35 var(--text);
  color: var(--ink-dim);
  text-shadow: 0 1px 2px #000;
}
#install-hint b {
  color: var(--gold-light);
  font-weight: 600;
}
/* (each step with its picture, drawn after Safari's: the menu's three lines, Share's box with its arrow, Add to Home
   Screen's plus in a box; kept whole, the arrows between them) */
#install-hint .ios-step {
  white-space: nowrap;
}
#install-hint .ios-step svg {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.25em;
  vertical-align: -0.17em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#install-hint .ios-step.bare svg {
  margin-right: 0;
}
#install-hint .ios-step .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#install-hint .ios-then {
  margin: 0 0.2em;
  color: var(--ink-dim);
}

#victory .window {
  padding: 22px 28px;
  max-width: 580px;
}
#victory .score-label {
  font-size: 13px;
}
#victory .stats {
  margin: 10px 0 4px;
}
#victory .unlock {
  margin: 18px 0 4px;
  font-weight: 600;
  color: var(--gold-light);
}
.victory-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
#victory button {
  min-width: 180px;
  font-size: 17px;
}
@media (max-height: 780px) {
  #title .window {
    max-width: 680px;
    padding: 14px 26px;
  }
  #title h1 {
    font-size: 58px;
  }
  #victory .window {
    padding: 14px 24px;
  }
  /* (and less round it, so a laptop's short screen has the whole card at rest, unscrolled) */
  #victory {
    padding: 8px 16px;
  }
}
@media (max-width: 640px) {
  #room-plate {
    top: 66px;
    width: 92vw;
  }
  #hud {
    top: 120px;
  }
  #corner .gbutton {
    min-height: 44px;
  }
  #title h1 {
    font-size: 48px;
  }
}
@media (max-height: 560px) and (min-width: 641px) {
  #speech.native-bubble {
    bottom: 12px;
  }
  #title .window {
    max-width: 760px;
    padding-top: 0;
  }
  #title h1 {
    font-size: 44px;
    margin: 0 0 8px;
  }
}

/* Test controls and touch input keep the same native widget painter as the rest of the game. */
[hidden] {
  display: none !important;
}
/* (a pinch anywhere zooms the camera, never the page: panels may still scroll, the page may not scale) */
html,
body {
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  touch-action: pan-x pan-y;
}
button,
#move-stick {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#interaction-cues {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}
#developer-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #0009;
  padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
#developer-panel .window {
  width: min(530px, 100%);
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px;
}
#developer-panel .dev-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#developer-panel h2 {
  margin: 0 0 6px;
  font: 600 24px var(--slab);
  color: var(--gold-light);
}
#developer-panel p {
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink-dim);
  margin: 4px 0 12px;
}
#developer-panel label {
  display: block;
  font-size: 16px;
  margin-top: 10px;
}
#developer-panel select {
  width: 100%;
  min-height: 44px;
  font: 16px var(--text);
  color: var(--ink);
  background: #282a24;
  border: 1px solid #8e8463;
  padding: 6px;
}
#developer-panel .dev-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
#developer-panel input {
  width: 22px;
  height: 22px;
  accent-color: #c4b454;
}
.dev-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.dev-row .dev-check {
  margin-top: 0;
}
/* (the developer's readout of the pointer's place and the camera: src/noclip.ts) */
#cursor-readout {
  position: fixed;
  left: max(8px, env(safe-area-inset-left));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100000;
  max-width: calc(100vw - 16px);
  padding: 6px 9px;
  background: #000b;
  color: #e8f4ea;
  font:
    12px/1.35 ui-monospace,
    Consolas,
    monospace;
  white-space: pre-wrap;
  pointer-events: none;
  border-radius: 4px;
}
#cursor-readout[hidden] {
  display: none;
}
.dev-row .gbutton {
  min-width: 0;
  font-size: 15px;
  padding: 0 10px;
}
#dev-readout {
  display: block;
  font: 13px/1.5 var(--text);
  margin: 12px 0;
  color: var(--ink-dim);
}
#dev-close {
  width: 100%;
}
#test-sections {
  width: 280px;
  max-width: 100%;
  font-size: 16px;
}
#touch-controls {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
body.touch-controls.playing #touch-controls {
  display: block;
}
#move-stick {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  width: 124px;
  height: 124px;
  padding: 0;
  pointer-events: auto;
  background: none;
}
#stick-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  min-height: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  padding: 0;
  pointer-events: none;
  transition: opacity 120ms;
}
#move-stick.engaged #stick-thumb {
  opacity: 0.9;
}
body.input-busy #touch-controls {
  visibility: hidden;
  pointer-events: none;
}
body.cinema #interaction-cues {
  display: none;
}
@media (max-width: 640px) {
  #room-plate {
    top: max(8px, calc(env(safe-area-inset-top) + 20px));
    width: calc(100vw - 28px);
    height: 44px;
  }
  #corner {
    top: max(56px, calc(env(safe-area-inset-top) + 68px));
    right: 12px;
    flex-direction: column;
  }
  #corner .gbutton {
    min-width: 80px;
    height: 44px;
    font-size: 12px;
    padding: 0 8px;
  }
  #hud {
    top: max(56px, calc(env(safe-area-inset-top) + 68px));
    left: 12px;
    width: min(274px, calc(100vw - 116px));
    gap: 2px;
  }
  #stats {
    height: 30px;
  }
  #title .window {
    padding: 14px 20px;
  }
  #title .title-content {
    max-height: calc(100dvh - 88px);
  }
  #title h1 {
    font-size: 42px;
  }
  #title .gbutton {
    min-height: 48px;
  }
  #speech.native-bubble {
    bottom: max(14px, env(safe-area-inset-bottom));
  }
}
@media (max-height: 560px) and (min-width: 641px) {
  #room-plate {
    top: max(4px, env(safe-area-inset-top));
    width: 44vw;
    height: 44px;
  }
  #hud {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
  }
  #hud {
    width: 235px;
  }
  #corner {
    top: max(8px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
  #corner .gbutton {
    min-width: 80px;
  }
  #move-stick {
    width: 104px;
    height: 104px;
  }
}
/* A phone on its side (under 440 px tall, from 520 px wide: the iPhone SE's too, whose buttons were cut off under
   PLAY when stacked): the name on the left and the menu beside it, the only screens too short to stack them. Its name
   is sized to its column (half the card: (card - padding - gap) / 2, "Adventure" about 5.6 of its em), not to the
   screen's width. Taller screens keep the menu under the name, as upright ones do (Joe, 2026-11-17: side by side on an
   iPad, 440 to 560 px tall in Safari, the name reached 88 px in a 330 px column, "Big Rat" / "s", "Advent" / "ure",
   and the menu scrolled). */
@media (max-height: 439px) and (min-width: 520px) {
  #title .window {
    width: min(680px, calc(100vw - 40px));
    padding: 10px 20px;
  }
  #title .title-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 22px;
    max-height: calc(100dvh - 68px);
  }
  #title h1 {
    grid-column: 1;
    align-self: center;
    margin: 0;
  }
  #title .title-buttons {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
}

/* One persistent menu and one contextual action slot leave the native scene in focus. */
#corner {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
#corner #menu {
  height: 44px;
  min-height: 44px;
  font-size: 14px;
}
#hud {
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  gap: 0;
}
#stats {
  width: 100%;
  height: 26px;
  padding: 3px 10px;
  gap: 6px;
  font-size: 13px;
  justify-content: flex-start;
}
#pause .window {
  width: min(480px, calc(100vw - 56px));
  padding: 16px 18px 28px;
} /* (more below: the frame is deeper at its foot) */
#pause .pause-content {
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
}
#pause .buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#pause .buttons .gbutton {
  position: relative;
  min-width: 0;
  min-height: 48px;
  height: 48px;
  font-size: 16px;
  padding: 0 10px;
}
/* (rows of two, every button the width of one: Resume and Restart chapter, View controls (where the level has a card)
   and Graphics, Show FPS and Sound, One-tap skip (once the adventure is finished) and Exit to menu; the developer's after
   them. A row short of a button is left short: none stretched to fill it) */
/* (Exit to menu's are-you-sure, in Pause's place) */
#pause.leaving .buttons {
  display: none;
}
#pause .leave-note {
  margin: 0 auto 20px;
  font: 500 15px/1.4 var(--text);
  color: var(--ink-dim);
  max-width: 420px;
}
#pause .leave-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
#pause .leave-buttons .gbutton {
  min-width: 0;
  height: 48px;
  min-height: 48px;
  font-size: 16px;
  padding: 0 10px;
}
@media (max-width: 900px) {
  #room-plate {
    display: none;
  }
}
@media (max-height: 560px) and (orientation: landscape) {
  #hud {
    width: min(270px, calc(100vw - 114px));
  }
  #move-stick {
    width: 104px;
    height: 104px;
  }
  #pause h2 {
    font-size: 24px;
    margin: 0 0 8px;
  }
  #pause .buttons .gbutton {
    min-height: 44px;
    height: 44px;
    font-size: 15px;
  }
  /* (a phone's short screen: room for the whole menu, not a scroll that cuts its heading) */
  #pause .pause-content {
    max-height: calc(100dvh - 72px);
  }
  /* (and the end's verdict, wider and tighter, so it fits whole: its long title on one line) */
  #victory .window {
    width: min(600px, 100%);
    max-width: none;
    padding: 10px 24px 12px;
  }
  #victory h2 {
    font-size: 24px;
    margin: 4px 0;
  }
  #victory .overall-score {
    font-size: 34px;
  }
  #victory .threshold {
    margin-top: 8px;
  }
  #victory .threshold-note {
    margin: 6px 0 12px;
  }
  #victory button {
    height: 48px;
    min-height: 48px;
  }
  #victory .credits {
    margin-top: 8px;
  }
}

/* Dialogue belongs to its visible speaker. Keep confirmation in a stable thumb/keyboard position. */
#speech.native-bubble.attached,
#speech.native-bubble.attached.on {
  position: fixed;
  transform: none;
  transition: opacity 150ms ease;
}
.interaction-cue {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.interaction-cue[hidden] {
  display: none;
}
.interaction-marker {
  width: 18px;
  height: auto;
  display: none;
}
/* (a keyboard's prompt: the E key and its verb, the native key cap and outlined slab face over this fallback) */
.interaction-prompt {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font: 700 15px var(--slab);
  color: #fff;
  text-shadow:
    1px 1px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000;
}
.interaction-prompt .native-widget {
  position: absolute;
  left: 0;
  top: 0;
}
.native-ui-ready .interaction-prompt.native-prompt {
  color: transparent;
  text-shadow: none;
}
.native-ui-ready .interaction-prompt.native-prompt kbd {
  visibility: hidden;
}
body.touch-controls .interaction-marker {
  display: block;
}
body.touch-controls .interaction-prompt {
  display: none;
}
/* (the Spark's prompt over its glowing target: shown on a touch screen too, its cap Tap; it is pressed to cast) */
.spark-cue:not([hidden]) {
  pointer-events: auto;
  cursor: pointer;
}
body.touch-controls .spark-cue .interaction-prompt {
  display: inline-flex;
}

/* A spoken line waits for a click (or tap, or Enter) anywhere: the whole view is its target, under the HUD's own
   controls; the client's hint sits low and centred, inside the lower cinema bar during a shot. */
#continue {
  position: fixed;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#continue[hidden] {
  display: none;
}
#continue:focus-visible {
  outline: none;
}
#continue .continue-hint {
  position: absolute;
  left: 50%;
  bottom: max(10px, calc(5.5vh - 22px), env(safe-area-inset-bottom));
  transform: translateX(-50%);
  isolation: isolate;
  display: grid;
  place-items: center;
  min-width: 200px;
  height: 44px;
  white-space: nowrap;
  font: 700 20px var(--text);
  color: #fff;
  text-shadow:
    1px 1px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000;
  animation: hintin 300ms 350ms ease both;
}
@keyframes hintin {
  from {
    opacity: 0;
  }
}
.native-ui-ready #continue .continue-hint.native-hint {
  color: transparent;
  text-shadow: none;
}
/* (a line docked at the bottom, with nobody to point at, sits above the hint) */
body.awaiting #speech.native-bubble:not(.attached) {
  bottom: calc(max(10px, calc(5.5vh - 22px)) + 52px);
}

/* The briefing: the archive's lamps down, the projector's screen the brightest thing in the room. */
body.briefing #view {
  filter: brightness(0.74) saturate(0.88);
}
body.briefing::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(
    ellipse 60% 55% at 50% 38%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.25) 55%,
    rgba(4, 6, 12, 0.62) 100%
  );
}

/* The HUD: the run's clock, cheese and deaths (clear of the Menu button in the other top corner: on a phone held
   upright there is no room for both at full width). */
#hud {
  width: min(380px, calc(100vw - 160px - env(safe-area-inset-left) - env(safe-area-inset-right)));
}
.native-ui-ready #stats {
  display: none;
}
/* The game's own widgets (panels, buttons, cards and the pictures drawn with them) out of sight until the native
   interface has drawn them (native-ui.ts adds native-drawn), from the first paint, never their plain look a moment first:
   their room kept. The interface is made by the page's early script (premenu.ts), beside the game's own. Shown plain at
   once where it cannot load (native-ui-failed), and regardless 3s after showing should one not be drawn (a very slow
   connection's first visit). Not in 2004scape's dress, whose pause menu is painted its own way. */
@keyframes native-reveal {
  to {
    visibility: visible;
  }
}
html:not(.native-ui-failed)
  body:not(.scape-mode)
  :is(.gpanel, .gbutton, .gcard, .level-art, .difficulty-cheese):not(.native-drawn) {
  visibility: hidden;
  animation: native-reveal 0s 3s forwards;
}
/* (touch: the marker over what is in reach is the button) */
body.touch-controls #interaction-cues .interaction-cue:not([hidden]) {
  pointer-events: auto;
}
body.touch-controls .interaction-marker {
  width: 30px;
  padding: 8px;
  box-sizing: content-box;
  cursor: pointer;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  animation: tapbob 1.1s ease-in-out infinite;
  transform-origin: 50% 100%;
}
/* (the hand taps: down, a squash, up) */
@keyframes tapbob {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(5px) scale(0.94, 0.9);
  }
  60% {
    transform: translateY(0);
  }
}

/* The game's CHOOSE OPTION window (native-ui.ts draws it; the rows are the browser's buttons laid over it). */
#options {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-bottom: 20vh;
  animation: optionsin 260ms ease-out both;
}
#options[hidden] {
  display: none;
}
@keyframes optionsin {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
#options .option-row {
  min-width: min(560px, 86vw);
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #ebebd4;
  color: #000;
  font: 600 17px var(--slab);
  cursor: pointer;
}
#options.native-options .option-row {
  position: absolute;
  min-width: 0;
  min-height: 0;
  background: none;
  color: transparent;
}
#options.native-options .option-row:focus-visible {
  outline: none;
}
#options .native-widget {
  left: 0;
  top: 0;
}

/* The office's lamps going down for the projector. */
#view {
  transition: filter 1.4s ease;
}
/* (the room dims; the lit slide is laid over it in perspective by briefing-screen.ts, so it keeps its brightness) */
body.lights-down #view {
  filter: brightness(0.42) saturate(0.85);
}

/* The dream: after the club, the dark swirls before the rat wakes. */
#dream {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s ease;
  overflow: hidden;
}
#dream.on {
  opacity: 1;
}
#dream {
  background: #000;
}

/* Captain Waltain's office after hours: cold, low, smoky; the desk lamp the warmest thing in it. */
body.office #view {
  filter: brightness(0.78) contrast(1.1) saturate(0.72);
}
/* (waking in it again: only its lamps, the dark closing in round the desk) */
body.office.office-dark::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(
    ellipse 62% 72% at 50% 56%,
    rgba(0, 0, 0, 0) 38%,
    rgba(0, 0, 0, 0.6) 70%,
    rgba(0, 0, 0, 0.95) 100%
  );
}
body.office.lights-down #view {
  filter: brightness(0.4) contrast(1.12) saturate(0.7);
}
body.office::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(
      ellipse 55% 60% at 45% 42%,
      rgba(30, 24, 14, 0) 0%,
      rgba(8, 10, 14, 0.35) 55%,
      rgba(2, 3, 6, 0.82) 100%
    ),
    linear-gradient(180deg, rgba(40, 46, 56, 0.18), rgba(10, 8, 4, 0.1));
}

/* One size for every in-play control: the Menu, Spark and touch action buttons share a height and a face (and the HUD's
   badges take it: native-ui.ts hudSize). On a computer's screen a size larger than a phone's. */
:root {
  --hud-button-h: 64px;
  --hud-button-font: 20px;
}
#corner #menu,
#corner .gbutton {
  height: var(--hud-button-h);
  min-height: var(--hud-button-h);
  font-size: var(--hud-button-font);
}
#corner #menu {
  width: auto;
  min-width: 152px;
  padding: 0 22px;
}
@media (max-width: 640px), (max-height: 520px) {
  :root {
    --hud-button-h: 48px;
    --hud-button-font: 15px;
  }
  #corner #menu {
    min-width: 104px;
  }
}

/* Names over heads are the game's nameplates (native-ui.ts); the browser's text stays for the fallback. */
#labels .name.native-nameplate {
  position: relative;
  display: block;
  color: transparent;
  text-shadow: none;
  isolation: isolate;
}
/* (scaled to the figure's distance by game.ts, about its foot: Brighter Fashion's sizing) */
#labels .name.native-nameplate {
  transform: scale(var(--plate, 1));
  transform-origin: 50% 100%;
}
/* (a narrator's box has no tail to fill the gap above the hint) */
body.awaiting #speech.native-bubble.narrator:not(.attached) {
  bottom: calc(max(10px, calc(5.5vh - 22px)) + 66px);
}
/* (narrower: small, at the top right corner, clear of the slide's headline and of the speech at the bottom) */

/* The game's item-picked-up card (native-ui.ts draws it): high in the middle, sliding in, held, then fading. */
#pickup {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translate(-50%, -14px);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  color: transparent;
  transition:
    opacity 220ms ease-out,
    transform 260ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
#pickup.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
#pickup {
  transform-origin: 50% 60%;
}
#pickup.on.fly {
  opacity: 0.35;
  transition:
    transform 560ms cubic-bezier(0.55, 0, 0.8, 0.2),
    opacity 560ms ease-in;
}
#cheese-count {
  transition: transform 180ms ease-out;
  transform-origin: 30% 30%;
}
#cheese-count.bump {
  transform: scale(1.2);
}
#pickup > :not(canvas) {
  position: absolute;
  opacity: 0;
}
body.cinema #pickup {
  opacity: 0;
}
/* The cheese found so far: a small native item card with its count, under the clock. */
#cheese-count {
  position: relative;
  display: none;
  color: transparent;
  margin-top: 4px;
}
#cheese-count.on {
  display: block;
}
#cheese-count > :not(canvas) {
  position: absolute;
  opacity: 0;
}

#notice {
  position: fixed;
  inset: 0;
  z-index: 40;
  color: transparent;
  cursor: pointer;
}
#notice[hidden] {
  display: none;
}
#notice > :not(canvas) {
  position: absolute;
  opacity: 0;
}

#counters {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
#deaths {
  position: relative;
  display: none;
  color: transparent;
  margin-top: 4px;
  transform-origin: 30% 30%;
}
#deaths.on {
  display: block;
}
#deaths.bump {
  animation: deaths-bump 420ms ease-out;
}
@keyframes deaths-bump {
  0% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
#deaths > :not(canvas) {
  position: absolute;
  opacity: 0;
}

/* the final score: which ending, the score against the good ending's mark, a new mode the first time */
#victory .threshold .bar {
  position: relative;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(196, 180, 84, 0.4);
}
#victory .threshold .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 99px;
  background: var(--gold);
  transition: width 1400ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
#victory.bad-ending .threshold .fill {
  background: #a8594a;
}
#victory .threshold .mark {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  margin-left: -1px;
  background: var(--gold-light);
}

/* holding Esc to skip a cutscene: the prompt (on a key press), its ring filling as Esc is held, the black while it runs */
#skip {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  top: calc(max(14px, calc(env(safe-area-inset-top, 0px) + 20px)) + var(--hud-button-h, 44px) + 12px);
  z-index: 61;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font: 700 16px var(--text);
  text-shadow:
    0 0 2px #000,
    0 1px 3px #000,
    0 0 6px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms;
  touch-action: none;
  user-select: none;
}
#skip.on {
  opacity: 1;
  pointer-events: auto;
}
#skip .cap {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 40px;
}
#skip svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
#skip .track {
  fill: rgba(20, 16, 10, 0.78);
  stroke: rgba(196, 180, 84, 0.45);
  stroke-width: 2;
}
/* (the progress runs round the key's edge, from the top middle) */
#skip .ring {
  fill: none;
  stroke: #f0c766;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100px;
  filter: drop-shadow(0 0 3px rgba(255, 210, 110, 0.8));
}
#skip .key {
  position: relative;
  font: 700 13px/1 var(--text);
  letter-spacing: 0.03em;
  text-align: center;
}
#skip .key[hidden] {
  display: none;
}
/* (on a touch screen the cap holds a pressing finger instead of Esc, and the whole pill is the hold target) */
#skip .finger {
  position: relative;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px #000);
}
#skip .finger .tap {
  stroke: #f0c766;
  opacity: 0.9;
}
#skip .finger[hidden] {
  display: none;
}
body.touch-controls #skip {
  padding: 6px 4px 6px 12px;
  margin: -6px -4px 0 0;
}
#skip-veil {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms;
  display: grid;
  place-items: center;
}
#skip-veil.on {
  opacity: 1;
  pointer-events: auto;
}
#skip-veil span {
  color: rgba(255, 255, 255, 0.75);
  font: 700 15px var(--text);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* (nothing of the game's HUD over the title screen: its own sound button only) */
body:not(.in-game) #menu {
  display: none !important;
}
body.on-title #corner {
  display: none !important;
}

/* no browser scroll bars anywhere: panels that can overflow still scroll (wheel, drag, keys), but never sideways */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
html,
body {
  overflow: hidden;
}
#developer-panel .dev-content,
#pause .pause-content,
#victory .victory-content,
#title .title-content {
  overflow-x: hidden;
}
/* (a painted window never scrolls itself: its frame is a canvas inside it, standing out past its edges (native-ui.ts),
   and a window that could scroll (by that overhang alone: a wheel over Pause) carried its frame off with its content,
   the frame's top cut and the title at the cut. Each is kept to the screen (max-height, min-height: 0 against its
   content's), a part inside it scrolling where that is short, the frame whole round it and its buttons in view) */
#pause .window,
#victory .window {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
}
#pause .pause-content,
#victory .victory-content {
  min-height: 0;
  overscroll-behavior: contain;
}
#victory .victory-content {
  overflow-y: auto;
}
/* (room inside the scrolling parts for a focused button's glow (.native-button.pad-focus), which they would otherwise
   cut off flat at their edges; given back outside, so nothing moves) */
#pause .pause-content,
#victory .victory-content,
#title .title-content {
  padding: 14px;
  margin: -14px;
}

/* a death's notice: the scene dims round it and the words fade up, rather than snapping on */
#notice.death {
  background: radial-gradient(ellipse at center 60%, rgba(0, 0, 0, 0.15) 25%, rgba(0, 0, 0, 0.7) 100%);
  animation: notice-in 700ms ease-out both;
}
#notice.death > canvas {
  animation: notice-in 900ms 150ms ease-out both;
}
@keyframes notice-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* (and its two buttons, Continue and View controls, the page's own painted as the game's: the painter sets them under
   its line (native-ui.ts notice); a click or tap anywhere else does nothing) */
#notice.dead {
  cursor: default;
}
/* (and while it or a controls card is up, no barks or names floating over it: ui.ts notice) */
body.notice-held #labels {
  visibility: hidden;
}
#notice > .notice-buttons {
  left: 0;
  right: 0;
  top: 62%;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  opacity: 1;
}
#notice > .notice-buttons[hidden] {
  display: none;
}
#notice.death > .notice-buttons {
  animation: notice-in 900ms 150ms ease-out both;
}
#notice .notice-buttons .gbutton {
  flex: 0 1 220px;
  min-width: 0;
  height: 54px;
  min-height: 54px;
  font-size: 18px;
  padding: 0 16px;
}
@media (max-width: 640px) {
  #notice .notice-buttons .gbutton {
    height: 48px;
    min-height: 48px;
    font-size: 16px;
    padding: 0 10px;
  }
}

/* the title's PLAY: big, as the game's own */
#title #start.play {
  width: min(300px, 100%);
  height: 72px;
  min-height: 72px;
  font-size: 30px;
  margin-bottom: 4px;
}

/* the title as the game's own menu: no frame, a small kicker, the name in wide white capitals, the gold PLAY, and the
   other choices as dark buttons in a row beneath it */
#title .title-card {
  text-align: center;
  padding: 10px 16px;
  width: min(720px, calc(100vw - 32px));
}
/* (the name in its own slab face, white over gold, as it was) */
#title .title-card h1 {
  margin: 0 0 clamp(44px, 8vh, 72px);
  font: 700 clamp(44px, 8vw, 76px) / 0.95 var(--slab);
  color: #fff;
  text-shadow:
    0 3px 0 #000,
    0 8px 30px rgba(0, 0, 0, 0.8);
}
#title .title-card h1 .l3 {
  color: var(--gold-light);
}
/* (a phone on its side: the name has half the card, beside the menu, sized to that column and the height, as above
   at "A phone on its side") */
@media (max-height: 439px) and (min-width: 520px) {
  #title .title-card h1 {
    font-size: min(56px, calc((min(720px, 100vw - 32px) - 54px) / 2 / 5.9), 12vh);
  }
  /* (the menu given the height but a margin: the iPhone SE's narrow column stacks PLAY and four buttons) */
  #title .title-content {
    max-height: calc(100dvh - 20px);
  }
}
#title .title-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
#title .title-buttons #start.play {
  order: 0;
  margin: 0 auto 4px;
}
#title .title-buttons::before {
  content: '';
  flex-basis: 100%;
  order: 1;
}
/* (a saved game: Continue, and under it on a line of its own where the run is) */
#title .title-buttons #save-info {
  order: 0;
  flex-basis: 100%;
  margin: -6px 0 2px;
  text-align: center;
}
#title .title-buttons .gbutton:not(.play) {
  order: 2;
}
#title .title-buttons .gbutton:not(.play) {
  width: auto;
  min-width: 190px;
  height: 52px;
  min-height: 52px;
  font-size: 17px;
}
/* (a short screen, its menu under the name, as upright screens have it: the menu given the height but a margin, its
   buttons a little lower, the name 0.7 of its size clear of them (Joe, 2026-11-18: more room between the two, the name
   a little smaller), and the name sized to what is left once PLAY and two rows of buttons (Level Select among them)
   are in: the name and its gap about 3.67 of its em tall, the content's padding 28 px, the buttons' block 194 px, and some to spare (Joe,
   2026-11-17). That is a first guess: src/title-fit.ts measures the title and makes the name, its gap and the buttons
   (--menu-fit, down to 0.8 of these) smaller together until nothing scrolls) */
@media (max-height: 780px) and (min-height: 440px) {
  #title .title-content {
    max-height: calc(100dvh - 48px);
  }
  #title .title-card h1 {
    font-size: min(clamp(44px, 8vw, 76px), calc((96dvh - 270px) / 3.67));
    margin-bottom: 0.7em;
  }
  #title .title-buttons {
    gap: calc(10px * var(--menu-fit, 1));
  }
  #title .title-buttons #start.play {
    height: calc(56px * var(--menu-fit, 1));
    min-height: 0;
    font-size: calc(30px * var(--menu-fit, 1));
  }
  #title .title-buttons .gbutton:not(.play) {
    height: calc(44px * var(--menu-fit, 1));
    min-height: 0;
    min-width: calc(190px * var(--menu-fit, 1));
    font-size: calc(17px * var(--menu-fit, 1));
  }
}

#title .title-card {
  position: relative;
  z-index: 1;
}
/* "Click to start" before the first press (boot/head.js): the menu's buttons held back (their room kept), the whole
   screen the button, and its words in the middle of where the buttons will be, breathing */
#press-start {
  display: none;
}
.press-start #press-start {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 3;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.press-start #title .title-buttons,
.press-start #title #install-hint {
  visibility: hidden;
}
#title .title-buttons {
  position: relative;
}
#title .press-start-hint {
  display: none;
}
.press-start #title .press-start-hint {
  display: block;
  visibility: visible;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  white-space: nowrap;
  font: 700 clamp(30px, 5vw, 40px) var(--text);
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow:
    2px 2px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    0 3px 0 #000,
    0 4px 22px rgba(0, 0, 0, 0.9);
  animation: press-breathe 2.2s ease-in-out infinite;
}
#title .press-start-hint .touch {
  display: none;
}
.press-tap #title .press-start-hint .mouse {
  display: none;
}
.press-tap #title .press-start-hint .touch {
  display: inline;
}
@keyframes press-breathe {
  50% {
    opacity: 0.72;
    scale: 0.97;
  }
}
@media (prefers-reduced-motion: reduce) {
  #title .press-start-hint {
    animation: none;
  }
}
/* (the title, and the rest of the menu, only after the press, all at once (their room kept, so nothing moves): the
   screen the words alone until then) */
.press-start #title .title-card h1,
.press-start #title #build-info {
  visibility: hidden;
}

/* the menu from the page's first paint (index.html marks it `menu`; a link straight in has the wheel instead): its
   title and buttons over the dark, no 3D behind it, faint rays turning slowly behind them: their own layer, turned by
   the compositor, nothing redrawn as they go */
html.menu #title:not(.gone) {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: none;
}
html.menu #start {
  opacity: 1;
  pointer-events: auto;
}
/* (its words once their faces are in (index.html: no flash of another face), up in a moment) */
html.menu:not(.faces) #title .title-card {
  opacity: 0;
}
html.menu #title .title-card {
  transition: opacity 220ms ease-out;
}
#title {
  background: radial-gradient(ellipse at 50% 46%, #1a1611 0%, #0d0b09 58%, #050404 100%);
}
/* (behind the title, as Brighter Shores' own menu has round its sun: rays, warm brown and a greyer brown in turn,
   strongest at the middle and fading out long before the edges, turning slowly) */
#title .title-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(150vmax, 1400px);
  aspect-ratio: 1;
  translate: -50% -50%;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  animation: title-rays 140s linear infinite;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(201, 158, 98, 0.085) 0deg 7.5deg,
    rgba(150, 138, 118, 0.035) 7.5deg 15deg
  );
  -webkit-mask-image: radial-gradient(
    circle,
    #000 0,
    rgba(0, 0, 0, 0.75) 14%,
    rgba(0, 0, 0, 0.25) 30%,
    transparent 46%
  );
  mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.75) 14%, rgba(0, 0, 0, 0.25) 30%, transparent 46%);
}
@keyframes title-rays {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  #title .title-rays {
    animation: none;
  }
}
/* (the menu's buttons until the game's own pictures of them are in (a slow connection's first seconds): drawn here as
   near to those as CSS goes (the gold rim, the face, Play's wide capitals), so they take their place without a jump;
   a phone's first cards' too, the game's dark gold, there from the page's first paint) */
#title .gbutton:not(.native-button) {
  border-radius: 11px;
  background: linear-gradient(#45402f, #3b372b 30%, #34302a);
  box-shadow:
    inset 0 0 0 2px #d6bd5c,
    inset 0 0 0 3.5px rgba(0, 0, 0, 0.55),
    0 2px 4px rgba(0, 0, 0, 0.55);
  color: #ece6d6;
  font-weight: 500;
}
#title .gbutton.gold:not(.native-button) {
  border-radius: 10px;
  background: linear-gradient(#c09246 0, #a57a33 9%, #8d682b 22%, #8d682b 78%, #6e501d 92%, #5e4416 100%);
  box-shadow:
    inset 0 0 0 1px #6b5220,
    inset 0 0 0 3px #e9cb6a,
    inset 0 0 0 4.5px rgba(60, 40, 10, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.55);
  color: #fff;
}
#title #start.play:not(.native-button) {
  text-transform: uppercase;
  font-size: 29px;
  letter-spacing: 0.13em;
  text-indent: 0.13em;
  font-weight: 800;
  text-shadow:
    0 0 2px #000,
    0 1px 1px #000;
}

/* the touch stick, readable: a ring to put the thumb in, and the thumb itself plainly there */
#move-stick::before {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 2px solid rgba(240, 220, 150, 0.45);
  background: radial-gradient(circle, rgba(0, 0, 0, 0.18) 30%, rgba(0, 0, 0, 0.38) 100%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
#stick-thumb {
  opacity: 0.6;
}
#move-stick.engaged::before {
  border-color: rgba(255, 230, 160, 0.8);
}

/* (a ride steered by swipes: no stick in the way of the thumbs) */
body.swipe-ride #move-stick {
  display: none !important;
}
/* (a side-on run: the stick runs and climbs, and a Jump button under the right thumb) */
#jump-button {
  display: none;
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  width: 104px;
  height: 76px;
  min-height: 76px;
  padding: 0;
  font-size: 18px;
  pointer-events: auto;
}
body.jump-ride #jump-button {
  display: block;
}

/* (on a touch screen: no text selection, no long-press callout or menu, no double-tap zoom, anywhere in the game) */
body.touch-controls,
body.touch-controls * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
body.touch-controls {
  touch-action: none;
}
#continue,
#notice,
#skip,
#speech,
#pause button,
#victory button {
  touch-action: manipulation;
}

/* (a phone held upright: a suggestion to turn it, dismissable; gone when it is turned) */

/* 2004scape: while its stretch is up (scape-ui.ts), Brighter Shores' HUD is put away and the page's own controls wear
   the 2004 client's login-screen stone and its bitmap fonts (painted as images: --rs-face, at --rs-w by --rs-h) */
#scape-sound {
  display: none;
}
body.scape-mode #stats,
body.scape-mode #counters,
body.scape-mode #pickup,
body.scape-mode #card,
body.scape-mode #room-plate,
body.scape-mode #bars {
  display: none !important;
}
body.scape-mode #scape-sound {
  display: block;
  width: var(--hud-button-h, 44px);
  height: var(--hud-button-h, 44px);
  padding: 0;
  border: 0;
  cursor: pointer;
}
body.scape-mode .rs-button,
body.scape-mode #scape-sound {
  position: relative;
  border: 0 !important;
  color: transparent !important;
  text-shadow: none !important;
  filter: none;
  background:
    var(--rs-face) center / var(--rs-w) var(--rs-h) no-repeat,
    var(--rs-button) center / 100% 100% no-repeat !important;
  image-rendering: pixelated;
}
body.scape-mode .rs-button > * {
  visibility: hidden !important;
}
body.scape-mode .rs-button:hover,
body.scape-mode #scape-sound:hover {
  filter: brightness(1.18) !important;
}
body.scape-mode .rs-button:active,
body.scape-mode #scape-sound:active {
  transform: translateY(1px);
}
/* (the one in focus: lit as under the mouse, and a yellow line just inside its stone frame, never over its neighbours) */
body.scape-mode .rs-button:focus-visible,
body.scape-mode #scape-sound:focus-visible,
body.scape-mode .rs-button.pad-focus {
  filter: brightness(1.18) !important;
  outline: 2px solid #ffff00;
  outline-offset: -5px;
}
body.scape-mode .rs-text {
  display: inline-block;
  width: var(--rs-w);
  height: var(--rs-h);
  color: transparent !important;
  text-shadow: none !important;
  font-size: 0 !important;
  background: var(--rs-face) center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
body.scape-mode .rs-text:empty {
  display: none;
}
/* (the box, its buttons and the room between them grown with the client's pixels (--rs-k, scape-ui.ts): a label never
   more than two thirds of its button, nor anything up against the box's stone, at any size; under the last row as much
   stone as beside the buttons, the box's rim being deeper at its foot (nothing listed under them any more)) */
body.scape-mode #pause .window {
  background: var(--rs-box) center / 100% 100% no-repeat !important;
  image-rendering: pixelated;
  padding: calc(var(--rs-k, 2) * 12px) calc(var(--rs-k, 2) * 17px) calc(var(--rs-k, 2) * 18px);
  width: min(calc(var(--rs-k, 2) * 364px), calc(100vw - 24px));
  max-width: none;
}
body.scape-mode #pause .buttons .gbutton,
body.scape-mode #pause .leave-buttons .gbutton {
  min-width: 0;
  min-height: 0;
  height: max(44px, calc(var(--rs-k, 2) * 24px));
}
body.scape-mode #pause .window > canvas.native-widget {
  display: none !important;
}
body.scape-mode #pause h2 {
  margin: calc(var(--rs-k, 2) * 2px) auto calc(var(--rs-k, 2) * 7px);
}
body.scape-mode #pause .pause-difficulty {
  display: block;
  margin: calc(var(--rs-k, 2) * -3px) auto calc(var(--rs-k, 2) * 7px);
  letter-spacing: 0;
}
body.scape-mode #pause .pause-difficulty:empty,
body.scape-mode #pause.leaving .pause-difficulty {
  display: none;
}
body.scape-mode #pause .leave-note {
  max-width: none;
  margin: calc(var(--rs-k, 2) * 1px) auto calc(var(--rs-k, 2) * 10px);
}
body.scape-mode #skip {
  text-shadow: none;
}
body.scape-mode #skip .key {
  display: none;
}
body.scape-mode #skip .track {
  fill: rgba(0, 0, 0, 0.6);
  stroke: #3e3529;
}
body.scape-mode #skip .ring {
  stroke: #ffff00;
  filter: none;
}

/* the title's credits: a film's end roll in the game's window (src/credits.ts): the mod's makers, then Brighter Shores'
   (roles in gold capitals over their names, all on the one centre line), then the licences; ending on Steam */
#credits {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #0009;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#credits[hidden] {
  display: none;
}
#credits .window {
  width: min(720px, 100%);
  height: min(860px, 100%);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 26px 18px;
  text-align: center;
}
#credits h2 {
  flex: none;
  margin: 0 0 4px;
  font: 700 26px var(--slab);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}
/* (the roll: the words come up from under the frame's lower edge and fade out under its top; the client's scroll bar
   beside it where it is scrolled by hand (native-ui.ts)) */
#credits .credits-content {
  flex: 1;
  min-height: 0;
  container-type: size;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 86%, transparent 100%);
}
#credits .credits-content:focus {
  outline: none;
}
#credits .credits-content:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: -2px;
}
/* (the first heading starts low in the window, the last line ends high: the roll comes in and goes out) */
#credits .credits-roll {
  padding: 40cqh 10px 26cqh;
} /* (its first words coming up from low in the frame) */
#credits .credits-section + .credits-section {
  margin-top: 64px;
}
#credits h3 {
  margin: 0;
  font: 700 26px/1.2 var(--slab);
  color: var(--gold-light);
  text-wrap: balance;
}
#credits .credits-by {
  margin: 4px 0 4px;
  font: 700 12px var(--text);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
#credits .credits-list {
  margin: 0;
}
#credits dt {
  margin: 22px 0 4px;
  font: 700 13px var(--text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c8b46c;
}
#credits dd {
  margin: 0;
  font: 400 19px/1.45 var(--text);
  color: #e6e3da;
}
#credits dd span {
  display: block;
}
#credits dd small {
  display: block;
  margin-top: 2px;
  font: 400 15px/1.4 var(--text);
  color: #a8a59a;
}
#credits dd .credits-others {
  color: #a8a59a;
  font-style: italic;
}
#credits .credits-disclaimer {
  max-width: 30em;
  margin: 26px auto 0;
  font: 500 16px/1.5 var(--text);
  color: #d8d3c4;
  text-wrap: pretty;
}
#credits .credits-licences {
  list-style: none;
  margin: 22px auto 0;
  padding: 0;
  max-width: 30em;
  display: grid;
  gap: 12px;
  font: 400 16px/1.4 var(--text);
  color: #d8d3c4;
}
#credits .credits-licences b {
  display: block;
  font-weight: 600;
  color: #e6e3da;
}
#credits .credits-licence-link {
  margin: 16px 0 0;
  font: 600 16px var(--text);
}
#credits .credits-roll a:not(.gbutton) {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
#credits .credits-copyright {
  max-width: 30em;
  margin: 16px auto 0;
  font: 400 15px/1.5 var(--text);
  color: #a8a59a;
  text-wrap: pretty;
}
#credits .credits-spoiler {
  max-width: 30em;
  margin: 16px auto 0;
  font: 400 15px/1.5 var(--text);
  color: #a8a59a;
}
#credits .credits-spoiler summary {
  cursor: pointer;
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid rgba(196, 180, 84, 0.45);
  border-radius: 4px;
  color: var(--gold-light);
  font: 600 15px var(--text);
  list-style: none;
}
#credits .credits-spoiler summary::-webkit-details-marker {
  display: none;
}
#credits .credits-spoiler summary::before {
  content: '\25B8  ';
}
#credits .credits-spoiler[open] summary::before {
  content: '\25BE  ';
}
#credits .credits-spoiler summary:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}
#credits .credits-spoiler p {
  margin: 10px 0 0;
}
/* (the end: thanks, and the real game's own Steam page, a link drawn as the game's bright gold button, Steam's mark at
   its left as on the briefing's slide) */
#credits .credits-end {
  margin-top: 72px;
  display: grid;
  justify-items: center;
  gap: 16px;
}
#credits .credits-end p {
  margin: 0;
  font: 500 18px/1.4 var(--text);
  color: #d8d3c4;
}
#credits #credits-steam {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  min-height: 52px;
  max-width: 100%;
  padding: 0 22px 0 52px;
  font-size: 17px;
  text-decoration: none;
}
#credits #credits-steam > .steam-mark {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  opacity: 1 !important;
  fill: #fff;
  filter: drop-shadow(0 1px 1px rgba(60, 35, 5, 0.9));
  pointer-events: none;
  z-index: 1;
}
#credits #credits-steam:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}
/* (Pause, Faster and Close, under the roll) */
#credits .credits-buttons {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 12px;
}
#credits .credits-buttons .gbutton {
  flex: 0 1 170px;
  min-width: 0;
  height: 50px;
  min-height: 50px;
  font-size: 17px;
  padding: 0 10px;
}
@media (max-width: 420px) {
  #credits .window {
    padding: 18px 14px 14px;
  }
  #credits dd {
    font-size: 18px;
  }
  #credits .credits-buttons {
    gap: 8px;
  }
  #credits .credits-buttons .gbutton {
    height: 46px;
    min-height: 46px;
    font-size: 15px;
  }
  #credits #credits-steam {
    font-size: 15px;
    padding: 0 14px 0 46px;
  }
}
@media (max-height: 560px) and (orientation: landscape) {
  #credits .window {
    padding: 12px 20px 12px;
  }
  #credits h2 {
    font-size: 20px;
    margin-bottom: 0;
  }
  #credits .credits-roll {
    padding-top: 30cqh;
  }
  #credits .credits-buttons {
    padding-top: 8px;
  }
  #credits .credits-buttons .gbutton {
    height: 42px;
    min-height: 42px;
    font-size: 15px;
  }
}

/* a projected slide's button, the Steam one or the sound one (briefing-screen.ts): laid over the button as it is projected on the screen, as if
   pressed on the slide itself; it shows only when hovered or focused */
.slide-link {
  position: fixed;
  z-index: 8;
  margin: 0;
  padding: 0;
  min-height: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.slide-link:hover {
  filter: drop-shadow(0 0 10px rgba(255, 214, 120, 0.55)) !important;
}
.slide-link:focus-visible {
  outline: 3px solid var(--gold-light, #f0d98a);
  outline-offset: 3px;
}
/* (its mark (Steam's, a speaker), in the room the native button leaves at its left) */
.slide-link > .slide-link-mark,
.slide-link.native-button > .slide-link-mark {
  position: absolute;
  left: calc(var(--mark, 26px) * 0.45);
  top: 50%;
  width: var(--mark, 26px);
  height: var(--mark, 26px);
  transform: translateY(-50%);
  opacity: 1 !important;
  fill: #fff;
  filter: drop-shadow(0 1px 1px rgba(60, 35, 5, 0.9));
  pointer-events: none;
  z-index: 1;
}

/* the projector's lit slide, over the darkened view, placed on the cloth by a perspective transform; under the HUD */
.projected-slide {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3;
  transform-origin: 0 0;
  pointer-events: none;
  display: none;
}

/* the title's level select (src/level-select.ts): the levels reached in story order, five to a row; each the game's item
   card (native-ui.ts draws it, in gold when chosen, lit under the pointer) with where it is and its name in the band
   over its picture and its best (time, cheese) in the band under; the next ahead dimmed and locked. Under them the
   chosen one, the difficulty a cheese each, Close and Play. On a phone, a row each (its card the picture's alone) */
#levels {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #000a;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#levels .window {
  width: min(990px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 26px 18px;
  text-align: center;
}
#levels h2 {
  margin: 0 0 12px;
  font: 700 26px var(--slab);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}
#levels .levels-grid {
  --card: 170px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: start;
  gap: 12px;
  padding: 4px 6px 6px 4px;
  overscroll-behavior: contain;
}
/* (a finger on a level drags the list up and down: the buttons' own touch-action, none, would hold the scroll) */
#levels .levels-grid,
#levels .levels-grid * {
  touch-action: pan-y;
}
/* (the card: the item card's shape, 1.5 as tall as wide (native-ui.ts levelArt reads it off the box); where it is and
   its name in the band over the art, its best in the band under it, where the card puts them (its units: 6.34 in, 32 a
   band, 115.33 the art, of 128 × 192)) */
.level-card {
  position: relative;
  flex: none;
  display: block;
  width: var(--card, 170px);
  aspect-ratio: 2 / 3;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  background: none;
}
.level-card .level-art {
  position: absolute;
  inset: 0;
  isolation: isolate;
  display: block;
  border-radius: 8px;
  background: #1d211a;
  box-shadow:
    inset 0 0 0 2px #4d5a45,
    inset 0 0 0 4px #0f110e;
}
.level-card .level-art.native-card {
  background: none;
  box-shadow: none;
}
.level-card .level-art img {
  position: absolute;
  left: 4.95%;
  top: 19.97%;
  width: 90.1%;
  height: 60.07%;
  object-fit: cover;
  border-radius: 2px;
  filter: saturate(0.92) brightness(0.95);
  transition: filter 200ms;
}
.level-card .level-num {
  position: absolute;
  left: 4.95%;
  top: 19.97%;
  width: 90.1%;
  height: 60.07%;
}
/* (its number in the middle of its picture: native-ui.ts draws it as the cards' corner counts are, white and outlined;
   until then the page's, as like it as it can be) */
.level-card .level-num {
  isolation: isolate;
  display: grid;
  place-items: center;
  pointer-events: none;
  font: 800 34px/1 var(--text);
  color: #fff;
  text-shadow:
    0 0 2px #000,
    0 0 2px #000,
    0 1px 1px #000;
}
.level-card .level-num.native-text {
  color: transparent;
  text-shadow: none;
}
/* (on a translucent black strip across the picture's whole width, the picture dimmed under it: the number clear on any
   picture; its height with the card's) */
.level-card .level-num::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  z-index: -1;
  height: 38%;
  transform: translateY(-50%);
  background: rgb(0 0 0 / 0.5);
  box-shadow:
    0 1px 0 rgb(0 0 0 / 0.25),
    0 -1px 0 rgb(0 0 0 / 0.25);
}
.level-card .level-title {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 3.3%;
  height: 16.67%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-shadow: 0 1px 2px #000;
}
.level-card .level-where {
  font: 800 9.5px/1.1 var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.level-card .level-where:empty {
  display: none;
}
.level-card .level-name {
  font: 700 14.5px/1.08 var(--slab);
  color: #fff;
  text-wrap: balance;
}
.level-card .level-best {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 80.04%;
  height: 16.67%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font: 700 14px var(--text);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px #000;
}
/* (the cheese found in the best, by the HUD's own cheese, of the level's) */
.level-cheese {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.level-cheese img {
  width: 18px;
  height: auto;
  filter: drop-shadow(0 1px 1px #000);
}
/* (in the shade of the difficulty the best was on, as "Pick your cheese" has them: index.html's filters) */
.level-cheese[data-shade='easy'] img {
  filter: url(#cheese-easy) drop-shadow(0 1px 1px #000);
}
.level-cheese[data-shade='normal'] img {
  filter: url(#cheese-normal) drop-shadow(0 1px 1px #000);
}
#levels .levels-shades {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.level-card .level-none {
  font: 600 12.5px var(--text);
  color: #9a9484;
}
/* (the level's picture brightened under the pointer: its own, not the best's cheese, whose shade is its difficulty's) */
.level-card:not(.locked):hover .level-art img,
.level-card:not(.locked):focus-visible .level-art img,
.level-card.pad-focus .level-art img {
  filter: none;
}
/* (the card in focus, the pad's or the keyboard's: a gold ring and glow round it, plain to see across the room; the
   chosen one is gold besides, the ring only says where the focus is) */
.level-card:focus-visible {
  outline: none;
}
.level-card:not(.locked):focus-visible,
.level-card.pad-focus {
  outline: 3px solid var(--gold-light);
  outline-offset: 4px;
  box-shadow: 0 0 18px 4px rgba(255, 196, 80, 0.55);
}
.level-card.locked:focus-visible,
.level-card.locked.pad-focus {
  outline: 3px solid #8a8576;
  outline-offset: 4px;
}
#levels .levels-cheese:focus-visible,
#levels .levels-cheese.pad-focus,
#difficulty .difficulty-option.pad-focus {
  outline: 3px solid var(--gold-light);
  outline-offset: 2px;
  border-radius: 8px;
}
/* (the chosen one: its card in gold (native-ui.ts), its name in gold) */
.level-card.chosen .level-name {
  color: var(--gold-light);
}
/* (the one ahead: dimmed, a lock where its picture would be, its number and nothing else) */
.level-card.locked {
  cursor: default;
}
.level-card .level-lock {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  transform: translate(-50%, -50%);
  fill: none;
  stroke: #8a8576;
  stroke-width: 2;
  stroke-linecap: round;
}
.level-card.locked .level-name,
.level-card.locked .level-where {
  color: #8a8576;
}
/* (under them: the chosen one, where it is and its best on the left; the difficulty, a cheese each; Close and Play) */
#levels .levels-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px 18px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(196, 180, 84, 0.25);
}
#levels .levels-chosen {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}
#levels .levels-chosen-name {
  font: 700 18px/1.15 var(--slab);
  color: #fff;
}
#levels .levels-chosen-best {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 10px;
  font: 600 13.5px var(--text);
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
#levels .levels-chosen-where {
  font: 800 10.5px var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
#levels .levels-chosen-best .level-time,
#levels .levels-chosen-best .level-cheese {
  color: var(--ink);
  font-weight: 700;
}
#levels .levels-chosen-best .level-cheese img {
  width: 16px;
}
/* (the difficulty: the cheese's card shows the choice, in gold when chosen, lit under the pointer (native-ui.ts), as the
   game's own cards; its name under it brighter) */
#levels .levels-difficulty {
  display: flex;
  gap: 2px;
}
#levels .levels-cheese {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 74px;
  margin: 0;
  padding: 4px;
  cursor: pointer;
  font: 700 12.5px var(--text);
  color: #9a9484;
  background: none;
  border: 0;
}
#levels .levels-cheese .difficulty-cheese {
  width: 40px;
  height: 40px;
}
#levels .levels-cheese:not(:disabled):hover,
#levels .levels-cheese:focus-visible,
#levels .levels-cheese.pad-focus {
  outline: none;
  color: var(--ink);
}
#levels .levels-cheese.chosen {
  color: var(--gold-light);
}
#levels .levels-cheese.locked {
  cursor: default;
  color: #6b6658;
}
#levels .levels-cheese-lock {
  display: none;
  position: absolute;
  right: 12px;
  top: 3px;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #c9c3b2;
  stroke-width: 2.2;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 1px #000);
}
#levels .levels-cheese.locked .levels-cheese-lock {
  display: block;
}
#levels .levels-buttons {
  display: flex;
  gap: 10px;
}
#levels .levels-buttons .gbutton {
  min-width: 118px;
}
/* (a phone upright, or held sideways: a row each, as the difficulty picker's, its card the picture's square alone,
   where it is over its name, the best on the right (sideways, two rows across)) */
@media (max-width: 560px), (max-height: 500px) {
  #levels .window {
    padding: 16px 14px 12px;
  }
  #levels h2 {
    font-size: 20px;
    margin-bottom: 8px;
  }
  #levels .levels-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 2px 4px 6px 2px;
  }
  .level-card {
    width: auto;
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 11px;
    padding: 5px 10px 5px 5px;
    text-align: left;
    background: linear-gradient(#22241c, #181a14);
    border: 1px solid rgba(196, 180, 84, 0.3);
    border-radius: 5px;
  }
  .level-card .level-art {
    position: relative;
    inset: auto;
    width: 52px;
    height: 52px;
    border-radius: 6px;
  }
  .level-card .level-art img {
    left: 4.95%;
    top: 4.95%;
    width: 90.1%;
    height: 90.1%;
  }
  .level-card .level-num {
    left: 4.95%;
    top: 4.95%;
    width: 90.1%;
    height: 90.1%;
    font-size: 14px;
  }
  .level-card .level-title {
    position: static;
    height: auto;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
  }
  .level-card .level-where {
    font-size: 10px;
  }
  .level-card .level-name {
    font-size: 16px;
    text-align: left;
    text-wrap: pretty;
  }
  .level-card .level-best {
    position: static;
    height: auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    font-size: 13.5px;
  }
  .level-card .level-cheese img {
    width: 16px;
  }
  .level-card:not(.locked):hover,
  .level-card:not(.locked):focus-visible,
  .level-card.pad-focus {
    border-color: rgba(231, 217, 138, 0.6);
  }
  .level-card.chosen {
    border-color: var(--gold);
  }
  .level-card.locked {
    background: #141512;
    border-color: #33392f;
  }
  .level-card .level-lock {
    width: 46%;
  }
  #levels .levels-foot {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 10px;
    margin-top: 8px;
    padding-top: 10px;
  }
  #levels .levels-chosen {
    flex-basis: 100%;
    align-items: center;
    text-align: center;
  }
  #levels .levels-chosen-name {
    font-size: 16px;
  }
  #levels .levels-chosen-best {
    justify-content: center;
    font-size: 13px;
  }
  #levels .levels-buttons {
    flex-basis: 100%;
  }
  #levels .levels-buttons .gbutton {
    flex: 1;
    min-width: 0;
    height: 46px;
    min-height: 46px;
  }
}
/* (held sideways: two rows across, and all under them on one line) */
@media (max-height: 500px) {
  #levels .window {
    width: min(820px, 100%);
    padding: 10px 16px 10px;
  }
  #levels h2 {
    font-size: 17px;
    margin-bottom: 6px;
  }
  #levels .levels-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .level-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 4px 9px 4px 4px;
  }
  .level-card .level-art {
    width: 42px;
    height: 42px;
  }
  .level-card .level-name {
    font-size: 15px;
  }
  #levels .levels-foot {
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 6px;
    padding-top: 7px;
  }
  #levels .levels-chosen {
    flex: 1;
    flex-basis: auto;
    align-items: flex-start;
    text-align: left;
  }
  #levels .levels-chosen-name {
    font-size: 15px;
  }
  #levels .levels-chosen-best {
    justify-content: flex-start;
    font-size: 12px;
  }
  #levels .levels-cheese {
    width: 64px;
    padding: 2px;
    font-size: 11.5px;
    gap: 1px;
  }
  #levels .levels-cheese .difficulty-cheese {
    width: 30px;
    height: 30px;
  }
  #levels .levels-cheese-lock {
    right: 9px;
  }
  #levels .levels-buttons {
    flex-basis: auto;
  }
  #levels .levels-buttons .gbutton {
    flex: none;
    min-width: 92px;
    height: 40px;
    min-height: 40px;
  }
}

/* the end's score, counting up as it comes */
#victory .overall-score {
  font-variant-numeric: tabular-nums;
  opacity: 0.25;
  transition: opacity 300ms;
}
#victory .overall-score.in {
  opacity: 1;
}

#victory .game-version {
  font: 500 12px var(--text);
  color: var(--ink-dim);
  opacity: 0.7;
  letter-spacing: 0.04em;
}

/* the loader: the wheel and how far along, on black, nothing more (what it is doing is not shown) */
#loading .label {
  display: none;
}
/* (the title's three lines: Big Rat's, ACTION spaced out between, Adventure; each letter its own box (index.html): Big
   Rat's at small uneven tilts, Adventure on a gentle arc, a ripple running along it every six seconds) */
#title h1 small.action {
  position: relative;
  z-index: 2;
  display: table;
  margin: 0.44em auto 0.26em;
  padding-left: 0.3em;
  font: 800 0.64em/1 var(--text);
  text-transform: uppercase;
  white-space: nowrap;
}
#title h1 .l1,
#title h1 .l3 {
  display: block;
  position: relative;
  z-index: 1;
}
#title h1 .c,
#title h1 .ch {
  display: inline-block;
}
#title h1 .c {
  rotate: var(--r, 0deg);
  translate: 0 var(--y, 0);
}
/* (every five seconds a pulse runs down the title, top to bottom, all three on the one clock: Big Rat's letters each
   rock a little and back, one after another; then ACTION bulges; then a ripple along Adventure) */
#title h1 .l1 .c {
  --w: 7deg;
  animation: title-rock 5s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 60ms + 0.8s);
}
#title h1 .l1 .c:nth-child(3n + 1) {
  --w: -6deg;
}
#title h1 .l1 .c:nth-child(3n) {
  --w: 4deg;
}
@keyframes title-rock {
  0%,
  14%,
  100% {
    transform: none;
  }
  4% {
    transform: rotate(var(--w));
  }
  9% {
    transform: rotate(calc(var(--w) * -0.4));
  }
}
#title h1 .l3 .c {
  animation: title-ripple 5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 70ms + 2.05s);
}
@keyframes title-ripple {
  0%,
  12%,
  100% {
    transform: translateY(0);
  }
  5% {
    transform: translateY(-0.09em) scale(1.04);
  }
}
/* (ACTION's letters: each, as the rat lands on it (title.ts), squashes under it, then bounces up swollen and bright,
   and settles back with a little wobble) */
#title h1 .ch {
  position: relative;
  transform-origin: 50% 90%;
}
#title h1 .ch.squish {
  animation: action-squish 0.55s ease-out;
  z-index: 1;
}
@keyframes action-squish {
  0% {
    transform: scale(1.18, 0.7) translateY(0.06em);
  }
  14% {
    transform: scale(1.18, 0.7) translateY(0.06em);
  }
  42% {
    transform: scale(1.38) translateY(-0.22em);
    filter: brightness(1.45);
  }
  66% {
    transform: scale(0.94, 1.04) translateY(0);
    filter: none;
  }
  84% {
    transform: scale(1.04, 0.97);
  }
  100% {
    transform: none;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* (the Menu button is not over the loader: nothing to press while a place is built) */
#ui:has(#loading.on) #corner {
  visibility: hidden;
}
/* the title on a phone: everything smaller, in both ways round (its desktop sizes filled the screen) */
@media (max-height: 500px) and (orientation: landscape) {
  #title h1,
  #title .title-card h1 {
    font-size: 34px;
  }
  #title #start.play,
  #title #continue-run {
    width: 210px;
    height: 46px;
    min-height: 46px;
    font-size: 18px;
  }
  #title .title-buttons {
    gap: 7px;
  }
  #title .title-buttons .gbutton:not(.play) {
    height: 38px;
    min-height: 38px;
    min-width: 140px;
    font-size: 14px;
  }
  #install-hint {
    margin-top: 8px;
    font-size: 12px;
  }
}
@media (max-width: 500px) and (orientation: portrait) {
  #title h1,
  #title .title-card h1 {
    font-size: 40px;
    margin-bottom: 26px;
  }
  #title #start.play,
  #title #continue-run {
    width: 220px;
    height: 50px;
    min-height: 50px;
    font-size: 19px;
  }
  #title .title-buttons {
    gap: 8px;
  }
  #title .title-buttons .gbutton:not(.play) {
    height: 42px;
    min-height: 42px;
    min-width: 150px;
    font-size: 15px;
  }
}
@media (max-width: 500px) {
  /* (a narrow phone: the bad ending's title on two lines, not three, and each row's sum on one) */
  #victory h2 {
    font-size: 23px;
  }
}
@media (max-height: 560px) and (orientation: landscape) {
  /* (tighter still, so the whole card and its buttons fit at rest; the version left to the title's corner) */
  #victory .window {
    padding: 6px 24px 8px;
  }
  #victory h2 {
    font-size: 21px;
    margin: 2px 0;
  }
  #victory .score-label {
    margin-top: 4px;
  }
  #victory .overall-score {
    font-size: 28px;
    margin-top: 0;
  }
  #victory .threshold {
    margin-top: 4px;
  }
  #victory .threshold-note {
    margin: 4px 0 8px;
  }
  #victory .game-version {
    display: none;
  }
}
/* (the title's corner: the version and the graphics card, small and quiet) */
#build-info {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(10px, env(safe-area-inset-bottom));
  margin: 0;
  max-width: 60vw;
  font: 500 14px var(--text);
  color: var(--ink-dim);
  opacity: 0.7;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px #000;
}

/* (sparks off ACTION, now and then: small, dim gold stars, each flaring up somewhere along the word and drifting off: title.ts) */
#title h1 small.action .spark {
  position: absolute;
  width: 0.4em;
  height: 0.4em;
  margin: -0.2em 0 0 -0.2em;
  pointer-events: none;
  color: #ffe69a;
  filter: drop-shadow(0 0 3px rgba(255, 210, 90, 0.7));
  animation: action-spark var(--life, 900ms) ease-out forwards;
  letter-spacing: 0;
}
#title h1 small.action .spark svg {
  display: block;
  width: 100%;
  height: 100%;
}
@keyframes action-spark {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.2) rotate(0deg);
  }
  25% {
    opacity: 0.75;
    transform: translate(calc(var(--dx) * 0.3), calc(var(--dy) * 0.3)) scale(1) rotate(45deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.3) rotate(120deg);
  }
}
/* (ACTION, the action in it: leaning hard, in the heaviest face; and on the title's five-second clock (after Big Rat's
   letters rock, before Adventure's ripple) coming down onto the title from a little bigger, gently, the title nudged with
   it) */
#title h1 small.action {
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--gold-light);
  text-shadow: 0 0.07em 0 #000;
  animation: action-slam 5s cubic-bezier(0.25, 1.25, 0.45, 1) 1.4s infinite;
}
#title h1 {
  animation: action-shake 5s 1.4s infinite;
}
@keyframes action-slam {
  0%,
  22%,
  100% {
    transform: none;
    opacity: 1;
  }
  5% {
    transform: scale(1.14) rotate(-1.5deg);
    opacity: 0.8;
  }
  11% {
    transform: scale(0.98);
    opacity: 1;
  }
  15% {
    transform: translateX(-1px) scale(1.01);
  }
  19% {
    transform: translateX(1px);
  }
}
@keyframes action-shake {
  0%,
  10%,
  20%,
  100% {
    translate: 0 0;
  }
  12% {
    translate: 0 1.5px;
  }
  15% {
    translate: -1px 0;
  }
  18% {
    translate: 1px 0;
  }
}
#title.leaving h1 {
  animation: none;
}
/* (and as the rat lands on each in the Rat Run, its squash (below) over all that) */
#title h1 small.action .ch.squish {
  animation: action-squish 0.55s ease-out;
}
/* the Rat Run, on Play (title.ts): the button pressed in, the menu's buttons away, the rat over ACTION on a canvas of its
   own (a band across the screen, only while it runs), then the title and the picture together to black */
#title .gbutton.pressed,
#title .gbutton.pressed:hover {
  transform: translateY(2px) scale(0.96);
  filter: brightness(1.25);
}
#title .title-buttons,
#title #install-hint {
  transition:
    opacity 0.35s,
    transform 0.35s;
}
#title.leaving .title-buttons,
#title.leaving #install-hint {
  opacity: 0;
  transform: translateY(0.4em);
  pointer-events: none;
}
#title.leaving h1 small.action {
  animation: none;
}
#title.gone.run-out {
  transition:
    opacity 550ms,
    visibility 0s linear 550ms;
}
#title .rat-run {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 3;
}
@media (prefers-reduced-motion: reduce) {
  #title h1,
  #title h1 small.action,
  #title h1 .l1 .c,
  #title h1 .l3 .c {
    animation: none;
  }
}
/* (a red button: the way out that loses something; the game's own red over this fallback) */
.gbutton.red:not(.native-button) {
  background: #78302f;
}
/* (Pause's title: Exit to menu while it asks) */
#pause .leave-title,
#pause.leaving .pause-title {
  display: none;
}
#pause.leaving .leave-title {
  display: inline;
}
#pause .leave-note {
  margin-top: 2px;
}
/* (the HUD: the run's time, cheese and deaths; the level's name and goal not spelled out) */
#clock-count {
  position: relative;
  display: none;
  color: transparent;
  margin-top: 4px;
}
#clock-count.on {
  display: block;
}
#clock-count > :not(canvas) {
  position: absolute;
  opacity: 0;
}
/* (Show FPS's card (native-ui.ts draws it; src/fps.ts): on its own over everything, the menu, the loading wheel, a
   cutscene's bars and every fade, never in the way of a press; in the HUD's top-left corner, or after the deaths' card
   when the HUD's row is up (fps.ts places it there); in 2004scape, a line in the client's yellow under its own) */
#fps-count {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  top: max(12px, env(safe-area-inset-top));
  z-index: 100001;
  display: block;
  color: transparent;
  pointer-events: none;
}
#fps-count[hidden] {
  display: none;
}
#fps-count > :not(canvas) {
  position: absolute;
  opacity: 0;
}
body.scape-mode #fps-count {
  width: var(--rs-w) !important;
  height: var(--rs-h) !important;
}
body.scape-mode #fps-count > canvas {
  display: none;
}

/* the built-in graphics word: over the title until gone past */
#gpu-warning {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  background: #0b0908;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#gpu-warning[hidden] {
  display: none;
}
#gpu-warning .window {
  width: min(600px, 100%);
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 26px 20px;
}
#gpu-warning .gpu-content {
  min-height: 0;
  overflow-y: auto;
  text-align: left;
}
#gpu-warning h2 {
  margin: 0 0 12px;
  font: 700 24px var(--slab);
  color: var(--gold-light);
  text-align: center;
}
#gpu-warning p,
#gpu-warning li {
  font: 500 15px/1.45 var(--text);
  color: var(--ink);
}
#gpu-warning p {
  margin: 0 0 10px;
}
#gpu-warning b {
  color: var(--gold-light);
  font-weight: 600;
}
/* (the card it draws with, and how slow; the steps numbered and all open; the restart a callout in its own colour) */
#gpu-warning .gpu-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
#gpu-warning .gpu-chip {
  font: 700 11px var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffd9c2;
  background: rgba(205, 92, 52, 0.28);
  border: 1px solid rgba(225, 120, 80, 0.55);
  border-radius: 999px;
  padding: 2px 9px;
}
#gpu-warning .gpu-lead {
  text-align: center;
}
#gpu-warning .gpu-steps {
  list-style: none;
  counter-reset: gstep;
  margin: 12px 0 4px;
  padding: 0;
  display: grid;
  gap: 12px;
}
#gpu-warning .gpu-steps > li {
  counter-increment: gstep;
  position: relative;
  margin: 0;
  padding: 2px 0 0 40px;
  min-height: 28px;
}
#gpu-warning .gpu-steps > li::before {
  content: counter(gstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 15px var(--slab);
  color: #1a140c;
  background: var(--gold-light);
}
#gpu-warning .gpu-steps .title {
  display: block;
  font: 700 16px/1.35 var(--text);
  color: #fff;
}
#gpu-warning .gpu-steps .sub {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  color: var(--ink-dim);
}
#gpu-warning .gpu-steps .row {
  margin: 8px 0 2px;
}
#gpu-warning .gpu-steps .row .gbutton {
  min-height: 46px;
  height: 46px;
  font-size: 16px;
  padding: 0 18px;
}
#gpu-warning .gpu-restart {
  margin-top: 6px;
  padding: 10px 12px;
  border-left: 3px solid #e0874f;
  background: rgba(224, 135, 79, 0.12);
  border-radius: 4px;
  display: grid;
  gap: 4px;
}
#gpu-warning .gpu-restart strong {
  font: 700 12px var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f2a777;
}
#gpu-warning .gpu-restart span,
#gpu-warning .gpu-result span {
  font: 500 14px/1.45 var(--text);
  color: var(--ink);
}
#gpu-warning .gpu-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
#gpu-warning .gpu-copy code {
  font-size: 14px;
  padding: 4px 8px;
}
#gpu-warning .gpu-copy button {
  font: 600 13px var(--text);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 4px 12px;
  min-height: 30px;
  cursor: pointer;
}
#gpu-warning .gpu-copy button:hover {
  background: rgba(255, 255, 255, 0.2);
}
#gpu-warning .gpu-result {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 4px;
  display: grid;
  gap: 4px;
}
#gpu-warning .gpu-result strong {
  font: 700 15px var(--text);
}
#gpu-warning .gpu-result em {
  font: italic 500 13px/1.4 var(--text);
  color: var(--ink-dim);
}
#gpu-warning .gpu-result.bad {
  border-left: 3px solid #e0874f;
  background: rgba(224, 135, 79, 0.12);
}
#gpu-warning .gpu-result.bad strong {
  color: #f2a777;
}
#gpu-warning .gpu-result.good {
  border-left: 3px solid #7fbf6a;
  background: rgba(127, 191, 106, 0.13);
  text-align: center;
}
#gpu-warning .gpu-result.good strong {
  color: #b7e3a6;
}
#gpu-warning code {
  font:
    600 13px ui-monospace,
    monospace;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  user-select: all;
}
#gpu-warning .gpu-tip {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-dim);
}
#gpu-warning #gpu-continue {
  display: block;
  margin: 16px auto 0;
  min-width: 220px;
}

/* ---- difficulty (src/difficulty.ts): a new game's choice, the save's and the pause menu's word on it, the end's */
/* (the title's choice, a tap on one starts the game: a cheese each, a row each as the level select's cards, its item card
   (native-ui.ts draws it, paler the milder) beside its name, strength and line; Normal framed in gold and said to be the
   one to start on; Legendary greyed and locked, its cheese grey, until the adventure has been finished once) */
#difficulty {
  position: fixed;
  inset: 0;
  z-index: 31;
  display: grid;
  place-items: center;
  background: #000a;
  padding: 16px;
}
#difficulty[hidden] {
  display: none;
}
#difficulty .window {
  width: min(480px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 24px 20px;
  text-align: center;
}
#difficulty h2 {
  margin: 0 0 14px;
  font: 700 24px var(--slab);
  color: var(--gold-light);
}
/* (the choices scrolled, on a screen too short for all three, under the client's scroll bar: native-ui.ts; a finger on
   one drags them, as the level select's) */
#difficulty .difficulty-options {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 4px 4px 6px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
#difficulty .difficulty-options,
#difficulty .difficulty-options * {
  touch-action: pan-y;
}
#difficulty .difficulty-option {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  column-gap: 14px;
  margin: 0;
  padding: 9px 14px 9px 9px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  background: linear-gradient(#22241c, #181a14);
  border: 1px solid rgba(196, 180, 84, 0.32);
  border-radius: 5px;
  transition: border-color 140ms;
}
/* (under the pointer or the keyboard's focus: its cheese's card lit (native-ui.ts), the row's edge brighter; no glow,
   no lift: the game's own cards light, they do not shine) */
#difficulty .difficulty-option:not(:disabled):hover,
#difficulty .difficulty-option:focus-visible,
#difficulty .difficulty-option.pad-focus {
  outline: none;
  border-color: var(--gold-light);
}
/* (the one chosen: its cheese's card in the game's gold (native-ui.ts), the row warmer and its edge the brightest gold,
   doubled, so it reads at a glance which Start will begin on) */
#difficulty .difficulty-option.chosen {
  background: linear-gradient(#3a3420, #26231a);
  border-color: var(--gold-light);
  box-shadow: inset 0 0 0 1px var(--gold-light);
}
#difficulty .difficulty-option.chosen .difficulty-name {
  color: var(--gold-light);
}
/* (Back and Play side by side, as the level select's) */
#difficulty .difficulty-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}
/* (the cheese's item card: the svg in a green frame until native-ui.ts's picture is drawn, then that alone; the level
   select's difficulty the same cheeses, smaller) */
:is(#difficulty, #levels) .difficulty-cheese {
  position: relative;
  isolation: isolate;
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  background: #1d211a;
  box-shadow:
    inset 0 0 0 2px #4d5a45,
    inset 0 0 0 4px #0f110e;
}
:is(#difficulty, #levels) .difficulty-cheese img {
  position: absolute;
  left: 18.5%;
  top: 17.3%;
  width: 63%;
  height: auto;
}
:is(#difficulty, #levels) .difficulty-cheese[data-shade='easy'] img {
  filter: saturate(0.4) sepia(0.3) brightness(1.35);
}
:is(#difficulty, #levels) .difficulty-cheese[data-shade='normal'] img {
  filter: saturate(0.8) brightness(1.15);
}
:is(#difficulty, #levels) .difficulty-cheese[data-shade='locked'] img {
  filter: grayscale(1) brightness(0.42);
}
:is(#difficulty, #levels) .difficulty-cheese.native-card {
  background: none;
  box-shadow: none;
}
:is(#difficulty, #levels) .difficulty-cheese.native-card img {
  opacity: 0;
}
#difficulty .difficulty-words {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* (the name in the level cards' slab, its cheese's strength after it in their kicker's gold capitals) */
#difficulty .difficulty-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 9px;
}
#difficulty .difficulty-name {
  font: 700 19px/1.2 var(--slab);
  color: #fff;
}
#difficulty .difficulty-strength {
  font: 700 11px var(--text);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
#difficulty .difficulty-note {
  margin-top: 2px;
  font: 500 15px/1.3 var(--text);
  color: var(--ink);
}
/* (the default, Normal: said in a word under its line as well) */
#difficulty .difficulty-tag {
  margin-top: 3px;
  font: 600 13px var(--text);
  color: var(--ink-dim);
}
#difficulty .difficulty-lock {
  display: none;
  margin-top: 3px;
  font: 600 14px var(--text);
  color: var(--ink-dim);
  align-items: center;
  gap: 6px;
}
#difficulty .difficulty-lock svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
/* (locked: greyed, no lift on the pointer, the line to open it in its place) */
#difficulty .difficulty-option.locked {
  cursor: default;
  background: #141512;
  border-color: #33392f;
}
#difficulty .locked .difficulty-name,
#difficulty .locked .difficulty-strength {
  color: #8a8576;
}
#difficulty .locked .difficulty-note {
  display: none;
}
#difficulty .locked .difficulty-lock {
  display: flex;
}
#difficulty .difficulty-buttons {
  flex: none;
}
#difficulty .difficulty-buttons .gbutton {
  min-width: 140px;
  height: 48px;
  min-height: 48px;
  font-size: 16px;
}
/* (Play names the choice: room for "Play on Legendary", the longest, without the button changing width as it changes) */
#difficulty #difficulty-start {
  min-width: 196px;
}
@media (max-width: 420px) {
  #difficulty .window {
    padding: 18px 14px 16px;
  }
  #difficulty .difficulty-option {
    grid-template-columns: 54px 1fr;
    column-gap: 11px;
    padding: 8px 10px 8px 8px;
  }
  #difficulty .difficulty-cheese {
    width: 54px;
    height: 54px;
  }
  #difficulty .difficulty-name {
    font-size: 17px;
  }
  #difficulty .difficulty-note {
    font-size: 14px;
  }
}
/* (a phone held sideways: the three no taller than the screen) */
@media (max-height: 460px) {
  #difficulty .window {
    padding: 14px 20px 12px;
  }
  #difficulty h2 {
    margin-bottom: 8px;
    font-size: 20px;
  }
  #difficulty .difficulty-options {
    gap: 7px;
    margin-bottom: 10px;
  }
  #difficulty .difficulty-option {
    grid-template-columns: 46px 1fr;
    padding: 5px 12px 5px 6px;
  }
  #difficulty .difficulty-cheese {
    width: 46px;
    height: 46px;
  }
  #difficulty .difficulty-name {
    font-size: 16px;
  }
  #difficulty .difficulty-note {
    font-size: 13.5px;
  }
  #difficulty .difficulty-buttons .gbutton {
    height: 40px;
    min-height: 40px;
  }
}
/* (a phone's narrow window: the two sharing the row, Play's name with them) */
@media (max-width: 480px) {
  #difficulty .difficulty-buttons .gbutton,
  #difficulty #difficulty-start {
    flex: 1 1 0;
    min-width: 0;
  }
}
/* (a saved game's difficulty, small under where it is, in the kicker's gold capitals) */
#save-info .save-where,
#save-info .save-difficulty {
  display: block;
}
#save-info .save-difficulty:empty {
  display: none;
}
#save-info .save-difficulty {
  margin-top: 4px;
  font: 700 14px var(--text);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}
/* (and the run's, small under Pause's title) */
#pause .pause-difficulty {
  margin: -4px 0 14px;
  font: 700 14px var(--text);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}
#pause .pause-difficulty:empty,
#pause.leaving .pause-difficulty {
  display: none;
}
/* the end: the difficulty played, each row's sum, the score's label, and the good ending's figure under its mark */
#victory .played-on b {
  color: var(--gold);
}
#victory .threshold {
  position: relative;
  padding-bottom: 16px;
}
#victory .threshold-note {
  max-width: 400px;
  line-height: 1.4;
}
/* An ability gained (ui.unlocked; native-ui.ts draws it): a toast high in the middle, under the room's plate (where
   there is none, under the counters: `--hud`, their foot, ui.ts), coming in as the item card does, held, then fading;
   never in the way (no pointer, no focus). */
#unlocked {
  --x: -50%;
  position: fixed;
  left: 50%;
  top: 84px;
  z-index: 30;
  pointer-events: none;
  color: transparent;
  opacity: 0;
  transform: translate(var(--x), -14px);
  transition:
    opacity 220ms ease-out,
    transform 260ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
#unlocked.on {
  opacity: 1;
  transform: translate(var(--x), 0);
}
#unlocked.on.off {
  opacity: 0;
  transition: opacity 400ms ease-in;
}
#unlocked > :not(canvas) {
  position: absolute;
  opacity: 0;
  white-space: nowrap;
}
body.cinema #unlocked {
  opacity: 0;
}
/* (no room plate: under the counters; a phone on its side, under them at the left, clear of the heads in the middle) */
@media (max-width: 900px) {
  #unlocked {
    top: calc(var(--hud, 64px) + 12px);
  }
}
@media (max-height: 560px) and (orientation: landscape) {
  #unlocked {
    --x: 0px;
    left: max(12px, env(safe-area-inset-left));
    top: calc(var(--hud, 64px) + 12px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #unlocked,
  #unlocked.on {
    transform: translateX(var(--x));
    transition: opacity 200ms;
  }
}

/* ---- the end (index.html #victory, src/ui.ts victory): one window at a time over the scene. Legendary opened, its own
   moment first (the gold card, Great); the scorecard: the ending, the difficulty and the name, the score against the
   good ending's line, how it was made a row each (the game's pictures, what, how many, its points), then Share
   scorecard (gold), Return to Menu and Credits; and the share window: the picture as it will go, Save, Copy, Share. */
#victory.on ~ #continue,
body:has(#victory.on) #continue {
  display: none;
}
#victory .window[hidden] {
  display: none;
}
#victory .scorecard-window {
  width: min(440px, 100%);
  padding: 26px 26px 14px;
}
#victory .ending-title {
  margin: 6px 0 4px;
  font: 700 26px/1.2 var(--slab);
  color: var(--gold-light);
  text-wrap: balance;
}
#victory .played-on {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px 6px;
  font: 600 16px var(--text);
  color: var(--ink-dim);
  letter-spacing: 0;
  text-transform: none;
}
#victory .played-on .difficulty {
  color: var(--ink-dim);
  font-weight: 600;
}
#victory .score-label {
  margin-top: 16px;
  font: 800 12px var(--text);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
#victory .overall-score {
  margin-top: 2px;
  font: 800 52px/1 var(--slab);
  color: var(--gold-light);
  text-shadow: 0 3px 0 #000;
}
#victory .threshold {
  margin: 14px auto 0;
  max-width: 300px;
}
#victory .threshold-note {
  margin: 8px 0 16px;
  font: 600 14px var(--text);
  color: var(--ink-dim);
}
#victory.bad-ending .threshold-note {
  color: #e3a596;
}
/* how it was made: a row each, its picture, what, how many, its points (lined up on the right) */
#victory .ledger {
  display: grid;
  gap: 6px;
  max-width: 340px;
  margin: 0 auto 4px;
  text-align: left;
}
#victory .ledger-row {
  display: grid;
  grid-template-columns: 32px 1fr auto 76px;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(196, 180, 84, 0.22);
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}
/* (each row in from a touch smaller, not from lower down: a row lower than its place reached past the end's foot, and its
   scroll bar came and went as they came in) */
#victory .ledger-row.in {
  opacity: 1;
  transform: none;
}
#victory .ledger-row .icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
}
#victory .ledger-row .icon img {
  width: 30px;
  height: auto;
  display: block;
}
#victory .ledger-row[data-kind='deaths'] .icon img {
  width: 24px;
}
#victory .ledger-row .icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--ink-dim);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#victory .ledger-row .what {
  font: 600 16px var(--text);
  color: var(--ink-dim);
}
#victory .ledger-row .count {
  font: 700 16px var(--text);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
#victory .ledger-row .points {
  text-align: right;
  font: 800 16px var(--text);
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}
#victory .ledger-row .points.minus {
  color: #f0a493;
}
#victory .ledger-row .points.none {
  font-weight: 600;
  font-size: 14px;
  color: rgba(201, 195, 178, 0.7);
}
/* the buttons: View scorecard, gold, the width of the window; Return to Menu and Credits side by side under it */
#victory .victory-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
#victory .victory-row {
  display: flex;
  gap: 10px;
}
#victory .victory-buttons .gbutton {
  height: 52px;
  min-height: 52px;
  min-width: 0;
  width: 100%;
  padding: 0 14px;
  font-size: 18px;
}
#victory .victory-row .gbutton {
  flex: 1 1 0;
}
#victory .game-version {
  margin: 8px 0 0;
}
/* Legendary opened: the word, one line, Great */
#victory .legendary-window {
  width: min(360px, 100%);
  padding: 30px 26px 20px;
}
#victory .legendary-window h2 {
  margin: 0 0 6px;
  font: 800 30px var(--slab);
  color: var(--gold-light);
}
#victory .legendary-window p {
  margin: 0 0 18px;
  font: 500 16px/1.4 var(--text);
  color: var(--ink-dim);
}
#victory .legendary-window .gbutton {
  width: 100%;
  height: 52px;
  min-height: 52px;
  font-size: 18px;
}
/* the share window: the picture as it will go, the name on it, its buttons in a row, a line for what happened, Back */
#victory .share-window {
  width: min(620px, 100%);
  padding: 26px 22px 16px;
}
#victory .share-preview {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  border-radius: 6px;
  background: #0b0908;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
/* (the name on the picture: optional, Anonymous until given; 16px, so an iPhone does not zoom to it) */
#victory .share-name {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font: 600 16px var(--text);
  color: var(--ink-dim);
  white-space: nowrap;
}
#victory #score-name {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border-radius: 7px;
  border: 2px solid var(--gold);
  background: rgba(0, 0, 0, 0.6);
  color: var(--ink);
  font: 700 16px var(--text);
}
#victory #score-name::placeholder {
  color: rgba(201, 195, 178, 0.55);
}
#victory #score-name:focus {
  outline: none;
  border-color: var(--gold-light);
}
#victory .share-buttons {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
#victory .share-buttons .gbutton,
#victory #share-back {
  flex: 1 1 0;
  height: 50px;
  min-height: 50px;
  min-width: 0;
  font-size: 17px;
}
#victory #share-back {
  width: 100%;
  margin-top: 10px;
}
#victory .share-note {
  margin: 10px 0 0;
  font: 600 14px var(--text);
  color: var(--gold-light);
}
#victory .share-note:empty {
  display: none;
}
/* (the end up: no speech left over beside its windows) */
body:has(#victory.on) #speech {
  display: none;
}
@media (max-height: 560px) and (orientation: landscape) {
  /* (a phone on its side: the picture at the left, as tall as fits, its buttons in a column beside it) */
  #victory .window.share-window {
    width: min(780px, 100%);
    display: grid;
    grid-template-columns: minmax(0, auto) 180px;
    grid-template-rows: auto auto auto 1fr;
    column-gap: 16px;
    align-items: start;
    padding: 22px 18px 12px;
  }
  #victory .share-preview {
    grid-row: 1 / span 4;
    width: auto;
    max-width: 100%;
    height: min(calc(100dvh - 96px), 300px);
  }
  #victory .share-name {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0 0 10px;
    font-size: 14px;
  }
  #victory #score-name {
    flex: none;
    height: 40px;
  }
  #victory .share-buttons {
    flex-direction: column;
    margin-top: 0;
  }
  #victory .share-buttons .gbutton,
  #victory #share-back {
    flex: none;
    width: 100%;
    height: 46px;
    min-height: 46px;
  }
  #victory .share-note {
    margin-top: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #victory .ledger-row {
    transition: none;
  }
}
@media (max-width: 500px) {
  #victory .scorecard-window {
    padding: 24px 16px 12px;
  }
  #victory .ending-title {
    font-size: 23px;
  }
  #victory .overall-score {
    font-size: 46px;
  }
  #victory .victory-buttons .gbutton {
    height: 50px;
    min-height: 50px;
    font-size: 17px;
  }
}
@media (max-height: 560px) and (orientation: landscape) {
  #victory .scorecard-window {
    padding: 18px 22px 10px;
  }
  #victory .score-label {
    margin-top: 8px;
  }
  #victory .overall-score {
    font-size: 38px;
  }
  #victory .threshold-note {
    margin-bottom: 10px;
  }
  #victory .victory-buttons .gbutton {
    height: 44px;
    min-height: 44px;
    font-size: 16px;
  }
}

/* What's new on the title (src/whats-new.ts): one of the menu's buttons under Play (or Continue and New game), before
   Credits, a red dot on it while a release is unread (no count: round, red, ringed in gold, breathing a little),
   and its window, the game's releases in brief newest first under the client's scroll bar, as tall as they are (to the
   screen's height) */
#title #news-corner {
  position: relative;
  order: 2;
}
#title #news-corner[hidden] {
  display: none;
}
#news-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 3;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c8352a;
  box-shadow:
    0 0 0 2px #f1d27a,
    0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  animation: news-breathe 2.4s ease-in-out infinite;
}
#news-badge[hidden] {
  display: none;
}
@keyframes news-breathe {
  50% {
    box-shadow:
      0 0 0 2px #f1d27a,
      0 0 14px 3px rgba(232, 90, 60, 0.7);
  }
}
@media (prefers-reduced-motion: reduce) {
  #news-badge {
    animation: none;
  }
}
.press-start #title #news-corner {
  visibility: hidden;
}
html.menu #title:not(.ready) #news-corner {
  opacity: 0;
  pointer-events: none;
}
#title.leaving #news-corner {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
#news {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #000a;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#news[hidden] {
  display: none;
}
/* (the title's Settings (src/settings.ts): a small window as What's new's, its three settings a button each, one
   under another, Close under them) */
#settings {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #000a;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#settings[hidden] {
  display: none;
}
#settings .window {
  width: min(380px, 100%);
  padding: 22px 26px 20px;
  text-align: center;
}
#settings h2 {
  margin: 0 0 16px;
  font: 700 26px var(--slab);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}
#settings .settings-buttons {
  display: grid;
  gap: 10px;
}
#settings .settings-buttons .gbutton {
  width: 100%;
  min-width: 0;
  height: 52px;
  min-height: 52px;
  font-size: 17px;
}
#settings #settings-close {
  margin: 18px auto 0;
  min-width: 160px;
}
@media (max-height: 500px) and (orientation: landscape) {
  #settings .window {
    padding: 12px 22px 12px;
  }
  #settings h2 {
    font-size: 20px;
    margin-bottom: 8px;
  }
  #settings .settings-buttons {
    gap: 6px;
  }
  #settings .settings-buttons .gbutton {
    height: 44px;
    min-height: 44px;
    font-size: 15px;
  }
  #settings #settings-close {
    margin-top: 10px;
  }
}
#news .window {
  width: min(560px, 100%);
  max-height: min(780px, 100%);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 26px 18px;
}
#news h2 {
  flex: none;
  margin: 0 0 12px;
  text-align: center;
  font: 700 26px var(--slab);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}
#news .news-content {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 2px 4px 8px;
  text-align: left;
}
#news .news-content:focus {
  outline: none;
}
#news .news-release {
  padding: 10px 4px 12px;
  border-bottom: 1px solid rgba(196, 180, 84, 0.22);
}
#news .news-release:last-child {
  border-bottom: 0;
}
#news .news-release header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
#news .news-release .ver {
  font: 700 13px var(--text);
  letter-spacing: 0.14em;
  color: var(--gold);
}
#news .news-release time {
  font: 600 12px var(--text);
  color: var(--ink-dim);
  opacity: 0.8;
}
#news .news-release h3 {
  margin: 4px 0 8px;
  font: 700 20px/1.25 var(--slab);
  color: var(--gold-light);
}
#news .news-release.newest h3 {
  font-size: 22px;
}
#news .news-release p {
  margin: 6px 0;
  font: 500 16px/1.45 var(--text);
  color: var(--ink);
}
#news .news-release p.h {
  font-weight: 700;
}
#news .news-release ul {
  margin: 6px 0 0;
  padding-left: 20px;
  font: 500 16px/1.45 var(--text);
  color: var(--ink);
}
#news .news-release li {
  margin: 3px 0;
}
#news .news-release li::marker {
  color: var(--gold);
}
#news .news-release a,
#news .news-site a {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
#news .news-site {
  flex: none;
  margin: -6px 0 8px;
  text-align: center;
  font: 600 14px var(--text);
}
#news #news-close {
  flex: none;
  align-self: center;
  margin: 12px auto 0;
  min-width: 160px;
}
@media (max-width: 500px) and (orientation: portrait) {
  #news .window {
    padding: 18px 16px 14px;
  }
  #news h2 {
    font-size: 22px;
  }
  #news .news-release h3 {
    font-size: 18px;
  }
  #news .news-release p,
  #news .news-release ul {
    font-size: 15px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #news .window {
    padding: 12px 20px 12px;
  }
  #news h2 {
    font-size: 20px;
    margin-bottom: 4px;
  }
  #news .news-site {
    margin: 0 0 4px;
  }
}

/* ---- a gamepad in use (body.pad-controls: src/input-mode.ts). Its focus in a window (pad-nav.ts .pad-focus): the
   native widgets light it as they light a hover (native-ui.ts), and a button glows round its edge besides, to be seen
   from the sofa; anything not drawn natively has the keyboard's ring. No pointer over the scene. Its glyphs, drawn by
   native-ui.ts as its actions are bound (--glyph-confirm, --glyph-skip, --glyph-slide): Skip's on the skip prompt's
   cap, Confirm's in the title's "Press A to start", Slide's on a slide's own button */
body.pad-controls #view {
  cursor: none !important;
}
.native-button.pad-focus {
  filter: drop-shadow(0 0 4px rgba(255, 214, 120, 0.85)) drop-shadow(0 0 10px rgba(255, 190, 80, 0.45));
}
.pad-focus:not(.native-button):not(.level-card):not(.difficulty-option):not(.levels-cheese):not(.option-row):not(
    .rs-button
  ) {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}
.pad-glyph {
  display: inline-block;
  width: 1.4em;
  height: 1.4em;
  vertical-align: -0.35em;
  background: var(--glyph-confirm) center / contain no-repeat;
}
#skip .pad-key {
  display: none;
  position: relative;
  width: 26px;
  height: 26px;
  background: var(--glyph-skip) center / contain no-repeat;
}
body.pad-controls:not(.scape-mode) #skip .key {
  display: none;
}
body.pad-controls:not(.scape-mode) #skip .pad-key {
  display: block;
}
#title .press-start-hint .pad {
  display: none;
}
body.pad-controls #title .press-start-hint .mouse,
body.pad-controls #title .press-start-hint .touch {
  display: none;
}
body.pad-controls #title .press-start-hint .pad {
  display: inline;
}
body.pad-controls .slide-link::after {
  content: '';
  position: absolute;
  right: -12px;
  top: -12px;
  width: 28px;
  height: 28px;
  background: var(--glyph-slide) center / contain no-repeat;
}

/* ---- a controller come or gone (src/pad-notice.ts): the game's small raised card (native-ui.ts), low in the middle
   (Joe, 2026-10-28: at the bottom, centred), quiet, never in the way */
#pad-notice {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 100000;
  pointer-events: none;
  color: #f3e9c8;
  font: 600 15px var(--text);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition:
    opacity 220ms ease-out,
    transform 260ms ease-out;
}
#pad-notice.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
#pad-notice.on.off {
  opacity: 0;
  transition: opacity 400ms ease-in;
}
#pad-notice[hidden] {
  display: none;
}
/* (not over the Controls window: its own line says which controller is in use) */
body:has(#controls-panel:not([hidden])) #pad-notice {
  display: none;
}
/* (its words as plain text until the native card is drawn, then the card alone) */
#pad-notice:not(.native-notice) {
  padding: 8px 16px;
  background: rgba(20, 16, 10, 0.82);
  border: 1px solid rgba(231, 217, 138, 0.45);
  border-radius: 6px;
}
#pad-notice.native-notice > :not(canvas) {
  position: absolute;
  opacity: 0;
}

/* ---- the Controls window (src/controls-panel.ts): over Settings, Pause, or the briefing's controller slide; a row an action, its name and two slots,
   each its key or button as the game draws it (native-ui.ts glyphPicture); what is fixed under them; the Steam
   Controller's part and its help under the list on the Controller tab */
#controls-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: #000a;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#controls-panel[hidden] {
  display: none;
}
#controls-panel .window {
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  padding: 18px 22px 18px;
  text-align: center;
}
#controls-panel h2 {
  margin: 0 0 10px;
  font: 700 26px var(--slab);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}
#controls-panel h3 {
  margin: 10px 0 6px;
  font: 700 16px var(--slab);
  color: var(--gold-light);
}
#controls-panel .controls-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
}
#controls-panel .controls-tabs .gbutton {
  min-width: 140px;
  height: 44px;
  font-size: 16px;
}
#controls-panel .controls-tabs .gbutton[aria-pressed='false'] {
  filter: brightness(0.72);
}
#controls-panel .controls-using {
  min-height: 1.2em;
  margin: 8px 0 4px;
  font: 500 13.5px var(--text);
  color: #c9c3b2;
}
/* (room inside for a focused slot's ring, and its scrollbar kept clear of the slots) */
#controls-panel .controls-list {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  text-align: left;
  padding: 6px 12px 6px 6px;
  scrollbar-gutter: stable;
}
#controls-panel .bind-row {
  display: grid;
  grid-template-columns: 1fr 92px 92px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border-bottom: 1px solid rgba(231, 217, 138, 0.12);
}
#controls-panel .bind-row.fixed {
  grid-template-columns: 1fr auto;
  color: #b9b3a2;
}
#controls-panel .bind-name {
  font: 600 15px var(--text);
  color: var(--ink, #f3e9c8);
}
#controls-panel .bind-slot {
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  cursor: pointer;
  font: 600 13px var(--text);
  color: #e8dfc4;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(231, 217, 138, 0.28);
  border-radius: 6px;
}
#controls-panel .bind-slot:hover,
#controls-panel .bind-slot:focus-visible {
  outline: none;
  border-color: var(--gold-light);
  background: rgba(231, 217, 138, 0.12);
}
#controls-panel .bind-slot.pad-focus {
  outline: 3px solid var(--gold-light);
  outline-offset: 1px;
}
#controls-panel .bind-slot.empty {
  color: #7d7868;
}
#controls-panel .bind-slot.waiting {
  border-color: var(--gold);
  color: var(--gold-light);
  animation: bind-wait 900ms ease-in-out infinite alternate;
}
@keyframes bind-wait {
  to {
    background: rgba(231, 217, 138, 0.2);
  }
}
#controls-panel .bind-fixed {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
#controls-panel .bind-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#controls-panel .bind-glyph kbd {
  font: 700 13px var(--text);
  padding: 3px 7px;
  border: 1px solid rgba(231, 217, 138, 0.5);
  border-radius: 4px;
}
#controls-panel .bind-picture {
  height: 30px;
  width: auto;
}
#controls-panel .controls-status {
  min-height: 2.6em;
  margin: 8px 0 0;
  font: 500 13.5px var(--text);
  color: #e8dfc4;
}
/* (nothing said: no room kept for it, so the Steam part follows the list closely) */
#controls-panel .controls-status:empty {
  min-height: 0;
  margin: 0;
}
#controls-panel .steam-hid {
  text-align: left;
  margin-top: 8px;
  padding: 2px 6px 0;
  border-top: 1px solid rgba(231, 217, 138, 0.18);
}
#controls-panel .steam-hid #steam-connect {
  height: 44px;
  font-size: 15px;
  padding: 0 18px;
}
#controls-panel .steam-status:empty {
  display: none;
}
#controls-panel .steam-status {
  min-height: 1.2em;
  margin: 6px 0;
  font: 600 13.5px var(--text);
  color: var(--gold-light);
}
#controls-panel .steam-help {
  margin: 4px 0;
  font: 500 13px/1.4 var(--text);
  color: #c9c3b2;
}
#controls-panel .controls-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}
#controls-panel .controls-buttons .gbutton {
  min-width: 150px;
  height: 46px;
  font-size: 16px;
}
@media (max-width: 520px) {
  #controls-panel .bind-row {
    grid-template-columns: 1fr 72px 72px;
  }
  #controls-panel .controls-tabs .gbutton,
  #controls-panel .controls-buttons .gbutton {
    min-width: 0;
    flex: 1;
  }
}
@media (max-height: 560px) {
  #controls-panel .window {
    padding: 10px 16px 10px;
  }
  #controls-panel h2 {
    font-size: 19px;
    margin-bottom: 6px;
  }
}
