/* Tree Gaming Live Map — in-game chat */

#gameChatButton {
  min-width: 94px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgba(70, 205, 190, .62);
  border-radius: 9px;
  color: #eefdf9;
  background: linear-gradient(145deg, #147c75, #0c4f51);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 5px 16px rgba(0, 0, 0, .3);
  font: 800 13px/1 Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, filter .16s ease;
}

#gameChatButton:hover {
  transform: translateY(-1px);
  border-color: rgba(113, 239, 218, .88);
  filter: brightness(1.1);
}

#gameChatButton:focus-visible {
  outline: 3px solid rgba(78, 224, 204, .38) !important;
  outline-offset: 2px;
}

.tree-game-chat-button-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
}

.tree-game-chat-button-icon svg { width: 100%; height: 100%; fill: currentColor; }

.tree-game-chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: none;
  place-items: center;
  box-sizing: border-box;
  padding: 20px;
  background: rgba(2, 7, 8, .78);
  backdrop-filter: blur(8px);
}

.tree-game-chat-overlay.is-open { display: grid; }
.tree-game-chat-overlay[aria-hidden="true"] { display: none; }

.tree-game-chat-dialog {
  width: min(460px, calc(100vw - 32px));
  height: min(680px, calc(100dvh - 40px));
  min-height: 430px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: #f3f5f2;
  background:
    radial-gradient(circle at 94% 0, rgba(39, 195, 174, .13), transparent 34%),
    radial-gradient(circle at 0 100%, rgba(217, 170, 73, .09), transparent 34%),
    linear-gradient(155deg, #151c1e, #090e10);
  border: 1px solid rgba(217, 170, 73, .38);
  border-radius: 19px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .68);
  font: 14px/1.45 Inter, "Segoe UI", Arial, sans-serif;
}

.tree-game-chat-dialog *,
.tree-game-chat-dialog *::before,
.tree-game-chat-dialog *::after { box-sizing: border-box; }

.tree-game-chat-dialog [hidden] { display: none !important; }

.tree-game-chat-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 15px 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  background: rgba(5, 11, 12, .74);
}

.tree-game-chat-title-wrap { min-width: 0; }

.tree-game-chat-kicker {
  display: block;
  margin-bottom: 2px;
  color: #48cab8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.tree-game-chat-title {
  margin: 0;
  color: #f6f1e7;
  font: 700 20px/1.15 Georgia, "Times New Roman", serif;
}

.tree-game-chat-presence {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: #969f9d;
  font-size: 11px;
}

.tree-game-chat-presence-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8a5e28;
  box-shadow: 0 0 0 3px rgba(138, 94, 40, .15);
}

.tree-game-chat-presence.is-online .tree-game-chat-presence-dot {
  background: #50d09d;
  box-shadow: 0 0 0 3px rgba(80, 208, 157, .14), 0 0 11px rgba(80, 208, 157, .42);
}

.tree-game-chat-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 11px;
  color: #dce6e3;
  background: #1a2527;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.tree-game-chat-close:hover { color: #fff; border-color: rgba(217, 170, 73, .45); background: #283235; }

.tree-game-chat-log {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 14px;
  scrollbar-width: thin;
  scrollbar-color: #765626 #0a0e0f;
}

.tree-game-chat-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree-game-chat-message {
  position: relative;
  padding: 10px 12px 11px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 5px 13px 13px 13px;
  background: rgba(28, 36, 38, .86);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .16);
  overflow-wrap: anywhere;
}

.tree-game-chat-message.is-web {
  border-color: rgba(66, 199, 181, .2);
  background: linear-gradient(135deg, rgba(20, 84, 78, .48), rgba(26, 37, 39, .9));
}

.tree-game-chat-message.is-system {
  border-color: rgba(217, 170, 73, .22);
  background: linear-gradient(135deg, rgba(105, 76, 27, .28), rgba(27, 34, 35, .9));
}

.tree-game-chat-message-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.tree-game-chat-sender {
  min-width: 0;
  overflow: hidden;
  color: #efc86c;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-game-chat-time {
  flex: 0 0 auto;
  color: #78817f;
  font-size: 10px;
}

