* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }
html, body { height: 100%; }

body{
  font-family: Arial, sans-serif;
  background: #000;
  color: #fff;
}

/* ✅ Keep footer at bottom always */
.page{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ✅ More headspace from top (requested) */
.chat-shell{
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;     /* ✅ headspace */
  padding-bottom: 28px;
}

/* ✅ also add a little top margin so chatbox isn't glued to header */
.chat-container{
  width: min(900px, 92vw);
  margin: 14px auto 0;   /* ✅ headspace */
  position: relative;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ✅ Side controls (icon + text always aligned) */
.side-control{
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-btn{
  background: #FFD700;
  border: none;
  color: #000;
  font-size: 28px;
  cursor: pointer;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.button-text{
  font-size: 12px;
  color: #fff;
  opacity: 0.9;
  text-align: center;
  line-height: 1.1;
}

/* Chat box */
.chat-box{
  background-color: #1A1A1A;
  border-radius: 20px;
  padding: 14px;
  height: min(70vh, 560px);
  min-height: 440px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  border: 4px solid #444;
  position: relative;
  overflow: hidden;
}

/* Toast */
.toast{
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  font-weight: 800;
  font-size: 14px;
  color: #eaeaea;
}

/* ✅ Top-right actions */
.top-actions{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 65;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.mini-action{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(20,20,20,0.85);
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
}
.mini-action:hover{ background: rgba(35,35,35,0.95); }

/* ✅ Modal (injected by JS) */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
  pointer-events: auto;
}
.modal-backdrop.show{ display:flex; }

.modal{
  width: min(460px, 92vw);
  background: #121212;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 16px 60px rgba(0,0,0,0.55);
  overflow: hidden;
}

.modal-head{
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.modal h3{
  font-size: 18px;
  margin: 0;
  letter-spacing: 0.2px;
}

.modal-body{ padding: 14px; }

.modal p{
  color: #e4e4e4;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.support-lead{
  font-size: 14.5px;
  font-weight: 900;
  margin-bottom: 8px;
  color: #fff;
}

.support-text{ opacity: 0.96; }

.support-donate{
  display: block;
  margin: 12px 0 10px;
  text-align: center;
  font-weight: 900;
  text-decoration: none;
  background: rgba(255,215,0,0.12);
  border: 1px solid rgba(255,215,0,0.35);
  color: #FFD700;
  padding: 10px 12px;
  border-radius: 14px;
}
.support-donate:hover{ background: rgba(255,215,0,0.18); }

.support-actions{
  display:flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 10px;
}

.modal .reasons{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.modal .reason{
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  color: #eee;
  font-size: 13px;
}
.modal .reason.selected{ outline: 2px solid #FFD700; }

.modal textarea{
  width: 100%;
  min-height: 70px;
  resize: none;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #1a1a1a;
  color: #eee;
  padding: 10px;
  outline: none;
  margin-bottom: 10px;
}

.modal .actions{
  display:flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal .btn{
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
}

.modal .btn.cancel{ background: #2a2a2a; color: #eee; }
.modal .btn.danger{ background: #ff5252; color: #000; }
.modal .btn.submit{ background: #FFD700; color: #000; }
.modal .btn.loading{ opacity: 0.72; cursor: wait; }

/* ✅ Warning visual (red exclamation) */
.warn-wrap{ display:flex; align-items:flex-start; gap: 10px; }
.warn-icon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 70, 70, 0.16);
  border: 2px solid rgba(255, 70, 70, 0.55);
  display:flex;
  align-items:center;
  justify-content:center;
  color: #ff5c5c;
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  flex: 0 0 auto;
}
.warn-text{
  margin: 0;
  padding-top: 3px;
  font-size: 13.5px;
  color: #e7e7e7;
  line-height: 1.45;
}

/* Messages */
.messages-container{
  flex: 1;
  overflow-y: auto;
  padding: 58px 10px 12px; /* header room */
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

/* sleek dark scrollbar */
.messages-container::-webkit-scrollbar { width: 10px; }
.messages-container::-webkit-scrollbar-track { background: #101010; border-radius: 10px; }
.messages-container::-webkit-scrollbar-thumb { background: #2b2b2b; border-radius: 10px; border: 2px solid #101010; }
.messages-container::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }
.messages-container { scrollbar-color: #2b2b2b #101010; scrollbar-width: thin; }

#messages{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ✅ Bubbles */
.message{
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 18px;
  word-wrap: break-word;
  position: relative;
}

.message.left{
  background: #333;
  align-self: flex-start;
  margin-right: 36px;  /* ✅ closer dots */
}
.message.right{
  background: #4CAF50;
  align-self: flex-end;
  color: #fff;
}

.msg-label{
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 4px;
  font-weight: 800;
}

.typing-indicator{
  font-size: 12px;
  color: #bbb;
  padding: 6px 2px;
}

/* Input */
.chat-input{
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
  z-index: 3;
}

.chat-input input{
  flex: 1;
  padding: 10px 12px;
  border-radius: 20px;
  border: none;
  background: #333;
  color: #fff;
  outline: none;
  font-size: 16px; /* iOS zoom fix */
}

#sendBtn, .emoji-btn{
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
}
#sendBtn{ background: #4CAF50; color: #fff; }
.emoji-btn{ background: #2f2f2f; color: #fff; }
.emoji-btn:hover{ background:#3a3a3a; }

/* ✅ Speech-to-text button */
.speech-btn{
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.speech-btn:hover{ background: rgba(255,255,255,0.12); }
.speech-btn.active{
  background: rgba(255,215,0,0.28);
  outline: 2px solid rgba(255,215,0,0.45);
  color: #FFD700;
}

/* Emoji panel */
.emoji-panel{
  position: absolute;
  bottom: 72px;
  right: 16px;
  z-index: 70;
  background: #111;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  width: 280px;
  max-height: 220px;
  overflow-y: auto;
}
.emoji-panel::-webkit-scrollbar { width: 10px; }
.emoji-panel::-webkit-scrollbar-track { background: #0e0e0e; border-radius: 10px; }
.emoji-panel::-webkit-scrollbar-thumb { background: #2b2b2b; border-radius: 10px; border: 2px solid #0e0e0e; }
.emoji-panel::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }
.emoji-panel { scrollbar-color: #2b2b2b #0e0e0e; scrollbar-width: thin; }

.emoji-panel button{
  background: #1c1c1c;
  border: none;
  border-radius: 10px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 18px;
}
.emoji-panel button:hover{ background:#2a2a2a; }

/* Center logo watermark */
.logo{
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  opacity: 0.45;
  z-index: 1;
  pointer-events: none;
}
.logo img{
  width: min(115px, 24vw);
  height: auto;
}

/* Overlay */
.chat-overlay{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.60);
  border-radius: 20px;
  font-weight: 900;
  font-size: 18px;
  color: #ddd;
  z-index: 55;
  text-align: center;
  padding: 18px;
  pointer-events: none;
}
.chat-overlay.show{ display:flex; pointer-events: none; }

/* Spin animation for Next */
@keyframes vocaSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin{ animation: vocaSpin 0.75s linear infinite; }

/* Respect note */
.respect-note{
  width: min(900px, 92vw);
  margin: 10px auto 18px;
  text-align: center;
  font-size: 10px;
  color: #9a9a9a;
  line-height: 1.25;
  padding: 0 8px;
}
.respect-note a{
  color: #bdbdbd;
  text-decoration: underline;
}
.respect-note a:hover{ color: #fff; }

/* Footer */
.chat-footer{
  margin-top: auto;
  text-align: center;
  color: #bdbdbd;
  font-size: 12px;
  padding: 6px 10px;
  border-top: none;
  background: rgba(255,255,255,0.03);
}
.chat-footer a{
  color: #d9d9d9;
  text-decoration: none;
  margin: 0 6px;
}
.chat-footer a:hover{ color:#fff; }

/* Mini toast */
.mini-toast{
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.82);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  z-index: 9999;
}

/* ✅ 3 dots VERY CLOSE but outside bubble */
.msg-more{
  position: absolute;
  top: 10px;
  right: -32px;      /* ✅ closer */
  width: 28px;       /* slightly smaller */
  height: 28px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.40);
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
}
.msg-more:hover{ background: rgba(0,0,0,0.58); }

/* Reaction badge */
.reaction-badge{
  position: absolute;
  right: 10px;
  bottom: 8px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}
.reaction-badge.hidden{ display:none; }

/* Tooltip like: "You reacted 🙂" / "Mellow Turtle reacted 😂" */
.msg-react-tooltip{
  position: absolute;
  left: 12px;
  top: -34px;
  background: rgba(0,0,0,0.85);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 6px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(0,0,0,0.55);
  z-index: 20;
  pointer-events: none;
}

/* sleek small action menu */
.msg-action-menu{
  position: fixed;
  z-index: 99999;
  width: 196px;
  background: rgba(16,16,16,0.96);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 18px 55px rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}
.mam-react{
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.mam-emo{
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
  font-size: 16px;
}
.mam-emo:hover{ background: rgba(255,255,255,0.10); }
.mam-reply{
  width: 100%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-weight: 900;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
}
.mam-reply:hover{ background: rgba(255,255,255,0.10); }

/* sleek small reply box */
.floating-reply{
  position: fixed;
  z-index: 99999;
  width: min(340px, 92vw);
  background: rgba(16,16,16,0.96);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 18px 55px rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}
.fr-head{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 8px;
  margin-bottom: 6px;
}
.fr-title{
  font-size: 12px;
  font-weight: 900;
  opacity: 0.95;
}
.fr-close{
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.fr-close:hover{ background: rgba(255,255,255,0.10); }

.fr-row{
  display:flex;
  gap: 6px;
  align-items:center;
}
.fr-input{
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: #fff;
  padding: 9px 10px;
  outline: none;
  font-size: 13px;
}
.fr-send{
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  background: #FFD700;
  color: #000;
  display:flex;
  align-items:center;
  justify-content:center;
}
.fr-send:active{ transform: scale(0.98); }

/* jump down arrow */
.jump-down{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 76px;
  z-index: 80;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 14px 40px rgba(0,0,0,0.55);
}
.jump-down:hover{ background: rgba(0,0,0,0.72); }
.jump-down.hidden{ display: none !important; }

/* ✅ Tablet */
@media (max-width: 900px){
  .chat-container{
    flex-direction: column;
    gap: 14px;
    width: min(900px, 96vw);
  }

  .side-control{
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 10px;
    gap: 8px;
  }

  .chat-box{
    order: 1;
    height: 74vh;
    min-height: 440px;
    padding: 14px;
  }

  .message{
    max-width: 90%;
  }

  .message.left{
    margin-right: 34px; /* ✅ closer dots on mobile */
  }
  .msg-more{
    right: -30px; /* ✅ closer */
  }

  .emoji-panel{
    right: 10px;
    bottom: 68px;
    width: 260px;
    max-height: 200px;
  }

  .logo img{
    width: min(100px, 34vw);
  }

  .respect-note{
    font-size: 9.8px;
    margin: 10px auto 16px;
  }

  .msg-action-menu{
    width: min(320px, 92vw);
  }

  .floating-reply{
    width: min(360px, 94vw);
  }
}

/* ✅ Small phones: stop compression */
@media (max-width: 520px){
  .chat-shell{ padding-top: 18px; }
  .chat-container{ margin-top: 10px; padding: 8px 0; }

  .chat-box{
    height: 78vh;
    min-height: 480px;
    border-width: 3px;
    border-radius: 18px;
  }

  .messages-container{
    padding: 56px 10px 12px;
  }

  .message{
    max-width: 94%;
    padding: 11px 12px;
    border-radius: 18px;
    line-height: 1.35;
  }

  .message.left{ margin-right: 32px; }
  .msg-more{
    right: -28px;
    top: 9px;
    width: 28px;
    height: 28px;
  }

  .msg-action-menu{
    width: min(360px, 94vw);
    border-radius: 16px;
  }

  .mam-emo{ width: 30px; height: 30px; font-size: 16px; }

  .floating-reply{
    width: min(380px, 94vw);
  }

  .chat-input{ gap: 8px; }
  .chat-input input{ padding: 11px 12px; }
}
