:root {
  color-scheme: dark;
  --bar: #0d0b05;
  --ink: #d6be60;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  /* iOS tints the status bar area from the page background. */
  background: var(--bar);
}

body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bar);
  color: var(--ink);
  font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace;
  /* Stop the page itself bouncing, zooming or selecting like a website. */
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#hud {
  position: absolute;
  /* Keep clear of the notch and status bar when installed. */
  top: calc(env(safe-area-inset-top) + 12px);
  left: calc(env(safe-area-inset-left) + 14px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
  text-shadow: 0 0 6px #000;
  opacity: 0.85;
}

#rec {
  color: #ff5a48;
  letter-spacing: 0.08em;
}

#sigils {
  color: #8fd0ff;
  font-size: 18px;
  letter-spacing: 0.2em;
}

#mini {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  right: calc(env(safe-area-inset-right) + 12px);
  width: 132px;
  height: 132px;
  background: rgba(8, 7, 3, 0.72);
  border: 1px solid rgba(214, 190, 96, 0.35);
}

#full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 7, 3, 0.9);
}

#legend {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 28px);
  margin: 0;
  text-align: center;
  opacity: 0.7;
  pointer-events: none;
}

#msg {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: calc(env(safe-area-inset-bottom) + 56px);
  margin: 0;
  text-align: center;
  text-shadow: 0 0 8px #000, 0 0 2px #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s;
}

#msg.on {
  opacity: 0.9;
}

.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background: rgba(8, 7, 3, 0.78);
}

#end {
  background: rgba(244, 240, 222, 0.94);
  color: #2a2410;
}

.card h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
}

.card p {
  margin: 0;
}

.card small {
  opacity: 0.6;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.2;
  }
}
