/* HaiGames SDK — shared game styles
 *
 * 所有游戏共用的 overlay / sheet / header / status / comment 样式。
 * 具体游戏（TTT 的棋盘、WYR 的选项）放在各自目录的 css 里。
 *
 * 设计约束：
 *   - 游戏 overlay 作为底部升起的 bottom-sheet，桌面端居中，移动端占满宽度；
 *   - 深色背景主题与 companion.html 对齐；
 *   - 所有色值用 rgba 而非 CSS var，便于嵌入不同宿主页（无需强制宿主定义 var）。
 */

.hg-overlay {
  position: fixed; inset: 0; z-index: 600;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px);
}
.hg-overlay.open { display: flex; }

.hg-sheet {
  width: 100%; max-width: 480px;
  background: rgba(10, 8, 22, 0.98);
  backdrop-filter: blur(32px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px max(24px, env(safe-area-inset-bottom)) 20px;
  animation: hg-slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  position: relative;
}
@keyframes hg-slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.hg-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.hg-title {
  font-size: 16px; font-weight: 700;
  color: rgba(255, 255, 255, 0.92); letter-spacing: 0.3px;
}
.hg-close-btn {
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.6);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.hg-close-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.hg-status {
  text-align: center; font-size: 14px;
  color: rgba(255, 255, 255, 0.55); min-height: 22px; margin-bottom: 14px;
}

.hg-buddy-comment {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 14px; padding: 12px 16px;
  font-size: 14px; color: rgba(255, 255, 255, 0.85);
  line-height: 1.5; min-height: 48px;
  margin-bottom: 16px; font-style: italic; display: none;
}
.hg-buddy-comment.show { display: block; }

.hg-action-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.3) 0%, rgba(139, 92, 246, 0.4) 100%);
  border: 1px solid rgba(167, 139, 250, 0.4); border-radius: 14px;
  font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, 0.9);
  cursor: pointer; transition: all 0.2s;
}
.hg-action-btn:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.42) 0%, rgba(139, 92, 246, 0.55) 100%);
}
.hg-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Inline "Start game" chip（内嵌在聊天气泡内的启动按钮） */
.hg-start-inline-btn {
  display: inline-block; margin-top: 10px;
  padding: 8px 18px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.25) 0%, rgba(139, 92, 246, 0.35) 100%);
  border: 1px solid rgba(167, 139, 250, 0.45);
  font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.88);
  cursor: pointer; transition: all 0.2s;
}
.hg-start-inline-btn:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.38) 0%, rgba(139, 92, 246, 0.5) 100%);
}
.hg-start-inline-btn:disabled { opacity: 0.4; cursor: not-allowed; }
