@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --bg: #0b0c16;
  --bg-soft: #12162a;
  --surface: #171b33;
  --surface-glow: #1f2545;
  --text: #f6f2ff;
  --muted: #a6accb;
  --accent: #f5c542;
  --accent-strong: #f08a4b;
  --link: #6ee7ff;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 50px rgba(10, 12, 25, 0.5);
  --radius: 20px;
  --font-sans: "Manrope", "Trebuchet MS", sans-serif;
  --font-serif: "Fraunces", "Georgia", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.page-glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(110, 231, 255, 0.15), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(245, 197, 66, 0.18), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(240, 138, 75, 0.18), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-footer {
  margin-top: auto;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: #fff;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(23, 27, 51, 0.92), rgba(31, 37, 69, 0.8));
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  max-width: 100%;
  box-sizing: border-box;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 17px;
  color: #1a1202;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.brand-mark:hover {
  transform: scale(1.08);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text);
}

.brand-subtitle {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ---- Header right section ---- */

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

.search-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  background: rgba(11, 12, 22, 0.6);
  border-radius: 999px;
  padding: 4px 14px;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar:focus-within {
  border-color: rgba(110, 231, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.08);
}

.search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.search-bar .search-spinner {
  display: none;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(110, 231, 255, 0.2);
  border-top-color: rgba(110, 231, 255, 0.8);
  border-radius: 50%;
  animation: search-spin 0.6s linear infinite;
}

.search-bar.is-searching .search-icon {
  display: none;
}

.search-bar.is-searching .search-spinner {
  display: block;
}

.search-bar.is-searching input {
  opacity: 0.6;
}

@keyframes search-spin {
  to { transform: rotate(360deg); }
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 7px 4px;
  width: 180px;
  min-width: 0;
  outline: none;
  font-size: 14px;
}

.search-bar input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

/* ---- Sign in button ---- */

.sign-in-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1a1202 !important;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.sign-in-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 197, 66, 0.3);
  color: #1a1202 !important;
}

/* ---- User avatar button & dropdown ---- */

.user-menu-wrap {
  position: relative;
}

.user-avatar-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.user-avatar-btn:hover {
  transform: scale(1.08);
}

.user-mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  background: var(--surface);
  transition: border-color 0.2s ease;
}

.user-avatar-btn:hover .user-mini-avatar,
.user-avatar-btn[aria-expanded="true"] .user-mini-avatar {
  border-color: var(--accent);
}

.avatar-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
  pointer-events: none;
}

.user-avatar-btn[aria-expanded="true"] .avatar-ring {
  border-color: rgba(245, 197, 66, 0.4);
}

/* ---- Dropdown menu ---- */

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: dropdown-in 0.15s ease;
}

.user-dropdown.open {
  display: grid;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 10px;
}

.dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dropdown-username {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-email {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.12s ease;
  text-decoration: none;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.user-dropdown-item svg {
  flex-shrink: 0;
  color: var(--muted);
}

.user-dropdown-item:hover svg {
  color: var(--text);
}

.user-dropdown-item--danger {
  color: #e74c3c;
}

.user-dropdown-item--danger:hover {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}

.user-dropdown-item--danger svg {
  color: #e74c3c;
}

.dropdown-sign-out {
  display: contents;
}

.hero {
  margin: 40px 0 28px;
  display: block;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 42px;
  margin: 0 0 14px;
}

.hero p {
  color: var(--muted);
  line-height: 1.6;
}

.hero-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
}

.hero-stat {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.hero-stat strong {
  color: var(--text);
  font-size: 22px;
}

.forum-index {
  display: grid;
  gap: 28px;
}

.forum-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.forum-header h2 {
  font-family: var(--font-serif);
  margin: 0 0 8px;
}

.forum-header p {
  color: var(--muted);
  margin: 0 0 20px;
}

.forum-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}


.forum-card {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  display: grid;
  gap: 14px;
}

.topic-row,
.forum-card,
.result-card {
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.is-clickable {
  cursor: pointer;
}

.is-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(110, 231, 255, 0.4);
  box-shadow: 0 18px 30px rgba(10, 12, 25, 0.45);
}

.is-clickable:active {
  transform: translateY(0);
  box-shadow: 0 10px 18px rgba(10, 12, 25, 0.4);
}

.forum-link {
  font-weight: 700;
  color: var(--text);
  font-size: 18px;
}

.forum-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.forum-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.forum-meta strong {
  color: var(--text);
  display: block;
}

.forum-hero,
.topic-hero,
.search-hero {
  margin: 32px 0 20px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.users-hero {
  margin: 32px 0 20px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}

.users-hero p {
  color: var(--muted);
  margin: 0;
  max-width: 520px;
}

.users-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.breadcrumbs {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.forum-hero h1,
.topic-hero h1,
.search-hero h1 {
  font-family: var(--font-serif);
  margin: 12px 0;
}

.users-hero h1 {
  font-family: var(--font-serif);
  margin: 12px 0;
}

.forum-hero-meta,
.topic-hero-meta {
  display: flex;
  gap: 16px;
  color: var(--muted);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 12px;
  color: var(--muted);
}

.topic-list,
.result-list {
  display: grid;
  gap: 12px;
}

.users-list {
  display: grid;
  gap: 16px;
}

.user-table-wrap {
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.user-table thead {
  background: var(--surface-glow);
}

.user-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.user-table td {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.user-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.user-table a {
  color: var(--text);
  font-weight: 600;
}

.user-table .posts-cell {
  font-weight: 700;
  color: var(--accent);
}

.user-table .contact-cell a {
  color: var(--link);
  word-break: break-all;
}

.topic-row,
.result-card {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

.topic-link {
  font-size: 18px;
  color: var(--text);
  font-weight: 600;
}

.topic-sub {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 8px;
}

.topic-stats {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.topic-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 12px 0;
}

.topic-pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.topic-pagination a.page-link:hover {
  background: var(--accent);
  color: #1a1202;
}

.topic-pagination .page-link.current {
  background: var(--accent);
  color: #1a1202;
  pointer-events: none;
}

.topic-pagination .page-ellipsis {
  color: var(--muted);
  padding: 0 4px;
  font-size: 16px;
}

.topic-pagination .page-info {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.post-list {
  display: grid;
  gap: 20px;
}

.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden;
}

.post-author {
  background: var(--bg-soft);
  padding: 20px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.post-author img {
  width: 90px;
  height: 90px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid var(--border);
}

.author-name a {
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
}

.author-meta {
  color: var(--muted);
  font-size: 12px;
  display: grid;
  gap: 6px;
}

.post-body {
  padding: 20px 24px 26px;
}

.post-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.post-content {
  line-height: 1.7;
  color: #e7e3f4;
}

.post-content img {
  max-width: 100%;
}

.video-embed {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}

.video-embed iframe {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 16px 0;
  padding: 10px 16px;
  background: rgba(245, 197, 66, 0.08);
}

.post-content pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
}

.post-content ul,
.post-content ol {
  margin: 12px 0 12px 20px;
  padding: 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.spoiler {
  margin: 12px 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border);
}

.spoiler summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

.bb-center {
  text-align: center;
}

.bb-left {
  text-align: left;
}

.bb-right {
  text-align: right;
}

.smiley {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.bb-u {
  text-decoration: underline;
}

.quote-head {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}

.profile {
  margin: 28px 0 16px;
}

.profile-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  display: flex;
  gap: 20px;
  align-items: center;
}

.profile-card img {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid var(--border);
}

.profile-meta {
  color: var(--muted);
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.profile-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--link);
}

.search-meta {
  display: flex;
  gap: 16px;
  color: var(--muted);
}

.result-snippet {
  color: var(--muted);
  line-height: 1.6;
}

.pagination {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--muted);
}

.pagination a {
  background: var(--accent);
  color: #1a1202;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.site-footer {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s, color 0.2s;
  z-index: 100;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.empty-state {
  margin: 48px auto;
  text-align: center;
  background: var(--surface);
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.button {
  display: inline-block;
  margin-top: 16px;
  background: var(--accent);
  color: #1a1202;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

@media (max-width: 960px) {
  .site-header {
    flex-wrap: wrap;
    position: relative;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    order: 2;
  }

  .user-menu-wrap {
    position: absolute;
    top: 12px;
    right: 24px;
  }

  .header-right {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    align-self: stretch;
    margin-left: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .site-header .header-right .search-bar {
    flex: 1 1 0%;
    min-width: 0;
    max-width: none;
  }

  .header-right .sign-in-btn {
    flex-shrink: 0;
  }

  .site-header .header-right .search-bar input {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .users-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .users-meta {
    text-align: left;
  }
}

@media (max-width: 800px) {
  .user-table {
    min-width: 0;
  }

  .user-table thead {
    display: none;
  }

  .user-table tr {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
  }

  .user-table td {
    padding: 0;
    border: none;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
  }

  .user-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

  .notice {
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(110, 231, 255, 0.12);
    border: 1px solid rgba(110, 231, 255, 0.3);
    color: var(--text);
    font-weight: 600;
  }

  .notice.error {
    background: rgba(240, 138, 75, 0.12);
    border-color: rgba(240, 138, 75, 0.4);
  }

  .primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    background: var(--accent);
    color: #221600;
    font-weight: 700;
    cursor: pointer;
  }

  .primary-button:hover,
  .primary-button:focus-visible {
    background: #f4c430;
    color: #221600;
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.25);
  }

  .sign-in {
    margin: 48px 0;
    display: flex;
    justify-content: center;
  }

  .sign-in-card {
    width: min(560px, 100%);
    background: linear-gradient(160deg, rgba(23, 27, 51, 0.95), rgba(14, 17, 35, 0.92));
    border-radius: 28px;
    padding: 32px;
    border: 1px solid rgba(110, 231, 255, 0.15);
    box-shadow: 0 30px 70px rgba(6, 8, 20, 0.6);
    display: grid;
    gap: 18px;
    position: relative;
    overflow: hidden;
  }

  .sign-in-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 15%, rgba(110, 231, 255, 0.18), transparent 45%),
      radial-gradient(circle at 85% 10%, rgba(245, 197, 66, 0.2), transparent 40%);
    pointer-events: none;
  }

  .sign-in-card h1 {
    font-family: var(--font-serif);
    font-size: 32px;
    margin: 0;
    position: relative;
    z-index: 1;
  }

  .sign-in-card p {
    margin: 0;
    color: var(--muted);
    position: relative;
    z-index: 1;
  }

  .sign-in-form,
  .pin-form {
    display: grid;
    gap: 12px;
  }

  .sign-in-form label {
    display: grid;
    gap: 8px;
    font-weight: 600;
  }

  .sign-in-form input,
  .pin-form input,
  .reply-form input,
  .reply-form textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(110, 231, 255, 0.2);
    background: rgba(11, 12, 22, 0.7);
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .sign-in-form input:focus,
  .pin-form input:focus,
  .reply-form input:focus,
  .reply-form textarea:focus {
    outline: none;
    border-color: rgba(110, 231, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(110, 231, 255, 0.15);
  }

  .pin-entry {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 11, 24, 0.6);
    position: relative;
    z-index: 1;
  }

  .pin-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .pin-inputs input {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
  }

  .pin-help {
    text-align: center;
    font-size: 12px;
  }

  .reply-section {
    margin: 40px 0 0;
    display: grid;
    gap: 16px;
  }

  .reply-form {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    display: grid;
    gap: 14px;
  }

  .reply-form-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  .reply-label {
    display: grid;
    gap: 8px;
    font-weight: 600;
  }

  .editor-wrap {
    display: grid;
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: rgba(11, 12, 22, 0.7);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .editor-wrap:focus-within {
    border-color: rgba(110, 231, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(110, 231, 255, 0.12);
  }

  .editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
  }

  .editor-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .editor-toolbar button:hover {
    background: rgba(110, 231, 255, 0.12);
    color: var(--text);
  }

  .toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
  }

  .color-picker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease;
  }

  .color-picker-btn:hover {
    background: rgba(110, 231, 255, 0.12);
  }

  .color-picker-icon {
    font-weight: 700;
    font-size: 14px;
    color: var(--muted);
    border-bottom: 3px solid currentColor;
    line-height: 1;
    padding-bottom: 1px;
    pointer-events: none;
  }

  .color-picker-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
  }

  .clear-format-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .clear-format-btn:hover {
    background: rgba(110, 231, 255, 0.12);
    color: var(--text);
  }

  .clear-format-icon {
    font-weight: 700;
    font-size: 15px;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
  }

  .editor-content {
    min-height: 160px;
    max-height: 400px;
    overflow-y: auto;
    padding: 12px 14px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    outline: none;
  }

  .editor-content:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
    pointer-events: none;
  }

  .editor-content blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 8px 8px 0;
  }

  .editor-content pre {
    margin: 8px 0;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    overflow-x: auto;
  }

  .editor-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
  }

  .editor-content a {
    color: var(--link);
    text-decoration: underline;
  }

  .reply-cta {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    text-align: center;
    display: grid;
    gap: 12px;
  }



@media (max-width: 600px) {
  .header-right {
    width: 100%;
  }

  .search-bar {
    width: 100%;
  }

  .search-bar input {
    width: 100%;
  }

  .brand-title {
    font-size: 16px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .topic-stats,
  .forum-hero-meta,
  .topic-hero-meta {
    flex-direction: column;
    gap: 6px;
  }
}

/* ---- Post actions ("..." menu) ---- */

.post-body {
  position: relative;
}

.post-actions-wrap {
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.post-actions-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
}

.post-actions-btn::after {
  content: "···";
  font-size: 18px;
  letter-spacing: 2px;
  line-height: 0;
}

.post-actions-btn:hover {
  background: rgba(110, 231, 255, 0.12);
  color: var(--text);
}

/* Superadmin action button – distinct color for other users' posts */
.post-actions-btn--superadmin::after {
  color: #f5a623;
}
.post-actions-btn--superadmin {
  color: #f5a623;
}
.post-actions-btn--superadmin:hover {
  background: rgba(245, 166, 35, 0.15);
  color: #ffc107;
}

.post-actions-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.post-actions-menu.open {
  display: grid;
}

.post-actions-menu button {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  transition: background 0.15s ease;
}

.post-actions-menu button:hover {
  background: rgba(110, 231, 255, 0.1);
}

.edited-tag {
  font-style: italic;
  opacity: 0.7;
}

/* ---- Profile admin actions ---- */

.profile-admin {
  margin-top: 12px;
}

.profile-edit-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(245, 166, 35, 0.12);
  color: #f5a623;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.profile-edit-btn:hover {
  background: rgba(245, 166, 35, 0.2);
  color: #ffc107;
  border-color: rgba(245, 166, 35, 0.6);
}

/* ---- Modals ---- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  margin: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 16px;
}

.modal-card-lg {
  max-width: 640px;
}

.modal-card h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.5;
}

.modal-field {
  display: grid;
  gap: 8px;
}

.modal-field label {
  font-size: 13px;
  color: var(--muted);
}

.modal-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
}

.modal-field input:focus {
  outline: none;
  border-color: rgba(110, 231, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.12);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.modal-cancel {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.modal-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
}

.modal-confirm {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.modal-confirm:hover {
  opacity: 0.85;
}

.modal-confirm.danger {
  background: #e74c3c;
  color: #fff;
}

.modal-confirm.danger:hover {
  background: #c0392b;
}

.modal-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- Toast notification ---- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 90vw;
  text-align: center;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-success {
  background: linear-gradient(135deg, #1a3a2a, #1e4d35);
  color: #6ee7a0;
  border: 1px solid rgba(110, 231, 160, 0.25);
}

.toast-error {
  background: linear-gradient(135deg, #3a1a1a, #4d1e1e);
  color: #e76e6e;
  border: 1px solid rgba(231, 110, 110, 0.25);
}
