@font-face {
  font-family: Bangers;
  src: url(fonts/Bangers-Regular.ttf) format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --ink: #1a1208;
  --paper: #f3e2b8;
  --gold: #ffe56a;
  --sky: #3d6fa8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--sky);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
  font-family: Bangers, Impact, "Arial Black", sans-serif;
  color: var(--ink);
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#fontwarm {
  position: absolute;
  left: -999px;
  top: -999px;
  font-family: Bangers, Impact, sans-serif;
  font-size: 8px;
  opacity: 0;
  pointer-events: none;
}

#hud {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 10px;
  right: 70px;
  display: flex;
  gap: 8px;
  pointer-events: none;
  z-index: 3;
}

#hud[hidden] { display: none !important; }

.plaque {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 4px 10px 2px;
  min-width: 72px;
  line-height: 1;
}

.plaque .label {
  font-size: 11px;
  letter-spacing: 1px;
  color: #6a4a22;
}

.plaque .num {
  font-size: 26px;
  letter-spacing: 0.5px;
}

#mute {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 10px;
  width: 48px;
  height: 48px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  z-index: 5;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-appearance: none;
  appearance: none;
}

#mute:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

#mute svg {
  width: 26px;
  height: 26px;
  fill: var(--ink);
  stroke: none;
  grid-area: 1 / 1;
}

#mute .slash {
  fill: none;
  stroke: #c0261a;
  stroke-width: 3.4;
  stroke-linecap: round;
  display: none;
}

#mute[aria-pressed="true"] .slash { display: block; }

#overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 18px calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 4;
}

#overlay .copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

#overlay .copy[hidden] { display: none !important; }

.hint {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  color: var(--ink);
  background: rgba(243, 226, 184, 0.92);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 3px 3px 0 var(--ink);
  pointer-events: none;
}

.over-title {
  font-size: clamp(36px, 10vw, 54px);
  letter-spacing: 1px;
  text-align: center;
  color: #ffe56a;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 5px 0 var(--ink);
  line-height: 0.95;
}

.over-score {
  font-size: 22px;
  letter-spacing: 0.5px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 8px 16px;
  box-shadow: 3px 3px 0 var(--ink);
  text-align: center;
}

.comic-btn {
  pointer-events: auto;
  font-family: Bangers, Impact, "Arial Black", sans-serif;
  font-size: 32px;
  letter-spacing: 1px;
  background: var(--gold);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 5px 0 var(--ink);
  padding: 10px 28px 8px;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  min-height: 56px;
  min-width: 200px;
}

.comic-btn:active {
  transform: translate(2px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--paper);
  padding: 24px;
  text-align: center;
  font-size: 24px;
}
