:root {
  color-scheme: dark;
  --ink: #f1f4e8;
  --muted: rgba(231, 239, 225, 0.64);
  --cyan: #93ffe3;
  --cyan-hot: #d7fff5;
  --amber: #ffc66f;
  --night: #071014;
  --panel: rgba(5, 15, 18, 0.7);
  --shadow-ring: 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--night);
}

body {
  min-height: 100dvh;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition-property: scale, background-color, box-shadow, color, opacity;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

button:active {
  scale: 0.96;
}

button:focus-visible {
  outline: 2px solid var(--cyan-hot);
  outline-offset: 4px;
}

#game-shell,
#world {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
}

#world canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.world-grade {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 51% 43%, transparent 36%, rgba(1, 6, 8, 0.22) 72%, rgba(1, 5, 7, 0.68) 118%),
    linear-gradient(180deg, rgba(39, 72, 78, 0.04), rgba(1, 7, 9, 0.18));
}

.hud,
.energy-panel,
.tutorial,
.pulse-button,
.field-note,
.screen {
  z-index: 3;
}

.hud {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  left: max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition-property: opacity, transform;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.objective-block {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(4, 17, 19, 0.82), rgba(5, 15, 18, 0.46));
  box-shadow: var(--shadow-ring), 0 16px 34px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
}

.eyebrow,
.kicker {
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  line-height: 1;
  text-transform: uppercase;
}

#objective-label {
  font-size: clamp(1.05rem, 2.3vw, 1.55rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1;
}

.meal-pips {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.meal-pips i {
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.17);
  box-shadow: 0 0 0 rgba(147, 255, 227, 0);
  transition-property: background-color, box-shadow, scale;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
}

.meal-pips i.is-filled {
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(147, 255, 227, 0.58);
  scale: 1.08 1;
}

