:root {
  --bg: #DCEEDD;
  --paper: #FBFBF6;
  --ink: #232323;
  --line: rgba(0,0,0,0.5);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;
}
.mono { font-family: "JetBrains Mono","Courier New",monospace; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 2px solid var(--ink);
}
.topbar-inner {
  max-width: 900px; margin: 0 auto; padding: 10px 12px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.logo { font-family: "JetBrains Mono","Courier New",monospace; font-weight: 900; font-size: 1.15rem; letter-spacing: -0.02em; }
.logo .accent { color: #C0392B; }
#nav { display: flex; gap: 6px; flex-wrap: wrap; }
#nav a {
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 0.9rem;
  padding: 6px 12px; border: 2px solid var(--line); border-radius: 3px; background: var(--paper);
}
#nav a.active { background: var(--ink); color: var(--paper); }

main { max-width: 900px; margin: 0 auto; padding: 14px 12px 60px; }

.card {
  background: var(--paper); border: 2px solid var(--line); border-radius: 4px; padding: 14px;
}
.btn {
  font-weight: 700; border: 2px solid var(--ink); border-radius: 3px; padding: 8px 14px;
  background: var(--ink); color: var(--paper); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn.secondary { background: var(--paper); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
select, input, textarea {
  border: 2px solid var(--line); border-radius: 3px; padding: 7px 9px; font-size: 0.92rem;
  background: var(--paper); width: 100%; font-family: inherit;
}
label.field { display: block; margin-bottom: 10px; }
label.field .field-label { font-size: 0.75rem; font-weight: 700; color: rgba(0,0,0,0.55); margin-bottom: 4px; font-family: "JetBrains Mono","Courier New",monospace; }

.genre-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid rgba(0,0,0,0.2); margin-bottom: 12px; padding-bottom: 0; }
.genre-tab {
  padding: 8px 14px; font-weight: 700; white-space: nowrap; cursor: pointer;
  border: 2px solid transparent; border-radius: 4px 4px 0 0; margin-bottom: -2px; background: transparent;
}
.genre-tab.active { background: var(--paper); border-color: var(--ink); border-bottom-color: var(--paper); }

.thread-row {
  display: flex; align-items: center; gap: 10px; background: var(--paper); border: 2px solid rgba(0,0,0,0.6);
  border-radius: 4px; padding: 10px 12px; cursor: pointer; text-decoration: none; color: var(--ink); margin-bottom: 8px;
}
.thread-row .stripe { width: 4px; align-self: stretch; border-radius: 2px; }
.thread-row .title { font-weight: 700; }
.thread-row .meta { font-size: 0.75rem; color: rgba(0,0,0,0.5); font-family: "JetBrains Mono","Courier New",monospace; }

.avatar {
  border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0; border: 2px solid rgba(0,0,0,0.1); object-fit: cover;
}

.post {
  display: flex; gap: 10px; background: var(--paper); border: 2px solid rgba(0,0,0,0.4);
  border-radius: 4px; padding: 10px 12px; margin-bottom: 10px;
}
.post .num { font-size: 0.72rem; color: rgba(0,0,0,0.35); font-family: monospace; }
.post .name { font-weight: 700; font-size: 0.9rem; }
.post .time { font-size: 0.72rem; color: rgba(0,0,0,0.4); font-family: monospace; }
.post .text { font-size: 0.92rem; margin-top: 4px; white-space: pre-wrap; }
.post .actions { display: flex; gap: 12px; margin-top: 6px; }
.post .actions button { background: none; border: none; font-size: 0.75rem; font-weight: 700; cursor: pointer; padding: 0; color: #999; display: flex; align-items: center; gap: 4px; }
.post .actions button.on { color: #B8860B; }

.controls-row { display: flex; gap: 8px; margin-top: 4px; }
.controls-row select { flex: 1; }

.empty { text-align: center; color: rgba(0,0,0,0.45); padding: 40px 0; font-size: 0.9rem; }
.subtitle { color: rgba(0,0,0,0.6); font-size: 0.88rem; margin: 2px 0 14px; }
h2 { font-family: "JetBrains Mono","Courier New",monospace; font-weight: 900; margin: 6px 0 2px; }

.bubble {
  max-width: 78%; padding: 8px 10px; border: 2px solid; border-radius: 8px; font-size: 0.9rem;
}
.bubble .speaker { font-weight: 700; font-size: 0.75rem; margin-bottom: 3px; }
.turn { display: flex; gap: 8px; margin-bottom: 8px; }
.turn.right { flex-direction: row-reverse; }

.vote-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.vote-btn { flex: 1; font-weight: 700; padding: 8px; border: 2px solid; border-radius: 3px; background: var(--paper); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }

.verdict { margin-top: 10px; padding: 10px; border: 2px dashed var(--ink); border-radius: 4px; font-size: 0.85rem; }

.spin { display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-box { background: #fde8e8; border: 2px solid #C0392B; color: #7a2018; padding: 10px; border-radius: 4px; font-size: 0.85rem; margin-bottom: 10px; }
