/* === RESET & BASE === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #022d50;
  color: #e6edf3;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #e94560; color: #fff; }

/* === AUTH SCREEN === */
#auth-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; height: 100vh; padding: 20px;
  background:
    radial-gradient(circle at 18% 12%, rgba(46, 204, 113, 0.22), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(241, 196, 15, 0.16), transparent 24%),
    linear-gradient(145deg, #011d34 0%, #02345d 48%, #021d35 100%);
  position: relative;
  overflow-y: auto;
}
#auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  pointer-events: none;
}
#auth-box {
  position: relative; z-index: 1;
  width: min(420px, calc(100vw - 32px));
  padding: 34px 32px 30px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(4, 76, 124, 0.96), rgba(2, 45, 80, 0.96));
  box-shadow: 0 24px 70px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
}
.auth-brand-mark {
  width: 58px; height: 58px; margin: 0 auto 12px;
  border-radius: 18px;
  background: linear-gradient(145deg, #2ecc71, #f1c40f);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
  transform: rotate(-6deg);
}
.auth-brand-mark span {
  transform: rotate(6deg);
  color: #06223a; font-weight: 900; letter-spacing: -1px; font-size: 22px;
}
#auth-box h1 {
  text-align: center; color: #fff; margin-bottom: 5px;
  font-size: 28px; letter-spacing: 0.5px; font-weight: 800;
}
.auth-tagline {
  text-align: center; color: rgba(255,255,255,0.68);
  font-size: 12px; line-height: 1.45; margin-bottom: 20px;
}
#auth-box h1::after { display: none; }
#auth-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  margin-bottom: 18px; border-radius: 14px; padding: 4px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.22);
}
#auth-tabs button {
  width: 100%; padding: 10px 8px; border: none; border-radius: 10px;
  background: transparent; color: rgba(255,255,255,0.62); cursor: pointer;
  font-size: 12px; font-weight: 750; transition: all 0.2s ease; letter-spacing: 0.25px;
}
#auth-tabs button:hover { color: #fff; background: rgba(255,255,255,0.08); }
#auth-tabs button.active { background: linear-gradient(145deg, #2ecc71, #21a85a); color: #fff; box-shadow: 0 8px 18px rgba(46,204,113,0.24); }
#auth-box input[type="text"],
#auth-box input[type="password"],
#auth-box input[type="email"],
#auth-box input[type="number"] {
  width: 100%; padding: 13px 14px; margin-bottom: 11px;
  border: 1px solid rgba(255,255,255,0.16); border-radius: 12px;
  background: rgba(1,20,36,0.46); color: #fff; font-size: 13px;
  transition: all 0.2s ease; outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
#auth-box input:focus {
  border-color: rgba(46,204,113,0.75);
  background: rgba(1,20,36,0.68);
  box-shadow: 0 0 0 3px rgba(46,204,113,0.14);
}
#auth-box input::placeholder { color: rgba(255,255,255,0.44); }
#auth-box button:not(.emoticon-tab):not(.admin-tab):not(.social-btn) {
  width: 100%; padding: 13px 14px; border: none; border-radius: 12px;
  background: linear-gradient(145deg, #2ecc71, #22aa5e); color: #fff; font-size: 14px; cursor: pointer;
  font-weight: 800; letter-spacing: 0.35px; transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 12px 24px rgba(46,204,113,0.18);
}
#auth-box button:not(.emoticon-tab):not(.admin-tab):not(.social-btn):hover {
  background: linear-gradient(145deg, #34dc7b, #239f5a);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(46,204,113,0.28);
}
#auth-box button:not(.emoticon-tab):not(.admin-tab):not(.social-btn):active { transform: translateY(0); }
#auth-error { color: #ffb3b3; text-align: center; margin-top: 12px; font-size: 12px; min-height: 16px; }
.auth-hint { text-align: center; color: rgba(255,255,255,0.58); font-size: 11px; margin-top: 12px; line-height: 1.4; }
.auth-link, .auth-hint a { color: #f1c40f; text-decoration: none; font-weight: 700; }
.auth-link:hover, .auth-hint a:hover { text-decoration: underline; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.42); font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  margin: 14px 0;
}
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: rgba(255,255,255,0.13); }
.social-login { margin-top: 0; }
.social-btn {
  width: 100%; padding: 12px 14px !important;
  border-radius: 12px !important;
  background: #fff !important; color: #1f2937 !important;
  font-size: 13px !important; font-weight: 800 !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18) !important;
  display: flex !important; align-items: center; justify-content: center; gap: 10px;
  transition: all 0.2s ease !important; cursor: pointer;
}
.social-btn .fa-google { color: #db4437; font-size: 15px; }
.social-btn:hover { background: #f8fafc !important; transform: translateY(-1px); box-shadow: 0 14px 28px rgba(0,0,0,0.24) !important; }
.social-btn:active { transform: translateY(0); }
.social-btn.is-disabled { opacity: 0.78; cursor: not-allowed; }
/* Legacy quick-login styling kept harmless in case older cached HTML appears. */
.quick-login { display: none !important; }
/* Rules agree */
.rules-agree {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: rgba(255,255,255,0.75);
  margin: -2px 0 12px;
}
.rules-agree input { cursor: pointer; accent-color: #2ecc71; }
.rules-agree a { color: #f1c40f; text-decoration: none; font-weight: 700; }
.rules-agree a:hover { text-decoration: underline; }
@media (max-width: 520px) {
  #auth-screen { justify-content: flex-start; padding-top: 18px; }
  #auth-box, #pre-login-users { width: min(100%, 420px); }
  #auth-box { padding: 26px 20px 24px; border-radius: 20px; }
}

/* === PRE-LOGIN ACTIVE USERS === */
#pre-login-users {
  margin-top: 16px; max-height: 180px; overflow-y: auto;
  background: #034476;
  border: 2px solid #022d50;
  border-radius: 14px; padding: 14px; width: 380px;
  box-shadow: 3px 0 18px rgba(0,0,0,0.25);
}
#pre-login-users h4 {
  color: #fff; font-size: 10px; margin-bottom: 10px;
  text-align: center; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700;
}
#pre-login-users ul { list-style: none; }
#pre-login-users li {
  font-size: 11px; color: rgba(255,255,255,0.7); padding: 5px 8px;
  display: flex; align-items: center; gap: 6px;
  border-radius: 4px; transition: background 0.15s;
}
#pre-login-users li:hover { background: rgba(255,255,255,0.1); }

/* === CHAT LAYOUT === */
#chat-screen { height: 100vh; display: flex; flex-direction: column; background: #ffffee; }
#chat-layout { display: flex; flex: 1; height: 100%; overflow: hidden; background: #022d50; }

/* === LEFT PANEL === */
#left-panel {
  width: 230px; background: #034476;
  display: flex; flex-direction: column; flex-shrink: 0;
  box-shadow: 3px 0 18px rgba(0,0,0,0.25);
  transition: width 0.25s ease;
  position: relative;
  border-radius: 0 14px 14px 0;
  overflow: visible;
}
#left-panel.collapsed { width: 56px; }
#left-panel-toggle {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #022d50; border: 1px solid rgba(255,255,255,0.25);
  color: #fff; font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10; padding: 0; transition: all 0.2s;
}
#left-panel-toggle:hover { background: #034476; border-color: #fff; }
#left-panel.collapsed #left-panel-toggle {
  right: 50%;
  transform: translateX(50%);
}
#left-panel.collapsed #left-panel-toggle i {
  transform: rotate(180deg);
  display: inline-block;
}
#left-panel.collapsed #room-list-box,
#left-panel.collapsed #user-list-box { overflow: visible; }
#left-panel.collapsed h3 { justify-content: center; padding: 14px 4px; }
#left-panel.collapsed h3 > span { display: none; }
#left-panel.collapsed #room-list li,
#left-panel.collapsed #user-list li {
  padding: 8px 4px; justify-content: center; position: relative;
}
#left-panel.collapsed .room-icon { font-size: 16px; width: auto; }
#left-panel.collapsed .room-count {
  position: absolute; top: 2px; right: 2px;
  font-size: 8px; padding: 1px 4px; min-width: 14px;
  margin-left: 0;
}
#left-panel.collapsed .room-name,
#left-panel.collapsed .user-name,
#left-panel.collapsed .badge,
#left-panel.collapsed .gender-icon,
#left-panel.collapsed .star-badge { display: none; }
#left-panel.collapsed .user-status {
  position: absolute; bottom: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
}
#left-panel.collapsed .msg-avatar {
  width: 32px !important; height: 32px !important;
}
#left-panel h3 {
  padding: 14px 16px; font-size: 10px; color: #fff;
  text-transform: uppercase; letter-spacing: 1.5px;
  border-bottom: 1px solid rgba(255,255,255,0.15); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  background: #022d50;
}
#room-list-box { overflow-y: auto; }
#user-list-box { flex: 1; overflow-y: auto; border-top: 1px solid rgba(255,255,255,0.1); }
#room-list, #user-list { list-style: none; }
#room-list li, #user-list li {
  padding: 10px 16px; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: all 0.15s ease;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
}
#room-list li:hover, #user-list li:hover { background: rgba(255,255,255,0.08); }
#room-list li.active {
  background: rgba(255,255,255,0.18);
  color: #fff; font-weight: 600;
}
.room-icon { font-size: 14px; width: 22px; text-align: center; display: inline-block; }
.room-count {
  margin-left: auto; font-size: 9px; font-weight: 700;
  background: rgba(0,0,0,0.25); color: rgba(255,255,255,0.7); padding: 2px 7px;
  border-radius: 10px; min-width: 18px; text-align: center;
}
#room-list li.active .room-count { background: rgba(255,255,255,0.25); color: #fff; }
.room-count.has-users { background: rgba(255,255,255,0.35); color: #fff; }
.gender-icon { font-size: 12px; }
.star-badge { color: #f1c40f; font-size: 10px; }
.user-name { flex: 1; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Rank badges */
.badge {
  font-size: 5px; padding: 1px 3px; border-radius: 4px;
  text-transform: uppercase; font-weight: 700;
  display: inline-flex; align-items: center; gap: 2px;
  letter-spacing: 0.5px; white-space: nowrap;
}
.rank-admin { background: #029120; color: #fff; }
.rank-moderator { background: #e67e22; color: #fff; }
.rank-vip { background: #8e44ad; color: #fff; }
.rank-user { background: #2980b9; color: #fff; }
.rank-guest { background: #596068; color: #fff; }

/* === CHAT AREA === */
#chat-area {
  flex: 1; display: flex; flex-direction: column;
  background: #ffffee; min-width: 0;
  position: relative;
  margin-right: 10px;
  border: 2px solid #022d50;
  border-radius: 10px;
  overflow: hidden;
}
#chat-dock-bg {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 340px;
  background: #034476;
  display: none;
  z-index: 0;
  border-radius: 10px 0 0 10px;
}
#chat-area.docked {
  padding-right: 353px;
  background: transparent;
}
#chat-area.docked #chat-dock-bg { 
  display: block; 
  right: 5px;
}
#chat-area.docked #right-panel {
  border-left: 2px solid #022d50;
}
#btn-dock-private {
  background: transparent; border: none; color: rgba(255,255,255,0.85);
  cursor: pointer; font-size: 13px; padding: 4px 6px;
  transition: color 0.15s;
}
#btn-dock-private:hover { color: #fff; }
#chat-area.docked #btn-dock-private i {
  transform: rotate(180deg);
  display: inline-block;
}

/* Chat header - positioned above input bar - nice blue */
#chat-header {
  padding: 8px 16px; background: #034476;
  display: flex; align-items: center;
  transition: background 0.3s ease;
  gap: 10px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
#room-topic { font-size: 10px; color: rgba(255,255,255,0.6); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; margin-left: auto; }
#header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-right: auto; flex-wrap: wrap; }
.header-group { display: flex; align-items: center; gap: 1px; padding: 2px 4px; border-radius: 8px; background: rgba(0,0,0,0.15); }
.header-group + .header-group { border-left: 1px solid rgba(255,255,255,0.1); padding-left: 8px; margin-left: 2px; }
#header-actions button {
  background: transparent; border: none; color: rgba(255,255,255,0.75);
  font-size: 14px; cursor: pointer; padding: 7px 9px; border-radius: 6px;
  transition: all 0.15s ease; position: relative;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
}
#header-actions button:hover { background: rgba(255,255,255,0.2); color: #fff; transform: translateY(-1px); }
#header-actions button:active { transform: translateY(0); }
#header-actions button[title]:hover::after {
  content: attr(title); position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%);
  background: #022d50; color: #fff; padding: 4px 10px; border-radius: 4px;
  font-size: 10px; white-space: nowrap; z-index: 100; pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
