* { box-sizing: border-box; margin: 0; padding: 0; }

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

:root {
  --bg: #0F0F0F;
  --surface: #2A2929;
  --surface-2: #444342;
  --border: rgba(255, 183, 0, 0.18);
  --text: #F5F5F5;
  --text-dim: #c9c2a8;
  --accent: #FFB700;
  --accent-hover: #FFD000;
  --self: #FFB700;
  --other: #2A2929;
  --danger: #ff5b5b;
  --online: #FFD000;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 183, 0, 0.12), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(255, 208, 0, 0.08), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(255, 183, 0, 0.06), transparent 30%);
  pointer-events: none;
  z-index: 0;
}

.screen {
  display: none;
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
}

.with-topbar {
  padding-top: 72px;
}

/* ===== GLOBAL TOP BAR ===== */
.global-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 20;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 183, 0, 0.12);
}

.global-brand-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.global-brand-btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.global-brand-btn:active {
  transform: translateY(0);
}

.global-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(255, 183, 0, 0.22);
}

.global-brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--accent);
}

/* ===== ENTRY / ROOM SCREENS ===== */
#nameScreen, #roomScreen, #adminLoginScreen {
  justify-content: center;
  align-items: center;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 20px;
}

.card {
  background: rgba(42, 41, 41, 0.9);
  border: 1px solid var(--border);
  padding: 50px 40px;
  border-radius: 22px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  animation: fadeUp 0.45s ease;
}

.card-wide {
  max-width: 540px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--accent);
  letter-spacing: 0.2px;
}

.subtitle {
  color: var(--text-dim);
  margin-bottom: 32px;
  font-size: 14px;
}

#nameInput,
#pwInput,
#adminPwInput {
  width: 100%;
  padding: 14px 18px;
  background: #1b1b1b;
  border: 1px solid rgba(255, 183, 0, 0.14);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: all 0.2s;
  margin-bottom: 16px;
  font-family: inherit;
}

#nameInput:focus,
#pwInput:focus,
#adminPwInput:focus,
#roomInput:focus,
#newRoomName:focus,
.plain-input:focus,
#msgInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 183, 0, 0.16);
}

#nameNextBtn,
#adminLoginBtn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

#nameNextBtn:hover:not(:disabled),
#adminLoginBtn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

#nameNextBtn:disabled,
#adminLoginBtn:disabled,
#joinRoomBtn:disabled,
#sendBtn:disabled,
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.admin-link:hover {
  color: var(--accent);
}

/* ===== ROOM SELECTOR ===== */
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
  gap: 12px;
}

.room-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}

.room-header h2 span {
  color: var(--accent);
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.text-btn:hover {
  color: var(--text);
  background: rgba(255, 183, 0, 0.08);
}

#roomScreen .subtitle {
  text-align: left;
  margin-bottom: 28px;
}

.section-label {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  text-align: left;
}

.room-list-section {
  text-align: left;
}

.room-list {
  background: #1a1a1a;
  border: 1px solid rgba(255, 183, 0, 0.12);
  border-radius: 12px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.room-list::-webkit-scrollbar { width: 8px; }
.room-list::-webkit-scrollbar-thumb {
  background: rgba(255, 183, 0, 0.24);
  border-radius: 4px;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  color: var(--text);
}

.room-item:hover {
  background: rgba(255, 183, 0, 0.08);
  transform: translateX(2px);
}

.room-item-hash {
  color: var(--accent);
  font-weight: 800;
  font-size: 18px;
}

.room-item-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-item-admin-badge {
  font-size: 10px;
  background: var(--accent);
  color: #111;
  padding: 3px 7px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.room-item-lock {
  color: var(--text-dim);
  font-size: 14px;
  margin-left: auto;
}

.empty-rooms {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
}

.divider {
  position: relative;
  text-align: center;
  margin: 28px 0;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 183, 0, 0.14);
  z-index: 0;
}

.divider span {
  background: var(--surface);
  padding: 0 14px;
  position: relative;
  z-index: 1;
}

.create-room {
  text-align: left;
}

.room-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 183, 0, 0.14);
  border-radius: 12px;
  padding: 4px 4px 4px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.room-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 183, 0, 0.12);
}

.hash {
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

#roomInput,
#newRoomName {
  flex: 1;
  min-width: 0;
  padding: 10px 4px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

#joinRoomBtn {
  padding: 10px 20px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  flex-shrink: 0;
}

#joinRoomBtn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.hint {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 8px;
  text-align: left;
}

