html,
body {
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #1e2820;
  color: #d4c4a8;
  overflow: hidden;
}

/* ===== TELA DE LOGIN ===== */
#login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #1a2018 0%, #2d3a2d 50%, #3a4535 100%);
}

#login-box {
  background: rgba(30, 40, 32, 0.95);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border: 2px solid #5a6a4a;
  min-width: 320px;
}

#login-logo {
  display: block;
  width: 280px;
  height: auto;
  margin: 0 auto 20px auto;
}

#login-box h1 {
  margin: 0 0 30px 0;
  text-align: center;
  font-size: 32px;
  color: #d4c4a8;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #a69876;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #5a6a4a;
  border-radius: 6px;
  background: #2a3528;
  color: #d4c4a8;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #8b7355;
}

#login-error {
  color: #e55;
  font-size: 14px;
  text-align: center;
  margin-bottom: 15px;
  min-height: 20px;
}

#login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(180deg, #5a6a4a, #4a5a3a);
  color: #d4c4a8;
  border: 2px solid #6b7b5b;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#login-btn:hover {
  background: linear-gradient(180deg, #6b7b5b, #5a6a4a);
  border-color: #8b7355;
}

#login-btn:disabled {
  background: #3a4535;
  border-color: #4a5a4a;
  color: #6a6a5a;
  cursor: not-allowed;
}

/* ===== TELA DO JOGO ===== */
#game-screen {
  height: 100%;
  background: linear-gradient(180deg, #1a2018 0%, #2d3a2d 100%);
}

/* Título no topo */
#title {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
  user-select: none;
  -webkit-user-select: none;
}
#title h1 {
  margin: 0;
  font-size: 28px;
  color: #d4c4a8;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}
#title p {
  margin: 5px 0 0 0;
  font-size: 12px;
  color: #8b7355;
}
#player-info {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #8b7355;
}

/* Sidebar esquerda - Placar */
#sidebar-left {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  user-select: none;
  -webkit-user-select: none;
}
#sidebar-left h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #d4c4a8;
  text-align: center;
}
#scoreboard {
  background: rgba(30, 40, 32, 0.9);
  padding: 10px;
  border-radius: 8px;
  min-width: 140px;
  border: 2px solid #5a6a4a;
  margin-bottom: 15px;
}

#buttons-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Sidebar direita - Ranking */
#sidebar-right {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#ranking-panel {
  background: rgba(30, 40, 32, 0.9);
  padding: 10px;
  border-radius: 8px;
  min-width: 180px;
  max-height: 500px;
  overflow-y: auto;
  border: 2px solid #5a6a4a;
}

#ranking-panel h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #d4c4a8;
  text-align: center;
  border-bottom: 1px solid #5a6a4a;
  padding-bottom: 6px;
}

#ranking-list {
  font-size: 11px;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(90, 106, 74, 0.3);
  gap: 6px;
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item.me {
  background: rgba(139, 115, 85, 0.2);
  margin: 0 -5px;
  padding: 4px 5px;
  border-radius: 4px;
}

.trophy {
  font-size: 14px;
  min-width: 20px;
  text-align: center;
}