/* Group color accents */
.media-group button:hover { color: #f1c40f; }
.view-group button:hover { color: #8ecae6; }
.user-group button:hover { color: #2ecc71; }
.admin-group button:hover { color: #e94560; }
.exit-group button:hover { color: #ff6b6b; }
#my-rank-badge { margin-left: 4px; }
#logout-btn { color: #ff6b6b !important; }

/* Revolving banner */
#revolving-banner {
  background: #034476;
  padding: 8px 20px; text-align: center; font-size: 12px;
  color: #fff; border-bottom: 1px solid #022d50;
  border-radius: 10px 10px 0 0;
  min-height: 36px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
#banner-text { font-style: italic; opacity: 0.9; }

/* Announcement banner */
.announcement-banner {
  background: linear-gradient(90deg, #e94560, #f39c12, #e94560);
  color: #fff; padding: 6px 15px; font-size: 12px; font-weight: 600;
  text-align: center; white-space: nowrap; overflow: hidden;
  animation: scrollBanner 15s linear infinite;
}
@keyframes scrollBanner {
  0% { text-indent: 100%; }
  100% { text-indent: -100%; }
}

/* Movie controls bar */
#movie-controls {
  display: none; background: #161b22; padding: 10px 16px;
  border-bottom: 1px solid #1a2332; gap: 8px; align-items: center; flex-wrap: wrap;
}
#movie-controls .movie-label { font-size: 10px; color: #586069; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.youtube-search-container { position: relative; display: flex; align-items: center; }
#youtube-search-input {
  width: 180px; padding: 7px 12px; border-radius: 6px 0 0 6px;
  border: 1px solid #1a2332; background: #0d1117; color: #e6edf3;
  font-size: 11px; outline: none;
}
#youtube-search-input:focus { border-color: #e94560; }
#btn-youtube-search {
  padding: 7px 12px; background: #e94560; border: 1px solid #e94560;
  border-radius: 0 6px 6px 0; color: #fff; cursor: pointer;
}
#btn-youtube-search:hover { filter: brightness(1.1); }
.search-results-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #161b22; border: 1px solid #30363d;
  border-radius: 6px; max-height: 300px; overflow-y: auto;
  z-index: 1000; margin-top: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #21262d;
}
.search-result-item:hover { background: #1f242c; }
.search-result-item:last-child { border-bottom: none; }
.search-result-thumb {
  width: 80px; height: 45px; object-fit: cover; border-radius: 4px;
  flex-shrink: 0;
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 11px; color: #e6edf3; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-channel {
  font-size: 9px; color: #8b949e; margin-top: 2px;
}
#movie-controls .divider {
  color: #30363d; font-size: 13px; margin: 0 8px;
}
#movie-controls input[type="text"] {
  flex: 1; padding: 7px 12px; border-radius: 6px; border: 1px solid #1a2332;
  background: #0d1117; color: #e6edf3; font-size: 11px; outline: none;
  transition: border-color 0.2s;
}
#movie-controls input[type="text"]:focus { border-color: #e94560; }
#movie-controls button {
  padding: 7px 14px; color: #fff; border: none; border-radius: 6px;
  font-size: 11px; cursor: pointer; font-weight: 600; transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 4px;
}
#movie-controls button:hover { filter: brightness(1.1); transform: translateY(-1px); }
#btn-movie-load { background: #e94560; }
#btn-movie-play { background: #2ecc71; }
#btn-movie-pause { background: #e67e22; }
#btn-movie-stop { background: #596068; }
#btn-movie-queue { background: #2ecc71; }
#btn-movie-next { background: #3498db; }
#btn-movie-clear-queue { background: #e74c3c; }
#movie-controller-name { font-size: 10px; color: #586069; margin-left: auto; }

/* Messages area - slightly off-white tint with dark text */
#messages {
  flex: 1; overflow-y: auto; padding: 14px 18px;
  display: flex; flex-direction: column; gap: 1px;
  background: #ffffee; color: #24292f;
}

#messages.reverse { flex-direction: column-reverse; }
.chat-img { max-width: 200px; max-height: 140px; border-radius: 6px; cursor: zoom-in; display: block; margin: 4px 0; }

/* Each message row: fully horizontal - avatar + stars + username : text + time */
.msg {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 4px 8px; border-radius: 4px; max-width: 100%;
  font-size: 1em; line-height: 1.6;
  animation: fadeIn 0.15s ease;
  word-wrap: break-word;
  background: #ffffee;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.msg-incoming { background: transparent; }
.msg-incoming:hover { background: rgba(0,0,0,0.03); }
.msg-outgoing { background: rgba(3,68,118,0.04); }
.msg-outgoing:hover { background: rgba(3,68,118,0.08); }
.msg-system {
  background: transparent; color: #8b949e; font-style: italic;
  font-size: 10px; text-align: center; align-self: center;
  padding: 3px 12px; display: block; gap: 0;
}
.msg-private {
  background: rgba(124,58,237,0.06);
  border-left: 3px solid #7c3aed;
}
.msg-private:hover { background: rgba(124,58,237,0.1); }

/* Message avatar */
.msg-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}

/* Message inline content */
.msg-inline { flex: 1; min-width: 0; }
.msg-inline p { margin: 0; }
.msg-sender {
  font-weight: 700; color: #034476;
}
.star-badge { color: #f1c40f; font-size: 10px; margin-right: 2px; }
.msg-text { color: #24292f; }
.msg-time { font-size: 9px; color: #999; margin-left: 6px; }
.msg-delete {
  font-size: 9px; color: #999; cursor: pointer;
  margin-left: 4px; opacity: 0; transition: opacity 0.2s;
}
.msg:hover .msg-delete { opacity: 1; }
.msg-delete:hover { color: #e94560; }

/* Typing area - nice blue to match header */
#typing-area {
  padding: 10px 14px; background: #022d50;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
}
#my-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.3); flex-shrink: 0; display: none; }
#input-tools { display: flex; align-items: center; gap: 4px; }
#input-tools > button {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); color: #fff;
  padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
  transition: all 0.15s ease;
}
#input-tools > button:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); }
#message-input {
  flex: 1; padding: 10px 14px; border: 1px solid #ccc; border-radius: 8px;
  background: #fff; color: #24292f; font-size: 12px; outline: none;
  transition: border-color 0.2s;
}
#message-input:focus { border-color: #034476; }
#message-input::placeholder { color: #999; }
#send-btn {
  background: #029120; border: none; color: #fff;
  padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: all 0.2s ease; font-weight: 700;
}
#send-btn:hover { background: #02b328; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* Recording UI */
#record-ui { display: flex; align-items: center; gap: 10px; }
#record-timer { font-family: 'Courier New', monospace; color: #ff6b6b; font-weight: bold; font-size: 13px; }
#btn-stop-record.stop { background: #e74c3c !important; color: #fff !important; border-color: #e74c3c !important; }
#record-target label { font-size: 11px; color: rgba(255,255,255,0.7); margin-right: 8px; cursor: pointer; }
#record-target input { margin-right: 3px; }
#record-preview-ui { display: none; align-items: center; gap: 8px; }
#record-preview-ui audio { height: 28px; width: 200px; }
.record-action-btn {
  padding: 5px 10px; color: #fff; border: none; border-radius: 6px;
  cursor: pointer; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.record-send { background: #2ecc71; }
.record-discard { background: #e94560; }

/* Style UI */
#style-ui {
  display: none; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.2); padding: 6px 10px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
}
#style-ui input[type="color"] { width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; border-radius: 4px; }
#style-ui label { font-size: 11px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 3px; cursor: pointer; }
#style-ui button { padding: 5px 10px; background: #e94560; border: none; color: #fff; border-radius: 4px; cursor: pointer; font-size: 10px; font-weight: 600; }

/* Voice messages */
.voice-msg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.voice-msg audio { display: none; }
.voice-msg .voice-label { font-size: 10px; color: #666; }
.voice-waveform-wrapper { display: flex; align-items: center; gap: 6px; }
.voice-waveform { border-radius: 4px; cursor: pointer; }
.voice-play-btn {
  width: 28px; height: 28px; border-radius: 50%; background: #e94560; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: pointer; flex-shrink: 0;
  transition: all 0.15s ease;
}
.voice-play-btn:hover { background: #d63a52; transform: scale(1.05); }

/* === RIGHT PANEL (Private Chat) === */
#right-panel {
  width: 320px; background: #ffffee; border: 2px solid #022d50;
  display: flex; flex-direction: column;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  border-radius: 10px;
  position: absolute;
  top: 10px; right: 10px;
  height: 80%;
  min-height: 40%;
  max-height: calc(100% - 60px);
  z-index: 50;
  transform: translateX(60px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}
.resize-handle {
  height: 8px;
  background: #022d50;
  cursor: ns-resize;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  transition: background 0.15s;
}
.resize-handle:hover {
  background: #034476;
}
.resize-handle::after {
  content: '';
  width: 28px;
  height: 3px;
  background: rgba(255,255,255,0.35);
  border-radius: 2px;
}
#right-panel.panel-visible {
  transform: translateX(0);
  opacity: 1;
}
#private-chat-header {
  padding: 10px 14px; background: #022d50;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid #022d50;
  border-radius: 8px 8px 0 0;
  flex-shrink: 0;
  cursor: move;
  user-select: none;
}
#private-header-left { display: flex; align-items: center; gap: 8px; }
#private-header-right { display: flex; align-items: center; gap: 10px; }
#private-target-name { font-weight: 700; color: #fff; font-size: 13px; }
#private-target-status {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2ecc71; /* online */
  box-shadow: 0 0 4px #2ecc71;
}
#private-target-status.away { background: #f1c40f; box-shadow: 0 0 4px #f1c40f; }
#private-typing-indicator {
  font-size: 11px; color: rgba(255,255,255,0.7);
  font-style: italic;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
