body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  background: linear-gradient(to bottom, #f0f0f0, #b08ee7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;  /* <-- centers vertically */
  min-height: 100vh;
}

/* Wrapper so h1 stays just above input */
.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px; /* spacing between h1 and input */
}

h1 {
  font-size: 2rem;
  text-align: center;
  color: #0a11d6;
  font-weight: 700;
  /* border-bottom: 3px solid #EF391D; */
  padding-bottom: 5px;
  margin: 0;
}

#textInput {
  width: 90%;
  max-width: 400px;
  padding: 12px;
  font-size: 1rem;
  border: 2px solid #121451;
  border-radius: 10px;
  outline: none;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
}

/* Falling letters */
.letter {
  position: fixed;
  top: 0;
  animation: fall 3s linear forwards;
  pointer-events: none;
  user-select: none;
}
@keyframes fall {
  to { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Chat Sidebar */
#chatSidebar {
  position: fixed;
  right: -100%;
  top: 0;
  height: 100%;
  width: 70%;
  max-width: 350px;
  background: #c191f8;
  box-shadow: -2px 0 8px rgb(119, 7, 247);
  transition: right 0.3s ease;
  z-index: 998;
  display: flex;
  flex-direction: column;
}
#chatSidebar.open { right: 0; }

#messageBox {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}
.msg {
  background: #f7f7f7;
  padding: 8px 12px;
  margin: 6px 0;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.4;
}
.time {
  display: block;
  font-size: 0.7rem;
  color: #888;
  margin-top: 4px;
}

#clearBtn {
  border: none;
  background: #4306cf;
  color: #fff;
  font-size: 1rem;
  padding: 10px;
  cursor: pointer;
  border-radius: 0;
}
#clearBtn:hover { background: #8a39e6; }

/* Floating toggle button */
#toggleChatBtn {
  position: fixed;
  bottom: 15px;
  right: 15px;
  background: #914dff;
  border: none;
  border-radius: 50%;
  padding: 14px 16px;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 10px rgba(164, 101, 245, 0.829);
}

#rotatePopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 15px 25px;
  border-radius: 10px;
  font-size: 16px;
  display: none; /* hidden by default */
  z-index: 1000;
  text-align: center;
}

.hidden { display: none; }
.noScroll { overflow: hidden; }
