@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&display=swap');

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

body {
  font-family: 'Rajdhani', 'Segoe UI', Tahoma, sans-serif;
  text-align: center;
  background: #141820;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(30, 55, 35, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(50, 30, 15, 0.3) 0%, transparent 60%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #dde6f0;
  overflow: hidden;
}

/* Screen entrance animations */
@keyframes screenSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
  50% { box-shadow: 0 0 40px rgba(255, 107, 53, 0.12), 0 0 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 10px rgba(255, 107, 53, 0.2); }
  50% { text-shadow: 0 0 25px rgba(255, 107, 53, 0.5), 0 0 50px rgba(255, 107, 53, 0.15); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

canvas {
  border: 2px solid #4a6a4a;
  border-radius: 2px;
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.12), 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #2a3020;
}

#menu {
  background: rgba(22, 30, 22, 0.95);
  padding: 44px;
  border-radius: 4px;
  border: 1px solid #3a5a3a;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-width: 440px;
  width: 100%;
  animation: screenSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards, pulseGlow 4s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

/* ---- Lobby Layout: 3-column centered ---- */
#lobbyLayout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  min-height: 0;
}

#lobbyCenter {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.menu-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 107, 53, 0.04) 0%, transparent 50%);
  pointer-events: none;
  animation: menuGlowRotate 8s linear infinite;
}

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

.menu-subtitle {
  color: #ff6b35;
  font-size: 16px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 4px;
  margin-bottom: 18px;
  opacity: 0.8;
}

.github-link {
  display: block;
  color: #8aaa8a;
  font-size: 14px;
  font-family: 'Share Tech Mono', monospace;
  text-decoration: none;
  margin-bottom: 18px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  transition: all 0.3s;
  letter-spacing: 0.5px;
}

.github-link:hover {
  color: #f0f0f0;
  border-color: #4a6a4a;
  background: rgba(255,255,255,0.05);
}

.github-footer-link {
  position: fixed;
  bottom: 10px;
  right: 16px;
  color: #5a7a5a;
  font-size: 13px;
  font-family: 'Share Tech Mono', monospace;
  text-decoration: none;
  z-index: 50;
  transition: color 0.3s;
  letter-spacing: 0.5px;
}

.github-footer-link:hover {
  color: #8aaa8a;
}

#menu h2 {
  color: #f0f0f0;
  margin-bottom: 6px;
  font-size: 40px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: titlePulse 3s ease-in-out infinite;
}

#menu input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #4a6a4a;
  border-radius: 2px;
  font-size: 20px;
  font-family: 'Share Tech Mono', monospace;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.35);
  color: #f0f0f0;
  transition: border-color 0.3s;
}

#menu input:focus {
  outline: none;
  border-color: #4a8a4a;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}

#menu input::placeholder {
  color: #555;
}

#menu button {
  width: 100%;
  padding: 16px 28px;
  background: linear-gradient(180deg, #3a5a3a 0%, #2a4a2a 100%);
  color: #f0f0f0;
  border: 1px solid #4a6a4a;
  border-radius: 2px;
  font-size: 22px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

#menu button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.5s;
}

#menu button:hover::after {
  left: 100%;
}

#menu button:hover {
  background: linear-gradient(180deg, #4a7a4a 0%, #3a5a3a 100%);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.2);
  border-color: #5a8a5a;
  transform: translateY(-1px);
}

#menu button:active {
  transform: scale(0.98);
}

/* Room List Screen */
#roomListScreen {
  background: rgba(22, 30, 22, 0.95);
  padding: 44px;
  border-radius: 4px;
  border: 1px solid #3a5a3a;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-width: 500px;
  width: 100%;
  animation: screenSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#roomListScreen button {
  width: 100%;
  padding: 14px 28px;
  background: linear-gradient(180deg, #3a5a3a 0%, #2a4a2a 100%);
  color: #f0f0f0;
  border: 1px solid #4a6a4a;
  border-radius: 2px;
  font-size: 20px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#roomListScreen button:hover {
  background: linear-gradient(180deg, #4a7a4a 0%, #3a5a3a 100%);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.2);
  border-color: #5a8a5a;
  transform: translateY(-1px);
}

#roomListContent {
  max-height: 340px;
  overflow-y: auto;
}

