/* Shared chrome for all three game pages. The games themselves share no
   code — only this frame — so each stays independently editable. */

.game-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
  gap: 18px;
}

.game-nav {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.15s, border-color 0.15s;
}

.game-nav a:hover {
  color: var(--text);
  border-color: var(--accent);
}

.game-title {
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  text-align: center;
}

.game-sub {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
  max-width: 42ch;
  line-height: 1.5;
}

.stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: var(--surface);
  touch-action: none;
}

/* Canvases scale to fit, but must never grow taller than the viewport —
   Flappy's 400x600 would otherwise render ~900px tall and run past the fold. */
.stage canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 62vh;
}

.scorebar {
  width: 100%;
  max-width: 560px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.scorebar strong {
  color: var(--text);
  font-size: 20px;
  display: block;
  font-weight: 700;
}

/* Overlay covers the canvas for start / game-over states. */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: rgb(13 13 18 / 0.82);
  backdrop-filter: blur(3px);
}

.overlay[hidden] {
  display: none;
}

.overlay h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
}

.overlay p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 34ch;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

kbd {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
}