.trophy.gold {
  filter: drop-shadow(0 0 3px #ffd700);
}

.trophy.silver {
  filter: drop-shadow(0 0 3px #c0c0c0);
}

.trophy.bronze {
  filter: drop-shadow(0 0 3px #cd7f32);
}

.rank-num {
  min-width: 20px;
  text-align: center;
  color: #8b7355;
  font-size: 10px;
}

.ranking-name {
  flex: 1;
  font-weight: bold;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #c9b896;
}

.ranking-item.me .ranking-name {
  color: #a67c52;
}

.ranking-xp {
  font-size: 10px;
  color: #7a9a5a;
  font-weight: bold;
}

/* Power-up Legend */
#powerup-legend {
  background: rgba(30, 40, 32, 0.9);
  padding: 10px;
  border-radius: 8px;
  min-width: 140px;
  border: 2px solid #5a6a4a;
  margin-bottom: 15px;
}

#powerup-legend h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #d4c4a8;
  text-align: center;
  border-bottom: 1px solid #5a6a4a;
  padding-bottom: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  padding: 4px 0;
  gap: 8px;
  border-bottom: 1px solid rgba(90, 106, 74, 0.3);
}

.legend-item:last-child {
  border-bottom: none;
}

.legend-icon {
  font-size: 16px;
  min-width: 24px;
  text-align: center;
}

.legend-icon.speed {
  filter: drop-shadow(0 0 4px #ffff00);
}

.legend-icon.damage {
  filter: drop-shadow(0 0 4px #ff4400);
}

.legend-icon.shield {
  filter: drop-shadow(0 0 4px #00ffff);
}

.legend-icon.rapidfire {
  filter: drop-shadow(0 0 4px #ff6600);
}

.legend-icon.heal {
  filter: drop-shadow(0 0 4px #ff4488);
}

.legend-icon.invisible {
  filter: drop-shadow(0 0 4px #9966ff);
}

.legend-icon.homing {
  filter: drop-shadow(0 0 4px #ff6600);
}

.legend-desc {
  font-size: 10px;
  color: #a69876;
}

#addBotBtn {
  background: linear-gradient(180deg, #5a6a4a, #4a5a3a);
  color: #d4c4a8;
  border: 2px solid #6b7b5b;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.2s;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
#addBotBtn:hover {
  background: linear-gradient(180deg, #6b7b5b, #5a6a4a);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}
#addBotBtn:active {
  background: linear-gradient(180deg, #4a5a3a, #3a4a2a);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

#logoutBtn {
  background: linear-gradient(180deg, #8b5a4a, #6b4a3a);
  color: #d4c4a8;
  border: 2px solid #9b6a5a;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  transition: all 0.2s;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
#logoutBtn:hover {
  background: linear-gradient(180deg, #9b6a5a, #8b5a4a);
}

#adminBtn {
  background: linear-gradient(180deg, #8b7355, #6b5a45);
  color: #d4c4a8;
  border: 2px solid #9b8365;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  transition: all 0.2s;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
#adminBtn:hover {
  background: linear-gradient(180deg, #9b8365, #8b7355);
}

/* Admin Modal */
#admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 30, 22, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

#admin-panel {
  background: #2a3528;
  border-radius: 12px;
  padding: 20px;
  min-width: 400px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid #5a6a4a;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

#admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #5a6a4a;
}

#admin-header h2 {
  margin: 0;
  font-size: 20px;
  color: #d4c4a8;
}

#admin-close {
  background: #8b5a4a;
  color: #d4c4a8;
  border: 1px solid #9b6a5a;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#admin-close:hover {
  background: #9b6a5a;
}

#admin-content h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #8b7355;
}

#admin-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(20, 30, 22, 0.6);
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #5a6a4a;
}

.admin-player-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-player-name {
  font-weight: bold;
  color: #d4c4a8;
  font-size: 14px;
}

.admin-player-stats {
  font-size: 11px;
  color: #8b7355;
}

.admin-player-stats .kills {
  color: #7a9a5a;
}

.admin-player-stats .deaths {
  color: #a65a4a;
}

.admin-reset-btn {
  background: linear-gradient(180deg, #8b5a4a, #6b4a3a);
  color: #d4c4a8;
  border: 1px solid #9b6a5a;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  transition: all 0.2s;
}

.admin-reset-btn:hover {
  background: linear-gradient(180deg, #9b6a5a, #8b5a4a);
}

/* Arena */
#arena {
  display: block;
  margin: 70px auto 20px auto;
  border: 4px solid #5a6a4a;
  background: #1a1a1a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* Cooldown bars */
#cooldown-bars {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.cooldown-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cooldown-label {
  font-size: 12px;
  font-weight: bold;
  color: #d4c4a8;
  min-width: 100px;
  text-align: right;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.cooldown-bar-bg {
  width: 200px;
  height: 20px;
  background: rgba(30, 40, 32, 0.8);
  border: 2px solid #5a6a4a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cooldown-bar {
  height: 100%;
  background: linear-gradient(90deg, #4e4, #6f6);
  transition: width 0.1s linear;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(100, 255, 100, 0.6);
}

.cooldown-bar.missile {
  background: linear-gradient(90deg, #ff6600, #ffaa00);
  box-shadow: 0 0 8px rgba(255, 120, 0, 0.6);
}

.player-name {
  font-weight: bold;
  color: #c9b896;
}

.player-name.me {
  color: #a67c52;
}

.score-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid rgba(90, 106, 74, 0.2);
}
