/* Colors pulled from the tileset so the page feels like part of the dungeon */
:root {
  --bg: #181425;        /* same as the game background */
  --stone: #3a2f4a;
  --stone-light: #5a4d6e;
  --text: #f4f0f8;
  --muted: #a99bb9;
}

/* Elements with the hidden attribute stay hidden even if a rule below gives
   them a display value */
[hidden] { display: none !important; }

/* Atkinson Hyperlegible: a font made by the Braille Institute to be as easy
   to read as possible. It comes with the game (assets/fonts) instead of
   using each device's own font, so the strip's text is the same width
   everywhere. Two files per weight: basic Latin, and extra Latin letters
   (like Turkish ş, ğ, İ), which the browser only downloads if a page needs
   them. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 400;
  src: url("assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 400;
  src: url("assets/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 700;
  src: url("assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 700;
  src: url("assets/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
}

/* The game fills the page */
body {
  display: flex;
  flex-direction: column;
}

button {
  font: inherit;
  color: var(--text);
  background: var(--stone);
  border: 2px solid var(--stone-light);
  border-radius: 6px;
  cursor: pointer;
}

button:hover { background: var(--stone-light); }

/* ---- The stage: the strip and the game, as one picture ---- */

#game {
  position: relative;
  flex: 1;
  min-height: 0; /* lets the game shrink to fit */
  overflow: hidden;
  /* center the stage in whatever space there is */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Everything on the stage is sized in game pixels: --gp is how many CSS
   pixels one game pixel is right now (display.js sets it). So the strip
   grows and shrinks together with the game, and keeps its shape. */
#stage {
  --gp: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#game canvas {
  image-rendering: pixelated; /* scale up with hard pixel edges, no blur */
}

/* The strip above the game: a hint or the button for what you're standing at on the left,
   depth and time on the right. Its text has a smallest size, so it stays
   readable on phones. */
#strip {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: calc(6 * var(--gp));
  width: calc(320 * var(--gp));
  height: calc(12 * var(--gp));
  padding: 0 calc(4 * var(--gp));
  font-size: max(calc(7.5 * var(--gp)), 10px);
  color: var(--muted);
  white-space: nowrap;
}

#door-hint {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#door-button {
  height: calc(11 * var(--gp));
  padding: 0 calc(5 * var(--gp));
  border-width: max(1px, calc(0.6 * var(--gp)));
  border-radius: calc(2 * var(--gp));
  font-size: inherit;
  font-weight: 600;
}

#progress {
  margin-left: auto;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

kbd {
  margin-left: 0.6em;
  padding: 0 0.35em;
  font-family: inherit;
  font-size: 0.8em;
  color: var(--muted);
  border: 1px solid var(--stone-light);
  border-radius: 3px;
}

/* The pixel font, for the keyboard notice */
@font-face {
  font-family: "Press Start 2P";
  src: url("assets/fonts/press-start-2p-latin-400-normal.woff2") format("woff2");
}

/* ---- The notice on phones and tablets (main.js) ---- */

#keyboard-notice {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(24, 20, 37, 0.92);
  color: var(--text);
  font-size: 18px;
}

#keyboard-notice[hidden] { display: none; }

#keyboard-notice p { margin: 0; }

#keyboard-notice .notice-title {
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #ffcd46;
}


