@font-face {
  font-family: Bangers;
  src: url(fonts/Bangers-Regular.ttf) format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
:root {
  --ink: #0c0a08;
  --paper: #efe4c8;
  --gold: #ffe56a;
  --green: #7dffb0;
  --bg: #07140f;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  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(--paper);
}
#app { position: fixed; inset: 0; width: 100%; height: 100%; }
#bg, #game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#bg { z-index: 0; }
#game { z-index: 1; }
#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;
  flex-wrap: wrap;
  pointer-events: none;
  z-index: 3;
}
#hud[hidden] { display: none !important; }
.plaque {
  background: rgba(12, 18, 14, 0.72);
  border: 1px solid rgba(125, 255, 176, 0.45);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 4px 10px 2px;
  min-width: 68px;
  line-height: 1;
  backdrop-filter: blur(6px);
}
.plaque .label { font-size: 10px; letter-spacing: 1px; color: #9ad9b0; }
.plaque .num, .plaque .era { font-size: 22px; color: #f4ffe8; }
#mute {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 10px;
  width: 48px; height: 48px;
  border: 1px solid rgba(125, 255, 176, 0.5);
  border-radius: 50%;
  background: rgba(12, 18, 14, 0.8);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  z-index: 6;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-appearance: none;
  appearance: none;
}
#mute:active { transform: translate(1px, 1px); }
#mute svg { width: 26px; height: 26px; fill: #e8ffd8; stroke: none; grid-area: 1/1; }
#mute .slash { fill: none; stroke: #ff6b6b; stroke-width: 3.4; stroke-linecap: round; display: none; }
#mute[aria-pressed="true"] .slash { display: block; }

#gate, #overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
}
#gate {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 30%, rgba(40, 90, 60, 0.55), rgba(4, 8, 6, 0.88));
  backdrop-filter: blur(10px);
}
#gate[hidden], #overlay[hidden] { display: none !important; }
.gate-card {
  width: min(420px, 100%);
  text-align: center;
  background: rgba(10, 16, 12, 0.82);
  border: 1px solid rgba(125, 255, 176, 0.4);
  border-radius: 18px;
  padding: 28px 22px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.gate-18 {
  font-size: 64px;
  color: #ffe56a;
  text-shadow: 0 0 24px rgba(255, 220, 80, .45);
  line-height: 1;
}
.gate-card h1 {
  font-size: clamp(28px, 8vw, 42px);
  margin: 8px 0 10px;
  color: #f4ffe8;
  line-height: 0.95;
}
.gate-card p {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.4;
  color: #cfe8d4;
  margin: 0 0 18px;
}
#overlay {
  pointer-events: none;
  top: auto;
  height: auto;
  bottom: 0;
  left: 0; right: 0;
  padding: 0 18px calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 4;
  background: none;
}
#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: #0c0a08;
  background: rgba(239, 228, 200, 0.92);
  border: 1px solid rgba(12,10,8,.35);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.over-title {
  font-size: clamp(32px, 9vw, 50px);
  letter-spacing: 1px;
  text-align: center;
  color: #ffe56a;
  text-shadow: 0 2px 0 #0c0a08, 0 0 22px rgba(255, 180, 60, .45);
  line-height: 0.95;
}
.over-score {
  font-size: 20px;
  background: rgba(12, 18, 14, 0.82);
  border: 1px solid rgba(125, 255, 176, 0.4);
  border-radius: 12px;
  padding: 8px 16px;
  text-align: center;
  color: #f4ffe8;
}
.comic-btn {
  pointer-events: auto;
  font-family: Bangers, Impact, "Arial Black", sans-serif;
  font-size: 28px;
  letter-spacing: 1px;
  background: linear-gradient(#ffe56a, #f0b430);
  color: #0c0a08;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 0 #5a3a10, 0 12px 24px rgba(0,0,0,.4);
  padding: 10px 24px 8px;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  min-height: 56px;
  min-width: 200px;
}
.comic-btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #5a3a10, 0 8px 16px rgba(0,0,0,.35);
}
noscript {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: #efe4c8; color: #0c0a08; padding: 24px; text-align: center; font-size: 24px;
}
