/* The world app's page: a canvas that fills the window and, over it, the kit's controls (kit/ui.js). The colours are
   the tour prototype's, so a world and the map it replaces read as one product. */

:root {
  --surface: #ffffff;
  --ink: #22385a;
  --border-subtle: #c9d2de;
  --blue: #1d6fb8;
  --shadow-float: 0 4px 16px rgb(34 56 90 / 0.22);
  --gutter: clamp(12px, 2vw, 28px);
  /* What the notch, the rounded corners and the home bar cover (index.html asks for viewport-fit=cover). */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }

body {
  background: #a9c9e8;
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.45;
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* The canvas takes every drag, pinch and wheel itself (kit/input.js): the browser pans and zooms nothing. */
#world {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* The controls lie over the canvas and let through whatever does not land on one of them. */
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#ui button, #ui .stick { pointer-events: auto; }
#ui [hidden] { display: none; }

/* The chrome (kit/ui.js): every control, the labels, and what a pack builds of its own, in one element the size of
   the page. Clean View puts it away: nothing of it is seen, pressed or read out, but it keeps its boxes, so that
   what is measured in it meanwhile (a label, the row of the held actor's bar) is measured as it will be shown. */
.chrome {
  position: absolute;
  inset: 0;
}
#ui .chrome[hidden] {
  display: block;
  visibility: hidden;
}

/* A label that can be picked is a button too (kit/labels.js), and looks like its kind, not like a control. */
#ui button:where(:not(.label)) {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  box-shadow: var(--shadow-float);
  cursor: pointer;
  touch-action: manipulation;
}
#ui button:where(:not(.label)):hover { border-color: var(--ink); }

/* The status line, under the row of the places; and, in its place while the chrome is away, the line that says how
   to bring it back. */
.status, .problem, .clean-says {
  position: absolute;
  top: calc(72px + var(--safe-top));
  left: 50%;
  max-width: min(32rem, calc(100% - 2 * var(--gutter)));
  margin: 0;
  padding: 8px 16px;
  translate: -50% 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  text-align: center;
}
/* Something went wrong: under the status line, and marked off from it. */
.problem {
  top: calc(124px + var(--safe-top));
  border: 2px solid var(--signal);
}

/* The places: one row along the top, 64 px deep (a pack keeps its labels out from under it with their top margin),
   which scrolls sideways where the view is too narrow for it and stops short of the view's tools. */
.places {
  position: absolute;
  top: calc(12px + var(--safe-top));
  left: calc(var(--gutter) + var(--safe-left));
  display: flex;
  gap: 6px;
  max-width: calc(100% - 2 * var(--gutter) - var(--safe-left) - var(--safe-right) - 64px);
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.94);
  box-shadow: var(--shadow-float);
  pointer-events: auto;
}
#ui .places .place {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 0.86rem;
  white-space: nowrap;
}

/* The action chips: at the foot of the view on the right, wrapping into rows short of the scale bar at the foot on
   the left (its widest, 158 px, and a gap). */
