/* ========== RTSGo 原型样式（暗色克制风） ========== */
:root {
  --bg: #17181c;
  --bg-soft: #1f2126;
  --card: #23252b;
  --border: #30333a;
  --ink: #e8e6e0;
  --mute: #8a8d94;
  --accent: #d8b45a;      /* 棋魂金 */
  --danger: #e05252;
  --ok: #7fae6e;
  --board-bg: #d9c49a;    /* 棋盘木色 */
  --board-line: #5a4a2e;
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh; overflow-x: hidden;
}
.mono { font-family: Consolas, "Courier New", monospace; }
.muted { color: var(--mute); font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.row.right { justify-content: flex-end; margin-top: 16px; }

/* ---------- 屏幕切换 ---------- */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.brand { font-weight: 700; letter-spacing: 1px; cursor: pointer; user-select: none; }
.user-box { display: flex; align-items: center; gap: 8px; }
.user-box .lbl { color: var(--mute); font-size:12px; white-space: nowrap; }
.input {
  background: var(--card); border: 1px solid var(--border); color: var(--ink);
  padding: 8px 12px; border-radius: var(--radius); font-size: 14px; outline: none; width: 100%;
}
.input:focus { border-color: var(--accent); }
.input[readonly] { color: var(--mute); }

/* ---------- 按钮 ---------- */
.btn {
  background: var(--card); border: 1px solid var(--border); color: var(--ink);
  padding: 10px 22px; border-radius: var(--radius); font-size: 14px; cursor: pointer;
  transition: filter .12s; user-select: none;
}
.btn:hover:not(:disabled) { filter: brightness(1.2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #1a1a1a; font-weight: 600; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; }
.tag-soon { font-size: 11px; background: var(--border); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.tag { font-size: 11px; background: var(--border); border-radius: 4px; padding: 2px 8px; margin-left: 8px; color: var(--mute); }

/* ---------- 开始界面 ---------- */
.center-stack {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: calc(100vh - 60px); gap: 40px; padding: 40px 20px;
}
.logo-block { text-align: center; }
.title { font-size: 72px; font-weight: 800; letter-spacing: 2px; }
.title span { color: var(--accent); }
.subtitle { color: var(--mute); margin-top: 8px; letter-spacing: 1px; }
.menu-buttons { display: flex; flex-direction: column; gap: 12px; width: 260px; }
.menu-buttons .btn { padding: 14px; font-size: 15px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px;
}
.center-card {
  max-width: 480px; margin: 8vh auto; position: relative;
}
.center-card.wide { max-width: 640px; }
.center-card h2 { margin-bottom: 20px; font-size: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; color: var(--mute); font-size: 12px; margin-bottom: 6px; }
.mode-cards { display: flex; gap: 10px; }
.mode-card {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
}
.mode-card:has(input:checked) { border-color: var(--accent); background: rgba(216,180,90,.08); }
.mode-card input { display: none; }
.mode-card span { font-size: 12px; color: var(--mute); }

/* ---------- 游戏说明 ---------- */
.article h3 { font-size: 14px; color: var(--accent); margin: 14px 0 6px; }
.article h3:first-child { margin-top: 0; }
.article p { font-size: 13px; line-height: 1.7; color: var(--mute); }

/* ---------- 游戏界面（一屏适配，不滚动） ---------- */
.game-screen { display: none; }
.game-screen.active {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}
.game-layout {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 8px 20px;
}
.board-wrap { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
.board-frame {
  position: relative; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--board-bg); line-height: 0;
}
#board { display: block; }
.freeze-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; letter-spacing: 4px; backdrop-filter: blur(1px);
}
.phase-hint { display: block; text-align: center; margin-top: -6px; }
.ownership-legend { display:flex; justify-content:center; gap:12px; font-size:11px; }
.ownership-legend span { display:flex; align-items:center; gap:4px; }
.ownership-legend .mark { width:9px; height:9px; display:inline-block; border-radius:2px; }
.ownership-legend .mark.black { background:rgba(20,24,32,.78); }
.ownership-legend .mark.white { background:rgba(250,248,238,.9); border:1px solid rgba(80,74,64,.35); }
.ownership-legend .mark.neutral { width:5px; height:5px; border-radius:50%; background:rgba(96,91,82,.7); }
.timebar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.timebar-fill { height: 100%; width: 100%; background: var(--accent); transition: width 100ms linear; }

/* ---------- 侧面板（不滚动，聊天区弹性收缩） ---------- */
.side-panel {
  width: 320px; height: 100%;
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
  padding: 8px 0;
}
.vs-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px;
}
.player-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.player-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.player-dot.black { background: #1c1c1c; border: 1px solid #555; }
.player-dot.white { background: #f0f0f0; border: 1px solid #999; }
.vs-text { text-align: center; color: var(--mute); font-size: 12px; margin: 4px 0; }

.panel-block {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.block-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--mute); }
.num { font-size: 22px; font-weight: 700; font-family: Consolas, monospace; }
.black-num { color: #e8e8e8; }
.white-num { color: #cfcfcf; }
.vs-mini { color: var(--mute); font-size: 12px; }
.soul-bars { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bar-wrap { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bar { height: 100%; width: 50%; transition: width .3s; border-radius: 4px; }
.bar-black { background: #dcdcdc; }
.bar-white { background: #6a6a6a; }

.info-list .info-row {
  display: flex; justify-content: space-between; font-size: 13px;
  padding: 4px 0; color: var(--mute);
}
.info-list .info-row b { color: var(--ink); font-weight: 500; }
.cost { color: var(--accent) !important; }
.gain { color: var(--ok) !important; }

.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-grid .btn { padding: 10px 0; }

.chat-block { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-box {
  flex: 1; min-height: 0; overflow-y: auto;
  font-size: 12px; line-height: 1.6; margin-bottom: 6px; color: var(--mute);
}
.chat-line .who { color: var(--accent); }
.chat-line.me .who { color: var(--ok); }