#close-private { background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer; font-size: 15px; transition: color 0.15s; }
#close-private:hover { color: #e94560; }

/* Status dots for user list */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-online { background: #2ecc71; box-shadow: 0 0 4px #2ecc71; }
.status-away { background: #f1c40f; box-shadow: 0 0 4px #f1c40f; }
#user-list li { display: flex; align-items: center; gap: 8px; }
#user-list li .status-dot { margin-right: 2px; }
#private-messages {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 4px;
  background: #ffffee;
}
#private-input-area {
  padding: 10px 16px; display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid #ccc;
  background: #034476;
}
#private-input-row1 { display: flex; gap: 8px; align-items: center; }
#private-input-row2 { display: flex; gap: 8px; justify-content: center; }
#private-message-input {
  flex: 1; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px;
  background: #fff; color: #24292f; font-size: 12px; outline: none;
}
#private-message-input:focus { border-color: #034476; }
#private-send-btn {
  background: linear-gradient(145deg, #2ecc71, #27ae60); border: none; color: #fff;
  padding: 8px 16px; border-radius: 6px; cursor: pointer;
  transition: all 0.15s ease; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
#private-send-btn:hover { background: linear-gradient(145deg, #27ae60, #229954); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(46,204,113,0.3); }
#private-send-btn:active { transform: translateY(0); }
#btn-priv-image, #btn-priv-emoticon, #btn-priv-voice {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  transition: all 0.15s ease; font-size: 12px;
}
#btn-priv-image:hover, #btn-priv-emoticon:hover, #btn-priv-voice:hover { background: rgba(255,255,255,0.2); }

/* === EMOTICON PANEL === */
#emoticon-panel {
  position: fixed; bottom: 70px; left: 240px;
  background: #161b22; border: 1px solid #1a2332;
  border-radius: 12px; z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  overflow: hidden;
}
#emoticon-tabs {
  display: flex; gap: 0; border-bottom: 1px solid #1a2332;
  background: #0d1117;
}
.emoticon-tab {
  background: transparent; color: #586069; border: none;
  padding: 8px 14px; cursor: pointer; font-size: 11px; font-weight: 600;
  transition: all 0.15s;
}
.emoticon-tab.active { color: #e94560; border-bottom: 2px solid #e94560; }
.emoticon-tab:hover { color: #e6edf3; }
.emoticon-panel { display: none; padding: 10px; }
.emoticon-panel.active { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
#emoticon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 10px; }
#emoticon-grid span, #emoticon-grid-bible span {
  font-size: 18px; cursor: pointer; padding: 6px; border-radius: 6px;
  text-align: center; transition: background 0.1s;
}
#emoticon-grid span:hover, #emoticon-grid-bible span:hover { background: #1a2332; }

/* === CONTEXT MENU === */
#user-context-menu {
  position: fixed; background: #161b22;
  border: 1px solid #1a2332; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); z-index: 200;
  min-width: 180px; overflow: hidden;
}
#user-context-menu ul { list-style: none; }
#user-context-menu li {
  padding: 10px 16px; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: background 0.1s;
}
#user-context-menu li:hover { background: #1a2332; }
#user-context-menu li i { width: 16px; text-align: center; color: #586069; }
#user-context-menu li:hover i { color: #e94560; }
.mod-only, .admin-only { display: none; }

/* === MODALS === */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; animation: fadeIn 0.15s ease;
}
.modal-content {
  background: #161b22; border: 1px solid #1a2332;
  border-radius: 14px; padding: 28px;
  width: 440px; max-height: 85vh; overflow-y: auto;
  position: relative;
  box-shadow: 0 16px 64px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
}
.modal-content.wide { width: 760px; }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  font-size: 20px; cursor: pointer; color: #586069;
  transition: color 0.15s; line-height: 1;
}
.modal-close:hover { color: #8ecae6; }
.modal-content h2 {
  color: #8ecae6; margin-bottom: 16px; font-size: 16px; font-weight: 700;
}
.modal-content h3 { color: #e6edf3; margin: 16px 0 10px; font-size: 13px; font-weight: 600; }
.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="email"],
.modal-content input[type="tel"],
.modal-content input[type="number"],
.modal-content input[type="file"],
.modal-content select,
.modal-content textarea {
  display: block; width: 100%; margin-bottom: 10px;
  background: #0d1117; border: 1px solid #1a2332; padding: 10px 12px;
  border-radius: 8px; color: #e6edf3; font-size: 12px;
  outline: none; transition: border-color 0.2s;
}
.modal-content input:focus, .modal-content select:focus, .modal-content textarea:focus { border-color: #e94560; }
.modal-content label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #8b949e; margin-bottom: 10px; cursor: pointer;
  background: transparent; padding: 0; border: none; width: auto;
}
.modal-content label input[type="checkbox"] { width: auto; margin: 0; }
.modal-content button:not(.game-btn):not(.btn-secondary) {
  background: #034476; border: none; color: #fff;
  padding: 10px 18px; border-radius: 8px; cursor: pointer;
  font-weight: 600; font-size: 12px;
  transition: all 0.15s ease;
}
.modal-content button:not(.game-btn):not(.btn-secondary):hover {
  background: #045a9e;
}

/* Profile modal */
#profile-view p { margin-bottom: 6px; font-size: 12px; color: #8b949e; }
#profile-view p strong { color: #e6edf3; }
#profile-avatar-preview { width: 80px; height: 80px; border-radius: 12px; margin: 10px 0; object-fit: cover; }

/* Friends modal */
#friends-list p, #pending-requests p { font-size: 12px; margin-bottom: 8px; color: #8b949e; }
#friends-list button, #pending-requests button {
  padding: 4px 10px; font-size: 10px; margin-left: 6px;
}

/* Donation modal */
#donation-modal p { font-size: 12px; margin-bottom: 12px; color: #8b949e; line-height: 1.5; }
#donation-modal .donate-warning { font-size: 11px; color: #e94560; margin-top: 10px; font-weight: 600; }

/* Notification modal */
#notify-modal hr { border: none; border-top: 1px solid #1a2332; margin: 14px 0; }
#notify-modal h3 { margin-top: 0; }

