:root {
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

button,
a,
summary,
[tabindex] {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 4px solid #111827;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10000;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #111827;
  color: #fff;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

a.back-btn {
  display: inline-block;
  text-decoration: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.is-hidden {
  display: none !important;
}

canvas {
  max-width: 100%;
  height: auto !important;
}

.accessible-game-controls {
  width: min(100% - 2rem, 900px);
  margin: 1rem auto 2rem;
  padding: 1rem;
  border: 2px solid rgba(17, 24, 39, 0.18);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2937;
  text-align: center;
}

.accessible-game-controls h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.accessible-game-controls p {
  margin: 0.5rem 0;
}

.accessible-control-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.accessible-control-buttons button {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 2px solid #374151;
  border-radius: 0.75rem;
  background: #fff;
  color: #111827;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.accessible-control-buttons button[aria-pressed="true"] {
  background: #111827;
  color: #fff;
}

.accessible-control-buttons button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
