@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #12141c;
  --bg-panel: #1a1d29;
  --bg-input: #21243350;
  --border: #2a2e40;
  --text: #eef0f5;
  --text-dim: #9098b0;
  --accent: #33d6c0;
  --accent-dim: #1f7a70;
  --guest: #8b8fd1;
  --error: #ff6b6b;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
}

.hidden { display: none !important; }

.screen {
  height: 100vh;
  width: 100%;
}

/* ==================== LANDING SCREEN ==================== */

#landing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.landing-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 30px;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.brand span { color: var(--accent); }

.tagline {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 24px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 4px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.tab-panel.active { display: flex; }

.tab-panel label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: -4px;
}

.tab-panel input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.tab-panel input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.primary-btn {
  margin-top: 6px;
  background: var(--accent);
  color: #0a1a17;
  border: none;
  border-radius: var(--radius);
  padding: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: filter 0.15s;
}
.primary-btn:hover { filter: brightness(1.08); }
.primary-btn:active { filter: brightness(0.95); }

.hint {
  font-size: 11.5px;
  color: var(--text-dim);
  margin: 4px 0 0;
  line-height: 1.4;
}

.error-msg {
  color: var(--error);
  font-size: 13px;
  min-height: 18px;
  margin: 14px 0 0;
}

.photo-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}
.photo-preview {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.photo-picker input[type="file"] {
  flex: 1;
  font-size: 12px;
  color: var(--text-dim);
}

/* ==================== CHAT SCREEN ==================== */

.chat-layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.room-name {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
}
.online-count {
  display: block;
  font-size: 11.5px;
  color: var(--accent);
  margin-top: 2px;
}

.user-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}
.user-list li {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.user-list li:hover { background: var(--bg-input); }
.user-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  display: none;
}
.user-list li.guest .user-dot { background: var(--guest); }
.user-list li.guest .user-name { color: var(--text-dim); }
.guest-tag {
  font-size: 10px;
  color: var(--text-dim);
  margin-left: auto;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex-shrink: 0;
}
.chat-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}
.me-badge {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-dim);
}
.icon-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 75%;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--bg-input);
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.message .msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}
.message .msg-body { flex: 1; min-width: 0; }
.message .msg-nick {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--accent);
  display: block;
  margin-bottom: 2px;
}
.message.guest .msg-nick { color: var(--guest); }
.message.self {
  align-self: flex-end;
  background: var(--accent-dim);
}
.message.self .msg-nick { color: #cffaf3; }

.system-message {
  align-self: center;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 10px;
}

.message-form {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.message-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 12px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.message-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0a1a17;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.send-btn:hover { filter: brightness(1.08); }

/* ==================== MOBILE ==================== */

@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }
  .icon-btn { display: inline-block; }
  .message { max-width: 85%; }
}

/* ==================== SEARCH + CLICKABLE USERS ==================== */

.user-list li { cursor: pointer; }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ==================== ACTIVITY FEED ==================== */

.activity-line {
  font-size: 13px;
  color: var(--text-dim);
  padding: 5px 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.activity-line img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.activity-nick {
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline dotted var(--border);
}
.activity-nick:hover { color: var(--accent); }
.activity-line.leave .activity-nick { cursor: default; text-decoration: none; opacity: 0.7; }
.activity-line.leave .activity-nick:hover { color: var(--text); }

/* ==================== FLOATING DM WINDOWS ==================== */

.dm-window {
  position: fixed;
  width: 320px;
  height: 400px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 100;
  overflow: hidden;
}
.dm-window.focused { border-color: var(--accent); }

.dm-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}
.dm-header img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.dm-header .dm-name {
  font-weight: 700;
  font-size: 13.5px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
  border-radius: 4px;
}
.dm-btn:hover { color: var(--text); background: var(--bg-input); }

.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dm-msg {
  max-width: 80%;
  padding: 7px 11px;
  border-radius: 12px;
  background: var(--bg-input);
  font-size: 13.5px;
  line-height: 1.4;
  word-wrap: break-word;
  align-self: flex-start;
}
.dm-msg.self {
  align-self: flex-end;
  background: var(--accent-dim);
}
.dm-note {
  align-self: center;
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
  padding: 4px 8px;
  line-height: 1.4;
}

.dm-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.dm-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 9px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  min-width: 0;
}
.dm-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.dm-form button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0a1a17;
  cursor: pointer;
  flex-shrink: 0;
}

/* ==================== MINIMIZED STACK (right side) ==================== */

