@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400@700&display=swap');

:root {
  --body-bg: #111;
  --font-color: #ffffff;
  --container-size: 1200px;
  --container-padding: 15px;
  --cell-border-color: rgb(255, 255, 255);
  --cell-size: 150px;
  --mark-size: calc(var(--cell-size) * 0.9);
  --btn-bg: #111;
  --cell-x-bg: #1f3a93;
  --cell-circle-bg: #d91e18;
  --cell-hover-bg: #808080;
}

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

h1,
h2,
h3 {
  margin: 0;
}

body {
  margin: 0;
  font-size: 16px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  background: var(--body-bg);
  color: var(--font-color);
}

.container {
  max-width: calc(var(--container-size) + (var(--container-padding) * 2));
  width: 100%;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  margin: 0 auto;
}

.btn {
  background: inherit;
  border: 1px solid #fff;
  background: var(--btn-bg);
  color: #ffffff;
  font-size: 16px;
  text-transform: uppercase;
  padding: 15px 20px;
  font-weight: 700;
  border-radius: 4px;
  box-shadow: 0 3px 6px rgba(255, 255, 255, 0.16),
    0 3px 6px rgba(255, 255, 255, 0.23);
  cursor: pointer;
  transition: all 0.3s ease;
}

.blue-span {
  color: var(--cell-x-bg);
}

.red-span {
  color: var(--cell-circle-bg);
}

.header {
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cell-border-color);
}

.header__title {
  font-size: 32px;
  text-align: center;
}

.main {
  height: 100vh;
  width: 100%;
}

.board {
  height: 100vh;
  display: grid;
  justify-content: center;
  align-items: center;
  align-content: center;
  grid-template-columns: repeat(3, auto);
}

.board__cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border: 2px solid var(--cell-border-color);

  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.board__cell.x,
.board__cell.circle {
  cursor: not-allowed;
}

.board__cell:first-child,
.board__cell:nth-child(2),
.board__cell:nth-child(3) {
  border-top: none;
}

.board__cell:nth-child(3n + 1) {
  border-left: none;
}

.board__cell:nth-child(3n + 3) {
  border-right: none;
}

.board__cell:nth-child(7),
.board__cell:nth-child(8),
.board__cell:last-child {
  border-bottom: none;
}

.board__cell.x::before,
.board__cell.x::after,
.board.x .board__cell:not(.x):not(.circle):hover::before,
.board.x .board__cell:not(.x):not(.circle):hover::after {
  content: '';
  width: calc(var(--mark-size) * 0.15);
  height: var(--mark-size);
  background: var(--cell-x-bg);
  border-radius: 10px;
  position: absolute;

  transition: all 0.3s ease;
}

.board.x .board__cell:not(.x):not(.circle):hover::before,
.board__cell.x::before {
  transform: rotate(45deg);
}

.board.x .board__cell:not(.x):not(.circle):hover::after,
.board__cell.x::after {
  transform: rotate(-45deg);
}

.board__cell.circle::before,
.board__cell.circle::after,
.board.circle .board__cell:not(.x):not(.circle):hover::before,
.board.circle .board__cell:not(.x):not(.circle):hover::after {
  content: '';
  width: var(--mark-size);
  height: var(--mark-size);
  background: var(--cell-circle-bg);
  border-radius: 50%;
  position: absolute;

  transition: all 0.3s ease;
}

.board.circle .board__cell:not(.x):not(.circle):hover::after,
.board__cell.circle::after {
  content: '';
  width: calc(var(--mark-size) * 0.7);
  height: calc(var(--mark-size) * 0.7);
  background: var(--body-bg);
}

.board.x .board__cell:not(.x):not(.circle):hover::before,
.board.x .board__cell:not(.x):not(.circle):hover::after {
  background: var(--cell-hover-bg);
}

.board.circle .board__cell:not(.x):not(.circle):hover::before {
  background: var(--cell-hover-bg);
}

.winning-message {
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.9);

  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  display: none;
}

.winning-message.active {
  display: flex;
}

.winning-message-text {
  font-size: 100px;
  color: #fff;
  margin-bottom: 15px;
}

.winning-message-btn {
  padding: 20px 30px;
  font-size: 24px;
}

.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding-bottom: 10px;
}

.footer__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  column-gap: 30px;
}

.footer__icon {
  width: 64px;
  height: auto;
  transition: all 0.3s ease;
}

.footer--github {
  filter: invert(1);
}

.footer__time {
  font-size: 32px;
}

.results {
  position: absolute;
  width: 120px;
  left: 50px;
  top: 50%;
  transform: translateY(-50%);
}

.results__title {
  text-transform: uppercase;
}

.results__list {
  /* text-decoration: none;
  list-style-type: none; */
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.results__item {
  font-size: 24px;
}

.audio {
  display: none;
}

/* .board__btn {
  background: #000;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  padding: 5px 20px;
  transition: all .3s ease;
  border-radius: 10px;
}

.board__btn-span {
}

.board__btn-span svg {
  width: 64px;
  height: auto;
}

.board__btn-span svg path {
  fill: #fff;
} */

.settings {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.settings__title {
  font-size: 24px;
  display: flex;
  align-items: center;
  text-transform: uppercase;
}

.settings_span {
}

.settings__icon {
  width: 48px;
  height: auto;
  filter: invert(1);
}

.settings__list {
  list-style-type: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.settings__item {
  width: 100%;
}

.settings__btn {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 10px;
  background: #000;
  color: #fff;
  font-size: 21px;
  border: 1px solid #fff;
  border-radius: 10px;
  box-shadow: 0 3px 6px rgba(255, 255, 255, 0.16),
    0 3px 6px rgba(255, 255, 255, 0.23);
  cursor: pointer;
  transition: all 0.3s ease;
}

.settings__btn-span {
  pointer-events: none;
}

.settings__btn-icon {
  width: 32px;
  height: auto;
  filter: invert(1);
}

.settings__btn--active::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 6px rgba(255,255,255,0.16), 0 3px 6px rgba(255,255,255,0.23);

}

@media (hover: hover) {
  .btn:hover {
    background: #000;
  }

  .board__btn:hover {
    background: #111;
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.19),
      0 6px 6px rgba(255, 255, 255, 0.23);
  }

  .settings__btn:hover {
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.19),
      0 6px 6px rgba(255, 255, 255, 0.23);
  }

  .footer__icon:hover {
    opacity: 0.5;
  }
}

.btn:active {
  background: #222;
  opacity: 0.9;
}

.settings__btn:active {
  opacity: 0.5;
}

.footer__icon:active {
  opacity: 0.25;
}
