:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  color: #cbd0d6;
  background: #0b1017;
  --gold: #b2a17b;
  --line: #303642;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(120deg, #111823, #0b1017 60%);
  min-height: 100vh;
}
a {
  color: var(--gold);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  color: #e0cc9e;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button {
  border: 1px solid #605741;
  border-radius: 5px;
  background: #1b2028;
  padding: 9px 13px;
  cursor: pointer;
}
button:hover {
  background: #292d35;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
:focus-visible {
  outline: 2px solid #c3ac78;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.forum-header {
  padding: 18px max(20px, calc((100vw - 1140px) / 2));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 25px;
  background: #10161f;
}
.brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.brand span {
  font-size: 16px;
  font-weight: 500;
}
.forum-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}
main {
  max-width: 1140px;
  margin: auto;
  padding: 24px 20px 70px;
}
h1 {
  font-family: Georgia, serif;
  font-size: clamp(24px, 4vw, 36px);
  color: #d8c7a2;
  overflow-wrap: anywhere;
  margin: 24px 0;
}
h2 {
  font-size: 20px;
  color: #d8c7a2;
}
small,
time {
  color: #919ba9;
  font-size: 12px;
}
#forum-session {
  font-size: 13px;
  min-height: 20px;
}
#forum-error {
  border-left: 3px solid #b66760;
  background: #442625;
  padding: 12px;
  white-space: pre-wrap;
}
.forum-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.forum-categories a {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #a6adb9;
}
.forum-categories .active {
  border-color: #716343;
  background: #24231f;
  color: #d4be8c;
}
.list-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 22px 0;
}
.list-tools form {
  display: flex;
  gap: 8px;
}
input,
textarea,
select {
  background: #0c121b;
  border: 1px solid #3a4350;
  border-radius: 5px;
  padding: 10px;
  max-width: 100%;
}
textarea {
  resize: vertical;
  width: 100%;
  line-height: 1.6;
}
.forum-topic {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #151d27;
}
.forum-topic:nth-of-type(even) {
  background: #121923;
}
.forum-topic a {
  font-size: 17px;
  overflow-wrap: anywhere;
}
.forum-topic small {
  display: block;
  margin-top: 8px;
}
.forum-topic > div:last-child {
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
}
.forum-topic b {
  font-size: 16px;
  color: #d0d5dc;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 25px 0;
  font-size: 13px;
}
.empty {
  padding: 36px;
  text-align: center;
  background: #131b25;
}
.forum-post {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #141c27;
  margin: 16px 0;
  scroll-margin-top: 12px;
  overflow: hidden;
}
.forum-author {
  padding: 18px 14px;
  background: #101720;
  border-right: 1px solid var(--line);
  font-size: 12px;
}
.forum-author a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow-wrap: anywhere;
}
.forum-author img {
  object-fit: cover;
  border-radius: 7px;
  background: #19212b;
}
.forum-author b {
  font-size: 14px;
}
.forum-author dl {
  margin: 16px 0 0;
}
.forum-author dl div {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 5px;
}
.forum-author dt {
  color: #929daa;
}
.forum-author dd {
  margin: 0;
}
.admin-label {
  display: block;
  text-align: center;
  font-size: 10px;
  text-transform: uppercase;
  color: #c5ad7d;
  margin-top: 9px;
}
.forum-post > section {
  padding: 18px 22px;
  min-width: 0;
}
.forum-post header {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}
.post-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
  font-size: 15px;
  min-height: 38px;
}
.forum-post blockquote {
  margin: 15px 0;
  padding: 12px 16px;
  background: #0d141e;
  border-left: 2px solid #776643;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 13px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.actions button {
  font-size: 12px;
  padding: 7px 10px;
}
.actions [aria-pressed="true"] {
  color: #ddc88e;
  background: #383326;
}
.battle-link {
  display: inline-block;
  padding: 10px 14px;
  background: #202735;
  border: 1px solid #4e5663;
  border-radius: 5px;
  font-size: 13px;
}
.forum-editor {
  padding: 24px;
  background: #151d27;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-top: 26px;
}
.forum-editor label {
  display: block;
  font-size: 13px;
  margin-bottom: 16px;
}
.forum-editor label > input,
.forum-editor label > select,
.forum-editor label > textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
}
.forum-editor small {
  line-height: 1.5;
}
#topic-admin {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-row {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.admin-row p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  width: 100%;
  margin: 5px 0;
  font-size: 13px;
}
.admin-row small {
  word-break: break-all;
}
.admin-section {
  padding: 20px;
  background: #151d27;
  margin-top: 20px;
}
.admin-section form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.admin-section label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}
.forum-header code,
main code {
  overflow-wrap: anywhere;
}
.embedded .forum-header {
  padding: 14px 18px;
}
.embedded main {
  padding-top: 16px;
}
.embedded #game-link {
  display: none;
}
.forum-dialog {
  padding: 0;
  width: min(1180px, 96vw);
  height: 92dvh;
  max-height: 94dvh;
  border: 1px solid #605741;
  border-radius: 8px;
  background: #0b1017;
}
.forum-dialog::backdrop {
  background: #02050bd9;
}
.forum-dialog iframe {
  border: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.forum-dialog-close {
  position: absolute;
  right: 8px;
  top: 7px;
  z-index: 2;
}
a.forum-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #9ca6b5;
  padding: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.forum-nav-link.has-replies {
  color: #ddc18b;
}
.forum-nav-link .forum-count {
  background: #343127;
  color: #d8c396;
  padding: 2px 5px;
  border-radius: 8px;
  font-size: 10px;
}
.forum-nav-link .reply-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccaf6d;
}
.forum-dialog-link {
  font-size: 12px;
}
@media (max-width: 650px) {
  .forum-header {
    padding: 13px;
    gap: 10px;
  }
  .brand {
    font-size: 20px;
  }
  .brand span {
    font-size: 13px;
  }
  .forum-header nav {
    gap: 9px;
    font-size: 12px;
  }
  main {
    padding: 15px 10px 35px;
  }
  .list-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .list-tools form input {
    flex: 1;
    min-width: 0;
  }
  .forum-topic {
    padding: 15px 12px;
    gap: 10px;
  }
  .forum-topic a {
    font-size: 15px;
  }
  .forum-topic > div:last-child small {
    font-size: 10px;
  }
  .forum-post {
    display: block;
  }
  .forum-author {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    display: grid;
    grid-template-columns: 115px 1fr;
    gap: 8px;
  }
  .forum-author > a {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 7px;
    font-size: 12px;
  }
  .forum-author img {
    width: 40px;
    height: 50px;
  }
  .forum-author b {
    font-size: 12px;
  }
  .forum-author dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
    margin: 0;
    font-size: 10px;
  }
  .admin-label {
    grid-column: 1;
    font-size: 9px;
  }
  .forum-post > section {
    padding: 13px;
  }
  .post-body {
    font-size: 14px;
  }
  .forum-editor {
    padding: 15px;
  }
  .forum-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  #forum-admin .admin-section {
    padding: 12px;
  }
  .forum-header #game-link {
    font-size: 11px;
  }
}

.forum-credits {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px 30px;
  font-size: 12px;
}
/* Transactional market announcements use the same readable forum palette. */
.forum-market-item { padding: 16px; border: 1px solid #665331; background: #b9954810; border-radius: 5px; }
.forum-market-item h3 { margin: 8px 0; color: #e1c386; }
.forum-market-item dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; }
.forum-market-item dt { color: #8594a6; font-size: 12px; }
.forum-market-item dd { margin: 3px 0 0; color: #e1d5ba; }
.forum-market-item ul { padding-left: 20px; line-height: 1.65; }
.forum-topic .market-summary { color: #d6ba7c; }
