.run-game {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #12101a;
  touch-action: none;
  overscroll-behavior: none;
  overflow: hidden;
}

.run-game[hidden] {
  display: none !important;
}

body.run-game-open {
  overflow: hidden;
}

.run-canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 0;
}

.run-fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.run-vhs-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.035) 0,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.55);
  opacity: 0.7;
}

.run-vhs-band {
  position: absolute;
  left: 0;
  right: 0;
  height: 190px;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(1.5px);
  background: linear-gradient(
    180deg,
    transparent 0,
    rgba(255, 255, 255, 0.04) 22%,
    rgba(170, 195, 255, 0.13) 50%,
    rgba(255, 255, 255, 0.04) 78%,
    transparent 100%
  );
  animation: run-vhs-roll 11s linear infinite;
}

.run-vhs-band--2 {
  animation-delay: -3.7s;
}

.run-vhs-band--3 {
  animation-delay: -7.4s;
}

@keyframes run-vhs-roll {
  0% {
    transform: translateY(105vh);
    opacity: 0;
  }
  4% {
    opacity: 0.85;
  }
  55% {
    transform: translateY(-18vh);
    opacity: 0.85;
  }
  60% {
    opacity: 0;
  }
  100% {
    transform: translateY(-18vh);
    opacity: 0;
  }
}

.run-grain-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.8;
  mix-blend-mode: screen;
  image-rendering: auto;
}

.run-hud {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 52px;
  pointer-events: none;
}

.run-score {
  font-family: ui-monospace, monospace;
  font-size: 1.25rem;
  color: #e8e8f4;
  letter-spacing: 0.05em;
}

.run-close {
  position: absolute;
  right: max(8px, env(safe-area-inset-right));
  pointer-events: auto;
  background: transparent;
  border: 0;
  color: #9a9ab0;
  font-size: 1.75rem;
  line-height: 1;
  padding: 8px 14px;
  cursor: pointer;
}

.run-close:focus {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
  border-radius: 4px;
}

.run-hint {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 2;
  margin: 0;
  font-size: 0.85rem;
  color: #9a9ab0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.run-hint.is-hidden {
  opacity: 0;
}

@media (max-width: 767px) {
  .run-score {
    font-size: 1.5rem;
  }

  .run-hint {
    font-size: 0.95rem;
  }
}

@media (min-width: 768px) {
  .run-vhs-band {
    height: 120px;
    filter: blur(2px);
    background: linear-gradient(
      180deg,
      transparent 0,
      rgba(255, 255, 255, 0.025) 25%,
      rgba(170, 195, 255, 0.07) 50%,
      rgba(255, 255, 255, 0.025) 75%,
      transparent 100%
    );
  }

  .run-grain-overlay {
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .run-fx {
    display: none;
  }
}
