:root {
  color-scheme: light;
  --paper: #f7f8f3;
  --panel: rgba(255, 255, 255, 0.86);
  --ink: #252c2d;
  --muted: #69706f;
  --line: rgba(39, 50, 49, 0.16);
  --line-strong: rgba(39, 50, 49, 0.3);
  --green: #527a64;
  --blue: #dceaf3;
  --pink: #f2dfdc;
  --yellow: #f5ebc8;
  --shadow: 0 16px 36px rgba(49, 59, 55, 0.11);
}

* {
  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:
    linear-gradient(180deg, rgba(220, 234, 243, 0.72), rgba(220, 234, 243, 0) 320px),
    linear-gradient(90deg, rgba(242, 223, 220, 0.68), rgba(242, 223, 220, 0) 430px),
    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(247, 248, 243, 0.88);
  backdrop-filter: blur(12px);
}

.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: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.58);
  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: rgba(255, 255, 255, 0.78);
  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;
}

.room-types span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.62);
  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);
}

.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: rgba(255, 255, 255, 0.72);
}

.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);
}

.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);
}

@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;
  }
}