.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #2a3a2a;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: screenFadeIn 0.3s ease-out;
}

.room-item:hover {
  border-color: #4a6a4a;
  background: rgba(0, 0, 0, 0.35);
  transform: translateX(3px);
}

.room-item .room-info {
  text-align: left;
}

.room-item .room-name {
  color: #f0f0f0;
  font-size: 19px;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
}

.room-item .room-count {
  color: #8aaa8a;
  font-size: 15px;
  font-family: 'Share Tech Mono', monospace;
}

.room-item button {
  width: auto;
  padding: 8px 20px;
  font-size: 16px;
  margin: 0;
}

/* Room Screen */
#roomScreen {
  background: rgba(22, 30, 22, 0.95);
  padding: 44px;
  border-radius: 4px;
  border: 1px solid #3a5a3a;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-width: 460px;
  width: 100%;
  animation: screenSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#roomScreen button {
  padding: 14px 32px;
  background: linear-gradient(180deg, #3a5a3a 0%, #2a4a2a 100%);
  color: #f0f0f0;
  border: 1px solid #4a6a4a;
  border-radius: 2px;
  font-size: 20px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#roomScreen button:hover {
  background: linear-gradient(180deg, #4a7a4a 0%, #3a5a3a 100%);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.2);
  border-color: #5a8a5a;
  transform: translateY(-1px);
}

/* Ready button - prominent blinking CTA */
#roomReadyBtn {
  padding: 18px 48px !important;
  font-size: 24px !important;
  background: linear-gradient(180deg, #ff6b35 0%, #cc4422 100%) !important;
  border: 2px solid #ff8855 !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  animation: readyButtonPulse 1.5s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

#roomReadyBtn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  animation: readyButtonShine 2.5s ease-in-out infinite;
}

#roomReadyBtn:hover {
  background: linear-gradient(180deg, #ff8855 0%, #dd5533 100%) !important;
  border-color: #ffaa77 !important;
  box-shadow: 0 0 35px rgba(255, 107, 53, 0.5) !important;
  transform: translateY(-2px) scale(1.03);
}

#roomReadyBtn:disabled {
  animation: none !important;
  background: linear-gradient(180deg, #3a5a3a 0%, #2a4a2a 100%) !important;
  border-color: #4a6a4a !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 0.6 !important;
  cursor: default !important;
}

#roomReadyBtn:disabled::before {
  display: none;
}

@keyframes readyButtonPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 107, 53, 0.3); }
  50% { box-shadow: 0 0 30px rgba(255, 107, 53, 0.6), 0 0 60px rgba(255, 107, 53, 0.2); }
}

@keyframes readyButtonShine {
  0% { transform: translateX(-100%) rotate(0deg); }
  100% { transform: translateX(100%) rotate(0deg); }
}

.room-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid #2a3a2a;
  border-radius: 2px;
  animation: screenFadeIn 0.3s ease-out;
  transition: all 0.2s;
}

.room-player:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: #3a4a3a;
}

.room-player .player-name {
  color: #f0f0f0;
  font-size: 18px;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
}

.room-player .player-status {
  font-size: 15px;
  font-family: 'Share Tech Mono', monospace;
  padding: 2px 8px;
  border-radius: 2px;
}

.room-player .player-status.ready {
  color: #4ad94a;
  background: rgba(74, 217, 74, 0.1);
  border: 1px solid rgba(74, 217, 74, 0.3);
  animation: readyPulse 1.5s ease-in-out infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(74, 217, 74, 0.3); }
}

.room-player .player-status.waiting {
  color: #d9a04a;
  background: rgba(217, 160, 74, 0.1);
  border: 1px solid rgba(217, 160, 74, 0.3);
  animation: waitingBlink 1.2s ease-in-out infinite;
}

@keyframes waitingBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

#queueStatus {
  margin-top: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  border: 1px solid #2a3a2a;
}

#queueStatus p {
  color: #a0b8a0;
  margin: 6px 0;
  font-size: 18px;
  font-family: 'Share Tech Mono', monospace;
}

