:root {
  color-scheme: light;
  --paper: #f2eadb;
  --paper-deep: #e5d8c2;
  --ink: #171714;
  --muted: #676055;
  --line: #b9ad99;
  --red: #c12e22;
  --red-dark: #8e1b14;
  --white: #fffaf0;
  --shadow: 8px 8px 0 #171714;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "BIZ UDPMincho", Georgia, serif;
}

button,
input,
select {
  font: inherit;
}

button,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus {
  outline: none;
}

.paper-noise {
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: 0.34;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Ccircle cx='2' cy='3' r='.5' fill='%232b251d'/%3E%3Ccircle cx='12' cy='9' r='.4' fill='%232b251d'/%3E%3Ccircle cx='6' cy='15' r='.35' fill='%232b251d'/%3E%3C/svg%3E");
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--red);
  color: var(--white);
  font: 500 14px/1 Consolas, "Courier New", monospace;
  transform: rotate(-3deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small,
.kicker,
.eyebrow,
.case-meta,
footer {
  font-family: Consolas, "Courier New", monospace;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.screen {
  display: none;
  min-height: calc(100dvh - 104px);
  padding: clamp(56px, 8vw, 110px) 0;
}

.screen.is-active {
  display: block;
}

#setup-screen.is-active {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(480px, 1.15fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: start;
}

.hero {
  position: sticky;
  top: 48px;
}

.eyebrow,
.kicker {
  margin: 0 0 16px;
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1,
h2 {
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 1.22;
  font-weight: 900;
}

h1 em {
  position: relative;
  color: var(--red);
  font-style: normal;
}

h1 em::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 6px;
  background: var(--red);
  content: "";
  transform: rotate(-1deg);
}

.hero-copy {
  max-width: 42rem;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 2;
}

.setup-panel,
.answer-panel,
.timer-panel {
  border: 2px solid var(--ink);
  background: rgba(255, 250, 240, 0.66);
  box-shadow: var(--shadow);
}

.setup-panel {
  padding: clamp(24px, 4vw, 48px);
}

.panel-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 40px;
}

.panel-heading h1,
.panel-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.panel-heading .kicker {
  margin-bottom: 6px;
}

.step-stamp {
  display: grid;
  width: 64px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font: 500 18px/1 Consolas, "Courier New", monospace;
  transform: rotate(-8deg);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field,
.field-group {
  min-width: 0;
}

.field {
  display: grid;
  gap: 9px;
}

.field-label,
.field-group legend {
  font-weight: 700;
}

.field-group {
  margin: 34px 0 0;
  padding: 0;
  border: 0;
}

.field-group legend {
  margin-bottom: 12px;
}

input[type="text"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
}

input[type="text"],
textarea {
  padding: 0 14px;
}

input[type="text"],
select {
  min-height: 52px;
}

textarea {
  min-height: 104px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
}

select {
  padding: 0 42px 0 14px;
  appearance: none;
}

.select-wrap {
  display: block;
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  pointer-events: none;
  content: "";
  transform: translateY(-70%) rotate(45deg);
}

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

.choice-card {
  position: relative;
  display: grid;
  min-height: 90px;
  gap: 8px;
  place-items: center;
  padding: 12px 8px;
  border: 1px solid var(--line);
  background: transparent;
  text-align: center;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.choice-card:has(input:focus-visible) {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.choice-card input,
.suspect-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-card span {
  font-size: 22px;
  font-weight: 900;
}

.choice-card strong {
  font-size: 12px;
}

.choice-custom:has(input:checked) {
  background: var(--red);
}

.custom-fields {
  margin-top: 20px;
  padding: 18px;
  border-left: 5px solid var(--red);
  background: var(--paper-deep);
}

.custom-fields > p:first-child {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.name-field {
  position: relative;
}

.name-field span {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--red);
  font: 500 11px/1 Consolas, "Courier New", monospace;
  transform: translateY(-50%);
}

.name-field input {
  padding-left: 42px;
}

.rules-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  margin: 30px 0;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}

.rules-note strong {
  color: var(--red);
}

.rules-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 0;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  background: var(--red);
  color: var(--white);
  box-shadow: 5px 5px 0 var(--ink);
}

.primary-button:hover {
  background: var(--red-dark);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.primary-button:active,
.secondary-button:active {
  box-shadow: none;
  transform: translate(3px, 3px);
}

.secondary-button {
  background: var(--white);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.text-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--muted);
}

.field-error {
  min-height: 1.5em;
  margin: 8px 0 0;
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 700;
}

.case-meta {
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.case-meta span:first-child {
  color: var(--red);
}

.reveal-stage {
  max-width: 680px;
  margin: 0 auto;
  padding-top: 56px;
  text-align: center;
}

.reveal-stage h1 {
  font-size: clamp(36px, 7vw, 64px);
}

.reveal-stage > p:not(.eyebrow) {
  margin: 20px auto 0;
  color: var(--muted);
  line-height: 1.8;
}

.secret-card {
  position: relative;
  display: grid;
  min-height: 310px;
  place-items: center;
  margin: 42px 0 32px;
  padding: 30px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  box-shadow: 10px 10px 0 var(--red);
}

.secret-card::before,
.secret-card::after {
  position: absolute;
  width: 160px;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  content: "";
}

.secret-card::before {
  top: 35px;
  left: -45px;
  transform: rotate(-35deg);
}

.secret-card::after {
  right: -45px;
  bottom: 35px;
  transform: rotate(-35deg);
}

.card-seal {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 62px;
  aspect-ratio: 1;
  place-items: center;
  border: 3px double var(--red);
  border-radius: 50%;
  color: var(--red);
  font-weight: 900;
  transform: rotate(9deg);
}

.card-front,
.card-back {
  position: relative;
  z-index: 1;
}

.card-front span,
.card-back span,
.card-front small,
.card-back small {
  display: block;
}

.card-front span,
.card-back span {
  color: #c9bfad;
  font: 400 11px/1.4 Consolas, "Courier New", monospace;
}

.card-front strong {
  display: block;
  margin: 16px 0;
  color: var(--red);
  font-size: 92px;
  line-height: 1;
}

.card-back strong {
  display: block;
  margin: 26px 0;
  color: var(--white);
  font-size: clamp(42px, 10vw, 74px);
  line-height: 1.25;
}

.card-front small,
.card-back small {
  color: #c9bfad;
}

.reveal-action {
  max-width: 680px;
}

.discussion-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.78fr);
  gap: clamp(50px, 8vw, 120px);
  align-items: center;
  min-height: 62dvh;
}