/* Admin tabs */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-tab {
  background: #0d1117; border: 1px solid #1a2332; color: #586069;
  padding: 7px 14px; cursor: pointer; border-radius: 6px;
  font-size: 11px; font-weight: 600; transition: all 0.15s;
}
.admin-tab:hover { color: #e6edf3; border-color: #2a3442; }
.admin-tab.active { background: #e94560; color: #fff; border-color: #e94560; }
.admin-panel { font-size: 12px; }
.admin-panel table { width: 100%; border-collapse: collapse; }
.admin-panel th, .admin-panel td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #1a2332; }
.admin-panel th { color: #e94560; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.admin-panel tr:hover { background: rgba(255,255,255,0.02); }
.admin-panel button {
  padding: 4px 10px; font-size: 10px; border-radius: 4px;
  background: #e94560; color: #fff; border: none; cursor: pointer;
}
.admin-panel input[type="text"],
.admin-panel input[type="password"],
.admin-panel input[type="number"] {
  padding: 8px 10px; border-radius: 6px; border: 1px solid #1a2332;
  background: #0d1117; color: #e6edf3; font-size: 12px; outline: none;
}
.admin-announce textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #1a2332;
  background: #0d1117; color: #e6edf3; resize: vertical; font-size: 12px;
  outline: none;
}
.admin-announce textarea:focus { border-color: #e94560; }

/* Inline form row */
.form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row label { font-size: 12px; color: #8b949e; white-space: nowrap; }

/* Help modal */
.help-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.help-tab {
  background: #0d1117; border: 1px solid #1a2332; color: #586069;
  padding: 7px 14px; cursor: pointer; border-radius: 6px;
  font-size: 11px; font-weight: 600; transition: all 0.15s;
}
.help-tab:hover { color: #e6edf3; border-color: #2a3442; }
.help-tab.active { background: #034476; color: #fff; border-color: #034476; }
.help-panel { font-size: 12px; }
.help-panel h3 { color: #e94560; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; margin: 16px 0 8px; border-bottom: 1px solid #1a2332; padding-bottom: 4px; }
.rank-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: #8b949e; }
.cmd-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.cmd-row code {
  background: #0d1117; border: 1px solid #1a2332; padding: 2px 8px; border-radius: 4px;
  color: #e6edf3; font-size: 11px; font-family: 'Courier New', monospace;
}
.cmd-short { color: #8b949e; font-size: 11px; }
.cmd-q {
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: #034476; color: #fff; font-size: 10px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0; padding: 0;
}
.cmd-q:hover { background: #045a9e; transform: scale(1.1); }
.cmd-detail {
  width: 100%; padding: 6px 10px; background: rgba(3,68,118,0.1); border-left: 3px solid #034476;
  border-radius: 0 4px 4px 0; color: #8b949e; font-size: 12px; margin: 4px 0 8px 0;
  display: none;
}
.cmd-detail.open { display: block; }
.btn-icon { color: #e94560; font-size: 12px; width: 18px; display: inline-flex; }

/* Video call */
#call-modal .modal-content { width: 540px; text-align: center; }
#call-status { color: #8b949e; font-size: 13px; margin-bottom: 12px; }
#call-videos { display: flex; gap: 10px; margin: 12px 0; justify-content: center; }
#call-videos video { border: 2px solid #1a2332; border-radius: 10px; width: 200px; height: 150px; background: #000; }

/* Maintenance modal */
#maintenance-modal {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 40%, #16213e, #0d1117);
  z-index: 1000; align-items: center; justify-content: center;
  flex-direction: column; text-align: center; color: #e6edf3;
}
#maintenance-modal h1 { font-size: 24px; margin-bottom: 16px; }
#maintenance-modal p { font-size: 14px; color: #8b949e; margin-top: 8px; }
#maintenance-modal button {
  margin-top: 30px; padding: 12px 28px; background: #e94560; color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600;
}

/* Lightbox */
#lightbox-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9); z-index: 2000;
  display: none; align-items: center; justify-content: center;
  flex-direction: column; cursor: zoom-out;
}
#lightbox-overlay.active { display: flex; }
#lightbox-overlay img { max-width: 92%; max-height: 85%; border-radius: 8px; cursor: default; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
#lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 32px; cursor: pointer; }

/* YouTube embed */
.youtube-embed { margin-top: 6px; }
.youtube-embed iframe { width: 100%; max-width: 360px; height: 200px; border: none; border-radius: 8px; }

/* Image message */
.msg-image { max-width: 200px; max-height: 200px; border-radius: 8px; cursor: pointer; margin-top: 4px; }

/* Reaction overlay */
.reaction-overlay { position: fixed; pointer-events: none; font-size: 36px; animation: floatUp 2s ease-out forwards; z-index: 1000; }
@keyframes floatUp { 0% { opacity:1; transform: translateY(0) scale(1); } 100% { opacity:0; transform: translateY(-150px) scale(1.5); } }

/* Movie iframe */
#movie-iframe { width: 100%; height: 280px; border: none; border-radius: 8px; }

/* Zoom */
#messages.zoom-100, #private-messages.zoom-100, #movie-messages-main.zoom-100, #gaming-messages-main.zoom-100 { font-size: 12px; }
#messages.zoom-115, #private-messages.zoom-115, #movie-messages-main.zoom-115, #gaming-messages-main.zoom-115 { font-size: 14px; }
#messages.zoom-130, #private-messages.zoom-130, #movie-messages-main.zoom-130, #gaming-messages-main.zoom-130 { font-size: 16px; }
#messages.zoom-145, #private-messages.zoom-145, #movie-messages-main.zoom-145, #gaming-messages-main.zoom-145 { font-size: 18px; }
#messages.zoom-150, #private-messages.zoom-150, #movie-messages-main.zoom-150, #gaming-messages-main.zoom-150 { font-size: 20px; }

/* Chat direction */
#messages.reverse { flex-direction: column-reverse; }
#private-messages.reverse { flex-direction: column-reverse; }

/* Muted ping bar */
#muted-ping-bar {
  display: none; position: fixed; bottom: 70px; left: 50%;
  transform: translateX(-50%); z-index: 150;
  background: linear-gradient(135deg, #e94560, #d63a52); color: #fff;
  padding: 10px 24px; border-radius: 24px; font-size: 12px; font-weight: 600;
  align-items: center; gap: 10px;
  box-shadow: 0 6px 20px rgba(233,69,96,0.3);
}
#muted-ping-bar.active { display: flex; }
#muted-ping-bar button {
  background: #fff; color: #e94560; border: none;
  border-radius: 14px; padding: 5px 14px; font-weight: 700;
  cursor: pointer; font-size: 11px; transition: all 0.15s;
}
#muted-ping-bar button:hover { background: #f8d7da; }

/* Sound toggle */
#sound-toggle { background: transparent; border: none; font-size: 15px; cursor: pointer; }

/* Draggable popups */
.draggable-popup {
  position: fixed; display: none; z-index: 200;
  width: 440px; height: 560px; background: #0d1117;
  border: 1px solid #1a2332; border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6); overflow: hidden;
  flex-direction: column;
}
.draggable-popup.active { display: flex; }
.popup-title-bar {
  background: #161b22; color: #e6edf3; padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: move; user-select: none; font-size: 13px; font-weight: 700;
  border-bottom: 1px solid #1a2332;
}
.popup-close-btn { background: transparent; border: none; color: #586069; font-size: 18px; cursor: pointer; padding: 0 4px; transition: color 0.15s; }
.popup-close-btn:hover { color: #e94560; }
.popup-content { flex: 1; display: flex; overflow: hidden; }
.popup-resize-handle {
  position: absolute; bottom: 0; right: 0; width: 18px; height: 18px;
  cursor: nwse-resize; z-index: 10; user-select: none;
}
.popup-resize-handle::after {
  content: ''; position: absolute; bottom: 4px; right: 4px;
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-top: 6px solid rgba(255,255,255,0.25);
}
.popup-iframe { flex: 1; border: none; width: 100%; height: 100%; }
#bible-frame { display: none; }
.bible-placeholder {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #0d1117; color: #8b949e; text-align: center; padding: 20px;
}
.bible-placeholder p { margin-bottom: 16px; font-size: 13px; }
.btn-load-bible {
  background: #034476; border: 1px solid #045a8f; color: #fff;
  padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: all 0.15s; display: flex; align-items: center; gap: 6px;
}
.btn-load-bible:hover { background: #045a9e; border-color: #fff; }
#bible-frame.loaded { display: block; }
#bible-content.has-frame .bible-placeholder { display: none; }
.radio-sidebar {
  width: 130px; background: #0d1117; border-left: 1px solid #1a2332;
  overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px;
}
.radio-sidebar a {
  color: #e6edf3; text-decoration: none; font-size: 11px;
  padding: 8px 6px; border-radius: 6px; background: #161b22;
  text-align: center; transition: all 0.15s; font-weight: 500;
  border: 1px solid #1a2332;
}
.radio-sidebar a:hover { background: #1a2332; border-color: #e94560; color: #e94560; }
.btn-stop-radio {
  margin-top: 12px; padding: 10px; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(231,76,60,0.2); color: #ff9999; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  transition: all 0.15s ease; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-stop-radio:hover { background: rgba(231,76,60,0.35); color: #fff; border-color: rgba(231,76,60,0.5); }

/* Rules modal body */
.rules-body { text-align: left; font-size: 13px; line-height: 1.7; color: #8b949e; }
.rules-body ol { padding-left: 20px; }
.rules-body li { margin-bottom: 4px; }
.rules-body strong { color: #e6edf3; }
.rules-note { color: #586069; font-size: 12px; margin-top: 16px; }

/* Donation history */
#donation-history-table { max-height: 400px; overflow-y: auto; }

/* Floating reaction animation */
@keyframes floatReaction {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-200px) scale(1.3); }
}

/* ========== MOVIE SPLIT LAYOUT ========== */
#movie-split-layout {
  display: none;
  flex: 1;
  flex-direction: row;
  overflow: hidden;
}
#movie-split-layout.active {
  display: flex !important;
}
#movie-player-section {
  width: 75%;
  display: flex;
  flex-direction: column;
  background: #000;
  position: relative;
}
#movie-chat-section {
  width: 25%;
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
  border-left: 1px solid #16213e;
}
#movie-chat-header-main {
  background: #0f3460;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  border-bottom: 1px solid #16213e;
  flex-shrink: 0;
}
#movie-messages-main {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#movie-messages-main .msg-wrap {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}
#movie-messages-main .msg-username {
  color: #e94560;
  font-weight: 600;
  font-size: 12px;
}
#movie-messages-main .msg-time {
  color: #666;
  font-size: 10px;
  margin-left: 4px;
}
#movie-messages-main .msg-content {
  color: #eee;
  font-size: 12px;
  margin-top: 2px;
}
#movie-messages-main .msg-content img,
#movie-messages-main .msg-content iframe {
  display: none;
}
#main-reaction-sidebar {
  position: absolute;
  right: 10px;
  top: 50px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0,0,0,0.6);
  padding: 8px;
  border-radius: 8px;
  z-index: 10;
}
#main-reaction-sidebar .reaction-btn {
  background: #16213e;
  border: 1px solid #0f3460;
  color: #fff;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 18px;
}
#main-reaction-sidebar .reaction-btn:hover { background: #0f3460; }

/* Hide regular messages when in movie mode */
#chat-area.movie-mode #messages {
  display: none;
}
#chat-area.movie-mode #typing-area {
  display: none;
}
#chat-area.movie-mode #chat-header {
  display: flex;
  order: 0;
  border-radius: 10px 10px 0 0;
}
#movie-chat-section #movie-input-wrapper {
  padding: 8px;
  border-top: 1px solid #16213e;
  display: flex;
  gap: 6px;
}
#movie-chat-section #movie-input {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 4px;
  background: #0f3460;
  color: #fff;
  font-size: 12px;
}
#movie-chat-section #movie-send {
  padding: 8px 12px;
  background: #e94560;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
}

/* Responsive movie split */
@media (max-width: 900px) {
  #movie-split-layout { flex-direction: column; }
  #movie-player-section { width: 100%; height: 55%; }
  #movie-chat-section { width: 100%; height: 45%; border-left: none; border-top: 1px solid #16213e; }
}

/* ========== GAMING ROOM SPLIT LAYOUT ========== */
#gaming-split-layout {
  display: none;
  flex: 1;
  flex-direction: row;
  overflow: hidden;
  min-height: 0;
}
#gaming-split-layout.active {
  display: flex !important;
}
#gaming-player-section {
  flex: 1 1 75%;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
#gaming-chat-section {
  width: 25%;
  min-width: 220px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
  border-left: 1px solid #16213e;
  transition: width 0.2s, min-width 0.2s, max-width 0.2s, opacity 0.2s;
}
#gaming-chat-section.chat-hidden {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  overflow: hidden;
  border-left: none;
  opacity: 0;
  pointer-events: none;
}
#gaming-chat-header-main {
  background: #0f3460;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  border-bottom: 1px solid #16213e;
  flex-shrink: 0;
}
#gaming-messages-main {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
#gaming-messages-main .msg-wrap {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}
#gaming-messages-main .msg-username {
  color: #2ecc71;
  font-weight: 600;
  font-size: 12px;
}
#gaming-messages-main .msg-time {
  color: #666;
  font-size: 10px;
  margin-left: 4px;
}
#gaming-messages-main .msg-content {
  color: #eee;
  font-size: 12px;
  margin-top: 2px;
}
#gaming-chat-section #gaming-input-wrapper {
  padding: 8px;
  border-top: 1px solid #16213e;
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
#gaming-chat-section #gaming-input {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 4px;
  background: #0f3460;
  color: #fff;
  font-size: 12px;
}
#gaming-chat-section #gaming-send {
  padding: 8px 12px;
  background: #2ecc71;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
}

/* Game Toolbar */
.game-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #161b22, #1a2332);
  border-bottom: 1px solid #2d333b;
  flex-shrink: 0;
  z-index: 10;
}
.game-toolbar-btn {
  padding: 6px 14px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #21262d;
  color: #c9d1d9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.game-toolbar-btn:hover { background: #30363d; border-color: #8b949e; color: #fff; }
.game-toolbar-btn.game-toolbar-quit { border-color: #da3633; color: #f85149; }
.game-toolbar-btn.game-toolbar-quit:hover { background: #da3633; color: #fff; }

/* Main Gaming Area */
#main-gaming-area {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: #0d1117;
}

/* Game iframe */
.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1 1 auto;
  min-height: 0;
  display: block;
}

/* Hide regular messages when in gaming mode */
#chat-area.gaming-mode #messages {
  display: none;
}
#chat-area.gaming-mode #typing-area {
  display: none;
}
#chat-area.gaming-mode #chat-header {
  display: flex;
  order: 0;
  border-radius: 10px 10px 0 0;
}
#chat-area.gaming-mode #movie-controls {
  display: none !important;
}

/* Responsive gaming split */
@media (max-width: 900px) {
  #gaming-split-layout { flex-direction: column; }
  #gaming-player-section { width: 100% !important; flex: 1 1 auto; }
  #gaming-chat-section { 
    width: 100% !important; 
    max-width: 100% !important; 
    min-width: 0 !important;
    height: 180px; 
    max-height: 35%;
    border-left: none; 
    border-top: 1px solid #16213e; 
  }
  #gaming-chat-section.chat-hidden {
    height: 0 !important;
    max-height: 0 !important;
  }
}
@media (max-width: 600px) {
  .game-toolbar { padding: 4px 8px; gap: 4px; }
  .game-toolbar-btn { padding: 5px 8px; font-size: 11px; }
  #gaming-chat-section { height: 140px; }
}

