:root {
  --ink: #2a1d1b;
  --ink-2: #4a3a33;
  --paper: #fbf0d9;
  --paper-2: #f0dfbd;
  --paper-3: #e4cfa6;
  --orange: #e8743b;
  --orange-d: #b8562a;
  --sun: #f2c94c;
  --green: #4f7a3a;
  --green-l: #7fbf4a;
  --blue: #2f6fb0;
  --sky: #7fd0f0;
  --red: #c0392b;
  --px: 3px;

  --pixel: 'Pixelify Sans', 'Courier New', monospace;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1b1416;
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

#game {
  position: fixed;
  inset: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.hidden { display: none !important; }

button { font: inherit; color: inherit; }

/* chunky pixel frame: notched corners from four offset shadows */
.panel {
  background: var(--paper);
  box-shadow:
    -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink),
    inset 0 -3px 0 0 var(--paper-2),
    0 8px 0 -2px rgba(20, 10, 10, 0.35);
}

.key {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.35em;
  font-family: var(--pixel);
  font-size: 0.8em;
  line-height: 1.5;
  text-align: center;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-bottom-width: 4px;
  border-radius: 3px;
  vertical-align: 0.05em;
}

.btn {
  font-family: var(--pixel);
  font-weight: 500;
  font-size: 18px;
  padding: 8px 18px 10px;
  background: var(--paper);
  border: 0;
  cursor: pointer;
  position: relative;
  box-shadow:
    -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink),
    inset 0 -4px 0 0 var(--paper-3),
    0 7px 0 -1px var(--ink);
  transition: transform 0.05s;
}
.btn:hover { background: #fff7e6; }
.btn:active { transform: translateY(3px); box-shadow: -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), inset 0 -2px 0 0 var(--paper-3), 0 4px 0 -1px var(--ink); }
.btn:focus-visible { outline: 3px dashed var(--orange); outline-offset: 6px; }
.btn.primary { background: var(--orange); color: #fff8ec; box-shadow: -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), inset 0 -4px 0 0 var(--orange-d), 0 7px 0 -1px var(--ink); }
.btn.primary:hover { background: #f0834a; }
.btn.primary .key { background: #fff3e2; }
.btn.big { font-size: 22px; padding: 10px 26px 13px; }
.btn.small { font-size: 14px; padding: 4px 10px 6px; box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), inset 0 -3px 0 0 var(--paper-3), 0 5px 0 -1px var(--ink); }
.btn.small.off { color: #8a7a6a; }

/* ---------------------------------------------------------------- title */

.title {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 6vh 7vw;
  background:
    linear-gradient(90deg, rgba(42, 22, 18, 0.62) 0%, rgba(42, 22, 18, 0.35) 45%, rgba(42, 22, 18, 0) 75%);
  overflow-y: auto;
}

.title-inner { max-width: 560px; }

.logo {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 1px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.logo-word {
  font-size: clamp(54px, 9vw, 112px);
  color: #fff3dc;
  text-shadow:
    0 5px 0 var(--orange-d),
    5px 5px 0 var(--ink), -3px 5px 0 var(--ink), 0 9px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink);
}
.logo-num {
  margin-top: 14px;
  margin-left: 6px;
  font-size: clamp(36px, 5.4vw, 64px);
  color: var(--ink);
  background: var(--sun);
  padding: 2px 16px 6px;
  transform: rotate(-3deg);
  box-shadow: -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), inset 0 -5px 0 0 #d9a52f, 6px 10px 0 -2px var(--ink);
}

.tagline {
  margin: 26px 0 30px;
  font-size: 21px;
  color: #fff3dc;
  text-shadow: 0 2px 0 var(--ink);
}

.title-buttons { display: flex; gap: 22px; flex-wrap: wrap; }

.howto {
  margin-top: 30px;
  padding: 18px 22px 20px;
  font-size: 16px;
  line-height: 1.45;
  max-width: 540px;
}
.howto p { margin: 0 0 10px; }
.howto ul { margin: 0 0 14px; padding-left: 20px; }
.howto li { margin-bottom: 6px; }
.howto .keys { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; padding-top: 12px; border-top: 2px dashed var(--paper-3); }

.title-foot {
  margin-top: 26px;
  font-family: var(--pixel);
  color: #f6dfb8;
  text-shadow: 0 2px 0 var(--ink);
  font-size: 15px;
}

/* ---------------------------------------------------------------- HUD */

.hud {
  position: fixed;
  inset: 14px 16px auto 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  font-size: 14px;
}
.hud .btn { pointer-events: auto; }

.hud-heat { width: 252px; padding: 10px 12px 11px; }
.hud-row { display: flex; justify-content: space-between; align-items: baseline; }
.label { font-family: var(--pixel); font-weight: 500; font-size: 15px; }
.temp { font-family: var(--pixel); font-weight: 700; font-size: 20px; }

.meter {
  position: relative;
  height: 16px;
  margin: 5px 0 6px;
  background: #e7d6b4;
  box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), inset 0 3px 0 0 #d4bf98;
}
.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 20%;
  background: var(--green-l);
  box-shadow: inset 0 -4px 0 0 rgba(0, 0, 0, 0.18), inset 0 3px 0 0 rgba(255, 255, 255, 0.25);
  transition: background 0.4s;
}
.meter[data-tone="warn"] .meter-fill { background: var(--sun); }
.meter[data-tone="bad"] .meter-fill { background: var(--orange); }
.meter i {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: rgba(42, 29, 27, 0.4);
}

