body {
  background-color: black;
  color: white;
  font-family: 'IBM Plex Mono', monospace;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.contract-address {
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  cursor: pointer;
}

.contract-address #contract-text {
  color: white;
  text-decoration: none;
}

.contract-address #copy-status {
  color: #fff;
  margin-top: 5px;
}

h1 {
  text-align: center;
  font-size: 24px;
  border: 2px dashed white;
  padding: 12px;
  width: fit-content;
  margin: 0 auto 20px;
}

#login-screen {
  text-align: center;
  max-width: 400px;
  margin: 50px auto;
  position: relative;
}

#login-screen .button-group {
  text-align: center;
}

#display-name {
  background-color: black;
  color: white;
  border: 2px dashed white;
  padding: 15px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 20px;
  margin-bottom: 15px;
  autocomplete: "off";
  autocorrect: "off";
  autocapitalize: "off";
  spellcheck: "false";
  readonly: on;
}

#display-name:focus {
  readonly: off;
}

#username-error {
  font-size: 16px;
  margin-bottom: 15px;
}

button {
  background-color: black;
  color: white;
  border: 2px dashed white;
  padding: 12px 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  cursor: pointer;
  display: inline-block;
  margin: 10px auto;
}

button:hover {
  background-color: white;
  color: black;
}

button:disabled {
  background-color: #333;
  color: #666;
  cursor: not-allowed;
}

#container {
  display: flex;
  height: auto;
  min-height: calc(50vh - 120px);
  max-height: calc(75vh - 120px);
  border: 2px dashed white;
  box-sizing: border-box;
  margin: 35px;
}

#toggle-users {
  display: none;
  position: absolute;
  padding: 10px;
  font-size: 18px;
}

#user-list {
  width: 15%;
  border-right: 2px dashed white;
  padding: 10px;
  overflow-y: auto;
  box-sizing: border-box;
  text-align: left;
  max-height: calc(75vh - 120px);
}

#user-list h3 {
  margin: 0 0 10px 0;
  text-align: left;
}

.user-item {
  margin: 5px 0;
  font-size: 14px;
}

.user-item.role-dev {
  color: gold;
}

.user-item.role-admin {
  color: #39ff14; /* Neon green */
}

.user-item.role-user {
  color: white;
}

#chat-area {
  width: 85%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

#messages {
  flex-grow: 1;
  padding: 10px;
  overflow-y: auto;
  border-bottom: 2px dashed white;
  box-sizing: border-box;
  min-height: 100px;
}

#input-area {
  display: flex;
  padding: 10px;
  box-sizing: border-box;
}

#message-input {
  flex-grow: 1;
  background-color: black;
  color: white;
  padding: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  resize: none;
  box-sizing: border-box;
}

.message {
  margin: 5px 0;
  word-wrap: break-word;
  padding: 5px;
}

/* Alternating backgrounds */
#messages .message:nth-child(odd) {
  background-color: #1c1c1c; /* Subtle dark grey */
}

#messages .message:nth-child(even) {
  background-color: black;
}

.message strong {
  font-weight: bold;
}

.role-dev strong, .role-dev {
  color: gold !important;
}

.role-admin strong {
  color: #39ff14 !important; /* Neon green for admin usernames */
}

.role-admin {
  color: white !important; /* White for admin message text */
}

.role-user strong, .role-user {
  color: white !important;
}

.role-system strong {
  color: #ff5555 !important;
}

.shake-on-click {
  cursor: pointer;
  transition: transform 0.1s;
}

.shake-on-click:active {
  animation: shake 0.5s;
  animation-iteration-count: 1;
}

@keyframes shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(5px, 0); }
  50% { transform: translate(-5px, 0); }
  75% { transform: translate(5px, 0); }
  100% { transform: translate(0, 0); }
}

label {
  display: block;
  margin: 10px 0;
  font-size: 14px;
  color: #ccc;
  text-align: center;
}

#disclaimer-checkbox {
  margin-right: 5px;
  vertical-align: middle;
}