.timer-panel {
  padding: clamp(28px, 5vw, 50px);
}

#timer {
  display: block;
  margin: 18px 0;
  font: 500 clamp(70px, 10vw, 120px)/1 Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

.timer-track {
  height: 7px;
  overflow: hidden;
  background: var(--paper-deep);
}

.timer-track div {
  width: 100%;
  height: 100%;
  background: var(--red);
  transform-origin: left;
}

.timer-status {
  min-height: 1.5em;
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.button-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 12px;
}

.vote-now {
  display: block;
  margin: 28px auto 0;
}

#vote-screen {
  max-width: 860px;
  margin: 0 auto;
}

.vote-copy {
  margin: -20px 0 38px 82px;
  color: var(--muted);
}

#vote-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.suspect-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.suspect-card {
  position: relative;
  display: flex;
  min-height: 78px;
  gap: 16px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.56);
  cursor: pointer;
}

.suspect-card:has(input:checked) {
  border: 2px solid var(--red);
  background: var(--white);
}

.suspect-card:has(input:focus-visible) {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.suspect-number {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--ink);
  color: var(--red);
  font: 500 12px/1 Consolas, "Courier New", monospace;
}

.suspect-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-banner {
  padding-bottom: 48px;
  text-align: center;
}

.result-banner h1 {
  font-size: clamp(48px, 9vw, 100px);
}

.result-banner p:last-child {
  color: var(--muted);
  font-size: 17px;
}

.result-banner.is-wolf-win h1 {
  color: var(--red);
}

.answer-panel {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
}

.word-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 38px;
  border: 1px solid var(--ink);
}

.word-comparison > div {
  padding: 24px;
}

.word-comparison > div + div {
  border-left: 1px solid var(--ink);
}

.word-comparison span,
.word-comparison strong {
  display: block;
}

.word-comparison span {
  margin-bottom: 9px;
  color: var(--muted);
  font: 400 11px/1.4 Consolas, "Courier New", monospace;
}

.word-comparison strong {
  font-size: clamp(24px, 5vw, 38px);
}

.word-comparison .wolf-answer {
  background: var(--red);
  color: var(--white);
}

.wolf-answer span {
  color: var(--white);
}

.answer-panel h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.assignment-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.assignment-list li {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
}

