/* 《废墟余声》前端样式：暗色、电影感、低饱和 */

:root {
  --bg: #080a09;
  --bg-soft: #0d100e;
  --panel: rgba(18, 22, 20, 0.88);
  --panel-solid: #121614;
  --line: #2a302c;
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #d9d5c9;
  --text-dim: #a9a99e;
  --muted: #7f857c;
  --accent: #c9a45c;
  --accent-soft: rgba(201, 164, 92, 0.14);
  --green: #7fa08a;
  --danger: #b5523f;
  --danger-soft: rgba(181, 82, 63, 0.14);
  --blue: #6f8fa8;
  --radius: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(201, 164, 92, 0.06), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(111, 143, 168, 0.06), transparent 60%),
    var(--bg);
}

h1, h2, h3, p, ul, pre { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- 通用控件 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  letter-spacing: 0.04em;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.12s;
}

.btn:hover:not(:disabled) { border-color: rgba(201, 164, 92, 0.5); background: rgba(201, 164, 92, 0.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn.primary {
  border-color: rgba(201, 164, 92, 0.55);
  background: linear-gradient(180deg, rgba(201, 164, 92, 0.22), rgba(201, 164, 92, 0.1));
  color: #f0e4c8;
}

.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, rgba(201, 164, 92, 0.34), rgba(201, 164, 92, 0.16)); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn.small { min-height: 30px; padding: 4px 12px; font-size: 13px; border-radius: 6px; }
.btn.wide { width: 100%; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.panel-label {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; min-height: 26px; }
.chips:empty::after { content: "空"; color: var(--muted); font-size: 12px; letter-spacing: 0.1em; }

/* ---------- 屏幕切换 ---------- */

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ---------- 入口 ---------- */

#screen-landing { position: relative; }

.landing-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.landing-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.35) brightness(0.55) contrast(1.05);
}

.landing-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(8, 10, 9, 0.15), rgba(8, 10, 9, 0.86) 70%),
    linear-gradient(180deg, rgba(8, 10, 9, 0.75), rgba(8, 10, 9, 0.55) 45%, #080a09 100%);
}

.landing-content {
  position: relative;
  width: min(980px, calc(100% - 40px));
  padding: 64px 0 48px;
  text-align: center;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--accent);
  margin-bottom: 18px;
}

.landing-content h1 {
  font-family: var(--serif);
  font-size: clamp(48px, 9vw, 92px);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: #ece5d3;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.landing-sub {
  margin: 16px auto 38px;
  max-width: 560px;
  color: var(--text-dim);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2;
}

.landing-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.form-panel h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.form-panel .hint { margin-bottom: 16px; }

.form-panel label {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

input, textarea, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(201, 164, 92, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.08);
}

textarea { resize: vertical; min-height: 76px; line-height: 1.7; }

.landing-rules {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin-top: 34px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.landing-rules span::before { content: "· "; color: var(--accent); }

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 11, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.14em;
  color: #e7dfcb;
  white-space: nowrap;
}

.brand-sub { font-family: var(--sans); font-size: 10px; letter-spacing: 0.3em; color: var(--muted); margin-left: 6px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }

.room-tag {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid rgba(201, 164, 92, 0.3);
  border-radius: 4px;
  padding: 2px 7px;
  margin-left: 8px;
  vertical-align: middle;
}

.env-strip { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }

.round-box { text-align: right; min-width: 104px; }
.round-no { font-size: 12px; letter-spacing: 0.16em; color: var(--text-dim); }
.round-timer { font-family: var(--serif); font-size: 22px; color: var(--accent); letter-spacing: 0.08em; }

/* ---------- 大厅 ---------- */

.lobby-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 18px;
  padding: clamp(18px, 3vw, 36px);
  max-width: 1180px;
  margin: 0 auto;
}

.room-card { align-self: start; }

.room-code {
  font-family: var(--serif);
  font-size: 42px;
  letter-spacing: 0.26em;
  color: var(--accent);
  margin: 8px 0 10px;
  text-indent: 0.26em;
}

.player-list { display: flex; flex-direction: column; gap: 8px; }
.player-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 14px;
}
.player-list li .tag { margin-left: auto; font-size: 10px; letter-spacing: 0.14em; color: var(--accent); }
.player-list li .tag.offline { color: var(--muted); }

.brief-card h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0.08em; }
.brief-lead { margin-top: 10px; color: var(--text-dim); font-family: var(--serif); font-size: 15px; }

