@import url(https://fonts.googleapis.com/css?family=Lato:100,100italic,300,300italic,regular,italic,700,700italic,900,900italic);

:root {
  --transition: 0.3s;
  --border-r: 5px;
  --color: #d8d8d8;
  --link-color: #ffc100;
  --btn-color: #21283e;
  --border: 2px solid var(--color);
  --ceil-size: 100px;
  --mark-size: calc(var(--ceil-size) * 0.9);
}

* {
  margin: 0;
  padding: 0;
  border: 0;
}

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

button {
  font-size: inherit;
  color: inherit;
  background-color: transparent;
  cursor: pointer;
  transition: var(--transition);
}

html {
  scroll-behavior: smooth;
  font-family: Lato, serif;
  background-image: linear-gradient(112.1deg, rgba(32, 38, 57, 1) 11.4%, rgb(43, 55, 95) 70.2%);
}

body {
  height: 100vh;
  font-size: 18px;
  color: var(--color);
}

a {
  color: var(--link-color);
  &:active {
    opacity: 0.5;
  }
}

.btn {
  padding: 5px 20px;
  border-radius: var(--border-r);
  background-color: var(--color);
  color: #000;
}

.btn:hover {
  background-color: var(--link-color);
}

.wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0px 20px;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.main {
  flex: 1 1 auto;
}

.header {
  padding: 20px 0px;
  font-weight: 700;
  font-size: 1.5rem;
}

.logo-row {
  display: flex;
  text-align: center;
}

.logo-row span {
  width: 25px;
  height: 32px;
}

.border-right {
  border-right: var(--border);
}

.border-top {
  border-top: var(--border);
}

.main,
.winning-popup,
.start-screen form {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.start-screen form {
  gap: 30px;
}

.game-screen,
.start-screen form {
  background-color: rgba(255, 255, 255, 0.03);
  padding: 30px;
  border-radius: var(--border-r);
  border: var(--border);
}

.form-item {
  display: flex;
  gap: 15px;
  align-items: center;
  font-weight: 700;
}

.form-input {
  padding: 5px 10px;
  border-radius: var(--border-r);
  font-size: 0.9em;
}

.game-screen {
  text-align: center;
}

.controls {
  margin-top: 80px;
}

.go-back-btn {
  margin-right: 20px;
}

.statistic {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  width: 310px;
  margin-bottom: 30px;
}

.statistic-mark {
  font-size: 1.5em;
  opacity: 0.7;
  margin-bottom: 10px;
}

.name {
  margin-bottom: 10px;
}

.turn {
  margin-bottom: 30px;
  color: var(--link-color);
  opacity: 0.9;
}

.game-flow {
  position: relative;
}

.winner-message {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(22, 27, 44, 0.9);
  color: var(--color);
  font-size: 3rem;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--border-r);
}

.board {
  display: grid;
  justify-content: center;
  align-items: center;
  text-align: center;
  justify-items: center;
  align-items: center;
  grid-template-rows: repeat(3, auto);
  grid-template-columns: repeat(3, auto);
  background-color: #252e4a;
  border-radius: var(--border-r);
}

.cell {
  width: var(--ceil-size);
  height: var(--ceil-size);
  border: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

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

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

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

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

.cell.x::before {
  content: 'X';
  position: absolute;
  font-size: 6rem;
}

.cell.circle::before {
  content: 'O';
  position: absolute;
  font-size: 6rem;
}

.footer {
  padding: 20px 0px;
  text-align: center;
}
