@font-face { font-family: "Dogica"; src: url("dogicapixel.ttf") format("truetype"); font-display: swap; }

:root {
  --ink: #4d332b;
  --paper: #f5f0ed;
  --grass: #36ae5c;
  --night: #141a1f;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--night);
}

body {
  color: var(--ink);
  font-family: "Dogica", ui-monospace, Menlo, monospace;
  font-size: 12px;
  line-height: 2;
  -webkit-font-smoothing: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

/* Clear of a phone's notch and rounded corners; the bands beside it stay the night colour. */
#game {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  right: env(safe-area-inset-right, 0);
  bottom: env(safe-area-inset-bottom, 0);
  left: env(safe-area-inset-left, 0);
}

/* Touches belong to the game: no pinch zoom, double-tap zoom or scrolling. */
#canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; background: var(--night); }

.cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  box-sizing: border-box;
  background: var(--paper);
  text-align: center;
}

.cover h1 { margin: 0; font-size: 16px; font-weight: 400; }
.cover p { margin: 0; max-width: 420px; }
#loading .version { margin-top: -8px; opacity: 0.6; font-size: smaller; }
.cover a { color: inherit; }

#bar { width: min(320px, 70vw); height: 16px; border: 4px solid var(--ink); padding: 2px; box-sizing: border-box; }
#fill { height: 100%; width: 0; background: var(--grass); }

#rotate { display: none; z-index: 2; }

/* What went wrong, over the bottom of the game, until tapped away. */
#error-detail {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  max-height: 45%;
  overflow: auto;
  z-index: 3;
  padding: 8px;
  background: var(--paper);
  border: 4px solid var(--ink);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  -webkit-user-select: text;
  user-select: text;
}

@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: flex; }
}
