:root {
  color-scheme: light;
  --paper: #eee9dc;
  --ink: #17181a;
  --orange: #ff593d;
  --blue: #245cff;
  --acid: #c8ff3d;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(rgba(23,24,26,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,24,26,.035) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.mark { display: flex; align-items: center; gap: 11px; }
.mark b {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
  font-size: 23px;
}
.mark span, .utility, footer, .index {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1.25;
}

.title { text-align: center; }
.title h1 { margin: 0; font-size: clamp(26px, 4vw, 48px); line-height: .9; letter-spacing: -.055em; }
.title p { margin: 5px 0 0; font-family: Georgia, serif; font-size: 13px; font-style: italic; }

.utility {
  justify-self: end;
  border: 1px solid var(--ink);
  padding: 10px 13px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.game-wrap {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: #111318;
  box-shadow: 9px 9px 0 var(--ink);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  touch-action: none;
  cursor: crosshair;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  background: rgba(238,233,220,.88);
  backdrop-filter: blur(6px);
  transition: opacity .2s ease, visibility .2s ease;
}
.overlay.visible { opacity: 1; visibility: visible; }

.card {
  width: min(610px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 12px 12px 0 var(--orange);
}
.index { margin: 0 0 14px; color: var(--blue); }
.card h2 {
  margin: 0;
  font-size: clamp(42px, 8vw, 80px);
  line-height: .84;
  letter-spacing: -.065em;
  text-transform: uppercase;
}
.card > p:not(.index):not(.insight) {
  max-width: 510px;
  margin: 24px 0;
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1.45;
}

.rule {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 22px 0;
}
.rule span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
  font-size: 10px;
  font-weight: 900;
}
.rule b { font-size: 9px; line-height: 1.2; letter-spacing: .08em; }

.primary {
  border: 2px solid var(--ink);
  padding: 14px 20px;
  color: var(--ink);
  background: var(--acid);
  box-shadow: 5px 5px 0 var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.primary:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.primary:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.card small { margin-left: 17px; font-size: 10px; font-weight: 700; }

.results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 25px 0 15px;
  border: 2px solid var(--ink);
}
.results div { padding: 14px; border-right: 1px solid var(--ink); }
.results div:last-child { border-right: 0; }
.results strong { display: block; font-size: 30px; }
.results span { font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.insight { min-height: 46px; font-family: Georgia, serif; line-height: 1.45; }

.pause {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 12px 16px;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-2deg);
  border: 2px solid var(--paper);
  color: var(--paper);
  background: var(--blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .13em;
  pointer-events: none;
}
.pause.visible { opacity: 1; }

footer {
  display: flex;
  justify-content: space-between;
  padding: 15px 0 0;
}

@media (max-width: 700px) {
  .shell { width: min(100% - 14px, 1180px); padding-top: 10px; }
  .topbar { grid-template-columns: 1fr auto; }
  .title { grid-column: 1 / -1; grid-row: 2; }
  .rule { grid-template-columns: auto 1fr; }
  .card small { display: block; margin: 14px 0 0; }
  .game-wrap { box-shadow: 5px 5px 0 var(--ink); }
  footer { flex-direction: column; gap: 6px; }
}
