/* Sprunki 游戏列表：主栏宽度与游戏单页 .GAME-main 一致（1000px + 与 game.css 相同左右 padding） */
.GAMES-main {
  margin: 0 auto;
  max-width: 1000px;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}
@media (max-width: 1020px) {
  .GAMES-main { padding: 0 12px; }
}

/* 图标栅格：桌面一行 6 个；窄屏与 game 页 .GAME-newgames-grid 断点风格接近 */
.GAMES-icon-grid {
  display: grid;
  width: 100%;
  gap: 0.75rem;
  align-items: start;
  justify-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 520px) {
  .GAMES-icon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .GAMES-icon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.875rem; }
}
@media (min-width: 1024px) {
  .GAMES-icon-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
}

/* 单格卡片：上图标 + 下标题 */
.GAMES-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--game-tile-border, #2e4469);
  background: #12121c;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.07);
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
}
.GAMES-tile:hover {
  transform: translateY(-2px);
  border-color: var(--game-tile-border-hover, #3a5280);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.09);
}
.GAMES-tile__thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  background: rgba(24, 24, 27, 0.88);
  overflow: hidden;
}
.GAMES-tile__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* 游戏名显示在图标下方（长标题最多 3 行，避免半截字） */
.GAMES-tile__title {
  box-sizing: border-box;
  margin: 0;
  padding: 0.45rem 0.35rem 0.55rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f9fafb;
  line-height: 1.3;
  min-height: 3.9em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  word-break: break-word;
  overflow-wrap: anywhere;
  /* 覆盖全局 h2 渐变透明字，防止长标题裁切异常 */
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: #f9fafb !important;
}
@media (min-width: 640px) {
  .GAMES-tile__title { font-size: 0.78rem; padding: 0.5rem 0.4rem 0.6rem; }
}
@media (min-width: 1024px) {
  .GAMES-tile__title { font-size: 0.8125rem; line-height: 1.28; min-height: 3.84em; }
}
.GAMES-tile__badge {
  pointer-events: none;
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  z-index: 2;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(5, 150, 105, 0.95);
  padding: 0.2rem 0.45rem;
  border-radius: 0.2rem;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 列表页中间广告占位条（与图标区无关，同属 games 页样式） */
.GAMES-page-adslot {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.GAMES-section { padding: 28px 0 48px; }

.GAMES-heading {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
@media (min-width: 640px) {
  .GAMES-heading { font-size: 2rem; margin-bottom: 16px; }
}

.GAMES-intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 auto 32px;
  max-width: 640px;
  text-align: center;
  padding: 18px 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}
.GAMES-intro p { margin: 0 0 0.75em; }
.GAMES-intro p:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .GAMES-intro { padding: 14px 18px; margin-bottom: 28px; font-size: 0.9375rem; }
}

.GAMES-empty { text-align: center; color: var(--text-secondary); font-size: 16px; margin: 0; }

/* Article content below the game grid */
.GAMES-article {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--card-border, #2A3A5B);
}
.GAMES-article-section {
  margin-bottom: 2.25rem;
}
.GAMES-article-section:last-child {
  margin-bottom: 0;
}
.GAMES-article-h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading-color, #F3F4F6);
  margin: 0 0 0.75rem;
  line-height: 1.3;
}
@media (min-width: 640px) {
  .GAMES-article-h2 { font-size: 1.3rem; }
}
.GAMES-article p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-secondary, #B3B7C5);
  margin: 0 0 0.9em;
}
.GAMES-article p:last-child { margin-bottom: 0; }
.GAMES-faq {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.GAMES-faq dt {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--heading-color, #F3F4F6);
  margin: 1rem 0 0.2rem;
  padding: 0;
}
.GAMES-faq dt:first-child { margin-top: 0; }
.GAMES-faq dd {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary, #B3B7C5);
  margin: 0;
  padding: 0;
}
@media (max-width: 640px) {
  .GAMES-article { margin-top: 2rem; padding-top: 1.5rem; }
  .GAMES-article-h2 { font-size: 1.1rem; }
  .GAMES-article p, .GAMES-faq dd { font-size: 0.9rem; }
}

/* ── 通用区块标题 ── */
.GAMES-screenshots-section,
.GAMES-videos-section,
.GAMES-howto-section {
  margin: 2.5rem 0 0;
  padding: 2rem 0 0;
  border-top: 1px solid rgba(255,255,255,.07);
}
.GAMES-section-h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading-color, #F3F4F6);
  margin: 0 0 0.35rem;
}
.GAMES-section-desc {
  font-size: 0.9rem;
  color: var(--text-secondary, #B3B7C5);
  margin: 0 0 1.25rem;
}

/* ── Screenshots 网格 ── */
.GAMES-ss-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 0.75rem;
}
@media (max-width: 767px) { .GAMES-ss-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 420px) { .GAMES-ss-grid { grid-template-columns: repeat(1, minmax(0,1fr)); } }

