/* ==========================================================================
   Pelican Island Ride - UI stylesheet
   "提鹅鹏 · 单车环岛"  cinematic minimal DOM/CSS interface.

   Design language: cream paper, ink, teal and poppy. Hairline rules, wide
   letter-spacing, tabular numerals, serif display type for Chinese and a
   quiet humanist sans for micro labels. No images, no web fonts, no network.
   Everything is driven by the classes that src/ui/hud.js and src/ui/menus.js
   toggle, e.g. `.is-on`, `.is-visible`, `.is-active`, `.is-photo`.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  --pi-paper: #f7f1e4;
  --pi-paper-soft: #efe6d2;
  --pi-paper-deep: #e3d7bf;
  --pi-ink: #22201c;
  --pi-ink-80: rgba(34, 32, 28, 0.8);
  --pi-ink-65: rgba(34, 32, 28, 0.65);
  /* Small-text ink: 9-11px labels need >= 4.5:1 on the cream glass, so they
     must not use --pi-ink-45 (measured ~2.7:1 - decorative use only). */
  --pi-ink-mute: rgba(34, 32, 28, 0.68);
  --pi-ink-45: rgba(34, 32, 28, 0.45);
  --pi-ink-25: rgba(34, 32, 28, 0.25);
  --pi-hair: rgba(34, 32, 28, 0.16);
  --pi-hair-strong: rgba(34, 32, 28, 0.32);
  --pi-teal: #1f6f78;
  --pi-teal-deep: #12464d;
  --pi-teal-pale: #a8cbc6;
  --pi-poppy: #e0523f;
  /* Poppy is 3.4:1 on cream - fine for shapes, too light for small text. */
  --pi-poppy-deep: #a93a2b;
  --pi-gold: #e8b64c;
  --pi-foam: #f2fbfb;
  --pi-glass: linear-gradient(180deg, rgba(247, 241, 228, 0.94), rgba(239, 230, 210, 0.9));
  --pi-shadow: 0 20px 44px -26px rgba(34, 32, 28, 0.6);
  --pi-shadow-soft: 0 10px 24px -18px rgba(34, 32, 28, 0.55);
  --pi-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, "SimSun", serif;
  --pi-sans: Optima, "Avenir Next", "Gill Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --pi-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --pi-r-hud: 46px;
  /* UI scale (settings) and notch/safe-area insets. */
  --pi-ui-scale: 1;
  --pi-safe-t: env(safe-area-inset-top, 0px);
  --pi-safe-r: env(safe-area-inset-right, 0px);
  --pi-safe-b: env(safe-area-inset-bottom, 0px);
  --pi-safe-l: env(safe-area-inset-left, 0px);
}

/* --------------------------------------------------------------------------
   1b. Page baseline - the canvas owns the viewport, nothing scrolls.

   Without this reset the browser default body margin (8px) pushed the
   engine-sized canvas past the viewport and produced both scrollbars on every
   screen size; the HUD (position: absolute) then anchored to the initial
   containing block instead of the viewport and drifted with the page.
   -------------------------------------------------------------------------- */

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070a12;
  overscroll-behavior: none;
}

body {
  /* Kills double-tap zoom but keeps pinch-zoom (WCAG 1.4.4 friendly). */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

#game-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#ui-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Screen-reader-only text (live regions, form hints). */
.pi-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   2. Shared primitives
   -------------------------------------------------------------------------- */

.pi-hud,
.pi-menus {
  font-family: var(--pi-sans);
  color: var(--pi-ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.pi-hud *,
.pi-menus * {
  box-sizing: border-box;
}

.pi-hud :focus-visible,
.pi-menus :focus-visible {
  outline: 2px solid var(--pi-teal);
  outline-offset: 2px;
}

/* One visible focus ring for every interactive control, keyboard or touch. */
.pi-menus button:focus-visible,
.pi-menus input:focus-visible,
.pi-hud button:focus-visible,
.pi-touch button:focus-visible,
.pi-touch [tabindex]:focus-visible {
  outline: 2px solid var(--pi-teal);
  outline-offset: 2px;
}

.pi-serif {
  font-family: var(--pi-serif);
  font-weight: 500;
}

.pi-micro {
  font-family: var(--pi-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
  white-space: nowrap;
}

.pi-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.pi-panel {
  background: var(--pi-glass);
  border: 1px solid var(--pi-hair);
  border-radius: 3px;
  box-shadow: var(--pi-shadow);
  -webkit-backdrop-filter: blur(7px) saturate(1.04);
  backdrop-filter: blur(7px) saturate(1.04);
}

.pi-rule {
  height: 0;
  border: 0;
  border-top: 1px solid var(--pi-hair);
  margin: 0;
}

/* --------------------------------------------------------------------------
   3. HUD root + layout scaffolding
   -------------------------------------------------------------------------- */

#pi-hud {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 40;
  opacity: 1;
  transition: opacity 420ms var(--pi-ease);
}

#pi-hud.is-paused {
  opacity: 0;
}

#pi-hud.is-booting {
  opacity: 0;
}

.pi-hud-corner {
  position: absolute;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.pi-hud-corner--tl {
  top: calc(var(--pi-r-hud) + var(--pi-safe-t));
  left: calc(var(--pi-r-hud) + var(--pi-safe-l));
  flex-direction: column;
  align-items: flex-start;
}

.pi-hud-corner--tr {
  top: calc(var(--pi-r-hud) + var(--pi-safe-t));
  right: calc(var(--pi-r-hud) + var(--pi-safe-r));
  flex-direction: column;
  align-items: flex-end;
}

.pi-hud-corner--br {
  right: calc(var(--pi-r-hud) + var(--pi-safe-r));
  bottom: calc(var(--pi-r-hud) - 8px + var(--pi-safe-b));
}

.pi-hud-corner--bl {
  left: calc(var(--pi-r-hud) + var(--pi-safe-l));
  bottom: calc(var(--pi-r-hud) - 4px + var(--pi-safe-b));
}

/* Ink-on-glass chip used by the feather counter, clock, camera mode, race. */
.pi-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 12px 6px;
  background: var(--pi-glass);
  border: 1px solid var(--pi-hair);
  border-radius: 2px;
  box-shadow: var(--pi-shadow-soft);
  -webkit-backdrop-filter: blur(7px) saturate(1.04);
  backdrop-filter: blur(7px) saturate(1.04);
  opacity: 0;
  transform: translateY(-6px);
  animation: pi-hud-in 460ms var(--pi-ease) 220ms forwards;
}

.pi-chip__label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
}

.pi-chip__value {
  font-family: var(--pi-serif);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--pi-ink);
  font-variant-numeric: tabular-nums;
}

.pi-chip__value--big {
  font-size: 19px;
}

.pi-chip--quiet {
  background: rgba(247, 241, 228, 0.6);
  box-shadow: none;
}

/* Feather glyph (inline SVG) -------------------------------------------------*/

.pi-feather {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.pi-feather__icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--pi-teal);
  transform: translateY(2px);
}

.pi-chip.is-pulse .pi-feather__icon {
  animation: pi-pulse 520ms var(--pi-ease);
}

