:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080a0c;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #080a0c;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

button {
  color: inherit;
  font: inherit;
}

.prototype {
  display: grid;
  min-height: 100dvh;
  place-items: center;
}

.stage {
  --screen-ratio: 0.46258;
  position: relative;
  width: min(100vw, calc(100dvh * var(--screen-ratio)));
  height: min(100dvh, calc(100vw / var(--screen-ratio)));
  max-width: 100vw;
  max-height: 100dvh;
  overflow: hidden;
  background: #15191d;
  box-shadow: 0 0 80px rgb(0 0 0 / 55%);
  isolation: isolate;
}

#screen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}

.hotspots {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.hotspot {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hotspot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -3px;
  background: rgb(255 255 255 / 10%);
}

.menu-toggle {
  position: absolute;
  z-index: 5;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 50%;
  place-content: center;
  gap: 3px;
  background: rgb(12 15 18 / 72%);
  box-shadow: 0 6px 24px rgb(0 0 0 / 28%);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
}

.screen-menu {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transform: translateY(14px);
  background: rgb(17 20 23 / 94%);
  backdrop-filter: blur(26px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

.screen-menu.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.screen-menu__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.screen-menu__head p,
.screen-menu__head h1,
.screen-menu__hint {
  margin: 0;
}

.screen-menu__head p {
  color: rgb(255 255 255 / 52%);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.screen-menu__head h1 {
  margin-top: 4px;
  font-size: 28px;
}

#menu-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.screen-menu__hint {
  margin-top: 24px;
  color: rgb(255 255 255 / 62%);
  font-size: 14px;
  line-height: 1.45;
}

#screen-list {
  display: grid;
  min-height: 0;
  margin-top: 18px;
  overflow: auto;
  gap: 8px;
}

.screen-link,
.restart {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 14px;
  text-align: left;
  background: rgb(255 255 255 / 5%);
  cursor: pointer;
}

.screen-link[aria-current="page"] {
  border-color: rgb(255 255 255 / 70%);
  background: rgb(255 255 255 / 14%);
}

.restart {
  margin-top: 14px;
  text-align: center;
  background: #fff;
  color: #111;
  font-weight: 700;
}

.tap-hint {
  position: absolute;
  z-index: 3;
  width: 54px;
  height: 54px;
  border: 2px solid rgb(255 255 255 / 90%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

.tap-hint.is-visible {
  animation: pulse 1.7s ease-out 2;
}

.status {
  position: absolute;
  z-index: 4;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, 8px);
  background: rgb(0 0 0 / 72%);
  color: rgb(255 255 255 / 88%);
  font-size: 12px;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.status.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes pulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}

@media (prefers-reduced-motion: reduce) {
  .screen-menu,
  .status {
    transition: none;
  }

  .tap-hint.is-visible {
    animation: none;
    opacity: .8;
  }
}

@media (min-width: 700px) {
  .stage {
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 28px;
  }
}
