body {
  display: flex;
  background: url("/images/back.jpg") no-repeat center center fixed;
  background-size: cover;
  justify-content: center;
  scrollbar-width: thin;
  scrollbar-color: #c18a8a #eee;
  overflow-y: hidden;
  overflow-x: hidden;
}

body.sala-farmville2 {
  background-image: url("/images/famrville2back.jpg");
  background-size: cover;
  background-position: center center;
  overflow-y: hidden;
  overflow-x: hidden;
    scrollbar-width: thin;
  scrollbar-color: #c18a8a #eee;
}
body.sala-farmville2 .user-bg { display:none !important; }

#userBgLayer {
  height: 100vh;
  background-size: cover;
  background-position: center;
}

body.sala-playstation {
  background-image: url("/chat/backgrounds/playstation/bg-13.png");
  background-size: cover;
  background-position: center center;
  overflow-y: hidden;
  overflow-x: hidden;
    scrollbar-width: thin;
  scrollbar-color: #c18a8a #eee;
}
body.sala-playstation .user-bg { display:none !important; }
.playstation-bg {
  background-size: cover;
  filter: brightness(0.9);
  /* outros estilos específicos para a sala playstation */
}

html, body{ transform: none !important; }

.bg-video{
  position: fixed;
  inset: 0;              /* top/right/bottom/left: 0 */
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #000;      /* cor de fundo para cantos extremos */
}

/* vídeo cobre a viewport inteira, centrado */
.bg-video > video {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, 0px);
  min-width: 100%;
  min-height: 100%;
  width: -moz-available;
  height: 41vw;
  object-fit: fill;
  object-position: center center;
}

html {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
form {
  padding: 13px 4px;
  display: flex;
  gap: 10px;
  justify-content: center;
}
form label {
  font-size: 1.2rem;
  font-weight: bold;
}
input#enter {
  font-size: 17px;
}
a {
  color: #0000ff;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
#menu,
.welcome {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
  max-width: 98%;
}
#name {
  border-radius: 9px;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
  border-bottom-right-radius: 9px;
  border-bottom-left-radius: 9px;
  border: 1px solid #ff9800;
  padding: 4px 4px;
  max-width: 64%;
  width: 510px;
}
#enter {
  background: #ff9800;
  border: 2px solid #e65100;
  color: white;
  padding: 4px 10px;
  font-weight: bold;
  border-radius: 7px;
  height: 35px;
  width: 124px;
}
.error {
  color: #ff0000;
}
#menu p.welcome {
  flex: 1;
}
a#exit {
  color: white;
  background: #e11010;
  padding: 2px 27px;
  border-radius: 8px;
  font-weight: bold;
  margin-right: -20px;
  margin-top: 0px;
}
.country-flag {
  min-width: 0;
  font-size: 13px;
  margin-top: 4px;
  margin-left: 5px;
  margin-right: 5px;
  white-space: nowrap;
}

.msgln {
  margin: 0 0 5px 0;
}
.msgln span.left-info {
  color: red;
}
.msgln span.chat-time {
  color: #666;
  font-size: 60%;
  vertical-align: super;
}
.msgln b.user-name,
.msgln b.user-name-left {
  font-weight: bold;
  background: #546e7a00;
  color: #1d4589;
  padding: 2px 4px;
  font-size: 90%;
  border-radius: 10px;
  margin: 0 5px 0 0;
}
/* estilos diferentes por tipo */
.msgln[data-evt="logout"] .left-info { color: red; }
.msgln[data-evt="join"]   .left-info { color: #28a745; }

.msg-content {
  display: flex;
  flex-direction: column;
  width: 98%;
    min-height: 60px;
}
.user-name-chat {
  font-size: 21px;
  font-weight: bold;
  color: #4169e1;
  word-break: break-word;
  margin-top: 1px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 110px;
}

.user-name-img {
  width: 0px;
  height: 0px;
  margin-top: 0px;   
}

.user-flag {
  min-width: 0;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 20px;
  box-shadow: 1px 2px 6px #cddcff60;
  margin: 4px;
  object-fit: cover;
}

.chat-time {
  min-width: 0;
  color: #196;
  font-size: 12px;
  margin-top: 3px;
  margin-left: -50px;
  margin-right: 10px;
  white-space: nowrap;
  
}

.msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 100%;
      height: 35px;
  }