/* ===== PASSWORD OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.overlay-card {
  background: var(--surface);
  border: 1px solid rgba(255, 183, 0, 0.18);
  padding: 32px;
  border-radius: 18px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.lock-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.overlay-card h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.overlay-card p {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 20px;
}

.overlay-card p span {
  color: var(--accent);
  font-weight: 700;
}

.pw-error {
  color: #ff7b7b;
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 12px;
}

.overlay-buttons {
  display: flex;
  gap: 10px;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #111;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: #1a1a1a;
  color: var(--text);
  border: 1px solid rgba(255, 183, 0, 0.14);
}

.btn-secondary:hover {
  background: rgba(255, 183, 0, 0.06);
}

/* ===== CHAT SCREEN ===== */
#chatScreen {
  flex-direction: row;
  overflow: hidden;
}

#sidebar {
  width: 240px;
  flex: 0 0 240px;
  background: rgba(42, 41, 41, 0.92);
  border-right: 1px solid rgba(255, 183, 0, 0.12);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: margin-left 0.3s ease;
}

#sidebar.hidden {
  margin-left: -240px;
}

.sidebar-header {
  padding: 20px 20px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 183, 0, 0.12);
  flex-shrink: 0;
}

.online-label {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.online-count {
  background: var(--accent);
  color: #111;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}

#usersList {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  min-height: 0;
}

#usersList::-webkit-scrollbar { width: 8px; }
#usersList::-webkit-scrollbar-track { background: transparent; }
#usersList::-webkit-scrollbar-thumb {
  background: rgba(255, 183, 0, 0.22);
  border-radius: 4px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  transition: background 0.15s;
}

.user-item:hover {
  background: rgba(255, 183, 0, 0.06);
}

.user-item.is-self {
  background: rgba(255, 183, 0, 0.08);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-item.is-self .user-name::after {
  content: ' (you)';
  color: var(--text-dim);
  font-size: 12px;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 10px rgba(255, 208, 0, 0.7);
  flex-shrink: 0;
}

.empty-users {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
}

.chat-main {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(15, 15, 15, 0.92);
  border-bottom: 1px solid rgba(255, 183, 0, 0.12);
  flex-shrink: 0;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(255, 183, 0, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 18px;
  font-weight: 800;
}

.brand-app-name {
  color: var(--accent);
}

.brand-divider {
  color: var(--text-dim);
}

.room-hash {
  color: var(--accent-hover);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
  flex-shrink: 0;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 12px rgba(255, 208, 0, 0.8);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

#displayName {
  color: var(--text);
  font-weight: 700;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  background: transparent;
  border: 1px solid rgba(255, 183, 0, 0.14);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.icon-btn:hover {
  background: rgba(255, 183, 0, 0.08);
  color: var(--accent-hover);
  border-color: rgba(255, 183, 0, 0.28);
}

.icon-btn.danger:hover {
  background: rgba(255, 91, 91, 0.18);
  color: #fff;
  border-color: rgba(255, 91, 91, 0.4);
}

.icon-btn.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

#leaveBtn {
  width: 32px;
  height: 32px;
  margin-left: 4px;
  font-size: 14px;
}

main {
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

main::-webkit-scrollbar { width: 8px; }
main::-webkit-scrollbar-track { background: transparent; }
main::-webkit-scrollbar-thumb {
  background: rgba(255, 183, 0, 0.22);
  border-radius: 4px;
}

.message {
  max-width: 70%;
  animation: msgIn 0.25s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message.self { align-self: flex-end; }
.message.other { align-self: flex-start; }

.msg-name {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
  padding: 0 4px;
  font-weight: 700;
}

.message.self .msg-name {
  text-align: right;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.message.self .msg-bubble {
  background: var(--self);
  color: #111;
  border-bottom-right-radius: 4px;
  font-weight: 700;
}

.message.other .msg-bubble {
  background: var(--other);
  color: var(--text);
  border: 1px solid rgba(255, 183, 0, 0.08);
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  padding: 0 4px;
}

.message.self .msg-time {
  text-align: right;
}

.system-msg {
  align-self: center;
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
  padding: 8px 16px;
  background: rgba(255, 183, 0, 0.06);
  border-radius: 20px;
  border: 1px solid rgba(255, 183, 0, 0.12);
}

footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(15, 15, 15, 0.92);
  border-top: 1px solid rgba(255, 183, 0, 0.12);
  flex-shrink: 0;
  align-items: center;
}

.input-wrapper {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 8px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 183, 0, 0.14);
  border-radius: 999px;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 183, 0, 0.12);
}

.input-wrapper .icon-btn {
  border: none;
  width: 36px;
  height: 36px;
}

.input-wrapper .icon-btn:hover {
  background: rgba(255, 183, 0, 0.1);
  border: none;
  color: var(--accent);
}

#msgInput {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

#sendBtn {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
}

#sendBtn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: scale(1.05);
}