.pi-chip.is-pulse .pi-chip__value {
  animation: pi-ink-flash 520ms var(--pi-ease);
}

/* --------------------------------------------------------------------------
   4. Compass strip (top center) + discovered counter
   -------------------------------------------------------------------------- */

.pi-compass {
  position: absolute;
  top: calc(var(--pi-r-hud) - 12px + var(--pi-safe-t));
  left: 50%;
  transform: translateX(-50%);
  width: min(52vw, 440px);
  min-width: 220px;
  padding: 5px 14px 7px;
  text-align: center;
  background: rgba(247, 241, 228, 0.74);
  border: 1px solid var(--pi-hair);
  border-radius: 3px;
  box-shadow: var(--pi-shadow-soft);
  -webkit-backdrop-filter: blur(7px) saturate(1.04);
  backdrop-filter: blur(7px) saturate(1.04);
  opacity: 0;
  /* fade only - an animated transform would cancel the centering translateX */
  animation: pi-fade-in 520ms var(--pi-ease) 140ms forwards;
}

.pi-compass__window {
  position: relative;
  height: 34px;
  overflow: hidden;
  border-top: 1px solid var(--pi-hair);
  border-bottom: 1px solid var(--pi-hair);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%);
}

.pi-compass__shift {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  will-change: transform;
  transform: translateX(-50%);
}

.pi-compass__strip {
  position: relative;
  height: 100%;
  width: 3240px;
}

.pi-ctick {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: var(--pi-ink-25);
}

.pi-ctick--minor {
  height: 6px;
}

.pi-ctick--mid {
  height: 10px;
  background: var(--pi-ink-45);
}

.pi-ctick--cardinal {
  height: 13px;
  background: var(--pi-ink-80);
}

.pi-ctick__label {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pi-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--pi-ink-65);
  white-space: nowrap;
}

.pi-ctick--cardinal .pi-ctick__label {
  font-family: var(--pi-serif);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--pi-ink);
}

.pi-compass__marker {
  position: absolute;
  top: -1px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--pi-poppy);
}

.pi-compass__readout {
  margin-top: 4px;
  font-family: var(--pi-serif);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--pi-ink-80);
  font-variant-numeric: tabular-nums;
}

.pi-compass__count {
  margin-top: 1px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
  font-variant-numeric: tabular-nums;
}

/* Photo mode is a clean viewfinder: the whole chrome steps aside. */
#pi-hud.is-photo .pi-compass,
#pi-hud.is-photo .pi-hud-corner,
#pi-hud.is-photo .pi-race,
#pi-hud.is-photo .pi-race-banner {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* A discovery letterbox takes the frame: the chrome steps back until it ends. */
#pi-hud.has-letterbox .pi-compass,
#pi-hud.has-letterbox .pi-hud-corner {
  opacity: 0;
  transition: opacity 420ms var(--pi-ease);
}

/* --------------------------------------------------------------------------
   5. Speedometer
   -------------------------------------------------------------------------- */

.pi-speedo {
  position: relative;
  width: 218px;
  height: 158px;
  opacity: 0;
  transform: translateY(10px);
  animation: pi-hud-in-up 520ms var(--pi-ease) 260ms forwards;
}

/* Cream backing so the dial stays readable over sea, dusk and night sky. */
.pi-speedo::before {
  content: "";
  position: absolute;
  inset: -10px -16px -8px;
  background: var(--pi-glass);
  border: 1px solid var(--pi-hair);
  border-radius: 3px;
  box-shadow: var(--pi-shadow-soft);
  -webkit-backdrop-filter: blur(7px) saturate(1.04);
  backdrop-filter: blur(7px) saturate(1.04);
}

.pi-speedo > * {
  position: relative;
  z-index: 1;
}

.pi-speedo__svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.pi-speedo__tick {
  stroke: var(--pi-ink-25);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.pi-speedo__tick--major {
  stroke: var(--pi-ink-80);
  stroke-width: 1.4;
}

.pi-speedo__label {
  fill: var(--pi-ink-mute);
  font-family: var(--pi-sans);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}

.pi-speedo__track {
  fill: none;
  stroke: rgba(34, 32, 28, 0.14);
  stroke-width: 1;
}

.pi-speedo__fill {
  fill: none;
  stroke: var(--pi-teal);
  stroke-width: 1.75;
  stroke-linecap: round;
  transition: stroke 420ms var(--pi-ease);
}

.pi-speedo__needle {
  stroke: var(--pi-ink);
  stroke-width: 1.9;
  stroke-linecap: round;
  transition: stroke 420ms var(--pi-ease);
}

.pi-speedo__needle-tail {
  stroke: var(--pi-ink-45);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.pi-speedo__hub {
  fill: var(--pi-paper);
  stroke: var(--pi-ink);
  stroke-width: 1.1;
}

.pi-speedo__digital {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -10%);
  text-align: center;
  pointer-events: none;
}

.pi-speedo__value {
  display: block;
  font-family: var(--pi-serif);
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--pi-ink);
  font-variant-numeric: tabular-nums;
  transition: color 420ms var(--pi-ease);
}

.pi-speedo__unit {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
}

.pi-speedo.is-fast .pi-speedo__fill {
  stroke: var(--pi-poppy);
}

.pi-speedo.is-fast .pi-speedo__needle {
  stroke: var(--pi-poppy);
}

.pi-speedo.is-fast .pi-speedo__value {
  color: var(--pi-poppy);
}

/* --------------------------------------------------------------------------
   6. Minimap
   -------------------------------------------------------------------------- */

.pi-minimap {
  width: 180px;
  opacity: 0;
  transform: translateX(10px) scale(0.98);
  transition: opacity 380ms var(--pi-ease), transform 380ms var(--pi-ease);
  pointer-events: none;
  visibility: hidden;
}

.pi-minimap.is-on {
  opacity: 1;
  transform: none;
  visibility: visible;
}

.pi-minimap__inner {
  padding: 9px 9px 8px;
}

.pi-minimap__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px 6px;
  border-bottom: 1px solid var(--pi-hair);
  margin-bottom: 7px;
}

.pi-minimap__title {
  font-family: var(--pi-serif);
  font-size: 12.5px;
  letter-spacing: 0.24em;
  color: var(--pi-ink);
}

.pi-minimap__count {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--pi-ink-mute);
  font-variant-numeric: tabular-nums;
}

.pi-minimap__canvas {
  display: block;
  width: 162px;
  height: 162px;
  border: 1px solid var(--pi-hair);
  background: var(--pi-paper-soft);
}

.pi-minimap__legend {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 2px 0;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
}

#pi-hud.is-photo .pi-minimap {
  opacity: 0;
  visibility: hidden;
}

/* --------------------------------------------------------------------------
   7. Race panel + finish banner
   -------------------------------------------------------------------------- */

.pi-race {
  width: 180px;
  padding: 10px 12px 9px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 380ms var(--pi-ease), transform 380ms var(--pi-ease);
  visibility: hidden;
}

.pi-race.is-on {
  opacity: 1;
  transform: none;
  visibility: visible;
}

.pi-race__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
}