@media (max-width: 992px) {
  body {
    padding: 0;
  }

  #container {
    flex-direction: column;
    position: relative;
    height: calc(65vh - 100px) !important;
    width: calc(100vw - 50px);
    overflow-y: auto;
    margin: 25px !important;
  }

  #toggle-users {
    display: block !important;
    bottom: 5px;
    left: 15px;
    z-index: 1001;
    padding: 12px;
    font-size: 18px;
    vertical-align: middle;
  }

  #user-list {
    display: none !important;
    position: absolute;
    bottom: 50px;
    left: 15px;
    width: 200px;
    max-height: 200px;
    background-color: black;
    border: 2px dashed white;
    z-index: 1000;
    padding: 10px;
    overflow-y: auto;
    text-align: left;
  }

  #user-list.show {
    display: block !important;
  }

  #chat-area {
    width: 100%;
    height: calc(85vh - 100px) !important;
    overflow-y: auto;
    position: relative;
  }

  #messages {
    flex-grow: 1;
    padding: 10px;
  }

  #input-area {
    flex-direction: column;
    padding: 5px 0;
    position: sticky;
    bottom: 0;
    z-index: 1;
    align-items: flex-end;
  }

  #message-input {
    min-height: 50px;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.4em;
    width: 100%;
    font-size: 16px;
  }

  #input-area button {
    margin-top: 10px;
    padding: 12px 20px;
    width: fit-content;
    align-self: flex-end;
    font-size: 18px;
  }

  #login-screen .logo img {
    display: block;
    margin: 0 0 0 125px;
    max-width: 300px;
    max-height: 250px;
    filter: brightness(3);
  }

  #login-screen .icons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
  }

  #login-screen .icons img {
    max-width: 30px;
    max-height: 30px;
    filter: brightness(3);
  }

  #chat-screen {
    display: none;
  }

  #chat-screen .header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1002;
    padding: 0 20px;
  }

  #chat-screen .header .logo img {
    display: block;
    margin: 0;
    max-width: 150px;
    max-height: 125px;
    filter: brightness(3);
  }

  #chat-screen .header .icons {
    display: flex;
    gap: 25px;
    flex-wrap: nowrap;
    margin: 0;
  }

  #chat-screen .header .icons img {
    max-width: 30px;
    max-height: 30px;
    filter: brightness(3);
  }

  .icons a {
    display: inline-block;
  }

  .icons a:hover img {
    filter: brightness(3) drop-shadow(0 0 10px white) drop-shadow(0 0 5px white);
    transition: filter 0.3s ease;
  }
}

@media (min-width: 993px) {
  #toggle-users {
    display: none !important;
  }

  #user-list {
    width: 15%;
    border-right: 2px dashed white;
    padding: 10px;
    overflow-y: auto;
    box-sizing: border-box;
    max-height: calc(75vh - 120px);
    text-align: left;
  }

  #chat-area {
    width: 85%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-height: calc(75vh - 120px);
  }

  #messages {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    border-bottom: 2px dashed white;
    box-sizing: border-box;
    min-height: 20vh;
  }

  #input-area {
    display: flex;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    bottom: 0;
  }

  #message-input {
    min-height: 40px;
    max-height: 60px;
  }

  #login-screen .logo img {
    max-width: 300px;
    max-height: 250px;
    filter: brightness(3);
    margin: 0 0 0 100px;
  }

  #login-screen .icons {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: nowrap;
  }

  #login-screen .icons img {
    max-width: 50px;
    max-height: 50px;
    filter: brightness(3);
  }

  #chat-screen {
    display: none;
  }

  #chat-screen .header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1002;
    padding: 0 20px;
  }

  #chat-screen .header .logo img {
    display: block;
    margin: 0;
    max-width: 300px;
    max-height: 250px;
    filter: brightness(3);
  }

  #chat-screen .header .icons {
    display: flex;
    gap: 25px;
    flex-wrap: nowrap;
    margin: 0;
  }

  #chat-screen .header .icons img {
    max-width: 45px;
    max-height: 45px;
    filter: brightness(3);
  }

  #container {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }

  .icons a {
    display: inline-block;
  }

  .icons a:hover img {
    filter: brightness(3) drop-shadow(0 0 10px white) drop-shadow(0 0 5px white);
    transition: filter 0.3s ease;
  }
}