.chips {
  position: absolute;
  right: calc(var(--gutter) + var(--safe-right));
  bottom: calc(var(--gutter) + var(--safe-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: calc(100% - 2 * var(--gutter) - 170px);
}
.chip-enter { border-color: var(--blue); }
.chip kbd {
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 400;
}
/* A touch-first device has no Enter key to hint at. */
@media (pointer: coarse) {
  .chip kbd { display: none; }
}
/* A touch-first device has the joystick at the foot of the view on the left: the chips wrap beside it, not over it.
   Slightly tighter horizontal padding keeps the action column below mid-screen pinch space while preserving 44 px touch targets. */
@media (pointer: coarse) {
  .chips { max-width: calc(100% - 2 * var(--gutter) - 150px); }
  #ui .chip { min-width: 44px; padding: 8px 10px; font-size: 0.88rem; }
}

/* The place labels (kit/labels.js): under every control, each a box moved by a transform. A label out of the
   picture keeps its box, so that it can be measured without being seen. */
.labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.label {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  line-height: 1.15;
  will-change: transform;
}
#ui .labels .label[hidden] {
  display: block;
  visibility: hidden;
}
/* A label the visitor can pick: a button with nothing of a button's look, for its kind's classes to dress. */
.label:where(button) {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
/* A label that stands for several: how many, on its corner. */
.label[data-count]::after {
  content: attr(data-count);
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
/* The line from a label that was moved clear to the point it names: drawn from that point, turned toward the box. */
.label-leader {
  position: absolute;
  top: 0;
  left: 0;
  height: 0;
  border-top: 1px solid var(--ink);
  transform-origin: 0 0;
}

/* The world's name is the page's heading for a reader of the page; the eye has the first of the places and the guide. */
.world-name {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The view's tools: the compass and, in the overview, zoom and quarter turns, with the guide's button below. */
.tools {
  position: absolute;
  top: calc(var(--gutter) + var(--safe-top));
  right: calc(var(--gutter) + var(--safe-right));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
#ui .tool {
  width: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
}
#ui .compass {
  width: 52px;
  height: 52px;
}
/* Out of the overview the compass only tells the bearing. */
#ui .compass:disabled {
  border-color: var(--border-subtle);
  cursor: default;
}
.compass svg {
  display: block;
  width: 40px;
  height: 40px;
  margin: auto;
}
.compass-needle { transform-origin: 24px 24px; }
.clean-tool svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
}
/* Clean View's one control (kit/ui.js): small and quiet, in the corner the compass has left, and plain to see once
   the pointer or the focus is on it. It is as big to press as any tool. */
#ui .clean-show {
  position: absolute;
  top: calc(var(--gutter) + var(--safe-top));
  right: calc(var(--gutter) + var(--safe-right));
  width: 44px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  opacity: 0.55;
}
#ui .clean-show:hover, #ui .clean-show:focus-visible { opacity: 1; }
.clean-show svg {
  display: block;
  width: 28px;
  height: 28px;
  margin: auto;
  padding: 6px;
  border-radius: 50%;
  background: rgb(34 56 90 / 0.5);
  color: #ffffff;
}

/* The guide: what this world is, the controls, the sources, and the switches a world has. An open guide lies under
   the row of the places and over whatever else is where it is. */
.guide {
  position: absolute;
  z-index: 1;
  top: calc(76px + var(--safe-top));
  right: calc(var(--gutter) + var(--safe-right) + 60px);
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100% - 2 * var(--gutter) - var(--safe-left) - var(--safe-right) - 60px));
  max-height: calc(100% - 76px - var(--gutter) - var(--safe-top) - var(--safe-bottom));
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
}
.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.guide h2 { margin: 0; font-size: 1rem; }
.guide h3 {
  margin: 14px 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.guide-body {
  padding: 12px 14px 14px;
  overflow-y: auto;
  font-size: 0.88rem;
}
.guide-body p { margin: 0 0 8px; }
.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#ui .toggle[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}
.guide-controls {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 4px 12px;
  margin: 0;
}
.guide-controls dt { font-weight: 700; }
.guide-controls dd { margin: 0; }
.guide-sources {
  margin: 0;
  padding-left: 18px;
}
.guide a { color: var(--blue); }

/* The scale bar, at the foot of the view on the left; over the joystick where there is one. */
.scale {
  position: absolute;
  left: calc(var(--gutter) + var(--safe-left));
  bottom: calc(var(--gutter) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.92);
}
.scale-label {
  font: 700 0.72rem/1 ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.scale-line {
  height: 6px;
  border: 2px solid var(--ink);
  border-top: 0;
}
@media (pointer: coarse) {
  .scale { bottom: calc(18px + 128px + 12px + var(--safe-bottom)); }
}

/* The bar of the held actor: a row of a pack's panel for it and the canonical actions. At the foot of the view, over
   the chips, however many rows they are (kit/ui.js keeps `--chips-height`; one row is 44 px), in the middle. */
.bar {
  position: absolute;
  right: calc(var(--gutter) + var(--safe-right));
  bottom: calc(var(--gutter) + var(--safe-bottom) + max(var(--chips-height, 44px), 44px) + 12px);
  left: calc(var(--gutter) + var(--safe-left));
  width: fit-content;
  max-width: 960px;
  margin-inline: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.96);
  box-shadow: var(--shadow-float);
  pointer-events: auto;
}
.bar-row, .bar-content, .bar-actions, .bar-rest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.bar-row {
  gap: 8px;
  padding: 6px 8px;
}
.bar-name {
  flex: 0 0 auto;
  padding-inline: 4px;
  font-size: 0.86rem;
  white-space: nowrap;
}
#ui .bar button {
  border-radius: 6px;
  box-shadow: none;
  font-size: 0.86rem;
}
#ui .bar-action[aria-keyshortcuts="Escape"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}
/* The bar's handle (kit/ui.js), at the end of its row, as big to press as any button: it stows the bar to a tab of
   its headline and the handle, where the bar stands, and opens it again. The chevron points the way the bar goes:
   down to stow a bar at the foot, up to open it. */
