* {
  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;
  width: 100vw;
}

/* Animated Background */
#bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 217, 61, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%);
}

.dust-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 217, 61, 0.3);
  border-radius: 50%;
  animation: float-dust 8s infinite ease-in-out;
}

.dust-particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; width: 3px; height: 3px; }
.dust-particle:nth-child(2) { left: 30%; top: 60%; animation-delay: 1.5s; width: 5px; height: 5px; }
.dust-particle:nth-child(3) { left: 50%; top: 30%; animation-delay: 3s; width: 4px; height: 4px; }
.dust-particle:nth-child(4) { left: 70%; top: 70%; animation-delay: 4.5s; width: 6px; height: 6px; }
.dust-particle:nth-child(5) { left: 90%; top: 40%; animation-delay: 6s; width: 3px; height: 3px; }
.dust-particle:nth-child(6) { left: 15%; top: 80%; animation-delay: 2s; width: 4px; height: 4px; background: rgba(255, 107, 107, 0.4); }
.dust-particle:nth-child(7) { left: 85%; top: 15%; animation-delay: 4s; width: 3px; height: 3px; background: rgba(107, 255, 184, 0.4); }
.dust-particle:nth-child(8) { left: 60%; top: 85%; animation-delay: 5s; width: 5px; height: 5px; }

@keyframes float-dust {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  25% { transform: translateY(-20px) translateX(10px); opacity: 0.6; }
  50% { transform: translateY(-10px) translateX(-10px); opacity: 0.4; }
  75% { transform: translateY(-30px) translateX(5px); opacity: 0.5; }
}

/* Shooting stars */
.shooting-star {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 217, 61, 0.8), rgba(255, 255, 255, 0));
  border-radius: 50%;
  animation: shoot 4s ease-in-out infinite;
  opacity: 0;
}

.shooting-star:nth-child(9) {
  top: 10%;
  left: -100px;
  animation-delay: 0s;
}

.shooting-star:nth-child(10) {
  top: 30%;
  left: -100px;
  animation-delay: 2.5s;
}

@keyframes shoot {
  0% { transform: translateX(0) translateY(0) rotate(-30deg); opacity: 0; }
  5% { opacity: 1; }
  20% { transform: translateX(calc(100vw + 200px)) translateY(100px) rotate(-30deg); opacity: 0; }
  100% { transform: translateX(calc(100vw + 200px)) translateY(100px) rotate(-30deg); opacity: 0; }
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
}

/* Lobby Styles */
#lobby {
  justify-content: center;
  align-items: center;
}

.lobby-container {
  text-align: center;
  padding: 40px;
  max-width: 420px;
  width: 90%;
  animation: fadeInUp 0.6s ease-out;
  background: linear-gradient(145deg, rgba(30, 30, 60, 0.9), rgba(20, 20, 40, 0.95));
  border-radius: 30px;
  border: 4px solid rgba(255, 217, 61, 0.3);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(255, 107, 107, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.lobby-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 217, 61, 0.05) 0%, transparent 50%);
  animation: rotateBg 20s linear infinite;
  pointer-events: none;
}