.pi-race__row + .pi-race__row {
  border-top: 1px solid var(--pi-hair);
}

.pi-race__key {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
}

.pi-race__val {
  font-family: var(--pi-serif);
  font-size: 15px;
  color: var(--pi-ink);
  font-variant-numeric: tabular-nums;
}

.pi-race__val--time {
  font-size: 18px;
}

.pi-race-banner {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -14px);
  padding: 18px 34px 16px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 440ms var(--pi-ease), transform 440ms var(--pi-ease);
}

.pi-race-banner.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.pi-race-banner__title {
  font-family: var(--pi-serif);
  font-size: 30px;
  letter-spacing: 0.3em;
  margin: 0;
  padding-left: 0.3em;
}

.pi-race-banner__time {
  margin-top: 4px;
  font-family: var(--pi-serif);
  font-size: 26px;
  color: var(--pi-teal);
  font-variant-numeric: tabular-nums;
}

.pi-race-banner__record {
  position: relative;
  display: inline-block;
  margin-top: 8px;
  padding-top: 6px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--pi-poppy-deep);
  opacity: 0;
}

.pi-race-banner.is-record .pi-race-banner__record {
  opacity: 1;
  animation: pi-fade-in 500ms var(--pi-ease) 200ms both;
}

.pi-race-banner.is-record .pi-race-banner__record::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 100%;
  background: var(--pi-poppy);
  transform-origin: left center;
  animation: pi-sweep 900ms var(--pi-ease) 300ms both;
}

/* --------------------------------------------------------------------------
   8. Letterbox + discovery card
   -------------------------------------------------------------------------- */

.pi-letterbox {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.pi-letterbox__bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 11vh;
  min-height: 54px;
  background: var(--pi-ink);
  transition: transform 520ms var(--pi-ease);
}

.pi-letterbox__bar--top {
  top: 0;
  transform: translateY(-101%);
}

.pi-letterbox__bar--bottom {
  bottom: 0;
  transform: translateY(101%);
}

.pi-letterbox.is-on .pi-letterbox__bar--top,
.pi-letterbox.is-on .pi-letterbox__bar--bottom {
  transform: translateY(0);
}

.pi-discovery {
  position: absolute;
  top: 6.2vh;
  left: 50%;
  transform: translate(-50%, -12px);
  min-width: min(560px, 78vw);
  padding: 16px 30px 15px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 460ms var(--pi-ease), transform 460ms var(--pi-ease);
  z-index: 8;
}

.pi-discovery.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.pi-discovery__name {
  margin: 0;
  font-family: var(--pi-serif);
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 500;
  letter-spacing: 0.12em;
  padding-left: 0.12em;
  color: var(--pi-ink);
}

.pi-discovery__en {
  margin: 6px 0 0;
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--pi-teal);
}

.pi-discovery__sub {
  margin: 8px auto 0;
  padding-top: 8px;
  max-width: 46ch;
  border-top: 1px solid var(--pi-hair);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--pi-ink-65);
}

#pi-hud.is-photo .pi-discovery {
  opacity: 0;
  visibility: hidden;
}

/* --------------------------------------------------------------------------
   9. Toasts
   -------------------------------------------------------------------------- */

.pi-toasts {
  position: absolute;
  left: calc(var(--pi-r-hud) + var(--pi-safe-l));
  bottom: 92px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: min(320px, 42vw);
  z-index: 9;
}

.pi-toast {
  position: relative;
  padding: 10px 14px 10px 16px;
  background: var(--pi-glass);
  border: 1px solid var(--pi-hair);
  border-radius: 2px;
  box-shadow: var(--pi-shadow-soft);
  -webkit-backdrop-filter: blur(8px) saturate(1.04);
  backdrop-filter: blur(8px) saturate(1.04);
  animation: pi-toast-in 420ms var(--pi-ease) both;
}

.pi-toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--pi-teal);
}

.pi-toast.is-out {
  animation: pi-toast-out 400ms var(--pi-ease) both;
}

.pi-toast__title {
  font-family: var(--pi-serif);
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--pi-ink);
}

.pi-toast__sub {
  margin-top: 3px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--pi-ink-65);
}

/* --------------------------------------------------------------------------
   10. Photo mode overlay
   -------------------------------------------------------------------------- */

.pi-photo {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms var(--pi-ease);
  z-index: 7;
}

.pi-photo.is-on {
  opacity: 1;
  visibility: visible;
}

.pi-photo__brackets {
  position: absolute;
  inset: 5vh 5vw;
}

.pi-photo__bracket {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(247, 241, 228, 0.92);
  filter: drop-shadow(0 0 3px rgba(34, 32, 28, 0.55));
}

.pi-photo__bracket--tl {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
}

.pi-photo__bracket--tr {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
}

.pi-photo__bracket--bl {
  bottom: 0;
  left: 0;
  border-right: 0;
  border-top: 0;
}

.pi-photo__bracket--br {
  bottom: 0;
  right: 0;
  border-left: 0;
  border-top: 0;
}

.pi-photo__grid {
  position: absolute;
  inset: 5vh 5vw;
  opacity: 1;
  transition: opacity 260ms var(--pi-ease);
}

.pi-photo__grid.is-off {
  opacity: 0;
}

.pi-photo__gridline {
  position: absolute;
  background: rgba(247, 241, 228, 0.3);
  filter: drop-shadow(0 0 2px rgba(34, 32, 28, 0.4));
}

.pi-photo__gridline--v {
  top: 0;
  bottom: 0;
  width: 1px;
}

.pi-photo__gridline--h {
  left: 0;
  right: 0;
  height: 1px;
}

.pi-photo__readout {
  position: absolute;
  top: 6.4vh;
  left: 6vw;
  padding: 12px 18px 14px;
  color: var(--pi-paper);
  /* 0.72 keeps the 11px readout labels >= 4.5:1 even over blown-out water. */
  background: rgba(34, 32, 28, 0.72);
  border: 1px solid rgba(247, 241, 228, 0.32);
  border-radius: 3px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 6px rgba(34, 32, 28, 0.75);
}

.pi-photo__mode {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(247, 241, 228, 0.94);
}

