/* CSS Reset và base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Ensure clean panel display */
#login-panel, #room-panel, #map-selection-panel, #game-ui {
  width: 100%;
  position: relative;
  margin: 0 auto;
  clear: both;
}

/* Đảm bảo panel không bị cắt khi nội dung dài */
#character-selection-panel, #room-panel, #map-selection-panel, #game-ui {
  max-height: 100vh;
  overflow-y: auto;
}

/* Remove any conflicting transforms */
#login-panel *, #room-panel *, #game-ui * {
  transform-origin: center center;
}

/* Smooth transitions for all interactive elements */
button, input, select, textarea {
  transition: all 0.3s ease;
}

/* Fix button hover flickering */
button, .google-btn {
  will-change: transform, box-shadow, background;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Anti-flickering for pseudo-elements */
button::before, .google-btn::before {
  will-change: left;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Focus styles */
button:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(0, 255, 255, 0.5);
  outline-offset: 2px;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: white;
  text-align: center;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  animation: backgroundShift 10s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%, 100% { 
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
  }
  25% { 
    background: linear-gradient(135deg, #16213e 0%, #0c0c0c 50%, #1a1a2e 100%);
  }
  50% { 
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0c0c0c 100%);
  }
  75% { 
    background: linear-gradient(135deg, #0c0c0c 0%, #16213e 50%, #1a1a2e 100%);
  }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  animation: orbMove 15s ease-in-out infinite;
}

@keyframes orbMove {
  0%, 100% {
    background: 
      radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
  }
  33% {
    background: 
      radial-gradient(circle at 80% 20%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 20% 80%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 60% 60%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
  }
  66% {
    background: 
      radial-gradient(circle at 40% 60%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 60% 40%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
  }
}

/* Enhanced keyframes */
@keyframes glow {
  0%, 100% {
    text-shadow: 
      0 0 10px rgba(0, 255, 255, 0.5),
      0 0 20px rgba(0, 255, 255, 0.3),
      0 0 30px rgba(0, 255, 255, 0.1);
    box-shadow: 
      0 0 30px rgba(0, 255, 255, 0.3),
      inset 0 0 30px rgba(0, 0, 0, 0.5);
  }
  50% {
    text-shadow: 
      0 0 20px rgba(0, 255, 255, 0.8),
      0 0 30px rgba(0, 255, 255, 0.6),
      0 0 40px rgba(0, 255, 255, 0.4),
      0 0 50px rgba(0, 255, 255, 0.2);
    box-shadow: 
      0 0 50px rgba(0, 255, 255, 0.5),
      inset 0 0 30px rgba(0, 0, 0, 0.3);
  }
}

@keyframes slideInUp {
  0% {
    transform: translateY(50px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  0% {
    transform: translateX(-50px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

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

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

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

#title {
  margin: 20px;
  font-size: 3.5em;
  font-weight: 900;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite, float 4s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
  position: relative;
}

#title::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff);
  background-size: 400% 400%;
  animation: gradientShift 3s ease-in-out infinite;
  filter: blur(20px);
  opacity: 0.3;
  z-index: -1;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

#game-container {
  width: 800px;
  height: 600px;
  margin: 10px auto;
  background: linear-gradient(135deg, #2a2a3a 0%, #1e1e2e 100%);
  position: relative;
  border: 3px solid;
  border-image: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff) 1;
  border-radius: 15px;
  box-shadow: 
    0 0 30px rgba(0, 255, 255, 0.3),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  animation: glow 3s ease-in-out infinite;
  overflow: hidden;
}

#game-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 40px 70px, rgba(0, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 0, 255, 0.3), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 0, 0.3), transparent);
  background-repeat: repeat;
  background-size: 150px 150px;
  animation: particleFloat 20s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-150px);
  }
}

#game-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 10% 20%, rgba(0, 255, 255, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(255, 0, 255, 0.1) 0%, transparent 20%);
  pointer-events: none;
  z-index: 0;
}

#player, .enemy {
  width: 50px;
  height: 50px;
  position: absolute;
  background: none;
  border: none;
  box-sizing: border-box;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
  transition: all 0.2s ease-in-out;
  z-index: 10;
}

#player:hover, .enemy:hover {
  filter: drop-shadow(0 8px 16px rgba(0, 255, 255, 0.6));
  transform: scale(1.05);
}

#player .body, .enemy .body {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 14px;
  height: 22px;
  background: linear-gradient(145deg, #ff6b6b 0%, #ee5a24 50%, #c44569 100%);
  border-radius: 7px;
  z-index: 1;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.enemy .body { 
  background: linear-gradient(145deg, #4834d4 0%, #686de0 50%, #30336b 100%);
}

#player .head, .enemy .head {
  position: absolute;
  left: 13px;
  top: 2px;
  width: 24px;
  height: 20px;
  background: radial-gradient(ellipse at 30% 30%, #ffe0b2 0%, #ffcc80 50%, #d7940b 100%);
  border-radius: 50%;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

#player .eye, .enemy .eye {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #333 60%, #000 100%);
  border-radius: 50%;
  top: 10px;
  left: 19px;
  z-index: 3;
  animation: blink 3s infinite;
}

@keyframes blink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

#player .arm.left, .enemy .arm.left,
#player .arm.right, .enemy .arm.right {
  background: linear-gradient(90deg, #ff6b6b 0%, #ee5a24 50%, #c44569 100%);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.enemy .arm.left, .enemy .arm.right { 
  background: linear-gradient(90deg, #4834d4 0%, #686de0 50%, #30336b 100%);
}

#player .leg.left, .enemy .leg.left,
#player .leg.right, .enemy .leg.right {
  background: linear-gradient(180deg, #2c2c54 0%, #40407a 50%, #706fd3 100%);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#info-panel {
  margin-top: 10px;
}

#player .gun, .enemy .gun {
  position: absolute;
  width: 14px;
  height: 6px;
  background: linear-gradient(90deg, #57606f 0%, #2f3542 50%, #000 100%);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.5),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

#player .arm.left .gun, .enemy .arm.left .gun {
  left: 10px;
}

#player .arm.right .gun, .enemy .arm.right .gun {
  left: 10px;
}

/* Enhanced button styles */
button {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

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;
  pointer-events: none;
}

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

button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

button:active {
  transform: translateY(-1px) scale(1.01);
}

/* Login buttons container */
.login-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
  align-items: center;
}

/* Google login button */
.google-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #ea4335 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.5px;
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.25),
    0 2px 6px rgba(66, 133, 244, 0.2);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.google-btn::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;
  pointer-events: none;
}

