* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
}

/* LAYOUT */
.layout { display: flex; height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: #141422;
  border-right: 1px solid #1e1e35;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header { padding: 20px 16px; }

.site-title {
  font-size: 1rem;
  color: #e94560;
  font-weight: 700;
  cursor: pointer;
}
.site-title:hover { opacity: 0.8; }

.nav-pinned { padding: 8px 8px; }

.nav-pinned li {
  list-style: none;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  color: #e0e0e0;
  font-weight: 500;
}
.nav-pinned li:hover { background: #1e1e35; }
.nav-pinned li.active { background: #1e1e35; color: #e94560; }

.nav-separator {
  height: 1px;
  background: #1e1e35;
  margin: 8px 16px;
}

.nav-sections { flex: 1; padding: 8px; }

.nav-section { margin-bottom: 4px; }

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
}
.nav-section-title:hover { color: #a0a0b0; background: #1e1e35; }
.nav-section-title.active { color: #e94560; }

.nav-subpages { list-style: none; margin: 2px 0 6px; }

.nav-subpages li {
  padding: 5px 12px 5px 24px;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  color: #888;
}
.nav-subpages li:hover { background: #1e1e35; color: #e0e0e0; }
.nav-subpages li.active { background: #1e1e35; color: #e94560; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid #1e1e35;
  font-size: 0.82rem;
}

#identity-status { color: #a0a0b0; margin-bottom: 8px; }
#username-input {
  width: 100%; padding: 8px; margin-bottom: 8px;
  border: 1px solid #1e1e35; border-radius: 4px;
  background: #0f0f1a; color: #e0e0e0; font-size: 0.85rem;
}
#claim-btn, #link-email-btn, #logout-btn {
  width: 100%; padding: 7px; margin-bottom: 6px;
  border: none; border-radius: 4px; cursor: pointer; font-size: 0.8rem;
}
#claim-btn { background: #e94560; color: white; }
#link-email-btn { background: #1e1e35; color: #a0a0b0; }
#logout-btn { background: #1e1e35; color: #666; }

#support-link {
  display: block; text-align: center; font-size: 0.78rem;
  color: #555; text-decoration: none; padding: 6px; margin-top: 8px;
}
#support-link:hover { color: #e94560; }

/* MAIN CONTENT */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* PAGE (shared by all page types) */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 32px;
  width: 100%;
}

.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.5rem; color: #e0e0e0; margin-bottom: 8px; }
.page-header .blurb { font-size: 0.95rem; color: #777; line-height: 1.6; }

/* CONTENT BLOCKS */
.page-content {
  line-height: 1.7;
  font-size: 0.95rem;
  color: #c0c0c0;
}
.page-content h3 { color: #e0e0e0; margin: 24px 0 12px; font-size: 1.1rem; }
.page-content p { margin-bottom: 16px; }
.page-content img { max-width: 100%; border-radius: 8px; margin: 16px 0; }
.page-content iframe { margin: 16px 0; }
.page-content hr { border: none; border-top: 1px solid #1e1e35; margin: 24px 0; }
.page-content a { color: #e94560; }
.page-content ul, .page-content ol { margin: 12px 0 12px 24px; }
.page-content li { margin-bottom: 6px; }

/* CHAT (embedded at bottom of page) */
.chat-section {
  margin-top: 40px;
  border-top: 1px solid #1e1e35;
  padding-top: 24px;
}

.chat-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
  margin-bottom: 16px;
}

.chat-box {
  background: #141422;
  border: 1px solid #1e1e35;
  border-radius: 8px;
  overflow: hidden;
}

#chat-messages {
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message {
  display: flex;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
}
.message:hover { background: #0f0f1a; }

.message .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #e94560;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 0.75rem; color: white;
  flex-shrink: 0;
}

.message .body { flex: 1; min-width: 0; }
.message .meta { display: flex; gap: 8px; align-items: baseline; }
.message .username { font-weight: 600; color: #e94560; font-size: 0.85rem; }
.message .username .mod-tag {
  font-size: 0.55rem; background: #1e1e35; color: #777;
  padding: 1px 4px; border-radius: 3px; margin-left: 4px;
}
.message .timestamp { font-size: 0.68rem; color: #444; }
.message .text { margin-top: 2px; line-height: 1.4; word-wrap: break-word; font-size: 0.9rem; }

.delete-btn {
  background: none; border: none; color: #333;
  cursor: pointer; font-size: 0.7rem; margin-left: auto;
  padding: 2px 4px; border-radius: 3px;
}
.delete-btn:hover { color: #e94560; }

#chat-form {
  display: flex; padding: 12px 16px;
  border-top: 1px solid #1e1e35;
  gap: 8px;
}
#chat-form input {
  flex: 1; padding: 10px 14px;
  border: 1px solid #1e1e35; border-radius: 20px;
  background: #0f0f1a; color: #e0e0e0; font-size: 0.9rem;
}
#chat-form input:focus { outline: none; border-color: #e94560; }
#chat-form button {
  padding: 10px 18px; border: none; border-radius: 20px;
  background: #e94560; color: white; font-weight: 600; cursor: pointer;
  font-size: 0.85rem;
}
#chat-form button:hover { background: #c73e54; }

#banned-banner {
  padding: 10px 16px;
  background: #1a0f0f; color: #e94560;
  text-align: center; font-size: 0.85rem;
}

/* SECTION OVERVIEW (when you click a section with subpages) */
.section-overview {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 32px;
  width: 100%;
}
.section-overview h2 { font-size: 1.5rem; margin-bottom: 8px; }
.section-overview .section-desc { color: #777; line-height: 1.6; margin-bottom: 24px; }

.page-cards { display: flex; flex-direction: column; gap: 10px; }

.page-card {
  padding: 16px 20px;
  background: #141422;
  border: 1px solid #1e1e35;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.page-card:hover { border-color: #e94560; }
.page-card strong { color: #e0e0e0; font-size: 0.95rem; }
.page-card p { color: #666; font-size: 0.85rem; margin-top: 4px; }
.page-card .card-tag {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 8px;
  background: #1e1e35;
  color: #777;
}
.page-card .card-tag.chat { color: #e94560; }

/* EMPTY STATE */
.empty-state {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: #444; font-size: 0.95rem;
}

/* MOBILE */
@media (max-width: 700px) {
  .sidebar { width: 60px; }
  .sidebar-header, .nav-pinned, .nav-sections, .nav-separator, .sidebar-footer { display: none; }
  .page, .section-overview { padding: 24px 16px; }
}   