/* 3D 大厅叠加 UI */
.lobby-root {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: #0a0e17;
}

#lobbyCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.lobby-ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.lobby-ui .hit {
  pointer-events: auto;
}

.hud-tl, .hud-tr, .hud-bl, .hud-br {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: min(42vw, 280px);
}

.hud-tl { top: calc(0.7rem + env(safe-area-inset-top)); left: 0.7rem; }
.hud-tr { top: calc(0.7rem + env(safe-area-inset-top)); right: 0.7rem; align-items: flex-end; }
.hud-bl { bottom: calc(4.2rem + env(safe-area-inset-bottom)); left: 0.7rem; }
.hud-br { bottom: calc(4.2rem + env(safe-area-inset-bottom)); right: 0.7rem; align-items: flex-end; }

.glass-panel {
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  background: rgba(10, 16, 32, 0.55);
  border: 1px solid rgba(0, 212, 255, 0.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 24px rgba(0,0,0,0.35);
  color: #e8f1ff;
}

.glass-panel .label {
  font-size: 0.7rem;
  color: rgba(200,220,255,0.6);
  letter-spacing: 0.08em;
}

.glass-panel .title {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 0.95rem;
  color: #00d4ff;
}

.badge-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #fb7185;
  color: #fff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn {
  position: relative;
  min-width: 48px;
  min-height: 48px;
}

.lobby-nav {
  position: absolute;
  left: 50%;
  bottom: calc(0.55rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  z-index: 3;
  pointer-events: auto;
  padding: 0.35rem;
  border-radius: 16px;
  background: rgba(8, 12, 24, 0.65);
  border: 1px solid rgba(0, 212, 255, 0.28);
  backdrop-filter: blur(16px);
}

.lobby-nav a, .lobby-nav button {
  min-height: 44px;
  min-width: 56px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.notif-panel, .chat-panel, .help-panel {
  position: absolute;
  top: 4.2rem;
  right: 0.7rem;
  width: min(92vw, 340px);
  max-height: 55vh;
  overflow: auto;
  z-index: 5;
  display: none;
}

.notif-panel.open, .chat-panel.open, .help-panel.open { display: block; }

.chat-panel { left: 0.7rem; right: auto; bottom: 5rem; top: auto; }

.notif-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
}

.notif-item.unread { color: #00d4ff; }

.chat-log {
  height: 160px;
  overflow: auto;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  color: rgba(220,230,255,0.8);
}

.chat-input-row {
  display: flex;
  gap: 0.35rem;
}

.chat-input-row input {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(0,212,255,0.3);
  background: rgba(0,0,0,0.35);
  color: #fff;
  padding: 0 0.6rem;
}

.map-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.map-chip {
  font-size: 0.72rem;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
}

.map-chip.active {
  border-color: #00d4ff;
  color: #00d4ff;
  box-shadow: 0 0 10px rgba(0,212,255,0.35);
}

/* battle overlays */
.battle-hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.battle-hud .hit { pointer-events: auto; }
.vignette-hurt {
  position: absolute; inset: 0; pointer-events: none; z-index: 4;
  box-shadow: inset 0 0 80px rgba(255, 40, 60, 0.85);
  opacity: 0; transition: opacity 0.1s;
}

.vjoy-zone {
  position: absolute;
  left: 1rem;
  bottom: 1.2rem;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(0,212,255,0.3);
  touch-action: none;
  z-index: 6;
}

.vjoy-stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.45);
  border: 1px solid rgba(255,255,255,0.4);
}

.action-pad {
  position: absolute;
  right: 0.8rem;
  bottom: 1.2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  z-index: 6;
}

.action-pad .glass-btn {
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  padding: 0;
  font-size: 0.75rem;
}

.fallback-2d {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0e17;
  color: #e8f1ff;
  text-align: center;
  padding: 1.5rem;
}

@media (min-width: 900px) {
  .vjoy-zone, .action-pad { display: none; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .lobby-nav { transform: translateX(-50%) scale(0.92); }
  .glass-panel { padding: 0.45rem 0.6rem; }
}