.assignment-list li span:first-child {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-list .wolf-badge {
  padding: 4px 8px;
  background: var(--red);
  color: var(--white);
  font: 500 10px/1.4 Consolas, "Courier New", monospace;
}

.assignment-word {
  margin-left: auto;
  color: var(--muted);
}

.result-actions {
  display: grid;
  max-width: 800px;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin: 28px auto 0;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

#mode-screen.is-active {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: center;
}

.mode-hero h1,
.remote-entry-layout h1 {
  font-size: clamp(48px, 7vw, 88px);
}

.mode-grid {
  display: grid;
  gap: 18px;
}

.mode-card {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  grid-template-rows: auto auto;
  gap: 7px 18px;
  align-items: center;
  min-height: 150px;
  padding: 26px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: rgba(255, 250, 240, 0.66);
  color: var(--ink);
  text-align: left;
  box-shadow: 6px 6px 0 var(--ink);
}

.mode-card:hover {
  transform: translate(-2px, -2px);
}

.mode-card:active {
  box-shadow: none;
  transform: translate(4px, 4px);
}

.mode-card-accent {
  background: var(--red);
  color: var(--white);
}

.mode-number {
  display: grid;
  width: 60px;
  aspect-ratio: 1;
  grid-row: 1 / 3;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 500 12px/1 Consolas, "Courier New", monospace;
}

.mode-card strong {
  font-size: clamp(22px, 3vw, 31px);
}

.mode-card small {
  color: currentColor;
  opacity: 0.72;
}

.mode-card > span:last-child {
  grid-row: 1 / 3;
  font-size: 28px;
}

.remote-entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.8fr);
  gap: clamp(48px, 8vw, 110px);
  align-items: center;
}

.remote-choice-grid {
  align-content: center;
}

.security-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  max-width: 820px;
  margin-top: 64px;
  padding: 20px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.security-note strong {
  color: var(--red);
}

.security-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.remote-lobby-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.lobby-main {
  min-width: 0;
}

.compact-panel {
  padding: 28px;
  box-shadow: 5px 5px 0 var(--ink);
}

.compact-panel h2,
.signal-panel h2,
.roster-panel h2,
.chat-panel h2 {
  margin: 0;
  font-size: 27px;
}

.remote-category-field {
  margin-top: 20px;
}

#remote-custom-fields {
  margin-top: 18px;
}

.signal-panel,
.roster-panel,
.chat-panel {
  border: 2px solid var(--ink);
  background: rgba(255, 250, 240, 0.66);
}

.signal-panel {
  margin-top: 28px;
  padding: clamp(22px, 4vw, 34px);
}

.signal-heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.signal-heading .kicker {
  margin-bottom: 6px;
}

.signal-steps {
  margin: 24px 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.signal-button {
  width: 100%;
  margin-top: 14px;
}

.connection-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--red);
  color: var(--red);
  font: 500 10px/1 Consolas, "Courier New", monospace;
}

.roster-panel {
  position: sticky;
  top: 32px;
  padding: 28px;
  box-shadow: 6px 6px 0 var(--ink);
}

