:root {
  /* Layout idea: one squared exercise-book page. Blue-biro doodles, a red margin line, yellow highlighter
     on anything tappable. Sheets of ruled paper and one blackboard drop in for the four boxes. */
  --paper: #f6f8fb;
  --grid: #cfe0f3;
  --ink: #17349b;
  --ink-deep: #0e2266;
  --red: #c22b1e;
  --hi: #ffe45c;
  --pencil: #4b5565;
  --board: #20372f;
  --chalk: #f3f5ee;
  --sheet: #ffffff;
  --rule: #d8e5f5;
  --display: "Cabin Sketch", "Comic Sans MS", cursive;
  --body: "Patrick Hand", "Comic Sans MS", "Segoe Print", cursive;
  --gutter: clamp(36px, 8.4vw, 120px);
  --gutter-r: clamp(16px, 4vw, 56px);
  --line: clamp(18px, 6.1vw, 88px);
  --wob-a: 255px 15px 225px 15px/15px 225px 15px 255px;
  --wob-b: 15px 225px 15px 255px/255px 15px 225px 15px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 22px;
  line-height: 1.3;
  -webkit-text-size-adjust: 100%;
}
a {
  color: var(--ink);
}
a:hover {
  color: var(--ink-deep);
}
:focus-visible {
  outline: 3px dashed var(--red);
  outline-offset: 3px;
}
h2[tabindex="-1"]:focus,
#game:focus {
  outline: none;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 9;
  background: var(--hi);
  border: 3px solid var(--ink);
  padding: 6px 14px;
}
.skip:focus {
  left: 8px;
}
html.game .plain-only,
html:not(.game) .play-only,
html:not(.js) .js-only,
html:not(.js) .controls {
  display: none;
}

.page {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.margin-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--line);
  width: 2px;
  background: var(--red);
  pointer-events: none;
}

/* ---- header and HUD ---- */
.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px 24px;
  padding: clamp(12px, 3.4vh, 40px) var(--gutter-r) 0 var(--gutter);
}
.name {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1;
  color: var(--ink);
  text-decoration: underline double var(--red);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.13em;
  padding-bottom: 0.2em;
}
.hud {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  margin-left: auto;
}
.hud p {
  margin: 0;
}
.lbl {
  color: var(--pencil);
  font-size: clamp(16px, 1.5vw, 22px);
}
.num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 2.8vw, 40px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tally {
  display: flex;
  align-items: center;
  gap: 16px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.chip svg {
  flex: none;
  width: 22px;
  height: 22px;
}
.chip.bump {
  animation: bump 0.3s ease-out;
}
@keyframes bump {
  40% {
    transform: scale(1.35);
  }
}
.energy {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cells {
  display: flex;
  gap: 4px;
}
.cells i {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
}
.cells i.on {
  background: var(--ink);
}
.cells.low i.on {
  background: var(--red);
  border-color: var(--red);
}
.energy.low .lbl {
  color: var(--red);
}

/* ---- the four boxes ---- */
.boxes {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 28px);
  padding: clamp(10px, 3vh, 34px) var(--gutter-r) 0 var(--gutter);
}
.box {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 2.4vw, 34px);
  color: var(--ink);
  background: var(--hi);
  border: 3px solid var(--ink);
  border-radius: var(--wob-a);
  min-width: clamp(120px, 12.2vw, 176px);
  min-height: clamp(48px, 7.5vh, 68px);
  padding: 4px 20px;
  cursor: pointer;
  transition: transform 0.15s;
}
.box:nth-child(1) {
  transform: rotate(-2deg);
}
.box:nth-child(2) {
  transform: rotate(1.5deg);
  border-radius: var(--wob-b);
}
.box:nth-child(3) {
  transform: rotate(-1deg);
}
.box:nth-child(4) {
  transform: rotate(2deg);
  border-radius: var(--wob-b);
}
.box:hover {
  transform: translateY(-3px);
}
.box[aria-expanded="true"] {
  background: var(--ink);
  color: var(--hi);
}
.box.nudge {
  animation: nudge 0.9s ease-in-out 4;
}
@keyframes nudge {
  0%,
  100% {
    transform: rotate(2deg);
  }
  25% {
    transform: rotate(-5deg) scale(1.08);
  }
  60% {
    transform: rotate(6deg) scale(1.08);
  }
}

