/* Chromeosaurus styles. Positions of moving parts come from the custom
   properties --left and --bottom, set by the game modules. */
:root {
  --ink: #535353;
  --paper: #f7f7f7;
  --font-game: "Press Start 2P", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  user-select: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-game);
  color: var(--ink);
  background-color: var(--paper);
}

.page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.world {
  overflow: hidden;
  position: relative;
  touch-action: manipulation;
}

.hud {
  position: absolute;
  right: 1vmin;
  top: 1vmin;
  display: flex;
  align-items: center;
  gap: 1.5vmin;
  font-size: 2vmin;
}

.score {
  white-space: nowrap;
}

.mute {
  font-family: var(--font-game);
  font-size: 0.6em;
  color: var(--ink);
  border: 1px solid var(--ink);
  background-color: var(--paper);
  padding: 0.4em 0.6em;
  cursor: pointer;
}

.board {
  position: absolute;
  font-size: 1.4vmin;
  left: 1vmin;
  top: 1vmin;
}

.board-title {
  margin: 0 0 0.5em;
  font-size: 1em;
  font-weight: normal;
}

.board table {
  border-collapse: collapse;
}

.board th,
.board td {
  padding: 0.2em 0.6em 0.2em 0;
  text-align: left;
  font-weight: normal;
}

.board .is-me td {
  text-decoration: underline;
}

.board-status {
  margin: 0;
}

.start-screen {
  position: absolute;
  z-index: 1;
  font-size: 2vmin;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.name-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
}

.last-score {
  margin: 0;
  font-size: 0.8em;
}

.name,
.start {
  font-family: var(--font-game);
  font-size: 1em;
  color: var(--ink);
}

.name {
  width: 22ch;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background-color: transparent;
  text-align: center;
  user-select: text;
}

.start {
  border: 2px solid var(--ink);
  background-color: var(--paper);
  padding: 0.5em 1em;
  cursor: pointer;
}

.name:focus-visible,
.start:focus-visible,
.mute:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 4px;
}

.hint,
.help {
  margin: 0;
  font-size: 0.7em;
}

.hide {
  display: none;
}

.ground {
  --left: 0;

  position: absolute;
  width: 300%;
  bottom: 0;
  left: calc(var(--left) * 1%);
}

.clouds {
  --left: 0;

  position: absolute;
  top: 0;
  width: 150%;
  left: calc(var(--left) * 1%);
}

.dino {
  --bottom: 0;

  position: absolute;
  left: 1%;
  height: 30%;
  bottom: calc(var(--bottom) * 1%);
}

.cactus {
  position: absolute;
  left: calc(var(--left) * 1%);
  height: 30%;
  bottom: 0;
}
