*{box-sizing:border-box}

body{
  margin:0;
  font-family:system-ui, -apple-system, BlinkMacSystemFont;
  background:#f5f5f5;
  color:#333;
}

.bg{
  position:fixed;
  inset:0;
  background:url("../images/bg-default.webp") center/cover no-repeat;
  z-index:-3;
}

.overlay{
  position:fixed;
  inset:0;
  background:linear-gradient(
    to bottom,
    rgba(0,0,0,.2),
    rgba(0,0,0,.6)
  );
  z-index:-2;
}

/* ===== 顶部固定栏 ===== */
.topbar {
  position: fixed;        /* 关键：贴顶 */
  top: 0;
  left: 0;
  right: 0;
  height: 56px;

  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;

  background: rgba(0,0,0,.6);
  backdrop-filter: blur(10px);
  z-index: 1000;          /* 确保在最上层 */
}

/* 按钮基础样式 */
.topbar .btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 13px;
}

/* 主按钮 */
.topbar .btn.primary {
  background: linear-gradient(90deg, #ff8a00, #ff3d00);
}

/* 右侧图标 */
.topbar .icons {
  margin-left: auto;
  display: flex;
  gap: 10px;
  font-size: 18px;
  cursor: pointer;
}


/* ===== Hero 容器 ===== */
.hero {
  width: 100%;
  margin-bottom: 16px;
}

/* 单图轮播容器 */
.hero-single {
  position: relative;
  display: block;
  width: 100%;

  /* 关键：限制高度，且自适应 */
  height: clamp(245px, 32vw, 220px);

  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

/* 图片永远裁剪显示 */
.hero-single img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* 裁剪而不是拉伸 */
  object-position: center;

  transition: opacity .6s ease;
}

/* 标题遮罩 */
.hero-caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: 80%;

  background: rgba(0,0,0,.55);
  padding: 6px 10px;
  border-radius: 8px;
}

.hero-caption h3 {
  margin: 0;
  font-size: 14px;
  color: #fff;
}

.hero-caption p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #ddd;
}




.card{
  min-width:110px;
  border-radius:12px;
  background:#fff;
  color:#000;
  padding:6px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px; /* 原来偏大，这里缩小 */
}


.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px; /* 3 列一定要更小 */
}

/* 游戏区卡片再瘦一点 */
#games .game-card img {
  aspect-ratio: 1 / 1;   /* 正方形，更省高度 */
}

/* ===============================
   卡片统一基础样式（缩小版）
================================ */
.game-card {
  background: #fff;
  border-radius: 14px;
  padding: 6px;
  overflow: hidden;
  cursor: pointer;
}

/* 图片比例控制（关键） */
.game-card img {
  width: 100%;
  aspect-ratio: 4 / 3;      /* 推荐：比之前瘦 */
  object-fit: cover;
  border-radius: 10px;
}

/* 标题 / 文案更紧凑 */
.game-card h3,
.game-card p {
  margin: 6px 4px 0;
  font-size: 13px;
  line-height: 1.25;
  color: #222;
}

/* 副标题（如 Join Now / Leaderboard） */
.game-card .sub {
  font-size: 11px;
  color: #777;
  margin-top: 2px;
}


/* 页面整体 */
html, body {
  height: 100%;
}

body {
  margin: 0;
  overflow-y: auto;
  padding-top: 56px;    /* topbar */
  padding-bottom: 56px; /* bottom-nav */
  -webkit-overflow-scrolling: touch;
}

/* 底部导航容器 */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  height: 56px;
  display: flex;

  background: #fff;
  border-top: 1px solid #eee;

  z-index: 9999;
}

/* 单个导航项 */
.nav-item {
  flex: 1;
  text-align: center;
  font-size: 12px;
  text-decoration: none;
  color: #999;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 选中态 */
.nav-item.active {
  color: #EC7B09;
}

/* 图标 */
.nav-item .icon {
  width: 22px;
  height: 22px;
  display: block;
  margin-bottom: 2px;
}


/* ===== Live 多直播模块 ===== */
.live-section {
  margin: 16px 0;
}

.live-header {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}
/* ===== Live Track ===== */
.live-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px;
}

/* ===== Live Card ===== */
.live-card {
  position: relative;
  width: 160px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

.live-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* 直播标签 */
.live-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(255,0,0,.85);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  z-index: 5;
}

/* ===== 直播控制区（音量 / 全屏等按钮容器） ===== */
.live-controls {
  position: absolute;   /* 绝对定位，基于 live-card 容器 */
  bottom: 20px;          /* 距离底部 6px */
  right: 6px;           /* 距离右侧 6px */
  display: flex;        /* 使用 flex 横向排列按钮 */
  gap: 6px;             /* 按钮之间的间距 */
  z-index: 5;           /* 层级高于视频，低于弹幕输入层 */
}

/* =========================================================
   直播控制按钮（静音 / 全屏 等）
   ========================================================= */
