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

::selection {
  background-color: transparent;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* Button — structural only, visual style defined per page/game */

.button {
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.button:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

/* Overlay — shared pattern used by games and any future modal */

.overlay {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: var(--padding-page);
  position: fixed;
}

.overlay[hidden] {
  display: none;
}

.overlay-panel {
  align-items: center;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 320px;
  padding: 2rem;
  text-align: center;
  width: 100%;
}

@media (min-width: 480px) {
  .overlay-panel {
    max-width: none;
    padding: 2.5rem 3rem;
    width: auto;
  }
}

/* Site Nav */

:root {
  --nav-height: 3rem;
}

.site-nav {
  align-items: center;
  background-color: var(--color-bg);
  /* border-bottom: 1px solid var(--color-surface); */
  display: flex;
  height: var(--nav-height);
  justify-content: space-between;
  left: 0;
  padding: 0 var(--padding-page);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
}

body.has-nav {
  padding-top: var(--nav-height);
}

.site-nav-name {
  color: inherit;
  font-family: var(--font-rounded);
  font-weight: 600;
  text-decoration: none;
}

.site-nav-name--hidden {
  visibility: hidden;
}

.site-nav-controls {
  display: flex;
  gap: 1rem;
}

/* Toggle pill — sliding thumb via ::before, assumes 2 equal-width options */

.toggle-pill {
  background-color: var(--color-surface);
  border-radius: 9999px;
  display: flex;
  padding: 3px;
  position: relative;
}

.toggle-pill::before {
  background-color: var(--color-bg);
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  content: "";
  height: calc(100% - 6px);
  left: 3px;
  pointer-events: none;
  position: absolute;
  top: 3px;
  transition: transform var(--transition-base);
  width: calc(50% - 3px);
}

/* Slide thumb right when second option is active */
.toggle-pill:has([aria-pressed="true"]:last-child)::before {
  transform: translateX(100%);
}

.toggle-pill-btn svg {
  height: 0.875rem;
  width: 0.875rem;
}

.toggle-pill-btn svg path {
  fill: var(--color-muted);
  transition: fill var(--transition-base);
}

.toggle-pill-btn[aria-pressed="true"] svg path,
.toggle-pill-btn:hover:not([aria-pressed="true"]) svg path {
  fill: var(--color-text);
}

.toggle-pill-btn {
  align-items: center;
  background: none;
  border: none;
  border-radius: 9999px;
  color: var(--color-muted);
  cursor: pointer;
  display: flex;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  gap: 0.375rem;
  justify-content: center;
  letter-spacing: 0.05em;
  min-width: 1.75rem;
  padding: 0.25rem 0.625rem;
  position: relative; /* stay above ::before */
  text-transform: uppercase;
  transition: color var(--transition-base);
}

.toggle-pill-btn[aria-pressed="true"] {
  color: var(--color-text);
}

.toggle-pill-btn:hover:not([aria-pressed="true"]) {
  color: var(--color-text);
}

.toggle-pill-btn:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: -2px;
}