#gameUI {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 18, 12, 0.88);
  padding: 0;
  border-radius: 8px 8px 0 0;
  border: 1px solid #3a5a3a;
  border-bottom: none;
  z-index: 800;
  backdrop-filter: blur(10px);
  animation: slideUpIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0.92;
  transition: opacity 0.3s;
}

#gameUI:hover {
  opacity: 1;
}

#inGameControls {
  position: fixed;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 16px;
  font-family: 'Share Tech Mono', monospace;
  z-index: 790;
  pointer-events: none;
  text-align: center;
  line-height: 1.8;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hud-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  font-family: 'Share Tech Mono', monospace;
}

.hud-section {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}

.hud-section:last-child {
  border-right: none;
}

/* Kills section */
.hud-kills #killsDisplay {
  color: #ffaa44;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255, 170, 68, 0.3);
}

/* HP section — prominent bar */
.hud-health {
  min-width: 200px;
  padding: 8px 16px;
}

.hud-hp-bar-container {
  position: relative;
  width: 100%;
  height: 32px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  border: 1px solid #3a5a3a;
  overflow: hidden;
}

.hud-hp-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #5adf5a 0%, #3ab83a 50%, #2a982a 100%);
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 0 10px rgba(74, 217, 74, 0.2);
}

.hud-hp-bar-fill.hp-danger {
  background: linear-gradient(180deg, #ff5555 0%, #cc2222 50%, #aa1111 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 0 14px rgba(255, 50, 50, 0.4);
  animation: hpDangerPulse 0.8s ease-in-out infinite;
}

.hud-hp-bar-fill.hp-mid {
  background: linear-gradient(180deg, #ffcc44 0%, #dd9922 50%, #bb7711 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 0 10px rgba(255, 180, 44, 0.3);
}

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

.hud-hp-bar-container #healthDisplay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 6px rgba(0,0,0,0.5);
  z-index: 1;
  letter-spacing: 1px;
}

/* Weapon section — big and clear */
.hud-weapon {
  min-width: 180px;
}

.hud-weapon #shotsDisplay {
  color: #eef0ee;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(238, 240, 238, 0.15);
}

/* Status section (cooldown, reload, speed) */
.hud-status {
  min-width: 0;
}

.hud-status #cooldownDisplay {
  color: #ffbb55;
  font-size: 17px;
  font-weight: 600;
}

.hud-status #reloadDisplay {
  color: #ff6b35;
  font-size: 17px;
  font-weight: 700;
  animation: reloadBlink 0.6s ease-in-out infinite;
}

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

.hud-status #speedBoostDisplay {
  color: #44bbff;
  font-size: 17px;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(68, 187, 255, 0.4);
  animation: speedGlow 0.5s ease-in-out infinite;
}

@keyframes speedGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(68, 187, 255, 0.4); }
  50% { text-shadow: 0 0 16px rgba(68, 187, 255, 0.7), 0 0 30px rgba(68, 187, 255, 0.2); }
}

@keyframes slideUpIn {
  from { opacity: 0; transform: translateX(-50%) translateY(100%); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Ready Screen */
#readyScreen {
  animation: victorySlam 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#readyScreen button {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#readyScreen button:hover:not(:disabled) {
  background: linear-gradient(180deg, #4a7a4a 0%, #3a5a3a 100%) !important;
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.3);
  transform: scale(1.05);
}

#victoryScreen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(12, 18, 12, 0.97);
  color: #f0f0f0;
  padding: 50px 70px;
  border-radius: 4px;
  text-align: center;
  z-index: 1000;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.7), 0 0 120px rgba(255, 107, 53, 0.15);
  border: 1px solid #4a7a4a;
  backdrop-filter: blur(10px);
  animation: victorySlam 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes victorySlam {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(0.95); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#victoryMessage {
  font-size: 52px;
  margin: 0 0 8px 0;
  color: #ff6b35;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 30px rgba(255, 107, 53, 0.4);
  animation: titlePulse 2s ease-in-out infinite;
}

