html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
}

canvas {
  display: block;
  touch-action: none;
}

#game-root {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #000;
}

#video-root {
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.intro-failure-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.75);
}

.intro-failure-panel {
  width: min(600px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: #fff;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.intro-failure-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.25rem, 2.8vw, 1.9rem);
}

.intro-failure-text {
  margin: 0;
  max-width: 56ch;
  line-height: 1.5;
  font-family: sans-serif;
}

.intro-failure-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.intro-failure-actions button {
  min-width: 10rem;
  border: 1px solid #fff;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: 600 0.9rem/1.2 sans-serif;
}

.intro-failure-actions button:hover,
.intro-failure-actions button:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

/* Use safe-area insets without padding (avoids shrinking the content box) */
@supports (top: env(safe-area-inset-top)) {
  #game-root {
    top: env(safe-area-inset-top);
    right: env(safe-area-inset-right);
    bottom: env(safe-area-inset-bottom);
    left: env(safe-area-inset-left);
  }
}