.objective { display: grid; gap: 8px; margin: 18px 0; }
.objective-item {
  display: flex;
  gap: 14px;
  padding: 10px 12px;
  border-left: 2px solid rgba(201, 164, 92, 0.45);
  background: linear-gradient(90deg, rgba(201, 164, 92, 0.07), transparent);
  font-size: 13px;
}
.objective-item b { min-width: 44px; color: var(--accent); font-weight: 500; letter-spacing: 0.1em; }
.objective-item span { color: var(--text-dim); }

.brief-note { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.area-grid > div {
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.area-grid b { font-size: 13px; font-weight: 500; color: var(--text); }
.area-grid span { font-size: 11px; color: var(--muted); }

/* ---------- 游戏布局 ---------- */

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 18px;
  padding: 18px clamp(14px, 2.4vw, 30px) 48px;
  max-width: 1560px;
  margin: 0 auto;
  align-items: start;
}

.narrative-column { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.scene-media {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0d100e;
  box-shadow: var(--shadow);
}

#scene-image { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.7s ease; }
#scene-image.loaded { opacity: 1; }

.scene-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 10, 9, 0.15) 40%, rgba(8, 10, 9, 0.85) 100%);
  pointer-events: none;
}

.scene-loading {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 12, 11, 0.72);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  backdrop-filter: blur(4px);
}
.scene-loading.hidden { display: none; }

.scene-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(233, 226, 208, 0.82);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.scene-panel { padding-bottom: 14px; }
.scene-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.scene-round { margin-left: auto; font-size: 11px; letter-spacing: 0.18em; color: var(--muted); }

