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

body {
  font-family: Arial, sans-serif;
  background-image: url('https://upload-bbs.miyoushe.com/upload/2026/01/14/320847708/15b946a3ef6510e57cb5f377c1413c45_8024964842749136374.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.game-container {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  padding: 20px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.language-selector {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
  gap: 10px;
}

.lang-btn {
  background-color: rgba(255, 255, 255, 0.8);
  color: #333;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
}

.lang-btn.active {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
  box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

h1 {
  color: #2c3e50;
  margin-bottom: 20px;
}

.rules {
  background-color: #f9f9f9;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: left;
}

.rules h3 {
  color: #3498db;
  margin-bottom: 10px;
}

.rules ul {
  list-style-position: inside;
  line-height: 1.5;
}

.board-container {
  margin-bottom: 20px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  width: 320px;
  height: 320px;
  margin: 0 auto;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px);
}

.cell {
  background-color: rgba(236, 240, 241, 0.9);
  border: 2px solid #bdc3c7;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.cell:hover {
  background-color: #d5dbdb;
  transform: scale(1.05);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
}

.cell.player {
  background-color: #3498db;
  color: white;
  box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
  animation: placePiece 0.5s ease-out;
}

.cell.player::before {
  content: 'O';
  font-size: 36px;
  font-weight: bold;
}

.cell.computer {
  background-color: #e67e22;
  color: white;
  box-shadow: 0 0 20px rgba(230, 126, 34, 0.5);
  animation: placePiece 0.5s ease-out;
}

.cell.computer::before {
  content: 'X';
  font-size: 36px;
  font-weight: bold;
}

.cell.player.blinking,
.cell.computer.blinking {
  animation: blink 1s infinite alternate, glow 1.5s ease-in-out infinite alternate;
}

@keyframes placePiece {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes blink {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.6;
  }
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
  }
  to {
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.8), 0 0 40px rgba(52, 152, 219, 0.4);
  }
}

.cell.computer.blinking {
  animation: blink 1s infinite alternate, computerGlow 1.5s ease-in-out infinite alternate;
}

@keyframes computerGlow {
  from {
    box-shadow: 0 0 20px rgba(230, 126, 34, 0.5);
  }
  to {
    box-shadow: 0 0 30px rgba(230, 126, 34, 0.8), 0 0 40px rgba(230, 126, 34, 0.4);
  }
}

.game-info {
  background-color: rgba(249, 249, 249, 0.9);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
  text-align: left;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.info-item {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 500;
}

.info-item span:first-child {
  color: #7f8c8d;
}

.info-item span:last-child {
  color: #2c3e50;
  font-weight: bold;
}

.controls {
  margin-bottom: 20px;
}

button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  position: relative;
  overflow: hidden;
}

button:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

button:hover::before {
  left: 100%;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 100%;
}

.modal-content h2 {
  color: #2c3e50;
  margin-bottom: 20px;
}

.modal-content p {
  font-size: 18px;
  margin-bottom: 30px;
}

.modal-content button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  position: relative;
  overflow: hidden;
}

.modal-content button:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.modal-content button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.modal-content button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.modal-content button:hover::before {
  left: 100%;
}

@media (max-width: 480px) {
  .game-container {
    padding: 10px;
  }
  
  .board {
    width: 250px;
    height: 250px;
  }
  
  .cell {
    font-size: 28px;
  }
}

#blinking-info {
  color: #e67e22;
  font-weight: bold;
  margin-top: 10px;
  text-align: center;
  width: 100%;
}