#dm-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 90;
}
#dm-stack:empty { display: none; }
.dm-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 7px 14px 7px 8px;
  cursor: pointer;
  min-width: 165px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  transition: border-color 0.2s, background 0.2s;
}
.dm-pill:hover { background: var(--bg-input); }
.dm-pill img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.dm-pill .pill-name {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-pill .pill-badge {
  background: var(--accent);
  color: #0a1a17;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.dm-pill.unread {
  border-color: var(--accent);
  animation: pill-flash 1.1s ease-out 2;
}
@keyframes pill-flash {
  0%, 100% { background: var(--bg-panel); }
  50% { background: var(--accent-dim); }
}

/* ==================== STRANGER REQUEST PROMPTS ==================== */

#request-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  max-width: 300px;
}
.request-card {
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 13px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.5);
}
.request-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.request-head img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.request-head b { font-size: 13.5px; }
.request-preview {
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 0 0 11px;
  line-height: 1.4;
  word-wrap: break-word;
}
.request-actions { display: flex; gap: 8px; }
.request-actions button {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-accept { background: var(--accent); color: #0a1a17; }
.btn-deny { background: var(--bg-input); color: var(--text-dim); }
.btn-deny:hover { color: var(--text); }

/* ==================== MOBILE ==================== */

@media (max-width: 720px) {
  .dm-window {
    width: calc(100vw - 24px);
    height: 70vh;
    left: 12px !important;
    top: auto !important;
    bottom: 12px;
  }
  #dm-stack { right: 10px; bottom: 10px; }
  .dm-pill { min-width: 0; }
  .dm-pill .pill-name { display: none; }
  #request-stack { left: 12px; right: 12px; max-width: none; }
}

.list-empty {
  color: var(--text-dim);
  font-size: 12.5px;
  padding: 14px 10px;
  line-height: 1.5;
  cursor: default;
}
.list-empty:hover { background: none; }

/* Your own entry in the online list - visible but not clickable */
.user-list li.self-entry {
  cursor: default;
  background: var(--bg-input);
  border: 1px solid var(--border);
}
.user-list li.self-entry:hover { background: var(--bg-input); }
.self-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  margin-left: auto;
  letter-spacing: 0.04em;
}

.pill-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}
.pill-close:hover { color: var(--error); background: var(--bg-input); }

/* ==================== CHANGE PHOTO BUTTON ==================== */

.ghost-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--text); }
.ghost-btn:disabled { opacity: 0.5; cursor: wait; }
.my-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .ghost-btn span { display: none; }
  .ghost-btn { padding: 4px; border-radius: 50%; }
}

/* ==================== LARGER AVATARS PASS ==================== */

/* Sidebar a bit wider to fit larger avatars comfortably */
.sidebar { width: 250px; }

/* Keep long nicknames on one line instead of wrapping under the avatar */
.user-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* Bigger avatars in DM windows and the minimized stack too */
.dm-header img { width: 38px; height: 38px; }
.dm-pill img { width: 36px; height: 36px; }
.activity-line img { width: 30px; height: 30px; }
.request-head img { width: 42px; height: 42px; }

/* Slightly smaller text to balance the larger images */
.dm-header .dm-name { font-size: 13px; }
.dm-pill .pill-name { font-size: 12px; }
.activity-line { font-size: 12.5px; }

@media (max-width: 720px) {
  .sidebar { width: 250px; }
}

/* Sidebar widened again to fit the 78px avatars */
.sidebar { width: 290px; }
@media (max-width: 720px) {
  .sidebar { width: 290px; }
}

/* DM window header avatar doubled (38px -> 76px) */
.dm-header img { width: 76px; height: 76px; }
.dm-header { padding: 12px 14px; }
.dm-header .dm-name { font-size: 15px; }

/* Minimized stack pill avatar doubled (36px -> 72px) */
.dm-pill img { width: 72px; height: 72px; }
.dm-pill {
  border-radius: 44px;
  padding: 6px 16px 6px 6px;
  min-width: 210px;
}
.dm-pill .pill-name { font-size: 13px; }

/* Activity feed avatars tripled (30px -> 90px) */
.activity-line img { width: 90px; height: 90px; }
.activity-line {
  font-size: 14px;
  gap: 12px;
  padding: 8px 2px;
}

/* Leaves stay compact - only joins get the large avatar treatment */
.activity-line.leave img { width: 26px; height: 26px; }
.activity-line.leave {
  font-size: 12.5px;
  gap: 8px;
  padding: 4px 2px;
  opacity: 0.75;
}

/* ==================== BLOCKED STATES ==================== */

.user-list li.blocked-by-me,
.user-list li.blocked-me {
  cursor: default;
}
.user-list li.blocked-by-me img,
.user-list li.blocked-me img {
  filter: grayscale(1) brightness(0.55);
}
.user-list li.blocked-by-me .user-name,
.user-list li.blocked-me .user-name {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: var(--border);
}

.block-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--error);
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.block-tag.them { color: var(--text-dim); }

/* Hover action button on each row */
.row-action {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.user-list li:hover .row-action { opacity: 1; }
.row-action:hover { background: var(--bg); color: var(--text); }

/* ==================== USER MENU POPUP ==================== */

.user-menu {
  position: fixed;
  z-index: 500;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.menu-title {
  font-size: 12.5px;
  font-weight: 700;
  padding: 2px 6px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-info {
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 2px 6px 4px;
  line-height: 1.45;
}
.menu-btn {
  background: var(--bg-input);
  border: none;
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.menu-btn:hover { background: var(--border); }
.menu-btn.danger { color: var(--error); }
.menu-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--text-dim);
}
.menu-btn:disabled:hover { background: var(--bg-input); }

/* ==================== TOASTS ==================== */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.5);
  z-index: 600;
  max-width: 90vw;
  text-align: center;
  transition: opacity 0.4s;
}
.toast.fade { opacity: 0; }

/* ==================== PROFILE META (age + gender) ==================== */

.meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
.meta.compact { gap: 4px; flex: none; }

