:root {
  --ink: #1c2a26;
  --muted: #3e5650;
  --paper: #f3efe4;
  --line: #24312c;
  --sky: #7ec8c0;
  --danger: #9a3030;
  --good: #1f6b38;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, #c5ebe4 0%, transparent 42%),
    var(--sky);
  color: var(--ink);
  font-family: "Courier New", Courier, ui-monospace, monospace;
}

.page {
  width: min(1140px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 32px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.round {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.difficulty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.difficulty span {
  margin-right: 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.difficulty button {
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--line);
  padding: 4px 8px;
  cursor: pointer;
}

.difficulty button.on {
  background: var(--line);
  color: #f3efe4;
}

.hud {
  display: grid;
  grid-template-columns: auto auto 1.4fr auto auto auto;
  gap: 14px 18px;
  align-items: end;
  margin-bottom: 10px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.stat span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat em {
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
}

.pips {
  display: flex;
  gap: 6px;
  height: 22px;
  align-items: center;
}

.pip {
  width: 18px;
  height: 14px;
  background: #c4473a;
  border: 2px solid var(--line);
}

.pip.off {
  background: transparent;
}

.bar {
  height: 14px;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

#catcher-fill {
  height: 100%;
  width: 0%;
  background: #3f8f32;
}

.stage {
  position: relative;
  outline: none;
  border: 4px solid var(--line);
  background: #8fd0c8;
  line-height: 0;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(20, 42, 40, 0.28);
}

.overlay.hidden {
  display: none;
}

.card {
  width: min(440px, calc(100% - 36px));
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--line);
  padding: 22px 22px 18px;
  text-align: center;
}

.card h2 {
  margin: 0 0 8px;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.card p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.45;
}

.card .go {
  margin-top: 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overlay.splash {
  background: #16343a;
  overflow: hidden;
}

.overlay.splash .card {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.overlay.splash img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.overlay.splash .go {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 14px;
  background: var(--paper);
  border: 3px solid var(--line);
  color: var(--ink);
}

.controls {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

#timer.warn,
#left.warn {
  color: var(--danger);
}

#status.wet {
  color: #1d5f9a;
}

#status.dry {
  color: var(--good);
}

@media (max-width: 800px) {
  .hud {
    grid-template-columns: repeat(3, 1fr);
  }

  h1 {
    font-size: 32px;
  }
}
