/* ============ 黑暗森林 · 游戏界面样式 ============ */

/* 大厅设置 */
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.setting-row label { min-width: 88px; color: var(--muted); font-size: 13px; }
.setting-row select,
.setting-row input[type=number] {
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 0 10px;
  font-size: 14px;
  min-width: 88px;
}
.setting-row select:disabled,
.setting-row input:disabled { opacity: .55; }
.lobby-players { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lobby-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel2); font-size: 13px;
}
.lobby-chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.room-code-big {
  font-size: 30px; letter-spacing: 6px; font-weight: 900;
  color: var(--accent); margin: 6px 0;
}
.hint-line { font-size: 13px; color: var(--muted); line-height: 1.7; }
.copy-hint {
  display: inline-block; margin-top: 6px; padding: 4px 10px;
  border-radius: 8px; background: #0d1828; border: 1px dashed var(--line);
  color: var(--muted); font-size: 12px;
}

/* 星图 */
.map-card { padding: 10px; }
.map-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.map-top .turn { font-weight: 800; font-size: 15px; }
.map-top .timer { margin-left: auto; font-family: ui-monospace, monospace; color: var(--warn); font-size: 14px; }
.map-banner { font-size: 13px; color: #a9dcff; margin: 2px 0 8px; }
.map-wrap { width: 100%; overflow: hidden; }
.star-map { width: 100%; height: auto; display: block; touch-action: manipulation; }
.star-map text { font-family: inherit; user-select: none; }
.star-map .edge { stroke: rgba(120, 170, 230, .26); stroke-width: .35; }
.star-map .node circle.core { fill: #16263f; stroke: #4a7ab0; stroke-width: .45; cursor: pointer; transition: .15s; }
.star-map .node:hover circle.core { fill: #1d3453; }
.star-map .node.mine circle.core { stroke: #ffd166; stroke-width: .9; }
.star-map .node.destroyed circle.core { fill: #3a2430; stroke: #ff9daa; }
.star-map .node.dimension circle.core { fill: #2b1d45; stroke: #b48cff; }
.star-map .node.annihilated circle.core { fill: #262626; stroke: #8a8a8a; }
.star-map .node.legal circle.core { stroke: #37d67a; stroke-width: .9; }
.star-map .node.legal circle.halo { fill: rgba(55, 214, 122, .16); }
.star-map .node.selected circle.core { stroke: #fff; stroke-width: 1.1; }
.star-map .node .label {
  fill: #b9cbe4; font-size: 2.25px; text-anchor: middle;
  paint-order: stroke; stroke: #0a1220; stroke-width: .5px;
}
.star-map .node .subtag {
  font-size: 1.95px; text-anchor: middle;
  paint-order: stroke; stroke: #0a1220; stroke-width: .4px;
}
.star-map .node .attack-badge { fill: #ff8c42; font-size: 2.3px; font-weight: 700; }
.star-map .node .status-letter { font-size: 2.1px; font-weight: 700; text-anchor: middle; }
.star-map .bc-target { fill: none; stroke: #ffd166; stroke-width: .35; stroke-dasharray: 1.2 1; }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.map-legend .dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; margin-right: 4px; vertical-align: 1px;
}

/* 手牌 */
.hand-card { margin-top: 12px; }
.hand-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hand-head h3 { margin: 0; }
.hand { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.card-tile {
  flex: none; width: 132px; min-height: 92px; text-align: left;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); padding: 8px; cursor: pointer; touch-action: manipulation;
  display: flex; flex-direction: column; gap: 4px;
}
.card-tile:hover { border-color: #3b6ea8; }
.card-tile.selected { outline: 2px solid var(--accent); }
.card-tile.picked { outline: 2px solid var(--danger); background: #2a1b1e; }
.card-tile.dim { opacity: .45; }
.card-tile .c-name { font-weight: 800; font-size: 13px; line-height: 1.25; }
.card-tile .c-sub { font-size: 11px; color: var(--muted); }
.card-tile .c-cost { margin-top: auto; font-size: 12px; color: var(--warn); }
.card-tile.cat-BROADCAST { border-top: 3px solid #4cc9f0; }
.card-tile.cat-ATTACK { border-top: 3px solid #ff5964; }
.card-tile.cat-CONSTRUCTION { border-top: 3px solid #37d67a; }
.card-tile .c-badge {
  align-self: flex-start; font-size: 10px; padding: 1px 6px;
  border-radius: 999px; background: #0e1b30; color: var(--muted);
}
.card-detail {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #0d1828;
  font-size: 13px; line-height: 1.7;
}
.card-detail .cd-name { font-weight: 800; font-size: 15px; }
.card-detail .cd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.card-detail .muted { color: var(--muted); }
.card-detail .cd-effects { white-space: pre-line; color: #cfe0f5; }

/* 侧栏 */
.facility-list { display: flex; flex-wrap: wrap; gap: 6px; }
.facility-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid #2b4a75; background: #14253c; color: #cfe0f5;
  white-space: nowrap;
}
.player-line {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid #14233a; font-size: 13px; flex-wrap: wrap;
}
.player-line:last-child { border-bottom: none; }
.player-line .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.player-line .nm { font-weight: 700; }
.player-line .pstat { color: var(--muted); font-size: 12px; }
.player-line .spacer { flex: 1; }
.player-line.turn-now { background: rgba(76, 201, 240, .08); border-radius: 8px; padding: 6px; }
.player-line.dead { opacity: .5; }
.player-line .facility-list { width: 100%; }
.loglist { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; gap: 2px; }
.log-item {
  font-size: 12px; line-height: 1.55; padding: 4px 2px;
  border-bottom: 1px solid #12203a; white-space: pre-line; color: #c4d3e6;
}
.log-item.ATTACK { color: #ffb3b8; }
.log-item.BROADCAST { color: #a9dcff; }
.log-item.SYSTEM { color: #ffd166; }
.log-item.ELIMINATION { color: #ff8c42; }
.log-item.DEFENSE { color: #9ee6b7; }

/* 行动栏 */
.actionbar .end-turn-btn { margin-left: auto; flex: none; }
.actionbar .hand-count { color: var(--muted); font-size: 13px; }

/* 广播/揭示浮层 */
.overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(4, 8, 16, .78);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.overlay-card {
  width: 100%; max-width: 540px; max-height: 86vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; box-shadow: 0 16px 60px rgba(0, 0, 0, .65);
}
.overlay-card h2 { margin: 0 0 6px; font-size: 18px; }
.overlay-card .ov-sub { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 10px; }
.ov-list { display: flex; flex-direction: column; gap: 8px; }
.ov-card {
  text-align: left; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); padding: 10px 12px;
  cursor: pointer; font-size: 14px; touch-action: manipulation;
  display: flex; flex-direction: column; gap: 3px;
}
.ov-card:hover { border-color: #3b6ea8; }
.ov-card .t { font-weight: 800; }
.ov-card .s { color: var(--muted); font-size: 12px; }
.ov-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.reveal-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.reveal-card { border: 1px solid var(--line); border-radius: 12px; background: #0d1828; padding: 10px; font-size: 13px; }
.reveal-card .t { font-weight: 800; }
.reveal-card .s { color: var(--muted); font-size: 12px; }
.reveal-vs { color: var(--muted); font-weight: 800; }
.reward-line { margin-top: 10px; font-size: 13px; color: #9ee6b7; white-space: pre-line; }
.timer-line { font-family: ui-monospace, monospace; color: var(--warn); font-size: 13px; margin-top: 10px; }

/* 胜负 */
.winner-banner { text-align: center; padding: 12px 0; }
.winner-banner .big { font-size: 22px; font-weight: 900; color: var(--warn); }

/* 窄屏 */
@media (max-width: 999px) {
  .card-tile { width: 118px; }
  .map-legend { font-size: 11px; }
  .overlay-card { padding: 12px; }
  .reveal-grid { grid-template-columns: 1fr; }
  .reveal-vs { text-align: center; }
  .setting-row label { min-width: 74px; }
}