#countdownMessage {
  font-size: 24px;
  margin: 0;
  color: #a0b0a0;
}

/* ---- Global Panels ---- */
#globalOnlinePanel {
  flex: 0 0 200px;
  background: rgba(12, 18, 12, 0.88);
  color: #d0e0d0;
  padding: 14px;
  border-radius: 2px;
  min-width: 180px;
  max-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid #3a5a3a;
  font-size: 16px;
  backdrop-filter: blur(10px);
  align-self: flex-start;
}

#globalOnlinePanel h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #66cc66;
  border-bottom: 1px solid #2a4a2a;
  padding-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: 'Share Tech Mono', monospace;
}

#globalControlsPanel {
  flex: 0 0 220px;
  background: rgba(12, 18, 12, 0.88);
  color: #8aaa8a;
  padding: 14px 16px;
  border-radius: 2px;
  border: 1px solid #3a5a3a;
  font-size: 15px;
  line-height: 1.8;
  backdrop-filter: blur(10px);
  align-self: flex-start;
  min-width: 200px;
  max-width: 240px;
}

#globalControlsPanel h4 {
  margin: 0 0 5px 0;
  color: #88ccff;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid #2a3a4a;
  padding-bottom: 5px;
  font-family: 'Share Tech Mono', monospace;
}

#globalControlsPanel kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 2px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  color: #bbddbb;
  border: 1px solid #3a5a3a;
  transition: all 0.2s;
}

#globalControlsPanel kbd:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #4a6a4a;
}

#globalOnlinePanel::-webkit-scrollbar {
  width: 3px;
}

#globalOnlinePanel::-webkit-scrollbar-track {
  background: transparent;
}

#globalOnlinePanel::-webkit-scrollbar-thumb {
  background: #2a3a2a;
  border-radius: 1px;
}

/* ---- Scoreboard in-game (Tab overlay) ---- */
#playerList {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(12, 18, 12, 0.92);
  padding: 20px 28px;
  border-radius: 6px;
  border: 1px solid #4a6a4a;
  min-width: 320px;
  max-width: 440px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 900;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

#playerList h3 {
  margin: 0 0 12px 0;
  color: #d0b870;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 3px;
  border-bottom: 1px solid #3a4a2a;
  padding-bottom: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  text-align: center;
}

#playerList .tab-hint {
  text-align: center;
  color: #5a7a5a;
  font-size: 13px;
  font-family: 'Share Tech Mono', monospace;
  margin-top: 10px;
  letter-spacing: 1px;
}

/* Kill Feed */
#killFeed {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 850;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.kill-entry {
  background: rgba(12, 18, 12, 0.92);
  padding: 6px 16px;
  border-radius: 3px;
  border: 1px solid rgba(58, 90, 58, 0.6);
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  color: #c0d0c0;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  transition: opacity 0.5s ease-out;
}

.kill-entry .killer {
  color: #ff8c55;
  font-weight: 700;
}

.kill-entry .victim {
  color: #ee5555;
  font-weight: 600;
}

.kill-entry .weapon-icon {
  margin: 0 6px;
}

/* Kill streak entries */
.kill-entry.streak-entry {
  background: rgba(40, 20, 5, 0.92);
  border-color: rgba(255, 140, 0, 0.5);
}

.kill-entry.streak-entry .streak-text {
  color: #ffaa44;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Skin option taken state */
.skin-option.taken {
  position: relative;
}

.skin-option.taken::after {
  content: '✗';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: bold;
}

/* Toast notification animations */
@keyframes toastSlideUp {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.8); }
  60% { opacity: 0.65; transform: translate(-50%, -8px) scale(1.05); }
  100% { opacity: 0.6; transform: translate(-50%, 0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 0.6; transform: translate(-50%, 0) scale(1); }
  to { opacity: 0; transform: translate(-50%, -30px) scale(0.85); }
}

@keyframes toastBounce {
  0% { opacity: 0; transform: translate(-50%, 40px) scale(0.6) rotate(-2deg); }
  50% { opacity: 0.65; transform: translate(-50%, -6px) scale(1.08) rotate(1deg); }
  70% { opacity: 0.6; transform: translate(-50%, 3px) scale(0.98) rotate(0deg); }
  100% { opacity: 0.6; transform: translate(-50%, 0) scale(1) rotate(0deg); }
}