.meta-gender {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  font-weight: 700;
}
.meta-gender.g-erkek { background: #1e3a5f; color: #7fb8ff; }
.meta-gender.g-kadin { background: #4a1f3d; color: #ff9ed4; }
.meta-gender.g-non-binary { background: #2f3d24; color: #b6e08a; }

.meta.compact .meta-gender { width: 22px; height: 22px; font-size: 13px; }

.meta-age {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* ==================== SIGNUP FORM ADDITIONS ==================== */

.tab-panel select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.tab-panel select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.lock-warning {
  font-size: 11.5px;
  color: #ffc46b;
  background: rgba(255, 196, 107, 0.08);
  border: 1px solid rgba(255, 196, 107, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 2px 0;
  line-height: 1.45;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 0 !important;
  padding: 4px 0;
}
.checkbox-row input { accent-color: var(--accent); cursor: pointer; width: 16px; height: 16px; }

#legacy-profile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 6px;
}
#legacy-profile.hidden { display: none; }

/* ==================== MENU / TOAST / REQUEST TWEAKS ==================== */

.menu-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.menu-title img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
}
.toast-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.request-who {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.request-who b { font-size: 12.5px; font-weight: 600; }

.dm-name { display: flex; align-items: center; }
.activity-line.clickable { cursor: pointer; border-radius: 8px; }
.activity-line.clickable:hover { background: var(--bg-panel); }
.activity-text { color: var(--text-dim); }

/* ==================== OWNER ACCOUNT ==================== */

.user-list li.owner-entry {
  background: linear-gradient(90deg, rgba(51,214,192,0.10), transparent);
  border: 1px solid rgba(51,214,192,0.30);
}
.user-list li.owner-entry:hover { background: linear-gradient(90deg, rgba(51,214,192,0.16), transparent); }

.owner-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(51,214,192,0.35);
  border-radius: 10px;
  padding: 2px 7px;
}

.request-timer {
  font-size: 10.5px;
  color: var(--text-dim);
  text-align: right;
  margin-top: 8px;
  letter-spacing: 0.02em;
}
.request-card {
  transition: opacity 0.4s, transform 0.4s;
}
.request-card.expiring {
  opacity: 0;
  transform: translateX(20px);
}

/* ==================== YOUR OWN ENTRY - PROMINENT ==================== */

.user-list li.self-entry {
  background: linear-gradient(90deg, rgba(51,214,192,0.16), rgba(51,214,192,0.04));
  border: 1px solid rgba(51,214,192,0.45);
  box-shadow: 0 0 0 1px rgba(51,214,192,0.08), 0 3px 12px rgba(0,0,0,0.3);
  padding: 9px 10px;
}
.user-list li.self-entry:hover {
  background: linear-gradient(90deg, rgba(51,214,192,0.16), rgba(51,214,192,0.04));
}
/* Accent ring around your own photo */
.user-list li.self-entry .user-avatar {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(51,214,192,0.18);
}
.user-list li.self-entry .meta-age { color: var(--accent); }

.self-tag {
  font-size: 10px;
  font-weight: 700;
  color: #0a1a17;
  background: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 10px;
  padding: 3px 9px;
  margin-left: auto;
  flex-shrink: 0;
}

/* When you're also the god account, keep the god styling dominant
   but still ring your own photo. */
.user-list li.owner-entry.self-entry {
  border-color: rgba(51,214,192,0.55);
}

/* ==================== GOD PANEL ==================== */

.god-btn {
  border-color: rgba(51,214,192,0.45) !important;
  color: var(--accent) !important;
  padding: 6px 14px !important;
}
.god-btn:hover { background: rgba(51,214,192,0.10); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-head h2 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  flex: 1;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.god-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
}
.god-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.god-panel-body {
  display: none;
  overflow-y: auto;
  padding: 14px;
  gap: 8px;
  flex-direction: column;
}
.god-panel-body.active { display: flex; }

.god-hint {
  font-size: 11.5px;
  color: var(--text-dim);
  margin: 0 0 6px;
  line-height: 1.5;
  background: var(--bg-input);
  padding: 9px 11px;
  border-radius: 8px;
}

.god-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.god-row.banned {
  border-color: rgba(255,107,107,0.35);
  background: rgba(255,107,107,0.05);
}
.god-photo {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: zoom-in;
  border: 1px solid var(--border);
}
.god-info { flex: 1; min-width: 0; }
.god-nick {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.god-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
}
.god-actions { display: flex; gap: 6px; flex-shrink: 0; }

.god-action-btn {
  border: none;
  border-radius: 7px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: var(--bg-input);
  color: var(--text);
}
.god-action-btn.warn { color: #ffc46b; }
.god-action-btn.danger { color: var(--error); }
.god-action-btn.ok { color: var(--accent); }
.god-action-btn:hover:not(:disabled) { background: var(--border); }
.god-action-btn:disabled { opacity: 0.35; cursor: not-allowed; }

@media (max-width: 720px) {
  .modal { max-height: 90vh; }
  .god-photo { width: 44px; height: 44px; }
}

/* God actions inside the user hover menu */
.menu-divider {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding: 8px 6px 3px;
}
.menu-btn.warn { color: #ffc46b; }

/* ==================== VOICE MESSAGES ==================== */

.mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.mic-btn:hover { border-color: var(--accent); }
.mic-btn.recording {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.5); }
  50% { box-shadow: 0 0 0 7px rgba(255,107,107,0); }
}

.voice-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--bg-input);
  flex-wrap: wrap;
}
.voice-preview audio {
  flex: 1;
  min-width: 130px;
  height: 34px;
}
.voice-send, .voice-cancel {
  border: none;
  border-radius: 7px;
  padding: 8px 13px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.voice-send { background: var(--accent); color: #0a1a17; }
.voice-cancel { background: var(--bg-panel); color: var(--text-dim); }
.voice-send:disabled { opacity: 0.6; cursor: wait; }

.dm-msg.voice {
  padding: 6px 8px;
  max-width: 88%;
}
.dm-msg.voice audio {
  height: 34px;
  display: block;
  max-width: 210px;
}

/* ==================== REGISTERED vs GUEST DISTINCTION ==================== */

/* Registered accounts: green halo. Guests: always grayscale. */
.verified-halo {
  border: 2px solid var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(51,214,192,0.16);
}
.guest-photo {
  filter: grayscale(1);
  border: 1px solid var(--border) !important;
}

.user-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.user-col .meta { flex: none; }

.user-status {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.user-status.reg { color: var(--accent); }
.user-status.anon { color: var(--text-dim); }

/* Blocked rows: silhouette replaces the photo, so no grayscale/halo
   treatment should linger on it. */
.user-list li.blocked-by-me .user-avatar,
.user-list li.blocked-me .user-avatar {
  filter: none;
  border: 1px solid var(--border) !important;
  box-shadow: none;
  opacity: 0.85;
}
.user-list li.blocked-by-me .user-status,
.user-list li.blocked-me .user-status { color: var(--text-dim); }

/* DM header now stacks meta + status */
.dm-name {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

/* ==================== VIEW-ONCE IMAGES ==================== */

.img-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-btn:hover { border-color: var(--accent); }
.img-btn:disabled { opacity: 0.5; cursor: wait; }

.dm-msg.image-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 14px;
}
.dm-msg.image-msg.unopened {
  cursor: pointer;
  border: 1px dashed var(--accent);
  background: rgba(51,214,192,0.08);
}
.dm-msg.image-msg.unopened:hover { background: rgba(51,214,192,0.15); }
.dm-msg.image-msg.consumed,
.dm-msg.image-msg.sent {
  color: var(--text-dim);
  font-size: 12.5px;
  font-style: italic;
  border: 1px solid var(--border);
  background: transparent;
}
.image-label { font-size: 13.5px; font-weight: 600; }
.image-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.image-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}
.image-overlay img {
  max-width: 92vw;
  max-height: 78vh;
  border-radius: 10px;
  object-fit: contain;
}
.overlay-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.overlay-warn {
  font-size: 12.5px;
  color: #ffc46b;
}
.overlay-close {
  background: var(--accent);
  color: #0a1a17;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== GOD PANEL SEARCH ==================== */

.god-search-wrap {
  position: relative;
  padding: 12px 14px 0;
  flex-shrink: 0;
}
.god-search {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 34px 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.god-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.god-search-clear {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-25%);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
}
.god-search-clear:hover { color: var(--text); background: var(--bg); }

.god-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(51,214,192,0.12);
  border-radius: 8px;
  padding: 1px 7px;
  margin-left: 7px;
  letter-spacing: 0.02em;
}
.god-nick { display: flex; align-items: center; }

.dm-msg.image-msg.failed {
  color: var(--error);
  border-color: rgba(255,107,107,0.35);
}

/* ==================== PWA INSTALL BANNERS ==================== */

.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  z-index: 950;
  max-width: 440px;
  margin: 0 auto;
  animation: banner-up 0.35s ease-out;
}
.install-banner.hidden { display: none; }

@keyframes banner-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.install-banner img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
}
.install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.install-text b { font-size: 13.5px; }
.install-text span { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }
.install-text span b { color: var(--accent); font-size: 11.5px; }

#install-btn {
  background: var(--accent);
  color: #0a1a17;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.install-x {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}
.install-x:hover { color: var(--text); }

/* Respect the notch / home indicator when installed on iOS */
@supports (padding: env(safe-area-inset-bottom)) {
  .install-banner { bottom: calc(12px + env(safe-area-inset-bottom)); }
  #dm-stack { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* =====================================================================
   MOBILE FIXES  (iOS Safari especially)

   iOS reports 100vh as TALLER than the visible area, because the
   address bar overlaps it. Content centred in a 100vh box therefore
   ends up partly off-screen with no way to scroll to it - which is
   exactly what made the login form unreachable on iPhone.

   The fix is 100dvh ("dynamic" viewport height, which excludes browser
   chrome) plus making every screen scrollable as a safety net.
   ===================================================================== */

.screen {
  height: 100vh;          /* fallback for older browsers */
  height: 100dvh;         /* correct on modern iOS/Android */
  min-height: 0;
}

#landing {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
}
/* Keep it visually centred on tall screens, but never trap content */
@media (min-height: 720px) {
  #landing { align-items: center; }
}

.chat-layout {
  height: 100vh;
  height: 100dvh;
}

@media (max-width: 720px) {

  /* --- Landing card --- */
  .landing-card {
    padding: 22px 18px;
    border-radius: 14px;
    margin: auto 0;
  }
  .brand { font-size: 26px; }
  .tagline { font-size: 13px; }

  /* iOS zooms in on any input under 16px, which wrecks the layout.
     16px is the magic number that prevents it. */
  .tab-panel input,
  .tab-panel select,
  .dm-form input,
  .god-search {
    font-size: 16px;
  }

  .tab-btn { font-size: 13px; padding: 10px 6px; }

  /* --- Header: it was overflowing with 4 controls in a row --- */
  .chat-header {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .chat-title { font-size: 15px; }
  .header-right { gap: 8px; }
  .me-badge { display: none; }


  /* --- Sidebar --- */
  .sidebar {
    width: min(84vw, 300px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .user-avatar { width: 62px; height: 62px; }

  /* Tapping a user should close the drawer - handled in JS, but make
     sure the drawer sits above the DM windows while open. */
  .sidebar.open { z-index: 120; }

  /* --- DM windows: full-width sheets rather than floating boxes --- */
  .dm-window {
    width: auto;
    left: 8px !important;
    right: 8px;
    top: auto !important;
    bottom: calc(8px + env(safe-area-inset-bottom));
    height: min(72dvh, 560px);
    border-radius: 14px;
  }
  .dm-header { padding: 9px 10px; }
  .dm-header img { width: 46px; height: 46px; }
  .dm-header .dm-name { font-size: 12.5px; }

  /* Bigger tap targets for the header buttons */
  .dm-btn {
    font-size: 18px;
    padding: 6px 9px;
    min-width: 34px;
  }

  .dm-form { padding: 8px; gap: 6px; }
  .mic-btn, .img-btn, .dm-form button[type="submit"] {
    width: 40px;
    height: 40px;
  }

  /* --- Minimised stack --- */
  #dm-stack {
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    max-height: 60dvh;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .dm-pill {
    min-width: 0;
    padding: 5px;
    border-radius: 40px;
  }
  .dm-pill img { width: 54px; height: 54px; }
  .pill-close { font-size: 18px; padding: 4px 7px; }

  /* --- Activity feed: 90px avatars are too big on a phone --- */
  .activity-line img { width: 56px; height: 56px; }
  .activity-line { font-size: 13px; gap: 10px; }

  /* --- Requests --- */
  #request-stack {
    top: calc(8px + env(safe-area-inset-top));
    left: 8px;
    right: 8px;
    max-width: none;
  }

  /* --- God panel --- */
  .modal { max-height: 92dvh; }
  .god-panel-body { padding: 10px; }

  /* --- Install banner shouldn't cover the message box --- */
  .install-banner { bottom: calc(8px + env(safe-area-inset-bottom)); }
}

/* Very small phones */
@media (max-width: 380px) {
  .user-avatar { width: 52px; height: 52px; }
  .dm-pill img { width: 46px; height: 46px; }
  .activity-line img { width: 46px; height: 46px; }
  .ghost-btn span, .god-btn span { display: none; }
}

/* Landscape phones: very little vertical room */
@media (max-height: 480px) and (max-width: 900px) {
  .dm-window { height: 88dvh; }
  #landing { align-items: flex-start; }
  .landing-card { padding: 16px; }
}

/* =====================================================================
   MOBILE LAYOUT — the online list IS the home screen (WhatsApp style)

   The activity feed is desktop-only. On a phone it's noise: what people
   want is "who's here, tap to talk". So the layout reflows to:

     [ header with your controls ]
     [ full-screen list of people ]
     [ strip of minimised chats   ]

   DM windows become full-screen sheets that slide up over the list.
   ===================================================================== */

@media (max-width: 720px) {

  /* --- Reflow: stack header above a full-width list --- */
  .chat-layout {
    flex-direction: column;
  }

  /* .chat-main only contributes its header now */
  .chat-main {
    order: -1;
    flex: 0 0 auto;
    min-height: 0;
  }

  /* The feed is desktop-only */
  #activity-feed { display: none !important; }

  /* Sidebar stops being a drawer and becomes the main view */
  .sidebar {
    position: static;
    transform: none !important;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    box-shadow: none;
    border-right: none;
    z-index: auto;
    display: flex;
    flex-direction: column;
  }

  /* No drawer, so no hamburger */
  #sidebar-toggle { display: none !important; }

  /* Header shows who you are instead of "Hareketler" */
  .chat-title { display: none; }

  .sidebar-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px 6px;
  }
  .room-name { font-size: 15px; }

  .user-list {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 8px calc(96px + env(safe-area-inset-bottom));
  }

  /* Roomier rows - this is the primary surface now */
  .user-list li {
    padding: 10px 12px;
    gap: 13px;
    border-radius: 12px;
  }
  .user-avatar { width: 58px; height: 58px; }

  /* --- DM window: full-screen sheet --- */
  .dm-window {
    left: 0 !important;
    right: 0;
    top: 0 !important;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
    z-index: 300;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-up 0.22s ease-out;
  }
  @keyframes sheet-up {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  .dm-header {
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    cursor: default;
  }

  /* --- 80 / 20 SPLIT ---------------------------------------------
     The layout becomes a real two-column grid rather than a floating
     overlay: everything you interact with lives in the left 80%, and
     minimised chats occupy their own 20% column. Nothing can overlap
     the header buttons or the message box any more.
     --------------------------------------------------------------- */
  .chat-layout {
    display: grid;
    grid-template-columns: 1fr 0;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "head  stack"
      "list  stack";
    transition: grid-template-columns 0.2s ease;
  }
  body.has-stack .chat-layout {
    grid-template-columns: 80% 20%;
  }

  .chat-main { grid-area: head; }
  .sidebar   { grid-area: list; }

  #dm-stack {
    grid-area: stack;
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
    z-index: auto;
  }
  #dm-stack:empty { display: none; }

  /* Avatars scale to whatever the column width allows */
  .dm-pill img {
    width: 100%;
    max-width: 56px;
    height: auto;
    aspect-ratio: 1;
  }

  .dm-pill {
    position: relative;
    flex-direction: column;
    min-width: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    flex-shrink: 0;
  }
  .dm-pill:hover { background: none; }
  .dm-pill img {
    width: 56px;
    height: 56px;
    border: 2px solid var(--border);
  }
  .dm-pill.unread img { border-color: var(--accent); }
  .dm-pill .pill-name { display: none; }

  /* Badge sits on the avatar, like a phone app icon */
  .dm-pill .pill-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    text-align: center;
    font-size: 11px;
    padding: 2px 6px;
    border: 2px solid var(--bg);
  }
  .dm-pill .pill-close {
    position: absolute;
    bottom: -4px;
    left: -4px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- Requests: full-width card at the top --- */
  #request-stack {
    top: 0;
    left: 0;
    right: 0;
    max-width: none;
    padding: calc(8px + env(safe-area-inset-top)) 8px 0;
    z-index: 400;
  }
  .request-card { border-radius: 14px; }
  .request-actions button { padding: 12px; font-size: 13.5px; }
}

@media (max-width: 720px) {
  .dm-btn.back-btn {
    font-size: 22px;
    padding: 4px 10px 4px 4px;
    color: var(--text);
  }
}

/* Install banner sits at the TOP on mobile - the bottom belongs to the
   minimised chat strip, and the two were overlapping. */
@media (max-width: 720px) {
  .install-banner {
    bottom: auto;
    top: calc(6px + env(safe-area-inset-top));
    padding: 9px 11px;
    gap: 9px;
  }
  .install-banner img { width: 34px; height: 34px; border-radius: 8px; }
  .install-text b { font-size: 12.5px; }
  .install-text span { font-size: 10.5px; }
  #install-btn { padding: 7px 13px; font-size: 12px; }

  /* Requests appear below it if both are on screen */
  #request-stack { top: calc(74px + env(safe-area-inset-top)); }
}

/* Someone in their grace period - connected recently, phone probably
   locked. Still messageable; they'll get it when they return. */
.away-photo { opacity: 0.55; }
.user-status.away { color: #ffc46b !important; }

/* ==================== STRANGER SHIELD BUTTON ==================== */

.shield-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 15px 7px 12px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.shield-btn:hover { border-color: var(--text-dim); color: var(--text); }

.shield-btn.active {
  background: linear-gradient(135deg, rgba(51,214,192,0.20), rgba(51,214,192,0.06));
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51,214,192,0.10);
}
.shield-btn.active:hover { color: var(--accent); }

.shield-icon { font-size: 15px; line-height: 1; }
.shield-btn.active .shield-icon { animation: shield-pop 0.3s ease-out; }
@keyframes shield-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.shield-btn.disabled { opacity: 0.45; cursor: not-allowed; }

/* ==================== RULES MODAL ==================== */

.rules-modal {
  max-width: 420px;
  text-align: left;
}
.rules-modal .modal-head { justify-content: center; }
.rules-modal .modal-head h2 { flex: none; }

.rules-list {
  margin: 0;
  padding: 18px 24px 6px 40px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow-y: auto;
}
.rules-list li {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
.rules-list li b { color: var(--text); font-weight: 600; }
.rules-list li::marker { color: var(--accent); font-weight: 700; }

.rules-btn {
  margin: 14px 20px 20px;
  width: calc(100% - 40px);
}
.rules-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#rules-count { opacity: 0.8; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .shield-btn {
    padding: 7px 12px 7px 10px;
    gap: 5px;
  }
  .shield-label { display: none; }
  .shield-icon { font-size: 17px; }

  .rules-list { padding: 16px 16px 4px 34px; gap: 12px; }
  .rules-list li { font-size: 13px; }
  .rules-btn { margin: 12px 14px calc(16px + env(safe-area-inset-bottom)); width: calc(100% - 28px); }
}

