:root {
  color-scheme: light;
  --ink: #202844;
  --ink-soft: #53607d;
  --night: #11172e;
  --night-soft: #252e4c;
  --paper: #f3f6f9;
  --white: #ffffff;
  --line: #dfe5ed;
  --cyan: #55c7d0;
  --cyan-deep: #168d98;
  --violet: #7779b8;
  --rose: #ba6d83;
  --green: #3f8a79;
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.skyline { position: fixed; inset: 0 0 auto; height: 210px; overflow: hidden; pointer-events: none; opacity: .7; }
.skyline i { position: absolute; bottom: 0; display: block; width: 14vw; min-width: 90px; height: 88px; background: #e8edf3; clip-path: polygon(0 100%,0 35%,22% 35%,22% 13%,37% 13%,37% 48%,61% 48%,61% 22%,80% 22%,80% 100%); }
.skyline i:nth-child(1) { left: 2%; height: 94px; }
.skyline i:nth-child(2) { left: 19%; height: 126px; transform: scaleX(-1); }
.skyline i:nth-child(3) { right: 24%; height: 96px; }
.skyline i:nth-child(4) { right: 8%; height: 139px; transform: scaleX(-1); }
.skyline i:nth-child(5) { right: -5%; height: 80px; }
.topbar { height: 78px; padding: 0 clamp(24px, 6vw, 88px); display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; color: #eaf1ff; background: var(--night); }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.brand-mark { width: 34px; height: 34px; border: 1px solid #7896b5; border-radius: 50%; display: grid; place-items: center; position: relative; }
.brand-mark::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--cyan); display: block; transform: translateX(-3px); }
.brand-mark span { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--night); transform: translate(4px,-4px); }
.brand strong { display: block; font-size: 16px; letter-spacing: .04em; font-weight: 600; }
.brand small { display: block; margin-top: 3px; color: #9aa8c4; font-size: 8px; letter-spacing: .14em; }
.app-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; position: relative; z-index: 1; }
.landing-view { min-height: calc(100vh - 130px); display: grid; grid-template-columns: minmax(280px, .92fr) minmax(360px, .8fr); align-items: center; gap: clamp(48px, 9vw, 132px); padding: 70px 3vw 80px; }
.landing-copy { max-width: 490px; }
.moon-stamp { width: 70px; height: 70px; border: 1px solid #a4b6c6; border-radius: 50%; display: grid; place-items: center; margin-bottom: 36px; color: var(--cyan-deep); font-size: 25px; position: relative; }
.moon-stamp::after { content: ""; position: absolute; inset: 7px -4px -4px 7px; border: 1px solid #d1dce6; border-radius: 50%; }
.kicker { margin: 0 0 12px; color: var(--cyan-deep); font-size: 12px; font-weight: 600; letter-spacing: .1em; }
.landing-copy h1 { margin: 0; font-size: clamp(40px, 5.4vw, 68px); line-height: 1.2; letter-spacing: -.065em; font-weight: 600; }
.intro { max-width: 380px; margin: 24px 0 32px; color: var(--ink-soft); font-size: 15px; line-height: 1.9; }
.landing-rule { display: flex; align-items: center; gap: 12px; color: #8792a7; font-size: 11px; }
.rule-line { height: 1px; width: 35px; background: var(--cyan-deep); }
.entry-board { padding: 28px 34px 25px; background: var(--white); border-top: 3px solid var(--cyan); box-shadow: 0 16px 45px #18234612; }
.public-room-lobby { width: 100%; }
.public-room-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 14px; }
.public-room-heading .kicker { margin-bottom: 5px; }
.public-room-heading h2 { margin: 0; font-size: 22px; }
.public-room-heading .quiet-button { min-height: 34px; padding: 0 13px; }
.public-room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.public-room-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--line); }
.public-room-meta { flex: 1; min-width: 0; }
.public-room-meta strong { display: block; color: var(--ink); font-size: 13px; }
.public-room-meta span { display: block; margin-top: 4px; color: #8792a7; font-size: 10px; }
.public-room-card button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 3px; background: var(--night); color: white; font-size: 11px; font-weight: 600; }
.public-room-empty { grid-column: 1 / -1; margin: 0; padding: 20px; color: #929daf; background: #ffffffa6; border: 1px solid var(--line); text-align: center; font-size: 12px; }
.board-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 24px; color: #9ba4b5; font-size: 13px; }
.board-tabs button { padding: 0 0 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: inherit; background: transparent; }
.board-tabs button:hover, .board-tabs button:focus-visible { color: var(--ink); }
.board-tabs .tab-active { color: var(--ink); border-bottom-color: var(--violet); }
.entry-panel[hidden] { display: none; }
.entry-form .select-label { margin-top: 9px !important; }
.entry-form .primary-button { margin-top: 9px; }
.public-panel .public-room-heading { align-items: center; }
.public-panel .public-room-heading h2 { font-size: 18px; }
.public-panel .public-room-list { grid-template-columns: 1fr; }
.join-form-wrap { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.public-panel .public-room-lobby { margin-top: 24px; }
.join-by-code-title { margin: 0 0 12px; color: var(--ink); font-size: 13px; font-weight: 600; }
.entry-form label, .host-settings label { display: block; margin: 0 0 8px; color: #59647e; font-size: 12px; font-weight: 600; }
.entry-form input, .entry-form select, .host-settings input, .host-settings select, .join-form input, .action-area input, .action-area textarea, .chat-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: #fbfcfd; outline: none; }
.entry-form input, .entry-form select, .host-settings input, .host-settings select, .join-form input { min-height: 42px; padding: 0 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan-deep); box-shadow: 0 0 0 3px #55c7d021; }
.form-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.input-suffix { display: flex; align-items: center; position: relative; }
.input-suffix input { padding-right: 82px; }
.input-suffix span { position: absolute; right: 10px; color: #8d97a9; font-size: 10px; pointer-events: none; }
.select-label { margin-top: 2px !important; }
.primary-button { width: 100%; min-height: 46px; border: 0; border-radius: 4px; padding: 0 17px; background: var(--night); color: white; font-weight: 600; text-align: left; display: flex; align-items: center; justify-content: space-between; transition: background .16s ease, transform .16s ease; }
.primary-button:hover { background: #273454; }
.primary-button:active { transform: translateY(1px); }
.primary-button:focus-visible, button:focus-visible { outline: 3px solid #55c7d0a8; outline-offset: 2px; }
.or-divider { text-align: center; color: #aab1be; font-size: 11px; margin: 20px 0 14px; position: relative; }
.or-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px solid var(--line); }
.or-divider span { position: relative; padding: 0 10px; background: var(--white); }
.join-form { display: grid; grid-template-columns: 1fr 112px; gap: 8px; }
.join-form input:first-child { grid-column: 1; }
.join-form input:nth-child(2) { grid-column: 1; }
.join-form .join-spectator-option { grid-column: 1; display: flex; align-items: center; gap: 7px; margin: 2px 0 0; color: #748198; font-size: 10px; }
.join-form .join-spectator-option input { width: 15px; min-height: 15px; margin: 0; accent-color: var(--cyan-deep); }
.join-form .quiet-button { grid-column: 2; grid-row: 1 / span 3; }
.quiet-button { grid-column: 2; grid-row: 1 / span 2; border: 1px solid #cbd5e2; color: var(--ink); border-radius: 4px; background: #fff; font-weight: 600; }
.quiet-button:hover { border-color: var(--cyan-deep); color: var(--cyan-deep); }
.quiet-button:disabled { opacity: .58; cursor: wait; }
.invite-note { margin: 0 0 10px; padding: 9px 10px; border-left: 2px solid var(--cyan); background: #f3f8f9; color: #526078; font-size: 11px; line-height: 1.5; }
.test-note { margin: 15px 0 0; color: #a1a9b6; font-size: 10px; line-height: 1.6; }
.hidden { display: none !important; }
.app-dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); color: var(--ink); background: var(--white); box-shadow: 0 18px 60px #11172e38; }
.app-dialog--choice-list { width: min(520px, calc(100vw - 32px)); max-height: min(780px, calc(100dvh - 32px)); overflow: auto; }
.app-dialog::backdrop { background: #11172e80; }
.app-dialog-content { padding: 24px; }
.settings-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(820px, calc(100dvh - 32px)); overflow: auto; border-top: 3px solid var(--cyan); }
.settings-dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; border-bottom: 1px solid var(--line); background: #fff; }
.settings-dialog-header h2 { margin: 0; font-size: 19px; }
.settings-dialog-header .quiet-button { min-height: 34px; padding: 0 12px; }
.app-dialog-content h2 { margin: 0; font-size: 18px; }
.app-dialog-content p { margin: 12px 0 22px; color: var(--ink-soft); font-size: 13px; line-height: 1.7; white-space: pre-line; }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.app-dialog-actions--list { flex-direction: column; max-height: min(52dvh, 470px); overflow: auto; padding: 2px 4px 2px 0; }
.dialog-choice { min-width: 76px; min-height: 38px; padding: 0 14px; border: 1px solid #cbd5e2; border-radius: 4px; color: var(--ink); background: white; font-size: 12px; font-weight: 600; }
.app-dialog-actions--list .dialog-choice { width: 100%; min-height: 46px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.dialog-choice:hover { border-color: var(--cyan-deep); }
.dialog-choice--danger { border-color: var(--rose); color: white; background: var(--rose); }
.dialog-choice--danger:hover { border-color: #a8566d; background: #a8566d; }

.room-view { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; min-height: calc(100vh - 130px); padding: 34px 0 72px; }
.room-rail { padding: 22px 20px; border-right: 1px solid var(--line); }
.room-code-block { padding: 0 0 23px; border-bottom: 1px solid var(--line); }
.eyebrow { color: #99a3b3; font-size: 10px; letter-spacing: .08em; }
.room-code { margin: 7px 0 5px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 29px; font-weight: 700; letter-spacing: .15em; }
.share-link { display: block; min-height: 36px; margin: 8px 0; padding: 0 10px; }
.room-code-block p { margin: 0; color: #8a95a7; font-size: 11px; }
.rail-section { padding: 23px 0; }
.section-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading h2, .panel-heading h2 { margin: 0; font-size: 14px; font-weight: 600; }
.count-pill { padding: 3px 8px; background: #e5ebf2; color: #6a7792; font-size: 10px; border-radius: 30px; }
.player-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.spectator-list-empty { margin: 8px 0 0; color: #99a3b3; font-size: 10px; }
.spectator-toggle { width: 100%; min-height: 36px; margin: 2px 0 16px; font-size: 11px; }
.player-row { display: flex; align-items: center; gap: 9px; padding: 8px 9px; color: #53607a; font-size: 12px; background: #fff; border: 1px solid #e6ebf1; }
.player-row.offline { opacity: .64; }
.player-presence { color: #8a95a7; font-size: 9px; white-space: nowrap; }
.kick-button { padding: 3px 6px; border: 1px solid #e5c4cb; border-radius: 3px; color: #91485b; background: #fff8f9; font-size: 9px; }
.player-row.mine { border-color: #b8dfe1; background: #f5fbfb; }
#transfer-host-button, #leave-button { width: 100%; min-height: 38px; margin-top: 9px; }
.avatar { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #dce8ee; color: #526b81; font-size: 11px; font-weight: 700; }
.player-name { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.player-badge { color: var(--cyan-deep); font-size: 10px; white-space: nowrap; }
.role-card { margin: 5px 0 20px; padding: 15px 14px; border-left: 2px solid var(--violet); color: #dbe3f5; background: var(--night-soft); }
.role-card--chief { border-left-color: var(--violet); }
.role-card--seer { border-left-color: #5bc2ff; color: #e7f6ff; background: #174e72; }
.role-card--seer small { color: #b9e2f7; }
.role-card--seer strong { color: #d5f0ff; }
.role-card--seer p { color: #d0e6f1; }
.role-card--werewolf { border-left-color: #ff6575; color: #fff0f1; background: #6b2530; }
.role-card--werewolf small { color: #f1bdc3; }
.role-card--werewolf strong { color: #ffd8dc; }
.role-card--werewolf p { color: #f1d3d7; }
.role-card--villager { border-left-color: #9aa9bd; }
.role-card small { color: #9da9c1; font-size: 10px; }
.role-card strong { display: block; margin: 5px 0 3px; font-size: 19px; }
.role-card p { margin: 0; color: #b0bbd0; font-size: 11px; line-height: 1.7; }
.host-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding: 22px 26px 26px; }
.host-settings .settings-field { min-width: 0; }
.host-settings label { margin: 0 0 7px; font-size: 11px; }
.host-settings input, .host-settings select { min-height: 35px; font-size: 12px; }
.host-settings .quiet-button { min-height: 38px; border: 1px solid #cbd5e2; border-radius: 4px; background: white; font-size: 12px; }
.host-settings .public-setting { display: flex; align-items: center; gap: 9px; margin: 0; color: #59647e; font-size: 11px; font-weight: 600; }
.host-settings .public-setting input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--cyan-deep); }
.host-settings .settings-wide { grid-column: 1 / -1; }
.host-settings .wolf-scaling-note { margin: -7px 0 0; color: #8994a6; font-size: 10px; line-height: 1.6; }
.host-settings #save-settings { width: 100%; color: #fff; background: var(--night); border-color: var(--night); }
.room-heading-tools { display: flex; align-items: center; gap: 10px; }
.settings-trigger { min-height: 36px; padding: 0 13px; font-size: 11px; white-space: nowrap; }
.history-hint { margin-top: 8px; color: #355867; line-height: 1.65; overflow-wrap: anywhere; }
.abort-button { color: #91485b; border-color: #e5c4cb; }
.sound-toggle { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.help-button { min-height: 36px; padding: 0 12px; border: 1px solid #7185a5; border-radius: 4px; color: #eaf1ff; background: transparent; white-space: nowrap; }
.help-button:hover { background: #ffffff14; }
.how-to-dialog { width: min(720px, calc(100vw - 28px)); max-height: 85vh; max-height: 85dvh; }
.how-to-dialog[open] { display: flex; flex-direction: column; }
.how-to-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.how-to-header h2 { margin: 0; font-size: 20px; }
.how-to-header form { margin: 0; }
.how-to-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 24px; font-size: 14px; line-height: 1.8; }
.how-to-body h3 { margin: 22px 0 8px; font-size: 16px; }
.how-to-body p { margin: 8px 0; }
.how-to-body ul, .how-to-body ol { margin: 8px 0; padding-left: 22px; }
.how-to-body li { margin: 5px 0; }
.how-to-body dt { margin-top: 10px; font-weight: 600; }
.how-to-body dd { margin-left: 0; color: var(--ink-soft); }
.turn-notice { padding: 12px; color: #215762; background: #eaf4f4; border-left: 3px solid var(--cyan-deep); }
.idle-warning { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; background: #fff3df; color: #73501c; }
#connection-status { color: #91485b; }
.board-columns { margin-top: 18px; }
.start-button { min-height: 40px; font-size: 11px; }
.text-button { display: block; margin-top: 17px; padding: 0; border: 0; background: transparent; color: #9aa3b2; font-size: 11px; }
.text-button:hover { color: var(--rose); }
.room-main { min-width: 0; }
.room-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 5px 0 24px; border-bottom: 1px solid var(--line); }
.room-heading .kicker { margin-bottom: 6px; }
.room-heading h1 { margin: 0; font-size: clamp(25px, 3vw, 35px); letter-spacing: -.045em; }
.phase-description { margin: 7px 0 0; color: #7d879a; font-size: 12px; line-height: 1.65; }
.private-word { margin: 18px 0 0; padding: 12px 15px; color: #293858; background: #e8edf6; border-left: 2px solid var(--violet); font-size: 13px; }
.private-word strong { color: #484d84; }
.pending-panel { margin: 18px 0 0; padding: 14px 16px; background: #fff; border: 1px solid #dfe5ed; }
.pending-panel .pending-label { color: #8c96a8; font-size: 10px; }
.pending-panel blockquote { margin: 8px 0 0; color: var(--ink); font-size: 15px; line-height: 1.6; }
.board-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr); gap: 20px; padding-top: 21px; }
.record-panel, .discussion-panel { min-width: 0; background: #fff; border: 1px solid #e3e8ee; }
.panel-heading { min-height: 51px; padding: 0 15px; border-bottom: 1px solid #edf0f4; }
.panel-heading > div { display: flex; align-items: center; gap: 8px; }
.record-heading { gap: 12px; }
.history-countdown { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 3px; color: #385e70; background: #e4f2f3; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-countdown.hidden { display: none; }
.panel-mark { color: #6881a0; font-size: 15px; }
.speech-mark { color: var(--cyan-deep); font-size: 21px; line-height: 1; }
.soft-count, .small-muted { color: #9ca5b3; font-size: 10px; }
#opportunity-count { font-size: 13px; }
.history-list { max-height: 390px; min-height: 150px; overflow: auto; padding: 9px 15px 13px; }
.empty-state { padding: 30px 10px; color: #abb3bf; text-align: center; font-size: 12px; line-height: 1.7; }
.history-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 14px 0; border-bottom: 1px solid #eef1f5; }
.history-item:last-child { border-bottom: 0; }
.history-index { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #5d7191; background: #eef2f7; font-size: 13px; }
.history-item.system .history-index { color: #4a8787; background: #e6f3f1; }
.history-body { min-width: 0; }
.history-meta { display: flex; align-items: center; gap: 9px; color: #8994a6; font-size: 13px; }
.history-content { margin-top: 7px; color: #35415d; font-size: 16px; line-height: 1.65; word-break: normal; }
.history-answer { margin-top: 6px; color: var(--cyan-deep); font-size: 15px; font-weight: 600; }
.history-answer.no { color: #aa607a; }
.history-answer.maybe { color: #9a8452; }
.chat-list { height: 340px; overflow: auto; padding: 13px 15px; }
.chat-item { margin-bottom: 13px; }
.chat-item strong { color: #667b98; font-size: 10px; font-weight: 600; }
.chat-item p { margin: 4px 0 0; color: #48546f; font-size: 12px; line-height: 1.65; word-break: break-word; }
.chat-item time { display: block; margin-top: 3px; color: #b0b7c2; font-size: 9px; }
.chat-form { display: flex; gap: 7px; padding: 9px; border-top: 1px solid #edf0f4; }
.chat-form textarea { resize: vertical; min-height: 42px; padding: 9px; font-size: 11px; }
.chat-form button { width: 53px; flex: 0 0 53px; border: 0; border-radius: 3px; color: #fff; background: var(--night-soft); font-size: 11px; }
.chat-speaker { display: flex; align-items: center; gap: 7px; }
.chat-speaker-type { padding: 2px 5px; border-radius: 3px; background: #edf1f6; color: #68758b; font-size: 9px; }
.chat-speaker-type--chief { background: #e8e6f8; color: #615d9c; }
.chat-speaker-type--spectator { background: #e6f4f4; color: #358c92; }
.action-area { margin-top: 18px; padding: 16px 18px 18px; background: #e9eef4; border-left: 3px solid var(--cyan); }
.action-area h2 { margin: 0 0 5px; font-size: 14px; }
.action-area p { margin: 0 0 11px; color: #748198; font-size: 11px; line-height: 1.6; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.action-choice { min-height: 36px; padding: 0 15px; border: 1px solid #cad5e2; border-radius: 3px; background: #fff; color: #34415e; font-size: 11px; font-weight: 600; }
.action-choice:hover { border-color: var(--cyan-deep); }
.action-choice.primary { border-color: var(--night); color: #fff; background: var(--night); }
.action-choice.danger { border-color: #c68b9d; color: #8c4059; background: #fff9fa; }
.action-area input, .action-area textarea { min-height: 42px; padding: 10px 12px; margin: 9px 0; background: #fff; font-size: 12px; }
.action-area textarea { min-height: 74px; resize: vertical; }
.action-area .inline-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.action-area .inline-controls input { flex: 1 1 180px; }
.guessing-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.guessing-form { min-width: 0; padding: 12px; background: #f4f7fa; border: 1px solid #dfe6ee; }
.guessing-form label { display: block; color: #34415e; font-size: 12px; font-weight: 600; }
.guessing-form textarea { width: 100%; }
.turn-controls { margin-top: 12px; }
.toast { position: fixed; top: 92px; left: 50%; z-index: 8; transform: translateX(-50%); max-width: calc(100vw - 28px); padding: 10px 15px; color: #fff; background: #283553; box-shadow: 0 8px 22px #14203c2a; font-size: 12px; }
.result-banner { margin: 18px 0 0; padding: 15px 18px; color: #f0f5ff; background: var(--night-soft); border-left: 3px solid var(--cyan); }
.result-banner strong { display: block; margin-bottom: 5px; font-size: 15px; }
.result-banner p { margin: 0; color: #bbc6d9; font-size: 12px; line-height: 1.6; }
.site-footer { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 0 3vw 25px; display: flex; justify-content: flex-end; color: #a2acb9; font-size: 10px; }

@media (max-width: 860px) {
  .landing-view { grid-template-columns: 1fr 1fr; gap: 36px; padding-inline: 0; }
  .room-view { grid-template-columns: 210px minmax(0, 1fr); gap: 22px; }
  .board-columns { grid-template-columns: 1fr; }
  .discussion-panel .chat-list { height: 220px; }
  .guessing-forms { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { height: 66px; padding: 0 18px; }
  .app-shell, .site-footer { width: min(100% - 28px, 520px); }
  .landing-view { min-height: auto; display: block; padding: 42px 0 54px; }
  .moon-stamp { width: 54px; height: 54px; margin-bottom: 22px; font-size: 19px; }
  .landing-copy h1 { font-size: 43px; }
  .intro { margin: 16px 0 18px; font-size: 13px; }
  .landing-rule { margin-bottom: 26px; }
  .entry-board { padding: 22px 18px 18px; }
  .form-split { grid-template-columns: 1fr; gap: 12px; }
  .room-view { display: flex; flex-direction: column; padding-top: 18px; gap: 18px; }
  .room-rail { order: 2; padding: 18px 0 0; border-right: 0; border-top: 1px solid var(--line); }
  .room-main { order: 1; }
  .room-code-block { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-bottom: 12px; }
  .room-code-block .eyebrow { flex-basis: 100%; }
  .room-code { margin: 0; font-size: 22px; }
  .share-link { margin: 0; }
  .room-code-block p { flex-basis: 100%; margin: 0; }
  .rail-section { padding: 12px 0; }
  .player-list { grid-template-columns: 1fr 1fr; }
  .room-heading { align-items: flex-start; }
  .room-heading h1 { font-size: 27px; }
  .room-heading-tools { flex-direction: column-reverse; align-items: flex-end; }
  .settings-dialog-header { padding: 16px 18px; }
  .host-settings { grid-template-columns: 1fr; gap: 13px; padding: 18px; }
  .host-settings .settings-wide { grid-column: auto; }
  .board-columns { padding-top: 14px; gap: 12px; }
  .history-list { max-height: 290px; }
  .record-heading { gap: 7px; padding-inline: 10px; }
  .record-heading h2 { font-size: 13px; }
  .history-countdown { gap: 3px; padding: 5px 6px; font-size: 11px; }
  #opportunity-count { font-size: 11px; white-space: nowrap; }
  .chat-list { height: 190px; }
  .site-footer { padding-bottom: 17px; gap: 15px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media (max-width: 420px) {
  .player-list { grid-template-columns: minmax(0, 1fr); }
  .topbar-actions { gap: 8px; }
  .sound-toggle { font-size: 10px; gap: 3px; }
  .help-button { padding: 0 8px; font-size: 12px; }
  .how-to-header { padding: 14px 16px; }
  .how-to-body { padding-inline: 16px; }
}

.player-name, .chat-speaker strong, .history-meta strong { min-width: 0; overflow-wrap: anywhere; }
.chat-item p, .history-content, .pending-panel blockquote { overflow-wrap: anywhere; white-space: pre-wrap; }
.result-banner, .action-area, .phase-description { overflow-wrap: anywhere; }
.chat-speaker { flex-wrap: wrap; }
.board-columns > *, .room-heading > * { min-width: 0; }
#chat-new { display: block; margin: 6px auto; color: var(--cyan-deep); }
#chat-new.hidden { display: none; }

.vote-tally { padding: 12px; background: #edf1f8; overflow-wrap: anywhere; }
.vote-tally span { display: inline-block; margin: 4px 16px 4px 0; }
.vote-tally strong { display: block; }
.vote-tally .vote-progress, .vote-progress { color: var(--ink-soft); font-size: 12px; }

.player-presence, .player-badge, .avatar { flex-shrink: 0; }
.history-meta { flex-wrap: wrap; }
