/* Snake — arcade (design/Jeu - Serpent). A square board on the shared arcade
   surface: a warm deep-ink band, the same in light and dark. Stats (apples /
   length / best) live in the page header (taken over by the game); the control
   row and keyboard hint sit below the band on the page ground. Scoped .gsnake-root. */

.gsnake-root { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); inline-size: 100%; color: var(--color-text); user-select: none; -webkit-user-select: none; }

.gsnake-stage {
  inline-size: 100%; box-sizing: border-box;
  background: #211d19; border-block: 1px solid #12100d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: var(--space-4) 0; display: flex; justify-content: center;
}
.gsnake-play { position: relative; inline-size: min(100%, 460px); display: flex; justify-content: center; }
.gsnake-canvas { display: block; touch-action: none; background: #211d19; }

.gsnake-overlay {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); text-align: center;
  background: rgba(18, 16, 13, 0.55);
}
.gsnake-overlay.show { display: flex; }
.gsnake-over-title { font-family: var(--font-heading); font-weight: 600; font-size: clamp(1.2rem, 5vw, 1.7rem); color: var(--color-accent-400); }
.gsnake-over-score { font-variant-numeric: tabular-nums; color: #f2efe6; }
.gsnake-btn-primary {
  font: inherit; font-family: var(--font-heading); font-weight: 600; cursor: pointer;
  min-block-size: 46px; padding: 0 24px; border-radius: var(--radius-md);
  color: #211d19; background: var(--color-accent-400); border: 1px solid var(--color-accent-400);
}

/* One control row below the band, on the page ground (theme-following). */
.gsnake-controls { display: flex; gap: var(--space-2); align-items: stretch; justify-content: center; inline-size: 100%; max-inline-size: 480px; }
.gsnake-dir {
  font: inherit; flex: none; inline-size: 60px; min-block-size: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-neutral-400); border-radius: var(--radius-md);
  background: transparent; color: var(--color-neutral-800); cursor: pointer;
  touch-action: manipulation; box-sizing: border-box; font-size: 1.05rem;
}
.gsnake-start {
  font: inherit; flex: 1; min-block-size: 52px; min-inline-size: 0;
  font-family: var(--font-heading); font-weight: 600;
  border: 1px solid var(--color-accent); border-radius: var(--radius-md);
  background: transparent; color: var(--color-accent-700); cursor: pointer; box-sizing: border-box;
}
.gsnake-dir:hover, .gsnake-start:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.gsnake-dir:active, .gsnake-start:active { transform: translateY(1px); }
:root[data-theme="dark"] .gsnake-dir { color: #d7d3d3; border-color: #56514b; }
:root[data-theme="dark"] .gsnake-start { color: var(--color-accent-400); border-color: var(--color-accent-400); }

.gsnake-hint { text-align: center; font-size: 12px; color: var(--color-neutral-600); max-inline-size: 480px; }
.lz-variants.gsnake-inline { margin: 0; }

@media (prefers-reduced-motion: reduce) { .gsnake-dir:active, .gsnake-start:active { transform: none; } }