/* ---- stage ---- */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 170px;
  overflow: hidden;
}
#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}
.bubble {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  margin: 0;
  max-width: min(300px, 56vw);
  padding: 10px 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 225px 25px 255px 20px/25px 255px 20px 225px;
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.2;
  pointer-events: none;
  transform: translateY(-100%);
  transition: opacity 0.18s;
}
.bubble:empty {
  opacity: 0;
}
.factnote {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 10px;
  width: min(460px, calc(100% - 24px));
  padding: 10px 18px 12px;
  background: var(--hi);
  border: 3px solid var(--ink);
  border-radius: 4px 12px 6px 14px;
  transform: translateX(-50%) rotate(-1.5deg);
  box-shadow: 5px 5px 0 rgba(23, 52, 155, 0.16);
  pointer-events: none;
}
.factnote[hidden] {
  display: none;
}
.factnote.in {
  animation: noteIn 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
@keyframes noteIn {
  from {
    transform: translateX(-50%) translateY(-140%) rotate(8deg);
  }
  to {
    transform: translateX(-50%) rotate(-1.5deg);
  }
}
.factnote p {
  margin: 0;
}
.factnote .n {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(18px, 1.6vw, 22px);
}
.factnote .t {
  margin-top: 2px;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.2;
}

/* ---- sheets ---- */
.panel {
  position: absolute;
  z-index: 3;
  top: 6px;
  right: var(--gutter-r);
  left: var(--zone, 300px);
  max-width: 980px;
  max-height: calc(100% - 20px);
  overflow: auto;
  -webkit-user-select: text;
  user-select: text;
  transform-origin: 0 100%;
}
.panel[hidden] {
  display: none;
}
.panel.open {
  animation: unfold 0.55s cubic-bezier(0.2, 1.2, 0.35, 1) both;
}
.panel.closing {
  animation: crumple 0.32s ease-in both;
  pointer-events: none;
}
@keyframes unfold {
  0% {
    transform: translate(-30px, 20px) rotate(-16deg) scale(0.06);
    opacity: 0.4;
  }
  60% {
    transform: rotate(0.9deg) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: rotate(-0.35deg);
  }
}
@keyframes crumple {
  100% {
    transform: translate(-20px, 30px) rotate(150deg) scale(0.05);
    border-radius: 50%;
    opacity: 0.7;
  }
}
.board.open {
  animation: drop 0.6s cubic-bezier(0.2, 1.25, 0.35, 1) both;
  transform-origin: 50% 0;
}
.board.closing {
  animation: lift 0.3s ease-in both;
}
@keyframes drop {
  0% {
    transform: translateY(-115%);
  }
  70% {
    transform: translateY(0) rotate(0.7deg);
  }
  100% {
    transform: none;
  }
}
@keyframes lift {
  100% {
    transform: translateY(-115%);
  }
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.panel h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1;
}
.back {
  min-height: 44px;
  padding: 2px 18px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--wob-a);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(18px, 1.6vw, 22px);
  cursor: pointer;
}
.sheet {
  border: 3px solid var(--ink);
  border-radius: 3px 10px 4px 12px;
  padding: 14px clamp(16px, 2.4vw, 30px) 18px clamp(48px, 4.6vw, 62px);
  box-shadow: 7px 7px 0 rgba(23, 52, 155, 0.14);
  background:
    radial-gradient(
        circle at 18px 46px,
        var(--paper) 0 6px,
        var(--ink) 6px 7.5px,
        transparent 8px
      )
      no-repeat local,
    radial-gradient(
        circle at 18px calc(100% - 46px),
        var(--paper) 0 6px,
        var(--ink) 6px 7.5px,
        transparent 8px
      )
      no-repeat local,
    linear-gradient(
        90deg,
        transparent 0 37px,
        rgba(194, 43, 30, 0.5) 37px 39px,
        transparent 39px
      )
      no-repeat local,
    linear-gradient(var(--rule) 1.5px, transparent 1.5px) 0 60px/100% 34px local,
    var(--sheet);
}