#sendBtn svg {
  transform: translateX(-1px);
}

/* ===== EMOJI PICKER ===== */
.emoji-picker {
  position: absolute;
  bottom: 90px;
  left: 24px;
  width: 340px;
  max-width: calc(100% - 48px);
  background: #1a1a1a;
  border: 1px solid rgba(255, 183, 0, 0.16);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  animation: emojiIn 0.2s ease;
}

.emoji-picker.open {
  display: flex;
}

@keyframes emojiIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.emoji-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 183, 0, 0.12);
  padding: 4px;
  gap: 2px;
  overflow-x: auto;
  flex-shrink: 0;
}

.emoji-tab {
  flex: 1;
  min-width: 40px;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s;
}

.emoji-tab:hover {
  background: rgba(255, 183, 0, 0.08);
}

.emoji-tab.active {
  background: var(--accent);
}

.emoji-grid {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  overflow-y: auto;
  max-height: 260px;
}

.emoji-grid::-webkit-scrollbar { width: 6px; }
.emoji-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 183, 0, 0.22);
  border-radius: 3px;
}

.emoji-btn {
  aspect-ratio: 1;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 22px;
  border-radius: 8px;
  transition: background 0.1s, transform 0.1s;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-btn:hover {
  background: rgba(255, 183, 0, 0.08);
  transform: scale(1.15);
}

/* ===== ADMIN ===== */
.admin-dashboard {
  flex-direction: column;
  overflow-y: auto !important;
  height: 100vh;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(15, 15, 15, 0.92);
  border-bottom: 1px solid rgba(255, 183, 0, 0.12);
  flex-shrink: 0;
}

.admin-header .brand {
  flex: 1;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.admin-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-main {
  flex: 1;
  padding: 32px 24px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.admin-section {
  background: rgba(42, 41, 41, 0.92);
  border: 1px solid rgba(255, 183, 0, 0.14);
  border-radius: 18px;
  padding: 28px;
}

.admin-section h2 {
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--accent);
}

.muted {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 20px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.optional {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}

.plain-input {
  padding: 12px 16px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 183, 0, 0.14);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#createRoomBtn {
  align-self: flex-start;
  padding: 12px 28px;
}

.form-msg {
  font-size: 14px;
  min-height: 20px;
}

.form-msg.success { color: #8fff9f; }
.form-msg.error { color: #ff8d8d; }

.admin-room-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 183, 0, 0.12);
  border-radius: 12px;
  transition: border-color 0.2s;
}

.admin-room-item:hover {
  border-color: rgba(255, 183, 0, 0.3);
}

.admin-room-info {
  flex: 1;
  min-width: 0;
}

.admin-room-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-room-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.admin-room-meta code {
  background: #111;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: var(--accent-hover);
}

.delete-btn {
  background: transparent;
  border: 1px solid rgba(255, 183, 0, 0.14);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.delete-btn:hover {
  background: rgba(255, 91, 91, 0.18);
  color: white;
  border-color: rgba(255, 91, 91, 0.35);
}

/* ===== DESKTOP ===== */
@media (min-width: 701px) {
  #toggleSidebarBtn { display: none; }
}

/* ===== MOBILE ===== */
@media (max-width: 700px) {
  .global-topbar {
    padding: 0 16px;
    height: 64px;
  }

  .global-brand-logo {
    width: 34px;
    height: 34px;
  }

  .global-brand-name {
    font-size: 20px;
  }

  .with-topbar {
    padding-top: 64px;
  }

  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    width: 260px;
    flex-basis: 260px;
  }

  #sidebar.hidden {
    margin-left: -260px;
  }

  header {
    padding: 12px 16px;
  }

  main {
    padding: 16px;
  }

  footer {
    padding: 12px 16px;
    gap: 8px;
  }

  .message {
    max-width: 85%;
  }

  .card {
    padding: 36px 22px;
  }

  .card h1 {
    font-size: 34px;
  }

  .emoji-picker {
    bottom: 80px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }

  #displayName {
    max-width: 80px;
  }

  .admin-main {
    padding: 20px 16px;
  }

  .admin-section {
    padding: 20px;
  }

  .admin-header {
    padding: 12px 16px;
  }

  .admin-header .brand {
    font-size: 16px;
  }

  .brand {
    font-size: 16px;
  }

  .brand-app-name {
    display: none;
  }

  .brand-divider {
    display: none;
  }
}
