:root {
  color-scheme: light;
  --ink: #202c24;
  --muted: #53635a;
  --paper: #f4f4ed;
  --panel: #fffffa;
  --line: #dbe1d7;
  --green: #24523a;
  --pale: #e8eee3;
  --serif: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
p { line-height: 1.7; }
h2 { font-family: var(--serif); font-size: 1.33rem; margin-bottom: .65rem; }
h3 { font-size: .95rem; margin-bottom: .4rem; }
button, input, textarea { font: inherit; }
button, a, input, textarea { outline-offset: 3px; }
.masthead {
  padding: .9rem max(1.2rem, calc((100% - 1120px) / 2));
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; background: #172822; color: #e5ebdf;
}
.brand { color: inherit; text-decoration: none; font-family: Georgia, serif; font-size: 1.45rem; letter-spacing: .05em; }
.masthead span { font-size: .82rem; color: #c5d3c6; }
main { max-width: 1160px; margin: 0 auto; padding: 1.2rem; }
.intro {
  border-radius: 9px; padding: clamp(1.4rem, 5vw, 3.4rem);
  color: #f0f2e9; background: radial-gradient(ellipse at 90% 40%, #3a5647 0%, #223a30 55%, #1e3029 100%);
  margin-bottom: 1.15rem;
}
h1 { font-family: var(--serif); font-size: clamp(2.25rem, 7vw, 4rem); letter-spacing: .06em; margin: .2rem 0 .65rem; }
.intro p:last-child { max-width: 65ch; color: #dbebdf; }
.eyebrow { font-size: .77rem; letter-spacing: .13em; font-weight: 650; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: clamp(1rem, 3vw, 1.6rem);
}
.lobby { max-width: 520px; }
form { display: grid; gap: .75rem; margin-top: 1rem; }
label { display: grid; gap: .35rem; font-size: .92rem; }
.choices label { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; }
input:not([type="radio"]), textarea {
  padding: .62rem .72rem; width: 100%; min-width: 0;
  color: var(--ink); background: white; border: 1px solid #9cae9e; border-radius: 6px;
}
textarea { resize: vertical; }
button {
  background: var(--green); color: white; border: 1px solid var(--green); border-radius: 6px;
  padding: .58rem .9rem; cursor: pointer; justify-self: start;
}
button:hover { background: #183c2a; }
button.secondary { background: #f3f6ed; color: #244d38; border-color: #b7c8b9; }
button.secondary:hover { background: #e4ede2; }
button:disabled { cursor: default; opacity: .57; }
.controls { display: flex; flex-wrap: wrap; gap: .6rem; }
.notice { background: #fbf1d6; padding: .5rem .8rem; border-radius: 7px; margin-bottom: 1rem; }
.room-grid { display: grid; grid-template-columns: minmax(235px, 1fr) minmax(0, 2.4fr); gap: 1rem; align-items: start; }
.sidebar, .investigation { display: grid; gap: 1rem; min-width: 0; }
.narration { background: #e7efe5; }
.narration .eyebrow { color: #25513b; margin-bottom: .4rem; }
.narration button { margin-top: .8rem; }
.players { padding-left: 1.45rem; overflow-wrap: anywhere; }
.players li { padding: .13rem 0; }
.room-code { font-family: ui-monospace, monospace; letter-spacing: .07em; color: var(--green); }
.role { font-weight: 650; }
.muted, .chat-empty { color: var(--muted); font-size: .9rem; }
.suspects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.suspects article { padding: .65rem; border: 1px solid var(--line); border-radius: 6px; }
.suspects p, .clue p { font-size: .92rem; }
.evidence-heading { margin-top: 1.25rem; }
.clue { padding: .6rem 0; border-top: 1px solid var(--line); }
#private-clues .clue { margin-top: .7rem; }
.chat { max-height: 20rem; overflow: auto; display: grid; gap: .55rem; }
.chat-entry { padding: .6rem .75rem; border-left: 2px solid #b7c9b7; background: #f6f7f0; }
.chat-entry.keeper { border-color: var(--green); background: var(--pale); }
.chat-entry p { white-space: pre-wrap; overflow-wrap: anywhere; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: .3rem .75rem; margin: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 1rem; }
.solution { border-color: #91a98f; }
.solution h3 { margin-top: 1rem; }
#ballots { overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .room-grid { grid-template-columns: minmax(0, 1fr); }
  .suspects { grid-template-columns: minmax(0, 1fr); }
}
.host-mode { color: var(--muted); font-size: .84rem; margin: 0 0 .8rem; }