.emoticon {
  vertical-align: top;
    max-height: 30px;
  opacity: 0.95;
    border-radius: 25px;
  box-shadow: 5px 0px 5px #cddcff60;
}

.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  background: #ffffffe8;
  border: 2px solid #86a4e8;
  border-radius: 12px;
  box-shadow: 1px 5px 6px #cddcff60;
  margin: 1px 6px;
  padding: 0px 5px;
  min-height: 60px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-line;
  max-width: 98%;
  margin-top: 2px;
  margin-bottom: -18px;
    min-height: 35px;
}
.avatar-circle {
  width: 45px;
  height: 45px;
  min-height: 45px;
  min-width: 45px;
  color: aqua;
  text-shadow: 1px 3px 3px rgb(105, 0, 232);
  border-radius: 50%;
  font-size: 1.45em;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  margin-left: 5px;
  margin-top: 10px;
  box-shadow: 0px 1px 8px 4px #00000040;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 90px;
  opacity: 0.9;
  position: relative;
}
.avatar-circle::before {
  content: "";
  position: absolute;
  width: 35px;
  height: 20px;
  background-color: #00000050;
  border-radius: 60%;
  z-index: -1;
}
.msg-text {
  text-align: start;
  display: block;
  font-size: 20px;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
  overflow-wrap: anywhere;
  padding: 0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 35px;
}
#chat-footer {
  flex: 0 0 auto;
  background: #f7f7f7;
  border-top: 1px solid #ddd;
  padding: 8px 12px;
}

#emotesBtn {
  width: 30px;
  margin: 6px;
}
#emotesBtn:hover {
  transform: scale(1.15);
}

#emotesMenu {
  background: #ffffff;
  border-radius: 10px;
  padding: 11px 8px 8px 10px;
  min-width: 730px;
  max-width: 730px;
  max-height: 730px;
  overflow-x: auto;
  overflow-y: hidden;
  z-index: 10000;
  box-shadow: 0 4px 20px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
  -webkit-animation-name: animatetop;
  -webkit-animation-duration: 0.9s;
  animation-name: animatetop;
  animation-duration: 0.9s;
  
}

/* Add Animation */
@-webkit-keyframes animatetop {
  from {top:90px; opacity:0} 
  to {opacity:4}
}

@keyframes animatetop {
  from {top:90px; opacity:0}
  to {opacity:4}
}

#emotesMenu img {
  width: 30px;
  height: 30px;
  margin: 0.7px;
  cursor: pointer;
  transition: transform 0.13s;
  vertical-align: middle;
  background: #f6f8f8;
  border-radius: 8px;
  box-shadow: 0 1px 5px #bbb2;
  object-fit: contain;
  padding: 2.5px;
}
#emotesMenu img:hover {
  transform: scale(1.25) rotate(-6deg);
  box-shadow: 0 1px 3px #8884;
  filter: brightness(1.20);
}
.mood-picker {
  border-radius: 23px;
  z-index: 999;
  background: #0234a663;
  margin-top: -45px;
  padding: 3px 16px 9px 10px;
  margin-left: 125px;
  width: fit-content;
  height: 28px;
}
.emoji-btn {
  font-size: 1.6em;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.10s;
  outline: none;
  padding: 0px 0px;
}
.emoji-btn:hover {
  transform: scale(1.20);
}

.msg-text a {
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
}
.msg-text a:hover {
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
}
.msg-text a img {
  border: none !important;
  outline: none !important;
}
#chat-topo,
.chat-header,
.chat-title {
  padding: 8px 18px;
  margin-bottom: 0;
}
#header-top,
#header,
.chat-header {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  margin-bottom: 2px !important;
  min-height: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
h1,
.chat-title,
#chat-title {
  font-size: 1.3em !important;
  margin-bottom: 0 !important;
  margin-top: 2px !important;
}
#chatbox::-webkit-scrollbar {
  width: 6px;
  background: #eee;
}
#chatbox::-webkit-scrollbar-thumb {
  background: #c18a8a;
  border-radius: 8px;
}
#wrapper {
  margin-top: 13px;
  width: 1101px;
  min-width: 600px;
  max-width: 96.7vw;
  height: 98.5vh;
  min-height: 555px;
  max-height: 98.2vh;
  background: #ffffff91;
  border-radius: 14px;
  box-shadow: 0 2px 18px #bbc;
  display: flex;
  flex-direction: row;
  overflow-x: hidden;
  position: relative;
  top: -5px;
  z-index: 10;
}
#wrapper,
.left-side,
.right-side {
  overflow-x: auto;
}
#room-title {
  text-align: left;
  font-size: 40px;
  font-family: "Arial", Segoe UI, sans-serif;
  font-weight: bold;
  margin-bottom: 0px;
  margin-left: -60px;
}