/* ========== GAME MODAL ========== */
.game-modal-content { width: 600px; max-width: 90vw; }
.game-menu h3 { color: #8b949e; font-size: 13px; margin: 16px 0 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.game-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px; border: 1px solid #1a2332; border-radius: 10px;
  background: #161b22 !important; cursor: pointer; transition: all 0.15s ease;
  color: #e6edf3;
}
.game-btn:hover { background: #1a2332 !important; border-color: #2ecc71; transform: translateY(-2px); }
.game-btn i { font-size: 24px; color: #2ecc71; }
.game-btn span { font-size: 14px; font-weight: 600; }
.game-btn small { font-size: 11px; color: #8b949e; }

/* Invite Panel */
.game-invite-panel { padding: 20px 0; }
.game-invite-list { max-height: 300px; overflow-y: auto; margin: 16px 0; }
.game-invite-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin: 6px 0; background: #161b22;
  border-radius: 8px; border: 1px solid #1a2332;
}
.game-invite-item:hover { background: #1a2332; }
.game-invite-item .user-info { display: flex; align-items: center; gap: 10px; }
.game-invite-item button {
  padding: 6px 14px; background: #2ecc71; border: none; border-radius: 6px;
  color: #fff; font-weight: 600; cursor: pointer;
}
.game-invite-item button:hover { background: #27ae60; }
.btn-secondary {
  padding: 10px 20px; background: #596069; border: none; border-radius: 6px;
  color: #fff; font-weight: 600; cursor: pointer; margin-top: 10px;
}
.btn-secondary:hover { background: #6b7280; }
.btn-success { background: #2ecc71; color: #fff; }
.btn-success:hover { background: #27ae60; }
.btn-danger { background: #596069; color: #fff; }
.btn-danger:hover { background: #4a5058; }

/* Game Request Overlay */
.game-request-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.game-request-box {
  background: #161b22; border: 2px solid #2ecc71; border-radius: 16px;
  padding: 32px 48px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: popIn 0.3s ease;
}
@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.game-request-box h3 { font-size: 20px; color: #2ecc71; margin-bottom: 12px; }
.game-request-box p { color: #8b949e; margin-bottom: 24px; }
.game-request-buttons { display: flex; gap: 16px; justify-content: center; }
.game-request-buttons button {
  padding: 12px 28px; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}

/* Game Container (inline JS games like solitaire/tictactoe) */
.game-container { padding: 12px; overflow-y: auto; }
#game-canvas-wrapper {
  background: #0d1117; border: 2px solid #1a2332; border-radius: 8px;
  min-height: 200px; display: flex; align-items: flex-start; justify-content: center;
  overflow: auto;
}
.game-controls {
  margin-top: 12px; display: flex; justify-content: center; gap: 12px; flex-shrink: 0;
}
.game-controls button {
  padding: 10px 20px; background: #034476; border: none; border-radius: 6px;
  color: #fff; cursor: pointer;
}
.game-controls button:hover { background: #045a9e; }

/* User status indicator */
.user-status {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 5px; flex-shrink: 0;
}
.user-status.active { background: #2ecc71; box-shadow: 0 0 4px rgba(46,204,113,0.4); }
.user-status.away { background: #f39c12; box-shadow: 0 0 4px rgba(243,156,18,0.4); }
.user-status.offline { background: #596068; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1a2332; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2a3442; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  #left-panel { width: 200px; }
  #right-panel { width: 280px; }
}
@media (max-width: 768px) {
  #left-panel { width: 180px; }
  #right-panel { width: 260px; }
  .modal-content { width: 92%; }
  .modal-content.wide { width: 96%; }
  #call-modal .modal-content { width: 96%; }
  #call-videos { flex-direction: column; align-items: center; }
  #header-actions { gap: 2px; }
  #header-actions button { padding: 4px 6px; font-size: 13px; width: 28px; height: 28px; }
  .header-group { padding: 1px 2px; }
  .header-group + .header-group { padding-left: 4px; margin-left: 1px; }
  #auth-box { width: 340px; padding: 28px 24px; }
  #pre-login-users { width: 340px; }
}
@media (max-width: 480px) {
  #left-panel { width: 60px; }
  #left-panel h3 { font-size: 0; padding: 10px; }
  #left-panel h3 i { font-size: 14px; }
  #room-list li, #user-list li { padding: 8px; font-size: 11px; }
  #right-panel { width: 100%; position: fixed; top: 0; left: 0; z-index: 300; height: 100vh; }
  #typing-area { padding: 8px 10px; }
  .draggable-popup { width: 95vw !important; left: 2.5vw !important; }
  #auth-box { width: 92vw; }
  #pre-login-users { width: 92vw; }
  #emoticon-panel { left: 10px; bottom: 60px; }
  
  /* Mobile chat improvements */
  #chat-area { margin-right: 0; margin-left: 0; }
  .msg { padding: 6px 10px; font-size: 14px; }
  .msg-avatar { width: 32px; height: 32px; }
  .chat-img, .msg-image { max-width: 150px; max-height: 120px; }
  #message-input { font-size: 16px; } /* Prevent zoom on iOS */
  
  /* Mobile movie/gaming room improvements */
  #movie-controls, #gaming-controls {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
  }
  #movie-controls input, #youtube-search-input {
    width: 100%;
    font-size: 14px;
  }
  .youtube-search-container {
    width: 100%;
    margin-bottom: 6px;
  }
  
  /* Mobile modals */
  .game-modal-content {
    width: 95vw;
    margin: 10px;
  }
  .game-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .game-btn {
    padding: 12px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
  }
  .game-btn i {
    font-size: 20px;
    width: 24px;
  }
  
  /* Mobile header - prevent overflow */
  #header-top {
    padding: 6px 8px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  #current-room {
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #header-actions {
    gap: 1px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    max-width: 60%;
  }
  #header-actions::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
  #header-actions button {
    width: 36px;
    height: 36px;
    padding: 4px;
    flex-shrink: 0;
  }
  .header-group {
    display: flex;
    flex-shrink: 0;
  }
  
  /* Mobile typing area - ensure send button visible */
  #typing-area {
    padding: 8px 10px;
    gap: 6px;
  }
  #input-tools {
    gap: 4px;
  }
  #input-tools > button {
    width: 36px;
    height: 36px;
    padding: 6px;
    font-size: 14px;
  }
  #message-input {
    min-width: 0;
    font-size: 16px;
  }
  #send-btn {
    padding: 10px 14px;
    font-size: 13px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  
  /* Mobile game request overlay */
  .game-request-box {
    padding: 24px 20px;
    width: 90vw;
  }
  .game-request-buttons {
    flex-direction: column;
    gap: 10px;
  }
  .game-request-buttons button {
    width: 100%;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  #room-list li,
  #user-list li,
  .game-btn,
  #header-actions button {
    min-height: 44px; /* Minimum touch target size */
  }
  .msg-delete {
    opacity: 1; /* Always show delete on touch devices */
  }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
  #header-top {
    padding: 4px 8px;
  }
  #typing-area {
    padding: 6px 10px;
  }
  #messages {
    padding: 8px 10px;
  }
}

/* === Admin polish pass: spacing, scale, movie/chat UX === */
:root { --chat-gap-blue: #023b67; }
#chat-layout { gap: 6px; padding: 0 6px; background: var(--chat-gap-blue); }
#left-panel { margin-left: -6px; }
#chat-area { margin: 0; border-color: var(--chat-gap-blue); }
body { font-size: 16px; }
button, input, select, textarea { font-size: 1rem; }
.fa, .room-icon, .gender-icon, .btn-icon, .reaction-btn { transform: scale(1.18); transform-origin: center; }
#room-list li, #user-list li { font-size: 15px; padding-top: 12px; padding-bottom: 12px; }
.badge { font-size: 11px; padding: 3px 7px; }
.msg-avatar { width: 34px !important; height: 34px !important; }
#messages, #private-messages, #movie-messages-main, #gaming-messages-main { scrollbar-width: auto; scrollbar-color: #045a8f transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #045a8f, #022d50); border-radius: 8px; border: 2px solid rgba(255,255,255,0.12); }
::-webkit-scrollbar-thumb:hover { background: #0570b8; }
#right-panel { transition: transform 0.28s ease, opacity 0.28s ease, right 0.28s ease, width 0.28s ease; }
#right-panel:not(.panel-visible) { transform: translateX(18px); opacity: 0; }
#right-panel.panel-visible { transform: translateX(0); opacity: 1; }
#chat-area.docked { transition: padding-right 0.28s ease; }
#movie-queue-panel { flex-shrink: 0; max-height: 120px; overflow-y: auto; padding: 8px 12px; background: rgba(3,68,118,0.45); border-bottom: 1px solid #16213e; font-size: 13px; }
#movie-queue-panel strong { color: #fff; display: block; margin-bottom: 4px; }
#movie-queue-list { padding-left: 18px; color: #d9edf7; }
#movie-queue-list li { margin: 3px 0; }
#btn-youtube-search, #movie-send, #btn-movie-load, #btn-movie-queue { background: linear-gradient(145deg, #2ecc71, #27ae60) !important; }
#btn-movie-vote-remove { background: #e67e22 !important; }
#btn-movie-next { background: #3498db !important; }
#auth-screen { background: radial-gradient(circle at 50% 20%, rgba(46,204,113,0.18), transparent 30%), linear-gradient(rgba(2,45,80,.88), rgba(2,45,80,.94)), url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1200 800%22%3E%3Crect fill=%22%23022d50%22 width=%221200%22 height=%22800%22/%3E%3Cellipse cx=%22600%22 cy=%22490%22 rx=%22480%22 ry=%22205%22 fill=%22none%22 stroke=%22%23045a8f%22 stroke-width=%2226%22/%3E%3Cellipse cx=%22600%22 cy=%22490%22 rx=%22340%22 ry=%22135%22 fill=%22none%22 stroke=%22%23034476%22 stroke-width=%2222%22/%3E%3Cpath d=%22M160 515 Q600 310 1040 515%22 fill=%22none%22 stroke=%22%232ecc71%22 stroke-opacity=%22.55%22 stroke-width=%2210%22/%3E%3Ccircle cx=%22600%22 cy=%22350%22 r=%2280%22 fill=%22%23034476%22 stroke=%22%232ecc71%22 stroke-width=%226%22/%3E%3C/svg%3E') center/cover no-repeat; }
#auth-box { background: rgba(3,68,118,0.9); backdrop-filter: blur(8px); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.modal { align-items: center; justify-content: center; }
.modal-content { background: linear-gradient(145deg, #034476, #022d50); border: 2px solid #045a8f; box-shadow: 0 20px 70px rgba(0,0,0,.55); border-radius: 16px; }
#center-notice-toast.center-notice { top: 50% !important; transform: translate(-50%, -50%) scale(.94) !important; font-size: 20px !important; padding: 18px 34px !important; border-radius: 16px !important; }
#center-notice-toast.center-notice.show { transform: translate(-50%, -50%) scale(1) !important; }
@media (max-width: 760px) {
  #btn-dock-private { display: none !important; }
  #chat-area.docked { padding-right: 0 !important; }
  #chat-area.docked #chat-dock-bg { display: none !important; }
  #right-panel { width: 100% !important; }
}
#nice-prompt-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 3000; background: rgba(0,0,0,.45); }
.nice-prompt-box { width: min(420px, 92vw); background: linear-gradient(145deg,#034476,#022d50); border: 2px solid #045a8f; border-radius: 16px; box-shadow: 0 20px 70px rgba(0,0,0,.6); padding: 22px; color: #fff; }
.nice-prompt-box h3 { margin: 0 0 12px; color: #fff; font-size: 20px; }
.nice-prompt-box label { display: block; margin-bottom: 10px; color: #d9edf7; }
.nice-prompt-box input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #045a8f; background: rgba(0,0,0,.25); color: #fff; outline: none; }
.nice-prompt-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.nice-prompt-actions button { border: none; border-radius: 10px; padding: 10px 16px; cursor: pointer; color: #fff; font-weight: 700; }
#nice-prompt-cancel { background: #596068; }
#nice-prompt-ok { background: linear-gradient(145deg,#2ecc71,#27ae60); }

/* May 6 follow-flow fix: direction toggle now controls all chat panes. */
#movie-messages-main.reverse,
#gaming-messages-main.reverse {
  flex-direction: column-reverse;
}
#btn-direction.active {
  background: #046aa8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 0 10px rgba(4,106,168,0.35);
}


/* === Emoticon/GIF asset picker polish === */
#emoticon-panel {
  position: fixed; z-index: 500; background: #161b22; border: 1px solid #1a2332;
  border-radius: 12px; box-shadow: 0 10px 32px rgba(0,0,0,0.45); max-width: 420px; max-height: 360px; overflow: hidden;
}
#emoticon-tabs { display: flex; background: #0d1117; border-bottom: 1px solid #1a2332; }
#emoticon-grid, #emoticon-grid-bible { max-height: 300px; overflow-y: auto; }
.emoticon-asset {
  width: 34px; height: 34px; object-fit: contain; display: block; margin: 0 auto;
  border-radius: 6px; pointer-events: none;
}
.chat-emoticon-img {
  width: 42px; height: 42px; max-height: 42px; object-fit: contain; vertical-align: middle;
  margin: 0 2px; border-radius: 6px;
}
#emoticon-grid span, #emoticon-grid-bible span { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }
.movie-sync-status { color: #8b949e; font-size: 11px; margin-left: 8px; }

/* May 6 command modal + Gaming Room patch */
#nice-prompt-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 6000;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
  padding: 18px;
}
.nice-prompt-box {
  width: min(460px, 94vw);
  background: linear-gradient(145deg, #034476, #022d50);
  border: 2px solid #045a8f;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 24px;
  color: #fff;
  animation: popIn 0.18s ease;
}
.nice-prompt-box h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
}
.nice-prompt-box label {
  display: block;
  margin-bottom: 12px;
  color: #d9edf7;
  line-height: 1.45;
}
.nice-prompt-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #07a3d7;
  background: rgba(0,0,0,.28);
  color: #fff;
  outline: none;
  font-size: 15px;
}
.nice-prompt-box input:focus { border-color: #8ecae6; box-shadow: 0 0 0 3px rgba(142,202,230,.18); }
.nice-prompt-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.nice-prompt-actions button { border: none; border-radius: 10px; padding: 10px 18px; cursor: pointer; color: #fff; font-weight: 800; }
#nice-prompt-cancel { background: #596068; }
#nice-prompt-ok { background: linear-gradient(145deg,#2ecc71,#27ae60); }

.gaming-room-stage {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
  box-sizing: border-box;
  color: #e6edf3;
  overflow-y: auto;
}
.gaming-room-stage .game-menu,
.gaming-room-stage .game-invite-panel,
.gaming-room-stage .game-container {
  width: 100%;
}
.gaming-room-stage h2 {
  margin: 0 0 8px;
  color: #8ecae6;
  font-size: 20px;
}
.game-room-hint {
  margin: 0 0 16px;
  color: #8b949e;
  font-size: 13px;
  line-height: 1.4;
}
#chat-area.gaming-mode #btn-games {
  background: linear-gradient(145deg,#2ecc71,#27ae60);
  color: #fff;
}
#chat-area:not(.gaming-mode) #btn-games::after {
  content: '';
}
#main-gaming-area #game-canvas-wrapper {
  width: 100%;
  box-sizing: border-box;
}
#main-gaming-area .game-controls button {
  border-radius: 8px;
  font-weight: 700;
}

/* May 6 profile/image/chat targeting polish */
.msg-avatar,
.msg-sender,
.user-name,
.msg-username {
  cursor: pointer;
}
.msg-avatar:hover {
  outline: 2px solid rgba(3, 68, 118, 0.35);
  outline-offset: 2px;
}
.msg-sender:hover,
.user-name:hover,
.msg-username:hover {
  text-decoration: underline;
}
.chat-image-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 4px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(3, 68, 118, 0.28);
  background: linear-gradient(180deg, #f4fbff, #dcedfb);
  color: #034476;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: zoom-in;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.chat-image-icon:hover {
  background: linear-gradient(180deg, #ffffff, #cfe8fb);
  transform: translateY(-1px);
}
#profile-view img {
  border: 2px solid rgba(3, 68, 118, 0.35);
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}


/* May 6 self-protection + VIP sticky notes */
#btn-sticky-notes { color: #ffd166; }
#btn-sticky-notes:hover { color: #fff; text-shadow: 0 0 8px rgba(255,209,102,0.65); }
.sticky-notes-content { max-width: 520px; }
.sticky-note-help { color: #9fb7cc; margin: 2px 0 12px; font-size: 13px; }
#sticky-notes-list { display: grid; gap: 8px; margin: 10px 0 14px; max-height: 300px; overflow-y: auto; }
.sticky-note-item { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid rgba(4,90,143,0.65); border-radius:12px; background:linear-gradient(145deg, rgba(3,68,118,0.78), rgba(2,36,66,0.92)); box-shadow: inset 0 0 10px rgba(255,255,255,0.03); }
.sticky-note-text { color:#e6edf3; line-height:1.35; overflow-wrap:anywhere; }
.sticky-note-delete { flex:0 0 auto; border:none; border-radius:9px; padding:5px 8px; color:#fff; background:rgba(233,69,96,0.85); cursor:pointer; }
.sticky-note-delete:hover { background:#e94560; }
.sticky-note-compose { border-top:1px solid rgba(255,255,255,0.1); padding-top:12px; }
#sticky-note-input { width:100%; min-height:72px; resize:vertical; border-radius:12px; border:1px solid #045a8f; background:#061c32; color:#fff; padding:10px; }
.sticky-note-footer { display:flex; justify-content:space-between; align-items:center; margin-top:8px; color:#9fb7cc; }
#sticky-note-add { border:none; border-radius:10px; padding:8px 14px; background:linear-gradient(145deg,#2ecc71,#229954); color:#fff; font-weight:700; cursor:pointer; }
.context-disabled { opacity:0.4; pointer-events:none; display:none !important; }


/* May 6 finish pass: keep essential controls visible inside Movie/Gaming rooms. */
#chat-area.movie-mode #movie-controls { order: 1; }
#chat-area.movie-mode #movie-split-layout { order: 2; }
#chat-area.gaming-mode #gaming-split-layout { order: 1; }
#chat-area.movie-mode #chat-header,
#chat-area.gaming-mode #chat-header {
  padding: 6px 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.28);
  z-index: 20;
}
#chat-area.movie-mode #header-actions,
#chat-area.gaming-mode #header-actions {
  width: 100%;
  justify-content: flex-end;
  gap: 3px;
}
#chat-area.movie-mode .layout-group,
#chat-area.gaming-mode .layout-group,
#chat-area.movie-mode .admin-group,
#chat-area.gaming-mode .admin-group {
  display: none !important;
}
#chat-area.movie-mode #header-actions button,
#chat-area.gaming-mode #header-actions button {
  width: 30px;
  height: 30px;
  padding: 6px;
}
#chat-area.movie-mode .media-group,
#chat-area.gaming-mode .media-group,
#chat-area.movie-mode .view-group,
#chat-area.gaming-mode .view-group,
#chat-area.movie-mode .user-group,
#chat-area.gaming-mode .user-group,
#chat-area.movie-mode .exit-group,
#chat-area.gaming-mode .exit-group {
  display: flex;
}
#chat-area.movie-mode #btn-donate,
#chat-area.gaming-mode #btn-donate,
#chat-area.movie-mode #btn-friends,
#chat-area.gaming-mode #btn-friends,
#chat-area.movie-mode #btn-notify,
#chat-area.gaming-mode #btn-notify,
#chat-area.movie-mode #btn-sticky-notes,
#chat-area.gaming-mode #btn-sticky-notes {
  display: none !important;
}
#chat-area.gaming-mode #btn-games { display: flex !important; }
#chat-area.movie-mode #btn-games { display: flex !important; }
#center-notice-toast.center-notice span:first-child { line-height: 1; }
.radio-status {
  display: block;
  color: #8ecae6;
  font-size: 11px;
  line-height: 1.35;
  padding: 8px 2px 0;
}


/* May 7 continuation: prevent small-phone input panels from being covered or pushed offscreen. */
html, body { height: 100%; }
#chat-screen { height: 100vh; height: 100dvh; }
#chat-layout, #chat-area { min-height: 0; }
#messages, #movie-messages-main, #gaming-messages-main, #private-messages { min-height: 0; overflow-anchor: none; }
#typing-area, #movie-input-wrapper, #gaming-input-wrapper, #private-input-area { flex-shrink: 0; }
#right-panel:not(.panel-visible) { pointer-events: none; }
#right-panel.panel-visible { pointer-events: auto; }
@media (max-width: 600px) {
  body { overflow: hidden; }
  #chat-screen, #chat-layout { height: 100dvh; max-height: 100dvh; }
  #chat-layout { gap: 0; padding: 0; }
  #left-panel { width: 52px !important; margin-left: 0; border-radius: 0; z-index: 20; }
  #left-panel:not(.collapsed) { width: min(78vw, 230px) !important; position: fixed; left: 0; top: 0; bottom: 0; z-index: 500; }
  #left-panel.collapsed { width: 52px !important; }
  #chat-area { height: 100dvh; max-height: 100dvh; border-radius: 0; border-width: 0; }
  #revolving-banner { border-radius: 0; }
  #messages { padding: 8px 8px 8px 10px; }
  #chat-header { padding: 5px 6px; overflow-x: auto; scrollbar-width: none; }
  #chat-header::-webkit-scrollbar { display: none; }
  #header-actions { max-width: none; min-width: max-content; }
  #typing-area { position: relative; z-index: 30; padding: 7px 7px calc(7px + env(safe-area-inset-bottom)); gap: 5px; border-radius: 0; }
  #my-avatar { display: none !important; }
  #input-tools { max-width: 118px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
  #input-tools::-webkit-scrollbar { display: none; }
  #input-tools > button { width: 34px; height: 34px; padding: 5px; flex-shrink: 0; }
  #message-input { min-width: 80px; width: 100%; font-size: 16px; padding: 10px 9px; }
  #send-btn { min-width: 42px; width: 42px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; }
  #right-panel { top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; width: 100vw !important; height: 100dvh !important; min-height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; border-width: 0 !important; z-index: 1200 !important; transform: translateY(100%) !important; opacity: 0; }
  #right-panel.panel-visible { transform: translateY(0) !important; opacity: 1; }
  #private-chat-header { border-radius: 0; padding-top: calc(10px + env(safe-area-inset-top)); cursor: default; }
  #private-messages { padding: 10px; }
  #private-input-area { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  #private-input-row1 { gap: 6px; }
  #private-message-input { min-width: 0; font-size: 16px; padding: 10px 9px; }
  #private-send-btn { min-width: 46px; padding: 0 10px; height: 40px; }
  #private-send-btn i { margin: 0; }
  #private-send-btn { font-size: 0; }
  #private-send-btn i { font-size: 15px; }
  .resize-handle { display: none; }
  #emoticon-panel { left: 6px !important; right: 6px !important; bottom: calc(60px + env(safe-area-inset-bottom)) !important; max-width: none !important; width: auto !important; }
  #center-notice-toast.center-notice { max-width: 82vw !important; font-size: 16px !important; padding: 14px 18px !important; }
}
@supports (-webkit-touch-callout: none) {
  #chat-screen, #chat-layout, #chat-area, #right-panel.panel-visible { height: -webkit-fill-available; }
}

/* Media-sharing polish: compressed uploads, safe link chips, private lightbox previews */
#image-upload-status {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  z-index: 3200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
#image-upload-status.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.image-upload-status-card {
  min-width: min(360px, 92vw);
  padding: 12px 14px;
  border-radius: 14px;
  background: #034476;
  color: #fff;
  box-shadow: 0 10px 32px rgba(0,0,0,0.35);
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}
.image-upload-status-card.done { background: #1f8f55; }
.image-upload-status-card .upload-progress {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
}
.image-upload-status-card .upload-progress b {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.9);
  transition: width .22s ease;
}
.image-upload-status-card .upload-progress b.indeterminate {
  width: 45%;
  animation: uploadIndeterminate 1.1s ease-in-out infinite alternate;
}
@keyframes uploadIndeterminate {
  from { transform: translateX(-20%); }
  to { transform: translateX(145%); }
}

.chat-linked-image {
  display: inline-block;
  margin: 4px 6px 4px 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  vertical-align: top;
}
.chat-linked-image img {
  max-width: min(220px, 55vw);
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(3,68,118,0.22);
  box-shadow: 0 3px 12px rgba(0,0,0,0.16);
  background: #eef6fc;
}
.chat-media-chip,
.chat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(3,68,118,0.28);
  background: linear-gradient(180deg, #f4fbff, #dcedfb);
  color: #034476;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.chat-media-chip:hover,
.chat-link:hover {
  background: linear-gradient(180deg, #ffffff, #cfe8fb);
  transform: translateY(-1px);
}
.chat-media-video { color: #9d2338; }

#lightbox-overlay #lightbox-video,
#lightbox-overlay #lightbox-open-original { display: none; }
#lightbox-overlay.video-mode #lightbox-img { display: none; }
#lightbox-overlay.video-mode #lightbox-video {
  display: block;
  width: min(92vw, 960px);
  height: min(52vw, 540px);
  min-height: 220px;
  border: 0;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#lightbox-overlay.video-mode #lightbox-open-original {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 520px) {
  .chat-linked-image img { max-width: 72vw; max-height: 160px; }
  #lightbox-overlay.video-mode #lightbox-video {
    width: 94vw;
    height: 56vw;
    min-height: 190px;
  }
}

/* May 7 local-test cleanup: active box, mobile tools menu, smiley tabs, image chips */
#pre-login-users {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100vw - 32px));
  min-height: 120px;
  max-height: 260px;
  overflow-y: auto;
}
#pre-login-user-list { max-height: 210px; overflow-y: auto; }
#pre-login-users li {
  min-height: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}
#header-menu-toggle {
  display: none;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  width: 36px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
#emoticon-grid-standard { max-height: 300px; overflow-y: auto; }
#emoticon-grid-standard span,
#emoticon-grid span,
#emoticon-grid-bible span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#emoticon-grid-standard .standard-smiley {
  font-size: 24px;
  background: rgba(255,255,255,0.04);
}
#emoticon-grid-standard .standard-smiley:hover {
  background: #1a2332;
}
.chat-media-image { color: #8ecae6; }

@media (max-width: 700px) {
  #chat-header {
    position: relative;
    overflow: visible !important;
    justify-content: space-between;
    min-height: 44px;
  }
  #header-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  #room-topic { display: none; }
  #header-actions {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: calc(100% + 6px);
    display: none;
    grid-template-columns: repeat(5, minmax(38px, 1fr));
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    background: #022d50;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
    z-index: 900;
    margin: 0;
    min-width: 0;
  }
  #header-actions.mobile-open { display: grid; }
  #header-actions .badge,
  #header-actions #room-topic { display: none !important; }
  #header-actions .header-group {
    display: contents;
    background: transparent;
    padding: 0;
    margin: 0;
    border: 0;
  }
  #header-actions button {
    width: 100%;
    min-width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
  }
  #header-actions button[title]:hover::after { display: none; }
  #header-actions .exit-group #logout-btn {
    background: rgba(255,107,107,0.16);
    border-color: rgba(255,107,107,0.35);
  }
  #left-panel.collapsed { width: 52px !important; }
  #left-panel:not(.collapsed) {
    width: min(78vw, 230px) !important;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 500;
  }
  #chat-area { min-width: 0; }
}