.status { font-weight: 700; font-size: 15px; }
.status[data-tone="warn"] { color: #9a6a10; }
.status[data-tone="bad"] { color: var(--red); animation: throb 1s steps(2) infinite; }
@keyframes throb { 50% { opacity: 0.6; } }

.rate { font-size: 13px; color: var(--ink-2); min-height: 18px; }
.rate::before { content: '▲ '; color: var(--orange-d); font-size: 10px; }
.rate[data-dir="down"]::before { content: '▼ '; color: var(--blue); }
.rate:empty::before { content: ''; }

.water {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 2px dashed var(--paper-3);
}
.bottle { display: flex; gap: 5px; margin-left: auto; }
.sip {
  width: 11px;
  height: 18px;
  background: #e7d6b4;
  box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink);
  position: relative;
}
.sip::before { content: ''; position: absolute; left: 3px; top: -6px; width: 5px; height: 3px; background: var(--ink); }
.sip.full { background: #6fb8e8; box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), inset 3px 0 0 0 #a9dcf7; }

.items { display: flex; gap: 6px; flex-wrap: wrap; }
.items:not(:empty) { margin-top: 7px; }
.item {
  font-family: var(--pixel);
  font-size: 12px;
  padding: 1px 7px 2px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
}

.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.hud-info { padding: 9px 12px 10px; min-width: 214px; }
.clock-row { display: flex; justify-content: space-between; gap: 12px; font-family: var(--pixel); font-size: 20px; font-weight: 700; }
.weather { color: var(--orange-d); }
.feels { font-size: 12.5px; color: var(--ink-2); margin: 1px 0 7px; }
.count-row { display: flex; gap: 14px; font-size: 14px; padding-top: 6px; border-top: 2px dashed var(--paper-3); }
.count-row b { font-family: var(--pixel); font-size: 16px; }
.hud-buttons { display: flex; gap: 12px; }

/* ---------------------------------------------------------------- toasts + prompt */

.toasts {
  position: fixed;
  left: 16px;
  top: 236px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
}
.toast {
  background: var(--paper);
  padding: 9px 12px 10px 14px;
  box-shadow: -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), inset 6px 0 0 0 var(--sky);
  animation: toast-in 0.25s steps(4);
  transition: opacity 0.5s, transform 0.5s;
}
.toast.out { opacity: 0; transform: translateX(-20px); }
.toast.good { box-shadow: -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), inset 6px 0 0 0 var(--green-l); }
.toast.stage { box-shadow: -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), inset 6px 0 0 0 var(--orange); }
.toast-title { font-family: var(--pixel); font-weight: 700; font-size: 16px; margin-left: 4px; }
.toast-body { font-size: 14px; line-height: 1.35; margin: 2px 0 0 4px; }
@keyframes toast-in { from { transform: translateX(-30px); opacity: 0; } }

