/* =========================
   Base & Resets
========================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fffef9;
  overflow-x: hidden;
}

/* 仅在标题/按钮用像素风，避免整站难读 */
h1, h2, .brand, .nav a, .cta {
  font-family: 'Press Start 2P', system-ui, sans-serif;
  letter-spacing: 0.5px;
}

/* 常用容器（桌面不至于太宽，移动端满宽） */
.container, .gallery, .hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================
   Header / Navigation
========================= */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.25rem;
  background: #222834;
}

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.logo  { height: 56px; max-width: 100%; object-fit: contain; }
@media (max-width: 768px) { .logo { height: 48px; } }

.nav {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0 0 0 auto;
  padding: 0;
}
.nav a {
  text-decoration: none;
  color: #e3eb0a;
  font-weight: 700;
}
.nav a[aria-current="page"] { text-decoration: underline; }

/* Mobile nav */
.menu-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #e3eb0a;
}
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav { display: none; flex-direction: column; width: 100%; margin: 0; }
  .nav.show { display: flex; }
}
/* 已有大部分，补上这两条以防溢出 */
.nav { max-width: 100%; }
.nav a { word-break: keep-all; white-space: nowrap; } /* 菜单项不换行时溢出→横向滚动的问题 */


/* =========================
   Hero
========================= */
.hero {
  text-align: left;
  max-width: 980px;
  margin: 0 auto;
  padding: 3.2rem 1rem 2rem;
  background: #ffecd1;
}
.hero h1 { margin: 0 0 .4rem; font-size: 2.4rem; color: #ff5e5e; }
.hero p  { margin: 0 0 1rem; font-size: 1.1rem; }

.cta {
  display: inline-block;
  padding: .7rem 1.2rem;
  border-radius: 10px;
  background: #ff5e5e;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
/* 按钮分组 */
.cta-group {
  display: flex;
  flex-wrap: wrap;      /* 小屏自动换行 */
  gap: 12px;
  margin-top: 1rem;
}

/* 次级按钮样式 */
.cta.secondary {
  background: #222834;
  color: #e3eb0a;
  border: 2px solid #e3eb0a;
}
.cta.secondary:hover,
.cta.secondary:focus-visible {
  background: #e3eb0a;
  color: #222834;
}

/* =========================
   Generic Sections
========================= */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  line-height: 1.75;
}
.section-title {
  max-width: 980px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
  font-size: 1.6rem;
  font-weight: 800;
}

/* =========================
   Gallery (Our Games / Partnered Games)
========================= */
.gallery {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .gallery { grid-template-columns: 1fr 1fr; }
}

/* 放在 .gallery 里的 h2 占满整行，与卡片对齐 */
.gallery > h2 {
  grid-column: 1 / -1;
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 .75rem;
  text-align: left;
}

/* 大图卡片（整卡可点、轻交互） */
.tile {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  border-color: #ddd;
}
/* 键盘可见态（可访问性） */
.tile:focus-visible {
  outline: 2px solid #0a66c2;
  outline-offset: 3px;
}

/* 统一比例封面：16:9，超出裁切以保证整齐 */
.tile .img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f4f4f4;
}
.tile .img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* 标题与副文案 */
.tile-caption {
  padding: .85rem 1rem 1.1rem;
  display: grid; gap: .25rem;
}
.tile-caption strong { font-size: 1.06rem; }
.tile-caption span   { font-size: .95rem; color: #555; line-height: 1.45; }

/* =========================
   Team
========================= */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.member {
  position: relative;
  display: flex;
  flex-direction: column;   /* 头像在上，文字在下 */
  align-items: flex-start;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  min-height: 380px;        /* 等高关键值，可按需微调 */
  box-sizing: border-box;
}
@media (max-width: 540px) {
  .member { min-height: 320px; }
}

.member .avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.member .info {
  flex: 1;                  /* 占满剩余空间，撑起等高 */
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: justify;      /* 简介两端对齐 */
}
.member .info h3 { margin: 0 0 4px 0; font-size: 1.1rem; }
.member .info p  { margin: 0; line-height: 1.5; }

/* 右上角 LinkedIn 按钮 */
.linkedin-badge {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #f7f7f7;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.linkedin-badge:hover,
.linkedin-badge:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  outline: none;
}

/* =========================
   Footer
========================= */
.site-footer {
  background: #222834;
  padding: 16px;
  font-size: 14px;
  color: #e3eb0a;
}
.site-footer .footer-content {
  display: flex;
  justify-content: space-between;   /* 大屏左右分布 */
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.site-footer .social-links a {
  margin-left: 12px;
  display: inline-flex;
}
.site-footer .icon {
  width: 20px; height: 20px;
  fill: currentColor;
  transition: fill 0.2s ease;
}
.site-footer .social-links a:hover .icon {
  fill: #0A66C2; /* hover 高亮（LinkedIn 蓝） */
}
/* 手机端：上下堆叠居中 */
@media (max-width: 600px) {
  .site-footer .footer-content {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 10px;
  }
  .site-footer .social-links a {
    margin: 0 8px;
  }
}

/* =========================
   Optional Utilities
========================= */
/* 像素风图片边缘不糊（用于像素画封面/截图） */
.pixel-art img, img.pixel-art {
  image-rendering: pixelated;
}
/* —— Mobile 细化断点 —— */
@media (max-width: 420px) {
  .hero {
    padding: 2rem 1rem 1.5rem;
  }
  .hero h1 { font-size: 1.8rem; }
  .hero p  { font-size: 1rem; }
  .cta { padding: .6rem 1rem; border-radius: 8px; }
}

/* gallery：保证 1 列、卡片不贴边 */
@media (max-width: 720px) {
  .gallery { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .tile-caption { padding: .75rem .9rem 1rem; }
}

/* team：降低最小高度、避免大片空白；头像更小一点更协调 */
@media (max-width: 540px) {
  .member { min-height: 320px; padding: 14px; }
  .member .avatar { width: 84px; height: 84px; margin-bottom: 10px; }
  .member .info { gap: 4px; }
}

/* footer：居中堆叠、触控更容易点中 */
@media (max-width: 600px) {
  .site-footer .footer-content { gap: 12px; }
  .site-footer .social-links a { padding: 6px; } /* 提高可点击区域 */
}
/* 通用兜底：如果某些文字/链接太长，允许断行 */
body { overflow-x: hidden; }
.hero p, .tile-caption span, .member .info p {
  overflow-wrap: anywhere;  /* 长英文/URL 允许在任意处断行 */
  word-break: break-word;
}

/* 图片/卡片绝不超过容器 */
img, .tile, .member, .hero, .gallery { max-width: 100%; }
