#game {
  border: 1px solid black;
  width: 90vw;
  max-width: 1100px;
  aspect-ratio: 1100 / 700;
  position: relative;
  /* background: url("background.png") no-repeat center center; */
  background-size: cover; /* scale background nicely */
  margin: 0 auto; /* center on smaller screens */
  cursor: pointer;
}

#gameWrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center; /* horizontally centers content */
}

#logoutButton {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.5);
  color: black;
  border: 1px solid #aaa;
  border-radius: 5px;
  padding: 5px 10px;
  font-family: sans-serif;
  font-size: 14px;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.2s;
}

#logoutButton:hover {
  background: rgba(255, 255, 255, 0.9);
}

.player {
  width: 20px;
  height: 20px;
  position: absolute;
  border-radius: 50%;
  transition: left 0.05s linear, top 0.05s linear;
  user-select: none;
}

.player-label {
  user-select: none; /* запрет выделения текста */
}

/* Chat area */
#chatContainer {
  position: absolute;
  bottom: 10px;
  left: 50%; /* centered horizontally relative to game */
  transform: translateX(-50%);
  display: flex;
  align-items: center; /* vertically center items */
  height: 35px; /* same as input height, adjust if needed */
  background: rgba(197, 197, 197, 0.5);
  border-radius: 5px;
  padding: 2px 5px;
  z-index: 1000;
  justify-content: center;
  margin-top: -40px; /* overlay at bottom of game */
  max-width: 1100px; /* match game width */
}

/* Chat history expands upwards */
#chatHistory {
  max-height: 150px;
  overflow-y: auto;
  display: none;
  position: absolute;
  bottom: 50px; /* space for toggle/input */
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.6);
  color: black;
  border-radius: 3px;
  padding: 5px;
  font-size: 18px;
  box-sizing: border-box;
  z-index: 1001;
}

/* Toggle button above input */
#toggleChatHistory {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  margin-bottom: 5px;
  font-size: 18px;
  z-index: 1002;
}

/* Input always at bottom */
#chatInputWrapper {
  display: flex;
  gap: 5px;
  align-items: center; /* vertical alignment */
}

#chatInput {
  height: 30px; /* for example */
  font-size: 18px;
  width: 550px; /* optional minimum */
}

.triangle-btn {
  width: 0;
  height: 0;
  border: none; /* Reset all borders first */
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 15px solid white;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
}

.triangle-btn:hover {
  border-left-color: #f0f0f0; /* slightly lighter on hover */
}
