:root {
  --ink: #f6f3ea;
  --ink-muted: rgba(246, 243, 234, 0.62);
  --line: rgba(246, 243, 234, 0.22);
  --surface: #2f4630;
  --scrim: rgba(14, 20, 16, 0.5);
  --gold: #f2c94c;
  --leaf: #a9c77a;
  --season-spring: var(--leaf);
  --season-summer: #e7c45a;
  --season-autumn: #d1813e;
  --season-winter: #c9d8e6;
  --hawk: #e5573f;
  --energy-caution: #e0a33f;
  --energy-safe: #8fc7d8;
  --count-safe: #cde6b2;
  --count-danger: #ffb3a6;
  --ink-on-light: #1b231d;
  --hud-glow: 0 1px 12px rgba(10, 16, 12, 0.45);
  --text-glow-soft: 0 2px 24px rgba(10, 16, 12, 0.5);
  --text-glow-tight: 0 1px 3px rgba(10, 16, 12, 0.85);
  --icon-shadow: 0 1px 6px rgba(10, 16, 12, 0.4);
  --space-2: 2px;
  --space-4: 4px;
  --space-5: 5px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-14: 14px;
  --space-18: 18px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --radius-hairline: 1px;
  --radius-bar: 2px;
  --radius-pill: 999px;
  --radius-circle: 50%;
  color-scheme: dark;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--surface);
}
body {
  margin: 0;
  font-family:
    'Bricolage Grotesque',
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
/* the system cursor can't be faded, so it simply goes away after a few idle seconds */
#game.cursor-idle {
  cursor: none;
}
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(env(safe-area-inset-top, 0px) + var(--space-18)) var(--space-20) 0;
  pointer-events: none;
  text-shadow: var(--hud-glow);
  z-index: 2; /* above the overlays, though it's hidden while any overlay is up (see .no-hud below) */
}
/* menu, pause and win/game-over screens are meant to read as clean and atmospheric, not gameplay HUD */
body.no-hud .hud {
  display: none;
}
.hud::before {
  /* a faint shade behind the corners keeps the HUD readable over snow and bright sky */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 130px;
  background:
    radial-gradient(ellipse 300px 130px at 0 0, rgba(14, 20, 16, 0.55), transparent 72%),
    radial-gradient(ellipse 320px 110px at 100% 0, rgba(14, 20, 16, 0.24), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
.tl {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 168px;
}
.countrow {
  display: flex;
  align-items: baseline;
  gap: var(--space-8);
}
.count-label,
.yearname,
.aim {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--ink);
  text-shadow:
    var(--text-glow-tight),
    0 0 6px rgba(10, 16, 12, 0.7);
}
/* the next small aim, and a quiet moment when one is reached; settles back to the next aim */
.aim {
  min-height: 13px;
  white-space: nowrap;
  opacity: 0.85;
  transition:
    opacity 0.9s,
    color 0.9s;
}
.aim.got {
  opacity: 1;
  color: var(--gold);
}
/* the season label hangs under the bar without taking part in the row, so the sound and pause buttons stay level with the bar */
.yearname {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-6);
  text-align: right;
  opacity: 0.85;
  white-space: nowrap;
}
.count {
  font-weight: 300;
  font-size: 46px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  transition:
    transform 0.18s,
    color 0.3s;
}
.count.pop {
  transform: scale(1.12);
  transform-origin: left center;
}
.count.safe {
  color: var(--count-safe);
}
.count.hungry {
  color: var(--energy-caution);
}
.count.starving {
  color: var(--hawk);
  animation: pulse 0.9s infinite alternate;
}
.count.danger {
  color: var(--count-danger);
  animation: pulse 0.6s infinite alternate;
}
@keyframes pulse {
  to {
    opacity: 0.55;
  }
}
.lines {
  display: grid;
  gap: var(--space-5);
}
.meter {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.meter-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--ink);
  filter: drop-shadow(0 0 2px rgba(10, 16, 12, 0.7));
}
.meter-label {
  flex: 0 0 62px;
  white-space: nowrap;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--ink);
  text-shadow:
    var(--text-glow-tight),
    0 0 6px rgba(10, 16, 12, 0.7);
}
/* a dark track with a hairline edge, so the bar reads on snow as well as in the dark */
.line {
  flex: 1;
  min-width: 0;
  height: 5px;
  border-radius: var(--radius-bar);
  background: rgba(14, 20, 16, 0.5);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(246, 243, 234, 0.3),
    0 0 0 2px rgba(14, 20, 16, 0.25);
}
.line > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition:
    width 0.3s,
    background 0.3s;
}
.line.gold > i {
  background: var(--gold);
}
.line.leaf > i {
  background: var(--leaf);
  transition: none;
}
.tr {
  display: flex;
  align-items: center;
  gap: var(--space-14);
}
.year {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
  row-gap: var(--space-6);
  width: 120px;
  position: relative;
}
.year span {
  font-size: 13px;
  width: 14px;
  text-align: center;
  color: var(--ink);
}
.yearbar {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  height: 2px;
}
.yearbar i {
  display: block;
  border-radius: var(--radius-bar);
  opacity: 0.8;
}
.yearbar i:nth-child(1) {
  background: var(--season-spring);
}
.yearbar i:nth-child(2) {
  background: var(--season-summer);
}
.yearbar i:nth-child(3) {
  background: var(--season-autumn);
}
.yearbar i:nth-child(4) {
  background: var(--season-winter);
}
.yearbar b {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 10px;
  border-radius: var(--radius-hairline);
  background: var(--ink);
  transform: translateX(-1px);
  transition: left 0.3s linear;
}
.ib {
  pointer-events: auto;
  background: none;
  border: 0;
  color: var(--ink);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.8;
  filter: drop-shadow(var(--icon-shadow));
}
.ib:hover {
  opacity: 1;
}
.ib svg {
  width: 17px;
  height: 17px;
}
.ib .i-play,
.ib.paused .i-pause {
  display: none;
}
.ib.paused .i-play {
  display: inline;
}
.ib:focus-visible,
.btn:focus-visible,
.dash:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}
.dash {
  position: fixed;
  left: var(--space-20);
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-20));
  width: 58px;
  height: 58px;
  border-radius: var(--radius-circle);
  background: rgba(246, 243, 234, 0.08);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
  touch-action: none;
}
/* touch joystick: a faint ring and knob that appear under the left thumb and fade when it lifts */
.joy {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease-out;
}
.joy.on {
  opacity: 1;
  transition-duration: 0.15s;
}
.joy::before {
  content: '';
  position: absolute;
  left: -52px;
  top: -52px;
  width: 104px;
  height: 104px;
  box-sizing: border-box;
  border-radius: var(--radius-circle);
  border: 1px solid rgba(246, 243, 234, 0.22);
  background: rgba(246, 243, 234, 0.04);
}
.joy i {
  position: absolute;
  left: -20px;
  top: -20px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-circle);
  background: rgba(246, 243, 234, 0.16);
  border: 1px solid rgba(246, 243, 234, 0.3);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}
