:root {
  color-scheme: dark;
  --paper: #101411;
  --panel: #171c18;
  --ink: #e9eee9;
  --muted: #a6afa7;
  --line: rgba(194, 214, 199, 0.18);
  --line-strong: rgba(194, 214, 199, 0.36);
  --green: #8fc3a2;
  --blue: #1f3037;
  --pink: #382625;
  --yellow: #39331f;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Sans", "Meiryo", system-ui, sans-serif;
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.community-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px max(16px, calc((100vw - 1080px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(16, 20, 17, 0.94);
  backdrop-filter: none;
}

.brand {
  font-weight: 800;
}

.community-top nav,
.thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.community-top a,
.thread-actions a,
.thread-actions button,
.mini-like button,
.create-room button,
.thread-form button,
.reply-form button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.community-shell {
  width: min(1080px, calc(100% - 30px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.hero img {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kicker {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 12px;
  font-size: 3.1rem;
  line-height: 1.08;
}

.lead {
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.8;
}

.create-room,
.rooms-section,
.thread-form,
.threads,
.room-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.create-room,
.thread-form,
.room-hero {
  margin-bottom: 18px;
}

.rooms-section {
  margin-bottom: 18px;
}

.create-room form,
.thread-form form,
.reply-form form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #0e120f;
  color: var(--ink);
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

.room-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;
}

.room-types legend {
  width: 100%;
  font-weight: 800;
}

.room-types input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
}

.room-types span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: var(--panel);
  color: var(--muted);
}

.room-types input:checked + span {
  border-color: var(--line-strong);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.honeypot input {
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.section-head {
  margin-bottom: 14px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.room-card,
.thread-card,
.reply-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.room-card {
  min-height: 166px;
  display: grid;
  align-content: start;
  padding: 16px;
}

.room-card span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.room-card h3 {
  margin: 6px 0;
  font-size: 1.12rem;
}

.room-card p,
.room-card small,
.thread-card header p,
.reply-meta,
.empty,
.notice {
  color: var(--muted);
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
  line-height: 1.7;
}

.room-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.room-card-meta div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #111713;
}

.room-card-meta dt {
  margin-bottom: 2px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
}

.room-card-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
}

.room-card-latest {
  margin-top: 10px;
  font-size: 0.9rem;
}

.thread-card {
  padding: 18px;
}

.thread-card + .thread-card {
  margin-top: 14px;
}

.thread-card h3 {
  margin-bottom: 6px;
  font-size: 1.18rem;
}

.thread-card h3 span {
  margin-right: 8px;
  color: var(--green);
}

.thread-body {
  margin: 14px 0;
  line-height: 1.85;
}

.post-image {
  max-height: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.thread-actions {
  margin-top: 14px;
}

.replies {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.reply-card {
  padding: 14px;
  background: rgba(220, 234, 243, 0.28);
}

.reply-form {
  margin-top: 14px;
}

.mini-like {
  margin-top: 10px;
}

.community-footer {
  width: min(1080px, calc(100% - 30px));
  margin: 0 auto;
  padding: 0 0 30px;
  color: var(--muted);
}

.community-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 820px) {
  .community-top,
  .hero {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .community-top {
    position: relative;
    flex-direction: column;
  }

  .hero img {
    width: 150px;
  }

  h1 {
    font-size: 2.4rem;
  }

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

/* In a forum, borders describe content ownership rather than decoration. */
.thread-form,
.threads,
.create-room {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(13, 18, 15, .82);
}

.thread-card {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(13, 18, 15, .86);
}

.reply-card {
  padding: 14px;
  border: 1px solid rgba(174, 204, 185, .2);
  border-left: 3px solid rgba(174, 204, 185, .4);
  background: rgba(222, 235, 227, .055);
}

.reply-form {
  padding: 14px;
  border: 1px solid rgba(174, 204, 185, .18);
  background: rgba(8, 13, 10, .72);
}

input,
textarea {
  border-radius: 2px;
  border-color: rgba(205, 224, 212, .24);
  background: #0b100d;
}

@media (max-width: 820px) {
  .thread-form,
  .threads,
  .create-room,
  .thread-card { padding: 14px; }
}

/* Forum directory, not a dashboard. */
.community-top { position: relative; backdrop-filter: none; }
.community-top a,
.thread-actions a,
.thread-actions button,
.mini-like button,
.create-room button,
.thread-form button,
.reply-form button { border-radius: 0; background: transparent; }
.community-shell { max-width: 960px; }
.hero { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.hero img { width: 96px; border-radius: 0; }
.create-room,
.rooms-section,
.thread-form,
.threads,
.room-hero { border-radius: 0; background: transparent; box-shadow: none; }
.rooms-section { padding: 1.8rem 0; border: 0; }
.create-room,
.thread-form,
.room-hero { padding: 1.8rem 0; border: 0; border-top: 1px solid var(--line); }
.room-grid { display: block; border-top: 1px solid var(--line); }
.room-card {
  display: grid;
  grid-template-columns: 90px minmax(160px, .7fr) minmax(210px, 1fr) 180px;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.room-card > span { grid-column: 1; }
.room-card > h3 { grid-column: 2; }
.room-card > p { grid-column: 3; }
.room-card-meta { grid-column: 4; grid-row: 1 / span 2; }
.room-card-latest { grid-column: 3; }
.room-card-meta div { border: 0; background: transparent; }
.thread-card,
.reply-card { border-radius: 0; background: transparent; }
.thread-card { border-left: 0; border-right: 0; }
.room-types span { border-radius: 0; background: transparent; }

.room-archive {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.room-archive:not([open]) > .room-grid {
  display: none;
}
.room-archive summary {
  width: fit-content;
  padding: .9rem 0;
  color: var(--muted);
  cursor: pointer;
}
.room-archive summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.room-archive summary span { margin-left: .4rem; font-variant-numeric: tabular-nums; }
.room-archive[open] .room-grid { margin-bottom: 1rem; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr auto; }
  .room-card { grid-template-columns: 1fr; gap: .5rem; }
  .room-card > span,
  .room-card > h3,
  .room-card > p,
  .room-card-meta,
  .room-card-latest { grid-column: 1; grid-row: auto; }
  .room-card-meta { grid-template-columns: 1fr 1fr; }
}

/* Keep the directory light, but restore structure where people read and write. */
.thread-form,
.threads,
.create-room {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(13, 18, 15, .82);
}

.thread-card {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(13, 18, 15, .86);
}

.reply-card {
  padding: 14px;
  border: 1px solid rgba(174, 204, 185, .2);
  border-left: 3px solid rgba(174, 204, 185, .4);
  background: rgba(222, 235, 227, .055);
}

.reply-form {
  padding: 14px;
  border: 1px solid rgba(174, 204, 185, .18);
  background: rgba(8, 13, 10, .72);
}

@media (max-width: 820px) {
  .thread-form,
  .threads,
  .create-room,
  .thread-card { padding: 14px; }
}
