/* =============================================================
   V587 Lobby — 全部游戏页（独立页，data-page="allgames"）
   所有选择器都挂在 body[data-page="allgames"] 下，确保不影响游戏页/其它页
   ============================================================= */

body[data-page="allgames"] .content { padding: 12px 12px 24px; }

/* ---- 顶部标题 + 返回 ---- */
body[data-page="allgames"] .ag-head {
  display: flex; align-items: center; gap: 8px; margin: 2px 0 12px;
}
body[data-page="allgames"] .ag-back {
  width: 30px; height: 30px; flex: 0 0 auto; border: none; cursor: pointer;
  background: rgba(255,255,255,.08); border-radius: 9px; color: #ffd98a;
  font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center;
  font-family: inherit; padding: 0 0 2px;
}
body[data-page="allgames"] .ag-back:active { background: rgba(255,255,255,.16); }
body[data-page="allgames"] .ag-title {
  flex: 1; text-align: center;
  color: #fff; font-size: 17px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,12,45,.7);
}
body[data-page="allgames"] .ag-head-sp { width: 30px; flex: 0 0 auto; }

/* ---- 搜索框 ---- */
body[data-page="allgames"] .ag-search {
  position: relative; display: flex; align-items: center; margin-bottom: 14px;
}
body[data-page="allgames"] .ag-search .ag-s-ic {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: #9fb4da; pointer-events: none; display: flex;
}
body[data-page="allgames"] .ag-search input {
  width: 100%; height: 40px; border-radius: 20px; border: 1.5px solid rgba(246,206,96,0.55);
  background: rgba(6,20,46,.85); color: #fff; font-size: 13px; font-family: inherit;
  padding: 0 38px 0 36px; outline: none;
}
body[data-page="allgames"] .ag-search input::placeholder { color: #8ea2c7; }
body[data-page="allgames"] .ag-search input:focus { border-color: rgba(246,206,96,0.95); }
body[data-page="allgames"] .ag-s-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: none; cursor: pointer; background: rgba(255,255,255,.12);
  color: #fff; border-radius: 50%; font-size: 15px; line-height: 1; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}

/* ---- 游戏品牌（横向可滚动 pill 条）---- */
body[data-page="allgames"] .ag-brands {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
body[data-page="allgames"] .ag-brands::-webkit-scrollbar { display: none; }
body[data-page="allgames"] .ag-pill {
  flex: 0 0 auto; min-width: 54px; height: 54px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.12); background: rgba(6,20,46,.7); padding: 4px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: inherit; overflow: hidden;
}
body[data-page="allgames"] .ag-pill img {
  width: 30px; height: 30px; object-fit: contain; display: block;
}
body[data-page="allgames"] .ag-pill .ag-pill-tx {
  color: #cfe0ff; font-size: 10px; font-weight: 700; white-space: nowrap;
  max-width: 60px; overflow: hidden; text-overflow: ellipsis;
}
body[data-page="allgames"] .ag-pill.active {
  border-color: rgba(246,206,96,0.95); background: rgba(246,206,96,.14);
  box-shadow: 0 0 0 1px rgba(246,206,96,.35) inset;
}
body[data-page="allgames"] .ag-pill.active .ag-pill-tx { color: #ffd76a; }

/* ---- 游戏栅格（一行三个，复刻大厅热门卡片）---- */
body[data-page="allgames"] .ag-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
body[data-page="allgames"] .ag-card {
  position: relative; aspect-ratio: 283/174; border-radius: 10px; overflow: hidden;
  border: 2px solid rgba(246,206,96,0.9); background: #0b2a5c; cursor: pointer; padding: 0;
}
body[data-page="allgames"] .ag-img { width: 100%; height: 100%; object-fit: cover; display: block; }
body[data-page="allgames"] .ag-fb {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; padding: 4px; text-align: center;
}
body[data-page="allgames"] .ag-badge {
  position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.62); color: #ffd98a;
  font-size: 8px; font-weight: 800; padding: 1px 5px; border-radius: 6px; max-width: 54%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
body[data-page="allgames"] .ag-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.78), transparent);
  color: #ffd76a; font-size: 10px; font-weight: 800; padding: 12px 4px 4px; text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}

/* ---- 左上角爱心 ---- */
body[data-page="allgames"] .ag-heart {
  position: absolute; left: 3px; top: 3px; z-index: 3; width: 24px; height: 24px;
  border: none; cursor: pointer; padding: 0; border-radius: 50%;
  background: rgba(0,0,0,.42); display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
body[data-page="allgames"] .ag-heart svg { width: 15px; height: 15px; display: block; }
body[data-page="allgames"] .ag-heart .ag-ht {
  fill: none; stroke: #ffffff; stroke-width: 2;
  transition: fill .15s ease, stroke .15s ease, transform .15s ease;
}
body[data-page="allgames"] .ag-heart.faved .ag-ht { fill: #ff4d6d; stroke: #ff4d6d; }
body[data-page="allgames"] .ag-heart.faved { background: rgba(0,0,0,.5); }
body[data-page="allgames"] .ag-heart:active svg { transform: scale(1.25); }

/* ---- 空态 / 加载（复用 home.css 的 .g-loading/.g-empty 文案容器）---- */
body[data-page="allgames"] .ag-grid .g-empty,
body[data-page="allgames"] .ag-grid .g-loading {
  grid-column: 1 / -1; text-align: center; color: #9fb4da; font-size: 13px; padding: 30px 0;
}

/* ---- 页面背景：城堡竞技场（仅全部游戏页，置于壳内、不随内容滚动）---- */
body[data-page="allgames"] .phone-shell {
  background: #15214e url("/assets/skin/allgames-bg.jpg") center top / cover no-repeat;
}
/* 内容区顶部轻微压暗，保证标题/搜索/品牌字在亮处也清晰（下方留白透出城堡） */
body[data-page="allgames"] .content {
  background: linear-gradient(180deg, rgba(8,14,38,.42) 0%, rgba(8,14,38,.18) 22%, rgba(8,14,38,0) 46%);
}