@keyframes toastShake {
  0%, 100% { transform: translate(-50%, 0) rotate(0deg); }
  15% { transform: translate(-50%, 0) rotate(-3deg); }
  30% { transform: translate(-50%, 0) rotate(3deg); }
  45% { transform: translate(-50%, 0) rotate(-2deg); }
  60% { transform: translate(-50%, 0) rotate(1deg); }
  75% { transform: translate(-50%, 0) rotate(0deg); }
}

/* Skin Selector */
.skin-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #2a3a2a;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.skin-option:hover {
  transform: scale(1.25);
  border-color: #6a9a6a;
  box-shadow: 0 0 12px rgba(106, 154, 106, 0.3);
}

.skin-option.selected {
  border-color: #ff6b35;
  box-shadow: 0 0 14px rgba(255, 107, 53, 0.6);
  transform: scale(1.2);
}

/* Leaderboard Modal */
#leaderboardModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(12, 18, 12, 0.97);
  color: #f0f0f0;
  padding: 40px;
  border-radius: 4px;
  text-align: center;
  z-index: 1100;
  box-shadow: 0 0 60px rgba(0,0,0,0.7), 0 0 100px rgba(255, 107, 53, 0.1);
  border: 1px solid #4a7a4a;
  min-width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  animation: victorySlam 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Leaderboard */
.lb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2a3a2a;
  border-radius: 2px;
  transition: all 0.2s;
  animation: screenFadeIn 0.3s ease-out;
}

.lb-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #3a4a3a;
}

.lb-row.top {
  background: rgba(255, 107, 53, 0.1);
  border-color: #ff6b35;
}

.lb-rank {
  font-size: 20px;
  font-weight: 700;
  color: #ff6b35;
  min-width: 30px;
  font-family: 'Rajdhani', sans-serif;
}

.lb-name {
  flex: 1;
  text-align: left;
  padding: 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: #f0f0f0;
  font-family: 'Rajdhani', sans-serif;
}

.lb-stats {
  font-size: 15px;
  color: #8aaa8a;
  font-family: 'Share Tech Mono', monospace;
  white-space: nowrap;
}

/* ===== Match History ===== */
.match-entry {
  background: rgba(20, 30, 20, 0.85);
  border: 1px solid #2a3a2a;
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.match-entry:hover {
  border-color: #4a6a4a;
}

.match-entry.match-win {
  border-left: 3px solid #4aff4a;
}

.match-entry.match-loss {
  border-left: 3px solid #ff4444;
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.match-result {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Rajdhani', sans-serif;
}

.match-win .match-result {
  color: #4aff4a;
}

.match-loss .match-result {
  color: #ff4444;
}

.match-time {
  font-size: 14px;
  color: #6a8a6a;
  font-family: 'Share Tech Mono', monospace;
}

.match-stats {
  display: flex;
  gap: 16px;
  font-size: 15px;
  font-family: 'Share Tech Mono', monospace;
  color: #aaccaa;
}

.match-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.match-players {
  font-size: 14px;
  color: #6a8a6a;
  margin-top: 4px;
  font-family: 'Share Tech Mono', monospace;
}

/* ===== MOBILE TOUCH CONTROLS ===== */
#mobileControls {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  pointer-events: none;
}

#mobileControls.active {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 10px 10px;
}

.touch-joystick-area {
  width: 150px;
  height: 150px;
  position: relative;
  pointer-events: auto;
  touch-action: none;
}

.touch-joystick-base {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.touch-joystick-thumb {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 170, 68, 0.35);
  border: 2px solid rgba(255, 170, 68, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: background 0.1s;
}

.touch-joystick-thumb.active {
  background: rgba(255, 170, 68, 0.55);
}

.touch-right-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.touch-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #f0f0f0;
  font-size: 20px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.1s, transform 0.1s;
  pointer-events: auto;
}

.touch-btn:active, .touch-btn.pressed {
  background: rgba(255, 170, 68, 0.35);
  border-color: rgba(255, 170, 68, 0.6);
  transform: scale(0.92);
}

