/* FUGA 77 - page shell and DOM overlay screens.
   Warm dusk palette (G.3). System fonts only, no images.

   Sizing: every overlay screen declares a box in em (--bw x --bh) that holds
   its whole layout. The screen font size is the largest that makes that box
   fit the window (capped on big monitors), so nothing is ever clipped and
   nothing scrolls, from 360x640 to 2560x1080. Three layouts:
     - wide      (default)                        window at least 6:5, taller than 540px and wider than 1100px
     - compact   (landscape phones, small windows) window at least 6:5 and either 540px tall or less, or up to
                                                  1100px wide (the menu changes on the height alone)
     - portrait  (phones upright, narrow windows) window narrower than 6:5              */

/* ------------------------------------------------------------------ page */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1B1A22;
}

html {
  touch-action: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: default;
  color: #FFF4DC;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* The picture always fills the window. Three canvases share it (docs/DESIGN-3D.md, 8.1):
   #view3d is the 3D view, #hud3d its transparent overlay for the on-screen
   indicators, #game the aerial view. The main script shows the pair of the
   3D view or #game, never both. */
#game,
#view3d,
#hud3d {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  background: #1B1A22;
  outline: none;
  touch-action: none;
}

#view3d {
  background: #E39A6B;
}

#hud3d {
  z-index: 1;
  background: transparent;
  pointer-events: none;
}

/* loading state: on screen from the first paint until the menu is ready */
#boot {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #3A2A45 0%, #1B1A22 72%);
  pointer-events: none;
}

#boot.boot-done {
  display: none;
}

.boot-box {
  text-align: center;
  font-size: clamp(14px, 2.6vmin, 30px);
}

.boot-title {
  font-family: Impact, Haettenschweiler, "HelveticaNeue-CondensedBlack", "AvenirNextCondensed-Heavy", "Arial Narrow Bold", "Roboto Condensed", sans-serif-condensed, "Helvetica Neue", Arial, sans-serif;
  font-size: 4.2em;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #FFF4DC;
}

.boot-title b {
  font-weight: inherit;
  color: #E8642C;
}

.boot-text {
  margin-top: 0.9em;
  font-size: 1em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #E8D9A0;
}

.boot-bar {
  width: 12em;
  height: 0.28em;
  margin: 0.9em auto 0;
  border-radius: 0.2em;
  background: linear-gradient(90deg, #E8642C 0%, #FFC83A 50%, #E8642C 100%);
  background-size: 200% 100%;
  animation: boot-slide 1.1s linear infinite;
}

@keyframes boot-slide {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}

/* touch driving layer: covers the window and lets the pointer through. Its
   buttons are created, placed and styled by the input script, which also
   makes each of them take the pointer; nothing inside is styled here. */
#touch {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
  touch-action: none;
}

/* overlay screens: above the touch layer; transparent to the pointer when empty */
#ui {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;

  --fu-vw: 1vw;
  --fu-vh: 1vh;
  --fu-ink: #1B1A22;
  --fu-cream: #FFF4DC;
  --fu-sand: #E8D9A0;
  --fu-orange: #E8642C;
  --fu-amber: #FFC83A;
  --fu-red: #C8312B;
  --fu-green: #4CE06A;
  --fu-blue: #4FB7FF;
  --fu-display: Impact, Haettenschweiler, "HelveticaNeue-CondensedBlack", "AvenirNextCondensed-Heavy", "Arial Narrow Bold", "Roboto Condensed", sans-serif-condensed, "Helvetica Neue", Arial, sans-serif;
}

@supports (height: 100dvh) {
  #ui {
    --fu-vw: 1dvw;
    --fu-vh: 1dvh;
  }
}

/* ------------------------------------------------------------------ screen frame */
.fu-scr {
  --bw: 60;
  --bh: 34;
  --cap: max(18px, calc(var(--fu-vh) * 2.4));
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  font-size: min(calc(var(--fu-vw) * 100 / var(--bw)), calc(var(--fu-vh) * 100 / var(--bh)), var(--cap));
  line-height: 1.3;
  color: var(--fu-cream);
  background:
    radial-gradient(120% 80% at 50% 112%, rgba(232, 100, 44, 0.34) 0%, rgba(232, 100, 44, 0) 62%),
    linear-gradient(180deg, rgba(27, 26, 34, 0.86) 0%, rgba(34, 30, 42, 0.78) 100%);
}

.fu-scr *,
.fu-scr *::before,
.fu-scr *::after {
  box-sizing: border-box;
}

.fu-scr h1,
.fu-scr h2,
.fu-scr h3,
.fu-scr p,
.fu-scr ol {
  margin: 0;
  padding: 0;
}

.fu-panel {
  position: relative;
  width: calc((var(--bw) - 3) * 1em);
  max-height: calc((var(--bh) - 1.6) * 1em);
  padding: 1.5em 1.9em 1.5em;
  display: grid;
  gap: 1em 2em;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  scrollbar-width: none;
  border-radius: 0.9em;
  border: 0.1em solid rgba(232, 217, 160, 0.26);
  background: linear-gradient(180deg, rgba(62, 59, 72, 0.97) 0%, rgba(40, 37, 49, 0.98) 100%);
  box-shadow: 0 1em 2.6em rgba(0, 0, 0, 0.55), inset 0 0.08em 0 rgba(255, 244, 220, 0.10);
  animation: fu-in 0.16s ease-out both;
}

.fu-panel::-webkit-scrollbar {
  display: none;
}