/* dash moves under the right thumb, since the left one steers */
@media (pointer: coarse) {
  .dash {
    left: auto;
    right: calc(env(safe-area-inset-right, 0px) + var(--space-20));
  }
}
.banner {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.session-warning:not([hidden]) {
  position: fixed;
  z-index: 3;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 520px);
  padding: 10px 15px;
  border: 1px solid rgba(242, 197, 130, 0.7);
  border-radius: 8px;
  background: rgba(35, 28, 21, 0.92);
  color: #fff4df;
  text-align: center;
  font-size: 13px;
}
.banner.show {
  animation: bannerIn 6.5s ease forwards;
}
@keyframes bannerIn {
  0% {
    opacity: 0;
    letter-spacing: 0.2em;
  }
  18% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    letter-spacing: 0.42em;
  }
}
.b-season {
  font-weight: 300;
  font-size: clamp(28px, 6vw, 46px);
  letter-spacing: 0.32em;
  text-transform: lowercase;
  color: var(--ink);
  text-shadow: 0 2px 30px rgba(10, 16, 12, 0.55);
  padding-left: 0.32em;
}
/* a first-time-only line taught by the world itself (a hawk's first pass, hunger, the first dark
   night), never a checklist: it says a thing once, the moment it matters, and never says it again */
.hint {
  position: fixed;
  left: 50%;
  bottom: 15%;
  transform: translate(-50%, 0);
  max-width: 86vw;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  font-size: clamp(13px, 3vw, 16px);
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: var(--ink);
  text-shadow:
    var(--text-glow-tight),
    0 2px 20px rgba(10, 16, 12, 0.5);
}
.hint.show {
  animation: hintIn 5.5s ease forwards;
}
@keyframes hintIn {
  0% {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hint.show {
    animation-duration: 4.5s;
  }
}
.goal {
  position: fixed;
  left: 50%;
  bottom: 22%;
  transform: translate(-50%, 0);
  max-width: 86vw;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
  font-size: clamp(14px, 3.2vw, 18px);
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: var(--ink);
  text-shadow:
    0 0 6px rgba(10, 16, 12, 0.75),
    0 1px 3px rgba(10, 16, 12, 0.6),
    0 2px 20px rgba(10, 16, 12, 0.5);
}
.goal.show {
  opacity: 1;
}
.b-sub {
  margin-top: 10px;
  font-size: clamp(12px, 2.6vw, 15px);
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--ink);
  text-shadow:
    0 0 6px rgba(10, 16, 12, 0.75),
    0 1px 3px rgba(10, 16, 12, 0.6),
    0 2px 20px rgba(10, 16, 12, 0.5);
}
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: var(--space-24);
  background: radial-gradient(
    ellipse 70% 55% at 50% 50%,
    rgba(14, 20, 16, 0.4),
    rgba(14, 20, 16, 0.22) 60%,
    rgba(14, 20, 16, 0.55)
  );
  overflow: auto;
  text-align: center;
}
.card {
  max-width: 420px;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 18px;
  text-shadow: var(--text-glow-soft);
}
.card h1 {
  font-weight: 300;
  font-size: clamp(64px, 16vw, 112px);
  letter-spacing: -0.05em;
  line-height: 0.85;
  margin: 0;
}
.card h2 {
  font-weight: 300;
  font-size: clamp(30px, 8vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}
/* the year-won card: a warm low-sun glow instead of the plain scrim, and the title rising gently into it */
#wonOv {
  background:
    radial-gradient(ellipse 60% 45% at 50% 42%, rgba(242, 201, 76, 0.3), transparent 72%),
    radial-gradient(
      ellipse 70% 55% at 50% 50%,
      rgba(14, 20, 16, 0.66),
      rgba(14, 20, 16, 0.52) 60%,
      rgba(14, 20, 16, 0.68)
    );
  /* like game over, the ground behind is often bright snow or busy trees, so it sinks into a soft blur */
  backdrop-filter: blur(3px) saturate(0.75);
  -webkit-backdrop-filter: blur(3px) saturate(0.75);
}
#wonOv .sub,
#wonOv .stats span,
#wonOv .stats i {
  color: var(--ink);
}
#wonOv .stats span,
#wonOv .stats i {
  text-shadow: var(--text-glow-tight);
}
#wonOv .stats {
  gap: 36px;
}
#wonOv .btn.share {
  color: var(--ink);
  border-color: rgba(246, 243, 234, 0.5);
}
#wonOv .end-panel > * {
  animation: wonIn 1.4s ease-out both;
}
#wonOv .end-panel > :nth-child(2) {
  animation-delay: 0.25s;
}
#wonOv .end-panel > :nth-child(n + 3) {
  animation-delay: 0.6s;
}
#wonOv h2 {
  color: #fff3cf;
  text-shadow:
    0 0 28px rgba(242, 201, 76, 0.45),
    var(--text-glow-soft);
}
@keyframes wonIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #wonOv .end-panel > * {
    animation: none;
  }
}
.sub {
  font-size: 15px;
  color: var(--ink-muted);
  margin: 0;
  letter-spacing: 0.02em;
  /* the card's own soft glow reads thin over a busy background (bare branches, birds); a tight dark
     edge under it keeps the smaller, dimmer lines legible without a boxy scrim */
  text-shadow: var(--text-glow-tight), var(--text-glow-soft);
}
.keys {
  display: grid;
  gap: 7px;
  justify-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  text-shadow: var(--text-glow-tight), var(--text-glow-soft);
  color: var(--ink-muted);
}
.actions {
  display: flex;
  gap: var(--space-10);
  flex-wrap: wrap;
  justify-content: center;
}
#titleCard[data-view='saves'] .view-land,
#titleCard[data-view='land'] .view-saves {
  display: none;
}
.view {
  display: grid;
  gap: var(--space-10);
  justify-items: center;
  width: min(100%, 320px);
}
#titleOv .actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#titleOv .actions .link {
  grid-column: 1 / -1;
}
.land-name {
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-shadow: var(--text-glow-tight), var(--text-glow-soft);
}
.note:not(:empty),
#saveNote:not(:empty) {
  display: block;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
}
.slots {
  display: grid;
  gap: var(--space-10);
  width: 100%;
  max-height: 34vh;
  overflow-y: auto;
}
.slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
}
.slot-go {
  display: grid;
  gap: 2px;
  text-align: center;
}
.slot-go small {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  opacity: 0.7;
}
.slot-del {
  min-width: 34px;
}
.slot-del.sure {
  color: #ffd4cc;
}
.btn.link {
  background: none;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 13px;
  padding: 6px var(--space-14);
  color: var(--ink-muted);
  text-transform: lowercase;
}
.btn.link:hover {
  color: var(--ink);
}
.btn {
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(246, 243, 234, 0.08);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 11px var(--space-24);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn.main {
  background: var(--ink);
  color: var(--ink-on-light);
  border-color: var(--ink);
}
.btn.danger {
  color: #ffd4cc;
  background: rgba(116, 35, 28, 0.34);
  border-color: rgba(255, 180, 166, 0.72);
}
.btn.danger:hover {
  background: rgba(142, 42, 33, 0.5);
  border-color: #ffd4cc;
}
.btn.share {
  align-self: center;
  font-size: 13px;
  padding: 7px var(--space-20);
  color: var(--ink-muted);
}
.confirm-card {
  gap: var(--space-20);
}
.btn:hover {
  border-color: var(--ink);
}
.btn:disabled {
  opacity: 0.5;
  cursor: progress;
}
.stats {
  display: flex;
  gap: var(--space-28);
  justify-content: center;
}
.stats div {
  display: grid;
  gap: var(--space-4);
}
.stats b {
  font-weight: 300;
  font-size: 36px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stats span {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: rgba(246, 243, 234, 0.74);
}
/* under a run's number: the best it has to beat, or a quiet note that it just did */
.stats i {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--ink-muted);
}
/* game over: the ground behind the card is often bright snow or busy farmland, so the world sinks into a
   darker, softly blurred pool under the text instead of competing with it */
#overOv {
  background: radial-gradient(
    ellipse 75% 60% at 50% 50%,
    rgba(14, 20, 16, 0.72),
    rgba(14, 20, 16, 0.58) 60%,
    rgba(14, 20, 16, 0.72)
  );
  backdrop-filter: blur(3px) saturate(0.7);
  -webkit-backdrop-filter: blur(3px) saturate(0.7);
}
#overOv h2 {
  text-shadow: var(--text-glow-tight), var(--text-glow-soft);
}
#overOv .stats span {
  color: var(--ink);
  font-size: 13px;
  text-shadow: var(--text-glow-tight);
}
#overOv .stats i {
  color: var(--ink);
  opacity: 0.8;
  text-shadow: var(--text-glow-tight);
}
#overOv .stats {
  gap: 36px;
}
/* A compact flight desk: the world stays visible, but the current flight and actions have
   separate, easy-to-scan places instead of a single floating button. */