.specimen-line {
  margin-top: 7px;
  color: rgba(189, 245, 168, 0.72);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.specimen-line b {
  color: rgba(202, 247, 164, 0.95);
  font-weight: 900;
}

.specimen-line.is-hidden {
  display: none;
}

.utility-rail {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.utility-button {
  position: relative;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(5, 15, 18, 0.65);
  box-shadow: var(--shadow-ring), 0 8px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  color: rgba(240, 245, 232, 0.78);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.utility-button:hover {
  color: var(--cyan-hot);
  background: rgba(9, 28, 30, 0.82);
  box-shadow: 0 0 0 1px rgba(147, 255, 227, 0.26), 0 10px 26px rgba(0, 0, 0, 0.24);
}

.sound-off {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  scale: 0.25;
  filter: blur(4px);
  color: var(--amber);
  transition-property: opacity, scale, filter;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.sound-on {
  display: block;
  opacity: 1;
  scale: 1;
  filter: blur(0);
  transition-property: opacity, scale, filter;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

#mute-button[aria-pressed="true"] .sound-off {
  opacity: 1;
  scale: 1;
  filter: blur(0);
}

#mute-button[aria-pressed="true"] .sound-on {
  opacity: 0;
  scale: 0.25;
  filter: blur(4px);
}

.energy-panel {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: max(22px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 74px 2.2rem;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 11px 13px;
  border-radius: 17px;
  background: rgba(5, 15, 18, 0.64);
  box-shadow: var(--shadow-ring), 0 12px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition-property: opacity, transform;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.energy-panel .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 5px;
}

.energy-track {
  width: 74px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.energy-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
  transform: scaleX(1);
  transform-origin: left;
  transition-property: transform, background-color;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
}

#energy-value {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tutorial {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 260px);
  padding: 11px 16px;
  border-radius: 14px;
  transform: translateX(-50%);
  background: rgba(5, 15, 18, 0.74);
  box-shadow: var(--shadow-ring), 0 12px 32px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: clamp(0.66rem, 1.5vw, 0.78rem);
  font-weight: 850;
  letter-spacing: 0.09em;
  text-align: center;
  pointer-events: none;
  transition-property: opacity, transform;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.tutorial.is-step {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 9px 9px 14px;
  box-shadow:
    0 0 0 1px rgba(147, 255, 227, 0.34),
    0 0 26px rgba(147, 255, 227, 0.14),
    0 12px 32px rgba(0, 0, 0, 0.3);
}

.tutorial-step {
  flex: none;
  color: var(--cyan);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.tutorial-skip {
  flex: none;
  min-width: 0;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 9px;
  background: rgba(147, 255, 227, 0.13);
  color: rgba(215, 255, 245, 0.82);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  pointer-events: auto;
}

.tutorial-skip:hover {
  background: rgba(147, 255, 227, 0.24);
  color: var(--cyan-hot);
}

.tutorial:not(.is-step) .tutorial-step,
.tutorial:not(.is-step) .tutorial-skip {
  display: none;
}

.tutorial.is-locked {
  animation: tutorial-shake 260ms ease-out;
  box-shadow:
    0 0 0 1px rgba(255, 198, 111, 0.7),
    0 0 30px rgba(255, 198, 111, 0.24),
    0 12px 32px rgba(0, 0, 0, 0.3);
}

@keyframes tutorial-shake {
  0%, 100% { transform: translateX(-50%); }
  30% { transform: translate(calc(-50% - 6px)); }
  70% { transform: translate(calc(-50% + 6px)); }
}

.pulse-button.is-tutorial-target {
  box-shadow:
    0 0 0 2px rgba(215, 255, 245, 0.95),
    0 0 0 9px rgba(147, 255, 227, 0.18),
    0 0 40px rgba(147, 255, 227, 0.42),
    0 18px 44px rgba(0, 0, 0, 0.34);
  animation: target-breathe 1.2s ease-in-out infinite;
}

@keyframes target-breathe {
  50% {
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 1),
      0 0 0 14px rgba(147, 255, 227, 0.1),
      0 0 60px rgba(147, 255, 227, 0.6),
      0 18px 44px rgba(0, 0, 0, 0.34);
  }
}

.roost-vignette {
  position: relative;
  display: grid;
  justify-items: center;
  margin-bottom: 14px;
}

.roost-vignette canvas {
  display: block;
  width: 252px;
  max-width: 62vw;
  height: auto;
}

/* A hollow ring, not a blob: the roost glow has to frame the pup, not shine
   through it. On an SDR screen this tone-maps to an ordinary soft halo. */
.roost-hdr {
  position: absolute;
  top: 44%;
  left: 50%;
  width: 208px;
  max-width: 54vw;
  transform: translate(-50%, -50%);
  opacity: 0.42;
  pointer-events: none;
  animation: roost-breathe 3.6s ease-in-out infinite;
}

@keyframes roost-breathe {
  50% { opacity: 0.74; transform: translate(-50%, -50%) scale(1.07); }
}

.pup-caption {
  margin-top: 2px;
  color: rgba(202, 247, 164, 0.78);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.perk-panel {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin: 0 0 26px;
  max-width: 620px;
}

.perk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.perk-button {
  display: grid;
  gap: 4px;
  padding: 11px 14px;
  max-width: 190px;
  border-radius: 14px;
  background: rgba(6, 24, 26, 0.8);
  box-shadow: var(--shadow-ring), 0 10px 26px rgba(0, 0, 0, 0.24);
  text-align: left;
}

.perk-button:hover {
  background: rgba(12, 40, 40, 0.92);
  box-shadow: 0 0 0 1px rgba(147, 255, 227, 0.42), 0 10px 26px rgba(0, 0, 0, 0.26);
}

.perk-button strong {
  color: var(--cyan-hot);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.perk-button span {
  color: rgba(240, 245, 232, 0.66);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

.perk-button b {
  color: rgba(202, 247, 164, 0.9);
  font-weight: 900;
}

.perk-hint {
  margin: 0 !important;
  max-width: 44ch !important;
  color: rgba(240, 245, 232, 0.58) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
}

.perk-panel.is-hidden {
  display: none;
}

.roost-vignette.is-hidden {
  display: none;
}

.field-note {
  position: fixed;
  top: clamp(92px, 14vh, 132px);
  left: 50%;
  max-width: min(520px, calc(100vw - 36px));
  padding: 10px 14px;
  border-radius: 14px;
  transform: translate(-50%, -12px);
  opacity: 0;
  background: rgba(6, 20, 22, 0.84);
  box-shadow: var(--shadow-ring), 0 14px 34px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  color: rgba(241, 244, 232, 0.9);
  font-size: clamp(0.72rem, 1.6vw, 0.86rem);
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-wrap: pretty;
  pointer-events: none;
  transition-property: opacity, transform;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.field-note::first-letter {
  color: var(--cyan);
}

.field-note.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pulse-button {
  --charge: 0;
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: grid;
  width: 104px;
  height: 104px;
  place-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 38%, rgba(34, 92, 83, 0.95), rgba(6, 23, 25, 0.96));
  box-shadow:
    0 0 0 1px rgba(147, 255, 227, 0.3),
    0 0 0 8px rgba(5, 15, 18, 0.44),
    0 18px 42px rgba(0, 0, 0, 0.32);
  color: var(--cyan-hot);
  isolation: isolate;
  touch-action: none;
  transition-property: scale, box-shadow, opacity, transform;
  transition-duration: 150ms, 150ms, 220ms, 220ms;
  transition-timing-function: ease-out;
}

.pulse-button:hover {
  box-shadow:
    0 0 0 1px rgba(215, 255, 245, 0.65),
    0 0 0 8px rgba(9, 32, 33, 0.5),
    0 18px 44px rgba(0, 0, 0, 0.36);
}

.pulse-button span,
.pulse-button strong {
  position: relative;
  z-index: 2;
  display: block;
  line-height: 1;
}

.pulse-button span {
  margin-bottom: 4px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.pulse-button strong {
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.pulse-charge {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform: translateY(calc(100% - (var(--charge) * 100%)));
  background: linear-gradient(180deg, rgba(147, 255, 227, 0.25), rgba(255, 198, 111, 0.72));
  opacity: calc(0.25 + var(--charge) * 0.75);
  transition-property: opacity;
  transition-duration: 80ms;
}

.pulse-button.is-charging {
  scale: 0.96;
  box-shadow:
    0 0 0 2px rgba(215, 255, 245, 0.86),
    0 0 30px rgba(147, 255, 227, 0.28),
    0 18px 44px rgba(0, 0, 0, 0.4);
}

.screen {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: end;
  padding: clamp(24px, 6vw, 78px);
  background: linear-gradient(90deg, rgba(2, 10, 12, 0.86) 0%, rgba(2, 10, 12, 0.38) 48%, rgba(2, 10, 12, 0.04) 78%);
  pointer-events: auto;
  opacity: 1;
  transition-property: opacity, transform;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.start-copy,
.result-copy {
  max-width: 760px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.start-copy h1,
.result-copy h2 {
  margin: 0.08em 0 0;
  max-width: 10ch;
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 950;
  letter-spacing: -0.085em;
  line-height: 0.82;
  text-wrap: balance;
  text-shadow: 0 10px 46px rgba(0, 0, 0, 0.42);
}

.tagline,
.result-copy p {
  margin: 20px 0 26px;
  max-width: 38ch;
  color: rgba(240, 245, 232, 0.76);
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 570;
  line-height: 1.35;
  text-wrap: pretty;
}

.primary-button {
  min-height: 58px;
  padding: 0 24px;
  border-radius: 18px;
  background: var(--cyan);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.24),
    0 10px 28px rgba(55, 218, 183, 0.2),
    0 20px 50px rgba(0, 0, 0, 0.28);
  color: #07221f;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.primary-button:hover {
  background: var(--cyan-hot);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.42),
    0 12px 34px rgba(96, 255, 222, 0.28),
    0 22px 54px rgba(0, 0, 0, 0.32);
}

.controls-line {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(0.68rem, 1.5vw, 0.82rem);
  font-weight: 720;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-wrap: pretty;
}

.audio-caption {
  position: absolute;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  margin: 0;
  max-width: 260px;
  color: rgba(231, 239, 225, 0.5);
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: right;
  text-wrap: pretty;
}

.result-screen,
.pause-screen,
.fallback-screen {
  align-items: center;
  justify-items: center;
  background: rgba(2, 9, 11, 0.72);
  backdrop-filter: blur(12px);
  text-align: center;
}

.result-screen {
  overflow-y: auto;
}

.result-screen .result-copy,
.pause-screen .result-copy,
.fallback-screen .result-copy {
  display: grid;
  justify-items: center;
}

.result-copy h2 {
  max-width: 12ch;
  font-size: clamp(3.5rem, 10vw, 8rem);
}

.is-hidden {
  opacity: 0 !important;
  transform: translateY(12px);
  pointer-events: none !important;
  visibility: hidden;
}

.screen.is-hidden {
  transform: translateY(-12px);
}

.stagger-one,
.stagger-two,
.stagger-three,
.stagger-four,
.stagger-five {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
  animation: enter-copy 420ms ease-out forwards;
}

.stagger-two { animation-delay: 90ms; }
.stagger-three { animation-delay: 180ms; }
.stagger-four { animation-delay: 270ms; }
.stagger-five { animation-delay: 360ms; }

@keyframes enter-copy {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (max-width: 720px) {
  .hud {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    left: max(10px, env(safe-area-inset-left));
  }

  .objective-block {
    padding: 10px 12px;
    border-radius: 16px;
  }

  .utility-rail {
    gap: 5px;
  }

  .utility-button {
    width: 44px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }

  .utility-button::after {
    color: rgba(240, 245, 232, 0.82);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0;
  }

  #mute-button::after { content: "M"; }
  #fullscreen-button::after { content: "F"; }
  #pause-button::after { content: "II"; }

  #mute-button .sound-on,
  #mute-button .sound-off {
    display: none;
  }

  .energy-panel {
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
  }

  .pulse-button {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 92px;
    height: 92px;
  }

  .tutorial {
    bottom: 118px;
    max-width: calc(100vw - 28px);
  }

  .tutorial.is-step {
    padding: 8px 8px 8px 11px;
    gap: 7px;
  }

  .perk-button {
    max-width: none;
    width: 100%;
    padding: 9px 12px;
  }

  .roost-vignette canvas {
    width: 190px;
  }

  .screen {
    padding: 24px;
    background: linear-gradient(0deg, rgba(2, 10, 12, 0.9) 0%, rgba(2, 10, 12, 0.35) 62%, rgba(2, 10, 12, 0.08) 100%);
  }

  .start-copy h1 {
    font-size: clamp(3.65rem, 18vw, 6.2rem);
  }

  .controls-line {
    font-size: 0.64rem;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .audio-caption {
    display: none;
  }
}

@media (max-width: 340px) {
  .controls-line {
    font-size: 0.58rem;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .roost-vignette canvas {
    width: 148px;
  }

  .roost-vignette {
    margin-bottom: 8px;
  }

  .result-copy h2 {
    font-size: clamp(2.2rem, 9vh, 3.6rem);
  }

  .perk-panel {
    gap: 6px;
    margin-bottom: 16px;
  }

  .perk-button {
    padding: 8px 11px;
  }

  .screen {
    padding: 18px 24px;
  }

  .start-copy h1 {
    font-size: clamp(3.2rem, 15vh, 5rem);
  }

  .tagline {
    margin: 10px 0 14px;
  }

  .controls-line {
    margin-top: 10px;
  }

  .primary-button {
    min-height: 48px;
  }

  .audio-caption {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------- map screen */
/* The night starts on a real map. Everything about this panel is built to keep the
   distinction visible: measured ground on the left, what is measured and what is
   invented spelled out on the right. */

.map-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.2vh, 26px);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(20, 52, 56, 0.55), transparent 62%),
    #050e11;
  overflow: auto;
}

.map-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 380px);
  gap: clamp(14px, 2.4vw, 30px);
  align-items: center;
  width: min(1180px, 100%);
  max-height: 100%;
}

.map-stage {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  max-height: min(84vh, 780px);
  margin-inline: auto;
}

#map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  box-shadow: var(--shadow-ring), 0 26px 70px rgba(0, 0, 0, 0.5);
  cursor: crosshair;
  touch-action: manipulation;
}

.map-north {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.map-scalebar {
  position: absolute;
  bottom: 14px;
  left: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.map-scalebar i {
  display: block;
  width: calc(100% / 11);
  min-width: 34px;
  height: 4px;
  border-radius: 2px;
  background: rgba(241, 244, 232, 0.85);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.map-scalebar span,
.map-hint {
  color: rgba(241, 244, 232, 0.72);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.map-hint {
  position: absolute;
  right: 16px;
  bottom: 14px;
  max-width: 62%;
  margin: 0;
  text-align: right;
  pointer-events: none;
}

.map-side {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  max-height: min(84vh, 780px);
  padding: clamp(14px, 2vw, 22px);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(6, 22, 25, 0.94), rgba(5, 15, 18, 0.7));
  box-shadow: var(--shadow-ring), 0 22px 56px rgba(0, 0, 0, 0.4);
  overflow: auto;
}

.map-side h2 {
  margin: 2px 0 0;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  font-weight: 950;
  letter-spacing: 0.03em;
}

.map-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.map-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.map-layers button {
  min-width: 0;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 11px;
  background: rgba(147, 255, 227, 0.08);
  box-shadow: inset 0 0 0 1px rgba(147, 255, 227, 0.22);
  color: rgba(241, 244, 232, 0.78);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.map-layers button[aria-pressed='true'] {
  background: var(--cyan);
  box-shadow: none;
  color: #07221f;
}

.map-readout {
  display: grid;
  gap: 6px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  font-size: 0.73rem;
  line-height: 1.5;
}

.map-readout .rk {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  color: var(--muted);
}

.map-readout .rk b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.map-verdict {
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.map-verdict.good { color: var(--cyan); }
.map-verdict.fair { color: #cfe9a8; }
.map-verdict.thin { color: var(--amber); }
.map-verdict.bad { color: #ff9d8a; }

.map-brief {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  color: rgba(241, 244, 232, 0.8);
  font-size: 0.73rem;
  line-height: 1.45;
  list-style: none;
}

.map-brief li::before {
  margin-right: 7px;
  color: var(--cyan);
  content: '\2022';
}

#map-confirm:disabled {
  background: rgba(147, 255, 227, 0.14);
  box-shadow: inset 0 0 0 1px rgba(147, 255, 227, 0.2);
  color: rgba(241, 244, 232, 0.5);
  cursor: default;
}

.map-prov-toggle {
  justify-self: start;
  min-height: 30px;
  padding: 0;
  background: none;
  color: var(--cyan);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.map-prov {
  color: rgba(241, 244, 232, 0.7);
  font-size: 0.68rem;
  line-height: 1.55;
}

.map-prov p { margin: 0 0 7px; }
.map-prov b { color: var(--cyan); }

/* the terrain is measured, the wood on it is not - so the label never leaves screen */
.gen-tag {
  position: fixed;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 2;
  max-width: min(92vw, 720px);
  margin: 0;
  color: rgba(241, 244, 232, 0.42);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.4;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%);
}

.cell-read {
  display: grid;
  gap: 7px;
  margin: 4px 0 2px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  text-align: left;
}

.cell-read-verdict {
  margin: 0;
  color: var(--cyan-hot);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.cell-read-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1.48;
  list-style: none;
}

.cell-read-list b {
  margin-right: 7px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.cell-read-list .good b { color: var(--cyan); }
.cell-read-list .bad b { color: var(--amber); }
.cell-read-list span { color: rgba(241, 244, 232, 0.78); }

@media (max-width: 880px), (max-height: 620px) {
  .map-grid {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .map-stage {
    max-height: 54vh;
    width: min(100%, 54vh);
  }

  .map-side {
    max-height: none;
  }

  .map-hint { display: none; }
}