.GAMES-ss-item {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 0.6rem;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.GAMES-ss-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  border-color: rgba(255,255,255,.2);
}
.GAMES-ss-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: rgba(255,255,255,.04);
}
.GAMES-lazy-img:not([src]) {
  min-height: 1px;
}
.GAMES-ss-label {
  display: block;
  padding: 0.4rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text, #F3F4F6);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(0,0,0,.3);
}

/* ── Lightbox ── */
.GAMES-lb {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  box-sizing: border-box;
}
.GAMES-lb[hidden] { display: none; }
.GAMES-lb__img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(860px, 90vw);
  width: 100%;
}
.GAMES-lb__img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 0.5rem;
  display: block;
}
.GAMES-lb__name {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  opacity: .85;
}
.GAMES-lb__name:hover { opacity: 1; text-decoration: underline; }
.GAMES-lb__close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  opacity: .7;
  transition: opacity .15s;
  z-index: 9001;
}
.GAMES-lb__close:hover { opacity: 1; }
.GAMES-lb__arrow {
  flex-shrink: 0;
  font-size: 2.5rem;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}
.GAMES-lb__arrow:hover { background: rgba(255,255,255,.25); }
@media (max-width: 520px) {
  .GAMES-lb__arrow { width: 2.2rem; height: 2.2rem; font-size: 1.8rem; }
}

/* ── YouTube 视频网格 ── */
.GAMES-yt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1rem;
}
@media (max-width: 480px) { .GAMES-yt-grid { grid-template-columns: repeat(1, minmax(0,1fr)); } }

.GAMES-yt-item {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 0.65rem;
  overflow: hidden;
  transition: box-shadow .18s, border-color .18s;
}
.GAMES-yt-item:hover { box-shadow: 0 6px 20px rgba(0,0,0,.3); border-color: rgba(255,255,255,.18); }
.GAMES-yt-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16/9;
}
.GAMES-yt-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: rgba(255,255,255,.04);
  transition: transform .2s ease;
}
.GAMES-yt-thumb:hover .GAMES-yt-img { transform: scale(1.04); }
.GAMES-yt-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: .9;
  transition: opacity .15s, transform .15s;
}
.GAMES-yt-play svg { filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }
.GAMES-yt-thumb:hover .GAMES-yt-play { opacity: 1; transform: scale(1.08); }
.GAMES-yt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
}
.GAMES-yt-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #F3F4F6);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.GAMES-yt-title:hover { color: #fff; text-decoration: underline; }
.GAMES-yt-cta {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-yellow, #f0b429);
  text-decoration: none;
  white-space: nowrap;
}
.GAMES-yt-cta:hover { text-decoration: underline; }

/* ── How to Play 步骤 ── */
.GAMES-howto-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.GAMES-howto-step {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 0.65rem;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  color: var(--text, #F3F4F6);
  line-height: 1.55;
}
.GAMES-howto-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--brand-yellow, #f0b429);
  color: #0a0a0a;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}
.GAMES-howto-step strong { color: #fff; }
@media (max-width: 520px) {
  .GAMES-howto-step { font-size: 0.88rem; padding: 0.75rem 0.85rem; }
  .GAMES-section-h2 { font-size: 1.15rem; }
}