#pauseOv {
  background: rgba(10, 19, 17, 0.48);
  backdrop-filter: blur(3px) saturate(0.72);
  -webkit-backdrop-filter: blur(3px) saturate(0.72);
}
.pause-panel {
  box-sizing: border-box;
  min-width: 0;
  width: min(100%, 650px);
  padding: 27px 30px 22px;
  text-align: left;
  background: rgba(24, 37, 32, 0.88);
  border: 1px solid rgba(246, 243, 234, 0.29);
  border-radius: 18px;
  box-shadow:
    0 22px 70px rgba(6, 12, 10, 0.36),
    inset 0 1px rgba(255, 255, 255, 0.08);
}
.sound-levels {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(105px, 1fr) minmax(90px, 1fr);
  gap: 6px 18px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  font-size: 12px;
}
.sound-levels legend {
  padding: 0 0 8px;
  color: var(--ink-muted);
  font-size: 10px;
}
.flight-losses {
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}
.sound-levels label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sound-levels output {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.sound-levels input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  accent-color: #e6e7d8;
}
.sound-levels input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}
.pause-topline,
.pause-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.07em;
}
.pause-topline {
  text-transform: uppercase;
  letter-spacing: 0.17em;
}
.pause-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 32px;
  align-items: center;
  padding: 30px 0;
}
.pause-summary h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
}
.pause-summary .stats {
  justify-content: flex-start;
  gap: 32px;
  margin-top: 26px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.pause-summary .stats b {
  font-size: 30px;
}
.pause-actions {
  display: grid;
  gap: 9px;
}
.pause-actions .btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}
.pause-actions .btn.main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #e6e7d8;
  color: var(--ink-on-light);
  border-color: #e6e7d8;
}
.pause-actions .btn.main:hover {
  background: #fff7e1;
}
.pause-actions .btn:not(.main):hover {
  background: rgba(246, 243, 234, 0.16);
}
.pause-foot {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}
#pauseSaveNote:not(:empty) {
  text-align: right;
}
@media (max-width: 560px) {
  .pause-panel {
    padding: 21px 20px 18px;
  }
  .pause-main {
    grid-template-columns: 1fr;
    gap: 23px;
    padding: 23px 0;
  }
  .pause-summary .stats {
    margin-top: 18px;
  }
  .pause-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pause-actions .main,
  .pause-actions #pauseNewBtn {
    grid-column: 1 / -1;
  }
  .pause-actions .btn {
    white-space: normal;
  }
  .pause-foot {
    flex-direction: column;
    gap: 5px;
  }
  #pauseSaveNote:not(:empty) {
    text-align: left;
  }
}
/* Title and flight results share the pause menu's quiet framed surface. */
#titleOv {
  background: rgba(10, 19, 17, 0.42);
  backdrop-filter: blur(3px) saturate(0.8);
  -webkit-backdrop-filter: blur(3px) saturate(0.8);
}
#titleOv,
#wonOv,
#overOv,
#pauseOv {
  align-items: safe center;
}
.title-panel {
  width: min(100%, 740px);
}
.title-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 285px);
  gap: 38px;
  align-items: center;
  padding: 36px 0;
}
.title-summary h1 {
  margin: 0 0 15px;
  font-weight: 300;
  font-size: clamp(68px, 10vw, 100px);
  line-height: 0.9;
  letter-spacing: -0.065em;
}
.screen-panel .sub {
  text-shadow: none;
  line-height: 1.5;
}
.title-summary .keys {
  justify-items: start;
  margin-top: 30px;
  gap: 9px;
  letter-spacing: 0.03em;
  text-shadow: none;
}
.title-flight {
  min-width: 0;
  padding-left: 25px;
  border-left: 1px solid var(--line);
}
.title-flight .view {
  width: 100%;
  justify-items: stretch;
  gap: 12px;
}
.screen-label {
  color: var(--ink-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.title-flight .land-name {
  text-shadow: none;
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.title-flight .btn {
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.title-flight .slot-go {
  text-align: left;
  min-width: 0;
}
.title-flight .slot-go small {
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.02em;
}
.title-flight #newFlightBtn {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.title-flight .fine {
  line-height: 1.5;
  letter-spacing: 0.03em;
}
.title-panel #saveNote:empty {
  display: none;
}
.screen-panel .pause-summary .sub {
  margin-top: 12px;
}
#wonOv .end-panel {
  border-color: rgba(242, 201, 76, 0.38);
}
#wonOv .end-panel h2 {
  text-shadow: none;
}
#wonOv .end-panel .stats span,
#wonOv .end-panel .stats i,
#overOv .end-panel .stats span,
#overOv .end-panel .stats i {
  text-shadow: none;
}
.end-actions .share {
  font-size: 13px;
  padding: 10px 15px;
}
@media (max-width: 560px) {
  .title-main {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 25px 0;
  }
  .title-summary h1 {
    font-size: 72px;
    margin-bottom: 10px;
  }
  .title-summary .keys {
    margin-top: 18px;
    gap: 6px;
  }
  .title-flight {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }
  .title-flight .slots {
    max-height: 28vh;
  }
  .screen-panel .pause-topline {
    font-size: 9px;
    letter-spacing: 0.1em;
  }
  .end-actions .btn:not(.main) {
    grid-column: 1 / -1;
  }
}
.fine {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  text-transform: lowercase;
}
@media (max-width: 560px) {
  .count {
    font-size: 38px;
  }
  .year {
    width: 92px;
  }
  .count-label {
    font-size: 9.5px;
  }
  .hud {
    padding-inline: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .count.danger {
    animation: none;
  }
  .banner.show {
    animation-duration: 4s;
  }
}

/* Menus remain usable with keyboard focus, touch, enlarged text and high contrast. */
.screen-panel .btn,
.pause-panel .btn {
  min-height: 44px;
}
.title-flight .slot-del {
  min-width: 44px;
  padding: 8px;
  font-size: 22px;
}
.title-flight .slot-go {
  overflow-wrap: anywhere;
}
.pause-foot {
  font-size: 12px;
  letter-spacing: 0.01em;
}
.copyright {
  margin-top: -6px;
  text-align: center;
  color: var(--ink-muted);
  opacity: 0.55;
  font-size: 9.5px;
  letter-spacing: 0.06em;
}
.title-summary .keys {
  font-size: 13px;
}
.btn:focus-visible,
.ib:focus-visible,
.dash:focus-visible,
#game:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
#confirmOv {
  z-index: 5;
  background: rgba(7, 15, 12, 0.68);
}
.confirm-panel {
  width: min(100%, 430px);
}
.confirm-panel h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 300;
  line-height: 1.2;
}
.confirm-panel p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  margin: 18px 0 25px;
}
.confirm-panel .actions {
  justify-content: flex-end;
}
#shareFallback {
  box-sizing: border-box;
  width: 100%;
  min-height: 110px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
