/* ----- signed-in pages: header, floating menu, lobby, rooms (CodyChat's layout and Dark values) ----- */
.page-app { background: var(--bg); }

.app-head { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; height: 50px; padding: 0 10px; background: var(--bg-head); }
.app-brand { display: block; }
.app-brand img { height: 40px; width: auto; display: block; }
.app-head-gap { flex: 1; }
.head-avatar { display: block; padding: 0; border: 0; border-radius: 50%; background: none; }
.head-avatar .avatar { width: 36px; height: 36px; }
.head-avatar:hover .avatar { filter: brightness(1.15); }

.float-menu { position: fixed; top: 52px; right: 10px; z-index: 60; width: 230px; padding: 4px 0; border-radius: var(--radius-sm); background: var(--bg-menu); box-shadow: var(--shadow); animation: cb-pop .14s ease both; }
.fmenu-item { display: flex; align-items: center; gap: 4px; width: 100%; padding: 12px 16px; border: 0; background: none; color: var(--text); text-align: left; font-size: var(--fs-md); }
.fmenu-item:hover { background: var(--row-hover); text-decoration: none; }
.fmenu-item i { width: 28px; text-align: center; color: var(--text-muted); }

.page { width: 100%; max-width: 1100px; margin: 0 auto; padding: 18px 12px 60px 12px; }
.page-card { margin: 0 0 10px 0; padding: 20px; border-radius: 4px; background: var(--bg-elev); }

/* lobby */
.lobby-control { padding: 14px 20px 20px 20px; }
.lobby-add { padding: 5px 0 10px 0; }
.input-search { height: 46px; }
.room-listing { padding: 6px 10px; }

.room-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--row-line); cursor: pointer; position: relative; overflow: hidden; }
.room-card:last-child { border-bottom: 0; }
.room-card:hover, .room-card:focus-visible { background: var(--row-hover); }
.room-card.is-hidden { display: none; }
.room-icon-wrap { flex: none; width: 60px; height: 60px; }
.room-icon { display: block; width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }
.room-icon-sm { width: 44px; height: 44px; border-radius: 8px; }
.room-content { flex: 1; min-width: 0; padding-left: 2px; }
.room-name { font-size: 16px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-desc { font-size: 12px; padding: 3px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-tags { display: flex; align-items: center; gap: 6px; }
.room-tag { display: block; width: 16px; height: 16px; border-radius: 50%; }
.room-count { margin-left: auto; padding-right: 2px; font-size: 15px; font-weight: 700; }

/* room page */
.room-banner { display: flex; align-items: center; gap: 16px; }
.room-banner .room-icon { width: 72px; height: 72px; flex: none; }
.room-banner-text { flex: 1; min-width: 0; }
.room-title { font-size: 22px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-banner .room-tags { margin-top: 6px; justify-content: flex-start; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; align-items: start; }
.room-chat { min-height: 340px; display: flex; align-items: center; justify-content: center; }
.room-users { padding: 14px 10px; margin: 0; }
.side-title { padding: 0 10px 8px 10px; font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.side-empty { padding: 6px 10px; }
.user-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; text-align: left; color: var(--text); }
.user-row:hover { background: var(--row-hover); }
.user-av { position: relative; flex: none; }
.state-dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--bg-elev); background: var(--bg-elev); }
.user-text { flex: 1; min-width: 0; display: block; }
.user-name { display: block; font-weight: 700; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-sub { display: block; font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-rank { width: 18px; height: 18px; flex: none; }
.pass-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px 0; }
.pass-head .modal-title { margin: 0; }

@media (max-width: 800px) {
  .room-grid { grid-template-columns: 1fr; }
  .room-banner { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .page { padding: 10px 6px 50px 6px; }
  .page-card { padding: 14px; }
  .lobby-control { padding: 10px 14px 14px 14px; }
  .room-icon-wrap, .room-icon { width: 52px; height: 52px; }
}
.room-card.is-busy { opacity: .55; pointer-events: none; }