@keyframes rotateBg {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

.title-container {
  position: relative;
  margin-bottom: 10px;
}

.title {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #ff6b6b, #ffd93d, #ff6b6b);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite, titleBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.3)) drop-shadow(0 8px 15px rgba(255, 107, 107, 0.4));
  position: relative;
}

@keyframes titleBounce {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}

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

.title-guns {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.gun {
  display: inline-block;
  width: 40px;
  height: 20px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.gun-left {
  left: -20px;
  background: linear-gradient(90deg, #444, #666);
  clip-path: polygon(0 30%, 70% 30%, 70% 0, 100% 50%, 70% 100%, 70% 70%, 0 70%);
  animation: gunBob 2s ease-in-out infinite;
}

.gun-right {
  right: -20px;
  background: linear-gradient(270deg, #444, #666);
  clip-path: polygon(100% 30%, 30% 30%, 30% 0, 0 50%, 30% 100%, 30% 70%, 100% 70%);
  animation: gunBob 2s ease-in-out infinite reverse;
}

@keyframes gunBob {
  0%, 100% { transform: translateY(-50%) rotate(-5deg); }
  50% { transform: translateY(-50%) rotate(5deg); }
}

.subtitle {
  color: #888;
  margin-bottom: 40px;
  font-size: 1rem;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

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

.lobby-section {
  margin-top: 20px;
  animation: fadeInUp 0.5s ease-out;
}

.lobby-section.hidden {
  display: none;
}

/* Invite Card */
.invite-card {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 217, 61, 0.1));
  border: 2px solid rgba(255, 107, 107, 0.3);
  border-radius: 16px;
  padding: 30px;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.2); }
  50% { box-shadow: 0 0 40px rgba(255, 107, 107, 0.4); }
}

.invite-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #ff6b6b, #ffd93d);
  border-radius: 50%;
  position: relative;
  animation: bounce 1s ease-in-out infinite;
}

.invite-icon::before {
  content: '⚔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 30px;
}

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

.invite-text {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #fff;
}

.invite-text span {
  color: #ffd93d;
}

.invite-subtext {
  color: #888;
  margin-bottom: 25px;
  font-size: 1rem;
}

input[type="text"] {
  width: 100%;
  padding: 16px 22px;
  border: 3px solid #444;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.95));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.3),
    0 2px 0 rgba(255, 255, 255, 0.05);
}

input[type="text"]:focus {
  outline: none;
  border-color: #ffd93d;
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(255, 217, 61, 0.3),
    0 2px 0 rgba(255, 255, 255, 0.05);
}

input[type="text"]::placeholder {
  color: #666;
  font-weight: 500;
}

.btn {
  padding: 16px 32px;
  border: none;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(180deg, #ff8585 0%, #ff6b6b 50%, #e55555 100%);
  color: #fff;
  border: 3px solid #ff4444;
  box-shadow:
    0 6px 0 #cc3333,
    0 8px 15px rgba(255, 107, 107, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow:
    0 9px 0 #cc3333,
    0 12px 25px rgba(255, 107, 107, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 #cc3333,
    0 4px 10px rgba(255, 107, 107, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.btn-glow {
  animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 107, 107, 0.3); }
  50% { box-shadow: 0 0 25px rgba(255, 107, 107, 0.6); }
}

.btn-secondary {
  background: linear-gradient(180deg, #4a4a6a 0%, #3a3a5a 50%, #2a2a4a 100%);
  color: #fff;
  border: 3px solid #555;
  margin-top: 10px;
  box-shadow:
    0 5px 0 #222,
    0 6px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 7px 0 #222,
    0 10px 20px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.15);
}

.btn-secondary:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #222,
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.15);
}

.btn-icon {
  margin-right: 8px;
  font-size: 1.1em;
}

.btn-small {
  padding: 10px 20px;
  width: auto;
}

.divider {
  display: flex;
  align-items: center;
  margin: 25px 0;
  color: #888;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 217, 61, 0.3), transparent);
  border-radius: 2px;
}

.divider span {
  padding: 0 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.share-link {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.share-link input {
  flex: 1;
  margin-bottom: 0;
}

.room-code {
  color: #888;
  font-size: 0.9rem;
}

.room-code span {
  color: #ffd93d;
  font-weight: bold;
  letter-spacing: 0.2em;
}

/* Loading Spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  border: 3px solid #333;
  border-top-color: #ff6b6b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.waiting-text,
.joined-text {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.players-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.player-slot {
  text-align: center;
  animation: slideIn 0.5s ease-out;
}

.player-slot-1 { animation-delay: 0.1s; }
.player-slot-2 { animation-delay: 0.3s; }

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.player-slot-2 {
  animation-name: slideInRight;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.player-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin: 0 auto 10px;
  position: relative;
}

.avatar-1 {
  background: linear-gradient(135deg, #6bffb8, #2d8f5f);
  box-shadow: 0 0 20px rgba(107, 255, 184, 0.3);
}

.avatar-2 {
  background: linear-gradient(135deg, #ff6b6b, #8f2d2d);
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.player-avatar::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 30px;
  background: #fff;
  border-radius: 10px 10px 5px 5px;
  opacity: 0.8;
}

.player-name {
  font-size: 1.2rem;
  font-weight: bold;
}

.vs-container {
  animation: vsAppear 0.5s ease-out 0.2s both;
}

@keyframes vsAppear {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.vs {
  color: #ff6b6b;
  font-weight: 900;
  font-size: 1.8rem;
  text-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
  animation: vsPulse 1s ease-in-out infinite;
}

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

.get-ready {
  margin-top: 20px;
  color: #ffd93d;
  font-weight: bold;
  animation: blink 0.8s ease-in-out infinite;
}

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

.error {
  color: #ff6b6b;
  margin-top: 20px;
  padding: 10px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 8px;
  animation: shake 0.5s ease-in-out;
}

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

.error.hidden {
  display: none;
}

/* Game Screen */
#game-screen {
  position: relative;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0a0a1a;
}

#game-canvas {
  background: #111;
  border: 2px solid #222;
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 15px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
  pointer-events: none;
}

.hud-player {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#hud-right {
  align-items: flex-end;
}

.hud-name {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 5px;
}

#hud-left .hud-name {
  color: #6bffb8;
}

#hud-right .hud-name {
  color: #ff6b6b;
}