.room-highlight {
  background-image: linear-gradient(45deg, #00f3ff, #0a16c0);
  background-size: 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: #0000;
  user-select: none;
  pointer-events: none;
}
#menu {
  display: flow-root;
  margin-top: 1px;
  margin-bottom: 8px;
  min-height: 0%;
}
.welcome {
  color: #ffffff;
  margin: 0;
  font-size: 18px;
  margin-right: 0px;
  width: max-content;
  font-family: "Arial", Segoe UI, sans-serif;
  user-select: none;
  pointer-events: none;
}
.logout {
  font-size: 15px;
  margin: 0;
  margin-left: auto;
}
#exit {
  display: inline-block;
  padding: 11px 22px;
  background: #b44;
  color: #fff;
  border-radius: 6px;
  font-size: 23px;
  font-weight: bold;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: 16px;
  margin-top: 0;
  float: right;
  z-index: 9999;
}
#exit:hover {
  background: #c55;
}
#chatbox {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-line;
  max-width: 98%;
  min-height: 34%;
  overflow-y: auto;
  margin: 1px 0px 0px 5px;
  background: ##fafbffa1;
  text-align: left;
  width: 98%;
  border-top-left-radius: 13px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 0px;
  border-bottom-left-radius: 0px;
  flex: 1 1 auto;
  margin-top: -6px;
  border: 2px solid #19d22d;
  font-family: "Arial", Segoe UI, sans-serif;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #c18a8a #eee;
}
.loading-msg {
    text-align: center;
    font-style: italic;
    font-size: 48px;
    font-weight: bold;
    color: #19d22d;
    padding: 12px;
	margin-left: 2%;
	margin-right: 2%;
    margin-top: 20%;
    width: 90%;
	max-width: 90%;
    background: #ffffffe8;
    border: 2px solid #86a4e8;
    border-radius: 12px;
    font-family: "Arial", Segoe UI, sans-serif;
	box-shadow: 1px 5px 6px #cddcff60;
	animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse { 0% { opacity: 0.4; } 50% { opacity: 1; } 100% { opacity: 0.4; } }
form[name="message"] {
  margin: 4px 2px 67px 6px;
  display: flex;
  gap: 2px;
  align-items: flex-end;
  max-width: 91%;
  min-width: 91%;
  height: 70px;
}

#submitmsg {
  padding: 0px 0px 0px 0px;
  font-size: 16px;
  background: #ff4500;
  color: #fff;
  font-weight: bold;
  margin-bottom: 21px;
  border-radius: 25px;
  cursor: pointer;
  transition: background 0.18s;
  border: 2px solid #ff780094;
  height: 30px;
  width: 130px;
  margin-left: 13px;
  font-family: "Arial", Segoe UI, sans-serif;
}
#submitmsg.active {
  background: #69bb44;
  border: 2px solid #454562bd;
  transition: background 0.18s;
}
#userlistbox {
  font-weight: bold;
  color: #1d4589;
  font-size: 16px;
  margin: 0px 0px 0px 0px;
  background: #f4f6fad4;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-bottom-right-radius: 0px;
  border-bottom-left-radius: 0px;
  border: 2px solid #04f891;
  max-height: 400px;
  overflow-y: auto;
  word-break: break-all;
  padding: 12px 5px;
  min-height: 20px;
  width: 93%;
  max-width: 90%;
  font-family: "Arial", Segoe UI, sans-serif;
}
#logbox {
  color: #19d22d;
  font-size: 15px;
  max-height: none;
  background: #f4f6fad4;
  overflow: visible !important;
  display: block;
  padding: 11px 4px 8px 6px;
  margin-top: -1px;
  word-break: break-all;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  border: 2px solid #7ef804;
  width: 93%;
  max-width: 90%;
  font-family: "Arial", Segoe UI, sans-serif;
}
@media (max-width: 900px) {
  .chat-title-top {
    font-size: 30px;
  }
}
.bottom-chat-controls {
  position: relative;
  height: 170px;
  min-height: 170px;
  max-height: 170px;
  background: #ffffff7a;
  z-index: 3;
  border-radius: 13px;
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  border-bottom-right-radius: 13px;
  border-bottom-left-radius: 13px;
  border: 2px solid #7cd017;
  margin-top: -2px;
  max-width: 98%;
  margin-left: 5px;
  box-shadow: 0 2px 18px #f900002b;
}