.google-btn:hover::before {
  left: 100%;
}

.google-btn:hover {
  background: linear-gradient(135deg, #3367d6 0%, #2d8a47 50%, #d33b2c 100%);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.35),
    0 4px 12px rgba(66, 133, 244, 0.4);
}

.google-btn:active {
  transform: translateY(-1px) scale(1.01);
}

.google-icon {
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* Prevent text selection and improve hover stability */
button, .google-btn {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Stable hover states */
button:hover, .google-btn:hover {
  will-change: transform, box-shadow;
}

/* Responsive design for login buttons */
@media (max-width: 480px) {
  .login-buttons {
    gap: 12px;
  }
  
  .google-btn {
    width: 100%;
    max-width: 280px;
  }
  
  #login-btn {
    width: 100%;
    max-width: 280px;
  }
}

/* Neon border effect for containers */
.neon-border {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95)) padding-box,
              linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff) border-box;
  border-radius: 20px;
  animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
  0% {
    box-shadow: 
      0 0 20px rgba(0, 255, 255, 0.3),
      0 0 40px rgba(0, 255, 255, 0.1);
  }
  100% {
    box-shadow: 
      0 0 30px rgba(0, 255, 255, 0.6),
      0 0 60px rgba(0, 255, 255, 0.3),
      0 0 90px rgba(0, 255, 255, 0.1);
  }
}

/* Loading animations */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #00ffff;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

/* Loading indicator styles */
#auth-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

#auth-loading p {
  color: #00ffff;
  margin-top: 20px;
  font-size: 18px;
  text-shadow: 0 0 5px #00ffff;
}

#auth-loading .spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #00ffff;
  animation: spin 1s ease-in-out infinite;
}

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

/* Hide body content while loading */
body.loading > div:not(#auth-loading) {
  opacity: 0;
  pointer-events: none;
}

/* Notification styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.9) 0%, rgba(46, 204, 113, 0.9) 100%);
  border: 1px solid rgba(39, 174, 96, 0.5);
  border-radius: 10px;
  color: white;
  font-weight: 600;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.notification.show {
  transform: translateX(0);
}

.notification.error {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.9) 0%, rgba(192, 57, 43, 0.9) 100%);
  border-color: rgba(231, 76, 60, 0.5);
}

.notification.warning {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.9) 0%, rgba(230, 126, 34, 0.9) 100%);
  border-color: rgba(243, 156, 18, 0.5);
}

/* Tooltip styles */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
}

/* Enhanced scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #00ffff, #ff00ff);
  border-radius: 10px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #ff00ff, #ffff00);
}

/* Glass morphism effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Floating elements */
.floating {
  animation: float 6s ease-in-out infinite;
}

.floating:nth-child(2) {
  animation-delay: -2s;
}

.floating:nth-child(3) {
  animation-delay: -4s;
}

/* Panel display controls - Override all animations when hidden */
#login-panel, #character-selection-panel, #room-panel, #game-ui {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#login-panel[style*="display: none"], 
#character-selection-panel[style*="display: none"],
#room-panel[style*="display: none"], 
#game-ui[style*="display: none"] {
  display: none !important;
  opacity: 0 !important;
  transform: translateY(-50px) !important;
  animation: none !important;
  visibility: hidden !important;
}

/* Show panels with animation */
#login-panel:not([style*="display: none"]), 
#character-selection-panel:not([style*="display: none"]),
#room-panel:not([style*="display: none"]), 
#game-ui:not([style*="display: none"]) {
  display: block !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  visibility: visible !important;
}