@media (max-width: 560px) {
  .confirm-panel .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .end-actions #shareNote,
  .end-actions #shareFallback {
    grid-column: 1 / -1;
  }
}
@media (forced-colors: active) {
  .pause-panel,
  .btn {
    border-color: CanvasText;
  }
  .btn:focus-visible,
  #game:focus-visible {
    outline-color: Highlight;
  }
}

.confirm-panel .btn {
  border-radius: 8px;
}

.menu-loading {
  position: absolute;
  top: auto;
  left: 50%;
  right: auto;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #182520;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.menu-loading::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: loading-turn 0.9s linear infinite;
}
@keyframes loading-turn {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .menu-loading::before {
    animation: none;
  }
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 3px 7px;
  font:
    500 12px/1 system-ui,
    sans-serif;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: none;
  vertical-align: middle;
  color: var(--ink);
  background: rgba(246, 243, 234, 0.09);
  border: 1px solid rgba(246, 243, 234, 0.35);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  white-space: nowrap;
}
.key-group,
.control-keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.control-keys {
  flex-wrap: wrap;
  gap: 7px;
}
.keys:has(kbd) li {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
}
#pauseControls:has(kbd) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
#pauseControls .control-hint {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
#pauseControls:has(kbd) {
  column-gap: 16px;
  row-gap: 10px;
}
.key-group kbd {
  width: 28px;
  padding: 0;
  font-family: Arial, sans-serif;
  font-size: 17px;
}

