* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0D081B;
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

body::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 210, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(77, 150, 255, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(98, 0, 238, 0.08) 0%, transparent 50%);
  animation: backgroundPulse 8s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.login-container {
  background: #1A1235;
  border-radius: 2rem;
  padding: 2.5rem 3rem;
  border: 2px solid #2F1B68;
  box-shadow: 
    0 0 40px rgba(0, 210, 255, 0.15),
    0 0 80px rgba(77, 150, 255, 0.1),
    0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
  z-index: 1;
  max-width: 600px;
  width: 100%;
}

.login-container h1 {
  font-weight: 700;
  font-size: 3rem;
  letter-spacing: 3px;
  color: #E2DBF0;
  margin-bottom: 0.5rem;
  text-shadow: 
    0 0 20px rgba(0, 210, 255, 0.5),
    0 0 40px rgba(77, 150, 255, 0.3);
}

.subtitle {
  color: #8AB4F8;
  font-size: 1rem;
  margin-bottom: 2rem;
  font-weight: 500;
}

.player-setup {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.player-card {
  flex: 1;
  background: #0D081B;
  padding: 1.5rem;
  border-radius: 1.5rem;
  border: 1px solid #2F1B68;
  text-align: left;
}

.player-card label {
  display: block;
  color: #E2DBF0;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.player-card input[type="text"] {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid #2F1B68;
  background: #1A1235;
  color: #E2DBF0;
  font-size: 1rem;
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.3s ease;
}

.player-card input[type="text"]:focus {
  border-color: #00D2FF;
}

.color-options span {
  display: block;
  color: #8AB4F8;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.color-select {
  display: flex;
  gap: 0.8rem;
}

.color-select input[type="radio"] {
  display: none;
}

.color-label {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: 1px solid #2F1B68;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #E2DBF0;
  background: #1A1235;
  transition: all 0.3s ease;
}

.red-label:hover {
  border-color: #ff4444;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.yellow-label:hover {
  border-color: #ffc800;
  box-shadow: 0 0 10px rgba(255, 200, 0, 0.3);
}

.color-select input[type="radio"]:checked + .red-label {
  background: #ff4444;
  border-color: #ff4444;
  color: white;
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
}

.color-select input[type="radio"]:checked + .yellow-label {
  background: #e6a700;
  border-color: #e6a700;
  color: white;
  box-shadow: 0 0 15px rgba(255, 200, 0, 0.5);
}

.vs-divider {
  color: #E2DBF0;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 0 0.3rem;
}

.error-message {
  color: #ff4444;
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin-bottom: 0.8rem;
}

.start-btn {
  background: linear-gradient(135deg, #4D96FF, #00D2FF);
  border: 2px solid #00D2FF;
  padding: 0.9rem 3rem;
  border-radius: 3rem;
  font-weight: 650;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  color: #E2DBF0;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
  width: 100%;
}

.start-btn:hover {
  background: linear-gradient(135deg, #00D2FF, #4D96FF);
  box-shadow: 0 0 40px rgba(0, 210, 255, 0.5);
}

.game-container {
  background: #1A1235;
  backdrop-filter: blur(20px);
  border-radius: 3rem;
  box-shadow: 
    0 0 40px rgba(0, 210, 255, 0.15),
    0 0 80px rgba(77, 150, 255, 0.1),
    0 20px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  padding: 2.5rem 2.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #2F1B68;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  animation: borderGlow 4s ease-in-out infinite;
}

@keyframes borderGlow {
  0%, 100% {
    border-color: #2F1B68;
    box-shadow: 
      0 0 40px rgba(0, 210, 255, 0.15),
      0 0 80px rgba(77, 150, 255, 0.1),
      0 20px 50px rgba(0, 0, 0, 0.5);
  }
  50% {
    border-color: #00D2FF;
    box-shadow: 
      0 0 50px rgba(0, 210, 255, 0.3),
      0 0 100px rgba(77, 150, 255, 0.2),
      0 20px 50px rgba(0, 0, 0, 0.5),
      0 0 30px rgba(0, 210, 255, 0.2);
  }
}

.game-container h1 {
  font-weight: 700;
  font-size: 2.8rem;
  letter-spacing: 3px;
  color: #E2DBF0;
  margin-bottom: 0.8rem;
  text-shadow: 
    0 0 20px rgba(0, 210, 255, 0.5),
    0 0 40px rgba(77, 150, 255, 0.3);
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.1), rgba(77, 150, 255, 0.05));
  padding: 0.4rem 2.5rem;
  border-radius: 60px;
  border: 2px solid #2F1B68;
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% {
    border-color: #2F1B68;
  }
  50% {
    border-color: #00D2FF;
  }
}

.turn-indicator {
  background: #1A1235;
  backdrop-filter: blur(12px);
  padding: 0.7rem 2.4rem;
  border-radius: 3rem;
  margin: 0.5rem 0 1.8rem 0;
  font-weight: 600;
  font-size: 1.3rem;
  color: #E2DBF0;
  box-shadow: 
    0 0 20px rgba(0, 210, 255, 0.1),
    0 8px 25px rgba(0, 0, 0, 0.3);
  border: 2px solid #2F1B68;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: borderGlow 4s ease-in-out infinite;
}

.disc-preview {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff4444;
  box-shadow: 
    0 0 15px rgba(255, 68, 68, 0.8),
    0 0 30px rgba(255, 68, 68, 0.4);
  margin-left: 6px;
}

.board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.8rem;
  background: linear-gradient(135deg, #1A1235, #0D081B);
  backdrop-filter: blur(14px);
  padding: 1.8rem;
  border-radius: 3rem;
  box-shadow: 
    inset 0 0 30px rgba(0, 210, 255, 0.1),
    0 0 40px rgba(0, 210, 255, 0.15),
    0 20px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 1.8rem;
  border: 2px solid #2F1B68;
  animation: borderGlow 4s ease-in-out infinite;
}

.cell {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #1A1235, #0D081B);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 
    inset 0 -5px 8px rgba(0, 0, 0, 0.3),
    0 8px 15px rgba(0, 0, 0, 0.4),
    0 0 10px rgba(0, 210, 255, 0.1);
  border: 2px solid #2F1B68;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cell::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cell:hover {
  background: linear-gradient(135deg, #2F1B68, #1A1235);
  transform: scale(1.05);
  border-color: #00D2FF;
  box-shadow: 
    inset 0 -4px 8px rgba(0, 0, 0, 0.3),
    0 0 25px rgba(0, 210, 255, 0.4),
    0 0 50px rgba(77, 150, 255, 0.2);
}

.cell:hover::before {
  opacity: 1;
}

.disc {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  transition: 0.3s ease;
  animation: discDrop 0.3s ease-out;
}

@keyframes discDrop {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.disc.red {
  background: radial-gradient(circle at 35% 35%, #ff6b6b, #c92a2a);
  box-shadow: 
    inset -5px -6px 10px rgba(0, 0, 0, 0.3),
    inset 4px 4px 12px rgba(255, 200, 200, 0.8),
    0 0 20px rgba(255, 68, 68, 0.5),
    0 0 40px rgba(255, 68, 68, 0.2);
  border: 1px solid rgba(255, 100, 100, 0.5);
}

.disc.yellow {
  background: radial-gradient(circle at 35% 35%, #ffe083, #e6a700);
  box-shadow: 
    inset -5px -6px 10px rgba(0, 0, 0, 0.25),
    inset 4px 4px 12px rgba(255, 250, 200, 0.9),
    0 0 20px rgba(255, 200, 0, 0.5),
    0 0 40px rgba(255, 200, 0, 0.2);
  border: 1px solid rgba(255, 200, 0, 0.5);
}

.controls {
  display: flex;
  gap: 1.8rem;
  align-items: center;
  margin-top: 0.5rem;
}

button {
  background: linear-gradient(135deg, #4D96FF, #00D2FF);
  backdrop-filter: blur(12px);
  border: 2px solid #00D2FF;
  padding: 0.9rem 2.5rem;
  border-radius: 3rem;
  font-weight: 650;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  color: #E2DBF0;
  box-shadow: 
    0 0 20px rgba(0, 210, 255, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  overflow: hidden;
  animation: buttonGlow 2s ease-in-out infinite;
}

@keyframes buttonGlow {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(0, 210, 255, 0.3),
      0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: #00D2FF;
  }
  50% {
    box-shadow: 
      0 0 40px rgba(0, 210, 255, 0.6),
      0 0 80px rgba(77, 150, 255, 0.4),
      0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: #4D96FF;
  }
}

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 {
  background: linear-gradient(135deg, #00D2FF, #4D96FF);
  transform: translateY(-2px);
  box-shadow: 
    0 0 50px rgba(0, 210, 255, 0.5),
    0 0 100px rgba(77, 150, 255, 0.3),
    0 15px 30px rgba(0, 0, 0, 0.4);
  border-color: #4D96FF;
}

button:hover::before {
  left: 100%;
}

button:active {
  transform: translateY(2px);
  box-shadow: 
    0 0 30px rgba(0, 210, 255, 0.4),
    0 5px 15px rgba(0, 0, 0, 0.3);
}

.message-area {
  margin-top: 1.2rem;
  font-weight: 600;
  font-size: 1.2rem;
  color: #E2DBF0;
  background: linear-gradient(135deg, #1A1235, #0D081B);
  padding: 0.7rem 2rem;
  border-radius: 2rem;
  backdrop-filter: blur(8px);
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  border: 2px solid #2F1B68;
  box-shadow: 
    0 0 20px rgba(0, 210, 255, 0.1),
    0 8px 20px rgba(0, 0, 0, 0.3);
  animation: borderGlow 4s ease-in-out infinite;
}

@media (max-width: 650px) {
  .player-setup {
    flex-direction: column;
  }
  
  .vs-divider {
    padding: 0.5rem 0;
  }
  
  .cell {
    width: 48px;
    height: 48px;
  }
  
  .disc {
    width: 40px;
    height: 40px;
  }
  
  .game-container {
    padding: 1.8rem;
  }
  
  .game-container h1 {
    font-size: 2rem;
  }
}