/* render/game.css */
.game-view {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  background: radial-gradient(circle at 50% 30%, #2e2418 0%, #14100c 70%), #14100c;
  color: #e8ddc8;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;
  position: fixed; /* 锁定全屏，防止滚动 */
  top: 0; left: 0; right: 0; bottom: 0;
}
.game-view.show { display: flex; }

/* 顶部状态栏 */
.g-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  font-size: 12px;
  color: #9a8f7a;
  height: 40px;
}
.g-topbar .turn-info { color: #c9a227; letter-spacing: 0.08em; }
.g-topbar .btn-exit {
  background: transparent;
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: #c9a227;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}

/* 桌面：其他角色 */
.g-table {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
}

/* 角色卡 */
.g-player {
  width: 100px;
  background: linear-gradient(160deg, #332a20, #2a2119);
  border: 2px solid rgba(201, 162, 39, 0.25);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  user-select: none;
  position: relative;
}
.g-player.targetable { border-color: #c9a227; box-shadow: 0 0 14px rgba(201, 162, 39, 0.4); }
.g-player.selected-target { border-color: #d4ad2e; box-shadow: 0 0 0 2px #d4ad2e, 0 0 18px rgba(212, 173, 46, 0.6); }
.g-player.current-turn { border-color: #7fbf8e; box-shadow: 0 0 12px rgba(127, 191, 142, 0.5); }
.g-player.dead { opacity: 0.35; filter: grayscale(1); cursor: default; }
.g-player .p-name { font-size: 13px; font-weight: 600; color: #e8ddc8; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-player .p-hp { font-size: 12px; color: #d4635a; letter-spacing: 0.05em; }
.g-player .p-hand { font-size: 11px; color: #9a8f7a; margin-top: 2px; }
.g-player .p-tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 10px; margin-top: 4px; }
.g-player .p-tag.human { background: rgba(127, 191, 142, 0.2); color: #7fbf8e; }
.g-player .p-tag.ai { background: rgba(212, 99, 90, 0.2); color: #d4635a; }
.g-player .p-tag.dead { background: rgba(154, 143, 122, 0.2); color: #9a8f7a; }

/* 人类区域（固定在底部） */
.g-human {
  flex: 0 0 auto;
  border-top: 1px solid rgba(201, 162, 39, 0.25);
  background: rgba(0, 0, 0, 0.45);
  padding: 8px 10px 12px;
  z-index: 10;
}
.g-human .h-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  color: #c9a227;
}
.g-human .h-head .hp { color: #d4635a; }

/* 手牌 */
.g-hand {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 8px;
  scrollbar-width: thin;
}
.g-card {
  flex: 0 0 auto;
  width: 60px;
  height: 84px;
  background: linear-gradient(160deg, #f5ecd6, #e0d2b0);
  border: 2px solid #8a6f1c;
  border-radius: 8px;
  color: #2a2119;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
  user-select: none;
  position: relative;
}
.g-card:hover { transform: translateY(-6px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5); }
.g-card.selected { transform: translateY(-10px); border-color: #d4ad2e; box-shadow: 0 0 0 2px #d4ad2e, 0 10px 22px rgba(212, 173, 46, 0.4); }
.g-card .c-type { position: absolute; top: 4px; left: 5px; font-size: 10px; font-weight: 600; color: #8a6f1c; }
.g-card .c-name { font-size: 15px; }
.g-card.trick { background: linear-gradient(160deg, #e8e0f0, #d0c4e0); border-color: #6a4c8a; color: #2a1a3a; }
.g-card.slash { background: linear-gradient(160deg, #f5e0d0, #e8c4a8); border-color: #a85432; color: #3a1a0a; }
.g-card.dodge { background: linear-gradient(160deg, #d0e8f0, #a8c8e0); border-color: #326a8a; color: #0a1a3a; }
.g-card.peach { background: linear-gradient(160deg, #f0d8e0, #e0b0c0); border-color: #a8326a; color: #3a0a2a; }

/* 操作按钮 */
.g-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.g-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: linear-gradient(160deg, #d4ad2e, #a8841c);
  color: #1a1410;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: filter 0.15s, transform 0.12s;
}
.g-btn:hover { filter: brightness(1.08); }
.g-btn:active { transform: scale(0.97); }
.g-btn.ghost { background: transparent; color: #c9a227; }
.g-btn:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.5); }

/* 日志 */
.g-log {
  flex: 0 0 auto;
  max-height: 50px;
  overflow-y: auto;
  font-size: 11px;
  color: #9a8f7a;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(201, 162, 39, 0.12);
  line-height: 1.4;
}
.g-log .entry { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 响应遮罩与结束遮罩 */
.g-overlay, .g-over {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.g-overlay .box, .g-over .box {
  background: linear-gradient(160deg, #332a20, #2a2119);
  border: 2px solid #c9a227;
  border-radius: 14px;
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 40px rgba(201, 162, 39, 0.3);
}
.g-overlay .box h3, .g-over .box h2 { margin: 0 0 12px; color: #c9a227; font-size: 18px; letter-spacing: 0.1em; }
.g-overlay .box p, .g-over .box p { margin: 0 0 18px; color: #e8ddc8; font-size: 14px; line-height: 1.6; }
.g-overlay .box .btns { display: flex; gap: 12px; justify-content: center; }

/* 提示条 */
.g-tip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(26, 20, 16, 0.95);
  border: 1px solid #c9a227;
  border-radius: 10px;
  padding: 10px 18px;
  color: #c9a227;
  font-size: 14px;
  letter-spacing: 0.06em;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
}
.g-tip.show { opacity: 1; }

/* 桌面端稍微放大一点 */
@media (min-width: 600px) {
  .g-player { width: 120px; padding: 10px; }
  .g-player .p-name { font-size: 15px; }
  .g-card { width: 70px; height: 100px; }
  .g-card .c-name { font-size: 16px; }
  .g-log { max-height: 80px; }
}