#ui .bar-stow {
  flex: 0 0 auto;
  width: 44px;
  padding: 0;
  border-color: transparent;
  background: none;
}
.bar-stow svg {
  display: block;
  width: 18px;
  height: 18px;
  margin: auto;
}
.bar-stow[aria-expanded="false"] svg { rotate: 180deg; }
/* The tab opens to a press anywhere on it. */
.bar-stowed .bar-row {
  flex-wrap: nowrap;
  cursor: pointer;
}

/* A bar all of which would be more than one row deep is one row (kit/ui.js measures it, and marks the bar): what the
   row has no room for is behind its "More" button, which opens it over the bar. Its buttons keep their size
   whatever the panel beside them comes to say: a panel that outgrows its room is cut short, not the row, until the
   bar is fitted again. */
.bar-one-row .bar-row, .bar-one-row .bar-row .bar-content, .bar-one-row .bar-row .bar-actions, .bar-one-row .bar-row .bar-content > * {
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.bar-one-row .bar-row { overflow: hidden; }
/* A panel all of whose parts are behind "More" leaves no gap in the row. */
.bar-content:empty { display: none; }
.bar-one-row .bar-row .bar-content {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
}
.bar-one-row .bar-row .bar-actions, .bar-one-row .bar-row .bar-content > *, #ui .bar-one-row .bar-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.bar-rest {
  position: absolute;
  /* Open, it lies over whatever else is where it opens. */
  z-index: 1;
  bottom: calc(100% + 6px);
  left: 50%;
  translate: -50% 0;
  width: max-content;
  max-width: min(680px, calc(100vw - 2 * var(--gutter) - var(--safe-left) - var(--safe-right)));
  max-height: calc(100vh - 2 * var(--gutter) - max(var(--chips-height, 44px), 44px) - 76px - var(--safe-top) - var(--safe-bottom));
  padding: 6px 8px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

/* A narrow or touch-first view keeps its foot for the joystick and the chips and its middle for the fingers: the
   places take the whole top row, the status line keeps clear of the tools beside it, the tools start under the
   places, and the held actor's bar is against the top (the places, which are the overview's, are away while it
   shows), with the status line under it and what is behind "More" opening under it. */
@media (max-width: 720px), (pointer: coarse) {
  .places { max-width: calc(100% - 2 * var(--gutter) - var(--safe-left) - var(--safe-right)); }
  .status, .problem, .clean-says { max-width: calc(100% - 2 * var(--gutter) - 120px); }
  .tools { top: calc(76px + var(--safe-top)); }
  .bar {
    top: calc(8px + var(--safe-top));
    right: auto;
    bottom: auto;
    max-width: calc(100% - 2 * var(--gutter) - var(--safe-left) - var(--safe-right));
    margin-inline: 0;
  }
  /* The row is short here: its own buttons are closer cut, and no smaller to press than 44 px. */
  #ui .bar-action, #ui .bar-more { padding-inline: 10px; }
  /* Against the top the bar goes up to stow, and comes down to open. */
  .bar-stow svg { rotate: 180deg; }
  .bar-stow[aria-expanded="false"] svg { rotate: none; }
  .bar-rest {
    top: calc(100% + 6px);
    bottom: auto;
    left: 0;
    translate: none;
    justify-content: flex-start;
    max-width: calc(100vw - 2 * var(--gutter) - var(--safe-left) - var(--safe-right));
    max-height: calc(100vh - 120px - var(--safe-top) - var(--safe-bottom));
  }
}

/* The joystick (tour-prototype/joystick.js): a ring at the foot of the view on the left whose knob follows the thumb
   and springs back. */
.sticks {
  position: absolute;
  left: calc(18px + var(--safe-left));
  bottom: calc(18px + var(--safe-bottom));
}
.stick {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border: 2px solid rgb(255 255 255 / 0.9);
  border-radius: 50%;
  background: rgb(34 56 90 / 0.28);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.25);
  touch-action: none;
  cursor: grab;
}
.stick-knob {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.35);
  transition: translate 160ms ease-out;
  pointer-events: none;
}
.stick.is-held { cursor: grabbing; }
.stick.is-held .stick-knob { transition: none; background: var(--blue); }

