@import url("https://fonts.googleapis.com/css2?family=Signika+Negative:wght@300;400;500;600;700&display=swap");

*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  font-family: "Signika Negative", sans-serif;
  box-sizing: border-box;
  --x: #008080;
  --o: #c90000;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-size: cover;
  background-position: center center;
  background-repeat: repeat;
}

body.x {
  color: var(--x);
  --main: var(--x);
}
body.o {
  --main: var(--o);
  color: var(--o);
}
body#o {
  --me: var(--o);
}
body#x {
  --me: var(--x);
}
.xo_area,
.big_xo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
}
#app {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
}
.big_xo {
  gap: 15px;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.247);
  animation: up 0.25s ease forwards;
  opacity: 0;
  width: 100%;
  margin: 0 auto;
  max-width: 800px;
}
@keyframes up {
  0% {
    opacity: 0;
    transform: translateY(100px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
.xo_area {
  width: 100%;
  border: 4px solid var(--main);
  padding: 10px;
  border-radius: 10px;
  transition: border-color 0.25s cubic-bezier(0, 1, 0.92, 1.63),
    scale 0.25s cubic-bezier(0.25, 0.1, 0, 1.96), opacity 0.25s ease;
  position: relative;
}
.xo_area.won {
  background: var(--main);
  animation: b 0.25s ease forwards;
}
@keyframes b {
  0% {
    transform: scale(1);
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.xo_area.won::after {
  color: #fff !important;
}
.xo_area.done::after {
  content: attr(winner);
  position: absolute;
  color: var(--main);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  pointer-events: none;
  font-size: 0;
  animation: a 0.32s cubic-bezier(0.14, 0.2, 0.33, 1.52) forwards;
}
@keyframes a {
  0% {
    font-size: 0;
  }
  100% {
    font-size: 300px;
  }
}
.xo_area.done {
  /* opacity: 0.5; */
  opacity: 1 !important;
  border-color: transparent;
}
.xo_area.done span {
  opacity: 0.5 !important;
  pointer-events: none;
  box-shadow: rgba(0, 0, 0, 0.098) 0px 2px 4px;
}
.xo_area.disabled {
  opacity: 0.5;
  border-color: transparent;
  scale: 0.95;
}
.xo_area.disabled span {
  background: #53535342;
  opacity: 0.75;
  pointer-events: none;
}
.xo_area span {
  width: 100%;
  aspect-ratio: 1/1;
  background: rgb(255, 255, 255);
  cursor: pointer;
  box-shadow: rgba(0, 0, 0, 0.18) 0px 2px 4px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
  color: var(--main);
  font-size: 0;
  transition: font-size 0.25s cubic-bezier(0.14, 0.2, 0.33, 1.52),
    background 0.25s ease, scale 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}
#watcher .xo_area span {
  cursor: not-allowed;
}
.xo_area span.o,
.xo_area span.x {
  font-size: 40px;
}
.xo_area span:active {
  scale: 0.96;
}
.xo_area span:active::after {
  opacity: 0 !important;
}
.xo_area span::after {
  content: attr(current);
  position: absolute;
  font-size: 50px;
  opacity: 0;
  transition: opacity 0.25s;
  color: var(--me);
}
.done.o {
  --main: var(--o);
}
.done.x {
  --main: var(--x);
}
.xo_area span:hover::after {
  opacity: 0.1;
}

.x,
.x::after {
  color: var(--x) !important;
}
.o,
.o::after {
  color: var(--o) !important;
}

.column,
.raw,
.plusDiagonal,
.minusDiagonal {
  position: relative !important;
  background: var(--main) !important;
  color: #fff !important;
}

/* .column::after {
  content: "" !important;
  position: absolute !important;
  width: 3px;
  height: 107.15%;
  background: var(--main);
  z-index: 10;
  opacity: 1 !important;
} */

/* CSS */
.button-83 {
  appearance: button;
  background-color: transparent;
  background-image: linear-gradient(to bottom, #fff, #f8eedb);
  border: 0 solid #e5e7eb;
  border-radius: 0.5rem;
  box-sizing: border-box;
  color: #482307;
  column-gap: 1rem;
  cursor: pointer;
  display: flex;
  font-family: ui-sans-serif, system-ui, -apple-system, system-ui, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 100%;
  font-weight: 700;
  line-height: 24px;
  margin: 0;
  outline: 2px solid transparent;
  padding: 1rem 1.5rem;
  text-align: center;
  text-transform: none;
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  box-shadow: -6px 8px 10px rgba(81, 41, 10, 0.1),
    0px 2px 2px rgba(81, 41, 10, 0.2);
}

.button-83:active {
  background-color: #f3f4f6;
  box-shadow: -1px 2px 5px rgba(81, 41, 10, 0.15),
    0px 1px 1px rgba(81, 41, 10, 0.15);
  transform: translateY(0.125rem);
}

.button-83:focus {
  box-shadow: rgba(72, 35, 7, 0.46) 0 0 0 4px,
    -6px 8px 10px rgba(81, 41, 10, 0.1), 0px 2px 2px rgba(81, 41, 10, 0.2);
}

h1 {
  color: var(--me);
}

.rooms {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.room-btn {
  min-width: 100px;
  min-height: 100px;
  padding: 10px 20px;
  border: none;
  outline: none;
  color: #fff;
  background: #4b0082;
  font-weight: bold;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.202);
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}
button {
  transition: scale 0.25s ease;
}
button:active {
  scale: 0.96;
}

.create {
  width: 100%;
  padding: 10px 20px;
}

.last_played.x {
  /* background: var(--x) !important; */
  /* color: #fff !important; */
}
.last_played.o {
  /* background: var(--o) !important; */
  /* color: #fff !important; */
}

.other-state {
  position: absolute;
  top: 0;
  right: 5px;
  /* background: #fff; */
  padding: 10px 20px;
  /* border-radius: 10px; */
  /* box-shadow: 0 0 5px; */
  color: var(--main);
}

/* animation for the popup as it appears */
@keyframes popup {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 100;
  animation: popup 0.25s ease forwards;
}
.popup  h1 {
  font-size: 100px;
  margin-bottom: 40px;
}
.popup.draw  h1{
  color: #003fbc;
}
.popup button , .btn {
  padding: 10px 20px;
  border: none;
  outline: none;
  color: #fff;
  background: #4b0082;
  font-weight: bold;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.202);
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

.popup .home-btn {
  background: #fff;
  color: #7600c9;
  margin-top: 20px;
}

.popup button:active {
  scale: 0.96;
}
.popup.draw .wrapper{
  --me: #003fbc !important;
}
.wrapper {
  color: var(--me);
  background: #fff;
  padding: 20px 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-size: 40px;
  border-radius: 10px;
  box-shadow: 0 0 3px;
}


.time-wrapper {
  width: 100%;
  margin: 0 auto;
  max-width: 800px;
  justify-content: space-between;
  display: flex;
  padding: 5px 10px;
  font-size: 30px;
  font-weight: bold;
}


#x-time {
  color: var(--x) !important;
}

#o-time {
  color: var(--o) !important;
}

.time-wrapper > div {
  transition: scale 0.25s ease-in-out;
}
.time-wrapper > div.active {
  scale: 1.4;
}
