* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
body {
  background: #090b0e;
  color: #eceff1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}
#gameCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}
.hud-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}
.panel {
  background: rgba(15, 23, 30, 0.85);
  border: 1px solid #26384a;
  border-radius: 4px;
  padding: 10px 14px;
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.top-bar { display: flex; justify-content: space-between; }
.status-green { font-size: 13px; font-weight: bold; color: #00e676; }
.sub-label { font-size: 10px; color: #78909c; }
.target-frame { min-width: 240px; display: none; }
.target-title { font-size: 13px; font-weight: bold; color: #ff5252; }
.target-stats { font-size: 11px; display: flex; justify-content: space-between; margin-top: 4px; color: #90a4ae; }

.bar-container { background: #1a232c; height: 8px; border-radius: 2px; overflow: hidden; margin: 4px 0; }
.bar-fill { height: 100%; width: 100%; transition: width 0.05s linear; }
.hp-fill { background: #e53935; }
.energy-fill { background: #0288d1; }
.heat-fill { background: #f4511e; }

.center-alerts { align-self: center; text-align: center; margin-top: 15vh; }
.alert-box { display: none; background: #b71c1c; color: #fff; padding: 8px 18px; font-weight: bold; }
.deploy-box { display: none; background: #0277bd; color: #fff; padding: 6px 14px; font-size: 12px; }

.bottom-bar { display: flex; justify-content: space-between; align-items: flex-end; }
.mech-status { width: 280px; }
.mech-header { display: flex; justify-content: space-between; font-weight: bold; font-size: 13px; margin-bottom: 6px; }
.stat-row { margin-bottom: 4px; }
.stat-label { font-size: 10px; display: flex; justify-content: space-between; color: #b0bec5; }
.cargo-info { font-size: 11px; color: #ffd54f; margin-top: 4px; }

.weapon-console { width: 320px; }
.group-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.btn-group {
  flex: 1; padding: 6px; font-weight: bold; font-size: 11px;
  background: #192532; border: 1px solid #37474f; color: #90a4ae; cursor: pointer;
}
.btn-group.active { background: #0288d1; border-color: #29b6f6; color: #fff; }
.barrels-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.barrel-card {
  background: #101720; border: 1px solid #1c2b3a; padding: 4px 8px;
  display: flex; justify-content: space-between; align-items: center; font-size: 11px;
}
.btn-sys {
  width: 100%; padding: 6px; font-size: 11px; background: #162430;
  border: 1px solid #26384a; color: #cfd8dc; cursor: pointer;
}
.btn-sys.active { border-color: #00e676; color: #00e676; }
/* --- СТИЛИ ЛОББИ И АВТОРИЗАЦИИ --- */
.lobby-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(7, 10, 14, 0.92);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lobby-modal {
  width: 440px;
  background: #0d151e;
  border: 1px solid #283e54;
  border-radius: 6px;
  padding: 24px;
  box-shadow: 0 0 30px rgba(0, 230, 118, 0.15), inset 0 0 15px rgba(0, 0, 0, 0.8);
}
.lobby-header { text-align: center; margin-bottom: 20px; border-bottom: 1px solid #1c2b3a; padding-bottom: 12px; }
.cyber-title { font-size: 20px; font-weight: 900; letter-spacing: 2px; color: #00e676; text-shadow: 0 0 8px rgba(0, 230, 118, 0.4); }
.cyber-sub { font-size: 11px; color: #78909c; letter-spacing: 1px; margin-top: 4px; }

.form-desc { font-size: 12px; color: #b0bec5; margin-bottom: 14px; text-align: center; }
.input-group { margin-bottom: 12px; }
.input-group label { display: block; font-size: 11px; color: #90a4ae; margin-bottom: 4px; text-transform: uppercase; }
.input-group input {
  width: 100%;
  padding: 10px 12px;
  background: #141f2b;
  border: 1px solid #2a3d50;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.input-group input:focus { border-color: #00e676; box-shadow: 0 0 8px rgba(0, 230, 118, 0.3); }

.error-msg { color: #ff5252; font-size: 11px; margin-bottom: 10px; min-height: 16px; text-align: center; }

.btn-action {
  width: 100%;
  padding: 12px;
  background: #0277bd;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-action:hover { background: #0288d1; box-shadow: 0 0 15px rgba(2, 136, 209, 0.5); }

.btn-battle {
  background: linear-gradient(180deg, #00e676, #00a152);
  color: #041208;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-top: 14px;
}
.btn-battle:hover {
  background: linear-gradient(180deg, #69f0ae, #00c853);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.6);
}

.welcome-banner {
  background: #101c27;
  border-left: 3px solid #00e676;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 14px;
}
.pilot-name-accent { color: #00e676; font-weight: bold; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.stat-card {
  background: #111a24;
  border: 1px solid #1c2b3a;
  padding: 8px 10px;
  border-radius: 4px;
}
.stat-card-label { font-size: 10px; color: #78909c; }
.stat-card-val { font-size: 13px; font-weight: bold; color: #eceff1; margin-top: 2px; }

.btn-logout {
  width: 100%;
  background: none;
  border: none;
  color: #78909c;
  font-size: 11px;
  margin-top: 10px;
  cursor: pointer;
  text-decoration: underline;
}
.btn-logout:hover { color: #cfd8dc; }