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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0a0a1a;
  color: #fff;
  overflow: hidden;
  height: 100vh;
}

#app {
  width: 100%;
  height: 100%;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

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

.logo {
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 0 0 20px #00d4ff, 0 0 40px #00d4ff;
}

.logo span {
  color: #ff4444;
  text-shadow: 0 0 20px #ff4444, 0 0 40px #ff4444;
}

.auth-container, .lobby-container {
  background: rgba(20, 20, 40, 0.95);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.1);
  width: 400px;
  max-width: 90vw;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #888;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.tab-btn.active {
  background: rgba(0, 212, 255, 0.15);
  border-color: #00d4ff;
  color: #00d4ff;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.auth-form.active {
  display: flex;
}

.auth-form input {
  padding: 0.875rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  border-color: #00d4ff;
}

.btn-primary {
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #00d4ff, #0099cc);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}

.btn-primary.big {
  padding: 1.25rem 3rem;
  font-size: 1.25rem;
}

.btn-secondary {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: #ff4444;
  color: #ff4444;
}

.error-message {
  color: #ff4444;
  text-align: center;
  margin-top: 1rem;
  min-height: 1.5rem;
  font-size: 0.875rem;
}

.player-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.player-info span {
  font-size: 1.125rem;
  font-weight: 600;
  color: #00d4ff;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.queue-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  color: #00d4ff;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.game-info {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.game-info h3 {
  margin-bottom: 0.75rem;
  color: #00d4ff;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.game-info ul {
  list-style: none;
  font-size: 0.875rem;
  color: #aaa;
}

.game-info li {
  margin-bottom: 0.375rem;
}

.game-info b {
  color: #fff;
}

#game-canvas {
  display: block;
  background: #0a0a1a;
}

#game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.team-score {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.team-score.team1 {
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.15);
}

.team-score.team2 {
  color: #ff4444;
  background: rgba(255, 68, 68, 0.15);
}

.timer {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.hud-bottom {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  pointer-events: auto;
}

.hp-bar, .energy-bar {
  width: 200px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff88, #00cc66);
  border-radius: 12px;
  transition: width 0.2s;
}

.energy-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffdd00, #ffaa00);
  border-radius: 12px;
  transition: width 0.2s;
}

.hp-bar span, .energy-bar span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.btn-upgrade {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ffdd00, #ffaa00);
  border: none;
  border-radius: 8px;
  color: #000;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-upgrade:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 221, 0, 0.5);
}

.btn-upgrade:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.hud-stats {
  position: absolute;
  top: 4rem;
  left: 1rem;
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: #aaa;
}

.hud-stats span span {
  color: #fff;
  font-weight: 700;
}

.game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 10, 26, 0.95);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  text-align: center;
  pointer-events: auto;
}

.game-over h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #00d4ff;
}

#game-result {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  color: #ccc;
}

.hidden {
  display: none !important;
}
