/* 卡坦岛 Catan 联机版 —— 样式（深色主题） */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #0f1722; color: #e6eef7;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ===== 大厅 ===== */
.screen { min-height: 100vh; }
#lobby { display: flex; align-items: center; justify-content: center; }
.lobby-wrap { width: 760px; max-width: 94vw; }
.brand { text-align: center; margin-bottom: 26px; }
.brand .logo { font-size: 56px; }
.brand h1 { margin: 6px 0 4px; font-size: 30px; letter-spacing: 2px; }
.brand .tag { color: #8aa0b6; font-size: 14px; margin: 0; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: #18222f; border: 1px solid #2b3a4d; border-radius: 14px; padding: 22px; }
.card h2 { margin: 0 0 14px; font-size: 18px; }
.card label { display: block; font-size: 13px; color: #b9c8d8; margin: 12px 0 5px; }
.card input, .card select {
  width: 100%; padding: 10px 11px; border-radius: 9px; border: 1px solid #2b3a4d;
  background: #0f1722; color: #e6eef7; font-size: 14px;
}
.card button {
  margin-top: 18px; width: 100%; padding: 12px; border: 0; border-radius: 9px;
  background: #e07b39; color: #fff; font-size: 15px; font-weight: 600;
}
.card button:hover { background: #f08c47; }
.card .hint { font-size: 12px; color: #8aa0b6; margin-top: 12px; line-height: 1.6; }
.msg { text-align: center; margin-top: 16px; font-size: 14px; min-height: 18px; }
.msg.ok { color: #9fe6b8; } .msg.err { color: #f08a8a; }

/* ===== 游戏顶栏 ===== */
#game { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: #18222f; border-bottom: 1px solid #2b3a4d;
}
.topbar .room-info { font-size: 14px; }
.topbar .room-info b { color: #e07b39; font-size: 16px; letter-spacing: 1px; }
.topbar .turn-info { flex: 1; font-size: 14px; color: #cdd9e6; }
.topbar .turn-info b { color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #555; }
.dot.on { background: #3fcf7a; box-shadow: 0 0 6px #3fcf7a; }
.dot.off { background: #d9534f; }
.ghost {
  background: transparent; border: 1px solid #2b3a4d; color: #b9c8d8;
  padding: 7px 14px; border-radius: 8px; font-size: 13px;
}
.ghost:hover { background: #22303f; }

/* ===== 布局 ===== */
.layout { flex: 1; display: flex; overflow: hidden; }
.board-area { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; background: radial-gradient(circle at 50% 40%, #16202c, #0f1722); }
#board { max-width: 100%; max-height: 100%; touch-action: none; }
.board-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(20,30,42,.9); border: 1px solid #2b3a4d; color: #ffeb5a;
  padding: 7px 16px; border-radius: 20px; font-size: 13px; white-space: nowrap;
}

/* ===== 侧栏 ===== */
.sidebar { width: 320px; background: #141d28; border-left: 1px solid #2b3a4d; overflow-y: auto; padding: 14px; }
.panel { background: #18222f; border: 1px solid #2b3a4d; border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.panel h3 { margin: 0 0 10px; font-size: 14px; color: #9fb2c6; font-weight: 600; }
.panel h4 { margin: 12px 0 6px; font-size: 13px; color: #9fb2c6; }
.res-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 8px;
  background: #0f1722; border: 2px solid #555; font-size: 14px;
}
.chip .ico { font-size: 15px; }
.chip .n { font-weight: 700; }
.dev-row { display: flex; flex-wrap: wrap; gap: 6px; }
.devchip { padding: 4px 9px; border-radius: 7px; background: #243446; border: 1px solid #36506b; font-size: 12px; }
.devchip.vp { background: #3a2f12; border-color: #6b5a2e; color: #ffd86b; }
.vp-line { margin-top: 10px; font-size: 14px; }
.vp-line b { color: #ffeb5a; font-size: 16px; }
.muted { color: #7e8ea0; } .small { font-size: 12px; }

/* 动作按钮 */
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.abtn {
  padding: 10px 8px; border-radius: 9px; border: 1px solid #36506b; background: #22303f;
  color: #e6eef7; font-size: 13px; text-align: center;
}
.abtn:hover { background: #2b3c4f; }
.abtn.primary { background: #e07b39; border-color: #e07b39; color: #fff; font-weight: 600; }
.abtn.primary:hover { background: #f08c47; }
.abtn.dev { background: #2e4a3a; border-color: #3f6b50; }
.abtn.ghost2 { background: transparent; border-color: #2b3a4d; color: #b9c8d8; }

/* 玩家 */
.pl-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 13px; margin-bottom: 4px; }
.pl-row.me { background: #1f2e3d; }
.pl-row.cur { outline: 1px solid #e07b39; }
.swatch { width: 13px; height: 13px; border-radius: 3px; flex: 0 0 auto; }
.pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pscore { font-weight: 700; color: #ffeb5a; }

/* 日志 */
.log #log_list { max-height: 220px; overflow-y: auto; font-size: 12px; line-height: 1.6; }
.logitem { padding: 3px 0; border-bottom: 1px solid #1d2937; color: #c3d0de; }
.logitem .lt { color: #6c7f93; margin-right: 6px; }
.logitem.build { color: #9fe6b8; } .logitem.robber { color: #f0a86b; }
.logitem.trade { color: #8fb6e6; } .logitem.win { color: #ffeb5a; font-weight: 600; }
.logitem.discard { color: #d98aa6; } .logitem.roll { color: #c3d0de; }

/* 等待开局 */
.wait-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.wait { background: #18222f; border: 1px solid #2b3a4d; border-radius: 14px; padding: 28px 34px; text-align: center; max-width: 90%; }
.wait h2 { margin: 0 0 8px; }
.wait .tag { color: #8aa0b6; font-size: 13px; }
.wait-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.wait-list .pl { padding: 8px 12px; border-radius: 8px; background: #22303f; border: 1px solid #36506b; font-size: 14px; }
.wait-list .pl.ai { background: #2a2333; border-color: #4a3a5b; }
.wait button { margin-top: 14px; padding: 11px 22px; border: 0; border-radius: 9px; background: #e07b39; color: #fff; font-size: 15px; font-weight: 600; }
.wait button:hover { background: #f08c47; }

/* ===== 弹窗 ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #18222f; border: 1px solid #2b3a4d; border-radius: 14px; padding: 22px 24px; width: 380px; max-width: 92vw; }
.modal-box h3 { margin: 0 0 12px; font-size: 17px; }
.modal-box h4 { margin: 14px 0 6px; font-size: 14px; color: #9fb2c6; }
.modal-box label { display: block; font-size: 13px; color: #b9c8d8; margin: 12px 0 5px; }
.modal-box select { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid #2b3a4d; background: #0f1722; color: #e6eef7; font-size: 14px; }
.drow { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid #36506b; background: #22303f; color: #fff; font-size: 16px; }
.stepper b { min-width: 18px; text-align: center; display: inline-block; }
.modal-btns { display: flex; gap: 10px; margin-top: 18px; }
.modal-btns .abtn { flex: 1; }
.modal-box p { font-size: 14px; line-height: 1.7; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-left: 0; border-top: 1px solid #2b3a4d; max-height: 46vh; }
}