.pi-photo__focal {
  margin-top: 6px;
  font-family: var(--pi-serif);
  font-size: 30px;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.pi-photo__focal small {
  font-size: 14px;
  letter-spacing: 0.16em;
  opacity: 0.7;
  margin-left: 4px;
}

.pi-photo__filter {
  margin-top: 2px;
  font-family: var(--pi-serif);
  font-size: 15px;
  letter-spacing: 0.16em;
}

.pi-photo__hint {
  position: absolute;
  left: 50%;
  bottom: 7.5vh;
  transform: translateX(-50%);
  padding: 9px 20px;
  border: 1px solid rgba(247, 241, 228, 0.42);
  border-radius: 99px;
  background: rgba(34, 32, 28, 0.66);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  color: var(--pi-paper);
  font-size: 12px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.pi-photo__chips {
  position: absolute;
  right: 6vw;
  bottom: 7.5vh;
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pi-photo__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(247, 241, 228, 0.42);
  border-radius: 99px;
  background: rgba(34, 32, 28, 0.66);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  color: var(--pi-paper);
  font-family: var(--pi-sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
}

.pi-photo__chip.is-on {
  background: rgba(247, 241, 228, 0.9);
  color: var(--pi-ink);
  border-color: rgba(247, 241, 228, 0.9);
}

/* --------------------------------------------------------------------------
   First-run tutorial strip (left HUD column)
   -------------------------------------------------------------------------- */

.pi-tutorial {
  display: none;
  align-items: center;
  gap: 8px;
  max-width: 252px;
  padding: 7px 12px;
  border: 1px solid rgba(242, 232, 213, 0.26);
  border-left: 3px solid #e8b64c;
  border-radius: 4px;
  background: rgba(18, 16, 13, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--pi-paper);
  font-family: var(--pi-sans);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.pi-tutorial.is-on {
  display: inline-flex;
  animation: pi-tutorial-in 420ms ease both;
}

.pi-tutorial__step {
  color: #e8b64c;
  letter-spacing: 0.12em;
}

@keyframes pi-tutorial-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pi-tutorial.is-on { animation: none; }
}

/* --------------------------------------------------------------------------
   11. Paused badge + damage flash
   -------------------------------------------------------------------------- */

.pi-paused {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 26px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--pi-ease);
  z-index: 10;
}

.pi-paused.is-on {
  opacity: 1;
  visibility: visible;
}

.pi-paused__title {
  font-family: var(--pi-serif);
  font-size: 22px;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
}

.pi-paused__sub {
  margin-top: 2px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
}

.pi-damage {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(120% 90% at 50% 50%, rgba(224, 82, 63, 0) 42%, rgba(224, 82, 63, 0.5) 100%),
    linear-gradient(0deg, rgba(224, 82, 63, 0.12), rgba(224, 82, 63, 0.12));
  z-index: 11;
}

.pi-damage.is-on {
  animation: pi-damage 420ms var(--pi-ease) both;
}

/* --------------------------------------------------------------------------
   12. Loading veils (HUD + menus)
   -------------------------------------------------------------------------- */

.pi-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(34, 32, 28, 0.94);
  color: var(--pi-paper);
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms var(--pi-ease);
  z-index: 12;
}

.pi-loading.is-on {
  opacity: 1;
  visibility: visible;
}

.pi-loading__brand {
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(247, 241, 228, 0.74);
}

.pi-loading__title {
  font-family: var(--pi-serif);
  font-size: clamp(22px, 2.6vw, 32px);
  letter-spacing: 0.28em;
  padding-left: 0.28em;
}

.pi-loading__bar {
  position: relative;
  width: min(420px, 62vw);
  height: 2px;
  background: rgba(247, 241, 228, 0.2);
  overflow: hidden;
}

.pi-loading__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--pi-gold);
  transition: width 260ms var(--pi-ease);
}

.pi-loading__meta {
  display: flex;
  justify-content: space-between;
  width: min(420px, 62vw);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(247, 241, 228, 0.8);
  font-variant-numeric: tabular-nums;
}

.pi-loading__tip {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(247, 241, 228, 0.84);
}

.pi-loading__tip.is-swap {
  animation: pi-tip 520ms var(--pi-ease) both;
}

/* --------------------------------------------------------------------------
   13. Menus root + screens
   -------------------------------------------------------------------------- */

#pi-menus {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 50;
}

.pi-screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}

.pi-screen.is-active {
  display: block;
  animation: pi-fade-in 380ms var(--pi-ease) both;
}

.pi-screen--pause,
.pi-screen--settings {
  background: rgba(34, 32, 28, 0.34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.pi-screen__inner {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw;
}

/* --------------------------------------------------------------------------
   14. Title screen
   -------------------------------------------------------------------------- */

.pi-screen--title {
  background: linear-gradient(
    180deg,
    #e9bd7c 0%,
    #f0cf9d 22%,
    #f4dcb4 40%,
    #cfd8c0 52%,
    #7faeae 58%,
    #1f6f78 66%,
    #12464d 100%
  );
}

.pi-title__sun {
  position: absolute;
  left: 63%;
  top: 19%;
  width: clamp(140px, 17vw, 300px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    #fff8e6 0%,
    #ffeec2 30%,
    rgba(255, 226, 168, 0.72) 52%,
    rgba(255, 214, 150, 0) 74%
  );
  animation: pi-sun 16s ease-in-out infinite;
}

.pi-title__sun::after {
  content: "";
  position: absolute;
  inset: -16%;
  border-radius: 50%;
  border: 1px solid rgba(34, 32, 28, 0.1);
}

.pi-title__glare {
  position: absolute;
  left: 0;
  right: 44%;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(247, 241, 228, 0.62), rgba(247, 241, 228, 0) 76%);
}

.pi-title__islands {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.pi-isle {
  position: absolute;
  left: -2%;
  right: -2%;
}

.pi-isle--far {
  bottom: 41.5%;
  height: 9vh;
  background: linear-gradient(180deg, rgba(18, 70, 77, 0.32), rgba(18, 70, 77, 0.46));
  clip-path: polygon(
    0% 100%, 0% 68%, 7% 58%, 14% 66%, 23% 44%, 31% 62%, 39% 52%, 47% 68%,
    56% 50%, 64% 64%, 72% 54%, 80% 66%, 89% 58%, 95% 67%, 100% 60%, 100% 100%
  );
}

.pi-isle--mid {
  bottom: 39%;
  height: 11vh;
  background: linear-gradient(180deg, rgba(18, 70, 77, 0.66), rgba(14, 58, 64, 0.8));
  clip-path: polygon(
    0% 100%, 0% 76%, 9% 64%, 18% 74%, 28% 48%, 36% 70%, 44% 58%, 53% 74%,
    61% 40%, 69% 72%, 78% 60%, 86% 74%, 94% 66%, 100% 74%, 100% 100%
  );
}

.pi-isle--near {
  bottom: 34.5%;
  height: 8vh;
  background: linear-gradient(180deg, rgba(15, 52, 57, 0.92), rgba(12, 42, 46, 1));
  clip-path: polygon(
    0% 100%, 0% 70%, 11% 62%, 21% 76%, 30% 66%, 41% 78%, 52% 68%, 63% 80%,
    74% 70%, 84% 80%, 93% 72%, 100% 82%, 100% 100%
  );
}

.pi-title__lighthouse {
  position: absolute;
  left: 60.6%;
  bottom: calc(39% + 6.4vh);
  width: 8px;
  height: 24px;
  background: #0c2a2e;
  clip-path: polygon(34% 0%, 66% 0%, 88% 100%, 12% 100%);
  animation: pi-fade-in 600ms var(--pi-ease) 240ms both;
}

.pi-title__lighthouse::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 10px;
  height: 5px;
  transform: translateX(-50%);
  background: var(--pi-gold);
  border-radius: 1px;
  animation: pi-lamp 5s ease-in-out infinite;
}

.pi-title__reflection {
  position: absolute;
  left: 58%;
  right: 11%;
  bottom: 0;
  height: 34%;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(255, 244, 220, 0.16) 0,
    rgba(255, 244, 220, 0.16) 1px,
    rgba(255, 244, 220, 0) 1px,
    rgba(255, 244, 220, 0) 9px
  );
  -webkit-mask-image: radial-gradient(60% 78% at 44% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(60% 78% at 44% 0%, #000 0%, transparent 72%);
}

.pi-title__horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 55.6%;
  border-top: 1px solid rgba(34, 32, 28, 0.22);
}

.pi-title__art {
  position: relative;
  width: min(34vw, 400px);
  color: rgba(247, 241, 228, 0.9);
  animation: pi-fade-in 900ms var(--pi-ease) 380ms both;
}

.pi-vignette {
  display: block;
  width: 100%;
  height: auto;
}

.pi-vignette path,
.pi-vignette circle,
.pi-vignette line,
.pi-vignette ellipse {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pi-vignette__wheel {
  stroke-dasharray: 3 7;
  animation: pi-wheel 2.4s linear infinite;
}

.pi-vignette__draw {
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: pi-draw 2.6s var(--pi-ease) 700ms forwards;
}

.pi-title__content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 4vw;
  width: 100%;
  min-height: 100%;
  padding: 8vh 7vw 12vh;
}

.pi-title__lockup {
  animation: pi-rise 700ms var(--pi-ease) 60ms both;
}

.pi-title__main {
  margin: 0;
  font-family: var(--pi-serif);
  font-weight: 600;
  font-size: clamp(64px, 12vw, 180px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--pi-ink);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.24);
}

