@charset "UTF-8";
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: clamp(100vw, 100vw, 100vw);
  height: clamp(100vh, 100vh, 100vh);
  overflow: hidden;
}

.back-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.back-button::before {
  content: "◀︎";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.back-button::after {
  content: "Back";
  flex-grow: 1;
}
.back-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.back-button:hover {
  text-decoration: underline;
}

.reset-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.reset-button::before {
  content: "⟲";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.reset-button::after {
  content: "Reset Level";
  flex-grow: 1;
}
.reset-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.reset-button:hover {
  text-decoration: underline;
}

.undo-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.undo-button::before {
  content: "↺";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.undo-button::after {
  content: "Undo";
  flex-grow: 1;
}
.undo-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.undo-button:hover {
  text-decoration: underline;
}

.redo-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.redo-button::before {
  content: "↻";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.redo-button::after {
  content: "Redo";
  flex-grow: 1;
}
.redo-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.redo-button:hover {
  text-decoration: underline;
}

.settings-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.settings-button::before {
  content: "⚙";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.settings-button::after {
  content: "Settings";
  flex-grow: 1;
}
.settings-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.settings-button:hover {
  text-decoration: underline;
}

.help-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.help-button::before {
  content: "?";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.help-button::after {
  content: "Help";
  flex-grow: 1;
}
.help-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.help-button:hover {
  text-decoration: underline;
}

.cancel-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.cancel-button::before {
  content: "x";
  color: red;
  margin-right: 1ch;
  display: inline-block;
}
.cancel-button::after {
  content: "Cancel";
  flex-grow: 1;
}
.cancel-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.cancel-button:hover {
  text-decoration: underline;
}

.play-next-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.play-next-button::before {
  content: "▶︎";
  color: green;
  margin-right: 1ch;
  display: inline-block;
}
.play-next-button::after {
  content: "Play Next Level";
  flex-grow: 1;
}
.play-next-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.play-next-button:hover {
  text-decoration: underline;
}

.back-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.back-button::before {
  content: "◀︎";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.back-button::after {
  content: "Back";
  flex-grow: 1;
}
.back-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.back-button:hover {
  text-decoration: underline;
}

.reset-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.reset-button::before {
  content: "⟲";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.reset-button::after {
  content: "Reset Level";
  flex-grow: 1;
}
.reset-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.reset-button:hover {
  text-decoration: underline;
}

.undo-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.undo-button::before {
  content: "↺";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.undo-button::after {
  content: "Undo";
  flex-grow: 1;
}
.undo-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.undo-button:hover {
  text-decoration: underline;
}

.redo-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.redo-button::before {
  content: "↻";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.redo-button::after {
  content: "Redo";
  flex-grow: 1;
}
.redo-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.redo-button:hover {
  text-decoration: underline;
}

.settings-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.settings-button::before {
  content: "⚙";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.settings-button::after {
  content: "Settings";
  flex-grow: 1;
}
.settings-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.settings-button:hover {
  text-decoration: underline;
}

.help-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.help-button::before {
  content: "?";
  color: black;
  margin-right: 1ch;
  display: inline-block;
}
.help-button::after {
  content: "Help";
  flex-grow: 1;
}
.help-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.help-button:hover {
  text-decoration: underline;
}

.cancel-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.cancel-button::before {
  content: "x";
  color: red;
  margin-right: 1ch;
  display: inline-block;
}
.cancel-button::after {
  content: "Cancel";
  flex-grow: 1;
}
.cancel-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.cancel-button:hover {
  text-decoration: underline;
}

.play-next-button {
  display: inline-flex;
  place-items: center;
  font-size: inherit;
  display: inline-block;
  padding: 0.375em 1em;
  margin: 0.25em;
  border: 0.125em solid black;
  border-radius: 9999px;
  cursor: pointer;
  background: white;
  color: black;
}
.play-next-button::before {
  content: "▶︎";
  color: green;
  margin-right: 1ch;
  display: inline-block;
}
.play-next-button::after {
  content: "Play Next Level";
  flex-grow: 1;
}
.play-next-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.125em white;
}
.play-next-button:hover {
  text-decoration: underline;
}

#winner {
  visibility: hidden;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  display: grid;
  place-content: center;
  background-color: rgba(0, 0, 0, 0.5);
}
#winner > div {
  position: relative;
  border: 0.1875rem solid #f5f5f5;
  border-radius: 2rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  place-items: center;
  background-color: black;
  box-shadow: 0 0 0 0.1875rem black;
  margin: 1rem;
}

#winner-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-top: auto;
  color: #f5f5f5;
}

#winner-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  margin-bottom: auto;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-content: center;
}

header {
  padding: 0.5rem;
  z-index: 1;
  background: black;
  color: #f5f5f5;
  box-shadow: 0 0 0.5rem black;
}
header > h1 {
  font-size: 1.5rem;
  margin: 0 1rem 0.5rem;
  text-align: center;
}
header > p {
  margin: 0 0.5rem 0.5rem;
  text-align: center;
}
header > div {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  place-content: center;
  padding: 0.5em;
}

main {
  position: relative;
  flex-grow: 1;
  width: 100%;
  height: 100%;
}

#game-container {
  position: absolute;
  inset: 0;
  max-width: 100%;
  max-height: 100%;
  background: #eee;
  display: flex;
  flex-direction: column;
  align-content: stretch;
  justify-content: center;
}

@media (orientation: landscape) {
  body {
    flex-direction: row;
  }

  header {
    display: flex;
    flex-direction: column;
  }
  header > div {
    flex-grow: 1;
    flex-direction: column;
    justify-content: flex-end;
    align-content: stretch;
  }

  #game-container {
    flex-direction: row;
  }
}
header > p > strong {
  color: red;
}

#game-container > .board {
  background: #ccc;
  border: 1rem solid black;
  margin: 0.5rem;
  aspect-ratio: 1/1;
}
#game-container > .board .board__space {
  --x-offset: 0;
  --y-offset: 0;
  position: relative;
  border: none;
}
#game-container > .board .board__space::after {
  content: "";
  position: absolute;
  border-radius: 9999px;
  inset: 10%;
  transform: translate(var(--x-offset), var(--y-offset));
}
#game-container > .board .board__space[data-grid-x="5"][data-grid-y="2"]::before {
  content: "➔";
  font-size: 1.5rem;
  position: absolute;
  left: 100%;
  top: 0;
  bottom: 0;
  width: 1.5rem;
  color: black;
  background: #eee;
  display: grid;
  place-content: center;
}
#game-container > .board .board--light {
  background: #ccc;
}
#game-container > .board .board--dark {
  background: #bbb;
}
#game-container > .board .board--n::after {
  right: -90%;
  border: 0.25rem solid black;
  background: #664d80;
  z-index: 1;
}
#game-container > .board .board--r::after {
  right: -90%;
  border: 0.25rem solid black;
  background: red;
  z-index: 1;
  display: grid;
  place-content: center;
}
#game-container > .board .board--m::after {
  right: -190%;
  border: 0.25rem solid black;
  background: #4d8080;
  z-index: 1;
}
#game-container > .board .board--i::after {
  bottom: -90%;
  border: 0.25rem solid black;
  background: #66804d;
  z-index: 1;
}
#game-container > .board .board--l::after {
  bottom: -190%;
  border: 0.25rem solid black;
  background: #804d4d;
  z-index: 1;
}
#game-container > .board .board--x {
  background: black;
}