* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #101014;
  color: #fff;
  font-family: Arial, sans-serif;
}

a {
  color: #f5c542;
  text-decoration: none;
}

.page {
  max-width: 520px;
  margin: auto;
  min-height: 100vh;
  background: #15151c;
}

.hero {
  padding: 45px 22px;
  text-align: center;
  background: linear-gradient(135deg, #111, #292314);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 34px;
}

.hero p {
  color: #ddd;
  line-height: 1.5;
}

.card {
  margin: 18px;
  padding: 20px;
  background: #20202a;
  border-radius: 18px;
}

input,
textarea,
button {
  width: 100%;
  padding: 13px;
  margin: 7px 0;
  border-radius: 12px;
  border: none;
  font-size: 15px;
}

input,
textarea {
  background: #2c2c36;
  color: #fff;
}

button,
.btn {
  display: block;
  background: #f5c542;
  color: #111;
  font-weight: 700;
  text-align: center;
  padding: 13px;
  border-radius: 12px;
  margin: 9px 0;
  cursor: pointer;
}

.btn.dark {
  background: #2c2c36;
  color: #fff;
}

.alert {
  background: #421f1f;
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.success {
  background: #1f4228;
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.topbar {
  background: #0d0d12;
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.admin-badge {
  background: #f5c542;
  color: #111;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
}

/* ROOM SLIDER */

.tabs {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 10px;
  background: #111;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
  scrollbar-width: thin;
}

.tabs::-webkit-scrollbar {
  height: 6px;
}

.tabs::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 10px;
}

.tabs button {
  flex: 0 0 auto;
  width: 130px;
  height: 60px;
  background: #2c2c36;
  color: #fff;
  margin: 0;
  border-radius: 10px;
  text-align: left;
  padding: 8px 12px;
}

.tabs button.active {
  background: #f5c542;
  color: #111;
}

.room-name {
  font-size: 17px;
  font-weight: bold;
  line-height: 1.1;
}

.room-type {
  font-size: 13px;
  opacity: .8;
  margin-top: 4px;
}

/* CHAT */

.chatbox {
  height: calc(100vh - 225px);
  overflow-y: auto;
  padding: 12px;
}

.msg {
  background: #24242e;
  padding: 11px;
  margin-bottom: 10px;
  border-radius: 14px;
}

.msg .name {
  color: #f5c542;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 5px;
}

.msg .text {
  font-size: 16px;
  line-height: 1.4;
}

.msg img {
  max-width: 100%;
  border-radius: 12px;
  margin-top: 8px;
  display: block;
}

.deleted {
  color: #aaa;
  font-style: italic;
}

.admin-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 8px;
}

.admin-tools button {
  font-size: 14px;
  padding: 8px 4px;
  margin: 0;

    
  font-weight: bold;  
   font-family: Arial, sans-serif; 
    
}

.sendbar {
  padding: 10px;
  background: #111;
  position: sticky;
  bottom: 0;
}







.message-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.chat-avatar {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  color: #f5c542;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
}

.avatar-link {
  display: inline-flex;
}

.message-head .name {
  color: #f5c542;
  font-size: 14px;
  font-weight: bold;
}

.profile-card {
  text-align: center;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 50%;
  background: #333;
  color: #f5c542;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: bold;
  margin-bottom: 10px;
}

.profile-bio {
  color: #ddd;
  line-height: 1.5;
}

.small-text {
  color: #999;
  font-size: 13px;
}



.danger-btn {
  background: #8f2a2a;
  color: #fff;
}










.blocked-user {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #24242e;
  padding: 10px;
  border-radius: 14px;
  margin-bottom: 10px;
}

.blocked-avatar {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  color: #f5c542;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.blocked-info {
  flex: 1;
}

.blocked-name {
  display: block;
  color: #f5c542;
  font-weight: bold;
  margin-bottom: 6px;
}

.blocked-info button {
  padding: 8px;
  margin: 0;
}























.pm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #24242e;
  padding: 11px;
  border-radius: 14px;
  margin-bottom: 10px;
  color: #fff;
}

.pm-avatar {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  border-radius: 50%;
  object-fit: cover;
}

.pm-info {
  flex: 1;
}

.pm-name {
  font-weight: bold;
  color: #f5c542;
}

.pm-time {
  color: #aaa;
  font-size: 12px;
  margin-top: 3px;
}

.pm-badge {
  background: #f5c542;
  color: #111;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
}

.pm-page {
  min-height: 100vh;
}

.pm-chatbox {
  height: calc(100vh - 165px);
  overflow-y: auto;
  padding: 12px;
}

.pm-message {
  margin-bottom: 12px;
  max-width: 85%;
}

.pm-message.mine {
  margin-left: auto;
  text-align: right;
}

.pm-message.theirs {
  margin-right: auto;
  text-align: left;
}

.pm-bubble {
  display: inline-block;
  background: #24242e;
  padding: 10px 12px;
  border-radius: 14px;
  color: #fff;
  text-align: left;
}

.pm-message.mine .pm-bubble {
  background: #f5c542;
  color: #111;
}

.pm-date {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.pm-sendbar {
  padding: 10px;
  background: #111;
  position: sticky;
  bottom: 0;
}















.pm-delete-form {
  margin-top: 4px;
}

.pm-delete-btn {
  width: auto;
  padding: 4px 8px;
  margin: 0;
  font-size: 11px;
  border-radius: 8px;
  background: #333;
  color: #aaa;
}

.pm-delete-btn:hover {
  background: #8f2a2a;
  color: #fff;
}
















.pm-sender {
  font-size: 12px;
  color: #f5c542;
  font-weight: bold;
  margin-bottom: 4px;
}

.pm-message.mine .pm-sender {
  text-align: right;
}

.pm-message.theirs .pm-sender {
  text-align: left;
}



















.pm-delete-form {
  margin-top: 4px;
}

.pm-message.mine .pm-delete-form {
  text-align: right;
}

.pm-message.theirs .pm-delete-form {
  text-align: left;
}

.pm-delete-btn {
  width: auto;
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
}


































.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 15px;
}

.gallery-item {
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.gallery-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.gallery-delete {
  width: 100%;
  border-radius: 0;
  margin: 0;
  padding: 7px;
  font-size: 12px;
  background: #8f2a2a;
  color: #fff;
}

@media(max-width:600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item img {
    height: 150px;
  }
}















.gallery-count{
    background:#111;
    color:#f5c542;
    text-align:center;
    padding:10px;
    border-radius:12px;
    margin-bottom:10px;
    font-size:14px;
}



















.emoji-wrap {
  position: relative;
  margin-bottom: 6px;
}

.emoji-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  font-size: 20px;
  background: #2c2c36;
  color: #fff;
}

.emoji-picker {
  display: none;
  position: absolute;
  bottom: 48px;
  left: 0;
  background: #111;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 10px;
  width: 220px;
  z-index: 9999;
  box-shadow: 0 8px 25px rgba(0,0,0,.45);
}

.emoji-picker span {
  display: inline-block;
  font-size: 22px;
  padding: 6px;
  cursor: pointer;
}

.emoji-picker span:hover {
  transform: scale(1.2);
}










.user-search-row {
  display: flex;
  gap: 10px;
  background: #24242e;
  padding: 10px;
  border-radius: 14px;
  margin-bottom: 10px;
  align-items: center;
}

.user-search-avatar {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  max-width: 46px !important;
  max-height: 46px !important;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  color: #f5c542;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-search-info {
  flex: 1;
}

.user-search-name {
  color: #f5c542;
  font-weight: bold;
  font-size: 15px;
}

.user-search-bio {
  color: #aaa;
  font-size: 12px;
  margin: 3px 0;
}

.user-search-links a {
  color: #f5c542;
  font-size: 13px;
  text-decoration: none;
}

.user-search-links span {
  color: #555;
  margin: 0 5px;
}























.topbar{
    background:#0d0d12;
    padding:10px;
}

.topbar-user{
    text-align:center;
    margin-bottom:8px;
    font-size:13px;
    color:#ddd;
}

.topbar-menu{
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
    gap:10px;
}

.topbar-menu a{
    color:#f5c542;
    text-decoration:none;
    font-size:15px;
}





















html,
body {
  height: 100%;
}

/* Only lock scrolling on the chat page */
body:has(.chat-page) {
  overflow: hidden;
}

.chat-page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar,
.tabs,
.sendbar {
  flex-shrink: 0;
}

.chatbox {
  flex: 1;
  height: auto !important;
  overflow-y: auto;
  padding: 12px !important;
  -webkit-overflow-scrolling: touch;
}

.sendbar {
  background: #111;
  padding: 10px;
  position: relative;
  bottom: auto;
}












.photo-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;

  background: rgba(0,0,0,.92);

  justify-content: center;
  align-items: center;

  padding: 20px;
}

.photo-modal img {
  max-width: 95%;
  max-height: 90vh;
  border-radius: 12px;
}

.photo-close {
  position: absolute;
  top: 15px;
  right: 20px;

  font-size: 32px;
  color: #fff;
  cursor: pointer;

  z-index: 100000;
}
