/* ==================== REPORTS ==================== */

.god-btn.has-alert {
  border-color: #ffc46b !important;
  color: #ffc46b !important;
  animation: alert-pulse 1.6s ease-in-out infinite;
}
@keyframes alert-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,196,107,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255,196,107,0); }
}

.report-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-card.handled { opacity: 0.55; }

.report-head { display: flex; align-items: center; gap: 12px; }

.report-count {
  font-size: 10px;
  font-weight: 700;
  color: #ffc46b;
  background: rgba(255,196,107,0.14);
  border-radius: 8px;
  padding: 2px 7px;
  margin-left: 7px;
  white-space: nowrap;
}

.report-reason {
  margin: 0;
  font-size: 12.5px;
  color: var(--text);
  font-style: italic;
  line-height: 1.45;
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

.transcript {
  background: var(--bg);
  border-radius: 9px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.transcript-empty {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-dim);
  font-style: italic;
}
.transcript-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--bg-input);
}
.transcript-line.accused {
  background: rgba(255,107,107,0.08);
  border-left: 2px solid rgba(255,107,107,0.5);
}
.transcript-who {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.transcript-line.accused .transcript-who { color: var(--error); }
.transcript-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.4;
  word-wrap: break-word;
}

.report-actions-row { flex-wrap: wrap; }

