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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  min-height: 100vh;
  color: #fff;
  position: relative;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(123, 47, 247, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(241, 7, 163, 0.1) 0%, transparent 50%);
  animation: bgPulse 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes bgPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

#app {
  height: 100vh;
  padding: 20px;
}

.screen {
  display: none;
}

.screen.active {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

#nicknameScreen .card {
  width: 450px;
  background: rgba(15, 12, 41, 0.95);
  border: 2px solid #00d4ff;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.5), 0 10px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

#nicknameScreen .card h1 {
  background: linear-gradient(90deg, #00d4ff, #7b2ff7, #f107a3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

#nicknameScreen .form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #00d4ff;
  color: #fff;
  transition: all 0.3s;
}

#nicknameScreen .form-control:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #7b2ff7;
  box-shadow: 0 0 15px rgba(123, 47, 247, 0.5);
  color: #fff;
}

#nicknameScreen .form-control::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#nicknameScreen .btn-primary {
  background: linear-gradient(90deg, #00d4ff, #7b2ff7);
  border: none;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

#nicknameScreen .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.6);
}

#nicknameScreen .btn-secondary {
  background: linear-gradient(90deg, #f107a3, #fd5949);
  border: none;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(241, 7, 163, 0.4);
}

#nicknameScreen .btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(241, 7, 163, 0.6);
}

#gameScreen {
  display: none;
}

#gameScreen.active {
  display: block;
}

#gameBoard {
  background: linear-gradient(135deg, #d4a574 0%, #c9963d 100%);
  border: 3px solid #00d4ff;
  box-shadow: 
    0 0 20px rgba(0, 212, 255, 0.8),
    0 0 40px rgba(0, 212, 255, 0.6),
    0 0 60px rgba(123, 47, 247, 0.4),
    0 10px 30px rgba(0, 0, 0, 0.5),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  animation: boardGlow 3s ease-in-out infinite, boardFloat 4s ease-in-out infinite;
  transition: transform 0.3s ease;
}

#gameBoard:hover {
  transform: scale(1.01);
}

@keyframes boardGlow {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(0, 212, 255, 0.8),
      0 0 40px rgba(0, 212, 255, 0.6),
      0 0 60px rgba(123, 47, 247, 0.4),
      0 10px 30px rgba(0, 0, 0, 0.5),
      inset 0 0 20px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(0, 212, 255, 1),
      0 0 60px rgba(0, 212, 255, 0.8),
      0 0 90px rgba(123, 47, 247, 0.6),
      0 10px 30px rgba(0, 0, 0, 0.5),
      inset 0 0 30px rgba(255, 255, 255, 0.2);
  }
}

@keyframes boardFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.game-info {
  background: rgba(15, 12, 41, 0.9);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #00d4ff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.player-info .card {
  background: rgba(15, 12, 41, 0.9);
  border: 2px solid transparent;
  background-image: 
    linear-gradient(rgba(15, 12, 41, 0.9), rgba(15, 12, 41, 0.9)),
    linear-gradient(90deg, #00d4ff, #7b2ff7, #f107a3);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 0 20px rgba(123, 47, 247, 0.3);
  transition: all 0.3s ease;
  animation: cardShine 3s ease-in-out infinite;
}

.player-info .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 35px rgba(123, 47, 247, 0.6);
}

@keyframes cardShine {
  0%, 100% {
    box-shadow: 0 0 20px rgba(123, 47, 247, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(241, 7, 163, 0.6);
  }
}

.player-info .card-body {
  color: #fff;
}

.skill-info {
  margin-top: 10px;
  padding: 8px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 4px;
  font-size: 14px;
}

.skill-info button {
  margin-top: 5px;
  background: linear-gradient(90deg, #f107a3, #fd5949);
  border: none;
  transition: all 0.3s;
}

.skill-info button:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(241, 7, 163, 0.5);
}

#chatMessages {
  background: rgba(15, 12, 41, 0.5);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 4px;
  padding: 10px;
  max-height: 500px;
}

.message {
  margin-bottom: 10px;
  padding: 8px;
  background: rgba(0, 212, 255, 0.1);
  border-left: 3px solid #00d4ff;
  border-radius: 4px;
  word-wrap: break-word;
}

.message .nickname {
  font-weight: bold;
  color: #00d4ff;
  margin-right: 5px;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.message .timestamp {
  font-size: 11px;
  color: #999;
  margin-left: 5px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(15, 12, 41, 0.95);
  padding: 40px;
  border-radius: 10px;
  border: 2px solid #00d4ff;
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.5), 0 10px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
  min-width: 400px;
  position: relative;
  backdrop-filter: blur(10px);
}

.modal-content .btn-success {
  background: linear-gradient(90deg, #00d4ff, #7b2ff7);
  border: none;
  transition: all 0.3s;
}

.modal-content .btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.6);
}

.modal-content .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s;
}

.modal-content .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.animation-container {
  width: 100%;
  height: 200px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.firework {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  animation: explode 1s ease-out infinite;
}

@keyframes explode {
  0% {
    transform: translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty));
    opacity: 0;
  }
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--color);
  animation: fall 3s linear infinite;
}

@keyframes fall {
  to {
    transform: translateY(200px) rotate(360deg);
    opacity: 0;
  }
}

.winner-text {
  font-size: 48px;
  font-weight: bold;
  color: #28a745;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  animation: bounce 0.5s ease-in-out;
}

.loser-text {
  font-size: 36px;
  font-weight: bold;
  color: #dc3545;
  animation: shake 0.5s ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.badge {
  font-size: 14px;
  padding: 8px 12px;
  border: 2px solid currentColor;
  box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
  animation: badgeGlow 2s ease-in-out infinite;
  transition: all 0.3s ease;
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px currentColor, 0 0 30px currentColor;
}

@keyframes badgeGlow {
  0%, 100% {
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
  }
  50% {
    box-shadow: 0 0 15px currentColor, 0 0 30px currentColor, 0 0 40px currentColor;
  }
}

.card {
  background: rgba(15, 12, 41, 0.9);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #fff;
}

.card-header {
  background: rgba(0, 212, 255, 0.1);
  border-bottom: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  font-weight: bold;
}

#chatInput {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #fff;
}

#chatInput:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #00d4ff;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
  color: #fff;
}

#chatInput::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-group .btn-primary {
  background: linear-gradient(90deg, #00d4ff, #7b2ff7);
  border: none;
}