.pi-title__sub {
  margin: 12px 0 0;
  font-family: var(--pi-serif);
  font-size: clamp(17px, 1.9vw, 26px);
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  color: var(--pi-ink);
}

.pi-title__en {
  margin: 14px 0 0;
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
}

.pi-title__rule {
  width: 74px;
  margin: 26px 0 22px;
  border-top: 1px solid var(--pi-ink-25);
}

.pi-title__buttons {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(330px, 100%);
  animation: pi-rise 700ms var(--pi-ease) 200ms both;
}

.pi-title__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  align-self: end;
  padding-bottom: 4vh;
  animation: pi-fade-in 900ms var(--pi-ease) 320ms both;
}

.pi-title__tagline {
  max-width: 26ch;
  text-align: right;
  font-family: var(--pi-serif);
  font-size: 13.5px;
  line-height: 1.9;
  letter-spacing: 0.14em;
  color: rgba(247, 241, 228, 0.92);
}

.pi-title__hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 24px 13px;
  text-align: center;
  background: rgba(12, 42, 46, 0.82);
  color: rgba(247, 241, 228, 0.86);
  font-size: 11px;
  letter-spacing: 0.18em;
  animation: pi-fade-in 800ms var(--pi-ease) 420ms both;
}

/* --------------------------------------------------------------------------
   15. Buttons
   -------------------------------------------------------------------------- */

.pi-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 11px 18px 10px;
  text-align: left;
  font-family: inherit;
  color: var(--pi-ink);
  background: rgba(247, 241, 228, 0.86);
  border: 1px solid var(--pi-hair-strong);
  border-radius: 2px;
  cursor: pointer;
  transition: background 260ms var(--pi-ease), border-color 260ms var(--pi-ease),
    transform 260ms var(--pi-ease), box-shadow 260ms var(--pi-ease);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.pi-btn:hover,
.pi-btn:focus-visible {
  background: #f3e3c4;
  border-color: rgba(34, 32, 28, 0.5);
  box-shadow: var(--pi-shadow-soft);
}

.pi-btn:active {
  transform: translateY(1px);
}

.pi-btn__zh {
  font-family: var(--pi-serif);
  font-size: 17px;
  letter-spacing: 0.16em;
}

.pi-btn__en {
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
}

.pi-btn--primary {
  background: var(--pi-ink);
  border-color: var(--pi-ink);
  color: var(--pi-paper);
}

.pi-btn--primary .pi-btn__en {
  color: rgba(247, 241, 228, 0.6);
}

.pi-btn--primary:hover,
.pi-btn--primary:focus-visible {
  background: #35322b;
  border-color: #35322b;
}

.pi-btn--ghost {
  background: transparent;
  border-color: var(--pi-hair);
}

.pi-btn--inline {
  width: auto;
  flex-direction: row;
  align-items: baseline;
  gap: 10px;
  padding: 8px 15px 7px;
}

.pi-btn--inline .pi-btn__zh {
  font-size: 14px;
  letter-spacing: 0.14em;
}

.pi-btn--danger .pi-btn__zh {
  color: var(--pi-poppy-deep);
}

/* Small toggle/pill group (quality, time, language) */

.pi-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pi-option {
  padding: 7px 13px 6px;
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--pi-ink-65);
  background: transparent;
  border: 1px solid var(--pi-hair);
  border-radius: 2px;
  cursor: pointer;
  transition: background 220ms var(--pi-ease), color 220ms var(--pi-ease),
    border-color 220ms var(--pi-ease);
}

.pi-option:hover {
  border-color: var(--pi-hair-strong);
  color: var(--pi-ink);
}

.pi-option.is-on {
  background: var(--pi-ink);
  border-color: var(--pi-ink);
  color: var(--pi-paper);
}

.pi-option--toggle {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 32px;
}

.pi-option__state {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}

.pi-option--toggle.is-on .pi-option__state {
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   17b. UI scale - one CSS variable the settings panel writes
   -------------------------------------------------------------------------- */

#pi-hud,
.pi-menus {
  font-size: calc(14px * var(--pi-ui-scale));
}

.pi-chip__value {
  font-size: calc(15px * var(--pi-ui-scale));
}

.pi-chip__value--big {
  font-size: calc(19px * var(--pi-ui-scale));
}

.pi-speedo__value {
  font-size: calc(40px * var(--pi-ui-scale));
}

.pi-btn {
  padding: calc(11px * var(--pi-ui-scale)) calc(18px * var(--pi-ui-scale)) calc(10px * var(--pi-ui-scale));
}

.pi-btn__zh {
  font-size: calc(17px * var(--pi-ui-scale));
}

.pi-card__title {
  font-size: calc(30px * var(--pi-ui-scale));
}

.pi-option {
  font-size: calc(12.5px * var(--pi-ui-scale));
}

.pi-settings__label {
  font-size: calc(12px * var(--pi-ui-scale));
}

.pi-discovery__name {
  font-size: calc(clamp(28px, 3.4vw, 42px) * var(--pi-ui-scale));
}

/* --------------------------------------------------------------------------
   16. Cards (pause / settings / help / about)
   -------------------------------------------------------------------------- */

.pi-card {
  width: min(560px, 100%);
  padding: 30px 34px 26px;
  background: var(--pi-glass);
  border: 1px solid var(--pi-hair);
  border-radius: 3px;
  box-shadow: var(--pi-shadow);
  -webkit-backdrop-filter: blur(9px) saturate(1.05);
  backdrop-filter: blur(9px) saturate(1.05);
  animation: pi-rise 420ms var(--pi-ease) both;
}

.pi-card--wide {
  width: min(820px, 100%);
  padding: 30px 34px 24px;
}

.pi-card__eyebrow {
  font-size: 9.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--pi-teal);
}

