body {
  display: flex;
  flex-direction: row; /* Arranges items horizontally */
  flex-wrap: wrap; /* Allows items to wrap to a new line */
  justify-content: center; /* Centers items horizontally within the container */
  align-items: center; /* Centers rows vertically (if body height is larger than content) */
  min-height: 100vh; /* Ensures body takes full viewport height */
  margin: 0; /* Removes default browser margins */
  background-color: #1c1c33;
  overflow-x: hidden;
  color: white;
}

.header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 10px 0;
  box-sizing: border-box;
  align-self: flex-start;
  position: fixed;
  z-index: 9999999;
}

.auth-page {
  width: min(440px, 90vw);
  margin: 80px auto 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.auth-card {
  width: 100%;
  background: #2a2a4a;
  border-radius: 24px;
  padding: 28px 24px;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.auth-card h1,
.auth-card h2,
.auth-card p {
  margin-top: 0;
  color: white;
  text-align: center;
  display: block;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  width: 100%;
  background: #1e1e38;
  color: white;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  box-sizing: border-box;
  outline: none;
  border: none;
  transition: all 0.25s ease;
}

.auth-input:focus {
  box-shadow: 0 0 0 2px #5a5aff;
}

.auth-submit {
  margin-top: 6px;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: #3a3a62;
  color: white;
  padding: 12px 16px;
  font-size: 16px;
  cursor: pointer;
  font-family: "Varela Round", sans-serif;
  transition: all 0.25s ease;
}

.auth-submit:hover {
  box-shadow: 0 0 0 2px #5a5aff;
}

.auth-message {
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  font-family: "Varela Round", sans-serif;
  line-height: 1.3;
  margin: 0;
}

.auth-message.error {
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 80, 80, 0.35);
  color: #ffcaca;
}

.auth-message.success {
  background: rgba(20, 173, 118, 0.12);
  border: 1px solid rgba(20, 173, 118, 0.4);
  color: #d6ffe8;
}

.chat-layout {
  width: 90vw;
  height: 90vh;
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.chat-container {
  flex: 1;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.chat-header {
  text-align: center;
  margin: 10px;
}

.chat-sidebar {
  width: 180px;
  background: #2a2a4a;
  border-radius: 14px;
  padding: 16px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
}

.chat-sidebar:hover {
  box-shadow: 0 0 0 2px #5a5aff;
}

.chat-sidebar-header {
  font-size: 18px;
  color: white;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
}

.chat-user-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-user-item,
.chat-user-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dfe5ff;
  font-size: 14px;
  word-break: break-word;
}

.chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  background: #2a2a4a;
  border: none;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.chat-message-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 10px 12px;
  transition: all 0.25s ease;
}

.chat-message-item:hover {
  box-shadow: 0 0 0 2px #5a5aff;
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #dfe5ff;
  font-size: 12px;
  margin-bottom: 6px;
}

.chat-message-text {
  color: white;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.chat-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-form .auth-input {
  background: #2a2a4a;
  flex: 1;
  outline: none;
}

.chat-form .auth-submit {
  margin-top: 0;
  width: auto;
  min-width: 100px;
}

#logo {
  width: 5%;
  height: auto;
  image-rendering: pixelated;
  transition: all 0.3s ease;
}

#logo:hover {
  width: 6%;
}

.varela-round-regular {
  font-family: "Varela Round", sans-serif;
  font-weight: 400;
  font-style: normal;
  display: inline;
}

.link-wrap {
  all: unset; /* removes all default <a> styles */
  cursor: pointer; /* optional, still shows it's clickable */
  display: contents; /* makes the <a> not affect layout */
}

.image-container {
  position: relative;
  width: 150px; /* size of square */
  height: 150px;
  overflow: hidden;
  cursor: pointer;
  padding: 5px;
  transition:
    all 0.3s ease,
    width 0s linear 0.3s,
    padding 0s linear 0.3s,
    height 0s linear 0.3s; /* delay width and padding changes when hiding */
}

.image-container:hover {
  transform: scale(1.25);
  z-index: 10;
}

.image-container.hidden {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  width: 0px;
  padding: 0px;
  height: 0px;
}

.image-container img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  transition: 0.3s ease;
  border-radius: 25px;
}

.overlay-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 24px;
  text-align: center;
  opacity: 0;
  transition: 0.3s ease;
  font-family: "Varela Round", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.image-container:hover img {
  filter: brightness(50%);
}

.image-container:hover .overlay-text {
  opacity: 1;
}

.break {
  flex-basis: 100%;
  height: 0;
}

#games-search {
  background-color: #2a2a4a;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 12px 18px;
  font-size: 16px;
  font-family: "Varela Round", sans-serif;
  outline: none;
  width: 260px;
  transition: all 0.25s ease;
}

#games-search:focus {
  box-shadow: 0 0 0 2px #5a5aff;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.footer-separator {
  color: white;
  user-select: none;
}

.hide-in-search {
  transition: none;
}
.hide-in-search.hidden {
  opacity: 0;
  pointer-events: none;
  width: 0px;
  padding: 0px;
  height: 0px;
  flex-basis: 0%;
  transition:
    all 0.3s ease,
    width 0s linear 0.3s,
    padding 0s linear 0.3s,
    height 0s linear 0.3s,
    flex-basis 0s linear 0.3s,
    flex-basis 0s linear 0.3s; /* delay width and padding changes when hiding */
}
