:root {
  color-scheme: dark;
  background: #070b16;
  font-family: system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-width: 240px;
  min-height: 200px;
  background:
    radial-gradient(ellipse at 50% 45%, #14253c 0, #0b1222 34%, #070b16 76%);
}

.scene {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  background:
    radial-gradient(ellipse at 50% 112%, #0d465533 0, transparent 48%),
    #070b16;
}

.scene::before {
  position: absolute;
  z-index: 0;
  inset: -35%;
  background:
    radial-gradient(ellipse at 50% 50%, #070b1600 28%, #070b1666 75%);
  content: "";
  pointer-events: none;
}

.sphere-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  outline: none;
}

.sphere-canvas:active {
  cursor: grabbing;
}

.sphere-canvas:focus-visible {
  outline: 2px solid #9de8e8;
  outline-offset: -6px;
}

.scene-status {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  display: none;
  margin: 0;
  color: #fff;
  font-size: 14px;
  text-align: center;
  text-shadow: 0 1px 8px #000;
}

.scene.has-error .scene-status {
  display: block;
}

.scene.is-loading .scene-status {
  display: block;
}

.scene.is-fallback::after {
  position: absolute;
  z-index: 1;
  inset: auto;
  top: 50%;
  left: 50%;
  width: 52vmin;
  aspect-ratio: 1;
  border: 1px solid #8edbe544;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #4f839d 0, #1d4058 38%, #0b172a 72%, #07101f 100%);
  box-shadow:
    0 0 36px #39a8b725,
    inset -28px -25px 48px #020711aa,
    inset 15px 12px 32px #9ce8e522;
  filter: none;
  opacity: 1;
  content: "";
  transform: translate(-50%, -50%);
}

.scene.is-fallback .sphere-canvas {
  display: none;
}

.scene.is-camera-dragging .sphere-canvas {
  cursor: grabbing;
}

.scene.is-center-pressing .sphere-canvas {
  cursor: pointer;
}

.category-orb-hit-area {
  position: absolute;
  z-index: 4;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.category-orb-hit-area:focus-visible {
  border: 1px solid #d8f6ff;
  background: #d8f6ff22;
  outline: 2px solid #8ce5f0;
}

.visually-hidden:not(:focus-within) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.visually-hidden:focus-within {
  position: fixed;
  z-index: 6;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #8ce5f0;
  border-radius: 14px;
  background: #091321ee;
}

.category-nav-button,
.category-back,
.category-game-links a {
  border: 1px solid #8ce5f077;
  border-radius: 999px;
  color: #eafcff;
  background: #10233a;
  font: inherit;
}

.category-nav-button {
  padding: 8px 12px;
}

.category-page {
  position: fixed;
  z-index: 5;
  inset: 0;
  overflow: auto;
  padding: max(24px, env(safe-area-inset-top)) 20px
    max(24px, env(safe-area-inset-bottom));
  color: #f0f7ff;
  background:
    radial-gradient(ellipse at 50% 20%, #19314e 0, transparent 56%),
    #070b16;
}

.category-page-content {
  width: min(100%, 760px);
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.category-back {
  align-self: flex-start;
  padding: 10px 16px;
  cursor: pointer;
}

.category-page h1 {
  margin: 0;
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 500;
}

.category-game-list {
  display: grid;
  gap: 16px;
}

.category-game-list[hidden] {
  display: none;
}

.category-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: clamp(16px, 4vw, 24px);
  border: 1px solid #8ce5f033;
  border-radius: 20px;
  background: #101b2dcc;
}

.category-game.has-cover {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(16px, 5vw, 28px);
}

.category-game img {
  display: block;
  width: 100%;
  border-radius: 16px;
}

.category-game h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 5vw, 32px);
}

.category-game p,
.category-placeholder {
  color: #c3d0df;
  line-height: 1.7;
}

.category-game-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.category-game-links a {
  display: inline-block;
  padding: 10px 14px;
  text-decoration: none;
}

.category-game-links a:hover,
.category-back:hover {
  background: #1a3653;
}

.category-placeholder {
  font-size: 18px;
}

.portal-credits {
  align-self: center;
  color: #a7bacb;
  font-size: 13px;
  text-underline-offset: 3px;
}

.portal-credits:hover {
  color: #eafcff;
}

.category-page :focus-visible,
.visually-hidden :focus-visible {
  outline: 2px solid #9de8e8;
  outline-offset: 3px;
}

.shooting-star {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #d9f4ff;
  box-shadow: 0 0 3px 1px #bdefff55;
  opacity: 0.42;
  pointer-events: none;
  animation: shooting-star 650ms ease-out forwards;
}

@keyframes shooting-star {
  0% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      translate3d(var(--start-x), var(--start-y), 0);
  }

  50% {
    opacity: 0.42;
    transform: translate(-50%, -50%);
  }

  100% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      translate3d(var(--end-x), var(--end-y), 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .shooting-star {
    animation: none;
  }
}

@media (max-width: 520px) {
.category-game.has-cover {
    grid-template-columns: 1fr;
  }

  .category-game img {
    max-width: 320px;
    justify-self: center;
  }
}