.pi-card__title {
  margin: 8px 0 0;
  font-family: var(--pi-serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.24em;
}

.pi-card__lead {
  margin: 10px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--pi-ink-65);
}

.pi-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
}

.pi-card__actions--row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.pi-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--pi-hair);
}

.pi-card__note {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--pi-ink-mute);
}

/* --------------------------------------------------------------------------
   17. Settings
   -------------------------------------------------------------------------- */

.pi-settings {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.pi-settings__section {
  display: grid;
  gap: 10px;
}

.pi-settings__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--pi-hair);
}

.pi-settings__zh {
  font-family: var(--pi-serif);
  font-size: 16px;
  letter-spacing: 0.2em;
}

.pi-settings__en {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--pi-ink-mute);
}

.pi-settings__row {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.pi-settings__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--pi-ink-80);
}

.pi-settings__control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pi-settings__control--split {
  justify-content: space-between;
}

.pi-settings__value {
  min-width: 46px;
  text-align: right;
  font-family: var(--pi-serif);
  font-size: 13px;
  color: var(--pi-ink);
  font-variant-numeric: tabular-nums;
}

.pi-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
}

.pi-range::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--pi-hair-strong);
  border-radius: 2px;
}

.pi-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--pi-paper);
  border: 1px solid var(--pi-ink);
  box-shadow: 0 1px 2px rgba(34, 32, 28, 0.25);
}

.pi-range::-moz-range-track {
  height: 2px;
  background: var(--pi-hair-strong);
}

.pi-range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--pi-paper);
  border: 1px solid var(--pi-ink);
}

.pi-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(31, 111, 120, 0.32);
}

/* --------------------------------------------------------------------------
   18. Help / about lists
   -------------------------------------------------------------------------- */

.pi-keys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 6px 26px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.pi-keys__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  border-bottom: 1px dotted var(--pi-hair-strong);
}

.pi-keys__k {
  flex: 0 0 auto;
  padding: 2px 7px 1px;
  font-family: var(--pi-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pi-ink);
  background: rgba(34, 32, 28, 0.06);
  border: 1px solid var(--pi-hair);
  border-radius: 2px;
}

.pi-keys__v {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-align: right;
  color: var(--pi-ink-65);
}

/* --------------------------------------------------------------------------
   19. Menus loading panel
   -------------------------------------------------------------------------- */

.pi-menu-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--pi-ink);
  color: var(--pi-paper);
  opacity: 0;
  visibility: hidden;
  transition: opacity 460ms var(--pi-ease);
  pointer-events: auto;
  z-index: 60;
}

.pi-menu-loading.is-on {
  opacity: 1;
  visibility: visible;
}

.pi-menu-loading__pelican {
  color: rgba(247, 241, 228, 0.72);
  width: 132px;
  height: auto;
}

.pi-menu-loading__title {
  font-family: var(--pi-serif);
  font-size: clamp(24px, 2.8vw, 36px);
  letter-spacing: 0.3em;
  padding-left: 0.3em;
}

.pi-menu-loading__bar {
  position: relative;
  width: min(460px, 64vw);
  height: 2px;
  background: rgba(247, 241, 228, 0.18);
  overflow: hidden;
}

.pi-menu-loading__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--pi-teal-pale), var(--pi-gold));
  transition: width 300ms var(--pi-ease);
}

.pi-menu-loading__label {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: rgba(247, 241, 228, 0.82);
}

.pi-menu-loading__tip {
  margin-top: 6px;
  font-family: var(--pi-serif);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(247, 241, 228, 0.8);
}

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .pi-title__content {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 26px;
    padding: 9vh 8vw 14vh;
  }

  .pi-title__right {
    align-items: flex-start;
    align-self: start;
    padding-bottom: 0;
  }

  /* The sea band is lighter up here on narrow screens - use a pull quote. */
  .pi-title__tagline {
    text-align: left;
    color: var(--pi-ink);
    background: rgba(247, 241, 228, 0.62);
    border-left: 2px solid var(--pi-teal);
    padding: 11px 16px;
    max-width: 34ch;
  }

  .pi-title__art {
    width: min(52vw, 340px);
    opacity: 0.85;
  }
}

@media (max-width: 820px) {
  :root {
    --pi-r-hud: 20px;
  }

  .pi-compass {
    top: 10px;
    width: min(78vw, 320px);
    padding: 4px 12px 6px;
  }

  .pi-compass__window {
    height: 28px;
  }

  /* shorter window needs the tick labels pulled down so they are not clipped */
  .pi-ctick__label {
    bottom: 12px;
    font-size: 9.5px;
  }

  .pi-ctick--cardinal .pi-ctick__label {
    font-size: 11px;
  }

  /* phones get one top row for the compass, then a second row of chrome */
  .pi-hud-corner--tl {
    top: 92px;
  }

  .pi-hud-corner--tr {
    top: 92px;
  }

  .pi-minimap {
    width: 140px;
  }

  .pi-minimap__canvas {
    width: 122px;
    height: 122px;
  }

  .pi-race {
    width: 140px;
  }

  /* keep the finish banner clear of the right-hand column on phones */
  .pi-race-banner {
    top: 52%;
  }

  .pi-speedo {
    width: 168px;
    height: 122px;
  }

  .pi-speedo__value {
    font-size: calc(30px * var(--pi-ui-scale));
  }

  /* Phones: the speedometer owns the bottom-right corner, so toasts move up
     into the empty band under the top-left chips instead of covering the
     dial (they used to overlap it by ~73x63 px in portrait). */
  .pi-toasts {
    top: 236px;
    bottom: auto;
    width: min(206px, 55vw);
  }

  .pi-title__buttons {
    width: min(100%, 340px);
  }

  .pi-title__art {
    display: none;
  }

  .pi-settings__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .pi-card,
  .pi-card--wide {
    padding: 24px 22px 20px;
  }

  .pi-photo__hint {
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 8px 14px;
    /* keep clear of the grid chip pinned to the right edge */
    left: 6vw;
    right: calc(6vw + 84px);
    transform: none;
    white-space: normal;
    text-align: center;
  }
}

/* Portrait phones (375x667 and friends). */
@media (max-width: 480px) {
  .pi-title__content {
    padding: 6vh 7vw 16vh;
    gap: 18px;
  }

  .pi-title__main {
    font-size: clamp(46px, 16vw, 74px);
  }

  .pi-title__lockup {
    padding-top: 2vh;
  }

  .pi-title__hint {
    font-size: 10.5px;
    padding: 10px 14px 11px;
  }

  .pi-card,
  .pi-card--wide {
    padding: 20px 18px 18px;
  }

  .pi-compass {
    width: min(86vw, 320px);
  }

  .pi-toasts {
    top: 236px;
    width: min(184px, 50vw);
  }

  /* Audio captions sit above the dial so the numbers stay readable. */
  .pi-caption {
    bottom: calc(var(--pi-r-hud) + 168px + var(--pi-safe-b));
    font-size: 11.5px;
    max-width: 78vw;
  }

  .pi-damage__label {
    top: 34%;
  }
}