/* Compact status corners leave the flight visible on phones. Keep names available to readers. */
@media (max-width: 560px), (max-height: 500px) and (pointer: coarse) {
  .hud {
    padding: calc(env(safe-area-inset-top, 0px) + 10px) max(12px, env(safe-area-inset-right, 0px)) 0
      max(12px, env(safe-area-inset-left, 0px));
  }
  .tl {
    width: 110px;
    gap: 8px;
  }
  .count {
    font-size: 34px;
  }
  .count-label {
    letter-spacing: 0.06em;
  }
  .lines {
    gap: 6px;
  }
  .meter-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  #goalRow {
    display: none;
  }
  .tr {
    display: grid;
    grid-template-columns: 44px 44px;
    gap: 4px;
  }
  .tr .ib {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(14, 20, 16, 0.18);
  }
  .tr .year {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 92px;
    margin-top: 3px;
  }
  .yearname {
    font-size: 9px;
    letter-spacing: 0.03em;
  }
}
@media (max-height: 500px) and (pointer: coarse) {
  .tl {
    flex-direction: row;
    align-items: center;
    width: 185px;
    gap: 12px;
  }
  .lines {
    flex: 1;
  }
  .countrow {
    flex-direction: column;
    gap: 3px;
  }
}
.menu-loading.error::before {
  display: none;
}
@media (pointer: coarse) {
  .tr .ib {
    width: 44px;
    height: 44px;
  }
}
.pause-foot:has(#pauseControls kbd) {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.pause-foot:has(#pauseControls kbd) #pauseSaveNote {
  text-align: left;
}

