/* ============================================================
   home-game.css. Homepage game layer over index.html.
   All rules are scoped to html[data-home="game"] or #home-game
   so they cannot affect the rest of the site.
   ============================================================ */

html[data-home="game"],
html[data-home="game"] body {
  overflow: hidden;
  height: 100%;
  background: #12082a;
}

html[data-home="game"] body > :not(#home-game):not(script) {
  visibility: hidden;
}

#home-game {
  --hg-bg: #12082a;
  --hg-fg: #f4efe6;
  --hg-focus: #ffd23f;
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--hg-bg);
  color: var(--hg-fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

#home-game[hidden] {
  display: none;
}

#home-game .home-skip {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  z-index: 10;
  transition: none;
}

#home-game .home-skip:focus,
#home-game .home-skip:focus-visible {
  width: auto;
  height: auto;
  margin: 0;
  padding: 12px 16px;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--hg-fg);
  color: var(--hg-bg);
  font-weight: bold;
  text-decoration: none;
  border-radius: 6px;
  opacity: 1;
  outline: 3px solid var(--hg-focus);
  outline-offset: 2px;
}

#home-game .home-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font: inherit;
  font-weight: bold;
  color: var(--hg-bg);
  background: var(--hg-fg);
  border: 2px solid var(--hg-fg);
  border-radius: 6px;
  cursor: pointer;
  z-index: 2;
}

#home-game .home-menu svg {
  flex: none;
  display: block;
}

#home-game .home-menu:focus-visible {
  outline: 3px solid var(--hg-focus);
  outline-offset: 2px;
}

#home-game .home-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#home-game canvas {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  height: auto;
  min-height: 280px;
  background: var(--hg-bg);
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
}

#home-game canvas:focus-visible {
  outline: 3px solid var(--hg-focus);
  outline-offset: -3px;
  border-radius: 0;
}

#home-game .skate-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
}

#home-game .skate-controls button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 16px;
  font: inherit;
  color: var(--hg-fg);
  background: var(--hg-bg);
  border: 2px solid var(--hg-fg);
  border-radius: 6px;
  cursor: pointer;
}

#home-game .skate-controls button[aria-pressed="true"] {
  background: var(--hg-fg);
  color: var(--hg-bg);
}

#home-game .skate-controls button:focus-visible {
  outline: 3px solid var(--hg-focus);
  outline-offset: 2px;
}

#home-game .skate-controls button[hidden] {
  display: none;
}

#home-game .skate-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  #home-game,
  #home-game * {
    transition: none;
    animation: none;
  }
}