/* Landscape phones / small tablets: the top-right column must not run off the
   bottom edge (it did by 29px at 667x375) and the dial is compacted. */
@media (orientation: landscape) and (max-height: 560px) {
  :root {
    --pi-r-hud: 14px;
  }

  .pi-compass {
    top: calc(6px + var(--pi-safe-t));
    width: min(52vw, 300px);
    padding: 3px 10px 5px;
  }

  .pi-compass__window {
    height: 24px;
  }

  .pi-ctick__label {
    bottom: 10px;
    font-size: 9px;
  }

  .pi-hud-corner--tl,
  .pi-hud-corner--tr {
    top: calc(46px + var(--pi-safe-t));
    gap: 6px;
  }

  .pi-chip {
    padding: 5px 9px 4px;
  }

  .pi-chip__value {
    font-size: calc(13px * var(--pi-ui-scale));
  }

  .pi-chip__value--big {
    font-size: calc(16px * var(--pi-ui-scale));
  }

  .pi-minimap {
    width: 116px;
  }

  .pi-minimap__canvas {
    width: 88px;
    height: 88px;
  }

  .pi-minimap__inner {
    padding: 6px 6px 5px;
  }

  .pi-minimap__legend {
    font-size: 9.5px;
  }

  /* One compact strip instead of three stacked rows: the vertical column ran
     into the speedometer at 667x375. */
  .pi-race {
    width: 168px;
    padding: 6px 9px 5px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 9px;
  }

  .pi-race__row {
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 0;
  }

  .pi-race__row + .pi-race__row {
    border-top: 0;
    border-left: 1px solid var(--pi-hair);
    padding-left: 9px;
  }

  .pi-race__key {
    font-size: 9px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .pi-race__val {
    font-size: 12.5px;
  }

  .pi-race__val {
    font-size: 13px;
  }

  .pi-race__val--time {
    font-size: 13px;
  }

  .pi-race-banner {
    top: 44%;
    padding: 12px 22px 11px;
  }

  .pi-race-banner__title {
    font-size: 22px;
  }

  .pi-race-banner__time {
    font-size: 19px;
  }

  .pi-speedo {
    width: 132px;
    height: 96px;
  }

  .pi-speedo__value {
    font-size: calc(24px * var(--pi-ui-scale));
  }

  .pi-speedo__unit {
    font-size: 9.5px;
    letter-spacing: 0.2em;
  }

  .pi-toasts {
    top: auto;
    bottom: calc(56px + var(--pi-safe-b));
    width: min(220px, 34vw);
  }

  .pi-caption {
    bottom: calc(var(--pi-r-hud) + 18px + var(--pi-safe-b));
    max-width: 46vw;
  }

  .pi-photo__hint {
    bottom: 5.5vh;
  }

  .pi-photo__chips {
    bottom: 5.5vh;
  }

  .pi-photo__chip {
    font-size: 10px;
  }

  .pi-photo__readout {
    top: 4.5vh;
    padding: 8px 12px 9px;
  }

  .pi-photo__focal {
    font-size: 22px;
  }

  .pi-screen__inner {
    padding: 4vh 5vw;
  }

  .pi-card {
    padding: 18px 20px 16px;
  }
}

@media (max-height: 620px) {
  .pi-toasts {
    bottom: calc(56px + var(--pi-safe-b));
  }

  .pi-title__main {
    font-size: clamp(52px, 10vw, 110px);
  }
}

/* While the on-screen pad is up the camera-mode chip is redundant: the pad
   owns a 视角 button that shows the active mode, and the bottom-left corner
   belongs to the joystick. Toasts move down to clear the extra TL chip. */
body.pi-has-touch .pi-hud-corner--bl {
  display: none;
}

body.pi-has-touch .pi-toasts {
  top: 236px;
  bottom: auto;
}

body.pi-has-touch .pi-caption {
  bottom: calc(var(--pi-r-hud) + 250px + var(--pi-safe-b));
}

@media (orientation: landscape) and (max-height: 560px) {
  body.pi-has-touch .pi-toasts {
    top: auto;
    bottom: calc(56px + var(--pi-safe-b));
  }

  body.pi-has-touch .pi-caption {
    bottom: calc(var(--pi-r-hud) + 150px + var(--pi-safe-b));
  }
}

/* --------------------------------------------------------------------------
   21. Motion
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   20b. Touch controls (created by src/ui/touch.js)
   -------------------------------------------------------------------------- */

.pi-touch {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: none;
  font-family: var(--pi-sans);
  color: var(--pi-paper);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: none;
}

.pi-touch.is-on {
  display: block;
}

.pi-touch.is-off {
  display: none;
}

/* Frozen world (pause / photo / title): dim and stop swallowing pointers so
   photo-mode drag-look keeps the whole frame. */
.pi-touch.is-idle {
  opacity: 0.24;
  transition: opacity 260ms var(--pi-ease);
}

.pi-touch.is-idle .pi-touch__zone,
.pi-touch.is-idle .pi-touch__pad,
.pi-touch.is-idle .pi-touch__actions {
  pointer-events: none;
}

/* Photo mode: drag-to-look needs the frame, so keep only the action column
   and tuck it into the top-right corner (the readout is top-left). */
.pi-touch.is-photo .pi-touch__zone,
.pi-touch.is-photo .pi-touch__pad,
.pi-touch.is-photo .pi-touch__hint {
  display: none;
}

.pi-touch.is-photo {
  opacity: 1;
}

.pi-touch.is-photo .pi-touch__actions {
  left: auto;
  right: calc(var(--pi-safe-r) + 10px);
  top: calc(var(--pi-safe-t) + 8px);
  bottom: auto;
}

.pi-touch__zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 52%;
  height: 78%;
  pointer-events: auto;
  touch-action: none;
}

.pi-touch__ring {
  position: absolute;
  width: 108px;
  height: 108px;
  margin: -54px 0 0 -54px;
  border-radius: 50%;
  border: 1px dashed rgba(247, 241, 228, 0.42);
  background: radial-gradient(circle at 50% 50%, rgba(12, 20, 28, 0.28) 0%, rgba(12, 20, 28, 0) 70%);
  opacity: 0;
  transition: opacity 160ms var(--pi-ease);
  pointer-events: none;
}

.pi-touch__ring.is-on {
  opacity: 1;
}

.pi-touch__stick {
  position: absolute;
  left: calc(var(--pi-safe-l) + 20px);
  bottom: calc(var(--pi-safe-b) + 20px);
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 1px solid rgba(247, 241, 228, 0.3);
  background: rgba(12, 20, 28, 0.3);
  box-shadow: inset 0 0 24px -10px rgba(247, 241, 228, 0.4);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0.75;
  transition: opacity 200ms var(--pi-ease);
  pointer-events: none;
}

.pi-touch__stick.is-active {
  opacity: 1;
}

.pi-touch__knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, rgba(247, 241, 228, 0.98), rgba(213, 198, 168, 0.85));
  border: 1px solid rgba(34, 32, 28, 0.38);
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.8);
  transition: transform 140ms var(--pi-ease);
}

