@font-face {
  font-family: 'Castle WenKai';
  src: url('/assets/fonts/castle-wenkai-regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #101013;
  --panel: #19191e;
  --field: #121216;
  --hover: #232329;
  --line: #333239;
  --text: #f2eef1;
  --muted: #b1aab3;
  --red: #da4050;
  --red-hover: #ee5362;
  --red-soft: #342027;
  --radius: 8px;
  font-family: "Castle WenKai", "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; background: none; border: 0; }
button:disabled { cursor: not-allowed; opacity: .38; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--red-hover); outline-offset: 3px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; }
input, select, textarea { color: var(--text); }
input::placeholder, textarea::placeholder { color: #817a84; }
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 23px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
small { font-size: 12px; }
a { color: var(--red-hover); }
.icon { width: 19px; height: 19px; display: inline-block; flex-shrink: 0; vertical-align: middle; }
.topbar { max-width: 1120px; height: 68px; padding: 0 28px; margin: auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { font-size: 21px; font-weight: 700; padding: 8px 0; letter-spacing: 1px; color: var(--red-hover); }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.nav-btn { font-size: 13px; padding: 10px 0; color: var(--muted); }
.nav-btn:hover, .text-btn:hover { color: var(--text); }
.connection { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.connection i { width: 6px; height: 6px; border-radius: 50%; background: #c3bac7; }
.connection.offline { color: var(--red-hover); }
.connection.offline i { background: var(--red); }
.home-shell { max-width: 976px; padding: 32px 28px 40px; margin: auto; }
.entry-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 28px 26px; }
.entry-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.entry-tabs button { padding: 20px 2px 17px; color: var(--muted); font-size: 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.entry-tabs button.active { color: var(--text); border-bottom-color: var(--red); font-weight: 600; }
.config-editor { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 34px; }
.config-basics { padding-right: 26px; border-right: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; margin: 0 0 18px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 5px; background: var(--field); padding: 10px 12px; }
.field select { padding-right: 6px; }
.field textarea { resize: vertical; min-height: 110px; }
.field-help, .judge-seat-note { color: var(--muted); font-size: 12px; line-height: 1.8; }
.judge-seat-note { margin-top: 8px; }
[hidden] { display: none !important; }
.counter { display: inline-flex; align-items: center; flex-shrink: 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--field); }
.counter button { width: 36px; height: 40px; font-size: 19px; line-height: 1; }
.counter button:hover:not(:disabled) { background: var(--hover); }
.counter input { width: 38px; min-height: 40px; padding: 0; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; background: var(--field); font-variant-numeric: tabular-nums; }
.player-counter { display: flex; }
.player-counter input { flex: 1; width: 0; height: 44px; }
.player-counter button { width: 46px; height: 44px; }
.config-roles { min-width: 0; }
.config-roles-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; min-height: 25px; }
.config-roles-heading h3 { font-size: 14px; }
.config-roles-heading span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.role-counter { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid #2b2a31; min-height: 54px; }
.role-counter label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--text); font-size: 13px; }
.role-counter label small { font-size: 10px; color: var(--muted); }
.more-roles { margin-top: 14px; }
summary { cursor: pointer; color: var(--muted); font-size: 13px; min-height: 32px; padding: 4px 0; }
summary:hover { color: var(--text); }
.more-roles[open] summary { margin-bottom: 4px; }
.config-validation { font-size: 12px; line-height: 1.8; margin-top: 12px; color: #d5c5bd; }
.config-validation:empty { display: none; }
.invalid { color: #ff8a96 !important; }
.create-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.create-actions .btn { min-width: 140px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 11px 17px; min-height: 44px; border: 1px solid transparent; border-radius: 5px; font-size: 13px; line-height: 1.5; }
.btn .icon { width: 17px; height: 17px; }
.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 550; }
.primary:hover:not(:disabled) { background: var(--red-hover); border-color: var(--red-hover); }
.outline { background: transparent; border-color: #4a454f; color: var(--text); }
.outline:hover:not(:disabled) { background: var(--hover); }
.quiet { color: var(--muted); }
.quiet:hover:not(:disabled) { background: var(--hover); }
.block { display: flex; width: 100%; margin-top: 12px; }
.text-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 0; min-height: 36px; color: var(--muted); font-size: 12px; }
.text-btn .icon { width: 14px; height: 14px; }
.join-form { max-width: 380px; margin: 0 auto; padding: 6px 0; }
.room-code-input { font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.recent { margin-top: 24px; }
.recent h2 { color: var(--muted); font-size: 12px; font-weight: 500; margin-bottom: 10px; }
.recent>div { display: flex; flex-wrap: wrap; gap: 10px; }
.recent-room { display: inline-flex; align-items: center; gap: 15px; min-height: 40px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; font-size: 12px; }
.recent-room .icon { width: 14px; height: 14px; color: var(--muted); }
.room-page { max-width: 1120px; padding: 28px; margin: auto; }
.room-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.room-heading h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-variant-numeric: tabular-nums; }
.room-heading p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.room-type { font-size: 11px; font-weight: 400; padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.players-panel, .action-panel, .identity-card, .log-panel, .judge-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.players-panel, .action-panel { padding: 22px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title>span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seating { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.seat { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 94px; padding: 10px 12px; text-align: left; background: var(--field); border: 1px solid var(--line); border-radius: 6px; }
.seat:hover:not(:disabled) { background: var(--hover); }
.seat-no { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.seat-no em { font-style: normal; font-size: 9px; color: #ff9aa4; background: var(--red-soft); border-radius: 3px; padding: 0 4px; }
.seat>b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.seat>small { font-size: 10px; color: var(--muted); margin-top: 5px; text-align: left; overflow-wrap: anywhere; }
.seat.empty { border-style: dashed; }
.seat.empty>b { color: var(--muted); }
.seat.is-me { border-color: #90505c; }
.seat.speaking { border-color: var(--red); background: #2f1d24; }
.seat.dead { color: #99919c; background: #151518; }
.seat.dead>b { text-decoration: line-through; }
.seat.dead>small { color: #a397a3; }
.seat.selectable { border-color: #5c4b55; }
.seat.targeted { border-color: var(--red-hover); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.players-panel>.field-help { margin-top: 14px; }
.room-sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lobby-rules { font-size: 12px; color: var(--muted); padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); line-height: 1.9; }
.action-panel>.field { margin-bottom: 6px; }
.action-panel>.field-help { margin: 10px 0; }
.panel-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.phase-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.phase-heading>span { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; color: #f48a96; }
.panel-description { font-size: 12px; line-height: 1.8; color: var(--muted); margin-bottom: 16px; }
.panel-description:empty { display: none; }
.waiting-state { font-size: 13px; padding: 14px 0 6px; color: var(--muted); }
.host-controls { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 10px; }
.target-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0 10px; }
.target-label>span { font-size: 10px; align-self: center; }
.target-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-bottom: 16px; }
.target { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; min-width: 0; padding: 8px 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--field); }
.target b { font-size: 15px; font-weight: 550; font-variant-numeric: tabular-nums; }
.target span { color: var(--muted); font-size: 9px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target.selected, .outline.selected { background: var(--red-soft); border-color: var(--red); }
.submitted { display: flex; align-items: center; gap: 12px; padding: 15px; background: #252027; border: 1px solid #46303b; border-radius: 5px; }
.submitted>.icon { color: #f18b99; }
.submitted>div { display: flex; flex-direction: column; gap: 3px; }
.submitted b { font-size: 13px; font-weight: 500; }
.submitted span { font-size: 12px; color: var(--muted); }
.two-buttons, .direction-buttons { display: flex; gap: 10px; }
.two-buttons>*, .direction-buttons>* { flex: 1; }
.direction-buttons { margin-top: 16px; }
.direction-buttons>.btn { font-size: 11px; padding: 10px 6px; }
.danger-outline { color: #ff909d; border-color: #7b3c4a; }
.witch-victim { padding: 11px 12px; background: #252027; border: 1px solid #49323a; border-radius: 5px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.medicine-choices { display: flex; gap: 8px; margin: 12px 0; }
.medicine-choices button { flex: 1; min-height: 42px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; }
.medicine-choices button.selected { background: var(--red-soft); border-color: var(--red); }
.wolf-votes { font-size: 12px; line-height: 1.8; color: #d5a7b0; }
.manual-notice { font-size: 12px; color: var(--muted); margin: 14px 0; line-height: 1.8; }
.identity-toggle { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 56px; padding: 15px 18px; text-align: left; }
.identity-toggle>.icon { color: #e0afb8; width: 16px; height: 16px; }
.identity-toggle>b { font-size: 13px; font-weight: 550; flex: 1; }
.identity-toggle>span { font-size: 12px; color: var(--muted); }
.role-description { font-size: 12px; color: var(--muted); padding: 0 18px 15px; line-height: 1.9; }
.secret-messages { padding: 0 18px 6px; border-top: 1px solid var(--line); }
.secret-messages p { padding: 12px 0; color: var(--text); font-size: 12px; line-height: 1.9; border-bottom: 1px solid var(--line); }
.secret-messages p:last-child { border: 0; }
.secret-messages small { display: block; color: var(--muted); margin-bottom: 3px; font-size: 10px; }
.log-panel { padding: 12px 18px; }
.log-list p { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.8; }
.log-panel>.text-btn { margin-top: 8px; }
.room-config-strip { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-top: 20px; background: var(--panel); }
.room-config-strip h2 { font-size: 13px; margin-bottom: 12px; }
.role-chips { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.role-chip .icon { display: none; }
.role-chip b { color: var(--muted); font-weight: 400; }
.role-chip.red { color: #fa909e; }
.room-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 12px; }
.result-panel h2 { margin-bottom: 20px; font-size: 21px; }
.judge-panel { margin-top: 20px; padding: 22px; }
.judge-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.judge-grid article { background: var(--field); border: 1px solid var(--line); border-radius: 5px; padding: 15px; min-width: 0; }
.judge-grid h3 { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.judge-grid p { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 5px; }
.judge-grid article>div { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.judge-grid .text-btn { font-size: 11px; }
dialog { background: var(--panel); color: var(--text); width: min(480px,calc(100% - 28px)); border: 1px solid #4b414a; border-radius: 10px; padding: 24px; max-height: 90dvh; overscroll-behavior: contain; }
dialog.wide { width: min(880px,calc(100% - 28px)); }
dialog::backdrop { background: #000b; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.modal-head h2 { font-size: 19px; }
.icon-btn { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.icon-btn .icon { width: 17px; height: 17px; }
.modal-description { color: var(--muted); font-size: 13px; line-height: 1.9; margin-bottom: 18px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line); }
.modal-footer .btn { min-width: 90px; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); font-size: 13px; }
.switch-row input { accent-color: var(--red); width: 18px; height: 18px; }
.entry-note { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 14px; }
.entry-note:empty { display: none; }
.reveal-card { padding: 24px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); text-align: center; }
.reveal-card>.icon { display: none; }
.reveal-card>span { font-size: 12px; color: var(--muted); }
.reveal-card h2 { font-size: 30px; margin: 12px 0 18px; }
.reveal-card p { font-size: 13px; color: var(--muted); line-height: 2; text-align: left; }
.reveal-card.is-wolf { border-color: #87414e; }
.reveal-card.is-wolf h2 { color: #fb8898; }
.current-rules { padding: 16px; border: 1px solid var(--line); background: var(--field); border-radius: 5px; margin-bottom: 8px; }
.current-rules p { color: var(--muted); font-size: 12px; line-height: 1.9; margin-top: 6px; }
.rules-list article { padding: 16px 0; border-bottom: 1px solid var(--line); }
.rules-list p { color: var(--muted); font-size: 13px; line-height: 1.9; margin-top: 7px; }
.role-directory { margin-top: 20px; }
.role-explainer { padding: 16px 0; border-bottom: 1px solid var(--line); }
.role-explainer small { color: #d9a3ad; font-size: 10px; margin-left: 10px; }
.role-explainer p { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.invite-qr { display: flex; justify-content: center; margin: 18px 0; }
.invite-qr svg { width: 200px; height: 200px; background: white; border-radius: 5px; }
.invite-code { text-align: center; padding: 12px; margin-bottom: 12px; background: var(--field); border-radius: 5px; }
.invite-code span { display: block; color: var(--muted); font-size: 12px; }
.invite-code b { font-size: 27px; font-weight: 500; letter-spacing: 5px; font-variant-numeric: tabular-nums; }
.share-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.share-link code { font-size: 12px; overflow-wrap: anywhere; }
.help-details { margin-top: 18px; }
.help-details p { color: var(--muted); font-size: 12px; line-height: 1.9; margin-top: 8px; }
.recovery-box { padding: 20px; background: var(--field); border: 1px solid var(--line); border-radius: 5px; display: flex; flex-direction: column; gap: 12px; }
.recovery-box span { color: var(--muted); font-size: 12px; }
.recovery-box code { font-size: 20px; letter-spacing: 1px; overflow-wrap: anywhere; }
.copy-text { width: 100%; background: var(--field); border: 1px solid var(--line); padding: 15px; min-height: 100px; font-size: 13px; }
.special-targets { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.special-targets .btn { overflow-wrap: anywhere; }
.review-roles { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 22px; }
.review-roles>div { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 5px; background: var(--field); padding: 12px; gap: 4px; min-width: 0; }
.review-roles .icon { display: none; }
.review-roles b { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.review-roles span { font-size: 12px; color: var(--muted); }
.review-log p { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.9; }
.review-log small { display: inline-block; margin-right: 10px; color: var(--muted); }
.ballot { padding: 14px; border: 1px solid var(--line); border-radius: 5px; margin-top: 12px; font-size: 12px; }
.ballot p { color: var(--muted); margin-top: 8px; line-height: 2; }
dialog>h3 { margin: 24px 0 10px; }
.history-list p { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.history-list small { display: block; color: var(--muted); margin-bottom: 5px; }
.muted { font-size: 12px; color: var(--muted); }
.boot { min-height: 100dvh; display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 16px; font-size: 22px; }
.boot span { font-size: 13px; color: var(--muted); }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%,12px); opacity: 0; pointer-events: none; z-index: 1000; padding: 12px 20px; background: #30282f; border: 1px solid #6e4b59; border-radius: 6px; width: max-content; max-width: 90vw; color: var(--text); font-size: 13px; transition: opacity .15s,transform .15s; }
#toast.show { opacity: 1; transform: translate(-50%,0); }
#toast.error { border-color: var(--red); background: #3b2028; }
.busy .btn:not(.quiet) { cursor: wait; }
@media (max-width: 900px) {
  .room-layout { grid-template-columns: minmax(0,1fr) 300px; gap: 16px; }
  .players-panel,.action-panel { padding: 18px; }
  .seating { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .seat { padding: 10px; }
  .config-editor { gap: 24px; }
  .config-basics { padding-right: 24px; }
}
@media (max-width: 680px) {
  .topbar { height: 60px; padding: 0 18px; }
  .brand { font-size: 19px; }
  .topbar nav { gap: 18px; }
  .connection { font-size: 11px; }
  .home-shell { padding: 18px 14px 30px; }
  .entry-card { padding: 0 18px 18px; }
  .entry-tabs { margin-bottom: 22px; gap: 24px; }
  .entry-tabs button { padding-top: 16px; font-size: 15px; }
  .config-editor { grid-template-columns: 1fr; gap: 24px; }
  .config-basics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 12px; padding-right: 0; border-right: 0; }
  .config-basics .field { margin: 0; }
  .config-basics>.field-help,.judge-seat-note { grid-column: 1/-1; font-size: 11px; }
  .judge-seat-note { margin: -6px 0 0; }
  .field { font-size: 12px; gap: 7px; }
  .field input,.field select { padding: 10px; font-size: 12px; }
  .counter input { padding: 0; }
  .player-counter button { width: 35px; }
  .config-roles-heading h3 { font-size: 13px; }
  .role-counter { min-height: 54px; }
  .role-counter label { font-size: 13px; }
  .counter button { min-width: 40px; height: 40px; }
  .counter input { width: 42px; }
  .player-counter input { width: 0; }
  .create-actions { justify-content: stretch; gap: 10px; margin-top: 18px; padding-top: 18px; }
  .create-actions>.btn { flex: 1; min-width: 0; }
  .recent { margin-top: 20px; }
  .recent-room { font-size: 11px; gap: 8px; }
  .room-page { padding: 20px 14px; }
  .room-heading { gap: 10px; margin-bottom: 18px; }
  .room-heading h1 { font-size: 20px; gap: 8px; }
  .room-heading p { font-size: 11px; }
  .room-type { font-size: 9px; padding: 2px 5px; }
  .room-heading>.btn { font-size: 12px; padding: 10px 12px; white-space: nowrap; }
  .room-layout { display: flex; flex-direction: column; gap: 16px; }
  .room-sidebar { width: 100%; order: 0; gap: 12px; }
  .players-panel { width: 100%; order: 1; }
  .players-panel,.action-panel { padding: 18px; }
  .seating { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .seat { min-height: 88px; padding: 9px; }
  .seat>b { font-size: 12px; }
  .seat>small { font-size: 10px; }
  .target-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .target span { font-size: 10px; }
  .room-config-strip { padding: 18px; margin-top: 16px; }
  .room-footer { gap: 20px; }
  .judge-panel { padding: 18px; }
  .judge-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .judge-grid article { padding: 12px; }
  .judge-panel .panel-title>.btn { font-size: 12px; padding: 9px 12px; }
  dialog { padding: 20px; max-height: 90dvh; }
  .modal-head h2 { font-size: 18px; }
  .review-roles { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .share-link code { font-size: 11px; }
  .reveal-card h2 { font-size: 27px; }
}
@media (max-width: 350px) {
  .topbar { padding: 0 14px; }
  .topbar nav { gap: 12px; }
  .home-shell { padding: 14px 10px 25px; }
  .entry-card { padding: 0 14px 16px; }
  .config-basics { gap: 14px 10px; }
  .counter button { min-width: 34px; }
  .player-counter input { font-size: 14px; }
  .player-counter button { width: 30px; min-width: 30px; }
  .room-page { padding: 18px 10px; }
  .players-panel,.action-panel { padding: 15px; }
  .room-heading h1 { font-size: 18px; }
  .room-heading .room-type { display: none; }
  .seat { padding: 8px; }
  .seat>small { font-size: 9px; }
  .seat-no { font-size: 10px; gap: 4px; }
  .seat-no em { font-size: 8px; }
  .judge-grid { grid-template-columns: 1fr; }
  .field input,.field select { padding: 9px 7px; }
  .counter input { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *,*:before,*:after { animation: none !important; transition: none !important; }
}
.mode-picker { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin:36px 0 48px; }
.mode-card { position:relative; padding:32px 28px; text-align:left; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); }
.mode-card:hover { border-color:var(--red); background:var(--red-soft); }
.mode-card b { display:block; font-size:23px; margin-bottom:8px; }
.mode-card span { color:var(--muted); font-size:13px; }
.mode-card>.icon { position:absolute; right:26px; top:38px; color:var(--red-hover); }
.entry-tabs .back-mode { font-size:13px; }
.table-column { min-width:0; display:flex; flex-direction:column; gap:18px; }
.dialogue-panel { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:24px; }
.dialogue-list { max-height:520px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.dialogue-message { padding:16px 0; border-bottom:1px solid var(--line); }
.dialogue-message:last-child { border-bottom:0; }
.dialogue-message header { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px 14px; margin-bottom:7px; }
.dialogue-message b { font-size:13px; }
.dialogue-message small { font-size:11px; color:var(--muted); }
.dialogue-message p { font-size:14px; line-height:1.9; white-space:pre-wrap; overflow-wrap:anywhere; }
.wolf-message { border-left:2px solid var(--red); padding-left:12px; background:#da405009; }
.wolf-message header small,.own-message header b { color:var(--red-hover); }
.empty-dialogue { color:var(--muted); text-align:center; padding:28px 0; }
#wolf-form { border-top:1px solid var(--line); margin-top:16px; padding-top:18px; }
#wolf-form textarea { min-height:70px; }
.review-dialogue { margin-top:24px; }
.invalid { color:var(--red-hover); }
.shared-rooms { margin-top:24px; padding:22px; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); }
.shared-room { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 0; border-top:1px solid var(--line); }
.shared-room b { font-size:14px; }
.shared-room p { font-size:13px; color:var(--muted); margin-top:4px; }
.shared-room .btn { flex-shrink:0; font-size:14px; }
.seat { position:relative; }
.seat.dead { border-color:#87343e; background:#24171b; }
.seat.dead>b { max-width:calc(100% - 24px); }
.death-mark { position:absolute; right:7px; top:12px; color:#ff465b; font-size:48px; line-height:1; font-weight:700; pointer-events:none; text-shadow:0 0 12px #ff465b40; }
.seat.newly-out { animation:eliminated .9s ease-out; }
@keyframes eliminated { 0% { background:#9a2437; box-shadow:0 0 0 4px #f2465f90; } 100% { background:#24171b; box-shadow:0 0 0 0 transparent; } }
.voice-panel,.assistant-panel { border:1px solid var(--line); background:var(--panel); border-radius:var(--radius); padding:20px; min-width:0; }
.voice-panel .panel-title { margin-bottom:10px; flex-wrap:wrap; }
.voice-panel .panel-title span { color:var(--red-hover); font-size:12px; }
.voice-controls { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:12px; }
.voice-controls .btn { font-size:14px; }
.voice-panel .invalid { margin-top:12px; }
.assistant-panel>summary { font-size:15px; color:var(--text); }
.assistant-content { padding-top:10px; }
.assistant-messages { max-height:420px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; margin:12px 0 16px; }
.assistant-message { padding:13px 0; border-bottom:1px solid var(--line); }
.assistant-message header { display:flex; flex-wrap:wrap; align-items:center; gap:5px 10px; margin-bottom:6px; }
.assistant-message header b { font-size:14px; }
.assistant-message small { font-size:12px; color:var(--muted); }
.assistant-message header .text-btn { margin-left:auto; padding:0; min-height:28px; }
.assistant-message p { font-size:16px; line-height:1.85; white-space:pre-wrap; overflow-wrap:anywhere; }
.assistant-message.from-user p { color:var(--muted); }
.assistant-message.from-user b { color:var(--red-hover); }
.assistant-actions,.assistant-shortcuts { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
.assistant-actions .btn { font-size:14px; }
#assistant-text { min-height:100px; font-size:16px; }
.assistant-shortcuts { border-top:1px solid var(--line); margin-top:12px; padding-top:8px; }
.danger-text { color:var(--red-hover); }
.site-footer { display:flex; flex-wrap:wrap; justify-content:center; gap:10px 22px; padding:24px 16px; font-size:12px; }
.site-footer a { color:var(--muted); text-decoration:none; }
@media(max-width:700px) {
  .mode-picker { grid-template-columns:1fr; margin:18px 0 30px; gap:14px; }
  .mode-card { padding:26px 22px; }
  .mode-card b { font-size:20px; }
  .mode-card>.icon { top:32px; }
  .table-column { width:100%; order:1; gap:16px; }
  .dialogue-panel { padding:18px; }
  .dialogue-list { max-height:420px; }
  .dialogue-message p { font-size:13px; }
  .shared-rooms,.voice-panel,.assistant-panel { padding:18px; }
}
@media(prefers-reduced-motion:reduce){.seat.newly-out{animation:none;}}

/* 红黑基调与低饱和暗金细节。 */
:root { --gold:#b29864; --gold-bright:#d1b37c; --gold-line:#665136; --gold-soft:#292219; }
body { background:#100d11 url('/assets/lobby/castle.svg') center top / max(100%,1400px) auto no-repeat fixed; min-height:100dvh; }
.topbar { border-bottom-color:#64503666; }
.topbar .brand { text-shadow:0 2px 20px #b4283b24; }
.players-panel,.action-panel,.identity-card,.voice-panel,.assistant-panel,.dialogue-panel,.entry-card,.shared-rooms { border-color:#51402e80; box-shadow:0 9px 26px #0000001f; }
.btn,.nav-btn,.text-btn,.seat,.role-art-card { transition:background .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease; }
.btn.primary { box-shadow:0 3px 16px #9e26351c; }
.gold-outline { border-color:var(--gold-line); color:var(--gold-bright); }
.gold-outline:hover:not(:disabled) { background:var(--gold-soft); border-color:var(--gold); }
.seat.speaking { border-color:var(--gold); box-shadow:inset 0 0 0 1px #b2986433,0 0 14px #b2986410; }
.seat.is-me:not(.dead) { border-color:#986449; }
.config-roles-heading h3,.room-config-strip>h2 { color:var(--gold-bright); }
.home-shell,.role-gallery-page { animation:page-reveal .28s ease both; }
@keyframes page-reveal { from {opacity:0} to {opacity:1} }
.role-art-detail { animation:unfold .2s ease; }
@keyframes unfold { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:translateY(0)} }

/* 大厅：石墙、吊灯和三幅可操作挂画。 */
.castle-hall { max-width:1120px; position:relative; padding-top:0; padding-bottom:60px; }
.chandelier { width:330px; height:196px; margin:0 auto 6px; pointer-events:none; }
.chandelier svg { width:100%; height:100%; filter:drop-shadow(0 3px 12px #8e60232c); }
.gallery-wall.mode-picker { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:52px; margin:18px 14px 52px; }
.mode-card.framed-entry { display:flex; flex-direction:column; position:relative; padding:9px; text-align:center; background:linear-gradient(135deg,#80603c,#33251c 16%,#61472d 42%,#251b15 55%,#8b6a40); border:2px solid #916f49; border-radius:2px; box-shadow:0 18px 30px #0008,0 0 0 2px #1c1512,inset 0 0 0 2px #c8a36333; }
.framed-entry::before { content:''; position:absolute; width:58%; height:45px; left:21%; top:-35px; border-top:1px solid #8c70464d; transform:rotate(-13deg); pointer-events:none; }
.framed-entry::after { content:''; position:absolute; width:58%; height:45px; left:21%; top:-35px; border-top:1px solid #8c70464d; transform:rotate(13deg); pointer-events:none; }
.mode-card.framed-entry:hover { transform:translateY(-5px); border-color:var(--gold-bright); box-shadow:0 23px 36px #0009,0 0 30px #bd8c4320; }
.framed-entry .painting { position:relative; display:block; width:100%; height:255px; overflow:hidden; background:radial-gradient(ellipse at 50% 30%,#584132,#21171c 62%,#0f0c10); border:1px solid #c6a66a55; box-shadow:inset 0 0 38px #0009; }
.framed-entry .painting::after { content:''; position:absolute; inset:0; background:linear-gradient(0deg,#0e0b10ab,transparent 35%),linear-gradient(90deg,#0b080b44,transparent 18%,transparent 82%,#0b080b44); pointer-events:none; }
.framed-entry .painting-solo { background:radial-gradient(ellipse at 50% 20%,#5a2331,#23131d 64%,#0d0a0f); }
.framed-entry .painting-collection { background:radial-gradient(ellipse at 50% 20%,#4b3e48,#241d26 65%,#0d0a0f); }
.framed-entry img { height:110%; width:100%; object-fit:contain; object-position:50% 12%; display:block; filter:saturate(.72) brightness(.85); transition:filter .25s,transform .35s; }
.framed-entry:hover img { filter:saturate(.9) brightness(1); transform:scale(1.025); }
.framed-entry .painting-label { display:block; background:linear-gradient(#1a1416,#120e12); border:1px solid #9a764b55; border-top:0; padding:18px 8px 16px; width:100%; }
.mode-card.framed-entry b { display:block; color:#eadbc2; font-size:21px; font-weight:600; letter-spacing:2px; margin:0 0 5px; }
.mode-card.framed-entry span.painting-label>span { font-size:13px; color:#aaa08f; }
.castle-hall .recent { border-top:1px solid #8f704b33; padding-top:22px; margin:0 14px; }
.castle-hall .recent h2 { color:var(--gold); }
.recent-room:hover { border-color:var(--gold-line); }

/* 角色陈列。 */
.role-gallery-page { max-width:1200px; margin:auto; padding:36px 28px 56px; }
.gallery-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:24px; }
.gallery-heading h1 { color:#eadbc2; font-size:26px; letter-spacing:2px; }
.gallery-heading p { color:var(--muted); font-size:13px; margin-top:6px; }
.gallery-filters { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:28px; }
.gallery-filters button { border:1px solid #68513666; padding:8px 16px; min-height:42px; color:var(--muted); background:#151116bd; border-radius:4px; font-size:14px; }
.gallery-filters button.active { color:var(--gold-bright); border-color:var(--gold-line); background:var(--gold-soft); }
.role-art-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:24px 20px; }
.role-art-card { display:flex; flex-direction:column; align-items:center; padding:10px 8px 14px; border:1px solid #80603f80; border-radius:3px; min-width:0; background:radial-gradient(ellipse at 50% 15%,#4a373b8c,transparent 70%),#161116; box-shadow:0 8px 18px #0004,inset 0 0 0 3px #b2945c0a; }
.role-art-card:hover { border-color:var(--gold); transform:translateY(-3px); box-shadow:0 14px 23px #0005,0 0 15px #b2945c14; }
.role-art-card img { width:100%; height:220px; object-fit:contain; filter:drop-shadow(0 4px 8px #0006); }
.role-art-card b { color:#e8d9c2; font-size:16px; font-weight:500; margin-top:8px; }
.role-art-card small { color:#92877a; font-size:12px; margin-top:3px; }
.no-art { min-height:220px; display:flex; align-items:center; color:var(--muted); font-size:13px; }
.art-credit { margin-top:32px; text-align:center; color:#9a9084; font-size:12px; }
.role-art-detail { display:grid; grid-template-columns:minmax(180px,.8fr) minmax(0,1.2fr); gap:28px; align-items:center; }
.role-art-detail>img { width:100%; max-height:460px; object-fit:contain; background:radial-gradient(ellipse,#5d42402b,transparent 68%); }
.role-art-detail h3 { color:var(--gold-bright); margin:22px 0 9px; font-size:16px; }
.role-art-detail p { font-size:16px; line-height:1.9; }
.role-art-detail .role-camp { font-size:13px; color:var(--gold); }
.role-art-detail .field-help { font-size:13px; color:var(--muted); margin-top:18px; }
.role-source { display:inline-block; margin-top:22px; font-size:12px; color:var(--gold); }
.role-no-picture { min-height:230px; display:grid; place-items:center; font-size:14px; color:var(--muted); }

/* 常驻时间栏和大区域双记录。 */
.game-clockbar { display:flex; align-items:center; justify-content:space-between; gap:18px; position:sticky; top:0; z-index:12; padding:14px 20px; margin:0 0 20px; border:1px solid #8f704b88; border-radius:7px; background:#1c171bed; backdrop-filter:blur(14px); box-shadow:0 8px 20px #0003; }
.game-clockbar>div { display:flex; align-items:baseline; gap:18px; flex-wrap:wrap; }
.game-clockbar b { font-size:16px; color:var(--gold-bright); font-weight:500; }
.game-clockbar span { font-size:14px; color:var(--muted); }
.game-clockbar strong { font-size:23px; font-weight:500; color:#e3c692; font-variant-numeric:tabular-nums; white-space:nowrap; }
.records-heading { display:flex; justify-content:space-between; align-items:center; gap:14px; border-bottom:1px solid #71573755; margin-bottom:5px; }
.record-tabs { display:flex; gap:22px; }
.record-tabs button { padding:0 0 13px; border-bottom:2px solid transparent; color:var(--muted); font-size:16px; white-space:nowrap; }
.record-tabs button.active { border-bottom-color:var(--red); color:#f0e4d1; }
#records-status { color:var(--gold); font-size:12px; text-align:right; padding-bottom:13px; }
.game-record { padding:17px 0; border-bottom:1px solid var(--line); }
.game-record small { color:var(--gold); font-size:12px; }
.game-record p { margin-top:5px; font-size:15px; line-height:1.9; }
.stream-label,.old-incomplete { font-size:11px; color:var(--gold); }
.old-incomplete { color:#9f8b75; }
.stream-cursor { display:inline-block; vertical-align:middle; width:2px; height:1em; margin-left:4px; background:var(--gold); animation:cursor-pulse 1s infinite; }
@keyframes cursor-pulse { 50% {opacity:.15;} }
.wolf-discussion-label { margin-top:20px; display:flex; align-items:center; justify-content:space-between; gap:14px; color:#e7a5ad; }
.wolf-discussion-label b { font-size:14px; }
.wolf-discussion-label span { font-size:12px; color:var(--muted); }
.wolf-locked { margin-top:15px; color:var(--gold); }

/* 本人消息气泡，助手回复使用完整宽度的自然段。 */
.assistant-message { border:0; margin:0 0 22px; padding:0; }
.assistant-message.from-user { width:88%; margin-left:auto; }
.assistant-message.from-user header { justify-content:flex-end; }
.assistant-message.from-user p { padding:12px 14px; background:linear-gradient(130deg,#44232e,#302025); border:1px solid #86475266; border-radius:12px 12px 3px 12px; color:#f0e5e9; }
.assistant-message.from-assistant { width:100%; padding-bottom:16px; border-bottom:1px solid #6c55302b; }
.assistant-message.from-assistant header b { color:var(--gold-bright); }
.assistant-message-text { overflow-wrap:anywhere; white-space:pre-wrap; }
.thinking-dots { color:var(--muted); font-size:14px; }
.thinking-dots:after { content:'…'; animation:cursor-pulse 1.1s infinite; }
.message-error { font-size:12px; color:#e08f97; line-height:1.7; margin-top:10px; }
.message-error .text-btn { color:var(--gold-bright); display:block; }
.assistant-messages { max-height:520px; }

@media(max-width:950px) {
  .gallery-wall.mode-picker { gap:28px; margin-left:0; margin-right:0; }
  .framed-entry .painting { height:220px; }
  .role-art-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px 14px; }
  .role-art-card img { height:200px; }
}
@media(max-width:700px) {
  .castle-hall { padding:0 20px 36px; }
  .chandelier { width:245px; height:150px; margin-top:-4px; margin-bottom:6px; }
  .gallery-wall.mode-picker { grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; margin:14px 0 34px; }
  .mode-card.framed-entry { padding:5px; border-width:1px; }
  .framed-entry .painting { height:155px; }
  .framed-entry::before,.framed-entry::after { top:-22px; height:25px; }
  .framed-entry .painting-label { padding:12px 2px 11px; }
  .mode-card.framed-entry b { font-size:15px; letter-spacing:1px; margin:0; }
  .mode-card.framed-entry span.painting-label>span { display:none; }
  .castle-hall .recent { margin:0; padding-top:20px; }
  .role-gallery-page { padding:24px 16px 36px; }
  .gallery-heading { gap:14px; margin-bottom:20px; }
  .gallery-heading h1 { font-size:22px; }
  .gallery-heading p { font-size:12px; }
  .gallery-heading .btn { padding:9px 11px; font-size:13px; }
  .gallery-filters { gap:7px; margin-bottom:20px; }
  .gallery-filters button { padding:7px 11px; font-size:13px; }
  .role-art-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px 10px; }
  .role-art-card { padding:6px 3px 11px; }
  .role-art-card img,.no-art { height:155px; min-height:155px; }
  .role-art-card b { font-size:14px; }
  .role-art-card small { font-size:10px; }
  .role-art-detail { grid-template-columns:1fr; gap:0; }
  .role-art-detail>img { max-height:280px; }
  .role-art-detail h3 { margin-top:18px; }
  .game-clockbar { padding:12px 14px; margin-bottom:16px; }
  .game-clockbar>div { display:block; }
  .game-clockbar b { display:block; font-size:15px; }
  .game-clockbar span { font-size:12px; display:block; margin-top:3px; }
  .game-clockbar strong { font-size:19px; }
  .record-tabs { gap:18px; }
  .record-tabs button { font-size:14px; padding-bottom:12px; }
  #records-status { font-size:11px; }
  .game-record p { font-size:14px; }
}
@media(max-width:370px) {
  .castle-hall { padding-left:14px; padding-right:14px; }
  .gallery-wall.mode-picker { gap:10px; }
  .framed-entry .painting { height:135px; }
  .mode-card.framed-entry b { font-size:14px; letter-spacing:0; }
  .role-art-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
/* 细金线、角花与透出古堡的深色面板。 */
:is(.entry-card,.players-panel,.action-panel,.room-config-strip,.dialogue-panel,.voice-panel,.assistant-panel,.identity-card,.judge-panel,.shared-rooms) {
  position:relative;
  border-color:#9b794866;
  background:linear-gradient(135deg,#b68d3d05,transparent 38%),#19181deb;
  box-shadow:inset 0 0 0 4px #b28b4206,0 10px 30px #0003;
}
:is(.entry-card,.players-panel,.action-panel,.room-config-strip,.dialogue-panel,.voice-panel,.assistant-panel,.identity-card,.judge-panel,.shared-rooms)::before,
:is(.entry-card,.players-panel,.action-panel,.room-config-strip,.dialogue-panel,.voice-panel,.assistant-panel,.identity-card,.judge-panel,.shared-rooms)::after {
  content:''; position:absolute; width:18px; height:18px; pointer-events:none; opacity:.5;
}
:is(.entry-card,.players-panel,.action-panel,.room-config-strip,.dialogue-panel,.voice-panel,.assistant-panel,.identity-card,.judge-panel,.shared-rooms)::before {
  top:6px; left:6px; border-top:1px solid #c2a469; border-left:1px solid #c2a469;
  background:linear-gradient(135deg,transparent 7px,#b2986438 7px,#b2986438 8px,transparent 8px);
}
:is(.entry-card,.players-panel,.action-panel,.room-config-strip,.dialogue-panel,.voice-panel,.assistant-panel,.identity-card,.judge-panel,.shared-rooms)::after {
  bottom:6px; right:6px; border-bottom:1px solid #c2a469; border-right:1px solid #c2a469;
  background:linear-gradient(135deg,transparent 17px,#b2986438 17px,#b2986438 18px,transparent 18px);
}
.entry-tabs,.config-basics,.create-actions,.role-counter { border-color:#a17f4630; }
.field { font-size:14px; }
.field input,.field select,.field textarea { font-size:16px; }
.dialogue-message p { font-size:16px; line-height:1.95; }
.dialogue-message b,.assistant-message header b { font-size:16px; }
.panel-description,.waiting-state { font-size:14px; }
.rules-list p,.role-explainer p,.modal-description,.role-description { font-size:16px; }
.rules-list h3,.role-explainer h3 { font-size:16px; }
.field-help { font-size:13px; }
.text-btn,.nav-btn { font-size:14px; }
.room-heading { align-items:flex-start; }
.room-facts { display:flex; flex-wrap:wrap; gap:10px 22px; margin:12px 0 0; }
.room-facts>div { display:flex; align-items:baseline; gap:9px; }
.room-facts dt { font-size:13px; color:#a99d8b; }
.room-facts dd { font-size:16px; color:#dfd0b8; margin:0; }
.rule-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px 18px; margin:0; }
.rule-facts>div { border-left:1px solid #a88a4c50; padding-left:10px; }
.rule-facts dt { font-size:13px; color:#a99d8b; }
.rule-facts dd { margin:2px 0 0; font-size:16px; color:#e4d6bd; }
.current-rules .rule-facts { margin:18px 0; }
.rule-times,.room-list-facts { display:flex; flex-wrap:wrap; gap:6px 16px; margin-top:10px; color:var(--muted); font-size:14px; }
.lobby-rules { padding-bottom:22px; margin-bottom:22px; }
.lobby-seat { min-height:126px; overflow:hidden; isolation:isolate; }
.lobby-seat.seat-ready { background:linear-gradient(125deg,#4a3c244d,#201d1c 73%); border-color:#9c7d405c; }
.lobby-seat.seat-unready { background:linear-gradient(125deg,#6529363b,#261b21 73%); border-color:#9949575c; }
.lobby-seat.seat-ready:hover { background:linear-gradient(125deg,#5a472854,#29241d 73%); }
.lobby-seat.seat-unready:hover { background:linear-gradient(125deg,#752f4054,#302027 73%); }
.seat .seat-no { font-size:15px; }
.seat>b { font-size:19px; line-height:1.5; }
.seat-no em { font-size:11px; }
.seat-status { display:flex; flex-wrap:wrap; gap:4px 10px; }
.seat>small { font-size:12px; }
.lobby-seat .seat-no,.lobby-seat>b { position:relative; z-index:1; }
.ready-watermark { position:absolute; right:8px; bottom:0; font-size:37px; font-weight:600; letter-spacing:1px; line-height:1.25; white-space:nowrap; pointer-events:none; user-select:none; z-index:0; color:transparent; background:linear-gradient(100deg,#c6a45d29,#edd39b55 58%,#b68d3d10); background-clip:text; -webkit-background-clip:text; }
.seat-unready .ready-watermark { background-image:linear-gradient(100deg,#c9667626,#ec8e9a4d 58%,#a34e6210); }
.stage-notice { animation:stage-light 1.1s ease-out; }
@keyframes stage-light { 0%,25% {color:#ffe0a0;text-shadow:0 0 14px #e8bc6a80;} 100% {color:var(--muted);text-shadow:0 0 0 transparent;} }
.record-meta { display:inline-flex; flex-wrap:wrap; gap:4px 10px; }
.room-page { overflow-anchor:none; }
.table-column>.players-panel { order:0; }
.table-column>.dialogue-panel { order:1; }
.record-tabs button { min-height:44px; }
dialog { --modal-padding:28px; }
.modal-head { position:sticky; top:calc(-1 * var(--modal-padding)); z-index:2; background:var(--panel); padding-bottom:8px; }
.room-page :is(button,input,select,textarea,summary) { scroll-margin-block:100px 24px; }
.target span { font-size:12px; }
.assistant-panel>summary { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.assistant-panel>summary::before { content:'▸'; color:var(--gold); font-size:12px; }
.assistant-panel[open]>summary::before { content:'▾'; }
.assistant-panel>summary::marker { content:''; }
.assistant-panel>summary::-webkit-details-marker { display:none; }
.assistant-state { margin-left:auto; font-size:12px; font-weight:400; color:var(--gold); }

/* 开场只在本标签页首次进入时出现，点击任意位置或按回车进入。 */
.opening-screen { min-height:100dvh; overflow:hidden; background:radial-gradient(ellipse at 50% 50%,#491e2714,transparent 60%),linear-gradient(#0c090c6b,#100a1099); }
.opening-enter { width:100%; min-height:100dvh; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:70px 24px 100px; isolation:isolate; -webkit-tap-highlight-color:transparent; }
.opening-enter:focus-visible { outline:1px solid #b2986440; outline-offset:-14px; }
.opening-halo { position:absolute; width:min(80vw,700px); aspect-ratio:1; background:radial-gradient(ellipse,#b48a3e12,transparent 66%); z-index:-1; border-radius:50%; animation:halo-breathe 7s ease-in-out infinite alternate; }
.opening-emblem { width:65px; height:65px; margin-bottom:34px; color:#c6a164; animation:opening-ink 1.3s ease both; }
.opening-emblem svg { width:100%; height:100%; stroke:currentColor; stroke-width:.7; }
.opening-welcome { color:#c2b191; font-size:23px; letter-spacing:.35em; padding-left:.35em; animation:opening-ink 1.4s .25s ease both; }
.opening-title { display:flex; gap:.22em; padding-left:.22em; margin:12px 0 25px; font-size:clamp(70px,9vw,116px); line-height:1.45; font-weight:600; color:#e5d1ab; text-shadow:0 2px 35px #a1443828; }
.opening-title>span { display:block; animation:opening-ink 1.6s .85s ease both; }
.opening-title>span:first-child { color:#c9686c; }
.opening-title>span:nth-child(2) { animation-delay:1.1s; }
.opening-title>span:nth-child(3) { animation-delay:1.35s; }
.opening-rule { width:190px; height:1px; background:linear-gradient(90deg,transparent,#b89b5d99,transparent); position:relative; animation:opening-ink 1.3s 1.8s ease both; }
.opening-rule::after { content:''; width:5px; height:5px; position:absolute; left:calc(50% - 3px); top:-2px; background:#bfa063; transform:rotate(45deg); }
.opening-prompt { font-size:14px; color:#ac9b83; letter-spacing:.2em; padding-left:.2em; margin-top:42px; animation:opening-ink 1.4s 2.1s ease both; }
.opening-embers { position:absolute; inset:0; z-index:-1; pointer-events:none; overflow:hidden; }
.opening-embers i { position:absolute; width:2px; height:2px; border-radius:50%; background:#d5a35d; box-shadow:0 0 7px #be8349; left:calc(19% + var(--i)*12%); top:calc(80% - var(--i)*9%); animation:ember-rise calc(6s + var(--i)*.7s) calc(var(--i)*-.9s) ease-in-out infinite; }
.opening-leave { animation:opening-out .42s ease forwards; pointer-events:none; }
@keyframes opening-ink { from {opacity:0;filter:blur(4px);} to {opacity:1;filter:blur(0);} }
@keyframes opening-out { to {opacity:0;filter:blur(3px);} }
@keyframes halo-breathe { to {opacity:.45;} }
@keyframes ember-rise { 0%,100% {opacity:0;transform:translateY(12px);} 45% {opacity:.4;} 90% {opacity:0;transform:translateY(-50px);} }
@media(max-width:700px) {
  dialog { --modal-padding:20px; }
  .topbar .nav-btn { min-width:44px; min-height:44px; padding-inline:6px; }
  .entry-tabs .back-mode { min-width:44px; }
  .counter button { min-height:44px; }
  .player-counter button { min-width:36px; width:36px; }
  .icon-btn { min-width:44px; min-height:44px; }
  .game-clockbar { top:env(safe-area-inset-top,0px); }
  body { padding-left:env(safe-area-inset-left,0px); padding-right:env(safe-area-inset-right,0px); padding-bottom:env(safe-area-inset-bottom,0px); }
  .room-facts { gap:8px 15px; margin-top:10px; }
  .room-facts>div { gap:6px; }
  .room-facts dd { font-size:15px; }
  .room-facts dt { font-size:12px; }
  .field { font-size:14px; }
  .field input,.field select { font-size:16px; }
  .lobby-seat { min-height:115px; }
  .seat .seat-no { font-size:14px; }
  .seat>b { font-size:17px; }
  .ready-watermark { font-size:30px; right:4px; bottom:3px; letter-spacing:0; }
  .panel-title>span { font-size:12px; }
  .config-roles-heading h3 { font-size:16px; }
  .role-counter label { font-size:15px; }
  .opening-emblem { width:52px; height:52px; margin-bottom:26px; }
  .opening-welcome { font-size:19px; }
  .opening-title { font-size:76px; gap:.16em; padding-left:.16em; }
  .opening-prompt { font-size:13px; }
}
@media(max-width:370px) {
  .ready-watermark { font-size:25px; right:2px; }
  .lobby-seat { min-height:110px; }
  .seat>b { font-size:16px; }
  .seat .seat-no { font-size:13px; }
  .opening-title { font-size:66px; }
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;}}