.mouse-key {
  display: inline-block;
  width: 24px;
  height: 28px;
  flex: 0 0 24px;
  vertical-align: middle;
}

.marks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}
.marks figure {
  margin: 0;
  text-align: center;
}
.marks canvas {
  display: block;
  width: 84px;
  height: 100px;
}
.journal-panel {
  background: #182520; /* solid: the card underneath must not show through */
  width: min(100%, 760px);
  max-height: 90vh;
  overflow-y: auto;
}
.journal-panel h2 span {
  margin-left: 10px;
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.journal-panel h2 {
  margin: 0 0 18px;
  font-size: 26px;
  font-weight: 300;
  line-height: 1.2;
}
.journal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.journal-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}
.journal-pic {
  aspect-ratio: 8 / 5;
  display: grid;
  place-items: center;
  background: #27382b center / cover no-repeat;
  color: rgba(246, 243, 234, 0.28);
  font-size: 44px;
  font-weight: 300;
}
.journal-card > div:not(.journal-pic) {
  padding: 9px 11px 12px;
}
.journal-card h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 400;
}
.journal-card h3 span {
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.journal-card.unseen {
  opacity: 0.55;
}
.journal-panel .actions {
  justify-content: flex-end;
  margin-top: 18px;
}
/* touch controls: two quiet icons, the chosen one lit */
.ctl-toggle {
  display: inline-flex;
  gap: 6px;
}
.ctl-toggle button {
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: var(--radius-circle);
  border: 1px solid transparent;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
}
.ctl-toggle button[aria-pressed='true'] {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(246, 243, 234, 0.08);
}
.ctl-toggle button:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}
.ctl-toggle svg {
  display: block;
  width: 100%;
  height: 100%;
}