.pi-touch__axis {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(247, 241, 228, 0.6);
}

.pi-touch__axis--l {
  left: 7px;
}

.pi-touch__axis--r {
  right: 7px;
}

.pi-touch__pad {
  position: absolute;
  right: calc(var(--pi-safe-r) + 16px);
  bottom: calc(var(--pi-r-hud) + 158px + var(--pi-safe-b));
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
}

.pi-touch__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid rgba(247, 241, 228, 0.36);
  background: rgba(12, 20, 28, 0.44);
  color: var(--pi-paper);
  font-family: inherit;
  cursor: pointer;
  touch-action: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform 120ms var(--pi-ease), background 120ms var(--pi-ease);
}

.pi-touch__btn--go {
  width: 104px;
  height: 104px;
  background: rgba(18, 70, 77, 0.62);
  border-color: rgba(247, 241, 228, 0.5);
}

.pi-touch__btn.is-down {
  transform: scale(0.94);
  background: rgba(169, 58, 43, 0.66);
}

.pi-touch__btn--go.is-down {
  background: rgba(31, 111, 120, 0.92);
}

.pi-touch__btn-zh {
  font-size: 17px;
  letter-spacing: 0.1em;
}

.pi-touch__btn-en {
  font-size: 10px;
  letter-spacing: 0.18em;
  opacity: 0.78;
}

.pi-touch__actions {
  position: absolute;
  left: calc(var(--pi-safe-l) + 10px);
  bottom: calc(var(--pi-safe-b) + 150px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

.pi-touch__act {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(247, 241, 228, 0.34);
  background: rgba(12, 20, 28, 0.42);
  color: var(--pi-paper);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform 120ms var(--pi-ease), background 120ms var(--pi-ease);
}

.pi-touch__act.is-down {
  transform: scale(0.92);
  background: rgba(31, 111, 120, 0.85);
}

.pi-touch__act-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 18px;
  padding: 1px 3px 0;
  border-radius: 9px;
  background: var(--pi-gold);
  color: #22201c;
  font-size: 9px;
  letter-spacing: 0;
}

.pi-touch__hint {
  position: absolute;
  left: calc(var(--pi-safe-l) + 10px);
  right: auto;
  bottom: calc(var(--pi-safe-b) + 168px);
  max-width: min(240px, 62vw);
  padding: 8px 12px;
  border-radius: 3px;
  background: rgba(12, 20, 28, 0.62);
  border: 1px solid rgba(247, 241, 228, 0.24);
  color: var(--pi-paper);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 320ms var(--pi-ease);
  pointer-events: none;
}

.pi-touch.is-hinting .pi-touch__hint {
  opacity: 1;
}

/* Portrait phones: 4 action buttons, pedal pad above the compact dial. */
@media (max-width: 480px) {
  .pi-touch__act {
    width: 40px;
    height: 40px;
    font-size: 10.5px;
  }

  .pi-touch__actions {
    bottom: calc(var(--pi-safe-b) + 160px);
  }

  .pi-touch__btn {
    width: 82px;
    height: 82px;
  }

  .pi-touch__btn--go {
    width: 96px;
    height: 96px;
  }

  .pi-touch__pad {
    bottom: calc(var(--pi-r-hud) + 130px + var(--pi-safe-b));
  }

  .pi-touch__act--more {
    display: none;
  }

  /* Keep the first-run hint clear of the brake pad and the joystick. */
  .pi-touch__hint {
    bottom: calc(var(--pi-safe-b) + 168px);
    max-width: 150px;
    font-size: 10.5px;
  }
}

/* Landscape phones: everything sits on the bottom band, actions on top. */
@media (orientation: landscape) and (max-height: 560px) {
  .pi-touch__stick {
    width: 112px;
    height: 112px;
    left: calc(var(--pi-safe-l) + 14px);
    bottom: calc(var(--pi-safe-b) + 12px);
  }

  .pi-touch__knob {
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
  }

  .pi-touch__btn {
    width: 74px;
    height: 74px;
  }

  .pi-touch__btn--go {
    width: 84px;
    height: 84px;
  }

  .pi-touch__btn-zh {
    font-size: 14px;
  }

  .pi-touch__pad {
    right: calc(var(--pi-safe-r) + 152px);
    bottom: calc(var(--pi-safe-b) + 10px);
  }

  .pi-touch__actions {
    left: 50%;
    right: auto;
    top: calc(var(--pi-safe-t) + 90px);
    bottom: auto;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 7px;
  }

  .pi-touch__act {
    width: 36px;
    height: 36px;
    font-size: 9.5px;
  }

  .pi-touch__hint {
    left: calc(var(--pi-safe-l) + 136px);
    bottom: calc(var(--pi-safe-b) + 12px);
    top: auto;
    max-width: 188px;
    font-size: 10px;
  }
}

/* --------------------------------------------------------------------------
   20c. Audio captions, HUD help chip, damage label
   -------------------------------------------------------------------------- */

.pi-caption {
  position: absolute;
  left: 50%;
  bottom: calc(var(--pi-r-hud) + 26px + var(--pi-safe-b));
  transform: translateX(-50%);
  max-width: 42vw;
  padding: 6px 14px 7px;
  border-radius: 99px;
  background: rgba(34, 32, 28, 0.68);
  border: 1px solid rgba(247, 241, 228, 0.3);
  color: var(--pi-paper);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: center;
  opacity: 0;
  transition: opacity 220ms var(--pi-ease);
  pointer-events: none;
  z-index: 9;
}

.pi-caption.is-on {
  opacity: 1;
}

.pi-chip--btn {
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  color: var(--pi-ink);
}

.pi-chip--btn:hover,
.pi-chip--btn:focus-visible {
  background: #f3e3c4;
}

.pi-damage__label {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  padding: 6px 16px 7px;
  border-radius: 3px;
  background: rgba(34, 32, 28, 0.7);
  border: 1px solid rgba(247, 241, 228, 0.36);
  color: var(--pi-paper);
  font-family: var(--pi-serif);
  font-size: 15px;
  letter-spacing: 0.22em;
  opacity: 0;
  pointer-events: none;
}

.pi-damage.is-on .pi-damage__label {
  animation: pi-fade-in 420ms var(--pi-ease) both;
  opacity: 1;
}

@keyframes pi-hud-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pi-hud-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pi-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pi-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pi-toast-in {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pi-toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-14px);
  }
}

@keyframes pi-tip {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pi-pulse {
  0% {
    transform: translateY(2px) scale(1);
  }
  45% {
    transform: translateY(0) scale(1.16);
  }
  100% {
    transform: translateY(2px) scale(1);
  }
}

@keyframes pi-ink-flash {
  0% {
    color: var(--pi-ink);
  }
  40% {
    color: var(--pi-teal);
  }
  100% {
    color: var(--pi-ink);
  }
}

@keyframes pi-damage {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes pi-sweep {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes pi-sun {
  0%,
  100% {
    opacity: 0.94;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes pi-lamp {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

@keyframes pi-wheel {
  to {
    stroke-dashoffset: -20;
  }
}

@keyframes pi-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #pi-hud *,
  .pi-menus * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