@media (prefers-reduced-motion: reduce) {
  .stick-knob { transition: none; }
}

/* The Jump button (kit/ui.js): on foot on a touch-first device, at the foot of the view on the right, over the
   chips, under the thumb the joystick leaves free. */
#ui .jump {
  position: absolute;
  right: calc(var(--gutter) + var(--safe-right));
  bottom: calc(var(--gutter) + var(--safe-bottom) + max(var(--chips-height, 96px), 96px) + 16px);
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 50%;
  touch-action: none;
}

/* Normal 1989's scoreboard console (packs/normal-1989/scoreboard.js): a dark panel above the action chips, in the
   colours of the stadium's own board. Every rule sits under the pack's class and outranks the kit's `#ui button`. */
#ui .normal-1989-scoreboard {
  position: absolute;
  right: calc(var(--gutter) + var(--safe-right));
  bottom: calc(var(--gutter) + var(--safe-bottom) + 56px);
  display: flex;
  flex-direction: column;
  width: min(344px, calc(100% - 2 * var(--gutter) - var(--safe-left) - var(--safe-right)));
  max-height: calc(100% - 2 * var(--gutter) - var(--safe-top) - var(--safe-bottom) - 56px);
  overflow: hidden;
  border: 1px solid rgb(255 210 102 / 0.28);
  border-radius: 12px;
  background: #161c24;
  color: #eef3f8;
  box-shadow: 0 14px 36px rgb(10 16 24 / 0.36);
  pointer-events: auto;
}
/* Where the held actor's bar is at the foot (a view neither narrow nor touch-first), the console stands over its row
   while it shows (58 px, and a gap): the bar is as wide as what it says, and would run under the console. On a
   short page its body then scrolls, short of the view's tools above it (out of the overview 156 px deep, and a gap). */
@media (not (max-width: 720px)) and (not (pointer: coarse)) {
  #ui:has(.bar:not([hidden])) .normal-1989-scoreboard {
    bottom: calc(var(--gutter) + var(--safe-bottom) + max(var(--chips-height, 44px), 44px) + 82px);
    max-height: calc(100% - 2 * var(--gutter) - var(--safe-top) - var(--safe-bottom) - max(var(--chips-height, 44px), 44px) - 82px - 164px);
  }
}
#ui .normal-1989-scoreboard[hidden] { display: none; }

#ui .normal-1989-scoreboard .sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
  background: #0f141b;
}
#ui .normal-1989-scoreboard h2 {
  margin: 0;
  color: #f4efe3;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#ui .normal-1989-scoreboard .sb-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
}

#ui .normal-1989-scoreboard .sb-display {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1.5px solid #354150;
  border-radius: 8px;
  background: #090c10;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
#ui .normal-1989-scoreboard .sb-team small {
  display: block;
  margin-bottom: 2px;
  color: #b7c4d4;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}
#ui .normal-1989-scoreboard .sb-team strong {
  color: #ffd15c;
  font-size: 1.45rem;
  text-shadow: 0 0 10px rgb(255 209 92 / 0.45);
}
#ui .normal-1989-scoreboard .sb-clock strong {
  display: block;
  color: #ff9c3b;
  font-size: 1.55rem;
  text-shadow: 0 0 10px rgb(255 156 59 / 0.5);
}
#ui .normal-1989-scoreboard .sb-clock small {
  display: block;
  margin-top: 2px;
  color: #9ab0c8;
  font-size: 0.65rem;
}