.left-side {
  flex: 1 1 auto;
  min-width: 70%;
  max-width: 70%;
  background: #f9f9f900;
  display: flex;
  flex-direction: column;
  height: auto;
  top: 90px;
  position: absolute;
  bottom: 38px;
  min-height: 418px;
  scrollbar-width: thin;
  scrollbar-color: #c18a8a #eee;
}
.right-side {
  flex: 1 0 0;
  min-width: 29.5%;
  max-width: 29.5%;
  border-left: 0px solid #e51414;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  top: 93px;
  position: absolute;
  margin-left: 70.5%;
}

.left-side::-webkit-scrollbar {
  width: 6px;
  background: #eee;
}
.left-side::-webkit-scrollbar-thumb {
  background: #c18a8a;
  border-radius: 8px;
}
.online {
  color: #4dbb44;
  font-size: 14px;
  background: #328a2a3d;
  border-radius: 30px;
  border: 1px solid #03c5d959;
  margin: 6px 0px 0px 0px;
  margin-right: auto;
  display: flex;
  justify-content: center;
  margin-left: 60px;
  height: 32px;
  width: 700px;
  font-family: "Arial", Segoe UI, sans-serif;
}
.displaychat2 {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  max-width: max-content;
  font-size: clamp(42px, 42px, 42px);
  color: #0000ff1c;
  font-weight: bold;
  font-family: system-ui, sans-serif;
  z-index: 1;
  text-shadow: -8px 6px 4px #058bec47;
  letter-spacing: 1px;
  user-select: none;
  pointer-events: none;
  margin: 0;
  width: 1000px;
}
.chat-title-top {
  font-size: 56px;
  color: #eaff54;
  font-weight: bold;
  font-family: system-ui;
  text-align: center;
  text-shadow: 2px 4px 6px #555a;
  margin-top: 10px;
  margin-bottom: 14px;
  width: 100%;
  z-index: 1200;
  position: relative;
}
.rights2 {
  font-weight: bold;
  font-size: smaller;
  color: #0c5eb5;
  text-align: center;
  margin-top: -18px;
  height: 20px;
}
.top-side {
  flex: 1 1 90%;
  min-width: 98%;
  max-width: 98%;
  background: #f9f9f900;
  max-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 50px;
  padding: 3px;
  min-height: 43px;
}
.top-side2 {
  flex: 1 1 90%;
  min-width: 90%;
  max-width: 90%;
  background: #f9f9f900;
  max-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 80px;
  padding: 4px;
  min-height: 51px;
  top: 41px;
  position: absolute;
  margin-left: 90px;
}
.down-side {
  position: absolute;
  min-width: 98%;
  max-width: 98%;
  left: 1%;
  right: 1%;
  bottom: 1px;
  background: #0b032000;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 42px;
}
#emoji-bar {
  margin: 0px 17px 19px 7px;
  background: #fff;
  border-radius: 18px;
  padding: 0px 29px 0px 4px;
  border: 1px solid #800d0d80;
  display: flex;
  gap: 4px;
  margin-top: -72px;
  height: 49px;
  overflow: clip;
  align-items: center;
  justify-content: flex-start;
}
.mood-opt {
  width: 35px;
  height: 35px;
  cursor: pointer;
  text-shadow: 6px 4px 6px #555a;
}
.mood-opt:hover {
  transform: scale(1.25);
  transition: transform 0.6s;
}

#emoji-bar button {
  background: none;
  border: none;
  padding: 3px;
  margin: 2px;
  outline: none;
  box-shadow: none;
  cursor: pointer;
}