/* About: comic strip and the facts collection */
.strip {
  list-style: none;
  margin: 6px 0 10px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 14px;
}
.frame {
  display: block;
  width: 100%;
  height: 100%;
  padding: 8px 12px 10px;
  text-align: left;
  background: var(--sheet);
  border: 3px solid var(--ink);
  border-radius: var(--wob-b);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.22;
  cursor: pointer;
  transition: transform 0.15s;
}
.strip li:nth-child(odd) .frame {
  border-radius: var(--wob-a);
  transform: rotate(-0.8deg);
}
.strip li:nth-child(even) .frame {
  transform: rotate(0.7deg);
}
.strip li .frame:hover {
  transform: translateY(-3px);
}
.frame svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 88px;
  margin-bottom: 4px;
}
.frame b {
  font-family: var(--display);
  font-size: 1.3em;
  line-height: 1;
}
.go {
  transform-box: fill-box;
  transform-origin: center;
}
.frame:hover .drive,
.frame.play .drive {
  animation: drive 1.4s ease-in-out;
}
.frame:hover .wheel,
.frame.play .wheel {
  animation: spin 1.4s linear;
}
.frame:hover .bar,
.frame.play .bar {
  animation: grow 0.9s ease-out both;
}
.frame:hover .wave,
.frame.play .wave {
  animation: ping 1.1s ease-out both;
}
.frame:hover .wave.w2,
.frame.play .wave.w2 {
  animation-delay: 0.18s;
}
.frame:hover .wave.w3,
.frame.play .wave.w3 {
  animation-delay: 0.36s;
}
.frame:hover .twist,
.frame.play .twist {
  animation: twist 0.9s ease-in-out;
}
.bar {
  transform-origin: left center;
}
@keyframes drive {
  50% {
    transform: translateX(24px);
  }
}
@keyframes spin {
  to {
    transform: rotate(720deg);
  }
}
@keyframes grow {
  from {
    transform: scaleX(0.1);
  }
}
@keyframes ping {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes twist {
  30% {
    transform: rotate(-28deg);
  }
  70% {
    transform: rotate(22deg);
  }
}
.byline {
  margin: 0 0 6px;
  max-width: 74ch;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.25;
}
.facts-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 8px;
}
.facts-h {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(20px, 1.7vw, 25px);
  line-height: 1.1;
}
.fact-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fact-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 2px dashed var(--pencil);
  border-radius: 8px 11px 7px 12px;
  color: var(--pencil);
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  cursor: pointer;
}
@media (pointer: coarse) {
  .fact-btn {
    width: 44px;
    height: 44px;
  }
}
.fact-btn.found {
  background: var(--hi);
  border: 3px solid var(--ink);
  color: var(--ink);
}
.fact-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--hi);
}
.fact-read {
  min-height: 1.3em;
  margin: 6px 0 0;
  font-size: clamp(19px, 1.6vw, 23px);
  line-height: 1.25;
}
.facts-all {
  display: none;
  margin: 0;
  padding-left: 1.2em;
}

/* Work: flip cards */
.cards {
  list-style: none;
  margin: 12px 0 2px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(158px, 100%), 1fr));
  gap: 16px 14px;
}
.cards li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  perspective: 900px;
}
.card {
  position: relative;
  height: 212px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--body);
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.cards li:nth-child(odd) .card {
  transform: rotate(-1.6deg);
}
.cards li:nth-child(even) .card {
  transform: rotate(1.4deg);
}
.cards li .card[aria-pressed="true"] {
  transform: rotateY(180deg) rotate(1deg);
}
.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 8px;
  border: 3px solid var(--ink);
  border-radius: 10px 14px 9px 16px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.front {
  background: var(--hi);
  text-align: center;
}
.flip {
  background: var(--sheet);
  transform: rotateY(180deg);
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 12px;
}
.front svg {
  width: 74px;
  height: 74px;
}
.front b {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(22px, 1.75vw, 27px);
  line-height: 1.05;
  white-space: nowrap;
}
.front .tag {
  font-size: 17px;
  line-height: 1.15;
}
.front .tap {
  margin-top: auto;
  color: var(--pencil);
  font-size: 15px;
}
.flip .desc {
  font-size: clamp(17px, 1.35vw, 19px);
  line-height: 1.22;
}
.flip .role {
  margin-top: auto;
  color: var(--pencil);
  font-size: 16px;
  line-height: 1.15;
}
.open-link {
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: clamp(17px, 1.4vw, 20px);
}