.touch-btn-weapon {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.touch-aim-area {
  width: 150px;
  height: 150px;
}

.touch-aim-base {
  background: rgba(255, 60, 60, 0.08);
  border-color: rgba(255, 60, 60, 0.2);
  bottom: 10px;
  right: 10px;
  left: auto;
}

.touch-aim-thumb {
  background: rgba(255, 60, 60, 0.3);
  border-color: rgba(255, 60, 60, 0.55);
}

.touch-aim-thumb.active {
  background: rgba(255, 60, 60, 0.55);
  border-color: rgba(255, 60, 60, 0.8);
  box-shadow: 0 0 12px rgba(255, 60, 60, 0.4);
}

.touch-aim-label {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  opacity: 0.3;
  pointer-events: none;
}

/* ===== RESPONSIVE / MOBILE ===== */
@media (max-width: 900px) {
  body {
    padding: 10px;
    overflow-y: auto;
  }

  #lobbyLayout {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  #globalOnlinePanel,
  #globalControlsPanel {
    flex: none;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  #globalControlsPanel {
    display: none; /* Hide on mobile — players use touch controls */
  }

  #menu {
    padding: 24px;
    max-width: 100%;
  }

  #menu h2 {
    font-size: 28px;
  }

  #menu input {
    font-size: 18px;
    padding: 12px 14px;
  }

  #menu button {
    font-size: 18px;
    padding: 14px 22px;
  }

  #roomListScreen {
    padding: 24px;
    max-width: 100%;
  }

  #roomScreen {
    padding: 24px;
    max-width: 100%;
  }

  #readyScreen {
    padding: 24px 32px !important;
    width: 90vw !important;
    max-width: 400px !important;
  }

  #readyScreen h2 {
    font-size: 28px !important;
  }

  #victoryScreen {
    padding: 30px 24px;
    width: 92vw;
    max-width: 420px;
  }

  #victoryMessage {
    font-size: 32px;
  }

  /* HUD adjustments */
  #gameUI {
    width: 100%;
    border-radius: 0;
  }

  .hud-bar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hud-section {
    padding: 6px 12px;
    font-size: 14px;
  }

  .hud-health {
    min-width: 150px;
  }

  .hud-kills #killsDisplay {
    font-size: 18px;
  }

  .hud-weapon #shotsDisplay {
    font-size: 16px;
  }

  .hud-hp-bar-container {
    height: 26px;
  }

  .hud-hp-bar-container #healthDisplay {
    font-size: 15px;
  }

  /* Hide keyboard-only controls hint */
  #inGameControls {
    display: none !important;
  }

  /* Kill feed */
  #killFeed {
    top: 6px;
  }

  .kill-entry {
    font-size: 13px;
    padding: 4px 10px;
  }

  /* Scoreboard */
  #playerList {
    min-width: 0;
    width: 90vw;
    max-width: 360px;
    padding: 16px;
  }

  /* Leaderboard modal */
  #leaderboardModal {
    min-width: 0 !important;
    width: 92vw;
    max-width: 400px;
    padding: 24px !important;
  }

  .github-footer-link {
    display: none;
  }

  canvas {
    border-width: 1px;
  }
}

@media (max-width: 480px) {
  #menu {
    padding: 18px;
  }

  #menu h2 {
    font-size: 24px;
    letter-spacing: 1px;
  }

  .menu-subtitle {
    font-size: 13px;
    letter-spacing: 2px;
  }

  #menu input {
    font-size: 16px;
    padding: 10px 12px;
  }

  .github-link {
    font-size: 12px;
  }

  #roomListScreen {
    padding: 18px;
  }

  #roomScreen {
    padding: 18px;
  }

  #roomReadyBtn {
    padding: 14px 32px !important;
    font-size: 20px !important;
  }

  .room-player .player-name {
    font-size: 16px;
  }

  .skin-option {
    width: 28px;
    height: 28px;
  }

  .hud-bar {
    gap: 0;
  }

  .hud-section {
    padding: 5px 8px;
  }
}