.live-btn {
  background: rgba(0,0,0,.6); /* 半透明黑色背景，保证在视频画面上可读 */
  border: 0;                  /* 去掉默认按钮边框 */
  color: #fff;                /* 图标/文字颜色为白色 */
  font-size: 20px;            /* 图标大小（适合移动端触控） */
  width: 32px;                /* 按钮宽度 */
  height: 32px;               /* 按钮高度，保持正方形 */
  border-radius: 50%;         /* 圆形按钮，符合直播常见 UI */
}

/* =========================================================
   当前激活的直播卡片状态
   - 表示正在播放的直播
   ========================================================= */
.live-card.active {
  outline: 2px solid #00ffcc; /* 使用描边高亮当前播放直播 */
}

/* =========================================================
   竖屏“伪全屏”模式
   - 不调用系统横屏
   - 适合 H5 / WebView / App 内嵌
   ========================================================= */
.live-card.fullscreen {
  position: fixed;        /* 固定定位，脱离文档流 */
  inset: 0;               /* 上下左右全部贴边（等价 top/right/bottom/left = 0） */
  width: 100vw;           /* 占满视口宽度 */
  height: 90vh;          /* 占满视口高度 */
  border-radius: 0;       /* 去掉圆角，模拟真正全屏效果 */
  z-index: 1000000;        /* 极高层级，覆盖页面所有内容 */
}

/* =========================================================
   全屏状态下的视频显示方式
   ========================================================= */
.live-card.fullscreen video {
  object-fit: contain;    /* 关键设置：
                              - 保持视频完整比例
                              - 不裁剪画面
                              - 适合竖屏直播内容 */
}

/* =========================================================
   全屏模式下：控制按钮位置调整
   - 增加安全边距，避免贴边误触
   ========================================================= */
.live-card.fullscreen .live-controls {
  bottom: 45px;           /* 控制区距离底部更远 */
  right: 16px;            /* 控制区距离右侧更远 */
}

/* =========================================================
   全屏模式下：直播标签位置调整
   - 如 LIVE / 游戏名称 等
   =============== ========================================== */
.live-card.fullscreen .live-tag {
  top: 16px;              /* 距离顶部留出安全空间 */
  left: 16px;             /* 距离左侧留出安全空间 */
}



/* PC 端尺寸 */
@media (min-width: 768px) {
  .live-card {
    flex-basis: 360px;
  }
}






/* ===============================
   PC 自适应优化（不影响 H5）
================================ */
@media (min-width: 768px) {

  /* 中央内容区限制宽度 */
  .page-content {
    max-width: 420px;          /* 像手机 App */
    margin: 0 auto;
  }

  /* 顶部栏也跟着居中 */
  .topbar {
    max-width: 420px;
    left: 50%;
    transform: translateX(-50%);
  }

  /* 底部导航居中 */
  .bottom-nav {
    max-width: 420px;
    left: 50%;
    transform: translateX(-50%);
  }

  /* 背景铺满整个 PC */
  .bg,
  .overlay {
    left: 0;
    right: 0;
  }
}



/* ===== Reset ===== */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto;
  background: #f2f3f5;
  color: #333;
}

/* =================================================
   ✅ 关键：H5 样式容器
   ================================================= */
.h5-container {
  width: 100%;
  max-width: 420px;   /* 👈 PC 上就是手机宽度 */
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
}

/* ===== 游戏模块 ===== */
.game-grid {
  padding: 12px;
}

/* ===== Banner ===== */
.game-banner img {
  width: 100%;
  border-radius: 12px;
  display: block;
  margin-bottom: 12px;
}

/* ===== 游戏网格（永远 3 列） ===== */
.game-grid-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* ===== 游戏卡片 ===== */
.game-card {
  display: block;
  position: relative;
  text-decoration: none;
  color: #333;
}

.game-card img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.game-title {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  text-align: center;
  line-height: 1.2;
}

/* ===== Jackpot ===== */
.game-card.jackpot .jackpot-amount {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  color: #ffd700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}


/* ===============================
   小弹窗样式
   =============================== */

#sitePopupMask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9998;
}

#sitePopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 360px);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  z-index: 9999;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

#sitePopup img {
  width: 100%;
  display: block;
}

#sitePopup .popup-close {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 22px;
  cursor: pointer;
  color: #fff;
  z-index: 2;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
}



.home-h1 {
  font-size: 8px;        /* 主标题感明显，但不压 Hero */
  line-height: 1.35;
  font-weight: 600;
  margin: 16px 14px 10px;
  color: #919191;
  letter-spacing: 0.2px;
}

/* 手机端微调 */
@media (max-width: 768px) {
  .home-h1 {
    font-size: 8px;
    line-height: 1.3;
    margin: 14px 12px 8px;
  }
}


/* ===== Base ===== */
html, body {
  margin: 0;
  padding: 0;
  color: #fff;
}

/* ===== Loading (GIF only) ===== */
#bp-loading {
  position: fixed;
  inset: 0;
  background: #00000078;          /* 纯黑，最稳 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.bp-loading-gif {
  width: 96px;               /* PC / App */
  height: auto;
}





