@keyframes blurEffect {
  0% {
    filter: blur(30px);
  }
  100% {
    filter: blur(0);
  }
}

body {
  font-family: "Bungee Outline", sans-serif;
  font-weight: 900;
  overflow: hidden;
  animation: blurEffect 0.9s ease-out;
  margin: 18px;
  background-color: rgb(19, 19, 19);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  user-select: none;
}

#snow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

#chat_input, #join_input, #join_button, html, #chat_logout, #chat_input_send, #clear_chat_button {
  cursor: url(images/kitty.svg) 16 16, auto !important;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

img, a {
  pointer-events: none;
  -webkit-user-drag: none; 
}

.trail {
  animation: trailAnimation 1s ease-out forwards;
  background: radial-gradient(circle, rgba(255, 204, 255, 1) 0%, rgba(255, 102, 204, 0.6) 100%); /* Glowing gradient */
  opacity: 0.8; 
  border-radius: 50%;
  width: 15px; 
  height: 15px; 
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
  box-shadow: 0 0 8px rgba(255, 102, 204, 0.8);
  transform: scale(1); 
}

@keyframes trailAnimation {
  0% {
    transform: scale(1.4) rotate(0deg);
    opacity: 1;
    background: radial-gradient(circle, rgba(255, 102, 204, 1) 0%, rgba(255, 204, 255, 0.8) 100%);
    box-shadow: 0 0 8px rgba(255, 102, 204, 0.8);
  }
  25% {
    background: radial-gradient(circle, rgba(255, 255, 102, 1) 0%, rgba(255, 255, 204, 0.6) 100%);
    box-shadow: 0 0 12px rgba(255, 255, 102, 0.8);
  }
  50% {
    transform: scale(1.2) rotate(45deg);
    background: radial-gradient(circle, rgba(102, 255, 204, 1) 0%, rgba(204, 255, 255, 0.6) 100%);
    box-shadow: 0 0 12px rgba(102, 255, 204, 0.8);
  }
  75% {
    background: radial-gradient(circle, rgba(102, 204, 255, 1) 0%, rgba(204, 255, 255, 0.6) 100%);
    box-shadow: 0 0 12px rgba(102, 204, 255, 0.8);
  }
  100% {
    transform: scale(0.4) rotate(90deg);
    opacity: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    box-shadow: none;
  }
}

* {
  outline: none;
  border: none;
  padding: 0;
  margin: 0px;
  box-sizing: border-box;
}

@keyframes bounceWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes titleEffects {
  0% { color: #ffffff; }
  25% { color: #ffcc00; }
  50% { color: #ff66ff; }
  75% { color: #66ccff; }
  100% { color: #ffffff; }
}

#title, .highlight, .trail, #chat_logout {
  will-change: transform, opacity;
}

#title_container {
  width: 100%;
  height: auto;
  padding: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(160deg, #667eea, #764ba2);
  border-radius: 70px;
  position: relative;
  top: -4px; 
  z-index: 2;
}


#title {
  display: inline-block;
  font-size: 55px;
  letter-spacing: 6px;
  user-select: none;
  text-align: center;
  animation: titleEffects 5s infinite linear, 
  glow 2s infinite alternate;
}

#join_container {
  width: 100%;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

#join_input_container {
  width: 100%;
  background: rgb(255, 255, 255);
  max-width: 220px;
  height: 40px;
  border-radius: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#join_input {
  width: 100%;
  height: 40px;
  color: #202020;
  font-family: 'Varela Round';
  font-size: 16px;
  font-weight: normal;
  text-align: center;
  background-color: transparent;
  border: 2px solid rgb(147, 126, 252);
  border-radius: 35px;
  transition: all 0.3s ease; 
}

#join_input:focus, #join_input:not(:placeholder-shown) {
  border-color: rgba(113, 110, 255, 0.63); 
  box-shadow: 0px 0px 10px rgba(59, 56, 245, 0.774); 
  outline: none;
}

#join_button {
  width: 100%;
  max-width: 450px;
  height: 40px;
  background: rgb(117, 108, 247);
  border-radius: 35px;
  font-family: Varela Round;
  font-size: 15px;
  transform: translateY(12%);
  font-weight: bold;
  text-align: center;
  color: #ffffff;
  transition: background-color 0.1s, transform 0.3s;
} 