/* Hobbies: sticker sheet */
.stickers {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 18px;
  margin: 12px 0 12px;
  padding-left: 4px;
}
.sticker {
  position: relative;
  width: 116px;
  height: 116px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border-radius: 50%;
  background: var(--hi);
  border: 3px solid var(--ink);
  box-shadow:
    0 0 0 5px var(--sheet),
    0 0 0 6.5px rgba(23, 52, 155, 0.32);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s;
}
.sticker:nth-child(odd) {
  transform: rotate(-4deg);
}
.sticker:nth-child(even) {
  transform: rotate(3deg);
}
.stickers .sticker:hover {
  transform: rotate(-7deg) scale(1.07);
}
.sticker[aria-pressed="true"] {
  background: var(--ink);
  color: var(--hi);
}
.sticker svg {
  width: 46px;
  height: 46px;
}
.sticker .d {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.kit-desc {
  margin: 0 0 12px;
  min-height: 1.3em;
  font-size: clamp(19px, 1.7vw, 24px);
}

/* Contact: the blackboard */
.board {
  background: var(--board);
  color: var(--chalk);
  border: 5px solid var(--ink);
  border-top-width: 16px;
  border-radius: 6px 10px 8px 12px;
  padding: 16px clamp(16px, 3vw, 36px) 18px;
}
.board h2 {
  color: var(--hi);
}
.board .back {
  background: transparent;
  border-color: var(--chalk);
  color: var(--chalk);
}
.chalk-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: 10px 22px;
}
.chalk-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 4px 14px;
  border: 2px dashed rgba(243, 245, 238, 0.5);
  border-radius: var(--wob-a);
  color: var(--chalk);
  text-decoration: none;
}
.chalk-list li:nth-child(even) a {
  border-radius: var(--wob-b);
}
.chalk-list a:hover {
  border-style: solid;
  border-color: var(--hi);
  color: var(--hi);
}
.chalk-list svg {
  flex: none;
  width: 30px;
  height: 30px;
}
.chalk-list a:hover svg {
  animation: twist 0.5s ease-in-out;
}
.chalk-list .k {
  display: block;
  color: var(--hi);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.1;
}
.chalk-list .v {
  display: block;
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.chalk-note {
  margin: 12px 0 0;
  color: rgba(243, 245, 238, 0.82);
  font-size: clamp(16px, 1.35vw, 19px);
}
.game .panel.open .chalk-list > li {
  animation: writeIn 0.4s both;
  animation-delay: calc(var(--i) * 0.12s + 0.5s);
}
@keyframes writeIn {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

/* tired card and shared buttons */
.tipcard {
  position: absolute;
  z-index: 3;
  right: var(--gutter-r);
  bottom: 34px;
  width: min(470px, calc(100% - var(--zone, 300px) - var(--gutter-r)));
  padding: 18px 24px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 225px 15px 255px/255px 15px 225px 20px;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.3s,
    transform 0.3s;
  -webkit-user-select: text;
  user-select: text;
}
.tipcard.open {
  opacity: 1;
  transform: none;
}
.tipcard[hidden] {
  display: none;
}
.tipcard .treats {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}
.tipcard h2 {
  margin: 8px 0 4px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 2.8vw, 40px);
  line-height: 1.1;
}
.tipcard p {
  margin: 0 0 10px;
}
.tip-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}
.cta {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 6px 26px;
  background: var(--hi);
  border: 3px solid var(--ink);
  border-radius: var(--wob-a);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 2.2vw, 30px);
  text-decoration: none;
  cursor: pointer;
}
.linkish {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(19px, 1.7vw, 24px);
  text-decoration: underline;
  cursor: pointer;
}
.note {
  color: var(--pencil);
  font-size: clamp(16px, 1.4vw, 20px);
}