/* May 10 - compact user-list rank badges, no avatar in user list */
#user-list li .badge.rank-icon-only,
#my-rank-badge.badge.rank-icon-only {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  padding: 0 !important;
  margin: 0 4px 0 2px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

#user-list li .badge.rank-icon-only i,
#my-rank-badge.badge.rank-icon-only i {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

#user-list li > .msg-avatar,
#user-list li > img.msg-avatar,
#user-list li > img.user-avatar {
  display: none !important;
}

#user-list li {
  gap: 3px !important;
}


/* May 10 - Per-user normal chat message text accessibility mode
   Only affects the main normal chat message area, not room/user lists or gaming/movie chat. */
body.force-normal-message-black #messages .msg-text,
body.force-normal-message-black #messages .msg-me-text,
body.force-normal-message-black #messages .msg-content,
body.force-normal-message-black #messages .msg-text * {
  color: #111 !important;
}

body.force-normal-message-white #messages .msg-text,
body.force-normal-message-white #messages .msg-me-text,
body.force-normal-message-white #messages .msg-content,
body.force-normal-message-white #messages .msg-text * {
  color: #fff !important;
}

.settings-hint {
  color: #64748b;
  font-size: 12px;
  margin: 4px 0 8px;
}

#message-text-mode {
  margin-left: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}