.roll-badge {
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.roll-badge.hidden { display: none; }
.roll-badge.crit { color: #f0d98a; border-color: #8a7430; background: rgba(240, 217, 138, 0.08); }
.roll-badge.success { color: #9fd6a4; border-color: #3f6b46; background: rgba(159, 214, 164, 0.07); }
.roll-badge.partial { color: #e0b878; border-color: #7a5c2c; background: rgba(224, 184, 120, 0.07); }
.roll-badge.fail { color: #e08b84; border-color: #7a3a34; background: rgba(224, 139, 132, 0.07); }

.scene-text {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 2.05;
  letter-spacing: 0.02em;
  color: #ded8c9;
  min-height: 120px;
}
.scene-text p { margin-bottom: 12px; }
.scene-text p:last-child { margin-bottom: 0; }

.scene-meta { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.scene-meta:empty { display: none; }

.secret-note {
  padding: 10px 12px;
  border: 1px dashed rgba(181, 82, 63, 0.5);
  border-radius: 7px;
  background: var(--danger-soft);
  font-size: 13px;
  color: #e3c3ba;
}
.secret-note b { color: var(--danger); font-weight: 500; letter-spacing: 0.1em; }

.action-panel { display: flex; flex-direction: column; gap: 12px; }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestions:empty::after { content: "本轮暂无参考行动。"; color: var(--muted); font-size: 12px; }

.auto-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.auto-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.auto-toggle:hover { border-color: var(--accent); }
.auto-toggle:has(input:checked) {
  border-color: #8a7430;
  color: #f0d98a;
  background: var(--accent-soft);
}

.suggestion {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  color: var(--text-dim);
  transition: border-color 0.16s, color 0.16s, background 0.16s;
  text-align: left;
}
.suggestion:hover { border-color: rgba(201, 164, 92, 0.45); color: var(--text); background: rgba(201, 164, 92, 0.08); }

.action-form { display: flex; flex-direction: column; gap: 10px; }
.action-row { display: flex; align-items: center; gap: 12px; }
.action-row .hint { flex: 1; }

.action-status {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  min-height: 18px;
}
.action-status.waiting { color: var(--accent); }
.action-status.done { color: var(--green); }

/* ---------- 侧栏 ---------- */

.sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 82px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #2a302c; border-radius: 3px; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }

.map-panel { padding-bottom: 12px; }
#sandbox-map { width: 100%; height: auto; display: block; }

.map-node-label { font-size: 10px; letter-spacing: 0.06em; fill: #b9b4a6; font-family: var(--sans); }
.map-node-label.self { fill: #f0e4c8; }
.map-zombie-label { font-size: 9px; fill: #c07a5e; font-family: var(--sans); letter-spacing: 0.02em; }
.map-player-label { font-size: 9px; fill: #d9d5c9; font-family: var(--sans); }
.map-player-label.self { fill: var(--accent); }

.map-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 6px; font-size: 10px; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.self { background: var(--accent); box-shadow: 0 0 8px rgba(201, 164, 92, 0.8); }
.dot.mate { background: var(--blue); }
.dot.zed { background: #a5604b; }

.team-list { display: flex; flex-direction: column; gap: 9px; }
.team-member {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
}
.team-member.self { border-color: rgba(201, 164, 92, 0.32); background: rgba(201, 164, 92, 0.05); }
.team-member.dead { opacity: 0.45; }
.team-name { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.team-name .dot { width: 6px; height: 6px; }
.team-area { font-size: 11px; color: var(--muted); }
.team-state { font-size: 10px; letter-spacing: 0.1em; color: var(--accent); }
.team-state.off { color: var(--muted); }
.team-hp { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.team-hp i { display: block; height: 100%; background: linear-gradient(90deg, var(--danger), var(--green)); }

.status-block { display: grid; gap: 9px; }
.stat-row { display: grid; grid-template-columns: 42px 1fr 44px; align-items: center; gap: 8px; font-size: 12px; }
.stat-row span:first-child { color: var(--muted); letter-spacing: 0.08em; }
.stat-row span:last-child { text-align: right; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); transition: width 0.5s ease; }
.bar.hp i { background: linear-gradient(90deg, #8d4436, #b5523f); }
.bar.hunger i { background: #b08a4a; }
.bar.thirst i { background: #5f89a4; }
.bar.fatigue i { background: #8b7fa0; }

.wounds { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.wounds:empty { display: none; }
.secrets { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.secrets:empty { display: none; }
.wound {
  font-size: 11.5px;
  color: #c99a8b;
  padding: 4px 8px;
  border-left: 2px solid var(--danger);
  background: var(--danger-soft);
  border-radius: 0 4px 4px 0;
}
.wound.treated { color: var(--muted); border-left-color: var(--line); background: rgba(255, 255, 255, 0.02); }

.comms { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--text-dim); }
.comms-line { display: flex; align-items: center; justify-content: space-between; }
.comms-line b { font-weight: 500; color: var(--text); }
.comms-line .ok { color: var(--green); }
.comms-line .no { color: var(--danger); }

.world-log { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; font-size: 12px; }
.world-log li {
  padding: 5px 0 5px 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.55;
}
.world-log li b { color: var(--text-dim); font-weight: 400; }

/* ---------- 通讯面板 ---------- */

.chat-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  min-width: 62px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(201, 164, 92, 0.45);
  background: rgba(18, 22, 20, 0.94);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 80px;
  z-index: 41;
  width: min(340px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: rgba(13, 16, 14, 0.97);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transition: opacity 0.2s, transform 0.2s;
}
.chat-panel.collapsed { opacity: 0; transform: translateY(12px); pointer-events: none; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.chat-head select { width: auto; max-width: 150px; margin: 4px 0 0; padding: 4px 8px; font-size: 12px; }

.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.chat-msg { font-size: 12.5px; line-height: 1.6; color: var(--text-dim); }
.chat-msg b { color: var(--text); font-weight: 500; }
.chat-msg.self { text-align: right; }
.chat-msg.private b { color: #c99a8b; }
.chat-msg .tag { font-size: 10px; letter-spacing: 0.1em; color: var(--muted); margin-left: 6px; }

.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form input { margin: 0; }
.chat-hint { padding: 0 12px 10px; }

/* ---------- 提示与弹窗 ---------- */

.net-status {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #7a3a34;
  background: rgba(28, 20, 18, 0.94);
  color: #e8c7c3;
  font-size: 12px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.net-status.hidden { display: none; }
.net-status .btn { padding: 2px 8px; font-size: 11px; }

.toast-wrap {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 20, 0.96);
  color: var(--text-dim);
  font-size: 12.5px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.24s ease;
}
.toast.accent { border-color: rgba(201, 164, 92, 0.45); color: #eadfc6; }
.toast.danger { border-color: rgba(181, 82, 63, 0.55); color: #e0b9ae; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 5, 0.82);
  backdrop-filter: blur(5px);
}

.modal-card { width: min(680px, 100%); max-height: 84vh; display: flex; flex-direction: column; gap: 12px; }
.modal-card h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: 0.1em; color: #eadfc6; }

.recap {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1080px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .lobby-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .landing-forms { grid-template-columns: minmax(0, 1fr); }
  .landing-content { padding-top: 48px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .env-strip { order: 3; width: 100%; margin-left: 0; }
  .round-box { margin-left: auto; }
  .scene-text { font-size: 15.5px; line-height: 1.95; }
  .action-row { flex-direction: column; align-items: stretch; }
  .action-row .btn { width: 100%; }
  .chat-panel { right: 12px; bottom: 76px; }
  .chat-toggle { right: 12px; bottom: 16px; }
  .room-code { font-size: 34px; }
}
