.forum-page {
  padding-top: 14px;
}

.forum-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 13px 0 12px;
}

.forum-masthead h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 62px);
  letter-spacing: -0.075em;
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #aaa;
}

.forum-masthead h1 span {
  color: var(--red);
}

.forum-intro {
  max-width: 330px;
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.forum-layout {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 18px;
}

.forum-sidebar {
  display: grid;
  gap: 13px;
}

.board-stats {
  width: 100%;
  border-collapse: collapse;
  font: 11px "Courier New", monospace;
}

.board-stats th,
.board-stats td {
  padding: 5px 2px;
  border-bottom: 1px dotted #777;
  text-align: left;
}

.board-stats td {
  text-align: right;
  font-weight: 700;
}

.board-stats .online {
  color: var(--green);
}

.rules-list {
  margin: 0;
  padding-left: 19px;
  font-size: 13px;
  line-height: 1.55;
}

.preview-stamp {
  padding: 8px;
  border: 2px dashed var(--red);
  color: var(--red);
  font: 700 11px/1.35 "Courier New", monospace;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.forum-content {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
}

.section-heading h2::before {
  content: "[ ";
  color: var(--red);
}

.section-heading h2::after {
  content: " ]";
  color: var(--red);
}

.section-heading span {
  font: 10px "Courier New", monospace;
  text-transform: uppercase;
}

.compose-preview {
  margin-bottom: 28px;
  padding: 14px;
  border: 2px inset #fff;
  background: #d6d6d6;
}

.compose-grid {
  display: grid;
  gap: 9px;
}

.forum-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.compose-grid label {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  font-weight: 700;
}

.compose-grid label.message-label {
  align-items: start;
}

.compose-grid input,
.compose-grid textarea {
  width: 100%;
  padding: 7px;
  border: 2px inset #fff;
  color: #000;
  font: 14px "Courier New", monospace;
  background: #fff;
}

.compose-grid textarea {
  min-height: 95px;
  resize: vertical;
}

.compose-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 13px;
  margin: 11px 0 0 102px;
}

.preview-note {
  font: italic 11px "Times New Roman", serif;
}

.thread-list { display: grid; gap: 18px; }

.board-thread {
  padding-bottom: 17px;
  border-bottom: 1px solid #aaa;
}

.board-post {
  display: flow-root;
  width: fit-content;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid #aaa;
  background: #ddd;
}

.board-op {
  width: 100%;
  border-color: transparent;
  background: transparent;
}

.board-reply {
  min-width: min(100%, 420px);
  margin: 6px 0 0 28px;
  border-top-color: #eee;
  border-left-color: #eee;
}

.board-post-content {
  min-width: 0;
}

.board-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 9px;
  align-items: baseline;
  font-size: 12px;
}

.thread-subject {
  color: #780000;
  font-weight: 700;
}

.thread-subject:visited {
  color: #780000;
}

.board-post blockquote {
  margin: 12px 16px 9px 22px;
  font-size: 15px;
  line-height: 1.42;
  white-space: pre-line;
}

.post-thumbnail {
  float: left;
  display: block;
  margin: 0 13px 7px 0;
  border: 1px solid #777;
  background: #ccc;
}

.post-thumbnail img {
  display: block;
  width: 125px;
  height: 95px;
  object-fit: cover;
}

.missing-thumbnail,
.post-image-missing {
  place-content: center;
  color: #840000;
  font-family: "Courier New", monospace;
  text-align: center;
  background:
    repeating-linear-gradient(135deg, #eee 0 8px, #d7d7d7 8px 16px);
}

.missing-thumbnail {
  display: grid;
  width: 127px;
  height: 97px;
}

.missing-thumbnail strong,
.post-image-missing strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.missing-thumbnail span,
.post-image-missing span {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  font-weight: 700;
}

.reply-thumbnail img {
  width: 92px;
  height: 72px;
}

.omitted-posts {
  margin: 4px 0 5px 35px;
  color: #555;
  font-size: 12px;
}

.thread-meta,
.thread-foot,
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  font: 10px "Courier New", monospace;
}

.thread-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dotted #888;
}

.empty-box {
  padding: 18px;
  border: 1px dotted #555;
  background: #fff;
}

.thread-header {
  padding: 18px 0 8px;
}

.thread-header h1 {
  margin: 20px 0 7px;
  font-size: clamp(31px, 6vw, 58px);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.post {
  display: flow-root;
  margin: 11px 0;
  padding: 14px;
  background-color: #D6DAF0;
  border: 1px solid #B7C5D9;
  border-left: none;
  border-top: none;
}

.original-post {
  border: 3px outset #000;
  background: #E7EBF8;
}

.reply-post {
  margin-left: min(28px, 4vw);
}

.post-number {
  font-weight: 700;
}

.poster-id {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid rgb(0 0 0 / 45%);
  border-radius: 5px;
  color: var(--poster-id-text);
  font: 700 10px/1.25 "Courier New", monospace;
  vertical-align: baseline;
  background: var(--poster-id-color);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%);
}

.thread-locked {
  color: var(--red);
  font-weight: 700;
  text-transform: uppercase;
}

.thread-lock-notice {
  margin-bottom: 20px;
}

.post-body {
  margin-top: 13px;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.post-image {
  float: left;
  display: grid;
  justify-items: start;
  gap: 5px;
  max-width: min(250px, 42%);
  margin: 13px 16px 8px 0;
}

.post-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 260px;
  border: 2px inset #fff;
  object-fit: contain;
  background: #ccc;
}

.post-image figcaption {
  max-width: 100%;
  font: 10px "Courier New", monospace;
  overflow-wrap: anywhere;
}

.post-image-missing {
  float: left;
  display: grid;
  width: min(240px, 42%);
  height: 180px;
  margin: 13px 16px 8px 0;
  border: 2px inset #fff;
}

.post-image-missing strong {
  font-size: 46px;
}

.post-image-missing span {
  font-size: 11px;
}

.thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 15px 0;
}

.forum-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 12px;
}

.dark-mode .compose-preview,
.dark-mode .board-post,
.dark-mode .post,
.dark-mode .empty-box {
  color: #c5c8c6;
  border-color: #111;
  background: #282a2e;
}

.dark-mode .board-op,
.dark-mode .original-post {
  background: #1d1f21;
}

.dark-mode .board-reply {
  border-color: #111;
  background: #282a2e;
}

.dark-mode .thread-subject,
.dark-mode .thread-subject:visited {
  color: #b294bb;
}

.dark-mode .omitted-posts {
  color: #969896;
}

.dark-mode .missing-thumbnail,
.dark-mode .post-image-missing {
  color: #cc6666;
  background:
    repeating-linear-gradient(135deg, #282a2e 0 8px, #232428 8px 16px);
}

.dark-mode .compose-grid input,
.dark-mode .compose-grid textarea {
  color: #c5c8c6;
  border-color: #111;
  background: #282a2e;
}

.dark-mode .original-post {
  border-color: #111;
}

@media (max-width: 760px) {
  .forum-masthead {
    grid-template-columns: 1fr;
  }

  .forum-intro {
    max-width: 620px;
  }

  .forum-layout {
    grid-template-columns: 1fr;
  }

  .forum-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    order: 2;
  }

  .forum-content {
    order: 1;
  }
}

@media (max-width: 600px) {
  .forum-sidebar {
    grid-template-columns: 1fr;
  }

  .compose-grid label {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .compose-actions {
    align-items: start;
    flex-direction: column;
    margin-left: 0;
  }

  .board-reply {
    min-width: 0;
    margin-left: 10px;
  }

  .post-thumbnail img {
    width: 96px;
    height: 76px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }
}
