* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #000;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

h1, #about {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: start;
  padding: calc(clamp(20px, 4vw, 44px) + env(safe-area-inset-top)) calc(clamp(20px, 4vw, 44px) + env(safe-area-inset-right)) 0 calc(clamp(20px, 4vw, 44px) + env(safe-area-inset-left));
  mix-blend-mode: difference;
  pointer-events: none;
}

h1[hidden], #about[hidden] { display: none; }

#logo {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
}

#logo svg {
  display: block;
  width: 100%;
  height: auto;
  fill: #fff;
}

#about div {
  width: 100%;
  cursor: pointer;
  pointer-events: auto;
}

#about svg {
  display: block;
  height: auto;
  fill: #fff;
}

#about .wide { width: 100%; }
#about .narrow { display: none; width: 100%; }

@media (max-width: 719px) {
  #about .wide { display: none; }
  #about .narrow { display: block; }
}

#gate {
  position: fixed;
  left: calc(clamp(20px, 4vw, 44px) + env(safe-area-inset-left));
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: min(100vw - 2 * clamp(20px, 4vw, 44px) - env(safe-area-inset-left) - env(safe-area-inset-right), 400px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  background: rgba(0, 0, 0, 0.985);
  color: #fff;
  font: 500 12px/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: default;
}

#gate p:last-child { display: flex; gap: 0.9em; margin-top: 6px; }

#pse {
  font: 400 13px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-transform: none;
  text-align: start;
  opacity: 0.72;
}

@media (max-height: 480px) {
  #logo { max-width: 105vh; }
  #gate { padding: 14px 18px; gap: 8px; }
}

#gate button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: #fff;
  background: none;
  border: 1px solid #fff;
  padding: 0.85em 1.5em;
  cursor: pointer;
}

#gate button:hover, #gate button:focus-visible { background: #fff; color: #000; outline: none; }

#bar {
  position: fixed;
  left: calc(clamp(20px, 4vw, 44px) + env(safe-area-inset-left));
  right: calc(clamp(20px, 4vw, 44px) + env(safe-area-inset-right));
  bottom: calc(28px + env(safe-area-inset-bottom));
  height: 44px;
  mix-blend-mode: difference;
  pointer-events: none;
}

#bar > * {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.6s, left 0.7s cubic-bezier(0.6, 0, 0.2, 1);
}

#bar > #mastodon { left: calc(100% - 44px); }

#bar > .gone {
  color: #000;
  visibility: hidden;
  pointer-events: none;
  transition: color 0.6s, visibility 0s 0.6s;
}

#bar.away > *, #bar > #play.away { color: #000; pointer-events: none; }

#bar svg { display: block; }

#bar button svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#mastodon svg { width: 30px; height: 30px; fill: currentColor; }

#play .go { fill: currentColor; }
#play .stop { display: none; stroke-width: 7; stroke-linecap: butt; }
#play.playing .go { display: none; }
#play.playing .stop { display: inline; }

#mute .off { display: none; }
#mute.muted .on { display: none; }
#mute.muted .off { display: inline; }

#note {
  position: fixed;
  left: 0;
  bottom: 90px;
  width: max-content;
  color: #000;
  font: 500 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  mix-blend-mode: difference;
  pointer-events: none;
  transition: color 0.4s;
}

#note.show { color: #fff; }