.health-bar {
  width: 150px;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff6b6b, #ffd93d);
  transition: width 0.3s ease;
}

#hud-center {
  color: #666;
  font-size: 0.8rem;
}

/* Overlays */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

#countdown-number {
  font-size: 8rem;
  font-weight: 900;
  color: #ffd93d;
  animation: countdownPulse 1s ease-in-out infinite;
  text-shadow: 0 0 50px rgba(255, 217, 61, 0.5);
}

@keyframes countdownPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

#winner-text {
  font-size: 2.5rem;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #ffd93d, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: winnerAppear 0.5s ease-out;
}

@keyframes winnerAppear {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#game-over .btn {
  width: 200px;
  margin: 10px;
}

#rematch-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#rematch-buttons.hidden {
  display: none;
}

#rematch-request {
  text-align: center;
  animation: fadeInUp 0.3s ease-out;
}

#rematch-request.hidden {
  display: none;
}

#rematch-request-text {
  font-size: 1.3rem;
  color: #ffd93d;
  margin-bottom: 20px;
  font-weight: bold;
  text-shadow: 0 2px 10px rgba(255, 217, 61, 0.5);
}

.rematch-response-btns {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.rematch-response-btns .btn {
  width: 150px;
}

.btn-accept {
  background: linear-gradient(180deg, #6bffb8 0%, #4ade80 50%, #22c55e 100%) !important;
  border-color: #22c55e !important;
  box-shadow:
    0 6px 0 #16a34a,
    0 8px 15px rgba(34, 197, 94, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}

.btn-accept:hover {
  box-shadow:
    0 9px 0 #16a34a,
    0 12px 25px rgba(34, 197, 94, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}

.btn-decline {
  background: linear-gradient(180deg, #666 0%, #555 50%, #444 100%) !important;
}

#rematch-status {
  color: #888;
  margin-top: 20px;
}

/* Mobile Controls - positioned below game canvas via JS */
#mobile-controls {
  position: absolute;
  left: 0;
  right: 0;
  top: 0; /* Will be set by JS based on canvas position */
  height: 200px;
  pointer-events: none;
}

#mobile-controls.hidden {
  display: none;
}

.joystick {
  position: absolute;
  top: 0;
  width: 156px;
  height: 156px;
  pointer-events: auto;
}

#joystick-left {
  left: 15px;
}

.joystick-base {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Inner circle showing rotation-only zone */
.joystick-base::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 50%;
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 217, 61, 0.4);
  border-radius: 50%;
  pointer-events: none;
}