.remote-roster {
  margin: 24px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.remote-roster li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.roster-number {
  color: var(--red);
  font: 500 10px/1 Consolas, "Courier New", monospace;
}

.remote-roster li strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-status {
  color: var(--muted);
  font: 400 9px/1 Consolas, "Courier New", monospace;
}

.roster-actions {
  display: flex;
  gap: 6px;
}

.roster-action {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.approve-action {
  border-color: var(--red);
  color: var(--red-dark);
}

.remove-action {
  color: var(--muted);
}

.empty-copy,
.helper-copy,
.connection-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.helper-copy {
  margin: 18px 0 0;
}

.guest-lobby {
  max-width: 760px;
  margin: 0 auto;
}

.guest-lobby .signal-panel {
  box-shadow: 6px 6px 0 var(--red);
}

.signal-code-input {
  text-align: center;
  font: 500 34px/1 Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

.room-code-block {
  margin: 26px 0 22px;
  text-align: center;
}

.room-code-block > span {
  color: var(--muted);
  font: 500 10px/1 Consolas, "Courier New", monospace;
}

.host-room-code {
  margin: 12px 0 0;
}

.room-share-actions {
  margin-top: 12px;
}

.room-share-actions .secondary-button {
  width: 100%;
}

.room-lock-button {
  display: block;
  margin: 24px auto 0;
  color: var(--red-dark);
}

.guest-code-panel {
  text-align: center;
}

.six-digit-code {
  display: block;
  margin: 28px 0 20px;
  padding: 24px 12px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  color: var(--red);
  font: 500 clamp(52px, 12vw, 86px)/1 Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

.waiting-room-mark {
  margin: 20px 0;
  color: var(--red);
  font: 500 70px/1 Consolas, "Courier New", monospace;
}

.participant-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--red);
}

.participant-dialog::backdrop {
  background: rgba(23, 23, 20, 0.68);
}

.participant-dialog form {
  padding: clamp(24px, 5vw, 40px);
}

.participant-dialog h2 {
  margin: 0;
  font-size: clamp(25px, 5vw, 36px);
}

.participant-dialog form > p:not(.kicker) {
  margin: 18px 0 28px;
  color: var(--muted);
  line-height: 1.8;
}

.signal-field {
  margin-top: 22px;
}

.host-ready-control {
  margin-top: 28px;
  padding: 22px;
  border: 1px dashed var(--line);
  background: rgba(255, 250, 240, 0.48);
}

.host-ready-control p {
  margin: 0 0 16px;
  color: var(--muted);
}

#guest-ready-status {
  margin-top: 24px;
}

.remote-discussion-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(420px, 1.2fr);
  gap: clamp(36px, 7vw, 90px);
  align-items: start;
}

.remote-discussion-grid h1 {
  font-size: clamp(42px, 6vw, 76px);
}

.remote-timer-panel {
  margin-top: 36px;
  box-shadow: 6px 6px 0 var(--ink);
}

.chat-panel {
  min-height: 650px;
  padding: 28px;
  box-shadow: 6px 6px 0 var(--red);
}

.chat-log {
  height: 480px;
  margin: 24px 0 16px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chat-log:empty::after {
  display: block;
  padding: 32px 4px;
  color: var(--muted);
  content: "まだ発言はありません。最初の一言をどうぞ。";
  font-size: 13px;
}

.chat-log li {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}

.chat-log li strong {
  overflow: hidden;
  color: var(--red-dark);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-log li span {
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-form .secondary-button {
  min-width: 92px;
}

.result-waiting {
  max-width: 800px;
  margin: 28px auto 0;
  text-align: center;
}

@media (max-width: 840px) {
  #setup-screen.is-active,
  .discussion-layout,
  #mode-screen.is-active,
  .remote-entry-layout,
  .remote-lobby-layout,
  .remote-discussion-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    position: static;
  }

  .discussion-layout {
    gap: 50px;
  }

  .roster-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 16px 0;
  }

  .screen {
    min-height: calc(100dvh - 78px);
    padding: 42px 0 64px;
  }

  #setup-screen.is-active {
    gap: 42px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-copy {
    margin-top: 24px;
    font-size: 15px;
  }

  .setup-panel {
    padding: 22px 18px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .field-row,
  .name-grid,
  .suspect-grid,
  .result-actions {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rules-note {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .step-stamp {
    width: 52px;
  }

  .secret-card {
    min-height: 280px;
    margin-top: 34px;
    box-shadow: 6px 6px 0 var(--red);
  }

  .discussion-layout {
    min-height: auto;
  }

  .timer-panel {
    padding: 26px 20px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  #timer {
    font-size: 68px;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .vote-copy {
    margin: -20px 0 30px;
  }

  .word-comparison {
    grid-template-columns: 1fr;
  }

  .mode-card {
    grid-template-columns: 52px 1fr auto;
    min-height: 124px;
    padding: 20px 16px;
  }

  .mode-number {
    width: 46px;
  }

  .mode-card strong {
    font-size: 21px;
  }

  .security-note {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 40px;
  }

  .signal-heading {
    display: grid;
  }

  .compact-panel,
  .signal-panel,
  .roster-panel,
  .chat-panel {
    padding: 20px 16px;
  }

  .chat-panel {
    min-height: 560px;
  }

  .chat-log {
    height: 390px;
  }

  .chat-log li {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-form .secondary-button {
    width: 100%;
  }

  .remote-roster li {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .roster-status {
    display: none;
  }

  .roster-actions {
    grid-column: 2 / 4;
    justify-content: flex-end;
  }

  .word-comparison > div + div {
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .assignment-list li {
    flex-wrap: wrap;
  }

  .assignment-word {
    width: 100%;
    margin-left: 0;
  }

  footer {
    display: grid;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
