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

body {
  /* Modern gradient background */
  background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%);
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Professional header styling */
.header {
  text-align: center;
  margin-bottom: 40px;
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title {
  font-size: 48px;
  font-weight: 700;
  color: white;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
}

.subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Container for board */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Modern board styling with shadow and rounded corners */
.board {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  gap: 8px;
  padding: 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Enhanced cell styling with hover effects and transitions */
.cell {
  height: 120px;
  background: #f8f9fa;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 48px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.cell:hover {
  background: #f0f1f3;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cell:active {
  transform: scale(0.98);
}

/* Player X styling (Blue) */
.cell:has-text-x {
  color: #3b82f6;
}

/* Player O styling (Orange) */
.cell:has-text-o {
  color: #f97316;
}

/* Modern winner modal with backdrop blur */
.winner-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.winner-modal.show {
  display: flex;
}

/* Winner content card styling */
.winner-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.winner-message {
  font-size: 32px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

/* Professional restart button */
.restart-btn {
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.restart-btn:active {
  transform: translateY(0);
}

/* Responsive design for mobile */
@media (max-width: 480px) {
  .title {
    font-size: 36px;
  }

  .board {
    grid-template-columns: repeat(3, 100px);
    gap: 6px;
    padding: 16px;
  }

  .cell {
    height: 100px;
    font-size: 40px;
  }

  .winner-content {
    padding: 30px;
  }

  .winner-message {
    font-size: 24px;
  }
}
