/* ═══════════════════════ ROOT ═══════════════════════ */
:root {
  --bg: #060608;
  --bg2: #0c0c10;
  --bg3: #111116;
  --bg4: #16161d;
  --surface: rgba(255, 255, 255, 0.035);
  --surface2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);
  --white: #eeeef0;
  --muted: #55556a;
  --muted2: #88889a;
  --accent: #7c6aff;
  --accent2: #00d4ff;
  --accent3: #ff6a6a;
  --green: #22d47a;
  --glow: rgba(124, 106, 255, 0.15);
  --glow2: rgba(0, 212, 255, 0.1);
  --font-display: "Outfit", sans-serif;
  --font-mono: "Space Mono", monospace;
  --r: 14px;
  --r-sm: 8px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t: 0.25s var(--ease);
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button {
  cursor: pointer;
  font-family: var(--font-display);
  border: none;
  background: none;
  color: inherit;
}
input,
textarea {
  font-family: var(--font-display);
  color: var(--white);
}
::-webkit-scrollbar {
  width: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 99px;
}

/* ═══════════════════════ NOISE ═══════════════════════ */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* ═══════════════════════ VIEWS ═══════════════════════ */
.view {
  display: none;
  height: 100dvh;
  overflow: hidden;
}
.view.active {
  display: flex;
}

/* ═══════════════════════ SPLASH / AUTH ═══════════════════════ */
#view-auth {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(
      ellipse 60% 50% at 50% 0%,
      rgba(124, 106, 255, 0.12) 0%,
      transparent 70%
    ),
    var(--bg);
}
.auth-logo {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--white) 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-sub {
  font-size: 12px;
  color: var(--muted2);
  letter-spacing: 0.08em;
  margin-bottom: 40px;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Google btn */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--t);
  width: 100%;
}
.btn-google:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-google svg {
  flex-shrink: 0;
}

/* Input */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-label {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.input-field {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
}
.input-field:focus {
  border-color: rgba(124, 106, 255, 0.5);
}
.input-field::placeholder {
  color: var(--muted);
}

/* Primary btn */
.btn-primary {
  padding: 13px 20px;
  background: var(--accent);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  transition: var(--t);
  width: 100%;
  letter-spacing: 0.02em;
}
.btn-primary:hover {
  background: #9580ff;
  box-shadow: 0 0 24px rgba(124, 106, 255, 0.35);
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════ LOBBY ═══════════════════════ */
#view-lobby {
  flex-direction: column;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.topbar-logo {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.topbar-spacer {
  flex: 1;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--t);
  position: relative;
}
.user-chip:hover {
  border-color: var(--border2);
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  overflow: hidden;
  min-width: 160px;
  display: none;
  z-index: 100;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.user-menu.open {
  display: block;
}
.user-menu-item {
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
  cursor: pointer;
}
.user-menu-item:hover {
  background: var(--surface2);
}
.user-menu-item.danger {
  color: var(--accent3);
}
.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Search + create bar */
.lobby-bar {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.search-wrap {
  flex: 1;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}
.search-input:focus {
  border-color: rgba(124, 106, 255, 0.4);
}
.search-input::placeholder {
  color: var(--muted);
}
.btn-create {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--accent);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  transition: var(--t);
}
.btn-create:hover {
  background: #9580ff;
  box-shadow: 0 0 18px rgba(124, 106, 255, 0.3);
}
.btn-create:active {
  transform: scale(0.97);
}

/* Room grid */
.lobby-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.lobby-section-title {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lobby-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.room-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  transition: var(--t);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.room-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.room-card:hover {
  border-color: rgba(124, 106, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}
.room-card:hover::before {
  opacity: 1;
}
.room-card:active {
  transform: scale(0.98);
}
.room-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bg3);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.room-card-body {
  position: relative;
  z-index: 1;
}
.room-card-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted2);
}
.room-card-online {
  display: flex;
  align-items: center;
  gap: 4px;
}
.room-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.room-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-public {
  background: rgba(34, 212, 122, 0.12);
  color: var(--green);
  border: 1px solid rgba(34, 212, 122, 0.25);
}
.badge-private {
  background: rgba(255, 106, 106, 0.12);
  color: var(--accent3);
  border: 1px solid rgba(255, 106, 106, 0.25);
}
.room-card-code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: var(--bg3);
  border-radius: 4px;
  padding: 2px 6px;
  position: relative;
  z-index: 1;
  align-self: flex-start;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state p {
  font-size: 13px;
  line-height: 1.7;
}

/* ═══════════════════════ MODALS ═══════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.25s var(--ease);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--muted2);
  transition: var(--t);
}
.modal-close:hover {
  background: var(--surface2);
  color: var(--white);
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.room-type-row {
  display: flex;
  gap: 8px;
}
.room-type-btn {
  flex: 1;
  padding: 12px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: var(--t);
  cursor: pointer;
}
.room-type-btn:hover,
.room-type-btn.active {
  border-color: var(--accent);
  background: rgba(124, 106, 255, 0.1);
  color: var(--accent);
}
.room-type-icon {
  font-size: 22px;
}
.code-display {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.code-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* Join private modal - code input */
.code-input-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.code-digit {
  width: 42px;
  height: 52px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  outline: none;
  transition: border-color 0.2s ease;
}
.code-digit:focus {
  border-color: var(--accent);
}

/* ═══════════════════════ CHAT VIEW ═══════════════════════ */
#view-chat {
  flex-direction: column;
}

/* Chat topbar */
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.btn-back {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
  flex-shrink: 0;
}
.btn-back:hover {
  background: var(--surface2);
}
.chat-room-info {
  flex: 1;
  min-width: 0;
}
.chat-room-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-room-meta {
  font-size: 11px;
  color: var(--muted2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-room-meta .room-dot {
  width: 5px;
  height: 5px;
}
.chat-topbar-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted2);
  transition: var(--t);
}
.icon-btn:hover {
  background: var(--surface2);
  color: var(--white);
}
.icon-btn.danger:hover {
  background: rgba(255, 106, 106, 0.12);
  color: var(--accent3);
  border-color: rgba(255, 106, 106, 0.25);
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}
.msg-date-sep {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin: 12px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.msg-date-sep::before,
.msg-date-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Message row */
.msg-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  animation: msg-in 0.22s var(--ease);
}
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.msg-row.own {
  align-items: flex-end;
}
.msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}
.msg-row.own .msg-header {
  flex-direction: row-reverse;
}
.msg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.msg-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted2);
}
.msg-time {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 4px 14px 14px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  transition: background 0.15s ease;
}
.msg-row.own .msg-bubble {
  border-radius: 14px 4px 14px 14px;
  background: rgba(124, 106, 255, 0.15);
  border-color: rgba(124, 106, 255, 0.25);
}
.msg-bubble:hover .msg-delete-btn {
  opacity: 1;
}
.msg-delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Typing indicator */
.typing-bar {
  min-height: 24px;
  padding: 0 16px 4px;
  font-size: 12px;
  color: var(--muted2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}
.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted2);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

