/* ── Avatar ── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 28px;
  border-width: 2.5px;
}

/* ── Profile page ── */
.profile-current {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.profile-current-name {
  font-size: 20px;
  font-weight: 600;
  color: #2D1B4E;
}

.profile-section-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.avatar-option {
  display: flex;
  justify-content: center;
  padding: 8px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.avatar-option:hover {
  background: #F3EEF9;
  border-color: #C5B4DD;
}

.avatar-option-selected {
  border-color: #5C3D9E;
  background: #EDE5F5;
}

/* ── Forum layout ── */
.forum-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.forum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}

.forum-title {
  font-size: 26px;
  font-weight: 700;
  color: #2D1B4E;
  letter-spacing: -0.01em;
}

/* ── Topic list ── */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.topic-card {
  background: #FFFCF8;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(92, 61, 158, 0.08);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s;
}

.topic-card:hover {
  box-shadow: 0 2px 8px rgba(92, 61, 158, 0.14);
}

.topic-card-body {
  flex: 1;
  min-width: 0;
}

.topic-card-title {
  font-size: 17px;
  font-weight: 600;
  color: #2D1B4E;
  word-break: break-word;
  margin-bottom: 4px;
}

.topic-card-meta {
  font-size: 13px;
  color: #9ca3af;
}

.topic-card-meta a {
  color: #5C3D9E;
  text-decoration: none;
}

.topic-card-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.topic-reply-count {
  font-size: 13px;
  color: #9ca3af;
  white-space: nowrap;
}

/* ── Solved badge ── */
.badge-solved {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* ── Topic detail ── */
.topic-detail-header {
  margin-bottom: 20px;
}

.topic-detail-title {
  font-size: 24px;
  font-weight: 700;
  color: #2D1B4E;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.topic-detail-meta {
  font-size: 14px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Post card (topic body + replies) ── */
.post-card {
  background: #FFFCF8;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(92, 61, 158, 0.08);
  padding: 20px;
  margin-bottom: 10px;
}

.post-card-meta {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.post-author {
  font-weight: 600;
  color: #5C3D9E;
}

.location-tag {
  font-size: 12px;
  color: #3B2A6E;
  background: #EDE5F5;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 400;
}

.post-body {
  font-size: 16px;
  color: #1E1228;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-delete-link {
  font-size: 13px;
  color: #d1d5db;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.post-delete-link:hover { color: #e53e3e; }

/* ── Divider ── */
.posts-divider {
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 24px 0 12px;
}

/* ── Reply form ── */
.reply-form {
  background: #FFFCF8;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(92, 61, 158, 0.08);
  padding: 20px;
  margin-top: 16px;
}

.reply-form-title {
  font-size: 15px;
  font-weight: 600;
  color: #2D1B4E;
  margin-bottom: 12px;
}

.forum-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  border: 1.5px solid #D4C9E2;
  border-radius: 8px;
  background: #FAF7F2;
  color: #1E1228;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.forum-textarea:focus {
  outline: none;
  border-color: #5C3D9E;
  background: #FFFCF8;
}

.forum-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  border: 1.5px solid #D4C9E2;
  border-radius: 8px;
  background: #FAF7F2;
  color: #1E1228;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.forum-input:focus {
  outline: none;
  border-color: #5C3D9E;
  background: #FFFCF8;
}

.forum-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.forum-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.forum-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.forum-errors {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  padding: 10px 14px;
  color: #c53030;
  font-size: 15px;
  margin-bottom: 12px;
}

/* ── Solve button ── */
.btn-solve {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  border: 1.5px solid #16a34a;
  background: transparent;
  color: #16a34a;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-solve:hover {
  background: #dcfce7;
}

.btn-unsolve {
  border-color: #9ca3af;
  color: #9ca3af;
}

.btn-unsolve:hover {
  background: #f3f4f6;
}

/* ── New topic form ── */
.forum-form-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.forum-form-title {
  font-size: 24px;
  font-weight: 700;
  color: #2D1B4E;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

/* ── Empty state ── */
.forum-empty {
  text-align: center;
  padding: 48px 0;
  color: #9ca3af;
  font-size: 16px;
}

/* ── Post author row ── */
.post-author-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post-time {
  color: #9ca3af;
}

/* ── Login prompt ── */
.login-prompt {
  background: #FFFCF8;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(92, 61, 158, 0.08);
  padding: 20px;
  margin-top: 16px;
  text-align: center;
  font-size: 15px;
  color: #4b5563;
}

.login-prompt a {
  color: #5C3D9E;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .forum-page { padding: 16px 12px 40px; }
  .forum-form-page { padding: 16px 12px 40px; }
  .forum-title { font-size: 22px; }
  .topic-detail-title { font-size: 20px; }
}
