* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-color: black;
  font-family: Arial, sans-serif;
  color: #fff;
}

h1 {
  text-align: center;
  margin-top: 1rem;
  font-weight: 900;
}

section {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}

.score-board {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  justify-content: center;
}

.player-o,
.player-x {
  display: flex;
  gap: 35px;
  justify-content: space-between;
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 12px;
  padding: 10px 15px 10px 15px;
  height: 3rem;
  width: 30%;
  overflow: hidden;
  background-color: #232121;
  z-index: 99;
}

.player-o::after,
.player-x::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: green;
  z-index: -1;
  transition: width 0.5s ease;
}

.player-o.active::after {
  width: 100%;
}

.player-x.active::after {
  width: 100%;
}

#chance {
  margin-top: 20px;
}
#tossACoin{
  text-decoration: underline;
}
.result {
  display: none;
  transform: scale(0);
  transition: transform 0.3s ease;
  font-weight: 900;
  font-size: 2rem;
  align-items: center;
  justify-content: center;
  height: 200px;
  width: 200px;
  
  border-radius: 50%;
  border: 1px solid goldenrod;
}

.result.show {
  display: flex;
  transform: scale(1);
  animation: scaleUp 0.3s ease forwards;
}

@keyframes scaleUp {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}
.toss-section {
  display: none;
  flex-direction: column;
  align-items: center;
  transform: scale(0);
  transition: transform 0.3s ease;
}

.coin {
  position: relative;
  width: 200px;
  height: 200px;

  border-radius: 50%;
  perspective: 600px;
  margin: 20px auto;
  transition: transform 1s ease-in-out;
}

.toss-section.displayCoin {
  display: flex;
  animation: scaleUp 0.3s ease forwards;
}

@keyframes scaleUp {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}



.front,
.back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  transition: transform 1s ease-in-out;
}

.front {
  transform: rotateY(0deg);
}

.front {
  transform: rotateY(180deg);
}

.front img,
.back img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.flip {
  animation: rotate 3s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotateY(1800deg);
  }
}

.container {
  margin-top: 2rem;
  width: fit-content;
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 4px;

  padding: 5px;
  border: 1px solid #333;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  transition: scale 0.3s ease;
  animation: scaleup 0.3s ease forwards;
}

@keyframes scaleup {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

.result,
.hideContainer {
  animation: scaleDown 0.3s ease forwards;
}

@keyframes scaleDown {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(0);
  }
}

.box {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: red;
  border: 2px solid #444;
  border-radius: 4px;
  font-size: 1.8rem;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

.box[data-content="X"],
.box[data-content="O"] {
  animation: scaleIn 0.3s ease-out;
}

.box:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.footer {
  background-color: #222;
  color: #fff;
  width: 100%;
  padding: 30px 40px;
  text-align: center;
  margin-top: 100px;
}

.footer p {
  margin: 10px 0;
  font-size: 14px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.icon {
  color: #fff;
  font-size: 18px;
  text-decoration: none;
  transition: transform 0.3s ease, color 0.3s ease;
}

.icon.linkedin:hover {
  color: #0e76a8;
  transform: scale(1.2);
}

.icon.github:hover {
  color: #f0f0f0;
  transform: scale(1.2);
}

.icon.portfolio:hover {
  color: #1e90ff;
  transform: scale(1.2);
}

@media (max-width: 450px) {
  .score-board {
    flex-direction: column;
    gap: 10px;
  }

  .player-o,
  .player-x {
    width: 80%;
  }

  .container {
    grid-template-columns: repeat(3, 90px);
    grid-template-rows: repeat(3, 100px);
  }

  .box {
    font-size: 1.2rem;
  }
}