/* three racing stripes across the top edge of every panel */
.fu-panel::before {
  content: "";
  position: absolute;
  left: 1.9em;
  right: 1.9em;
  top: 0;
  height: 0.36em;
  border-radius: 0 0 0.2em 0.2em;
  background: linear-gradient(180deg, var(--fu-orange) 0 33.3%, #E9B92E 33.3% 66.6%, var(--fu-red) 66.6% 100%);
}

@keyframes fu-in {
  from { opacity: 0; transform: translateY(0.7em); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ type */
.fu-h {
  font-family: var(--fu-display);
  font-weight: 900;
  font-style: italic;
  font-synthesis: style;
  font-size: 2.1em;
  line-height: 1.1;
  letter-spacing: 0.05em;
  color: var(--fu-cream);
  text-shadow: 0.07em 0.07em 0 rgba(232, 100, 44, 0.95);
  white-space: nowrap;
}

.fu-panel > .fu-h {
  grid-area: h;
}

.fu-sub {
  font-size: 0.86em;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--fu-sand);
}

.fu-pair {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8em;
}

.fu-pair-l {
  color: rgba(255, 244, 220, 0.80);
  white-space: pre-wrap;
}

.fu-pair-v {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fu-wallet {
  display: flex;
  align-items: baseline;
  gap: 0.15em;
  font-size: 1.1em;
  white-space: nowrap;
}

.fu-wallet .fu-pair-l {
  white-space: pre;
  color: var(--fu-sand);
}

.fu-wallet .fu-pair-v {
  font-size: 1.15em;
  font-weight: 800;
  color: var(--fu-amber);
}

/* ------------------------------------------------------------------ buttons */
.fu-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8em;
  margin: 0;
  padding: 0.3em 1.3em;
  font: inherit;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.09em;
  text-align: center;
  white-space: nowrap;
  color: var(--fu-cream);
  background: linear-gradient(180deg, #5A5563 0%, #47434F 100%);
  border: 0.12em solid rgba(255, 244, 220, 0.16);
  border-bottom-color: rgba(0, 0, 0, 0.42);
  border-radius: 0.55em;
  box-shadow: 0 0.2em 0 rgba(0, 0, 0, 0.34);
  cursor: pointer;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.08s ease-out, box-shadow 0.12s ease-out, filter 0.12s ease-out;
}

.fu-btn:focus,
.fu-btn.fu-hl {
  border-color: var(--fu-amber);
  background: linear-gradient(180deg, #736D7E 0%, #58535F 100%);
  box-shadow: 0 0 0 0.2em var(--fu-amber), 0 0.2em 0.9em rgba(255, 200, 58, 0.35);
}

.fu-btn:active {
  transform: translateY(0.12em);
  filter: brightness(0.92);
}

.fu-primary {
  color: var(--fu-ink);
  background: linear-gradient(180deg, #FF9A52 0%, var(--fu-orange) 100%);
  border-color: rgba(255, 244, 220, 0.42);
  border-bottom-color: rgba(120, 40, 10, 0.75);
}

.fu-primary:focus,
.fu-primary.fu-hl {
  border-color: var(--fu-cream);
  background: linear-gradient(180deg, #FFD466 0%, #FFAE2E 100%);
  box-shadow: 0 0 0 0.2em var(--fu-cream), 0 0.2em 1em rgba(255, 190, 70, 0.55);
}

.fu-big {
  min-height: 3.3em;
  font-size: 1.14em;
  letter-spacing: 0.14em;
}

.fu-danger {
  color: #FFB3A6;
  background: linear-gradient(180deg, #5B3036 0%, #43252B 100%);
  border-color: rgba(255, 59, 59, 0.55);
  border-bottom-color: rgba(0, 0, 0, 0.5);
}

.fu-danger:focus,
.fu-danger.fu-hl {
  color: var(--fu-cream);
  border-color: #FF3B3B;
  background: linear-gradient(180deg, #A3322E 0%, #7C2424 100%);
  box-shadow: 0 0 0 0.2em #FF3B3B, 0 0.2em 0.9em rgba(255, 59, 59, 0.4);
}

.fu-back {
  justify-self: start;
  min-width: 9em;
}

/* ------------------------------------------------------------------ menu */
.fu-scr-menu {
  --bw: 40;
  --bh: 41.5;
  justify-content: flex-start;
  background:
    radial-gradient(90% 70% at 18% 108%, rgba(232, 100, 44, 0.42) 0%, rgba(232, 100, 44, 0) 64%),
    linear-gradient(90deg, rgba(27, 26, 34, 0.95) 0%, rgba(27, 26, 34, 0.88) 30%, rgba(27, 26, 34, 0.30) 66%, rgba(27, 26, 34, 0.04) 100%);
}

.fu-menu {
  width: 27em;
  margin-left: 5em;
  display: grid;
  grid-template-areas: "brand" "btns" "foot";
  gap: 1.3em;
  animation: fu-in 0.2s ease-out both;
}

.fu-brand {
  grid-area: brand;
}

.fu-title {
  font-family: var(--fu-display);
  font-weight: 900;
  font-style: italic;
  font-synthesis: style;
  font-size: 5.6em;
  line-height: 1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--fu-cream);
  text-shadow:
    0.045em 0.045em 0 var(--fu-orange),
    0.09em 0.09em 0 var(--fu-red),
    0.135em 0.135em 0 rgba(27, 26, 34, 0.9);
}

.fu-t-b {
  color: var(--fu-amber);
}

.fu-city {
  display: flex;
  align-items: center;
  margin-top: 0.35em;
  font-size: 1.2em;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fu-sand);
}

/* the rule beside the city name gives way when the text needs the room */
.fu-city::before {
  content: "";
  flex: 0 1 2.2em;
  min-width: 0.7em;
  height: 0.16em;
  margin-right: 0.7em;
  background: var(--fu-orange);
}

.fu-brand .fu-pitch {
  margin-top: 0.8em;
  max-width: 25em;
  line-height: 1.45;
  color: rgba(255, 244, 220, 0.86);
  text-shadow: 0 0.06em 0.2em rgba(27, 26, 34, 0.9);
}

.fu-menu-btns {
  grid-area: btns;
  display: grid;
  gap: 0.55em;
  width: 17em;
}

.fu-menu-btns .fu-btn {
  justify-content: flex-start;
  padding-left: 1.5em;
  min-height: 2.9em;
}

.fu-menu-btns .fu-btn:focus,
.fu-menu-btns .fu-btn.fu-hl {
  transform: translateX(0.5em);
}

.fu-menu-btns .fu-btn:active {
  transform: translateX(0.5em) translateY(0.12em);
}

.fu-menu-btns .fu-big {
  min-height: 3.2em;
}

.fu-foot {
  grid-area: foot;
  display: grid;
  gap: 0.3em;
  text-shadow: 0 0.06em 0.2em rgba(27, 26, 34, 0.9);
}

.fu-warn {
  font-size: 0.85em;
  color: #FFB39A;
}

.fu-warn[hidden] {
  display: none;
}

.fu-warn::before {
  content: "!";
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  margin-right: 0.5em;
  border-radius: 50%;
  font-weight: 900;
  line-height: 1.3em;
  text-align: center;
  color: var(--fu-ink);
  background: #FF8A5C;
}

/* ------------------------------------------------------------------ garage */
.fu-scr-garage {
  --bw: 66;
  --bh: 32;
}

.fu-garage {
  grid-template-columns: 1.2fr 1fr;
  grid-template-areas:
    "head  head"
    "show  stats"
    "show  buy"
    "id    paint"
    "back  paint";
  grid-template-rows: auto auto 1fr auto auto;
  gap: 0.9em 2.2em;
}

.fu-g-head {
  grid-area: head;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1em;
}

.fu-g-show {
  grid-area: show;
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.fu-arrow {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6em;
  height: 4.6em;
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: 1em;
  line-height: 1;
  color: var(--fu-cream);
  background: linear-gradient(180deg, #5A5563 0%, #47434F 100%);
  border: 0.12em solid rgba(255, 244, 220, 0.16);
  border-bottom-color: rgba(0, 0, 0, 0.42);
  border-radius: 0.55em;
  box-shadow: 0 0.2em 0 rgba(0, 0, 0, 0.34);
  cursor: pointer;
  outline: none;
  transition: transform 0.08s ease-out;
}

/* the arrow glyph stays in the text of the button, a drawn triangle is what shows */
.fu-arrow-t {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  overflow: hidden;
  font-size: 0;
  color: transparent;
}

.fu-arrow::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-color: transparent;
  border-width: 0.55em 0.85em 0.55em 0;
  border-right-color: currentColor;
}

.fu-next::before {
  border-width: 0.55em 0 0.55em 0.85em;
  border-right-color: transparent;
  border-left-color: currentColor;
}

.fu-arrow:active {
  transform: translateY(0.12em);
  color: var(--fu-ink);
  background: linear-gradient(180deg, #FFD466 0%, #FFAE2E 100%);
}

/* pointer-only niceties (a finger has no hover and would leave them stuck) */
@media (hover: hover) {
  .fu-arrow:hover {
    color: var(--fu-ink);
    background: linear-gradient(180deg, #FFD466 0%, #FFAE2E 100%);
  }

  .fu-sw:hover {
    transform: translateY(-0.1em);
  }

  .fu-sw.fu-on:hover {
    transform: scale(1.06);
  }

  .fu-seg button:hover {
    color: var(--fu-cream);
  }

  .fu-seg button.fu-on:hover {
    color: var(--fu-ink);
  }
}

.fu-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border-radius: 0.7em;
  border: 0.14em solid rgba(27, 26, 34, 0.85);
  background: #3B3A45;
  box-shadow: inset 0 0 0 0.08em rgba(232, 217, 160, 0.18), 0 0.3em 0.9em rgba(0, 0, 0, 0.35);
  touch-action: none;
}

/* keeps the stage at 124:58 whatever its width */
.fu-stage::before {
  content: "";
  display: block;
  padding-top: 46.77%;
}

.fu-preview {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.fu-g-id {
  grid-area: id;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name pips" "tipo pips";
  align-items: center;
  column-gap: 1em;
}

.fu-g-name {
  grid-area: name;
  font-family: var(--fu-display);
  font-weight: 900;
  font-style: italic;
  font-synthesis: style;
  font-size: 1.9em;
  line-height: 1.1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.fu-g-tipo {
  grid-area: tipo;
  font-size: 0.92em;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fu-sand);
}

.fu-pips {
  grid-area: pips;
  display: grid;
  grid-template-columns: repeat(6, 0.72em);
  gap: 0.3em;
}

.fu-pip {
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  border: 0.11em solid rgba(255, 244, 220, 0.38);
}

.fu-pip.fu-owned {
  border-color: var(--fu-sand);
  background: var(--fu-sand);
}

.fu-pip.fu-chosen {
  border-color: var(--fu-green);
  background: var(--fu-green);
}

.fu-pip.fu-cur {
  box-shadow: 0 0 0 0.16em var(--fu-ink), 0 0 0 0.3em var(--fu-amber);
}

.fu-g-stats {
  grid-area: stats;
  display: grid;
  gap: 0.5em;
  align-content: center;
}

.fu-stat {
  display: grid;
  grid-template-columns: 7.6em 1fr;
  align-items: center;
  gap: 0.8em;
}

.fu-stat-l {
  font-size: 0.82em;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--fu-sand);
}

.fu-bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.2em;
  height: 0.95em;
}

.fu-seg-cell {
  display: block;
  border-radius: 0.12em;
  background: rgba(27, 26, 34, 0.62);
  box-shadow: inset 0 0 0 0.06em rgba(255, 244, 220, 0.10);
  transform: skewX(-16deg);
  transition: background-color 0.12s ease-out;
}

.fu-seg-cell.fu-on {
  background: var(--fu-amber);
  box-shadow: inset 0 -0.2em 0 rgba(232, 100, 44, 0.55);
}

.fu-seg-cell.fu-on:nth-child(n+8) {
  background: #FF9A3C;
}

.fu-g-buy {
  grid-area: buy;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "price action" "miss miss";
  align-items: center;
  align-content: center;
  gap: 0.3em 1em;
}

.fu-g-buy.fu-owned {
  grid-template-columns: 1fr;
  grid-template-areas: "action" "miss";
}

.fu-price {
  grid-area: price;
  font-size: 1.7em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--fu-amber);
}

.fu-price:empty {
  display: none;
}

.fu-action {
  grid-area: action;
  min-height: 3em;
  font-size: 1.08em;
}

.fu-buy {
  color: var(--fu-ink);
  background: linear-gradient(180deg, #7CF093 0%, #3FC65B 100%);
  border-color: rgba(255, 244, 220, 0.42);
  border-bottom-color: rgba(10, 80, 30, 0.75);
}

.fu-buy:focus,
.fu-buy.fu-hl {
  border-color: var(--fu-cream);
  background: linear-gradient(180deg, #A6FFB6 0%, #55DA70 100%);
  box-shadow: 0 0 0 0.2em var(--fu-cream), 0 0.2em 1em rgba(76, 224, 106, 0.5);
}

.fu-action.fu-chosen {
  color: var(--fu-green);
  background: rgba(27, 26, 34, 0.55);
  border-color: rgba(76, 224, 106, 0.6);
  box-shadow: none;
  cursor: default;
}

.fu-action.fu-chosen::before {
  content: "";
  width: 0.42em;
  height: 0.82em;
  margin: -0.2em 0.7em 0 0;
  border: solid var(--fu-green);
  border-width: 0 0.2em 0.2em 0;
  transform: rotate(40deg);
}

.fu-action.fu-chosen:focus,
.fu-action.fu-chosen.fu-hl {
  box-shadow: 0 0 0 0.2em var(--fu-amber);
}

.fu-action.fu-off.fu-buy {
  color: rgba(255, 244, 220, 0.5);
  background: rgba(27, 26, 34, 0.55);
  border-color: rgba(255, 244, 220, 0.2);
  box-shadow: none;
  cursor: default;
}

.fu-action.fu-off.fu-buy:focus,
.fu-action.fu-off.fu-buy.fu-hl {
  box-shadow: 0 0 0 0.2em var(--fu-amber);
}

.fu-missing {
  grid-area: miss;
  min-height: 1.3em;
  font-size: 0.92em;
  font-weight: 700;
  color: #FF9D8A;
}

.fu-g-paint {
  grid-area: paint;
  display: grid;
  gap: 0.5em;
  align-content: start;
}

.fu-g-paint .fu-sub {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
}

.fu-paint-name {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 1.1em;
  color: rgba(255, 244, 220, 0.86);
}

.fu-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5em;
  padding: 0.3em;
  margin: -0.3em;
  border-radius: 0.6em;
}

.fu-sw {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  height: 2.4em;
  margin: 0;
  padding: 0;
  font: inherit;
  border: 0.14em solid rgba(27, 26, 34, 0.9);
  border-radius: 0.45em;
  box-shadow: 0 0 0 0.07em rgba(255, 244, 220, 0.22), inset 0 0.16em 0 rgba(255, 255, 255, 0.26), inset 0 -0.2em 0 rgba(0, 0, 0, 0.22);
  cursor: pointer;
  outline: none;
  transition: transform 0.08s ease-out;
}

.fu-sw.fu-on {
  border-color: var(--fu-cream);
  box-shadow: 0 0 0 0.14em var(--fu-cream), inset 0 0.16em 0 rgba(255, 255, 255, 0.26);
  transform: scale(1.06);
}

.fu-sw.fu-on::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 0.4em;
  height: 0.8em;
  border: solid #FFFFFF;
  border-width: 0 0.2em 0.2em 0;
  transform: translate(-50%, -50%) rotate(40deg);
  filter: drop-shadow(0 0 0.08em #000000) drop-shadow(0 0.05em 0.1em rgba(0, 0, 0, 0.8));
}

.fu-sw:focus,
.fu-sw.fu-hl {
  box-shadow: 0 0 0 0.14em var(--fu-cream), 0 0 0 0.34em var(--fu-amber);
}

.fu-garage .fu-back {
  grid-area: back;
  align-self: end;
}

/* ------------------------------------------------------------------ settings */
.fu-scr-settings {
  --bw: 44;
  --bh: 43;
}

.fu-settings {
  width: 38em;
  grid-template-areas: "h" "grid" "foot";
}

.fu-set-grid {
  grid-area: grid;
  display: grid;
  gap: 0.4em;
}

.fu-row {
  display: flex;
  align-items: center;
  gap: 1em;
  min-height: 2.8em;
  padding: 0.25em 0.9em;
  border-radius: 0.55em;
  background: rgba(27, 26, 34, 0.38);
  box-shadow: inset 0 0 0 0.08em rgba(255, 244, 220, 0.05);
}

.fu-row:focus-within,
.fu-row.fu-hl-in {
  background: rgba(255, 200, 58, 0.13);
  box-shadow: inset 0 0 0 0.12em rgba(255, 200, 58, 0.75);
}

.fu-row-l {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

/* «Vista» when the 3D view cannot be used: the row says so instead of offering it */
.fu-row-note {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.86em;
  line-height: 1.15;
  text-align: right;
  color: var(--fu-sand);
}

.fu-row-note[hidden],
.fu-seg[hidden] {
  display: none;
}

.fu-row-off .fu-row-l {
  flex: 0 0 auto;
  opacity: 0.7;
}

.fu-row-off .fu-row-note {
  flex: 1 1 auto;
}

.fu-row-v {
  flex: 0 0 2.3em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--fu-amber);
}

.fu-range {
  -webkit-appearance: none;
  appearance: none;
  --fill: 50%;
  flex: 0 0 15em;
  width: 15em;
  height: 2.2em;
  margin: 0;
  padding: 0;
  font: inherit;
  background: transparent;
  cursor: pointer;
  outline: none;
  touch-action: none;
}

.fu-range::-webkit-slider-runnable-track {
  height: 0.56em;
  border-radius: 0.3em;
  background: linear-gradient(90deg, var(--fu-orange) 0, var(--fu-amber) var(--fill), rgba(27, 26, 34, 0.75) var(--fill));
  box-shadow: inset 0 0 0 0.07em rgba(255, 244, 220, 0.14);
}

.fu-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.5em;
  height: 1.5em;
  margin-top: -0.47em;
  border-radius: 50%;
  border: 0.16em solid var(--fu-ink);
  background: var(--fu-cream);
  box-shadow: 0 0.12em 0.3em rgba(0, 0, 0, 0.5);
}

.fu-range:focus::-webkit-slider-thumb,
.fu-range.fu-hl::-webkit-slider-thumb {
  background: var(--fu-amber);
  box-shadow: 0 0 0 0.18em rgba(255, 200, 58, 0.45), 0 0.12em 0.3em rgba(0, 0, 0, 0.5);
}

.fu-range::-moz-range-track {
  height: 0.56em;
  border-radius: 0.3em;
  background: rgba(27, 26, 34, 0.75);
}

.fu-range::-moz-range-progress {
  height: 0.56em;
  border-radius: 0.3em;
  background: linear-gradient(90deg, var(--fu-orange), var(--fu-amber));
}

.fu-range::-moz-range-thumb {
  width: 1.2em;
  height: 1.2em;
  border-radius: 50%;
  border: 0.16em solid var(--fu-ink);
  background: var(--fu-cream);
}

.fu-range:focus::-moz-range-thumb,
.fu-range.fu-hl::-moz-range-thumb {
  background: var(--fu-amber);
}

.fu-seg {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 0.18em;
  padding: 0.18em;
  border-radius: 0.55em;
  background: rgba(27, 26, 34, 0.7);
  box-shadow: inset 0 0 0 0.08em rgba(255, 244, 220, 0.14);
}

.fu-seg button {
  -webkit-appearance: none;
  appearance: none;
  min-width: 3.2em;
  min-height: 2.15em;
  margin: 0;
  padding: 0 0.85em;
  font: inherit;
  font-weight: 700;
  color: rgba(255, 244, 220, 0.72);
  background: transparent;
  border: 0;
  border-radius: 0.4em;
  cursor: pointer;
  outline: none;
}

.fu-seg button.fu-on {
  color: var(--fu-ink);
  background: linear-gradient(180deg, #FF9A52 0%, var(--fu-orange) 100%);
  box-shadow: 0 0.1em 0 rgba(0, 0, 0, 0.3);
}

.fu-seg button:focus,
.fu-seg button.fu-hl {
  box-shadow: 0 0 0 0.16em var(--fu-amber);
}

.fu-seg button.fu-on:focus,
.fu-seg button.fu-on.fu-hl {
  background: linear-gradient(180deg, #FFD466 0%, #FFAE2E 100%);
}

.fu-set-foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-top: 0.3em;
}

/* confirm dialog (inside the screen, above its panel) */
.fu-dialog-wrap {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 26, 34, 0.78);
}

.fu-dialog {
  width: 27em;
  max-width: calc(100% - 2em);
  padding: 1.6em 1.6em 1.4em;
  border-radius: 0.9em;
  border: 0.12em solid rgba(255, 59, 59, 0.6);
  background: linear-gradient(180deg, #46303A 0%, #2C232D 100%);
  box-shadow: 0 1em 2.6em rgba(0, 0, 0, 0.6);
  animation: fu-in 0.14s ease-out both;
}

.fu-dialog-text {
  font-size: 1.12em;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.fu-dialog-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9em;
  margin-top: 1.3em;
}

.fu-dialog-btns .fu-btn {
  padding-left: 0.6em;
  padding-right: 0.6em;
}

/* ------------------------------------------------------------------ how to play */
.fu-scr-howto {
  --bw: 52;
  --bh: 32;
}

.fu-howto {
  grid-template-areas: "h" "steps" "keys" "back";
}

.fu-steps {
  grid-area: steps;
  list-style: none;
  display: grid;
  gap: 0.7em;
}

.fu-step {
  display: grid;
  grid-template-columns: 1.7em 1fr;
  align-items: center;
  gap: 0.9em;
  font-size: 1.04em;
  line-height: 1.34;
}

.fu-ico {
  display: block;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  position: relative;
}

.fu-i-pick {
  border: 0.26em solid var(--fu-green);
  box-shadow: 0 0 0.5em rgba(76, 224, 106, 0.6);
}

.fu-i-hide {
  border: 0.26em solid var(--fu-amber);
  box-shadow: 0 0 0.5em rgba(255, 200, 58, 0.6);
}

.fu-i-cash {
  background: #E9B92E;
  box-shadow: inset 0 0 0 0.16em #B88A12;
}

.fu-i-cash::after {
  content: "$";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  font-style: normal;
  font-weight: 900;
  font-size: 0.95em;
  line-height: 1.58em;
  text-align: center;
  color: #5A4206;
}

.fu-i-shop {
  border: 0.26em solid var(--fu-blue);
  box-shadow: 0 0 0.5em rgba(79, 183, 255, 0.6);
}

.fu-i-cop {
  background: linear-gradient(90deg, #3A7BFF 0 50%, #FF3B3B 50% 100%);
  box-shadow: 0 0 0.5em rgba(255, 59, 59, 0.5), inset 0 0 0 0.14em rgba(27, 26, 34, 0.7);
}

.fu-keys {
  grid-area: keys;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em 0.5em;
  align-items: center;
  padding: 0.8em 0.9em;
  border-radius: 0.6em;
  font-size: 0.9em;
  background: rgba(27, 26, 34, 0.42);
}

.fu-howto .fu-back {
  grid-area: back;
}

.fu-key {
  padding: 0.22em 0.7em;
  border-radius: 0.4em;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255, 244, 220, 0.10);
  box-shadow: inset 0 -0.14em 0 rgba(0, 0, 0, 0.35), inset 0 0 0 0.07em rgba(255, 244, 220, 0.16);
}

/* the separators of the J.2 string stay in the text; the chips already split it for the eye */
.fu-key-sep {
  display: none;
}

/* ------------------------------------------------------------------ records */
.fu-scr-records {
  --bw: 58;
  --bh: 30;
}

.fu-records {
  grid-template-columns: 1fr 1.05fr;
  grid-template-areas:
    "h     h"
    "list  retos"
    "back  back";
  align-items: start;
}

.fu-list {
  display: grid;
  gap: 0.34em;
}

.fu-records .fu-list {
  grid-area: list;
}

.fu-records .fu-back {
  grid-area: back;
}

.fu-list .fu-pair {
  min-height: 2em;
  padding: 0.2em 0.9em;
  border-radius: 0.45em;
  background: rgba(27, 26, 34, 0.36);
}

.fu-list .fu-pair-v {
  font-size: 1.12em;
  color: var(--fu-amber);
}

.fu-retos {
  grid-area: retos;
  display: grid;
  gap: 0.6em;
  padding: 0.9em 1em 1em;
  border-radius: 0.6em;
  background: rgba(27, 26, 34, 0.42);
  box-shadow: inset 0 0 0 0.08em rgba(232, 217, 160, 0.14);
}

.fu-reto-list {
  display: grid;
  gap: 0.5em;
}

.fu-reto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  min-height: 2.9em;
  padding: 0.4em 0.8em;
  border-radius: 0.45em;
  border-left: 0.3em solid var(--fu-orange);
  background: rgba(255, 244, 220, 0.07);
  line-height: 1.25;
}

.fu-reto-r {
  flex: 0 0 auto;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--fu-green);
}

/* ------------------------------------------------------------------ pause */
.fu-scr-pause {
  --bw: 40;
  --bh: 30;
  background: linear-gradient(180deg, rgba(27, 26, 34, 0.72) 0%, rgba(27, 26, 34, 0.80) 100%);
}

.fu-pause {
  width: 24em;
  grid-template-areas: "h" "btns";
  justify-items: center;
  text-align: center;
}

.fu-pause-btns {
  grid-area: btns;
  display: grid;
  gap: 0.55em;
  width: 100%;
}

/* ------------------------------------------------------------------ results */
.fu-scr-results {
  --bw: 60;
  --bh: 32;
}

.fu-scr-results.fu-wrecked {
  background:
    radial-gradient(120% 80% at 50% 112%, rgba(232, 100, 44, 0.46) 0%, rgba(232, 100, 44, 0) 62%),
    linear-gradient(180deg, rgba(27, 26, 34, 0.84) 0%, rgba(40, 26, 30, 0.80) 100%);
}

.fu-scr-results.fu-busted {
  background:
    radial-gradient(70% 80% at 0% 100%, rgba(58, 123, 255, 0.34) 0%, rgba(58, 123, 255, 0) 64%),
    radial-gradient(70% 80% at 100% 100%, rgba(255, 59, 59, 0.34) 0%, rgba(255, 59, 59, 0) 64%),
    linear-gradient(180deg, rgba(27, 26, 34, 0.86) 0%, rgba(27, 26, 40, 0.80) 100%);
}

.fu-results {
  width: 54em;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "top   top"
    "list  side"
    "btns  btns";
  align-items: start;
}

.fu-res-top {
  grid-area: top;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4em 1.2em;
}

.fu-res-title {
  font-size: 2.7em;
}

.fu-busted .fu-res-title {
  text-shadow: 0.07em 0.07em 0 rgba(58, 123, 255, 0.95);
}

.fu-badge {
  padding: 0.22em 0.9em;
  border-radius: 0.4em;
  font-weight: 900;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--fu-ink);
  background: linear-gradient(180deg, #FFE07A 0%, var(--fu-amber) 100%);
  box-shadow: 0 0.15em 0 rgba(120, 80, 0, 0.7), 0 0 1em rgba(255, 200, 58, 0.5);
  transform: rotate(-2.5deg);
  animation: fu-pop 0.5s ease-out 0.15s both;
}

@keyframes fu-pop {
  0% { transform: rotate(-2.5deg) scale(0.4); opacity: 0; }
  70% { transform: rotate(-2.5deg) scale(1.14); opacity: 1; }
  100% { transform: rotate(-2.5deg) scale(1); opacity: 1; }
}

.fu-res-rows {
  grid-area: list;
}

.fu-res-rows .fu-rec {
  background: rgba(255, 200, 58, 0.16);
  box-shadow: inset 0.3em 0 0 var(--fu-amber);
}

.fu-res-rows .fu-rec .fu-pair-v::after {
  content: "\2605";
  margin-left: 0.4em;
  color: var(--fu-amber);
}

.fu-res-side {
  grid-area: side;
  display: grid;
  gap: 0.6em;
  align-content: start;
}

.fu-res-retos {
  display: grid;
  gap: 0.4em;
}

.fu-res-reto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8em;
  padding: 0.4em 0.8em;
  border-radius: 0.45em;
  border-left: 0.3em solid var(--fu-green);
  background: rgba(76, 224, 106, 0.12);
  font-size: 0.94em;
  line-height: 1.28;
}

.fu-res-cash {
  justify-content: space-between;
  padding: 0.35em 0.9em;
  border-radius: 0.45em;
  font-size: 1.2em;
  background: rgba(27, 26, 34, 0.5);
  box-shadow: inset 0 0 0 0.08em rgba(255, 200, 58, 0.35);
}

.fu-hint {
  padding: 0 0.2em;
  font-size: 0.96em;
  color: rgba(255, 244, 220, 0.82);
}

.fu-hint.fu-can {
  font-weight: 800;
  color: var(--fu-green);
}

.fu-res-btns {
  grid-area: btns;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 0.8em;
  margin-top: 0.3em;
}

/* ------------------------------------------------------------------ compact panels
   Landscape phones (540px tall or less) and any landscape window up to 1100px
   wide: the panels switch to tighter two-column arrangements that need far
   fewer em across, so their text stays large. */
/* ------------------------------------------------------------------ versus (docs/DESIGN-VERSUS.md H.6)
   The versus screen, the lobby, the overlays of a match, its results and its local menu.
   Built by vsui.js from the same panel, rows and buttons as every other screen. */
.fu-scr-versus {
  --bw: 48;
  --bh: 35;
}

.fu-versus {
  width: 34em;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8em;
}

.fu-vs-head {
  display: grid;
  gap: 0.3em;
}

.fu-vs-sub {
  font-weight: 600;
  color: var(--fu-sand);
}

/* what this build still lacks: said on the versus screen and in the lobby */
.fu-versus .fu-vs-note {
  padding: 0.55em 0.8em;
  font-size: 0.86em;
  line-height: 1.35;
  border-radius: 0.5em;
  color: rgba(255, 244, 220, 0.88);
  background: rgba(79, 183, 255, 0.12);
  box-shadow: inset 0 0 0 0.08em rgba(79, 183, 255, 0.36);
}

.fu-vs-form {
  display: grid;
  gap: 0.5em;
}

.fu-vs-field {
  cursor: text;
}

.fu-input {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 11em;
  min-height: 2.1em;
  margin: 0;
  padding: 0.2em 0.6em;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--fu-cream);
  background: rgba(27, 26, 34, 0.78);
  border: 0.12em solid rgba(255, 244, 220, 0.28);
  border-radius: 0.4em;
  outline: none;
}

.fu-input:focus,
.fu-input.fu-hl {
  border-color: var(--fu-amber);
  box-shadow: 0 0 0 0.16em rgba(255, 200, 58, 0.45);
}

.fu-input:disabled,
.fu-versus .fu-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.fu-vs-codein {
  width: 7.4em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.28em;
}

/* one line is kept for the status, so the buttons do not jump when it appears */
.fu-vs-msg {
  min-height: 1.3em;
  font-weight: 700;
  color: var(--fu-sand);
}

.fu-vs-msg[hidden] {
  display: block;
  visibility: hidden;
}

.fu-vs-bad {
  color: #FFB39A;
}

.fu-versus .fu-vs-blocked {
  padding: 0.7em 0;
  font-size: 1.12em;
  line-height: 1.4;
  color: var(--fu-cream);
}

/* lobby: the room code is the thing to read out loud */
.fu-vs-room {
  display: flex;
  align-items: baseline;
  gap: 0.25em;
}

.fu-vs-code {
  font-size: 1.7em;
  letter-spacing: 0.16em;
  color: var(--fu-amber);
  -webkit-user-select: text;
  user-select: text;
}

.fu-vs-players {
  display: grid;
  gap: 0.4em;
}

.fu-vs-player .fu-row-l {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fu-vs-me {
  box-shadow: inset 0.32em 0 0 var(--fu-amber), inset 0 0 0 0.08em rgba(255, 244, 220, 0.05);
}

.fu-vs-empty .fu-row-l {
  font-weight: 600;
  font-style: italic;
  color: rgba(255, 244, 220, 0.62);
}

.fu-vs-state {
  flex: 0 0 auto;
  white-space: nowrap;
  color: rgba(255, 244, 220, 0.62);
}

.fu-vs-state[hidden] {
  display: none;
}

.fu-vs-ready .fu-vs-state {
  color: var(--fu-green);
}

.fu-vs-value {
  flex: 0 0 auto;
  color: var(--fu-amber);
}

.fu-vs-guest {
  font-size: 0.86em;
  color: var(--fu-sand);
}

.fu-vs-btns {
  display: flex;
  gap: 0.8em;
}

.fu-vs-btns .fu-btn {
  flex: 1 1 0;
}

/* how a match ended */
.fu-vs-end {
  width: 30em;
  grid-template-areas: "h" "msg" "btn";
  justify-items: center;
  text-align: center;
}

.fu-vs-endtext {
  grid-area: msg;
  font-size: 1.15em;
  line-height: 1.4;
  color: var(--fu-cream);
}

.fu-vs-end .fu-btn {
  grid-area: btn;
  min-width: 12em;
}

/* lobby: the options of the room. The creator sets the first two; the others say what this
   milestone plays with. The panel is wider and its rows closer than on the versus screen, so
   that the code, both players, the options and the buttons are all in view at once. */
.fu-scr-vslobby {
  --bh: 39;
}

.fu-vs-lobby {
  width: 40em;
  gap: 0.5em;
}

.fu-vs-lobby .fu-vs-player {
  min-height: 2.4em;
}

.fu-vs-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35em;
}

.fu-vs-option {
  min-height: 2.35em;
}

.fu-vs-option .fu-row-l {
  flex: 0 1 auto;
}

.fu-vs-option .fu-row-note {
  flex: 1 1 auto;
}

.fu-vs-option .fu-vs-value,
.fu-vs-option .fu-seg {
  margin-left: auto;
}

/* three long values: the label on its own line, the choices across the row */
.fu-vs-option-wide {
  flex-wrap: wrap;
  row-gap: 0.3em;
  padding-top: 0.45em;
  padding-bottom: 0.5em;
}

.fu-vs-option-wide .fu-row-l {
  flex: 1 0 100%;
}

.fu-vs-option-wide .fu-seg {
  flex: 1 1 auto;
  display: flex;
  margin-left: 0;
}

.fu-vs-option-wide .fu-seg button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.3em;
  padding: 0 0.2em;
  font-size: 0.78em;
  white-space: nowrap;
}

/* a wide option with a note (M3: «Ayuda policial»): the note on its own line under the choices */
.fu-vs-option-wide .fu-row-note {
  order: 3;
  flex: 1 0 100%;
}

/* the result of a match */
.fu-vs-result {
  width: 38em;
  grid-template-areas: none;
  gap: 0.55em;
  justify-items: center;
  text-align: center;
}

.fu-vs-result > .fu-h {
  grid-area: auto;
  font-size: 3.2em;
}

.fu-vs-win > .fu-h {
  color: var(--fu-amber);
  text-shadow: 0.06em 0.06em 0 rgba(200, 49, 43, 0.95);
}

.fu-vs-lose > .fu-h {
  color: #D9D2C4;
  text-shadow: 0.06em 0.06em 0 rgba(27, 26, 34, 0.9);
}

.fu-vs-score {
  font-size: 1.6em;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.fu-vs-tie {
  font-weight: 700;
  color: var(--fu-amber);
}

.fu-vs-tie[hidden] {
  display: none;
}

.fu-vs-halves {
  display: grid;
  gap: 0.15em;
  padding: 0.5em 1.2em;
  border-radius: 0.5em;
  color: rgba(255, 244, 220, 0.86);
  background: rgba(27, 26, 34, 0.38);
}

.fu-vs-result .fu-vs-rematch {
  color: var(--fu-amber);
}

.fu-vs-result .fu-vs-btns {
  width: 100%;
}

.fu-vs-result .fu-btn {
  grid-area: auto;
  min-width: 0;
}

/* «Esperando al rival…» is the longest label of the row: the rematch button gets the room */
.fu-vs-result .fu-vs-btns .fu-btn {
  padding-left: 0.5em;
  padding-right: 0.5em;
}

.fu-vs-result .fu-vs-btns .fu-btn:first-child {
  flex: 1.5 1 0;
}

/* what stands over the picture of a match: the role card, the countdown, how a half ended,
   the intermission. One element in #ui beside the screens; it takes no pointer and no key. */
.fu-vs-over {
  position: absolute;
  left: 0;
  right: 0;
  top: 17%;
  z-index: 30;
  display: grid;
  justify-items: center;
  gap: 0.3em;
  padding: 0 4%;
  font-size: clamp(13px, calc(var(--fu-vh) * 3), 30px);
  line-height: 1.15;
  text-align: center;
  color: var(--fu-cream);
  pointer-events: none;
}

.fu-vs-over p {
  margin: 0;
}

.fu-vs-over-big {
  font-family: var(--fu-display);
  font-style: italic;
  font-weight: 900;
  font-synthesis: style;
  font-size: 3em;
  letter-spacing: 0.04em;
  text-shadow: 0.06em 0.06em 0 rgba(27, 26, 34, 0.92), 0 0 0.5em rgba(27, 26, 34, 0.7);
  animation: fu-vs-pop 0.3s ease-out both;
}

.fu-vs-over-small,
.fu-vs-over-line {
  padding: 0.18em 0.9em;
  font-weight: 800;
  border-radius: 0.4em;
  background: rgba(27, 26, 34, 0.72);
}

.fu-vs-over-small {
  letter-spacing: 0.06em;
}

.fu-vs-over-line {
  font-weight: 700;
  color: rgba(255, 244, 220, 0.92);
}

/* the colour of the seat: amber for the taxi, blue for the police */
.fu-vs-tone-taxi.fu-vs-over-role .fu-vs-over-big,
.fu-vs-tone-taxi.fu-vs-over-count .fu-vs-over-small,
.fu-vs-tone-taxi.fu-vs-over-swap .fu-vs-over-line:last-child {
  color: var(--fu-amber);
}

.fu-vs-tone-police.fu-vs-over-role .fu-vs-over-big,
.fu-vs-tone-police.fu-vs-over-count .fu-vs-over-small,
.fu-vs-tone-police.fu-vs-over-swap .fu-vs-over-line:last-child {
  color: #8FB4FF;
}

.fu-vs-over-count .fu-vs-over-big,
.fu-vs-over-go .fu-vs-over-big {
  font-size: 6.5em;
  line-height: 1;
  color: var(--fu-cream);
  -webkit-text-stroke: 0.035em var(--fu-ink);
  text-shadow: 0.05em 0.05em 0 rgba(27, 26, 34, 0.95), 0 0 0.35em rgba(27, 26, 34, 0.85);
}

.fu-vs-over-go .fu-vs-over-big {
  color: var(--fu-green);
}

.fu-vs-over-swap .fu-vs-over-big,
.fu-vs-over-end .fu-vs-over-big {
  color: var(--fu-cream);
}

@keyframes fu-vs-pop {
  from { opacity: 0.6; transform: scale(1.3); }
  to { opacity: 1; transform: none; }
}

@media (min-aspect-ratio: 6001/5000) and (max-height: 540px), (min-aspect-ratio: 6001/5000) and (max-width: 1100px) {
  .fu-scr {
    --cap: 20px;
  }

  .fu-panel {
    width: calc((var(--bw) - 2.4) * 1em);
    max-height: calc((var(--bh) - 1) * 1em);
    padding: 0.95em 1.2em 0.85em;
    gap: 0.5em 1.4em;
  }

  .fu-panel::before {
    left: 1.2em;
    right: 1.2em;
    height: 0.28em;
  }

  .fu-h {
    font-size: 1.6em;
  }

  .fu-panel .fu-btn,
  .fu-dialog .fu-btn {
    min-height: 2.6em;
  }

  /* garage */
  .fu-scr-garage {
    --bw: 44;
    --bh: 21;
  }

  .fu-garage {
    grid-template-columns: 1.14fr 1fr;
    gap: 0.4em 1.4em;
  }

  .fu-arrow {
    width: 2.2em;
    height: 3.6em;
  }

  .fu-g-show {
    gap: 0.4em;
  }

  .fu-g-id {
    grid-template-areas: "name pips" "tipo pips";
  }

  .fu-g-name {
    font-size: 1.4em;
  }

  .fu-g-tipo {
    font-size: 0.78em;
  }

  .fu-g-stats {
    gap: 0.34em;
  }

  .fu-stat {
    grid-template-columns: 6.6em 1fr;
    gap: 0.6em;
  }

  .fu-stat-l {
    font-size: 0.74em;
  }

  .fu-bar {
    height: 0.8em;
  }

  .fu-g-buy {
    grid-template-areas: "price action" "miss action";
    gap: 0.1em 0.8em;
  }

  .fu-g-buy.fu-owned {
    grid-template-areas: "action";
  }

  .fu-g-buy.fu-owned .fu-missing {
    display: none;
  }

  .fu-price {
    font-size: 1.3em;
    align-self: end;
  }

  .fu-missing {
    min-height: 0;
    font-size: 0.72em;
    align-self: start;
    white-space: nowrap;
  }

  .fu-missing:empty {
    display: none;
  }

  .fu-g-buy:not(.fu-short) .fu-price {
    grid-row: 1 / 3;
    align-self: center;
  }

  .fu-action {
    min-height: 2.6em;
    font-size: 1em;
  }

  .fu-g-paint {
    gap: 0.3em;
  }

  .fu-swatches {
    gap: 0.36em;
  }

  .fu-sw {
    height: 2.3em;
  }

  .fu-garage .fu-back {
    min-height: 2.6em;
  }

  /* settings: sliders and sound left, switches and quality right */
  .fu-scr-settings {
    --bw: 43;
    --bh: 24.4;
  }

  .fu-settings {
    width: calc((var(--bw) - 2.4) * 1em);
  }

  .fu-set-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.34em 0.8em;
  }

  .fu-row {
    min-height: 2.65em;
    padding: 0.15em 0.7em;
    gap: 0.6em;
  }

  .fu-row-l {
    font-size: 0.92em;
    line-height: 1.15;
  }

  .fu-row:nth-child(1) { grid-area: 1 / 1; }
  .fu-row:nth-child(2) { grid-area: 2 / 1; }
  .fu-row:nth-child(3) { grid-area: 3 / 1; }
  .fu-row:nth-child(4) { grid-area: 4 / 1; }
  .fu-row:nth-child(5) { grid-area: 5 / 1; }
  .fu-row:nth-child(6) { grid-area: 1 / 2; }
  .fu-row:nth-child(7) { grid-area: 2 / 2; }
  .fu-row:nth-child(8) { grid-area: 3 / 2; }
  .fu-row:nth-child(9) { grid-area: 4 / 2; }

  .fu-range {
    flex-basis: 8.4em;
    width: 8.4em;
  }

  .fu-row-v {
    flex-basis: 2em;
  }

  .fu-seg button {
    min-width: 2.7em;
    min-height: 2.05em;
    padding: 0 0.7em;
  }

  .fu-set-foot {
    margin-top: 0;
  }

  /* how to play: steps left, controls right */
  .fu-scr-howto {
    --bw: 47;
    --bh: 19.6;
  }

  .fu-howto {
    grid-template-columns: 1.5fr 1fr;
    grid-template-areas:
      "h      h"
      "steps  keys"
      "steps  back";
    grid-template-rows: auto 1fr auto;
  }

  .fu-steps {
    gap: 0.42em;
  }

  .fu-step {
    font-size: 0.92em;
    line-height: 1.26;
    gap: 0.7em;
  }

  .fu-keys {
    font-size: 0.84em;
    padding: 0.6em 0.6em;
    gap: 0.4em 0.4em;
    align-content: start;
  }

  .fu-howto .fu-back {
    justify-self: stretch;
  }

  /* records */
  .fu-scr-records {
    --bw: 46;
    --bh: 19.6;
  }

  .fu-records {
    grid-template-areas:
      "h     h"
      "list  retos"
      "list  back";
    grid-template-rows: auto 1fr auto;
  }

  .fu-list {
    gap: 0.22em;
  }

  .fu-list .fu-pair {
    min-height: 1.66em;
    padding: 0.08em 0.7em;
    font-size: 0.94em;
  }

  .fu-retos {
    padding: 0.5em 0.6em 0.6em;
    gap: 0.36em;
  }

  .fu-reto-list {
    gap: 0.3em;
  }

  .fu-reto {
    min-height: 2.3em;
    padding: 0.2em 0.6em;
    font-size: 0.86em;
  }

  .fu-records .fu-back {
    justify-self: stretch;
  }

  /* pause */
  .fu-scr-pause {
    --bw: 36;
    --bh: 18.6;
  }

  .fu-pause {
    width: 22em;
  }

  .fu-pause-btns {
    gap: 0.4em;
  }

  /* results */
  .fu-scr-results {
    --bw: 44;
    --bh: 21.4;
  }

  .fu-results {
    width: calc((var(--bw) - 2.4) * 1em);
  }

  .fu-res-title {
    font-size: 1.9em;
  }

  .fu-badge {
    font-size: 0.86em;
  }

  .fu-res-side {
    gap: 0.34em;
  }

  .fu-res-retos {
    gap: 0.24em;
  }

  .fu-res-reto {
    padding: 0.2em 0.6em;
    font-size: 0.8em;
    line-height: 1.22;
  }

  .fu-res-cash {
    padding: 0.16em 0.7em;
    font-size: 1.06em;
  }

  .fu-hint {
    font-size: 0.84em;
  }

  .fu-res-btns {
    gap: 0.6em;
    margin-top: 0;
  }

  .fu-panel .fu-big {
    min-height: 2.6em;
    font-size: 1.06em;
  }

  .fu-dialog {
    padding: 1em 1.2em;
  }

  .fu-dialog-btns {
    margin-top: 0.8em;
  }
}

/* ------------------------------------------------------------------ short menu (landscape phones)
   Brand on the left, buttons on the right. Taller windows keep the upright
   menu of the wide layout whatever their width. */
@media (min-aspect-ratio: 6001/5000) and (max-height: 540px) {
  .fu-scr-menu {
    --bw: 40;
    --bh: 20.4;
    justify-content: center;
    background:
      radial-gradient(90% 70% at 30% 110%, rgba(232, 100, 44, 0.40) 0%, rgba(232, 100, 44, 0) 64%),
      linear-gradient(90deg, rgba(27, 26, 34, 0.92) 0%, rgba(27, 26, 34, 0.84) 100%);
  }

  .fu-menu {
    width: 37em;
    margin-left: 0;
    grid-template-columns: 1.16fr 1fr;
    grid-template-areas: "brand btns" "foot btns";
    grid-template-rows: 1fr auto;
    gap: 0.6em 2em;
    align-items: center;
  }

  .fu-title {
    font-size: 3.9em;
  }

  .fu-city {
    font-size: 0.96em;
    margin-top: 0.3em;
  }

  .fu-brand .fu-pitch {
    margin-top: 0.5em;
    font-size: 0.9em;
    line-height: 1.36;
  }

  .fu-menu-btns {
    width: 100%;
    gap: 0.42em;
  }

  .fu-menu-btns .fu-btn {
    min-height: 2.6em;
  }

  .fu-menu-btns .fu-big {
    min-height: 2.75em;
    font-size: 1.08em;
  }

  .fu-menu-btns .fu-btn:focus,
  .fu-menu-btns .fu-btn.fu-hl {
    transform: none;
  }

  .fu-menu-btns .fu-btn:active {
    transform: translateY(0.12em);
  }

  .fu-foot {
    align-self: end;
  }
}

/* ------------------------------------------------------------------ portrait layout */
@media (max-aspect-ratio: 6/5) {
  .fu-scr {
    --bw: 24;
    --bh: 41;
    --cap: max(18px, calc(var(--fu-vh) * 1.7));
  }

  .fu-panel {
    width: calc((var(--bw) - 1.4) * 1em);
    max-height: calc((var(--bh) - 1) * 1em);
    padding: 1.15em 1em 1em;
    gap: 0.6em;
    grid-template-columns: 1fr;
  }

  .fu-panel::before {
    left: 1em;
    right: 1em;
    height: 0.3em;
  }

  .fu-h {
    font-size: 1.8em;
  }

  .fu-btn {
    min-height: 2.75em;
  }

  /* menu */
  .fu-scr-menu {
    --bw: 24;
    --bh: 44.4;
    justify-content: center;
    background:
      radial-gradient(130% 60% at 50% 112%, rgba(232, 100, 44, 0.46) 0%, rgba(232, 100, 44, 0) 66%),
      linear-gradient(180deg, rgba(27, 26, 34, 0.90) 0%, rgba(27, 26, 34, 0.80) 100%);
  }

  .fu-menu {
    width: 21em;
    margin-left: 0;
    gap: 1.1em;
    justify-items: center;
    text-align: center;
  }

  .fu-title {
    font-size: 4.6em;
  }

  .fu-city {
    justify-content: center;
  }

  .fu-city::after {
    content: "";
    flex: 0 1 2.2em;
    min-width: 0.7em;
    height: 0.16em;
    margin-left: 0.36em;
    background: var(--fu-orange);
  }

  .fu-brand .fu-pitch {
    max-width: none;
  }

  .fu-menu-btns {
    width: 100%;
  }

  .fu-menu-btns .fu-btn {
    justify-content: center;
    padding-left: 1.3em;
    min-height: 2.8em;
  }

  .fu-menu-btns .fu-btn:focus,
  .fu-menu-btns .fu-btn.fu-hl {
    transform: none;
  }

  .fu-menu-btns .fu-btn:active {
    transform: translateY(0.12em);
  }

  .fu-foot {
    justify-items: center;
  }

  /* garage */
  .fu-scr-garage {
    --bw: 24;
    --bh: 42.7;
  }

  .fu-garage {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "show" "id" "stats" "buy" "paint" "back";
    grid-template-rows: none;
    gap: 0.55em;
  }

  .fu-g-head .fu-wallet {
    font-size: 1em;
  }

  .fu-g-show {
    gap: 0.3em;
  }

  .fu-arrow {
    width: 2.2em;
    height: 4em;
  }

  .fu-g-name {
    font-size: 1.6em;
  }

  .fu-g-tipo {
    font-size: 0.82em;
  }

  .fu-stat {
    grid-template-columns: 7em 1fr;
  }

  .fu-g-stats {
    gap: 0.42em;
  }

  .fu-bar {
    height: 0.86em;
  }

  .fu-g-buy {
    grid-template-areas: "price action" "miss action";
    gap: 0 0.8em;
  }

  .fu-g-buy.fu-owned {
    grid-template-areas: "action";
  }

  .fu-g-buy.fu-owned .fu-missing {
    display: none;
  }

  .fu-g-buy:not(.fu-short) .fu-price {
    grid-row: 1 / 3;
    align-self: center;
  }

  .fu-price {
    font-size: 1.45em;
    align-self: end;
  }

  .fu-missing {
    min-height: 0;
    font-size: 0.8em;
    align-self: start;
    white-space: nowrap;
  }

  .fu-missing:empty {
    display: none;
  }

  .fu-action {
    min-height: 2.8em;
  }

  .fu-sw {
    height: 2.25em;
  }

  .fu-garage .fu-back {
    justify-self: stretch;
  }

  /* settings */
  .fu-scr-settings {
    --bw: 24;
    --bh: 45;
  }

  .fu-settings {
    width: calc((var(--bw) - 1.4) * 1em);
  }

  .fu-row {
    padding: 0.2em 0.6em;
    gap: 0.6em;
    min-height: 3em;
  }

  .fu-row-l {
    font-size: 0.95em;
    line-height: 1.2;
  }

  .fu-range {
    flex-basis: 8.6em;
    width: 8.6em;
  }

  .fu-row-v {
    flex-basis: 2em;
  }

  .fu-seg button {
    min-width: 2.8em;
    padding: 0 0.66em;
  }

  .fu-set-foot .fu-btn {
    padding-left: 0.8em;
    padding-right: 0.8em;
    letter-spacing: 0.05em;
  }

  .fu-set-foot .fu-back {
    min-width: 6.4em;
  }

  /* how to play */
  .fu-scr-howto {
    --bw: 24;
    --bh: 42.7;
  }

  .fu-steps {
    gap: 0.5em;
  }

  .fu-step {
    font-size: 0.94em;
    line-height: 1.28;
    gap: 0.7em;
  }

  .fu-keys {
    font-size: 0.78em;
    padding: 0.6em;
    gap: 0.36em 0.4em;
  }

  .fu-howto .fu-back {
    justify-self: stretch;
  }

  /* records */
  .fu-scr-records {
    --bw: 24;
    --bh: 41;
  }

  .fu-records {
    grid-template-columns: 1fr;
    grid-template-areas: "h" "list" "retos" "back";
  }

  .fu-list {
    gap: 0.26em;
  }

  .fu-list .fu-pair {
    min-height: 1.9em;
    padding: 0.14em 0.7em;
  }

  .fu-retos {
    padding: 0.7em 0.7em 0.8em;
    gap: 0.45em;
  }

  .fu-reto {
    min-height: 2.6em;
    padding: 0.3em 0.6em;
    font-size: 0.92em;
  }

  .fu-records .fu-back {
    justify-self: stretch;
  }

  /* pause */
  .fu-scr-pause {
    --bw: 24;
    --bh: 34;
  }

  .fu-pause {
    width: 20em;
    padding-top: 1.5em;
    padding-bottom: 1.4em;
    gap: 1em;
  }

  /* results: the tallest case is a record badge under the title plus three
     completed retos, each on two lines */
  .fu-scr-results {
    --bw: 24;
    --bh: 42.7;
  }

  .fu-results {
    width: calc((var(--bw) - 1.4) * 1em);
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "list" "side" "btns";
    gap: 0.5em;
  }

  .fu-res-top {
    justify-content: center;
    text-align: center;
    gap: 0.4em 1.2em;
  }

  .fu-res-title {
    font-size: 2.2em;
  }

  .fu-res-rows .fu-pair {
    min-height: 1.8em;
    padding-top: 0.1em;
    padding-bottom: 0.1em;
  }

  .fu-res-side {
    gap: 0.45em;
  }

  .fu-res-retos {
    gap: 0.3em;
  }

  .fu-res-reto {
    padding: 0.26em 0.7em;
    font-size: 0.88em;
    line-height: 1.24;
  }

  .fu-res-cash {
    padding-top: 0.25em;
    padding-bottom: 0.25em;
  }

  .fu-res-btns {
    grid-template-columns: 1fr 1fr;
  }

  .fu-res-btns .fu-big {
    grid-column: 1 / 3;
  }
}

/* a screen that has just been built shows its highlighted item at once */
.fu-new .fu-btn,
.fu-new .fu-arrow,
.fu-new .fu-sw,
.fu-new .fu-seg-cell {
  transition: none;
}

/* ------------------------------------------------------------------ run notice */
/* What a run left from the pause screen achieved: over the menu or over the
   new run, never in the way of the pointer. */
.fu-toast {
  position: absolute;
  left: 0;
  right: 0;
  top: max(10px, calc(var(--fu-vh) * 2));
  z-index: 60;
  box-sizing: border-box;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 94%;
  margin: 0 auto;
  padding: 0.55em 1em 0.6em;
  display: grid;
  gap: 0.2em;
  font-size: clamp(13px, calc(var(--fu-vh) * 2.5), 19px);
  line-height: 1.25;
  text-align: center;
  color: var(--fu-cream);
  background: rgba(27, 26, 34, 0.93);
  border-radius: 0.6em;
  box-shadow: inset 0 0 0 0.12em rgba(255, 200, 58, 0.8), 0 0.4em 1.2em rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: fu-toast 7s ease-out both;
}

.fu-toast b {
  color: var(--fu-amber);
  white-space: nowrap;
}

.fu-toast-rec .fu-toast-item {
  display: inline-block;
}

.fu-toast-head {
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--fu-amber);
}

.fu-toast-cash {
  font-size: 0.9em;
  opacity: 0.9;
}

/* Upright phones: the notice is as wide as the screen allows and can grow
   tall, so it is set smaller and each reto keeps to two lines. */
@media (max-aspect-ratio: 6/5) {
  .fu-toast {
    max-width: 96%;
    padding: 0.4em 0.7em 0.45em;
    gap: 0.1em;
    font-size: clamp(11px, calc(var(--fu-vh) * 1.75), 15px);
    line-height: 1.18;
  }

  .fu-toast-reto {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
}

@keyframes fu-toast {
  0% { opacity: 0; transform: translateY(-0.8em); }
  5% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .fu-toast,
  .fu-panel,
  .fu-menu,
  .fu-dialog,
  .fu-badge {
    animation: none;
  }

  .fu-btn,
  .fu-arrow,
  .fu-sw,
  .fu-seg-cell {
    transition: none;
  }
}
