:root {
  --bg: #050817;
  --panel: rgba(15, 23, 47, 0.82);
  --line: rgba(120, 165, 255, 0.16);
  --cyan: #5ce1ff;
  --gold: #ffd75e;
  --red: #ff5566;
  --text: #e7efff;
  --muted: #8ea0c8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(48, 90, 190, 0.28), transparent 65%),
    radial-gradient(760px 520px at 88% 110%, rgba(120, 48, 150, 0.22), transparent 65%),
    var(--bg);
  overflow-x: hidden;
}

.stars {
  position: fixed; inset: 0; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 8% 18%, #fff 99%, transparent),
    radial-gradient(1px 1px at 24% 72%, #cfe6ff 99%, transparent),
    radial-gradient(1px 1px at 41% 12%, #fff 99%, transparent),
    radial-gradient(1px 1px at 62% 34%, #fff 99%, transparent),
    radial-gradient(1px 1px at 78% 82%, #bcd6ff 99%, transparent),
    radial-gradient(1px 1px at 91% 24%, #fff 99%, transparent),
    radial-gradient(2px 2px at 55% 88%, rgba(120, 200, 255, .8) 99%, transparent);
  background-size: 100% 100%;
}

.hidden { display: none !important; }

.app { max-width: 1440px; margin: 0 auto; padding: 16px 18px 30px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: 1.5px; text-shadow: 0 0 22px rgba(92, 225, 255, .35); }
.brand-icon { color: var(--cyan); margin-right: 6px; }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 1px; }
.status { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  background: rgba(24, 36, 70, .85); border: 1px solid var(--line); color: #cfe0ff;
}
.chip.alert { color: #ffb4bd; border-color: rgba(255, 85, 102, .45); background: rgba(120, 24, 42, .35); animation: blink 1s infinite alternate; }
.chip.ready { color: #8affc0; border-color: rgba(90, 255, 170, .4); }
@keyframes blink { from { opacity: .65; } to { opacity: 1; } }

.progress-wrap { margin-bottom: 12px; }
.progress-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.progress-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #37b6ff, #63f5c8);
  box-shadow: 0 0 16px rgba(70, 230, 210, .6); transition: width .35s ease;
}

.layout { display: grid; grid-template-columns: 220px minmax(0, 960px) 220px; gap: 14px; align-items: start; justify-content: center; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; backdrop-filter: blur(8px); min-height: 300px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
}
.panel-title { font-size: 12px; letter-spacing: 2px; color: var(--cyan); text-transform: uppercase; margin-bottom: 10px; font-weight: 700; }
.panel-title.mt { margin-top: 20px; }
.panel-empty, .log-empty { font-size: 12px; color: var(--muted); line-height: 1.7; }

.task-note { font-size: 11px; color: var(--muted); margin-bottom: 10px; line-height: 1.6; }
.mate-note { font-size: 11px; color: #ff9aa6; margin-bottom: 6px; line-height: 1.6; letter-spacing: .5px; }
.task-item {
  display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 8px 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, .07); color: #d8e5ff;
}
.task-item.done { color: #6f809f; text-decoration: line-through; }
.task-box {
  width: 15px; height: 15px; flex: 0 0 15px; border: 1px solid rgba(120, 200, 255, .55);
  border-radius: 4px; text-align: center; line-height: 13px; font-size: 11px; color: #63f5c8;
}
.task-room { margin-left: auto; font-size: 10px; color: var(--muted); white-space: nowrap; }
.ghost-note { font-size: 12px; color: #ffb9c3; line-height: 1.7; padding: 10px; margin-bottom: 10px; border-radius: 8px; background: rgba(255, 85, 102, .1); border: 1px solid rgba(255, 85, 102, .25); }

.help { font-size: 11px; color: #b8c8e8; line-height: 2; }
.help b { color: var(--gold); font-weight: 700; }
.help-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.7; }

#minimap { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--line); background: #0a1024; }
.log-line { font-size: 11px; color: #c3d3f0; line-height: 1.6; padding: 5px 0; border-bottom: 1px dashed rgba(255, 255, 255, .06); word-break: break-all; }
.log-t { color: #62769f; margin-right: 6px; font-variant-numeric: tabular-nums; }

.stage { min-width: 0; }
.canvas-wrap {
  position: relative; max-width: 960px; margin: 0 auto; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(120, 180, 255, .24);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(90, 180, 255, .06) inset;
  background: #070b18;
}
#game-canvas { display: block; width: 100%; height: auto; }

.role-banner {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 12;
  text-align: center; padding: 12px 26px; border-radius: 12px;
  background: rgba(8, 16, 36, .92); border: 1px solid rgba(92, 225, 255, .5);
  box-shadow: 0 0 30px rgba(60, 190, 255, .28); pointer-events: none; min-width: 340px;
}
.role-banner.imp { border-color: rgba(255, 85, 102, .6); box-shadow: 0 0 30px rgba(255, 70, 90, .3); }
.role-banner.neutral { border-color: rgba(197, 165, 255, .65); box-shadow: 0 0 30px rgba(160, 120, 255, .3); }
.role-title { font-size: 19px; font-weight: 800; color: var(--cyan); letter-spacing: 2px; }
.role-banner.imp .role-title { color: #ff7080; }
.role-banner.neutral .role-title { color: #c9a6ff; }
.role-sub { font-size: 11px; color: #b9cae8; margin-top: 5px; }

.toast {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 14;
  padding: 9px 18px; border-radius: 999px; font-size: 12px; white-space: nowrap;
  background: rgba(9, 17, 38, .94); border: 1px solid rgba(92, 225, 255, .45);
  color: #dff3ff; box-shadow: 0 8px 26px rgba(0, 0, 0, .5); pointer-events: none;
}

.sabotage-menu {
  position: absolute; right: 14px; bottom: 14px; z-index: 14; width: 210px;
  background: rgba(12, 18, 38, .96); border: 1px solid rgba(255, 85, 102, .45);
  border-radius: 12px; padding: 10px; box-shadow: 0 12px 36px rgba(0, 0, 0, .6);
}
.sab-title { font-size: 11px; color: #ff98a5; letter-spacing: 2px; margin-bottom: 8px; }
.sabotage-menu button {
  width: 100%; text-align: left; display: block; margin-bottom: 7px; padding: 8px 10px;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05);
  color: var(--text); font-size: 12px; cursor: pointer;
}
.sabotage-menu button:hover { border-color: var(--red); background: rgba(255, 85, 102, .14); }
.sabotage-menu small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }

.vent-menu {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 16;
  width: 260px; max-width: calc(100% - 24px); max-height: calc(100% - 24px);
  display: flex; flex-direction: column;
  padding: 14px; border-radius: 14px;
  background: rgba(10, 18, 36, .96); border: 1px solid rgba(90, 255, 160, .45);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .65), 0 0 30px rgba(60, 255, 150, .1) inset;
}
.vent-title { flex: 0 0 auto; font-size: 12px; color: #7dffb2; letter-spacing: 2px; margin-bottom: 10px; text-align: center; }
#vent-options { overflow-y: auto; min-height: 0; padding-right: 2px; }
#vent-options::-webkit-scrollbar { width: 6px; }
#vent-options::-webkit-scrollbar-thumb { background: rgba(125, 255, 178, .35); border-radius: 3px; }
.vent-option {
  width: 100%; text-align: left; display: block; margin-bottom: 5px; padding: 6px 9px;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05);
  color: var(--text); font-size: 12px; cursor: pointer;
}
.vent-option b {
  display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 50%; background: rgba(90, 255, 160, .18); color: #7dffb2; margin-right: 6px;
}
.vent-option:hover { border-color: #5cff9d; background: rgba(90, 255, 160, .14); }
.vent-option small { display: block; color: var(--muted); font-size: 10px; margin: 3px 0 0 26px; }
.vent-note { flex: 0 0 auto; font-size: 10px; color: var(--muted); text-align: center; margin-top: 8px; }

/* 导航菜单：两列紧凑排布，避免超出画面 */
.nav-menu { width: 380px; max-width: calc(100% - 24px); }
.nav-menu .vent-title { margin-bottom: 8px; }
#nav-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#nav-options .vent-option { display: flex; align-items: center; margin-bottom: 0; padding: 7px 9px; font-size: 12px; white-space: nowrap; }
#nav-options .vent-option b { width: 18px; height: 18px; line-height: 18px; margin-right: 6px; flex: 0 0 18px; }

.overlay {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(4, 8, 22, .89); backdrop-filter: blur(7px); overflow: auto;
}

.lobby-card, .result-card, .meeting-card {
  width: 100%; max-width: 540px; border-radius: 18px; padding: 22px 26px;
  background: linear-gradient(160deg, rgba(24, 36, 72, .96), rgba(10, 16, 36, .97));
  border: 1px solid rgba(120, 180, 255, .3);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 60px rgba(60, 140, 255, .12) inset;
}
.lobby-card h1 { margin: 0; font-size: 30px; letter-spacing: 5px; text-align: center; color: #eaf5ff; text-shadow: 0 0 26px rgba(92, 225, 255, .55); }
.tagline { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0 18px; letter-spacing: 1px; }
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; font-size: 12px; }
.form-row label { width: 108px; flex: 0 0 108px; color: #b6c8ea; }
.form-row input[type=range] { flex: 1; accent-color: var(--cyan); }
.form-row select {
  flex: 1; background: rgba(8, 14, 32, .9); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; outline: none;
}
.form-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--cyan); }
.form-row .range-note { color: var(--muted); font-size: 11px; }
.summary { font-size: 12px; color: #cfdfff; line-height: 1.8; padding: 10px 12px; border-radius: 10px; background: rgba(92, 225, 255, .07); border: 1px solid rgba(92, 225, 255, .18); margin: 12px 0 16px; }
.summary b { color: var(--gold); }

/* ---------- 顶栏密码入口 / 指定身份弹窗 ---------- */
.topbar-actions { display: flex; align-items: center; }
.top-btn {
  padding: 6px 14px; border-radius: 999px; font-size: 12px; cursor: pointer;
  color: #cfe0ff; background: rgba(24, 36, 70, .85); border: 1px solid var(--line);
}
.top-btn:hover { border-color: var(--cyan); color: #fff; background: rgba(92, 225, 255, .12); }
.forced-note { font-size: 12px; color: var(--gold); text-align: center; margin: -6px 0 12px; }
.link-btn { background: none; border: none; color: var(--cyan); cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0 4px; }
.pwd-card {
  width: 100%; max-width: 460px; border-radius: 18px; padding: 22px 26px;
  background: linear-gradient(160deg, rgba(24, 36, 72, .98), rgba(10, 16, 36, .98));
  border: 1px solid rgba(120, 180, 255, .3); box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.pwd-card h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: 2px; text-align: center; color: #eaf5ff; }
.pwd-card input[type=password] {
  width: 100%; background: rgba(8, 14, 32, .9); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; outline: none;
}
.pwd-card input[type=password]:focus { border-color: var(--cyan); }
.pwd-error { min-height: 18px; margin: 8px 0; font-size: 12px; color: #ff8b98; text-align: center; }
.pwd-actions { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.pwd-actions .small {
  padding: 9px 18px; border-radius: 8px; font-size: 12px; cursor: pointer;
  color: #dce8ff; background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
}
.pwd-actions .small:hover { border-color: var(--cyan); }
.pwd-actions .primary.small { margin: 0; }
.pwd-tip { font-size: 11px; color: var(--muted); text-align: center; margin: 0 0 12px; }
.pwd-group { margin-bottom: 12px; }
.pwd-group-title { font-size: 12px; color: var(--gold); margin-bottom: 6px; }
.pwd-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pwd-type {
  padding: 8px 6px; border-radius: 8px; font-size: 12px; cursor: pointer;
  color: #dce8ff; background: rgba(255, 255, 255, .055); border: 1px solid var(--line);
}
.pwd-type:hover { border-color: var(--cyan); background: rgba(92, 225, 255, .12); }
.pwd-type.sel { border-color: var(--gold); color: var(--gold); }

.primary {
  display: block; width: 100%; padding: 12px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 800; letter-spacing: 3px; color: #04121f;
  background: linear-gradient(90deg, #57d6ff, #6ff5c4);
  box-shadow: 0 8px 26px rgba(70, 220, 230, .3); transition: transform .15s, filter .15s;
}
.primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.primary.small { width: auto; margin: 14px 0 0 auto; padding: 9px 22px; font-size: 12px; letter-spacing: 1px; }

.meeting-card { max-width: 720px; }
.meeting-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.meeting-head h2 { margin: 0; font-size: 23px; letter-spacing: 2px; color: #ff8592; }
.meeting-head p { margin: 5px 0 0; font-size: 12px; color: #b9c8e6; line-height: 1.6; }
.meeting-timer { flex: 0 0 auto; font-size: 13px; color: var(--gold); padding: 6px 12px; border-radius: 8px; background: rgba(255, 215, 94, .1); border: 1px solid rgba(255, 215, 94, .3); }
.section-title { font-size: 11px; color: var(--cyan); letter-spacing: 2px; margin-bottom: 8px; }

.meeting-roster { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.roster-label { font-size: 10px; color: var(--muted); letter-spacing: 2px; margin-right: 2px; }
.roster-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 4px 8px; border-radius: 7px; background: rgba(255, 255, 255, .05); color: #dce8ff; }
.roster-chip .vote-dot { width: 9px; height: 9px; flex-basis: 9px; margin-top: 0; }
.roster-chip.dead { color: #8d96ab; background: rgba(120, 130, 155, .08); text-decoration: line-through; }
.roster-chip.dead .vote-dot { background: #5c6478 !important; box-shadow: none; }

.statements { max-height: 190px; min-height: 120px; overflow-y: auto; padding: 10px 12px; border-radius: 10px; background: rgba(4, 9, 24, .6); border: 1px solid var(--line); }
.chat-line { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.8; padding: 4px 0; }
.chat-avatar, .vote-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; margin-top: 3px; box-shadow: 0 0 8px currentColor; }
.chat-name { font-weight: 700; white-space: nowrap; }
.chat-text { color: #d8e5fb; }
.speech-box { margin-top: 12px; }
.speech-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.speech-btn, .vote-card {
  padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 12px; text-align: left;
  color: #dce8ff; background: rgba(255, 255, 255, .055); border: 1px solid var(--line);
  transition: border-color .15s, background .15s, transform .15s;
}
.speech-btn:hover, .vote-card:hover:not(:disabled) { border-color: var(--cyan); background: rgba(92, 225, 255, .12); transform: translateY(-1px); }
.speech-empty, .vote-wait { font-size: 12px; color: var(--muted); padding: 10px; }

.vote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.vote-card { display: flex; align-items: center; gap: 8px; text-align: left; }
.vote-card.self { opacity: .5; cursor: not-allowed; }
.vote-card.skip { justify-content: center; color: var(--gold); }
.vote-card.bank { justify-content: center; color: #ffb84d; border-color: rgba(255, 184, 77, .45); background: rgba(255, 184, 77, .08); }
.skip-dot { background: #6b7b9c; box-shadow: none; }
.vote-result { margin-top: 14px; text-align: center; }
.result-big { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: #ffd0d6; }
.result-detail { font-size: 12px; color: var(--muted); margin-top: 6px; }
.vote-tally { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 14px; text-align: left; }
.vote-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.vote-row b { margin-left: auto; color: var(--gold); }

.result-card { max-width: 470px; text-align: center; }
.result-emblem { font-size: 34px; color: var(--cyan); text-shadow: 0 0 26px rgba(92, 225, 255, .7); }
#result.imp-win .result-emblem { color: var(--red); text-shadow: 0 0 26px rgba(255, 85, 102, .7); }
.result-card h2 { margin: 4px 0 6px; font-size: 28px; letter-spacing: 4px; }
#result.imp-win h2 { color: #ff8492; }
#result-reason { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
#result-roles { max-height: 220px; overflow-y: auto; text-align: left; margin-bottom: 16px; }
.role-row { display: flex; align-items: center; gap: 9px; font-size: 12px; padding: 6px 9px; border-radius: 8px; background: rgba(255, 255, 255, .04); margin-bottom: 5px; }
/* 监控面板：作为画布右上角的小浮窗，不铺满全屏、不遮挡游戏画面 */
#security {
  inset: auto;
  top: 12px;
  right: 12px;
  bottom: auto;
  left: auto;
  display: block;
  padding: 0;
  background: none;
  backdrop-filter: none;
  overflow: visible;
  pointer-events: none;
}
#security .security-card { pointer-events: auto; }
.security-card {
  width: 320px;
  max-width: calc(100% - 24px);
  padding: 12px 14px;
  text-align: center;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(20, 34, 64, .96), rgba(9, 15, 32, .97));
  border: 1px solid rgba(120, 180, 255, .3);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 30px rgba(60, 140, 255, .1) inset;
}
.security-card h2 { margin: 0 0 6px; font-size: 22px; color: var(--cyan); letter-spacing: 3px; }
.security-card p { margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 70vh; overflow-y: auto; }
.security-room { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-size: 12px; color: #dce8ff; }
.security-room b { margin-left: auto; color: var(--gold); font-size: 14px; }
.security-room.empty { opacity: .55; }

.role-row.is-imp { background: rgba(255, 85, 102, .12); }
.role-row.is-neutral { background: rgba(180, 140, 255, .12); }
.role-row.is-neutral .role-id { color: #c9a6ff; }
.role-row.is-me { outline: 1px solid rgba(255, 215, 94, .5); }
.role-nm { width: 70px; }
.role-id { color: var(--muted); }
.role-state { margin-left: auto; color: var(--muted); }

.hint-bar {
  display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 9px 14px;
  border-radius: 10px; font-size: 12px; color: #cfe0ff;
  background: var(--panel); border: 1px solid var(--line);
}
.hint-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); flex: 0 0 7px; }
.action-bar { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.imp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.key-btn {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px; cursor: pointer;
  background: rgba(24, 36, 70, .85); border: 1px solid var(--line); color: #cfe0ff; font-size: 11px;
}
.key-btn b { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; background: rgba(92, 225, 255, .16); color: var(--cyan); font-size: 12px; }
.key-btn:hover { border-color: var(--cyan); }
.key-btn.danger b { background: rgba(255, 85, 102, .16); color: #ff8592; }
.key-btn.danger:hover { border-color: var(--red); }
.key-btn.stun b { background: rgba(255, 214, 94, .18); color: #ffd55e; }
.key-btn.stun:hover { border-color: #ffd55e; }
.key-btn.cd { opacity: .55; cursor: default; }
.key-btn.cd:hover { border-color: var(--line); }
.key-btn.cd b { background: rgba(255, 85, 102, .3); color: #ffb4bd; }

@media (max-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 960px); }
  .panel { min-height: 0; }
  .stage { grid-row: 1; }
  .layout > .panel:first-child { grid-row: 2; }
  .layout > .panel:last-child { grid-row: 3; }
  .help { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  #minimap { max-width: 320px; }
}
@media (max-width: 620px) {
  .app { padding: 10px; }
  .brand { font-size: 16px; }
  .speech-options, .vote-tally { grid-template-columns: 1fr; }
  .vote-grid { grid-template-columns: repeat(2, 1fr); }
  .lobby-card, .meeting-card, .result-card { padding: 16px; }
  .form-row label { width: 88px; flex-basis: 88px; }
}

/* ---------- 教程面板 ---------- */
.tutorial-card {
  width: 100%; max-width: 560px; max-height: 96%;
  display: flex; flex-direction: column;
  border-radius: 18px; padding: 16px 18px;
  background: linear-gradient(160deg, rgba(24, 36, 72, .97), rgba(10, 16, 36, .98));
  border: 1px solid rgba(120, 180, 255, .3);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 60px rgba(60, 140, 255, .12) inset;
}
.tut-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tut-head h2 { margin: 0; font-size: 19px; letter-spacing: 3px; color: #eaf5ff; }
.tut-actions { display: flex; align-items: center; gap: 10px; }
.tut-key-hint { font-size: 11px; color: var(--muted); }
.tut-close {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .06);
  color: #cfe0ff; font-size: 14px; line-height: 1;
}
.tut-close:hover { border-color: var(--red); color: #ff8592; }
.tut-body { overflow-y: auto; padding-right: 6px; font-size: 12px; line-height: 1.8; color: #c9d8f2; }
.tut-body h3 { font-size: 13px; color: var(--cyan); letter-spacing: 1px; margin: 14px 0 6px; }
.tut-body h3:first-child { margin-top: 0; }
.tut-body ul { margin: 0 0 8px; padding-left: 18px; }
.tut-body li { margin-bottom: 5px; }
.tut-body b { color: var(--gold); font-weight: 700; }
.tut-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.tut-table td { padding: 5px 8px; border-bottom: 1px dashed rgba(255, 255, 255, .08); vertical-align: top; }
.tut-tip {
  margin-top: 12px; padding: 9px 12px; border-radius: 10px; font-size: 11px;
  background: rgba(92, 225, 255, .07); border: 1px solid rgba(92, 225, 255, .18); color: #b6c8ea;
}
.tut-hint-line { text-align: center; font-size: 11px; color: var(--muted); margin: 0 0 14px; letter-spacing: 1px; }
.tut-hint-line b { color: var(--cyan); }

/* ---------- 会议自由发言 ---------- */
.speech-input-row { display: flex; gap: 8px; margin: 8px 0 4px; }
#speech-input {
  flex: 1; min-width: 0; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(8, 14, 32, .7);
  color: #e8f0ff; padding: 9px 12px; font-size: 13px;
  outline: none; font-family: inherit;
}
#speech-input:focus { border-color: var(--cyan); }
#speech-input:disabled { opacity: .5; }
#speech-input::placeholder { color: rgba(180, 200, 235, .45); }
.speech-note { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.6; }

/* ---------- 出局弹窗 ---------- */
#ghost-dialog { z-index: 80; }
.ghost-card {
  width: 100%; max-width: 420px;
  border-radius: 18px; padding: 26px 28px; text-align: center;
  background: linear-gradient(160deg, rgba(24, 36, 72, .97), rgba(10, 16, 36, .98));
  border: 1px solid rgba(120, 180, 255, .3);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 60px rgba(60, 140, 255, .12) inset;
}
.ghost-card .result-emblem { font-size: 34px; color: var(--cyan); opacity: .9; }
.ghost-card h2 { margin: 8px 0 6px; letter-spacing: 4px; color: #eaf5ff; }
.ghost-card p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.ghost-actions { display: flex; flex-direction: column; gap: 10px; }
#btn-ghost-restart {
  border-radius: 12px; padding: 12px; cursor: pointer; font-weight: 700; letter-spacing: 2px;
  font-size: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: #cfe0ff;
}
#btn-ghost-restart:hover { border-color: var(--cyan); color: #fff; }

/* ---------- 页面底部备案信息 ---------- */
.site-footer {
  text-align: center;
  padding: 10px 16px 16px;
  font-size: 12px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); text-decoration: underline; }
