:root {
  color-scheme: dark;
  background: #000;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #000;
}

body {
  position: relative;
  overflow-x: hidden;
}

.game-menu {
  display: flex;
  width: 100%;
  min-height: 100dvh;
  align-items: flex-start;
  justify-content: center;
  background: #000;
}

.menu-canvas {
  position: relative;
  width: min(100dvw, 56.28dvh, 941px);
  max-width: 100%;
  aspect-ratio: 941 / 1672;
  flex: 0 0 auto;
  overflow: hidden;
}

.menu-poster {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.game-link {
  position: absolute;
  z-index: 1;
  display: block;
  border-radius: 4.5% / 11%;
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 160ms ease;
}

.game-link--truth {
  top: 24.581%;
  left: 4.676%;
  width: 90.436%;
  height: 21.053%;
  --focus-color: 255, 46, 101;
}

.game-link--moto {
  top: 47.548%;
  left: 4.676%;
  width: 90.436%;
  height: 19.856%;
  --focus-color: 47, 224, 255;
}

.game-link--sister {
  top: 69.258%;
  left: 4.676%;
  width: 90.436%;
  height: 19.498%;
  --focus-color: 200, 80, 255;
}

@media (hover: hover) {
  .game-link:hover {
    box-shadow:
      inset 0 0 0 3px rgba(var(--focus-color), 0.9),
      0 0 22px rgba(var(--focus-color), 0.72);
  }
}

.game-link:focus-visible {
  box-shadow:
    inset 0 0 0 3px #fff,
    inset 0 0 0 7px rgba(var(--focus-color), 0.96),
    0 0 26px rgba(var(--focus-color), 0.9);
}

.game-link:active {
  box-shadow:
    inset 0 0 0 5px rgba(var(--focus-color), 1),
    0 0 18px rgba(var(--focus-color), 0.82);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) and (min-height: 700px) {
  .game-menu {
    align-items: center;
  }
}

@media (orientation: landscape) and (min-width: 900px) and (min-height: 700px) {
  body {
    overflow: hidden;
  }

  body::before {
    content: "";
    position: fixed;
    inset: -48px;
    z-index: 0;
    background:
      linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.78)),
      url("../assets/home/crush-game-directory.png") center / cover no-repeat;
    filter: blur(28px) saturate(0.82);
    opacity: 0.72;
    transform: scale(1.08);
    pointer-events: none;
  }

  .game-menu {
    position: relative;
    z-index: 1;
    height: 100dvh;
    min-height: 0;
    padding:
      max(14px, env(safe-area-inset-top))
      max(24px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(24px, env(safe-area-inset-left));
    align-items: center;
  }

  .menu-canvas {
    width: min(
      calc(100dvw - max(48px, env(safe-area-inset-left)) - max(48px, env(safe-area-inset-right))),
      calc((100dvh - max(28px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom))) * 941 / 1672),
      941px
    );
    max-height: calc(100dvh - 28px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow:
      0 28px 80px rgba(0, 0, 0, 0.72),
      0 0 42px rgba(200, 80, 255, 0.2);
  }
}

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