/* ---- ground and footer ---- */
.ground {
  flex: none;
  border-top: 4px solid var(--ink);
  overflow: hidden;
}
.hatch {
  height: 14px;
  width: calc(100% + 60px);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--ink) 0 2px,
    transparent 2px 14px
  );
}
.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 32px;
  padding: 8px var(--gutter-r) clamp(8px, 2vh, 18px) var(--gutter);
}
.hints {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 32px;
  color: var(--pencil);
  font-size: clamp(17px, 1.55vw, 22px);
}
.controls {
  display: flex;
  gap: 12px;
  margin-left: auto;
}
.ctl {
  min-height: 44px;
  padding: 4px 16px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--wob-a);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(17px, 1.55vw, 22px);
  cursor: pointer;
}
.ctl:nth-child(even) {
  border-radius: var(--wob-b);
}
.plane {
  position: absolute;
  z-index: 5;
  width: 44px;
  height: 44px;
  pointer-events: none;
  animation: fly 1.2s ease-in forwards;
}
@keyframes fly {
  0% {
    transform: translate(0, 0) rotate(0);
  }
  30% {
    transform: translate(60px, -30px) rotate(-12deg);
  }
  100% {
    transform: translate(70vw, -60vh) rotate(-28deg);
    opacity: 0;
  }
}