#ui .normal-1989-scoreboard .sb-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#ui .normal-1989-scoreboard .sb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
#ui .normal-1989-scoreboard .sb-row-label {
  min-width: 68px;
  color: #b4c2d4;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#ui .normal-1989-scoreboard .sb-btn-group {
  display: inline-flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

#ui .normal-1989-scoreboard button {
  min-width: 44px;
  padding: 0 9px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 6px;
  background: #232d3a;
  color: #eef3f8;
  box-shadow: none;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.76rem;
  white-space: nowrap;
}
#ui .normal-1989-scoreboard button:hover {
  border-color: rgb(255 209 92 / 0.5);
  background: #304154;
}
#ui .normal-1989-scoreboard .sb-btn-accent {
  border-color: #3d83c4;
  background: #1d5d96;
}
#ui .normal-1989-scoreboard .sb-btn-accent:hover { background: #2571b5; }
#ui .normal-1989-scoreboard :focus-visible { outline-color: #ffd15c; }

#ui .normal-1989-scoreboard .sb-buzzer {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1.5px solid #d44646;
  background: #6b1a1c;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: normal;
}
#ui .normal-1989-scoreboard .sb-buzzer:hover {
  border-color: #ff6b6b;
  background: #8c2023;
}
#ui .normal-1989-scoreboard .sb-buzzer[aria-pressed="true"] {
  border-color: #ffd15c;
  background: #d91e1e;
  animation: normal-1989-buzzer-pulse 0.7s ease-in-out infinite;
}
@keyframes normal-1989-buzzer-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(220 38 38 / 0.55); }
  50% { box-shadow: 0 0 0 6px rgb(220 38 38 / 0.08); }
}

#ui .normal-1989-scoreboard .sb-footer {
  display: flex;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid rgb(255 255 255 / 0.1);
}
#ui .normal-1989-scoreboard .sb-footer button { flex: 1 1 auto; }

@media (prefers-reduced-motion: reduce) {
  #ui .normal-1989-scoreboard .sb-buzzer[aria-pressed="true"] { animation: none; }
}

/* Normal 1989's place labels (packs/normal-1989/hud.js), as the original app drew them: a pill for the heroes and
   the landmarks, a tag for the rest, bare capitals for the streets. They are set in that app's faces, so each box
   is the size it was there and the same labels win their places. */
.normal-1989-label { font-family: 'Lato', 'Avenir Next', 'Helvetica Neue', system-ui, -apple-system, sans-serif; }
.normal-1989-label-hero {
  padding: 4px 10px;
  border: 1.5px solid #ffffff;
  border-radius: 999px;
  background: rgb(34 56 90 / 0.92);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.normal-1989-label-landmark {
  padding: 3px 8px;
  border: 1.5px solid #ffffff;
  border-radius: 999px;
  background: rgb(184 75 30 / 0.92);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
}
.normal-1989-label-athletic {
  padding: 2px 7px;
  border: 1px solid rgb(20 108 96 / 0.34);
  border-radius: 6px;
  background: rgb(255 255 255 / 0.9);
  color: #146c60;
  font-size: 0.72rem;
  font-weight: 700;
}
.normal-1989-label-campus {
  padding: 2px 7px;
  border: 1px solid rgb(34 56 90 / 0.22);
  border-radius: 6px;
  background: rgb(255 255 255 / 0.88);
  color: #22385a;
  font-size: 0.72rem;
  font-weight: 700;
}
.normal-1989-label-minor {
  padding: 2px 6px;
  border: 1px solid rgb(34 56 90 / 0.14);
  border-radius: 5px;
  background: rgb(255 255 255 / 0.8);
  color: #4a5f7a;
  font-size: 0.68rem;
  font-weight: 600;
}
.normal-1989-label-street {
  color: #22385a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow:
    -1.5px -1.5px 0 rgb(255 255 255 / 0.95),
    1.5px -1.5px 0 rgb(255 255 255 / 0.95),
    -1.5px 1.5px 0 rgb(255 255 255 / 0.95),
    1.5px 1.5px 0 rgb(255 255 255 / 0.95),
    0 0 4px rgb(255 255 255 / 0.95);
}

/* Normal 1989's panels in the held actor's bar: the Mazda's speed and where it is, and on foot the companion's
   badge, the place and the jumps. */
.normal-1989-speed {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--ink);
  color: #ffffff;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.normal-1989-speed strong {
  min-width: 24px;
  font-size: 1.15rem;
  line-height: 44px;
  text-align: right;
}
.normal-1989-speed span {
  color: #c9d9ec;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.normal-1989-zone, .normal-1989-companion {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #f6f8fb;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.normal-1989-companion {
  border-color: #146c60;
  background: #146c60;
  color: #ffffff;
  font-size: 0.78rem;
}
.normal-1989-jumps {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
#ui .normal-1989-jumps button {
  padding: 0 9px;
  font-size: 0.76rem;
}
@media (max-width: 720px), (pointer: coarse) {
  .normal-1989-companion { display: none; }
}

