body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background-color: #2b2b2b;
}

#app-container {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100dvh;
}

#game-wrapper {
  flex: 1200;
  min-width: 0;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-repeat: repeat;
  background-color: #2b2b2b;
}

#game-room {
  width: 1200px;
  height: 896px;
  flex-shrink: 0;
  position: relative;

  background-image: url("img/room/room.jpg");
  background-size: cover;
  background-position: center;

  transform-origin: center center;
  overflow: hidden;
}

#debug-bounds {
  position: absolute;
  border: 3px dashed red;
  background-color: rgba(255, 0, 0, 0.1);
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1000;
}

#ui-zone {
  flex: 440;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#chat-log {
  width: 100%;
  flex: 1;
  box-sizing: border-box;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: sans-serif;
  font-size: 12px;
  display: flex;
  gap: 20px;
  flex-direction: column;
  font-family: "Roboto Mono", monospace;
  color: rgb(124, 124, 124);
  font-weight: 400;
  font-size: 16px;
}

.chat-message {
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.character {
  position: absolute;
  transform: translate(-50%, -50%);

  width: 220px;
  height: 220px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#roma_b {
  background-image: url("img/sims/roma_b.png");
}
#nastya_sh {
  background-image: url("img/sims/nastya_sh.png");
}
#alena_m {
  background-image: url("img/sims/alena_m.png");
}
#dima_e {
  background-image: url("img/sims/dima_e.png");
}
#tanya_kh {
  background-image: url("img/sims/tanya_kh.png");
}
#ulia_k {
  background-image: url("img/sims/ulia_k.png");
}
#misha_m {
  background-image: url("img/sims/misha_m.png");
}
#ulia_m {
  background-image: url("img/sims/ulia_m.png");
}
#sergei_v {
  background-image: url("img/sims/sergei_v.png");
}
#zhenya_p {
  background-image: url("img/sims/zhenya_p.png");
}

.name-tag {
  display: none;
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);

  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 8px;
  white-space: nowrap;
  pointer-events: none;
}

.shadow {
  position: absolute;
  width: 120px;
  height: 25px;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0) 70%
  );

  z-index: -1;
  pointer-events: none;
}

.speech-bubble {
  position: absolute;
  bottom: 210px;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  color: black;
  padding: 10px 15px;
  border-radius: 12px;
  font-family: sans-serif;
  font-size: 14px;
  width: max-content;
  max-width: 300px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  font-family: "Roboto Mono", monospace;
  font-weight: 400;
  font-size: 16px;
}

.speech-bubble.visible {
  opacity: 1;
}

/* ========================================= */
/* МОБИЛЬНАЯ ВЕРСИЯ (ВЕРТИКАЛЬНАЯ ОРИЕНТАЦИЯ) */
/* ========================================= */
@media (orientation: portrait) {
  #app-container {
    flex-direction: column;
  }

  #game-wrapper {
    flex: none;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
  }

  #ui-zone {
    flex: 1;
    width: 100%;
    height: auto;
    border-left: none;
  }

  #chat-log {
    flex-direction: column-reverse;
    font-size: 12px;
  }
}

#secret-trigger {
  position: absolute;
  top: 130px;
  left: 450px;
  width: 300px;
  height: 50px;
  cursor: pointer;
  z-index: 50;
}

#chat-input-container {
  display: flex;
  padding: 15px;
  gap: 10px;
  background-color: #222;
  border-top: 1px solid #444;
}

#viewer-input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-family: "Roboto Mono", monospace;
  background: #111;
  color: white;
  font-size: 14px;
}

#viewer-input:focus {
  outline: 1px solid #555;
}

#viewer-send {
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  background: #444;
  color: white;
  cursor: pointer;
  font-family: "Roboto Mono", monospace;
  font-weight: 700;
  transition: background 0.2s;
}

#viewer-send:hover {
  background: #666;
}

#online-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  font-family: "Roboto Mono", monospace;
  font-size: 14px;
  z-index: 2000;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#online-count {
  color: #4caf50;
  font-weight: bold;
}