#join_button:hover {
  background-color: #cc0000;
  transform: scale(1.07) translateY(10%);
  text-decoration: none;
  transition: 0.3s;
}

#chat_container {
  width: 100%;
  height: auto;
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#chat_inner_container {
  width: 90%;
  max-width: 600px;
}

#chat_content_container {
  width: 100%;
  height: calc(100vh - 375px);
  overflow-y: auto;
  background: #1b1b1be1;
  font-family: 'Varela Round';
  padding: 8px 13px 6px 13px;
  margin-top: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.05),
    0 -1px 20px rgba(0, 0, 0, 0.5);
  border-radius: 35px;
  scroll-behavior: smooth;
  position: relative;
  top: -4px;
}


#clear_chat_button.deleteButton {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 10px;
  justify-content: center;
  gap: 3px;
  background-color: #1a1a1a;
  border: none;
  border-radius: 35px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

#clear_chat_button.deleteButton svg {
  width: 17px;
  height: 17px;
}

#clear_chat_button.deleteButton:active {
  transform: scale(0.98);
}

#clear_chat_button .bin path {
  fill: rgb(206, 206, 210); /* Default icon color (gray) */
  transition: all 0.2s;
}

#clear_chat_button:hover {
  background-color: rgb(237, 56, 56);
  overflow: visible;
}

#clear_chat_button:hover .bin path {
  fill: #fff;
 /* Icon turns white on hover */
}

/* Tooltip styling */
#clear_chat_button .tooltip {
  --tooltip-color: rgb(41, 41, 41);
  position: absolute;
  top: -40px;
  background-color: var(--tooltip-color);
  color: white;
  border-radius: 25px;
  font-size: 12px;
  padding: 8px 12px;
  font-weight: 600;
  box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.105);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.5s;
  pointer-events: none;
  white-space: nowrap;
}

#clear_chat_button .tooltip::before {
  position: absolute;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  content: "";
  background-color: var(--tooltip-color);
  bottom: -10%;
}

#clear_chat_button:hover .tooltip {
  opacity: 1;
}

.message_timestamp {
  font-size: 11px;
  color: rgb(69, 26, 150);
  margin-top: 5px;  
}

#chat_input_container {
  width: 100%;
  height: 50px;
  display: flex;
  background: #222222b4;
  justify-content: space-between;
  align-items: center;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.05),
    0 -1px 15px rgba(0, 0, 0, 0.5);
  padding: 0 8.5px;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

#chat_input {
  width: 100%;
  height: 100%;
  background-color: transparent;
  color: #cacaca;
  font-family: 'Varela Round', cursive;
  font-size: 17px;
  padding: 0px 8px;
  border: none;
  outline: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: #ad72cf;
  will-change: contents;
  transition: text-shadow 0.2s ease, color 0.2s ease;
}

#chat_input_send {
  width: 70px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.1s, box-shadow 0.2s;
  border-radius: 9999px; 
  background-color: #5a4fcf;
  margin-left: 12px; 
  margin-right: 4px; 
  position: relative;
  border: none;
  flex-shrink: 0;
}

#chat_input_send:active {
  transform: scale(0.85) translateX(15%) translateY(1%);
}

#chat_logout_container {
  position: fixed;
  width: 100%;
  margin-top: 25px;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  animation: flyIn 0.7s ease-out 1s forwards; 
}

.logout-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-left: 3px;
  margin-right: -6px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.logout-icon:hover {
  opacity: 1;
}

#logout-icon:active {
  transform: scale(0.95) translateX(-1%);
}

#chat_logout {
  color: rgb(235, 235, 235);
  background-color: #1a1a1a;
  padding: 10px 20px;
  border-radius: 35px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-family: 'Varela Round', cursive;
  font-weight: bold;
  transition: transform 0.4s;
  display: inline-block; 
  white-space: nowrap;
  outline: none;
  position: relative;
  overflow: hidden;
}

