html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  font-family: Inter, Arial, sans-serif;
}

#budoChat {
  width: 360px;
  height: 620px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: rgba(2, 8, 22, .22);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(80, 180, 255, .35);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 35px rgba(0, 120, 255, .35);
}

.chat-header {
  padding: 14px;
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,.42);
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.chat-header strong {
  font-size: 17px;
}

.chat-header span {
  display: block;
  font-size: 12px;
  opacity: .75;
}

#status {
  font-size: 12px;
  color: #3cff9e;
}

.login-box {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: rgba(0,0,0,.25);
}

input {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 11px;
  outline: none;
  background: rgba(255,255,255,.92);
  color: #111;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  background: #1e9bff;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

#messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-size: 14px;
}

.chat-row {
  display: flex;
  gap: 9px;
  margin-bottom: 12px;
  animation: popIn .18s ease-out;
}

.avatar {
  width: 31px;
  height: 31px;
  min-width: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #1e9bff, #8a5cff);
  box-shadow: 0 0 14px rgba(30,155,255,.45);
}

.bubble {
  max-width: 270px;
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255,255,255,.08);
}

.nick {
  display: block;
  font-weight: 800;
  margin-bottom: 3px;
  font-size: 13px;
}

.text {
  line-height: 1.35;
  color: rgba(255,255,255,.96);
  word-break: break-word;
}

.system {
  color: #ffd166;
  font-size: 12px;
  margin: 7px 0 10px;
  opacity: .9;
}

#chatForm {
  display: none;
  gap: 8px;
  padding: 10px;
  background: rgba(0,0,0,.42);
  border-top: 1px solid rgba(255,255,255,.12);
}

a {
  color: #6ed7ff;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(5px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.channel-select {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 700;
  outline: none;
  max-width: 190px;
}

.channel-select option {
  background: #111827;
  color: #fff;
}

.chat-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-icon {
  font-size: 16px;
  opacity: .95;
}

.channel-select {
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 8px 34px 8px 12px;
  font-size: 14px;
  font-weight: 800;
  outline: none;
  cursor: pointer;
  max-width: 170px;
  background-image:
    linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

.channel-select:hover {
  border-color: rgba(255,255,255,.32);
  background-color: rgba(255,255,255,.08);
}

.channel-select option {
  background: #111;
  color: #fff;
}

.chat-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-icon {
  font-size: 16px;
  opacity: .95;
}

.channel-select {
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 8px 34px 8px 12px;
  font-size: 14px;
  font-weight: 800;
  outline: none;
  cursor: pointer;
  max-width: 180px;
  background-image:
    linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

.channel-select:hover {
  border-color: rgba(255,255,255,.32);
  background-color: rgba(255,255,255,.08);
}

.channel-select option {
  background: #111;
  color: #fff;
}

/* ---------- Chat Layout Fix ---------- */

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.chat {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}

.chat-header {
  flex: 0 0 auto !important;
}

.messages {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
  padding: 12px !important;
}

.login,
#chatForm {
  flex: 0 0 auto !important;
  padding: 12px !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
  background: rgba(10,10,10,.92) !important;
}

#chatForm {
  display: flex;
  gap: 10px;
  align-items: center;
}

#messageInput {
  flex: 1;
  min-width: 0;
}