#emoji-bar img {
  width: 33px;
  height: 29px;
  display: block;
  margin: 3px;
  padding: 0px;
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 4.1s;
}

#emoji-bar img.emoji-btn {
  width: 30.5px;
  height: 30.5px;
  cursor: pointer;
  margin: -8.4px;
  padding: 0.1px;
  border: none;
  background: none;
  transition: transform 0.1s;
  margin-left: 6px;
}
#emoji-bar img.emoji-btn:hover {
  transform: scale(1.15);
}

.usermsgRich {
  width: 630px;
  height: 75px;
  padding: 3px;
  border: 1px solid #fb020233;
  border-radius: 15px;
  background: #fff;
  color: #000;
  font-family: Arial;
  font-size: 25pt;
  font-weight: normal;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-y: auto;
  overflow-x: hidden;
  outline: 0;
  font-variant-position: unset;
}

/* ===== Scrollbar fino só no editor ===== */
/* Firefox */
.usermsgRich{
  scrollbar-width: thin;              /* fino */
  scrollbar-color: #c18a8a #eee;      /* polegar / trilho */
}
/* WebKit (Chrome, Edge, Safari) */
.usermsgRich::-webkit-scrollbar{
  width:6px;       /* vertical fino */
  background: #eee;
}
.usermsgRich::-webkit-scrollbar-thumb{
  background:#c18a8a;
  border-radius:8px;
}
.usermsgRich::-webkit-scrollbar-track{
  background:#eee;
}

.loader-overlay{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  gap:10px;
  background: rgba(0,0,0,0.04);
  pointer-events:none;
}

.loader-spinner{
  width:28px; height:28px; border-radius:50%;
  border:3px solid rgba(0,0,0,.15);
  border-top-color:#6c6;
  animation: spin 1s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.loader-text{ font:14px/1 Arial, sans-serif; opacity:.7; }

#userlistbox .mention{ cursor: pointer; text-decoration: underline dotted; }
#userlistbox .mention:hover{ text-decoration: underline; }

/* animação de abanar */
@keyframes chat-shake {
  0%,100% { transform: translate3d(0,0,0); }
  10%,90% { transform: translate3d(-1px, 0, 0); }
  20%,80% { transform: translate3d( 2px, 0, 0); }
  30%,50%,70% { transform: translate3d(-4px, 0, 0); }
  40%,60% { transform: translate3d( 6px, 0, 0); }
}
.shake {
  animation: chat-shake 1500ms cubic-bezier(.36,.07,.19,.97) both;
}

/* respeitar acessibilidade */
@media (prefers-reduced-motion: reduce){
  .shake-x { animation: shakeX 1500ms cubic-bezier(.36,.07,.19,.97) both !important; }
}

.user-bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: center center / cover no-repeat fixed;
}
#bgPicker {
  position: absolute;
  top: 35px;
  right: 20px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.82);
  padding: 21px;
  border-radius: 19px;
  display: none;
  max-width: min(98vw, 506px);
  max-height: 80vh;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #f9e5e5 #eee;
}

#bgPicker .grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, 96px);
  gap: 8px;
}
#bgPicker .bg-item {
  width: 95px;
  height: 40px;
  border: 1px solid #666;
  border-radius: 8px;
  background: #222;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0px;
}
#bgPicker .bg-item img{
  max-width: 100%; max-height: 100%; border-radius: 6px;
}
#bgPicker .bg-item.selected{ border-color: #ffcc33; }
#bgPicker .bg-reset {
  grid-column: 1 / -1;
  background: #f42b2b;
  color: #fff;
  border-radius: 12px;
  padding: 3px 1px;
  text-align: center;
  cursor: pointer;
}

/* botão para abrir o picker (use seu ícone back.png) */
#bgBtn{
  border: 0; background: transparent; cursor: pointer;
}
#bgBtn img {
  width: 30px;
  height: 30px;
  display: block;
  margin-right: -13px;
}

/* Nunca mostre data: inline; (vai virar thumb) */
#usermsgRich img[src^="data:"] { display: none !important; }

/* Se algum <img> escapar, force tamanho de thumb */
#usermsgRich img {
  width: 50px !important;
  height: 50px !important;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.25);
  vertical-align: text-bottom;
}