.joystick-knob {
  position: absolute;
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2));
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: background 0.2s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Mobile Button Grid - 2x2 Layout */
#mobile-btn-grid {
  position: absolute;
  right: 15px;
  top: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
  pointer-events: auto;
}

.mobile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border: none;
  border-radius: 16px;
  color: #fff;
  font-weight: bold;
  font-size: 0.75rem;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mobile-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), transparent);
  border-radius: 16px 16px 0 0;
  pointer-events: none;
}

.mobile-btn-icon {
  font-size: 1.6rem;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.mobile-btn-text {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Jump Button - Green */
#btn-jump {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border: 2px solid rgba(74, 222, 128, 0.6);
  box-shadow:
    0 4px 15px rgba(34, 197, 94, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#btn-jump:active, #btn-jump.active {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}

/* Shield Button - Blue */
#btn-shield {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  border: 2px solid rgba(96, 165, 250, 0.6);
  box-shadow:
    0 4px 15px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#btn-shield:active, #btn-shield.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
}

/* Dash Button - Yellow/Orange */
#btn-dash {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: 2px solid rgba(251, 191, 36, 0.6);
  box-shadow:
    0 4px 15px rgba(245, 158, 11, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#btn-dash:active, #btn-dash.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

/* Shoot Button - Red, same size as others */
#btn-shoot {
  background: linear-gradient(135deg, #f87171, #ef4444);
  border: 2px solid rgba(248, 113, 113, 0.7);
  box-shadow:
    0 4px 15px rgba(239, 68, 68, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 20px rgba(239, 68, 68, 0.3);
  animation: shootPulse 2s ease-in-out infinite;
}

@keyframes shootPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 30px rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 6px 25px rgba(239, 68, 68, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 40px rgba(239, 68, 68, 0.5); }
}

#btn-shoot:active, #btn-shoot.active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.6);
  animation: none;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  #chat-panel {
    display: none; /* Hide chat on mobile by default */
  }

  #mobile-controls {
    pointer-events: none;
  }

  #mobile-controls > * {
    pointer-events: auto;
  }

  .joystick {
    top: 0;
    width: 130px;
    height: 130px;
  }

  .joystick-knob {
    width: 52px;
    height: 52px;
  }

  #mobile-btn-grid {
    right: 10px;
    top: 0;
    gap: 6px;
  }

  .mobile-btn {
    width: 72px;
    height: 72px;
    border-radius: 14px;
  }

  .mobile-btn-icon {
    font-size: 1.4rem;
  }

  .mobile-btn-text {
    font-size: 0.55rem;
  }
}

/* Chat Panel */
#chat-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 280px;
  z-index: 50;
}

#chat-toggle {
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s;
}

#chat-toggle:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: #555;
}

#chat-content {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
}

#chat-content.hidden {
  display: none;
}

#chat-messages {
  height: 200px;
  overflow-y: auto;
  padding: 10px;
}

.chat-message {
  margin-bottom: 8px;
  font-size: 0.85rem;
  word-wrap: break-word;
}

.chat-message .sender {
  font-weight: bold;
  color: #ffd93d;
}

.chat-message.spectator .sender {
  color: #888;
}

#chat-input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid #333;
}

#chat-input {
  flex: 1;
  margin-bottom: 0;
  padding: 8px 12px;
  font-size: 0.85rem;
}

#chat-input-container .btn {
  margin-left: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .title {
    font-size: 2.5rem;
  }

  .lobby-container {
    padding: 20px;
  }

  .health-bar {
    width: 100px;
  }

  #chat-panel {
    width: 220px;
    left: 10px;
    bottom: 220px;
  }

  .gun {
    display: none;
  }
}