@keyframes flyIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0); 
  }
}

#chat_logout::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: scale(0);
  transition: transform 0.5s ease;
}

#chat_logout:hover::after {
  transform: scale(4);
}

#chat_logout:hover {
  border-color: #666666;
  background: #292929;
}

#chat_logout:active {
  transform: scale(0.95) translateX(-1%);
}

.message_container {
  width: 570px;
  min-height: 60px;
  display: inline-block;
  margin-bottom: 5px;
  background-color: #2b2c3f7a;
  border-radius: 28px;
  padding: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 100%;
  padding-top: 9px;
  position: relative;
}

.message_timestamp {
  font-size: 10px;
  color: rgba(149, 109, 223, 0.89);
  margin-top: 5px;
  position: absolute; 
  top: 5px;
  right: 20px; 
  font-weight: bold;
}

.message_user {
  display: inline-block;
  background: linear-gradient(160deg, #667eea, #764ba2);
  color: rgba(255, 255, 255, 0.808);
  font-size: 11px; 
  font-weight: bold;
  padding: 2px 9px; 
  border-radius: 35px;
  margin-bottom: 5px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.user-icon {
  width: 15px;
  height: 15px;
  vertical-align: middle;
  border-radius: 50%;
  margin-left: -3px;
  position: center;
  margin-right: -1px;
  margin-bottom: 1.5px;
}

.message_content {
  font-weight: normal;
  font-size: 15px;
  width: auto; 
  max-width: 100%;
  margin: 2px;
  color: rgba(255, 255, 255, 0.877);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/*1340px media*/

@media (max-width: 1340px) {
  #title {
    font-size: 55px;
  }

  #title_container {
    width: 100%;
    height: auto;
    padding: 20px 0px;
    margin-top: -5px;
  }

  #join_input {
    width: 100%;
  }

  #join_button {
    width: 100%;
    align-items: center;
  }

  #chat_container {
    margin-top: 10px;
    height: auto;
  }

  #chat_content_container {
    width: 100%;
    height: calc(90vh - 270px) !important;   
    padding-top: 8px;
    margin-top: -6px;
    padding-bottom: 6px;
  }

  #chat_input {
    width: 75%;
  }

  #chat_logout_container {
    bottom: 10px;
    width: 100%;
    margin-top: 40px;
  }

  } 

  #chat_input_send {
    width: 60px;
    transform: translateY(-1%) translateX(11%);
    height: 40px;
  }

  .message_user {
    font-size: 16px;
  }

  #chat_input_container {
    transform: translateY(12%);
    margin-top: -2px;
  }

  .message_content {
    font-size: 14px;
  }

  .loader {
    width: 30px;
    height: 30px;
  }
  
/*480px media*/

@media (max-width: 480px) {

  #title {
    font-size: 32px;
  }
  
  #title_container {
    width: 100%;
    height: 70px;
    padding: 20px 0px;
    margin-top: -8px;
  }

  #join_input {
    width: 100%;
  }

  #join_button {
    width: 100%;
  }

  #chat_container {
    height: 450px;
  }
  
  #chat_content_container {
    width: 100%;
    height: calc(100vh - 290px) !important; 
    padding-top: 8px;
    margin-top: -4px;
    top: -5px;
    padding-bottom: 6px;
  }

  #chat_input_container {
    transform: translateY(12%);
    margin-top: -1%;
  }

  #chat_logout_container {
  bottom: 5px;
  width: 100%;
  margin-top: 20px;
  }

  #chat_logout {
    font-size: 14px;  
  }

      
  #chat_inner_container {
    width: 100%;
  }

  #chat_input {
    width: 100%;
  }

  #chat_input_send {
    width: 60px;
    transform: translateY(-1%) translateX(15%);
    height: 40px;
    margin-right: 5px;
    margin-left: -1px;
  }

  .message_user {
    font-size: 15px;
  }

  .message_content {
    font-size: 14px;
    margin-bottom: 2px;
  }

  .loader {
    width: 25px;
    height: 25px;
  }
  }