*, *::after, *::before {
  background: transparent;
  border: 0;
  box-sizing: border-box;
  color: inherit;
  cursor: default;
  font: inherit;
  margin: 0;
  padding: 0;
}

button, button *, button *::after, button *::before {
  cursor: pointer;
}

:root {
  background-color: #000000;
  color: #FFFFFF;
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.5;
  user-select: none;
}

html, body {
  height: 100%;
  width: 100%;
}

:focus {
  outline: 2px solid #FFFFFF;
}

[hidden] {
  display: none !important;
}

button {
  cursor: pointer;
}
button[aria-disabled="true"],
button[disabled] {
  cursor: not-allowed;
}

/* Responsive fluid font sizing */
@media (max-width: 20rem) {
  body {
    font-size: 0.5rem;
  }
}

@media (min-width: 20rem) {
  body {
    font-size: calc(0.5rem + ((1vw - 0.4rem) * 1));
  }
}

.u-screenReader {
  clip: rect(0, 0, 0, 0);
  -webkit-clip-path: inset(50);
  clip-path: inset(50);
  border: 0;
  height: 1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Ramparts — minimal visual HUD. The game is fully playable by ear; this is
 * a sighted-player convenience and is aria-hidden so AT users only hear the
 * announcer. The monospace board mirrors content.grid.snapshot(). */
.c-hud {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1rem;
  text-align: center;
  margin: 0.5rem 0;
  opacity: 0.85;
}

.c-hud--board {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(0.7rem, 2.4vmin, 1.4rem);
  line-height: 1.25;
  letter-spacing: 0.05em;
  text-align: center;
  margin: 1rem auto;
  white-space: pre;
}

/* High-score name entry on the game-over screen. */
.c-menu--input {
  display: block;
  margin: 0.5rem auto 1rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  text-align: center;
  border-radius: 0.25rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
}

.a-gameover--entry {
  margin-bottom: 1rem;
}

.c-menu {
  align-items: center;
  text-align: center;
}
  .c-menu--title {
    font-size: 3em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
  }
  .c-menu--subtitle {
    font-size: 1.1em;
    max-width: 40em;
    opacity: 0.85;
  }
  .c-menu--list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin-top: 1.5rem;
    padding: 0;
    width: min(28em, 90vw);
  }
    .c-menu--list li { width: 100%; }
  .c-menu--button {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.4rem;
    color: #FFFFFF;
    cursor: pointer;
    font-size: 1.05em;
    padding: 0.7em 1em;
    transition: background 120ms ease, border-color 120ms ease;
    width: 100%;
  }
  .c-menu--button:hover,
  .c-menu--button:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: #FFFFFF;
    outline: none;
  }
  .c-menu--button[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.22);
    border-color: #FFFFFF;
  }
  .c-menu--prose {
    line-height: 1.6;
    margin-top: 1rem;
    max-width: 48em;
    text-align: left;
  }
    .c-menu--prose h2 {
      font-size: 1.3em;
      margin-top: 1.5em;
    }
    .c-menu--prose ul {
      list-style: disc inside;
      padding-left: 0.5em;
    }
    .c-menu--prose kbd {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.5);
      border-radius: 0.25em;
      font-family: monospace;
      padding: 0 0.4em;
    }
  .c-menu--footer {
    bottom: 1.5rem;
    font-family: monospace;
    font-size: 0.8em;
    left: 0;
    opacity: 0.6;
    position: absolute;
    text-align: center;
    width: 100%;
  }

.c-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  padding: 2em;
  width: 100%;
}
  .c-screen:focus {
    outline: 0;
  }
  .c-screen > * + * {
    margin-top: 1rem;
  }

.a-app {
  height: 100%;
  left: 0;
  letter-spacing: 0.125em;
  position: absolute;
  opacity: 0;
  top: 0;
  transition: opacity 1s linear;
  width: 100%;
}
  .a-app--overlaySupport {
    height: 100%;
    left: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 666;
  }
  .a-app--screen {
    align-items: center;
    background-color: #000000;
    display: flex;
    height: 100%;
    justify-content: center;
    left: 0;
    position: absolute;
    opacity: 0;
    top: 0;
    transition: all 0.5s ease;
    transition-property: opacity;
    width: 100%;
    z-index: 1;
  }
    .a-app--screen > * {
      flex: 1 1 auto;
      max-width: 64em;
    }
    .a-app--screen-active {
      opacity: 1;
      z-index: 3;
    }
    .a-app--screen-inactive {
      opacity: 0;
      z-index: 2;
    }

.a-app-active {
  opacity: 1;
}