/* Normal 1989's part of the guide: the legend's swatches. */
.normal-1989-legend {
  margin: 0;
  padding: 0;
  list-style: none;
}
.normal-1989-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.normal-1989-legend i {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid rgb(34 56 90 / 0.2);
  border-radius: 3px;
}

/* Normal 1989's egg counter (packs/normal-1989/egg-play.js), in the original app's colours: a pill that is there once
   an egg has been thrown, with the button that clears them. At the foot of the view, beside the scale bar (its
   widest, 158 px, and a gap): in the strip the pack's labels keep out of (hud.js LABEL_MARGIN, 96 px), so that it
   lies over none of them, and under the held actor's bar; the chips wrap short of it while it shows. On a narrow or
   touch-first view it is at the foot on the left, over the scale bar. */
#ui .normal-1989-eggs {
  position: absolute;
  bottom: calc(var(--gutter) + var(--safe-bottom));
  left: calc(var(--gutter) + var(--safe-left) + 170px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  border: 1px solid rgb(184 115 12 / 0.38);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.94);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#ui .normal-1989-eggs[hidden] { display: none; }
#ui .normal-1989-eggs button {
  padding: 0 12px;
  border-color: rgb(184 115 12 / 0.34);
  border-radius: 999px;
  background: #fef3dc;
  color: #7c4906;
  box-shadow: none;
  font-size: 0.74rem;
}
#ui .normal-1989-eggs button:hover { background: #fde5b3; }
/* Not on a touch-first view: there the pill stands over the joystick, clear of the chips' rows. */
@media not all and (pointer: coarse) {
  #ui:has(.normal-1989-eggs:not([hidden])) .chips { max-width: calc(100% - 2 * var(--gutter) - 170px - 230px); }
}
@media (max-width: 720px), (pointer: coarse) {
  #ui .normal-1989-eggs {
    bottom: calc(var(--gutter) + var(--safe-bottom) + 46px);
    left: calc(var(--gutter) + var(--safe-left));
  }
}
@media (max-width: 720px) and (not (pointer: coarse)) {
  #ui:has(.normal-1989-eggs:not([hidden])) .chips { max-width: calc(100% - 2 * var(--gutter) - 230px); }
}
@media (pointer: coarse) {
  #ui .normal-1989-eggs { bottom: calc(18px + 128px + 12px + 46px + var(--safe-bottom)); }
}

/* Normal 1989's plowable snow readout (packs/normal-1989/snow.js): shown only while Snow Mode is active, in top-left
   clear of the places row, status pill, tools, and held actor bar; hidden automatically in Clean View (H). */
#ui .normal-1989-snow {
  position: absolute;
  top: calc(72px + var(--safe-top));
  left: calc(var(--gutter) + var(--safe-left));
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border: 1px solid rgb(56 109 168 / 0.34);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.92);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#ui .normal-1989-snow[hidden] { display: none; }
@media (max-width: 720px), (pointer: coarse) {
  #ui .normal-1989-snow {
    top: calc(108px + var(--safe-top));
    font-size: 0.72rem;
    padding: 5px 10px;
  }
}
