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

* {
  box-sizing: border-box;
}

html,
body,
#game-shell,
#game {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #080b19;
  touch-action: none;
}

canvas {
  display: block;
}

.panel {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(34rem, calc(100% - 2rem));
  transform: translate(-50%, -50%);
  padding: 1.5rem;
  border: 1px solid rgba(0, 255, 121, 0.45);
  border-radius: 8px;
  background: rgba(8, 11, 25, 0.94);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.5);
  text-align: center;
  z-index: 4;
}

.panel[hidden] {
  display: none;
}

.panel h1,
.panel h2 {
  margin: 0.4rem 0 0.75rem;
  color: #f7f8ff;
  font-size: clamp(1.75rem, 6vw, 3rem);
  letter-spacing: 0;
  line-height: 1;
}

.panel p {
  margin: 0.6rem auto;
  color: #c8cee8;
  font-size: 0.95rem;
  line-height: 1.5;
}

.panel .eyebrow {
  color: #00ff79;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 700;
}

.panel .hint {
  color: #8f99bd;
  font-size: 0.78rem;
}

.panel button {
  min-height: 44px;
  margin-top: 0.8rem;
  padding: 0.7rem 1.15rem;
  border: 0;
  border-radius: 6px;
  background: #00ff79;
  color: #07120d;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.panel button:focus-visible,
#touch-controls button:focus-visible {
  outline: 3px solid #ffd633;
  outline-offset: 3px;
}

#touch-controls {
  position: absolute;
  right: max(0.8rem, env(safe-area-inset-right));
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  left: max(0.8rem, env(safe-area-inset-left));
  display: none;
  align-items: end;
  justify-content: space-between;
  pointer-events: none;
  z-index: 3;
}

#touch-controls button {
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(8, 11, 25, 0.8);
  color: #f7f8ff;
  font-size: 1.5rem;
  font-weight: 800;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

#touch-controls button[data-control="right"] {
  margin-right: auto;
  margin-left: 0.6rem;
}

#touch-controls button[data-control="jump"] {
  border-color: rgba(0, 255, 121, 0.7);
  color: #00ff79;
}

@media (pointer: coarse), (max-width: 760px) {
  #touch-controls {
    display: flex;
  }

  .panel {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