/* Chat input area */
.chat-input-area {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.msg-textarea {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  transition: border-color 0.2s ease;
  line-height: 1.5;
}
.msg-textarea:focus {
  border-color: rgba(124, 106, 255, 0.45);
}
.msg-textarea::placeholder {
  color: var(--muted);
}
.btn-send {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: var(--t);
}
.btn-send:hover {
  background: #9580ff;
  box-shadow: 0 0 18px rgba(124, 106, 255, 0.3);
}
.btn-send:active {
  transform: scale(0.95);
}
.btn-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.chat-footer-meta {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}
.char-count {
  font-size: 10px;
  color: var(--muted);
}
.char-count.warn {
  color: var(--accent3);
}
.cooldown-hint {
  font-size: 10px;
  color: var(--muted);
}

/* Cooldown bar */
.cooldown-bar {
  height: 2px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.cooldown-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--accent2), var(--accent));
  border-radius: 99px;
  transition: width linear;
}

/* ═══════════════════════ TOAST ═══════════════════════ */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 99px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 9000;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
#toast.show {
  opacity: 1;
}

/* ═══════════════════════ PROFILE EDIT ═══════════════════════ */
.name-edit-row {
  display: flex;
  gap: 8px;
}
.name-edit-row .input-field {
  flex: 1;
}
.btn-sm {
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--t);
}
.btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════ ROOM INFO PANEL ═══════════════════════ */
.room-info-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(300px, 80%);
  height: 100%;
  background: var(--bg3);
  border-left: 1px solid var(--border2);
  z-index: 200;
  transition: right 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
}
.room-info-panel.open {
  right: 0;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
}
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.panel-section-title {
  font-size: 11px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.member-item:last-child {
  border-bottom: none;
}
.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.member-name {
  font-size: 13px;
  font-weight: 500;
}
.member-badge {
  font-size: 10px;
  color: var(--muted2);
}
.code-copy-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--t);
}
.code-copy-box:hover {
  border-color: var(--accent);
  background: rgba(124, 106, 255, 0.06);
}
.code-copy-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.15em;
  flex: 1;
}
.code-copy-icon {
  color: var(--muted2);
}
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
  display: none;
}
.panel-overlay.open {
  display: block;
}

/* ═══════════════════════ LOADING ═══════════════════════ */
#view-loading {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.loader {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loader-text {
  font-size: 12px;
  color: var(--muted2);
  letter-spacing: 0.08em;
}

/* ═══════════════════════ EMOJI PICKER (mini) ═══════════════════════ */
.emoji-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.emoji-pick {
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.emoji-pick:hover {
  background: var(--surface2);
}

@media (max-width: 380px) {
  .room-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .code-digit {
    width: 36px;
    height: 46px;
    font-size: 18px;
  }
}