.tree-game-chat-text {
  margin: 0;
  color: #e8ece8;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.tree-game-chat-empty,
.tree-game-chat-loading {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 30px 18px;
  color: #8e9996;
  text-align: center;
}

.tree-game-chat-empty-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border: 1px solid rgba(66, 199, 181, .18);
  border-radius: 17px;
  color: #43b8a9;
  background: rgba(66, 199, 181, .07);
  font-size: 24px;
}

.tree-game-chat-footer {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, .075);
  background: rgba(7, 12, 13, .88);
}

.tree-game-chat-status {
  min-height: 17px;
  margin: 0 2px 8px;
  color: #8f9b98;
  font-size: 11px;
}

.tree-game-chat-status.is-error { color: #ff9a9d; }
.tree-game-chat-status.is-success { color: #77d6ad; }

.tree-game-chat-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(217, 170, 73, .19);
  border-radius: 11px;
  color: #b7b7b0;
  background: rgba(217, 170, 73, .055);
  font-size: 12px;
}

.tree-game-chat-login {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid rgba(102, 192, 244, .35);
  border-radius: 8px;
  color: #dff4ff;
  background: #193447;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.tree-game-chat-form { display: grid; gap: 8px; }

.tree-game-chat-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
}

.tree-game-chat-input {
  width: 100%;
  min-height: 46px;
  max-height: 112px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid rgba(217, 170, 73, .21);
  border-radius: 11px;
  color: #f2f4f0;
  background: #080d0e;
  font: inherit;
  line-height: 1.4;
}

.tree-game-chat-input::placeholder { color: #697270; }

.tree-game-chat-input:focus {
  outline: none;
  border-color: rgba(67, 196, 179, .72);
  box-shadow: 0 0 0 3px rgba(67, 196, 179, .12);
}

.tree-game-chat-send {
  min-width: 82px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(85, 224, 203, .46);
  border-radius: 11px;
  color: #071311;
  background: linear-gradient(145deg, #58d7bd, #2ca795);
  font-weight: 900;
  cursor: pointer;
}

.tree-game-chat-send:hover:not(:disabled) { filter: brightness(1.08); }
.tree-game-chat-send:disabled { cursor: wait; filter: grayscale(.35); opacity: .58; }

.tree-game-chat-form-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #747e7b;
  font-size: 10px;
}

.tree-game-chat-form-meta strong { color: #aeb8b5; font-weight: 750; }
.tree-game-chat-count.is-near-limit { color: #efc86c; }

body.tree-game-chat-open { overflow: hidden; }

@media screen and (max-width: 860px) {
  #gameChatButton {
    width: 42px;
    min-width: 42px;
    min-height: 44px;
    padding: 0;
    font-size: 0;
  }

  #gameChatButton .tree-game-chat-button-icon { width: 20px; height: 20px; }
}

@media screen and (max-width: 600px) {
  .tree-game-chat-overlay {
    align-items: end;
    padding: 0;
  }

  .tree-game-chat-dialog {
    width: 100vw;
    height: min(88dvh, 760px);
    min-height: 420px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .tree-game-chat-header {
    min-height: 68px;
    padding: 11px 12px 10px 16px;
  }

  .tree-game-chat-log { padding: 14px 12px; }
  .tree-game-chat-footer { padding: 10px 10px max(12px, env(safe-area-inset-bottom)); }
  .tree-game-chat-input-wrap { gap: 7px; }
  .tree-game-chat-send { min-width: 72px; padding-inline: 10px; }
  .tree-game-chat-gate { align-items: flex-start; flex-direction: column; }
  .tree-game-chat-login { width: 100%; text-align: center; }

  #topNavBar .navLeft {
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  #topNavBar .navLeft::-webkit-scrollbar { display: none; }
}

@media screen and (max-width: 360px) {
  #topNavBar .navLeft { gap: 3px; }
  #topNavBar #mainWebsiteButton,
  #topNavBar #supportButton,
  #topNavBar #toolsButton,
  #topNavBar #gameChatButton { width: 39px; min-width: 39px; }
  #steamLoginButton { max-width: 92px !important; }
}

@media (prefers-reduced-motion: reduce) {
  #gameChatButton,
  .tree-game-chat-dialog { transition: none; }
}
