@font-face {
  font-family: Areal;
  src: url("_source work/_fonts/ABCAreal-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Areal Mono;
  src: url("_source work/_fonts/ABCArealMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Areal Mono;
  src: url("_source work/_fonts/ABCArealMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Gummo Comic;
  src: url("_source work/_fonts/ComicSans MS.ttf") format("truetype");
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-block-size: 100dvh;
  background: white;
  color: black;
  font: 500 14px/18px Areal, Arial, sans-serif;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid black; outline-offset: 4px; }
p, h1, h2, dl, dd { margin: 0; }
img { display: block; }
a { color: inherit; }

.sky, .version, .window-drag-handle { display: none; }

.gummo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 402px);
  margin-inline: auto;
  padding: max(40px, env(safe-area-inset-top)) 0 max(36px, env(safe-area-inset-bottom));
  background: white;
}

.header {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  justify-items: center;
  min-height: 30px;
  padding-inline: 18px;
  margin-bottom: 30px;
}

.stage { display: contents; }

.stage h1 {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: center;
  margin-bottom: 30px;
  line-height: 0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 30px;
}

.sound-button, .sound-window { display: none; }

.content {
  grid-area: 2 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.display {
  position: relative;
  width: min(282px, calc(100% - 24px));
  aspect-ratio: 1;
  border: solid black;
  border-width: 4px 1px 1px 4px;
  overflow: hidden;
  background: white;
}

.pet {
  position: absolute;
  width: min(232px, 91%);
  height: auto;
  bottom: 9px;
  left: calc(50% - 1.5px);
  transform: translateX(-50%);
}

.display[data-mode="idle"] .pet { opacity: .22; }

.needs, .points {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  column-gap: 10px;
  justify-items: center;
}

.needs {
  position: absolute;
  inset: 16px 0 auto;
  justify-content: center;
  pointer-events: none;
  transform: translateX(-1.5px);
}

.need-icon { display: grid; }
.need-icon img { grid-area: 1 / 1; }
.need-fill { clip-path: inset(calc(100% - var(--need-fill, 0%)) 0 0); }

.notices, .panel {
  position: absolute;
  top: 55px;
  left: calc(50% - 1.5px);
  transform: translateX(-50%);
  width: min(202px, calc(100% - 24px));
  text-align: center;
}

.notices { pointer-events: none; }
.message, .panel, .points span { background: #e5e5e5; border: 1px solid black; }

.message {
  padding: 6px 17px 7px;
  font: 16px/20px Gummo Comic, cursive;
}

.warning { background: red; color: white; }
.warnings { display: grid; gap: 3px; }
.points { justify-content: center; }
.points span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 27px;
  padding-inline-end: 2px;
  padding-block-end: 1px;
  border-radius: 999px;
  font: 16px/20px Gummo Comic, cursive;
  grid-row: 1;
}
[data-point="feed"] { grid-column: 1; }
[data-point="clean"] { grid-column: 2; }
[data-point="heal"] { grid-column: 3; }

.panel {
  height: min(198px, calc(100% - 66px));
  text-transform: uppercase;
}

.results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  letter-spacing: .14px;
}

.results h2 { font: inherit; margin: 0 0 10px; }
.results dl {
  display: grid;
  grid-template-columns: auto 1fr;
  width: min(142px, calc(100% - 24px));
  font: 400 11px/20px Areal Mono, monospace;
  letter-spacing: .11px;
  text-align: left;
}
.results dd { text-align: right; }
.again {
  min-width: 64px;
  min-height: 36px;
  margin-top: 2px;
  letter-spacing: inherit;
  text-transform: inherit;
}

.death {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 28px;
}

.info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 19px 20px 14px;
  gap: 10px;
  background: white;
  font: 16px/24px Gummo Comic, cursive;
  overflow: auto;
}

.back {
  align-self: center;
  margin-top: 8px;
  min-height: 36px;
  min-width: 56px;
  font: 500 14px/18px Areal, Arial, sans-serif;
  text-transform: uppercase;
}

.actions { display: flex; gap: 25px; }

.square-button {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  min-width: 50px;
  text-transform: uppercase;
}

.square {
  display: block;
  width: 24px;
  height: 24px;
  border: solid black;
  border-width: 1px 2px 2px 1px;
}