@media (max-width: 720px) {
  .transcript { max-height: 180px; }
  .report-actions-row .god-action-btn { flex: 1; min-width: 70px; }
}

/* ==================== CONNECTION LOGS ==================== */

.log-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.log-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.log-nick {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.log-event {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-input);
  border-radius: 7px;
  padding: 2px 7px;
  white-space: nowrap;
}
.log-ip {
  margin-left: auto;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 11.5px;
  color: var(--accent);
  cursor: pointer;
  background: rgba(51,214,192,0.10);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
.log-ip:hover { background: rgba(51,214,192,0.20); }
.log-when {
  font-size: 10.5px;
  color: var(--text-dim);
}

@media (max-width: 720px) {
  .log-ip { margin-left: 0; }
}

/* ==================== POLISH PASS ==================== */

/* Reports: collapsible cards */
.report-head { cursor: pointer; user-select: none; }
.report-chevron {
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s;
  transform: rotate(90deg);
  flex-shrink: 0;
  padding: 0 4px;
}
.report-card.collapsed .report-chevron { transform: rotate(0deg); }
.report-card.collapsed .report-body { display: none; }
.report-body { display: flex; flex-direction: column; gap: 10px; }

/* Tab badge for pending reports */
.tab-badge {
  display: inline-block;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  padding: 1px 6px;
  margin-left: 5px;
  vertical-align: middle;
}
.tab-badge.hidden { display: none; }
.god-tab { display: flex; align-items: center; justify-content: center; gap: 2px; }

/* Divider when reopening an earlier conversation */
.dm-divider {
  align-self: center;
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 0 2px;
  position: relative;
  width: 100%;
  text-align: center;
}
.dm-divider::before,
.dm-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 24%;
  height: 1px;
  background: var(--border);
}
.dm-divider::before { left: 4%; }
.dm-divider::after { right: 4%; }

