*, *::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;
}

.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-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;
}

.a-game {
  align-items: center;
  justify-content: flex-start;
  padding-top: 4em;
}
  .a-game--hud {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    display: grid;
    font-family: monospace;
    font-size: 1.25em;
    gap: 0.4rem 1rem;
    padding: 1.25rem 1.5rem;
    width: min(28rem, 90vw);
  }
  .a-game--row {
    display: grid;
    grid-template-columns: 6rem 1fr auto;
    align-items: baseline;
  }
  .a-game--label {
    opacity: 0.7;
    text-transform: uppercase;
    font-size: 0.75em;
    letter-spacing: 0.1em;
  }
  .a-game--value {
    font-weight: bold;
  }
  .a-game--gear {
    font-size: 1.5em;
  }
  .a-game--unit {
    opacity: 0.6;
    font-size: 0.8em;
  }
  .a-game--row-status {
    grid-template-columns: 1fr;
    margin-top: 0.5rem;
    text-align: center;
  }
  .a-game--status {
    color: #ffaa55;
    min-height: 1.4em;
  }
  .a-game--status:empty::before {
    content: "\00a0";
  }
  .a-game--keys {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8em;
    gap: 0.4rem 1rem;
    list-style: none;
    margin-top: 1.25rem;
    opacity: 0.7;
    padding: 0;
    width: min(28rem, 90vw);
  }
  .a-game--keys li {
    align-items: center;
    display: flex;
    gap: 0.4rem;
  }
  .a-game--keys kbd,
  .a-help--keys kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.2rem;
    font-family: monospace;
    font-size: 0.9em;
    padding: 0.05em 0.35em;
  }

.a-gameover {
  align-items: center;
  text-align: center;
}
  .a-gameover h1 {
    font-size: 3em;
  }
  .a-gameover--reason {
    opacity: 0.85;
    margin-bottom: 1rem;
  }
  .a-gameover--stats {
    display: grid;
    font-family: monospace;
    font-size: 1.1em;
    gap: 0.25rem 1.5rem;
    grid-template-columns: auto auto;
    margin: 0 auto 1.5rem;
    text-align: left;
  }
  .a-gameover--stats dt {
    opacity: 0.7;
  }
  .a-gameover--stats dd {
    margin: 0;
    font-weight: bold;
  }
  .a-gameover--actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
  }
  .a-gameover--actions button {
    background: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 1em;
    padding: 0.6em 1.2em;
  }
  .a-gameover--actions button:hover,
  .a-gameover--actions button:focus {
    background: #FFFFFF;
    color: #000000;
  }

.a-help {
  align-items: center;
}
  .a-help h1 {
    font-size: 2.25em;
    text-align: center;
  }
  .a-help--body {
    max-width: 42rem;
    line-height: 1.6;
  }
  .a-help--body ul {
    margin: 0.75rem 0;
    padding-left: 1.5em;
  }
  .a-help--body li + li {
    margin-top: 0.4rem;
  }
  .a-help--body h2 {
    font-size: 1.25em;
    margin-top: 1.5rem;
  }
  .a-help--keys {
    list-style: none;
    padding-left: 0;
  }
  .a-help--keys li {
    align-items: baseline;
    display: flex;
    gap: 0.6rem;
  }
  .a-help--actions {
    margin-top: 1rem;
    text-align: center;
  }
  .a-help--actions button {
    background: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 1em;
    padding: 0.5em 1em;
  }
  .a-help--actions button:hover,
  .a-help--actions button:focus {
    background: #FFFFFF;
    color: #000000;
  }

.a-learn {
  align-items: center;
}
  .a-learn h1 {
    font-size: 2.25em;
    text-align: center;
  }
  .a-learn--list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    width: min(28rem, 90vw);
  }
  .a-learn--list button {
    background: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    font-size: 1em;
    padding: 0.6em 0.8em;
    text-align: left;
    width: 100%;
  }
  .a-learn--list button .a-learn--name {
    font-weight: bold;
  }
  .a-learn--list button .a-learn--desc {
    font-size: 0.85em;
    opacity: 0.85;
  }
  .a-learn--list button:hover,
  .a-learn--list button:focus {
    background: #FFFFFF;
    color: #000000;
  }
  .a-learn--actions {
    text-align: center;
  }
  .a-learn--actions button {
    background: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 1em;
    padding: 0.5em 1em;
  }
  .a-learn--actions button:hover,
  .a-learn--actions button:focus {
    background: #FFFFFF;
    color: #000000;
  }

.a-menu {
  align-items: center;
  text-align: center;
}
  .a-menu--logo {
    font-size: 4em;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
  }
  .a-menu--list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    width: min(20rem, 80vw);
  }
  .a-menu--list button {
    background: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 1.25em;
    padding: 0.75em 1em;
    width: 100%;
  }
  .a-menu--list button:hover,
  .a-menu--list button:focus {
    background: #FFFFFF;
    color: #000000;
  }
  .a-menu--hint {
    font-size: 0.85em;
    opacity: 0.7;
    margin-top: 1.5rem;
  }

.a-soundtest {
  align-items: center;
}
  .a-soundtest h1 {
    font-size: 2em;
    text-align: center;
  }
  .a-soundtest--current {
    font-family: monospace;
    opacity: 0.85;
  }
  .a-soundtest--list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    width: min(28rem, 90vw);
  }
  .a-soundtest--list button {
    background: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    display: flex;
    font-size: 1em;
    gap: 0.6rem;
    padding: 0.6em 0.9em;
    text-align: left;
    width: 100%;
  }
  .a-soundtest--list button[aria-pressed="true"] {
    background: #FFFFFF;
    color: #000000;
  }
  .a-soundtest--list button:focus {
    outline: 2px solid #ffaa55;
  }
  .a-soundtest--list .a-soundtest--idx {
    font-family: monospace;
    opacity: 0.7;
    min-width: 1.5em;
  }
  .a-soundtest--actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
  }
  .a-soundtest--actions button {
    background: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 1em;
    padding: 0.5em 1em;
  }
  .a-soundtest--actions button:hover,
  .a-soundtest--actions button:focus {
    background: #FFFFFF;
    color: #000000;
  }

.a-splash {
  align-items: center;
  text-align: center;
}
  .a-splash--logo {
    font-size: 5em;
    letter-spacing: 0.05em;
  }
  .a-splash--tagline {
    font-size: 1.1em;
    opacity: 0.8;
  }
  .a-splash--details {
    bottom: 2rem;
    font-family: monospace;
    font-size: 0.75em;
    font-weight: 300;
    left: 2rem;
    letter-spacing: 0;
    padding: 0.5rem 0.75rem;
    position: absolute;
    text-align: left;
  }
  .a-splash--instruction {
    animation: a-splash--instruction 1s ease-in-out 0s infinite alternate both;
    bottom: 2rem;
    line-height: 2;
    padding: 0.5em 0.75em;
    position: absolute;
    right: 2rem;
    text-transform: uppercase;
  }

@keyframes a-splash--instruction {
  0% { opacity: 0.5; }
  100% { opacity: 1.0; }
}
