:root {
  color-scheme: light;
  --ink: #233e33;
  --paper: #f4f0e3;
  --orange: #c54c30;
  --muted: #657268;
}
.masthead .edition {
  font: 10px monospace;
  letter-spacing: 1px;
}
.companion-link {
  display: block;
  width: fit-content;
  margin: 0 auto 24px;
  padding: 14px 20px;
  color: #233e33;
  font-size: 12px;
  border: 1px solid #bcc4b5;
  border-radius: 30px;
  text-decoration: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background-image: radial-gradient(#233e330e 0.8px, transparent 0.8px);
  background-size: 6px 6px;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 0 38px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #c54c30;
  outline-offset: 5px;
}
.masthead {
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.masthead a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.6px;
}
.masthead small {
  font-size: 10px;
  vertical-align: super;
  letter-spacing: 0;
  margin-left: 5px;
}
.brand-paw {
  color: var(--orange);
  font-size: 28px;
  vertical-align: middle;
  margin-right: 6px;
}
.edition {
  font: 10px monospace;
  letter-spacing: 2px;
}
.masthead button {
  background: transparent;
  border: 1px solid #bcc4b5;
  padding: 10px 14px;
  border-radius: 5px;
  color: var(--ink);
  font-size: 12px;
}
.cabinet {
  border: 9px solid var(--ink);
  border-radius: 18px;
  background: var(--ink);
  box-shadow:
    0 18px 0 -9px #c7cabb,
    0 25px 45px #233e331c;
}
.screen {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 8px;
  background: #b9dfda;
}
#world {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
#world:focus-visible {
  outline-offset: -4px;
}
.panel {
  position: absolute;
  inset: 0;
  padding: 5.3%;
  background: #f5f1e7ed;
  backdrop-filter: blur(6px);
}
[hidden] {
  display: none !important;
}
#menu {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 24px;
  align-content: center;
}
.eyebrow {
  font: 10px/1.5 monospace;
  font-weight: 700;
  letter-spacing: 1.8px;
  margin: 0 0 18px;
  color: #577363;
}
h1 {
  font-family: Georgia, serif;
  font-weight: normal;
  letter-spacing: -3px;
  line-height: 1.04;
  font-size: clamp(34px, 5.3vw, 66px);
  margin: 0 0 18px;
}
h1 em {
  color: var(--orange);
  font-weight: normal;
}
.intro {
  font-size: 14px;
  line-height: 1.7;
  max-width: 320px;
  color: #53685b;
  margin: 0 0 24px;
}
.primary {
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff9ec;
  padding: 17px 23px;
  font-size: 14px;
  font-weight: bold;
  min-height: 48px;
  box-shadow: 0 4px 0 #12251e;
  display: inline-flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
}
.primary:hover {
  background: #385d48;
  transform: translateY(-1px);
}
.primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #12251e;
}
.primary span {
  font-size: 22px;
}
.start-tip {
  font: 10px/1.5 monospace;
  color: #657268;
  margin: 16px 0 0;
}
.character-card {
  align-self: center;
  justify-self: end;
  width: 100%;
  max-width: 265px;
  text-align: center;
  background: #e6e8d8;
  border: 1px solid #bdcbb5;
  border-radius: 100px 100px 8px 8px;
  padding: 31px 18px 21px;
  transform: rotate(1deg);
}
.card-top {
  display: flex;
  justify-content: space-between;
  font: 8px monospace;
  letter-spacing: 1px;
  color: #516b58;
}
.character-card canvas {
  display: block;
  width: 160px;
  height: 143px;
  margin: 0 auto;
  image-rendering: pixelated;
}
.character-card strong {
  font:
    25px Georgia,
    serif;
}
.character-card p {
  font-size: 11px;
  line-height: 1.6;
  color: #526956;
  margin: 9px 0 16px;
}
.character-tag {
  font: 8px monospace;
  letter-spacing: 1px;
  border: 1px solid #9db197;
  border-radius: 20px;
  padding: 5px 9px;
}
.menu-bottom {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #cdd3c5;
  padding-top: 16px;
  margin-top: 4px;
  font: 9px monospace;
  color: #536b59;
  letter-spacing: 0.7px;
}
.cabinet-bottom {
  height: 37px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: #d0dbc7;
  font: 10px monospace;
  padding: 6px 12px;
}
.led {
  background: #a9cb8d;
  box-shadow: 0 0 7px #a9cb8d;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.serial {
  margin-left: auto;
  color: #adc0aa;
  font-size: 9px;
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 28px 4px;
  color: #6e796d;
}
footer > div {
  display: flex;
  align-items: center;
  gap: 6px;
}
footer span {
  font-size: 10px;
  margin-right: 10px;
}
kbd {
  background: #e9e8dd;
  border: 1px solid #c6cbbd;
  border-bottom-width: 3px;
  padding: 5px 6px;
  border-radius: 4px;
  font: 9px monospace;
  color: #455e4d;
}
footer p {
  font:
    italic 13px Georgia,
    serif;
  margin: 0;
}
#hud {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #233e33;
  pointer-events: none;
  gap: 10px;
}
.world-label,
.hud-right {
  padding: 9px 13px;
  border-radius: 6px;
  background: #f9f5e8e8;
  box-shadow: 0 2px 0 #233e3312;
}
.world-label span {
  font: 9px monospace;
  display: block;
  margin-bottom: 3px;
  color: #536b59;
}
.world-label strong {
  font:
    18px Georgia,
    serif;
}
.hud-right {
  display: flex;
  gap: 15px;
  align-items: center;
  font: 12px monospace;
}
.hud-right button {
  pointer-events: auto;
  border: 0;
  background: #dce5d3;
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 4px;
}
progress {
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  height: 3px;
  appearance: none;
  border: 0;
  background: #ffffff44;
}
progress::-webkit-progress-bar {
  background: #ffffff44;
}
progress::-webkit-progress-value {
  background: #c54c30;
}
.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.centered h2 {
  font:
    normal clamp(24px, 3.4vw, 43px)/1.1 Georgia,
    serif;
  letter-spacing: -1px;
  margin: 0 0 10px;
}
.centered p {
  font-size: 13px;
  line-height: 1.6;
  color: #526956;
}
.centered .eyebrow {
  font-size: 10px;
}
.secondary {
  background: transparent;
  border: 0;
  padding: 10px;
  color: #526956;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: 38px;
}
.stars {
  color: #b65c20;
  font-size: 37px;
  letter-spacing: 8px;
  margin-bottom: 13px;
}
.results {
  display: flex;
  gap: 40px;
  margin: 14px 0 0;
}
.results dt {
  font: 8px monospace;
  color: #536b59;
  letter-spacing: 1px;
}
.results dd {
  font:
    25px Georgia,
    serif;
  margin: 8px 0 0;
}
.star-guide {
  font-size: 10px !important;
  margin: 15px 0 20px;
}
#touch {
  display: none;
  justify-content: space-between;
  padding: 20px 0;
  touch-action: none;
}
#touch > div {
  display: flex;
  gap: 10px;
}
#touch button {
  touch-action: none;
  user-select: none;
  border: 1px solid #adbaaa;
  border-bottom: 4px solid #859983;
  background: #e2e8d7;
  color: #233e33;
  border-radius: 12px;
  min-width: 58px;
  min-height: 56px;
  font-size: 18px;
}
#touch button:active {
  background: #c1d1ae;
}
.jump {
  background: #233e33 !important;
  color: #fff1d7 !important;
  padding-inline: 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 850px) {
  main {
    padding: 0 18px;
  }
  .masthead {
    height: 76px;
  }
  .edition {
    display: none;
  }
  .panel {
    padding: 4%;
  }
  .character-card {
    max-width: 210px;
    padding: 20px 13px 16px;
  }
  .character-card canvas {
    width: 125px;
    height: 112px;
  }
  .character-card strong {
    font-size: 21px;
  }
  .eyebrow {
    font-size: 8px;
    margin-bottom: 12px;
  }
  h1 {
    font-size: 43px;
  }
  .intro {
    font-size: 12px;
    margin-bottom: 16px;
  }
  .primary {
    padding: 13px 18px;
  }
  .menu-bottom {
    font-size: 7px;
    padding-top: 10px;
  }
  #menu {
    gap: 14px;
  }
  footer p {
    display: none;
  }
  .results {
    gap: 24px;
  }
}
@media (pointer: coarse), (max-width: 700px) {
  #touch:not([hidden]) {
    display: flex;
  }
}
@media (max-width: 600px) {
  main {
    padding: 0 10px;
  }
  .masthead {
    height: 64px;
  }
  .masthead a {
    font-size: 15px;
  }
  .masthead button {
    font-size: 10px;
  }
  .cabinet {
    border-width: 6px;
    border-radius: 12px;
  }
  .screen {
    aspect-ratio: 4/5;
  }
  #world {
    height: 100%;
    width: 100%;
  }
  #menu {
    display: flex;
    flex-direction: column;
    padding: 27px 25px;
    gap: 18px;
    justify-content: center;
  }
  .menu-copy {
    z-index: 1;
  }
  h1 {
    font-size: 43px;
    letter-spacing: -2px;
  }
  .intro {
    max-width: 270px;
    font-size: 12px;
  }
  .character-card {
    display: none;
  }
  .menu-bottom {
    font-size: 8px;
    gap: 14px;
    line-height: 1.6;
    flex-wrap: wrap;
  }
  .start-tip {
    font-size: 9px;
  }
  .cabinet-bottom {
    font-size: 9px;
    height: 46px;
    line-height: 1.4;
  }
  .serial {
    display: none;
  }
  #hud {
    left: 10px;
    right: 10px;
    top: 10px;
  }
  .world-label {
    padding: 8px;
  }
  .world-label strong {
    font-size: 15px;
  }
  .hud-right {
    padding: 5px;
    gap: 6px;
    font-size: 10px;
  }
  footer {
    padding: 20px 2px;
  }
  footer > div {
    flex-wrap: wrap;
    gap: 4px;
  }
  footer span {
    font-size: 9px;
    margin-right: 6px;
  }
  .results {
    gap: 20px;
  }
  .results dt {
    font-size: 7px;
  }
  .centered h2 {
    font-size: 30px;
  }
  .centered {
    padding: 20px;
  }
  .star-guide {
    max-width: 230px;
  }
  .screen:has(#menu[hidden]):has(#result[hidden]):has(#pause[hidden]) {
    aspect-ratio: 32/27;
  }
}
@media (max-height: 500px) and (min-width: 601px) {
  main {
    max-width: 850px;
  }
  .masthead {
    height: 44px;
  }
  .screen {
    max-height: 360px;
  }
  .cabinet-bottom {
    height: 25px;
  }
  footer {
    padding: 10px;
  }
  h1 {
    font-size: 36px;
  }
  .character-card {
    padding: 16px 10px;
  }
  .character-card canvas {
    width: 100px;
    height: 90px;
  }
  .intro {
    margin-bottom: 12px;
  }
  .menu-bottom {
    margin-top: 0;
  }
  .centered .secondary {
    min-height: 30px;
    padding: 6px;
  }
  .centered .eyebrow {
    margin-bottom: 6px;
  }
  .centered p {
    margin: 5px;
  }
  .results {
    margin: 8px;
  }
  .stars {
    font-size: 26px;
    margin: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