.voice-error {
  font-size: 10.5px;
  color: #ffc46b;
  flex-basis: 100%;
}

/* Pending-conversations badge inside an open mobile chat */
.pending-badge {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 10px;
  background: var(--accent);
  color: #0a1a17;
  border: none;
  border-radius: 12px;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  display: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
@media (max-width: 720px) {
  .pending-badge { display: block; }
}

/* ==================== DEVICE INDICATOR ==================== */

.device-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--text);
  opacity: 0.7;
}
.device-icon svg { width: 100%; height: 100%; display: block; }
.device-icon:hover { opacity: 1; }

@media (max-width: 720px) {
  .device-icon { width: 21px; height: 21px; }
}

@media (max-width: 720px) {
  /* Pills sit in a narrow column - no room for the close button
     to float outside, so it tucks into the corner instead. */
  .dm-pill { padding: 2px; }
  .dm-pill .pill-close {
    bottom: 0;
    left: 0;
    width: 20px;
    height: 20px;
    font-size: 13px;
  }
  .dm-pill .pill-badge { top: 0; right: 0; }

  /* Header and composer are inside the 80% column now, so nothing
     overlaps them - but keep them compact all the same. */
  .chat-header { padding: 7px 9px; }
  .header-right { gap: 6px; }
}

/* ==================== PROFILE PHOTO VIEWER ==================== */