.prompt {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 8px 9px;
  background: var(--paper);
  font-family: var(--pixel);
  font-size: 17px;
  white-space: nowrap;
  box-shadow: -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), 0 7px 0 -1px rgba(20, 10, 10, 0.4);
  pointer-events: none;
}

/* ---------------------------------------------------------------- dialog */

.dialog {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 32px));
  min-height: 132px;
  display: flex;
  gap: 16px;
  padding: 16px 20px 18px 16px;
  background: var(--paper);
  box-shadow:
    -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink),
    inset 0 0 0 3px var(--paper),
    inset 0 0 0 5px var(--paper-3),
    0 9px 0 -2px rgba(20, 10, 10, 0.4);
  cursor: pointer;
}
.dialog.narration { background: #f5ead2; }
.portrait {
  flex: none;
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  background: #cfe6ee;
  box-shadow: -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), inset 0 -18px 0 0 #b9d6a1;
  margin: 3px;
}
.dlg-main { flex: 1; min-width: 0; }
.dlg-head { display: flex; gap: 10px; align-items: center; min-height: 4px; }
.dlg-name {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 18px;
  color: var(--orange-d);
}
.dlg-name:empty { display: none; }
.dlg-verdict {
  font-family: var(--pixel);
  font-size: 13px;
  padding: 1px 8px 2px;
  color: #fff;
}
.dlg-verdict.right { background: var(--green); }
.dlg-verdict.wrong { background: var(--red); }
.dlg-text {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.45;
  white-space: pre-line;
}
.narration .dlg-text { font-style: italic; color: #3d2e28; }
.dlg-choices { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; cursor: default; }
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  padding: 7px 12px 8px 8px;
  background: #fffaf0;
  border: 0;
  cursor: pointer;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.35;
  font-style: normal;
  box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), inset 0 -3px 0 0 var(--paper-2);
}
.choice .key { flex: none; margin-top: 1px; }
.choice:hover { background: #fff1d6; box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), inset 4px 0 0 0 var(--orange); }
.choice.crossed { opacity: 0.45; text-decoration: line-through; cursor: default; }
.choice.crossed:hover { background: #fffaf0; box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink); }
.dlg-next {
  position: absolute;
  right: 16px;
  bottom: 12px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--orange-d);
  animation: nudge 0.7s steps(2) infinite;
}
@keyframes nudge { 50% { transform: translateY(3px); } }

/* ---------------------------------------------------------------- overlays */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(30, 16, 14, 0.55);
}
.overlay.scroll { align-items: flex-start; overflow-y: auto; }