.square-button:disabled .square { background: #e5e5e5; }
.square-button:not(:disabled):active .square,
.square-button[data-pressed="true"] .square {
  border: 0;
  background: url("assets/pressed.svg") center no-repeat;
}

.switch {
  display: grid;
  grid-template-columns: minmax(0, 92px) 76px minmax(0, 92px);
  align-items: center;
  gap: clamp(8px, 5vw, 20px);
  min-height: 44px;
  margin-block: -8px;
  max-width: calc(100% - 24px);
  text-transform: uppercase;
}

.track {
  display: flex;
  align-items: center;
  width: 76px;
  height: 28px;
  padding: 3px;
  border: solid black;
  border-width: 2px 1px 1px 2px;
}

.thumb {
  position: relative;
  width: 31px;
  height: 19px;
  background: red;
  border: solid black;
  border-width: 1px 2px 2px 1px;
  transform: translate3d(0, 0, 0);
  transition: transform 180ms ease-in-out;
  will-change: transform;
}
.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #40ff00;
  opacity: 0;
  transition: opacity 180ms ease-in-out;
}
.switch[aria-checked="true"] .thumb { transform: translate3d(36px, 0, 0); }
.switch[aria-checked="true"] .thumb::before { opacity: 1; }

.timer {
  font: 500 20px/20px Areal Mono, monospace;
  letter-spacing: .2px;
}

.score-history {
  width: min(282px, calc(100% - 24px));
  margin: -8px 0 -7px;
}

.score {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  font: 400 14px/30px Areal Mono, monospace;
  letter-spacing: .14px;
  text-transform: uppercase;
}

.score-day { width: 60px; }
.score-date { width: 80px; }
.score-count { width: 40px; }
.score td { padding: 0; }
.score td:nth-child(-n+2) { padding-inline-end: 20px; }
.score td:last-child { text-align: right; }
.test-indicator { font: 400 11px/16px Areal Mono, monospace; margin-top: -12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 280px) {
  .score-day { width: 22%; }
  .score-date { width: 29%; }
  .score-count { width: 15%; }
  .score td:nth-child(-n+2) { padding-inline-end: 12px; }
}

@media (min-width: 600px) {
  html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body {
    min-height: 0;
    background: #a6c1d1 url("_source work/desktop static bg - sky.png") center / cover;
  }

  .sky {
    display: block;
    position: fixed;
    width: 100%;
    height: 100%;
    inset: 0;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
  }

  .gummo {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 402px;
    height: min(694px, 100dvh);
    margin: auto;
    padding: 0;
    border: solid black;
    border-width: 1px 2px 2px 1px;
  }

  .gummo[data-moved] {
    inset: var(--window-y) auto auto var(--window-x);
    margin: 0;
  }

  .stage {
    display: block;
    flex: 1;
    min-height: 0;
    padding-top: 42px;
    overflow-y: auto;
    overscroll-behavior: none;
    scrollbar-width: none;
  }

  .stage:focus-visible { outline: 1px solid black; outline-offset: -2px; }

  .stage h1 {
    width: max-content;
    margin: 0 auto 32px;
  }

  .content {
    gap: 40px;
    padding-bottom: 36px;
  }

  .actions .square-button {
    gap: 20px;
    line-height: 10px;
    letter-spacing: .14px;
  }

  .switch { gap: 20px; }

  .score-history { margin: 10px 0 0; }

  .test-indicator {
    position: absolute;
    top: 14px;
    left: 160px;
    margin: 0;
  }

  .header {
    flex-shrink: 0;
    grid-template-columns: 1fr 60px 32px;
    grid-template-rows: 45px;
    padding: 0;
    margin: 0;
  }
  .window-drag-handle {
    display: block;
    grid-area: 1 / 1 / 2 / -1;
    align-self: stretch;
    width: 100%;
    border-bottom: 1px solid black;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }
  .window-drag-handle[data-dragging] { cursor: grabbing; }

  .version {
    display: block;
    grid-area: 1 / 1;
    justify-self: start;
    padding-left: 20px;
    font: 16px/24px Gummo Comic, cursive;
    pointer-events: none;
  }

  .info-button { grid-area: 1 / 2; width: 34px; }
  .sound-button { display: grid; grid-area: 1 / 3; width: 32px; margin-right: 8px; }
  .header .icon-button { translate: -5px; }

  .sound-window {
    --player-width: 320px;
    --player-height: 200px;
    --sound-window-width: calc(var(--player-width) + 3px);
    --sound-window-height: calc(var(--player-height) + 48px);
    position: fixed;
    z-index: 1;
    display: block;
    left: clamp(0px, var(--window-x), 100vw - var(--sound-window-width));
    top: clamp(0px, var(--window-y), 100dvh - var(--sound-window-height));
    width: var(--sound-window-width);
    border: solid black;
    border-width: 1px 2px 2px 1px;
    background: white;
  }

  .sound-window[data-moved] {
    left: var(--window-x);
    top: var(--window-y);
  }

  .sound-window-header { grid-template-columns: 1fr 38px; }
  .sound-window-header .version { font-weight: 400; }
  .sound-window-close { grid-area: 1 / 2; width: 32px; }

  .sound-player iframe {
    display: block;
    width: 100%;
    height: var(--player-height);
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sky { display: none; }
  .thumb, .thumb::before { transition: none; }
}