.zoomable, .dm-avatar { cursor: zoom-in; }

.profile-overlay img {
  max-width: 88vw;
  max-height: 72dvh;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.overlay-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 15px;
}
.overlay-meta .meta { flex: none; }

@media (max-width: 720px) {
  .profile-overlay img { max-width: 94vw; max-height: 66dvh; }
  .overlay-bar { flex-direction: column; gap: 12px; }
  .overlay-close { width: 100%; max-width: 260px; }
}

/* ==================== TYPING INDICATOR ==================== */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 11.5px;
  color: var(--text-dim);
  flex-shrink: 0;
  animation: typing-in 0.2s ease-out;
}
@keyframes typing-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: block;
  animation: typing-bounce 1.3s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.18s; }
.typing-dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.typing-indicator.recording .typing-dots i {
  background: var(--error);
  border-radius: 2px;
  animation-name: typing-pulse;
}
@keyframes typing-pulse {
  0%, 100% { transform: scaleY(0.6); opacity: 0.5; }
  50% { transform: scaleY(1.5); opacity: 1; }
}

.typing-label { font-style: italic; }

@media (max-width: 720px) {
  .typing-indicator { padding: 8px 12px; font-size: 12px; }
}

/* =====================================================================
   LIST ROW LAYOUT — nothing overlaps, ever

   Row structure:
     [ avatar ][ meta + status (flexible, truncates) ][ tag (fixed) ]

   The middle column is the only part allowed to shrink; the avatar and
   the tag badge both refuse to, so the badge can never be pushed on top
   of the device icon or vice versa.
   ===================================================================== */