/* Animation cho panel khi hiển thị */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Thêm animation cho panel */
#login-panel:not([style*="display: none"]),
#character-selection-panel:not([style*="display: none"]),
#room-panel:not([style*="display: none"]),
#map-selection-panel:not([style*="display: none"]),
#game-ui:not([style*="display: none"]) {
  animation: fadeInUp 0.4s ease;
}

/* Body classes cho từng chế độ panel */
body.login-mode .current-selection,
body.character-mode .current-selection {
  display: none !important;
}

body.login-mode #login-panel {
  display: block !important;
}

body.character-mode #character-selection-panel {
  display: block !important;
}

body.room-mode #room-panel {
  display: block !important;
}

body.map-mode #map-selection-panel {
  display: block !important;
}

body.game-mode #game-ui {
  display: block !important;
}

/* Đảm bảo tối giản tất cả phần tử khác */
body.login-mode > div:not(#login-panel),
body.character-mode > div:not(#character-selection-panel),
body.room-mode > div:not(#room-panel),
body.map-mode > div:not(#map-selection-panel),
body.game-mode > div:not(#game-ui) {
  display: none !important;
}

/* Tạo không gian cho các nút và tiêu đề */
#character-selection-panel h2,
#room-panel h2,
#map-selection-panel h2 {
  margin: 20px 0;
  font-size: 2em;
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Nút xác nhận và hủy trong phần chọn nhân vật và vũ khí */
.xac-nhan-btn, .huy-btn {
  padding: 10px 20px;
  margin: 0 10px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
}

.xac-nhan-btn {
  background: linear-gradient(135deg, #00a876 0%, #00d2a3 100%);
  color: white;
}

.huy-btn {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
}

.xac-nhan-btn:hover, .huy-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Đảm bảo hiển thị đúng khi chọn nhân vật và vũ khí trong game */
body.character-mode #character-selection-panel {
  display: block !important;
}

body.room-mode #room-panel {
  display: block !important;
}

body.map-mode #map-selection-panel {
  display: block !important;
}

body.game-mode #game-ui {
  display: block !important;
}

/* Đảm bảo các panel không hiển thị đồng thời và không đè lên nhau */
#login-panel, #character-selection-panel, #room-panel, #map-selection-panel, #game-ui {
  display: none; /* Mặc định tất cả đều ẩn */
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  clear: both;
  overflow-y: auto;
  min-height: 400px;
  padding: 30px 20px;
}

/* Chỉ hiển thị panel đang active */
#login-panel:not([style*="display: none"]),
#character-selection-panel:not([style*="display: none"]),
#room-panel:not([style*="display: none"]),
#map-selection-panel:not([style*="display: none"]),
#game-ui:not([style*="display: none"]) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Thiết lập layout riêng cho từng panel */
#login-panel {
  max-width: 500px;
  margin: 50px auto;
  text-align: center;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
  border-radius: 20px;
  border: 2px solid;
  border-image: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff) 1;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  padding: 40px;
}

#character-selection-panel {
  max-width: 900px;
  margin: 20px auto;
  text-align: center;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
  border-radius: 20px;
  border: 2px solid;
  border-image: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff) 1;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

/* Hiển thị đúng phần login */
#login-panel input {
  width: 80%;
  max-width: 320px;
  margin: 0 auto 25px auto;
  padding: 15px;
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 16px;
  text-align: center;
}

#login-panel button {
  width: 80%;
  max-width: 280px;
  margin: 10px auto;
  padding: 12px 0;
  display: block;
}

#login-panel h2 {
  color: #00ffff;
  margin-bottom: 30px;
  font-size: 2.5em;
}

/* Sửa lại cách hiển thị của phần chọn nhân vật */
.character-grid, .weapon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.character-option, .weapon-option {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.character-option.selected, .weapon-option.selected {
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.3) 0%, rgba(255, 0, 255, 0.2) 100%);
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

/* Chỉnh lại hiển thị cho các h3 */
.character-select h3, .weapon-select h3 {
  color: #00ffff;
  font-size: 1.5em;
  margin: 5px 0 15px 0;
  text-align: center;
}

/* Thiết lập các nút xác nhận/hủy */
.selection-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

/* Auth toggle link styling */
.auth-toggle {
  margin: 15px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.auth-toggle a {
  color: #00ffff;
  text-decoration: none;
  margin-left: 5px;
  transition: all 0.3s;
  position: relative;
}

.auth-toggle a:hover {
  color: #fff;
  text-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff;
}

.auth-toggle a:after {
  content: "";
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(90deg, #00ffff, transparent);
  transition: width 0.3s;
}

.auth-toggle a:hover:after {
  width: 100%;
}

/* Password input styling */
#email-input, #password-input {
  width: 80%;
  max-width: 320px;
  margin: 0 auto 25px auto;
  padding: 15px;
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

#email-input:focus, #password-input:focus, #login-panel input:focus {
  border-color: rgba(0, 255, 255, 0.8);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

/* Auth button animations */
#auth-btn {
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: all 0.5s;
}

#auth-btn: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.7s;
  z-index: -1;
}

#auth-btn:hover:before {
  left: 100%;
}
