@font-face {
  font-family: "W95FA";
  src: url("assets/W95FA.otf") format("opentype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #141414;
  --face: #c0c0c0;
  --light: #ffffff;
  --shadow: #404040;
  --ink: #000000;
  --muted: #3c3c3c;
  --title-a: #000080;
  --title-b: #1084d0;
  --link: #000080;
}

/* The unlisted edition gets a slightly less official title bar. */
body.unlisted {
  --title-a: #5a0000;
  --title-b: #b0402c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font-family: "W95FA", "MS Sans Serif", Tahoma, system-ui, sans-serif;
}

#wall {
  position: fixed;
  inset: 0;
}

.panel {
  position: fixed;
  z-index: 10;
  background: var(--face);
  border: 2px solid;
  border-color: var(--light) var(--shadow) var(--shadow) var(--light);
  box-shadow: 1px 1px 0 var(--ink);
}

.title {
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
}

.titlebar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 6px;
  font-size: 14px;
  color: var(--light);
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
}

.titlebar .ro { opacity: 0.85; }

.body {
  display: grid;
  gap: 2px;
  padding: 8px 10px 10px;
}

h1 {
  margin: 0 0 2px;
  font-size: 26px;
  font-weight: normal;
  letter-spacing: 3px;
}

.body p {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.muted { color: var(--muted); }

.body .note {
  margin-top: 8px;
  font-size: 14px;
}

.note a { color: var(--link); }

.controls {
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  gap: 4px;
  padding: 4px;
}

.controls button {
  width: 38px;
  height: 34px;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
  background: var(--face);
  border: 2px solid;
  border-color: var(--light) var(--shadow) var(--shadow) var(--light);
  cursor: pointer;
}

.controls button:active {
  border-color: var(--shadow) var(--light) var(--light) var(--shadow);
}

.controls button:focus-visible {
  outline: 1px dotted var(--ink);
  outline-offset: -6px;
}

.hint {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 4px 10px;
  font-size: 14px;
  white-space: nowrap;
  color: var(--light);
  background: rgba(0, 0, 0, 0.65);
  pointer-events: none;
  transition: opacity 0.6s;
}

.hint.gone { opacity: 0; }

.noscript {
  position: fixed;
  inset: auto 16px 50% 16px;
  margin: 0;
  text-align: center;
  color: var(--light);
}

@media (max-width: 520px) {
  h1 { font-size: 22px; }
  .hint { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 52px); }
}

@media (prefers-reduced-motion: reduce) {
  .hint { transition: none; }
}