/* May 10 - Message text mode refresh fix
   Default/User Colors must not force black after refresh. */
body.message-text-default #messages .msg-text,
body.message-text-default #messages .msg-me-text {
  /* no forced color here; inline user font colors win */
}
body.force-normal-message-black #messages .msg-text,
body.force-normal-message-black #messages .msg-me-text,
body.force-normal-message-black #messages .msg-content,
body.force-normal-message-black #messages .msg-text * {
  color: #111 !important;
}
body.force-normal-message-white #messages .msg-text,
body.force-normal-message-white #messages .msg-me-text,
body.force-normal-message-white #messages .msg-content,
body.force-normal-message-white #messages .msg-text * {
  color: #fff !important;
}


/* May 10 - Room-wide chat zoom + matching input text size
   Users who zoom message history need the text they are typing to zoom too. */
#messages.zoom-100, #private-messages.zoom-100, #movie-messages-main.zoom-100, #gaming-messages-main.zoom-100 { font-size: 12px; }
#messages.zoom-115, #private-messages.zoom-115, #movie-messages-main.zoom-115, #gaming-messages-main.zoom-115 { font-size: 14px; }
#messages.zoom-130, #private-messages.zoom-130, #movie-messages-main.zoom-130, #gaming-messages-main.zoom-130 { font-size: 16px; }
#messages.zoom-145, #private-messages.zoom-145, #movie-messages-main.zoom-145, #gaming-messages-main.zoom-145 { font-size: 18px; }
#messages.zoom-150, #private-messages.zoom-150, #movie-messages-main.zoom-150, #gaming-messages-main.zoom-150 { font-size: 20px; }

#message-input.zoom-100, #private-message-input.zoom-100, #movie-input.zoom-100, #gaming-input.zoom-100 { font-size: 14px !important; line-height: 1.35 !important; }
#message-input.zoom-115, #private-message-input.zoom-115, #movie-input.zoom-115, #gaming-input.zoom-115 { font-size: 16px !important; line-height: 1.35 !important; }
#message-input.zoom-130, #private-message-input.zoom-130, #movie-input.zoom-130, #gaming-input.zoom-130 { font-size: 18px !important; line-height: 1.35 !important; }
#message-input.zoom-145, #private-message-input.zoom-145, #movie-input.zoom-145, #gaming-input.zoom-145 { font-size: 20px !important; line-height: 1.35 !important; }
#message-input.zoom-150, #private-message-input.zoom-150, #movie-input.zoom-150, #gaming-input.zoom-150 { font-size: 22px !important; line-height: 1.35 !important; }

/* Give bigger typed text enough room without breaking the layout. */
#message-input.zoom-130, #message-input.zoom-145, #message-input.zoom-150,
#private-message-input.zoom-130, #private-message-input.zoom-145, #private-message-input.zoom-150,
#movie-input.zoom-130, #movie-input.zoom-145, #movie-input.zoom-150,
#gaming-input.zoom-130, #gaming-input.zoom-145, #gaming-input.zoom-150 {
  min-height: 42px !important;
}

#message-input.zoom-145, #message-input.zoom-150,
#private-message-input.zoom-145, #private-message-input.zoom-150,
#movie-input.zoom-145, #movie-input.zoom-150,
#gaming-input.zoom-145, #gaming-input.zoom-150 {
  min-height: 46px !important;
}

/* May 10 - Emoticon picker button repair */
#emoticon-panel {
  z-index: 5000 !important;
  max-width: min(420px, calc(100vw - 12px)) !important;
  max-height: min(360px, calc(100vh - 12px)) !important;
}
#emoticon-panel .emoticon-panel.active {
  display: grid !important;
}
#emoticon-grid-standard,
#emoticon-grid,
#emoticon-grid-bible {
  max-height: 300px !important;
  overflow-y: auto !important;
}


/* May 10 - Emoticon fallback + message text mode hardening */
.emoticon-missing-fallback {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 34px !important;
  min-height: 28px !important;
  font-size: 11px !important;
  color: #334155 !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
}
body.message-text-default #messages .msg-text[style*="color"],
body.message-text-default #messages .msg-text[style*="color"] * {
  /* inline user colors remain authoritative in default mode */
}


/* May 11 - Final emoticon picker viewport fit */
#emoticon-panel {
  position: fixed !important;
  z-index: 9000 !important;
  width: min(430px, calc(100vw - 20px)) !important;
  max-width: calc(100vw - 20px) !important;
  max-height: calc(100vh - 20px) !important;
  overflow: hidden !important;
}
#emoticon-panel .emoticon-panel.active,
#emoticon-grid-standard,
#emoticon-grid,
#emoticon-grid-bible {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
}
#emoticon-tabs {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
}
@media (max-width: 520px) {
  #emoticon-panel {
    width: calc(100vw - 16px) !important;
    left: 8px !important;
    right: 8px !important;
  }
  .emoticon-panel.active {
    grid-template-columns: repeat(7, 1fr) !important;
  }
}

