
.room { min-height: calc(100svh - 64px); }
.room-gate { max-width: 30rem; margin: 2rem auto 0; }
.room-gate-code { font-size: clamp(2.6rem, 10vw, 3.6rem); letter-spacing: 0.18em; margin: 0.25rem 0; }
.room-join { margin-top: 1.25rem; }
.join-code-input { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 700; }
.room-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 0.75rem 1rem; padding: 2rem 0 1.25rem; }
.room-head h1 { font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -0.02em; margin: 0.15rem 0 0; }
.room-head .result-label { margin: 0; }
.room-code { letter-spacing: 0.12em; }
.room-conn { font-size: 0.8rem; color: var(--muted); }
.room-conn.is-bad { color: var(--accent-red); }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: 1.5rem; align-items: start; }
.room-main { display: grid; gap: 1rem; min-width: 0; }
.room-side { display: grid; gap: 1rem; min-width: 0; }
.room-side .panel h2 { margin-bottom: 0.6rem; }
.room-qr { background: #fff; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); max-width: 15rem; margin: 0 auto; }
.room-qr svg { display: block; width: 100%; height: auto; }
.room-link { text-align: center; font-size: 0.85rem; margin: 0.75rem 0 0.5rem; color: var(--muted); }
.room-invite .actions { justify-content: center; }
.room-invite .hint { text-align: center; margin: 0.75rem 0 0; }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.member-list li:last-child { border-bottom: 0; }
.member-list .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.member-list .dot.is-on { background: var(--accent-green); }
.member-list .tag { font-size: 0.72rem; color: var(--muted); background: var(--surface); border-radius: var(--apa-r-pill); padding: 1px 8px; }
.member-list .grow { flex: 1; min-width: 0; display: flex; gap: 0.3em; white-space: nowrap; }
.member-list .grow .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.member-list .grow .num, .member-list .grow .me { flex: none; }
.member-list button { min-height: 44px; padding: 2px 12px; font-size: 0.8rem; }
.room-chat-tabs { margin-bottom: 0.6rem; }
.room-chat-list { list-style: none; margin: 0 0 0.6rem; padding: 0; max-height: 16rem; min-height: 4rem; overflow-y: auto; display: grid; gap: 6px; align-content: start; overscroll-behavior: contain; }
.room-chat-list li { font-size: 0.88rem; line-height: 1.5; }
.room-chat-list li b { font-weight: 650; margin-right: 0.4rem; }
.room-chat-list li.is-me b { color: var(--accent-red); }
.room-chat-list .empty { color: var(--muted); font-size: 0.8rem; }
.room-chat-form { display: flex; gap: 8px; }
.room-chat-form button { flex: none; white-space: nowrap; }
.room-chat.is-wolf { border-color: color-mix(in srgb, var(--apa-red-text) 55%, var(--line)); }
.phase-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--apa-r-lg); background: var(--apa-card); }
.phase-bar.is-night { background: #171717; color: #ededed; border-color: #262626; }
.phase-bar.is-night .hint { color: #a1a1a1; }
.phase-bar h2 { font-size: 1.25rem; margin: 0; }
.phase-bar .hint { margin: 0; }
.countdown { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.countdown.is-up { color: var(--accent-red); }
.phase-bar.is-night .countdown.is-up { color: #ededed; opacity: 0.7; }
.callout { padding: 1rem 1.25rem; border: 1px solid color-mix(in srgb, var(--apa-red-text) 55%, var(--line)); border-radius: var(--apa-r-lg); background: var(--apa-card); color: var(--ink); }
.callout strong { color: var(--accent-red); }
.callout p:last-child { margin-bottom: 0; }
.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr)); gap: 8px; }
.seat {
  display: grid; justify-items: start; justify-content: stretch; align-content: start; gap: 0; text-align: left; border-radius: var(--radius); background: var(--apa-card);
  padding: 8px 12px; min-height: 64px; border: 1px solid var(--line); position: relative; font-weight: 400; line-height: 1.5;
}
@media (hover: hover) { button.seat:hover:not(:disabled) { background: var(--surface); } }
.seat .no { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.seat .who { font-size: 0.78rem; color: var(--muted); max-width: 100%; display: flex; white-space: nowrap; }
.seat .who .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.seat .who .me { flex: none; }
.seat .role { font-size: 0.72rem; font-weight: 650; color: var(--camp, var(--muted)); }
.seat .note { font-size: 0.72rem; color: var(--accent-red); }
.seat.is-out { background: var(--surface); border-color: transparent; }
.seat.is-out .no { text-decoration: line-through; color: var(--muted); }
.seat.is-me { border-color: var(--ink); }
.seat.is-now { border-color: var(--apa-red-text); box-shadow: inset 0 0 0 1px var(--apa-red-text); }
.seat[aria-pressed='true'] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface); }
.seat:disabled { opacity: 0.35; }
.seat .marks { position: absolute; top: 6px; right: 8px; font-size: 0.7rem; color: var(--accent-red); font-weight: 700; }
.sheriff-badge { font-size: 0.7rem; font-weight: 700; line-height: 1.4; color: var(--ink); border: 1px solid var(--ink); border-radius: var(--apa-r-pill); padding: 0 6px; margin: 2px 0; }
.task { display: grid; gap: 0.9rem; }
.task h3 { font-size: 1.05rem; margin: 0; }
.task .actions { margin-top: 0.25rem; }
.task-result { font-size: 1.3rem; font-weight: 700; }
.task-result.is-wolf { color: var(--accent-red); }
.task-result.is-good { color: var(--accent-green); }
.facts { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 0.9rem; }
.facts li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: 6px 0; }
.facts li:last-child { border-bottom: 0; }
.facts li span:first-child { color: var(--muted); }
.order-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.order-list li { border: 1px solid var(--line); border-radius: var(--apa-r-pill); padding: 3px 12px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.order-list li.is-done { color: var(--muted); border-color: transparent; background: var(--surface); }
.order-list li.is-now { border-color: var(--accent-red); color: var(--accent-red); font-weight: 700; }
.tally { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.9rem; }
.tally li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; }
.tally li b { font-variant-numeric: tabular-nums; }
.log { font-size: 0.85rem; }
.log li { justify-content: flex-start; }
.game-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.winner { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; margin: 0.25rem 0 0.5rem; }
.winner.is-wolf, .winner.is-spy { color: var(--accent-red); }
.winner.is-good, .winner.is-civ { color: var(--accent-green); }
.replay { margin: 0; padding-left: 1.25rem; font-size: 0.88rem; display: grid; gap: 4px; }
details.panel > summary { cursor: pointer; font-weight: 650; min-height: 44px; padding-block: 10px; margin-block: -10px; display: flex; align-items: center; }
details.panel[open] > summary { margin-bottom: 0.75rem; }
.setting-row { display: grid; grid-template-columns: 7rem 1fr; gap: 0.5rem 1rem; align-items: baseline; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row > span { font-size: 0.88rem; font-weight: 600; }
.setting-row .segmented > button { padding-inline: 0.75rem; }
.board-pick {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 2px;
  padding: 4px; border-radius: var(--apa-r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.board-pick button { border: 0; border-radius: var(--radius); background: transparent; display: grid; justify-items: start; justify-content: stretch; align-content: center; gap: 0; text-align: left; padding: 6px 10px; min-height: 52px; }
.board-pick button strong { font-weight: 650; }
.board-pick button span { font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.board-pick button[aria-pressed='true'] { background: var(--apa-card); box-shadow: var(--apa-shadow-raise), 0 0 0 1px var(--line); }
.role-steppers { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 6px; }
.role-stepper { display: flex; align-items: center; justify-content: space-between; gap: 4px; border: 1px solid var(--line); border-radius: var(--apa-r-pill); padding-left: 14px; font-size: 0.85rem; }
.role-stepper > span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--camp); vertical-align: 0.05em; }
.role-stepper .stepper { border: 0; }
.role-stepper .stepper button { width: 44px; min-height: 44px; }
.check-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.check-line p { margin: 0; }
.check-line .is-ok { color: var(--accent-green); }
.check-line .is-bad { color: var(--accent-red); }
.console-say { display: grid; gap: 0.5rem; }
.console-say p { font-size: clamp(1.15rem, 3.4vw, 1.4rem); font-weight: 650; line-height: 1.5; margin: 0; }
.console-hint { color: var(--muted); font-size: 0.85rem; background: var(--surface); border-radius: var(--radius); padding: 0.6rem 0.85rem; margin: 0; }
.waiting { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.85rem; }
.waiting b { color: var(--accent-gold); font-weight: 650; }
.waiting span { border: 1px dashed var(--accent-gold); border-radius: var(--apa-r-pill); padding: 1px 10px; }
.console-next { width: 100%; }
.steps-line { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: 0.75rem; }
.steps-line li { padding: 2px 10px; border: 1px solid var(--line); border-radius: var(--apa-r-pill); color: var(--muted); }
.steps-line li.is-done { border-color: transparent; text-decoration: line-through; }
.steps-line li.is-now { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.as-panel { display: grid; gap: 0.75rem; }
@media (max-width: 900px) {
  .room-layout { grid-template-columns: 1fr; }
  .game-two { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .setting-row { grid-template-columns: 1fr; }
  .seat-grid { grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); }
  .phase-bar { padding: 0.85rem 1rem; }
}
.room-main > [data-slot]:empty { display: none; }
.spy-word-card { text-align: center; display: grid; gap: 0.25rem; padding: 1.75rem 1.25rem; }
.spy-word-big { font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 700; color: var(--apa-red-text); margin: 0; letter-spacing: 0.02em; }
.skill-box { border-top: 1px solid var(--line); padding-top: 0.75rem; }
.skill-box > summary { cursor: pointer; font-weight: 650; min-height: 44px; padding-block: 10px; color: var(--apa-red-text); }
.room-chat-tabs:not(:has(> button)) { background: none; box-shadow: none; padding: 0; }
.room-chat-tabs:not(:has(> button)) > strong { padding: 0; }
.facts.panel { padding: 0.35rem 1rem; }