.user-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.user-list li .user-avatar { flex: 0 0 auto; }

.user-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

/* Line 1: gender symbol + age bracket */
.user-col .meta {
  flex: 0 1 auto;
  min-width: 0;
  gap: 7px;
}
.user-col .meta-age {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Line 2: Kayıtlı/Anonim + device icon */
.status-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.status-row .user-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.status-row .device-icon { flex: 0 0 auto; }

/* Tag badges (god / sen / engelli / misafir) hold their own space */
.owner-tag,
.self-tag,
.block-tag,
.guest-tag {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

/* Narrow columns: the badge wins, the middle column gives way */
@media (max-width: 720px) {
  .user-list li { gap: 9px; padding: 9px 10px; }
  .user-col { gap: 3px; }
  .owner-tag { font-size: 9px; padding: 2px 6px; }
  .guest-tag, .block-tag { font-size: 9px; }
  .self-tag { font-size: 9px; padding: 2px 7px; }
}

/* Very narrow (mobile with the stack column open): drop the tag text
   down to an initial so it still fits without crowding anything. */
@media (max-width: 420px) {
  .user-col .meta-age { font-size: 12px; }
  .status-row .user-status { font-size: 10px; }
}

/* =====================================================================
   SEO CONTENT

   Real, indexable text below the login card. Visible to visitors and to
   search engines - hiding it with display:none would risk being treated
   as cloaking, so it's genuinely part of the page.
   ===================================================================== */

.seo-content {
  max-width: 620px;
  margin: 40px auto 0;
  padding: 0 20px 60px;
  color: var(--text-dim);
  line-height: 1.65;
  font-size: 14px;
}
.seo-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  color: var(--text);
  margin: 34px 0 12px;
}
.seo-content h3 {
  font-size: 14.5px;
  color: var(--text);
  margin: 22px 0 6px;
  font-weight: 600;
}
.seo-content p { margin: 0 0 12px; }
.seo-content strong { color: var(--text); font-weight: 600; }

.seo-steps, .seo-features {
  margin: 0 0 14px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.seo-steps li::marker { color: var(--accent); font-weight: 700; }
.seo-features li::marker { color: var(--accent); }

/* The landing screen scrolls, so the SEO text sits below the fold */
#landing { display: block; }
#landing .landing-card { margin: 40px auto 0; }
@media (min-height: 720px) {
  #landing { align-items: stretch; }
}

@media (max-width: 720px) {
  .seo-content { font-size: 13.5px; padding: 0 16px 40px; margin-top: 28px; }
  .seo-content h2 { font-size: 17px; margin: 26px 0 10px; }
  #landing .landing-card { margin: 20px auto 0; }
}

/* =====================================================================
   LEGAL PAGES
   ===================================================================== */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 22px 70px;
  color: var(--text-dim);
  line-height: 1.7;
  font-size: 14.5px;
}
.legal-back {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 22px;
}
.legal-back:hover { text-decoration: underline; }

.legal-page h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.25;
}
.legal-page h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  color: var(--text);
  margin: 34px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.legal-page h3 {
  font-size: 14.5px;
  color: var(--text);
  margin: 20px 0 6px;
  font-weight: 600;
}
.legal-page p { margin: 0 0 12px; }
.legal-page strong { color: var(--text); font-weight: 600; }
.legal-page a { color: var(--accent); }

.legal-updated {
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.75;
  margin-bottom: 22px !important;
}

.legal-page ul,
.legal-page ol {
  margin: 0 0 14px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.legal-page li::marker { color: var(--accent); }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 13px;
}
.legal-table th,
.legal-table td {
  border: 1px solid var(--border);
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: var(--bg-input);
  color: var(--text);
  font-weight: 600;
}

.legal-warning {
  background: rgba(255,196,107,0.08);
  border: 1px solid rgba(255,196,107,0.28);
  border-radius: 9px;
  padding: 12px 14px;
  color: #ffc46b;
}
.legal-warning strong { color: #ffc46b; }

.legal-mail {
  font-size: 16px;
  font-weight: 600;
}

.legal-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

/* Footer on the landing page */
.site-footer {
  max-width: 620px;
  margin: 0 auto;
  padding: 22px 20px calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: var(--text-dim);
}
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .footer-age {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 9px;
  font-weight: 700;
  font-size: 11px;
}

@media (max-width: 720px) {
  .legal-page { font-size: 14px; padding: 22px 16px 50px; }
  .legal-page h1 { font-size: 22px; }
  .legal-page h2 { font-size: 16.5px; }
  .legal-table { font-size: 12px; }
  .legal-table th, .legal-table td { padding: 7px 8px; }
}

.rules-legal {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 6px 20px 0;
  text-align: center;
}
.rules-legal a { color: var(--accent); }

/* ==================== MULTI-TAB BLOCK ==================== */

.tab-blocked {
  position: fixed;
  inset: 0;
  background: rgba(10,12,18,0.96);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tab-blocked-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 24px;
  max-width: 380px;
  text-align: center;
}
.tab-blocked-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  color: var(--text);
  margin: 0 0 10px;
}
.tab-blocked-card p {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0 0 18px;
}
.tab-blocked-card .primary-btn { width: 100%; }