/* May 10 - Friends/private-message unread helpers */
#btn-friends.has-unread-pm { position: relative; }
#btn-friends.has-unread-pm::after {
  content: attr(data-unread-pm);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.friend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 0;
}
.friend-row .friend-name { font-weight: 700; margin-right: auto; }
.pm-unread-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.unread-private-list {
  margin: 8px 0 12px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(15,23,42,.08);
}
.unread-private-list:empty { display: none; }


/* May 11 - Message text mode final guard: default/use-user-colors must not force black/white. */
body.message-text-default #messages .msg-text,
body.message-text-default #messages .msg-me-text,
body.message-text-default #messages .msg-content {
  color: inherit;
}
body.message-text-default #messages .msg-text[style*="color"],
body.message-text-default #messages .msg-text[style*="color"] * {
  color: inherit;
}
body.message-text-default.force-normal-message-black #messages .msg-text,
body.message-text-default.force-normal-message-black #messages .msg-me-text,
body.message-text-default.force-normal-message-black #messages .msg-content,
body.message-text-default.force-normal-message-white #messages .msg-text,
body.message-text-default.force-normal-message-white #messages .msg-me-text,
body.message-text-default.force-normal-message-white #messages .msg-content {
  color: inherit !important;
}


/* May 10 - BibleGateway iframe-in-popup and Games label polish */
#bible-content {
  position: relative;
  min-height: 260px;
}
#bible-frame {
  display: none;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 300px;
  border: 0;
  background: #fff;
}
#bible-frame.loaded {
  display: block !important;
}
#bible-content.has-frame .bible-placeholder {
  display: none !important;
}
#btn-games.labeled-header-btn {
  width: auto !important;
  min-width: 66px !important;
  padding-left: 8px !important;
  padding-right: 9px !important;
  gap: 5px !important;
}
#btn-games .header-button-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
#chat-area.movie-mode #btn-games.labeled-header-btn,
#chat-area.gaming-mode #btn-games.labeled-header-btn {
  width: auto !important;
  min-width: 66px !important;
  padding-left: 8px !important;
  padding-right: 9px !important;
}
@media (max-width: 720px) {
  #btn-games.labeled-header-btn {
    min-width: 58px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
  #btn-games .header-button-label {
    font-size: 10px;
  }
}


/* May 11 - Definitive message text mode + Games hover tooltip fix */
body.message-text-default #messages .msg-text,
body.message-text-default #messages .msg-me-text,
body.message-text-default #messages .msg-content {
  /* default mode does not force a color; inline per-user font colors win */
}
body.message-text-default #messages .msg-text[style*="color"] {
  /* preserve inline user colors */
}
body.message-text-black #messages .msg-text,
body.force-normal-message-black #messages .msg-text,
body.message-text-black #messages .msg-me-text,
body.force-normal-message-black #messages .msg-me-text,
body.message-text-black #messages .msg-content,
body.force-normal-message-black #messages .msg-content,
body.message-text-black #messages .msg-text *,
body.force-normal-message-black #messages .msg-text * {
  color: #111 !important;
}
body.message-text-white #messages .msg-text,
body.force-normal-message-white #messages .msg-text,
body.message-text-white #messages .msg-me-text,
body.force-normal-message-white #messages .msg-me-text,
body.message-text-white #messages .msg-content,
body.force-normal-message-white #messages .msg-content,
body.message-text-white #messages .msg-text *,
body.force-normal-message-white #messages .msg-text * {
  color: #fff !important;
}
#btn-games[data-tooltip] {
  position: relative !important;
}
#btn-games[data-tooltip]:hover::after,
#btn-games[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip) !important;
  position: absolute !important;
  bottom: calc(100% + 8px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: rgba(15, 23, 42, 0.96) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  z-index: 10000 !important;
  pointer-events: none !important;
}
#btn-games .header-button-label {
  display: none !important;
}


/* May 11 - /me action message styling */
.msg-me-action {
  justify-content: center !important;
  text-align: center !important;
  opacity: 0.96;
}

.msg-me-action .msg-me-action-line,
.msg-me-action .msg-content {
  display: inline-block !important;
  margin: 4px auto !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  background: rgba(148, 163, 184, 0.14) !important;
  color: #dbeafe !important;
  font-style: italic !important;
  font-weight: 500 !important;
}

#messages .msg-me-action .msg-me-text,
#private-messages .msg-me-action .msg-me-text,
#movie-messages-main .msg-me-action .msg-me-text,
#gaming-messages-main .msg-me-action .msg-me-text {
  font-style: italic !important;
}

body.message-text-black #messages .msg-me-action .msg-me-text,
body.force-normal-message-black #messages .msg-me-action .msg-me-text {
  color: #000 !important;
}

body.message-text-white #messages .msg-me-action .msg-me-text,
body.force-normal-message-white #messages .msg-me-action .msg-me-text {
  color: #fff !important;
}


/* May 11 - /me action should look like a normal italic chat line, not a centered pill/button */
.msg-me-action {
  justify-content: flex-start !important;
  text-align: left !important;
  opacity: 1 !important;
}

.msg-me-action .msg-me-action-line,
.msg-me-action .msg-content {
  display: block !important;
  margin: 2px 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-style: italic !important;
  font-weight: 400 !important;
  cursor: default !important;
}

#messages .msg-me-action .msg-me-text {
  color: #111 !important;
  font-style: italic !important;
  font-weight: 400 !important;
}

#movie-messages-main .msg-me-action .msg-me-text,
#gaming-messages-main .msg-me-action .msg-me-text,
#private-messages .msg-me-action .msg-me-text {
  font-style: italic !important;
  font-weight: 400 !important;
}

body.message-text-black #messages .msg-me-action .msg-me-text,
body.force-normal-message-black #messages .msg-me-action .msg-me-text {
  color: #000 !important;
}

body.message-text-white #messages .msg-me-action .msg-me-text,
body.force-normal-message-white #messages .msg-me-action .msg-me-text {
  color: #fff !important;
}


/* May 11 - Keep Friends visible in Movie/Gaming rooms for PM/friend notifications */
#chat-area.movie-mode #btn-friends,
#chat-area.gaming-mode #btn-friends {
  display: inline-flex !important;
}

/* Movie lineup wording: one clear add button; hidden legacy queue button retained for JS compatibility */
#btn-movie-queue {
  display: none !important;
}

#btn-movie-load {
  min-width: 128px;
}

/* May 11 - PM/message text mode consistency fix
   Applies the same user-color / force-black / force-white rules to private, movie,
   and gaming message panes as normal room chat. This prevents PMs from rendering
   black live and then changing to colored after PM history reloads. */
body.message-text-default #messages .msg-text,
body.message-text-default #messages .msg-me-text,
body.message-text-default #messages .msg-content,
body.message-text-default #private-messages .msg-text,
body.message-text-default #private-messages .msg-me-text,
body.message-text-default #private-messages .msg-content,
body.message-text-default #movie-messages-main .msg-text,
body.message-text-default #movie-messages-main .msg-me-text,
body.message-text-default #movie-messages-main .msg-content,
body.message-text-default #gaming-messages-main .msg-text,
body.message-text-default #gaming-messages-main .msg-me-text,
body.message-text-default #gaming-messages-main .msg-content {
  /* default/user-color mode does not force a color; inline per-user colors win */
}

body.message-text-black #messages .msg-text,
body.force-normal-message-black #messages .msg-text,
body.message-text-black #messages .msg-me-text,
body.force-normal-message-black #messages .msg-me-text,
body.message-text-black #messages .msg-content,
body.force-normal-message-black #messages .msg-content,
body.message-text-black #messages .msg-text *,
body.force-normal-message-black #messages .msg-text *,
body.message-text-black #private-messages .msg-text,
body.force-normal-message-black #private-messages .msg-text,
body.message-text-black #private-messages .msg-me-text,
body.force-normal-message-black #private-messages .msg-me-text,
body.message-text-black #private-messages .msg-content,
body.force-normal-message-black #private-messages .msg-content,
body.message-text-black #private-messages .msg-text *,
body.force-normal-message-black #private-messages .msg-text *,
body.message-text-black #movie-messages-main .msg-text,
body.force-normal-message-black #movie-messages-main .msg-text,
body.message-text-black #movie-messages-main .msg-me-text,
body.force-normal-message-black #movie-messages-main .msg-me-text,
body.message-text-black #movie-messages-main .msg-content,
body.force-normal-message-black #movie-messages-main .msg-content,
body.message-text-black #movie-messages-main .msg-text *,
body.force-normal-message-black #movie-messages-main .msg-text *,
body.message-text-black #gaming-messages-main .msg-text,
body.force-normal-message-black #gaming-messages-main .msg-text,
body.message-text-black #gaming-messages-main .msg-me-text,
body.force-normal-message-black #gaming-messages-main .msg-me-text,
body.message-text-black #gaming-messages-main .msg-content,
body.force-normal-message-black #gaming-messages-main .msg-content,
body.message-text-black #gaming-messages-main .msg-text *,
body.force-normal-message-black #gaming-messages-main .msg-text * {
  color: #111 !important;
}

body.message-text-white #messages .msg-text,
body.force-normal-message-white #messages .msg-text,
body.message-text-white #messages .msg-me-text,
body.force-normal-message-white #messages .msg-me-text,
body.message-text-white #messages .msg-content,
body.force-normal-message-white #messages .msg-content,
body.message-text-white #messages .msg-text *,
body.force-normal-message-white #messages .msg-text *,
body.message-text-white #private-messages .msg-text,
body.force-normal-message-white #private-messages .msg-text,
body.message-text-white #private-messages .msg-me-text,
body.force-normal-message-white #private-messages .msg-me-text,
body.message-text-white #private-messages .msg-content,
body.force-normal-message-white #private-messages .msg-content,
body.message-text-white #private-messages .msg-text *,
body.force-normal-message-white #private-messages .msg-text *,
body.message-text-white #movie-messages-main .msg-text,
body.force-normal-message-white #movie-messages-main .msg-text,
body.message-text-white #movie-messages-main .msg-me-text,
body.force-normal-message-white #movie-messages-main .msg-me-text,
body.message-text-white #movie-messages-main .msg-content,
body.force-normal-message-white #movie-messages-main .msg-content,
body.message-text-white #movie-messages-main .msg-text *,
body.force-normal-message-white #movie-messages-main .msg-text *,
body.message-text-white #gaming-messages-main .msg-text,
body.force-normal-message-white #gaming-messages-main .msg-text,
body.message-text-white #gaming-messages-main .msg-me-text,
body.force-normal-message-white #gaming-messages-main .msg-me-text,
body.message-text-white #gaming-messages-main .msg-content,
body.force-normal-message-white #gaming-messages-main .msg-content,
body.message-text-white #gaming-messages-main .msg-text *,
body.force-normal-message-white #gaming-messages-main .msg-text * {
  color: #fff !important;
}

/* May 11 maintenance countdown safety patch */
#maintenance-countdown {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin-top: 12px;
}
#maintenance-modal .maintenance-small {
  color: #8b949e;
  font-size: 12px;
}