/* flyer */
.flyer {
  position: relative;
  width: min(460px, 100%);
  padding: 0 0 18px;
  background: #fbf7ec;
  transform: rotate(var(--tilt, -1deg));
  box-shadow: 0 0 0 3px var(--ink), 8px 10px 0 0 rgba(20, 10, 10, 0.4);
  animation: flyer-in 0.2s steps(3);
}
@keyframes flyer-in { from { transform: rotate(var(--tilt, -1deg)) translateY(30px); opacity: 0; } }
.flyer-tape {
  position: absolute;
  left: 50%;
  top: -14px;
  width: 90px;
  height: 26px;
  transform: translateX(-50%) rotate(2deg);
  background: rgba(240, 225, 170, 0.85);
  box-shadow: 0 0 0 2px rgba(42, 29, 27, 0.25);
}
.flyer-band {
  background: var(--orange);
  color: #fff6e6;
  font-family: var(--pixel);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 18px 22px 6px;
  border-bottom: 3px solid var(--ink);
}
.flyer h2 {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.05;
  margin: 16px 22px 10px;
}
.flyer-body { margin: 0 22px; font-size: 17px; line-height: 1.5; }
.flyer-body p { margin: 0 0 10px; }
.flyer-body strong { font-family: var(--pixel); text-transform: capitalize; font-size: 17px; color: var(--orange-d); }
.flyer-tabs {
  display: flex;
  margin: 14px 0 0;
  border-top: 2px dashed #b9ab92;
}
.flyer-tabs span {
  flex: 1;
  font-family: var(--pixel);
  font-size: 11px;
  writing-mode: vertical-rl;
  text-align: center;
  padding: 6px 0;
  border-right: 2px dashed #b9ab92;
  color: #6b5b4a;
}
.flyer-tabs span:last-child { border-right: 0; }
.flyer-tabs span:nth-child(3) { visibility: hidden; }
.flyer-foot { display: flex; align-items: center; justify-content: space-between; margin: 16px 22px 0; }
.flyer-num { font-family: var(--pixel); font-size: 14px; color: #8a7a6a; }

/* pause */
.sheet { padding: 22px 26px 26px; width: min(680px, 100%); }
.sheet h2 { font-family: var(--pixel); font-weight: 700; font-size: 32px; margin: 0 0 14px; }
.pause-sheet canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  box-shadow: 0 0 0 3px var(--ink);
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: 14px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--ink); }
.sw.you { background: #fff6e0; box-shadow: inset 0 0 0 2px var(--orange); }
.sw.lib { background: var(--sky); }
.sw.water { background: #3d8fd6; }
.sw.help { background: var(--orange); }
.pause-stats { font-family: var(--pixel); font-size: 15px; margin: 10px 0 0; color: var(--ink-2); }
.sheet-buttons { display: flex; gap: 22px; margin-top: 24px; flex-wrap: wrap; }

/* win / lose */
.end-sheet { margin: 4vh auto; width: min(860px, 100%); padding-top: 0; }
.end-band {
  margin: 0 -26px 20px;
  padding: 12px 26px 10px;
  font-family: var(--pixel);
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 3px solid var(--ink);
}
.end-band.cool { background: var(--sky); }
.end-band.hot { background: var(--red); color: #fff2e6; }
.end-sheet h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.1; margin-bottom: 8px; }
.end-sub { font-size: 18px; line-height: 1.45; margin: 0 0 20px; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat {
  background: #fffaf0;
  padding: 10px 12px 11px;
  box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink);
}
.stat-label { font-size: 13px; color: var(--ink-2); }
.stat-value { font-family: var(--pixel); font-weight: 700; font-size: 28px; line-height: 1.15; }
.stat-note { font-size: 12.5px; color: var(--orange-d); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.end-sheet h3 { font-family: var(--pixel); font-weight: 700; font-size: 20px; margin: 0 0 10px; }
.people, .tips { list-style: none; margin: 0; padding: 0; font-size: 15px; line-height: 1.35; }
.people li { display: flex; flex-direction: column; padding: 7px 0 7px 22px; border-bottom: 2px dashed var(--paper-3); position: relative; }
.people li::before, .tips li::before { position: absolute; left: 0; font-family: var(--pixel); font-weight: 700; }
.people li.yes::before, .tips li.yes::before { content: '+'; color: var(--green); }
.people li.no::before, .tips li.no::before { content: '-'; color: #a8977f; }
.people .who { font-weight: 700; }
.people .no { color: #8a7a6a; }
.tips li { padding: 7px 0 7px 22px; border-bottom: 2px dashed var(--paper-3); position: relative; }
.tips li.no { color: #8a7a6a; font-style: italic; }

.signs { margin-top: 28px; }
.signs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sign-box { padding: 12px 14px 4px; box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink); }
.sign-box h4 { font-family: var(--pixel); font-size: 19px; margin: 0 0 6px; }
.sign-box p { margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
.sign-box .do { font-weight: 700; }
.sign-box.exhaustion { background: #fff3c9; }
.sign-box.stroke { background: #ffd9cc; }
.name-note { font-size: 14px; color: var(--ink-2); margin: 16px 0 0; font-style: italic; }

.aid { padding: 14px 16px 8px; box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink); }
.aid.stroke { background: #ffd9cc; }
.aid.exhaustion { background: #fff3c9; }
.aid h3 { margin-bottom: 2px; }
.aid-sub { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.aid ol { margin: 0; padding-left: 22px; font-size: 15.5px; line-height: 1.4; }
.aid li { margin-bottom: 7px; }
.hint { margin: 22px 0 0; padding: 12px 14px; background: #fffaf0; font-size: 16px; line-height: 1.4; box-shadow: inset 5px 0 0 0 var(--orange); }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 760px) {
  .hud { flex-direction: column; gap: 10px; inset: 10px 10px auto 10px; }
  .hud-right { flex-direction: row-reverse; align-items: flex-start; gap: 10px; }
  .hud-heat { width: 220px; }
  .hud-info { min-width: 0; }
  .feels { display: none; }
  .toasts { top: auto; bottom: 90px; width: calc(100vw - 32px); }
  .stats { grid-template-columns: 1fr 1fr; }
  .cols, .signs-grid { grid-template-columns: 1fr; }
  .dialog { flex-direction: column; }
  .portrait { width: 64px; height: 64px; }
  .title { align-items: flex-start; }
}

@media (max-height: 620px) {
  .toasts { display: none; }
}

/* coach tips */
.coach {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  animation: toast-in 0.2s steps(3);
}
.coach-card { padding: 16px 20px 18px; box-shadow: -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), inset 0 6px 0 0 var(--sun), 0 9px 0 -2px rgba(20,10,10,.4); }
.coach-card h2 { font-family: var(--pixel); font-weight: 700; font-size: 22px; margin: 6px 0 6px; }
.coach-card p { font-size: 17px; line-height: 1.45; margin: 0 0 14px; }
.hud.spot-water .water { outline: 3px solid var(--sun); outline-offset: 3px; animation: throb .6s steps(2) infinite; }
.hud.spot-water .water::after { content: '\25C0  this'; font-family: var(--pixel); color: var(--orange-d); }
.flyer-source { margin: 6px 22px 0; font-size: 12.5px; color: #8a7a6a; font-style: italic; }
.learned { margin-top: 26px; }

/* loading screen: covers everything until fonts + sprites are ready */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1b1416;
  transition: opacity 0.35s;
}
.loader.done { opacity: 0; pointer-events: none; }
.loader-sun {
  width: 24px;
  height: 24px;
  background: var(--sun);
  box-shadow: 0 -12px 0 -6px var(--orange), 0 12px 0 -6px var(--orange), -12px 0 0 -6px var(--orange), 12px 0 0 -6px var(--orange);
  animation: loader-spin 1.2s steps(8) infinite;
}
@keyframes loader-spin { to { transform: rotate(360deg); } }
body.loading .title { visibility: hidden; }
.elapsed { font-size: 12.5px; color: var(--ink-2); margin: 1px 0 7px; }
.elapsed b { font-family: var(--pixel); font-size: 14px; color: var(--ink); }

.fade { position: fixed; inset: 0; z-index: 90; opacity: 0; pointer-events: none; background: #fff; }

/* the pixel font's digits are hard to read, so numbers use the body font */
.temp, .clock-row, .elapsed b, .count-row b, .stat-value, .pause-stats {
  font-family: var(--body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.temp { font-size: 19px; }
.clock-row { font-size: 19px; }

.achievements { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.achievements li { padding: 8px 12px 9px; display: flex; flex-direction: column; box-shadow: -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink); }
.achievements .got { background: #fff3c9; }
.achievements .locked { background: #efe4cc; color: #8a7a6a; }
.ach-name { font-family: var(--pixel); font-weight: 700; font-size: 16px; }
.ach-desc { font-size: 13.5px; line-height: 1.3; }
@media (max-width: 760px) { .achievements { grid-template-columns: 1fr; } }

.score { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; }
.score-label { font-family: var(--pixel); font-size: 20px; }
.score-value { font-family: var(--body); font-weight: 700; font-size: 44px; line-height: 1; color: var(--orange-d); font-variant-numeric: tabular-nums; }
.score-note { font-size: 14px; color: var(--ink-2); }
.win-sheet { padding-top: 26px; }
.achievements .this-run .ach-name::after { content: '  this run'; font-family: var(--body); font-weight: 400; font-size: 12px; color: var(--orange-d); }

/* keep the pause map on screen on short laptop screens */
#pause { overflow-y: auto; }
.pause-sheet canvas { max-height: calc(100vh - 230px); width: auto; max-width: 100%; margin: 0 auto; }
