:root {
  --border: 1px solid black;
  --secondary-bg: rgba(240, 248, 255, 0.5);
  --primary-bg: rgba(255, 255, 255, 0.7);
  --border-color: rgba(255, 255, 255, 0.8);
  --text-color: #2c3e50;
  --border-radius: 5px;
  --transition-fast: all 0.2s ease;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  text-decoration: none;
  font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
  background: linear-gradient(135deg, rgb(220, 225, 245), rgb(205, 215, 240), rgb(225, 215, 245));
  padding: 20px;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background-color: antiquewhite;
  overflow: auto;
}

button {
  cursor: pointer;
  border: none;
  border-radius: var(--border-radius);
}

h1 {
  text-align: center;
  margin: 10px 0;
  font-size: clamp(2rem, 6vw, 3rem);
  justify-self: start;
  color: var(--text-color);
}

.container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1320px;
}

.choose-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 30px;
  background: rgba(240, 248, 255, 0.5);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 16px rgba(52, 152, 219, 0.1);
}
.choose-player > p {
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.player-btn-group {
  display: flex;
  gap: 20px;
}

.player {
  height: 80px;
  width: 80px;
  background: var(--primary-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.player:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.player:active {
  transform: translateY(0);
}

#player-o img {
  height: 58px;
  width: 58px;
}

#player-x img {
  height: 52px;
  width: 52px;
}

.game-wrapper {
  display: none;
  width: -moz-fit-content;
  width: fit-content;
  padding: 10px;
  background: rgba(240, 248, 255, 0.6);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 16px rgba(52, 152, 219, 0.15);
  transition: all 0.3s ease;
}
.game-wrapper:hover {
  box-shadow: 0 12px 24px rgba(52, 152, 219, 0.2);
}

#game {
  height: -moz-fit-content;
  height: fit-content;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.game-board {
  height: 300px;
  width: 300px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
}

.box {
  background: var(--primary-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.box:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.box:active {
  transform: translateY(0);
}
.box img.x-icon {
  height: 48px;
  width: 48px;
}
.box img.o-icon {
  height: 56px;
  width: 56px;
}

.game-stats {
  padding: 20px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.score-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-color);
  font-weight: 500;
}
.score-card > p {
  margin: 0;
  font-weight: 600;
}
.score-card div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.score-card .score {
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 600;
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-color);
}
.score-card .xScore img {
  height: 20px;
  width: 20px;
}
.score-card .oScore img {
  height: 22px;
  width: 22px;
}

#turn {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: var(--border-radius);
  transition: var(--transition-fast);
}
#turn:hover {
  background: var(--border-color);
}

#newGame {
  width: 100%;
  height: 45px;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--text-color);
  background: var(--primary-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition-fast);
}
#newGame:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
#newGame:active {
  transform: translateY(0);
}

#swal2-html-container {
  font-size: 1.25rem;
  font-weight: 500;
}
#swal2-html-container:has(img) {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-size: 2rem;
}

.swal2-container.swal2-center {
  -webkit-backdrop-filter: blur(3px) !important;
          backdrop-filter: blur(3px) !important;
  padding: 0 !important;
}

.swal2-title {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.swal2-title .o-icon-box {
  width: 32px;
}

.swal2-confirm.swal2-styled {
  background-color: #2c3e50;
  transition: var(--transition-fast);
}
.swal2-confirm.swal2-styled:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.swal2-confirm.swal2-styled:active {
  transform: translateY(0);
}

@media (max-width: 576px) {
  body {
    padding: 0 !important;
  }
  .swal2-popup.swal2-modal {
    width: 350px;
  }
  .swal2-title .o-icon-box {
    width: 32px;
  }
}