body {
    background-color: #14161A;
    color: #A0A0A8;
    font-family: system-ui;
}

a {
    color: #809bce;
    text-decoration: none;
    cursor: pointer;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.breadcrumbs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    padding: 16px;
    margin: 0;
}

.breadcrumbs li::after {
    content: "›";
    margin: 0 0 0 0.5em;
}

.breadcrumbs li:last-child::after {
    content: "";
}

.breadcrumbs a {
    text-decoration: none;
    color: #0077cc;
}

.breadcrumbs .is-active a {
    color: #A0A0A8;
    font-weight: bold;
    pointer-events: none;
}

.post {
    border-radius: 5px;
    background-color: #202228;
    margin-bottom: 10px;
}

.post-actions {
    text-align: right;
    border-top: 1px solid #444;
    padding: 12px;
}

.button {
  display: inline-block;
  padding: 4px 16px;
  background-color: #2E333D;
  color: #A0A0A8;
  text-decoration: none;
  border: none;
  border-radius: 5px;
  box-shadow: none;
  text-shadow: none;
  outline: none;
  cursor: pointer;
  font: inherit;
  appearance: none;
}

.button:hover {
  background-color: #3A3F4B;
  color: #E0E0E0;
}

.button:active {
  background-color: #3A3F4B;
  transform: none;
  box-shadow: none;
}

.avatar {
    margin: 0;
    width: 48px;
    height: 48px;
    background-color: lightgray;
    position: relative;
    overflow: hidden;
}

.avatar-large {
    margin: 0;
    width: 128px;
    height: 128px;
    background-color: lightgray;
    position: relative;
    overflow: hidden;
}

.avatar img, .avatar-large img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.user-profile-page {
    background: #202228;
    padding: 16px;
    border-radius: 5px;
}

.user-profile-extra {
    margin-top: 15px;
    padding: 16px;
}

.user-details, .user-profile {
    background: #202228;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-details > div, .user-profile-username {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.user-details .rank {
    font-size: 0.9em;
    color: #888;
}

.post-details {
    display: flex; 
    justify-content: space-between;
    align-items: center;
    padding: 12px;
}

.post-date {
    text-align: right;
}

.content {
    padding: 16px;
}

.add-reply-button-container {
    background: #202228;
    padding: 16px;
    text-align: right;
}

.content-editor {
    height: 150px;
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
    background: #202228;
    border: 0;
    color: darkgrey;
}

.pagination {
    padding: 0;
    display: flex;
    justify-content: center;
    list-style: none;
    margin-top: 20px;
    gap: 0.5em;
}

.pagination .is-current {
    color: #E0E0E0;
    border: 1px solid #E0E0E0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forum-row {
    display: flex;
    gap: 1rem;
    padding: 16px 0;
}

.forum-row:nth-child(odd) {
    background-color: #202228;
}

.forum-row-item {
    flex: 1;
    padding: 0 10px;
}

.latest-thread-row {
    display: flex;
    padding: 4px 0
}

.latest-thread-row-item {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 20ch;
}

.tag {
    background: #809bce;
    color: #14161A;
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
    margin-right: 5px;
    cursor: pointer;
}

.user-tag {
    background: #F7C9A9;
    color: #14161A;
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
    margin-right: 5px;
    cursor: pointer;
}

.topics-list {
    display: grid;
    grid-template-columns: auto auto auto auto;
    gap: 10px 0;
}

.user-list {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 10px 0;
}

@media (max-width: 600px) {
    .topics-list {
        grid-template-columns: auto auto;
    }
    .topic-views, .topic-posts {
        display: none !important;
    }
}

.topics-list > div, .user-list > div {
    background: #202228;
    padding: 15px;
}

.topics-list > div:nth-child(4n+2),
.topics-list > div:nth-child(4n+3),
.topics-list > div:nth-child(4n+4) {
    display: flex;
    align-items: center; 
}

.topics-list > div:nth-child(4n+1) {
    border-radius: 5px 0 0 5px;
}

.topics-list > div:nth-child(4n+4) {
    border-radius: 0 5px 5px 0;
}

.user-list > div:nth-child(3n+1) {
    border-radius: 5px 0 0 5px;
}

.user-list > div:nth-child(3n+3) {
    border-radius: 0 5px 5px 0;
}

.user-list > div:nth-child(3n+2), .user-list > div:nth-child(3n+3) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  width: 100%;
  font-family: system-ui, sans-serif;
  cursor: pointer;
  outline: none; /* remove default focus ring */
  background: #2E333D;
  padding: 8px 10px;
  border: 1px solid #555;
  border-radius: 5px;
}

/* Dropdown list (hidden by default) */
.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #2E333D;
  border: 1px solid #444;
  border-radius: 5px;
  margin-top: 4px;
  display: none;
  z-index: 10;
}

/* Show when dropdown (or any child) is focused */
.dropdown:focus-within .dropdown-list {
  display: block;
}

.dropdown-item {
  margin-top: 5px;
}

.remove-button {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.topics-list-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
}

.by {
    display: inline-block;
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.new-topic-button {
    white-space: nowrap;
}

.main-content {
    margin-top: 25px;
}

.loading-indicator {
    display: none;
    text-align: center;
    margin: 20px 0;
    padding: 20px;
}

.is-loading {
    display: block !important;
}

.thread-moderation-actions {
    justify-content: flex-end;
    background: #202228;
    padding: 16px;
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.navbar-item .buttons {
  display: inline-flex;
  gap: 0.5rem;
}

.navbar-item .buttons a:not(.button):not(:last-child)::after {
  margin-left: 0.5rem;
  content: "•";
}

.signature {
    font-size: 0.66rem;
    border-top: 1px dashed #444;
    margin-top: 1em;
    padding-top: 1em;
}

#poll-container {
    padding: 16px;
    border-bottom: 1px solid #444;
}

#poll-container h3 {
    margin-top: 0;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]) {
    color: #A0A0A8;
    background: #202228;
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    border: 0;
    margin-bottom: 8px;
}

select {
    color: #A0A0A8;
    border: 0;
    background: #202228;
    display: inline-block;
    width: auto;
}

textarea {
    font-family: inherit;
    margin-bottom: 8px;
}

fieldset {
    background: #202228;
    border: 1px solid #444;
    padding: 12px;
    margin-bottom: 12px;
}

#thread-form select {
    padding: 12px;
    width: 100%;
    margin-bottom: 8px;
}

#poll-container {
    background: #202228;
    border-radius: 5px 5px 0 0;
}

.poll-vote-buttons {
    margin-top: 12px;
}

.poll-result {
    margin-bottom: 12px;
}

.topic-locked-notice {
    text-align: center;
}

.user-management-form {
    margin-top: 48px;
}

.topic-header {
    margin-bottom: 20px;
}

.topic-header h2 {
    margin-bottom: 8px;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
}

.settings-table, .settings-table th, .settings-table td {
    border: 1px solid #444;
    border-collapse: collapse;
}

.settings-table td {
    padding: 8px;
}

.settings-table-cell-checkbox {
    text-align: center;
}

input[type="checkbox"] {
    accent-color: #809bce;
}

.info-message {
    padding: 16px;
    border: 1px solid #809bce;
    background: #202233;
    margin-bottom: 8px;
    border-radius: 4px;
}

.error-message {
    padding: 16px;
    border: 1px solid #f99898;
    background: #332020;
    margin-bottom: 8px;
    border-radius: 4px;
}

.password-reset-link {
    padding: 16px 0;
}