@media (max-width: 700px) {
  .hud {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 2px 0 0;
  }
  .hud .date,
  .hud .best,
  .hud .dist .lbl,
  .energy .lbl {
    display: none;
  }
  .tally {
    gap: 10px;
  }
  .cells i {
    width: 13px;
    height: 13px;
  }
  .cells {
    gap: 3px;
  }
  .boxes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .box {
    min-width: 0;
  }
  .panel {
    top: 6px;
    left: var(--gutter);
    max-height: calc(100% - var(--pbot, 120px));
  }
  .sheet {
    padding: 10px 12px 14px 44px;
  }
  .tipcard {
    left: auto;
    right: var(--gutter-r);
    bottom: auto;
    top: 6px;
    width: min(310px, calc(100% - 112px));
    padding: 10px 14px;
  }
  .tipcard .treats,
  .tipcard p:not(.note) {
    display: none;
  }
  .wide-only {
    display: none;
  }
  .num {
    white-space: nowrap;
  }
  .board {
    padding: 8px 10px 12px;
  }
  .strip,
  .cards {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    margin-right: -12px;
    padding: 6px 14px 8px 3px;
    scrollbar-width: thin;
  }
  .strip li {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
  .cards li {
    flex: 0 0 148px;
    scroll-snap-align: start;
  }
  .card {
    height: 188px;
  }
  .stickers {
    gap: 14px 12px;
    margin: 10px 0;
  }
  .sticker {
    width: 80px;
    height: 80px;
    font-size: 14px;
    box-shadow:
      0 0 0 4px var(--sheet),
      0 0 0 5.5px rgba(23, 52, 155, 0.32);
  }
  .sticker svg {
    width: 30px;
    height: 30px;
  }
  .chalk-list a {
    padding: 2px 10px;
    gap: 10px;
  }
  .chalk-list svg {
    width: 25px;
    height: 25px;
  }
  .chalk-note {
    margin-top: 8px;
  }
  .panel-head {
    flex-wrap: nowrap;
    align-items: flex-start;
    margin-bottom: 4px;
  }
  .panel h2 {
    font-size: 26px;
  }
  .back {
    flex: none;
    width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 0;
    line-height: 0;
  }
  .back::before {
    content: "\00d7";
    font-size: 32px;
    line-height: 40px;
  }
  .chalk-list {
    gap: 4px;
  }
  .chalk-list a {
    min-height: 46px;
  }
  .board {
    border-top-width: 12px;
  }
  .tipcard h2 {
    margin: 0 0 6px;
    font-size: 25px;
  }
  .tipcard .note {
    margin: 4px 0 0;
    font-size: 16px;
    line-height: 1.2;
  }
  .tip-actions {
    gap: 2px 16px;
  }
  .cta {
    min-height: 48px;
    padding: 4px 16px;
    font-size: 22px;
  }
  .boxed .hud {
    display: none;
  }
  .boxed .boxes,
  .resting .boxes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .boxed .box,
  .resting .box {
    font-size: 17px;
    min-height: 44px;
    padding: 2px;
  }
}
@media (max-width: 380px) {
  .cells i {
    width: 10px;
    height: 10px;
  }
  .tally {
    gap: 7px;
  }
  .chip {
    font-size: 18px;
  }
  .sticker {
    width: 72px;
    height: 72px;
    font-size: 13px;
  }
  .stickers {
    gap: 12px 10px;
  }
}
@media (min-width: 701px) and (max-height: 820px) {
  .boxed .boxes {
    padding-top: 10px;
  }
  .boxed .box {
    min-height: 46px;
  }
  .frame svg {
    max-height: 74px;
  }
}
@media (max-height: 480px) {
  .top {
    padding-top: 6px;
  }
  .name {
    font-size: clamp(30px, 5vw, 40px);
  }
  .hud .date,
  .hud .best {
    display: none;
  }
  .hud {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }
  .boxes {
    padding-top: 4px;
    gap: 10px;
  }
  .box {
    min-height: 44px;
    min-width: 96px;
    padding: 2px 12px;
    font-size: 20px;
  }
  .foot-row {
    padding-top: 2px;
    padding-bottom: 4px;
  }
  .hints {
    font-size: 16px;
  }
  .boxed .top {
    display: none;
  }
  .tipcard {
    bottom: auto;
    top: 4px;
    max-height: calc(100% - 8px);
    overflow: auto;
    padding: 8px 16px;
  }
  .tipcard .treats,
  .tipcard p:not(.note) {
    display: none;
  }
  .tipcard h2 {
    margin: 0 0 4px;
    font-size: 24px;
  }
}
@media (max-height: 640px) {
  .boxes {
    padding-top: 8px;
  }
  .box {
    min-height: 44px;
  }
}
.cta[hidden],
.chalk-list > li[hidden] {
  display: none;
}

/* Plain version: no game, everything readable top to bottom. Also what shows if scripts are off. */
html:not(.game) .page {
  height: auto;
  min-height: 100%;
  overflow: visible;
  -webkit-user-select: text;
  user-select: text;
}
html:not(.game) .stage {
  overflow: visible;
  min-height: 0;
}
html:not(.game) #game,
html:not(.game) .bubble,
html:not(.game) .factnote,
html:not(.game) .hud,
html:not(.game) .hints,
html:not(.game) .tipcard,
html:not(.game) #soundBtn,
html:not(.game) .back,
html:not(.game) .boxes,
html:not(.game) .ground .hatch,
html:not(.game) .fact-row,
html:not(.game) .fact-read,
html:not(.game) .front .tap,
html:not(.game) #kitGo,
html:not(.game) .kit-desc,
html:not(.game) .chalk-note {
  display: none;
}
html:not(.game) .panel,
html:not(.game) .panel[hidden] {
  display: block;
  position: static;
  transform: none;
  animation: none;
  max-width: 880px;
  max-height: none;
  overflow: visible;
  margin: 22px var(--gutter-r) 28px var(--gutter);
}
html:not(.game) .facts-all {
  display: block;
}
html:not(.game) .card {
  height: auto;
  transform: none !important;
  cursor: default;
}
html:not(.game) .face {
  position: static;
  transform: none;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
}
html:not(.game) .front {
  border-bottom: 0;
  border-radius: 10px 14px 0 0;
}
html:not(.game) .flip {
  border-radius: 0 0 9px 16px;
}
html:not(.game) .stickers {
  gap: 10px;
}
html:not(.game) .sticker {
  width: auto;
  height: auto;
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--wob-a);
  box-shadow: none;
  transform: none;
  cursor: default;
  flex: 1 1 280px;
  text-align: left;
  font-size: 22px;
}
html:not(.game) .sticker .d {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
  font-family: var(--body);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.2;
  margin-left: 6px;
}
html:not(.game) .frame,
html:not(.game) .fact-btn {
  cursor: default;
}
html:not(.game) .ground {
  margin-top: 20px;
}

@media (prefers-reduced-motion: reduce) {
  .panel.open,
  .panel.closing,
  .board.open,
  .board.closing,
  .factnote.in,
  .plane,
  .box.nudge,
  .chip.bump,
  .game .panel.open .chalk-list > li {
    animation: none;
  }
  .bubble,
  .box,
  .tipcard,
  .card,
  .sticker,
  .frame {
    transition: none;
  }
  .frame:hover .go,
  .frame.play .go,
  .chalk-list a:hover svg {
    animation: none;
  }
}
