:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ec;
  --accent: #111827;
  --accent-soft: #eef2ff;
  --gold: #d99a1b;
  --red: #c2410c;
  --green: #166534;
  --blue: #1d4ed8;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial,
    sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.site-header {
  height: 60px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  background: #172033;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 80;
}

.brand {
  font-size: 20px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.desktop-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.header-download,
.mobile-menu {
  display: none;
}

main {
  padding: 28px 18px 0;
}

.home-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.home-top {
  padding: 22px 24px;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(17, 24, 39, 0.05) 1px, transparent 1px), #fbfcff;
  background-size: 18px 18px;
  border-bottom: 1px solid var(--line);
}

.home-top h1 {
  margin: 0 0 4px;
  font-size: 34px;
  line-height: 1.15;
}

.home-top p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.client-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #fff7e6;
  border-bottom: 1px solid #f1d39b;
  color: #68430d;
}

.client-notice.hidden {
  display: none;
}

.client-notice-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f4d792;
  color: #6b4405;
  font-size: 18px;
  font-weight: 900;
}

.client-notice p {
  margin: 0;
  min-width: 0;
}

.client-notice a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--gold);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.client-notice-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: rgba(104, 67, 13, 0.1);
  color: #68430d;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.chess-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 16px;
}

.chess-card {
  min-height: 108px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 0.18s,
    transform 0.18s,
    box-shadow 0.18s;
}

.chess-card:hover,
.chess-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.1);
  outline: none;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.card-icon.gomoku {
  background: #111827;
}

.card-icon.snake {
  background: #15803d;
}

.card-icon.mine {
  background: #0f8b8d;
}

.card-icon.block {
  background: #1d4ed8;
}

.card-icon.tile {
  background: #f59e0b;
  font-size: 16px;
}

.card-icon.sudoku {
  background: #2f6f9f;
}

.card-icon.spider {
  background: #1f7a5c;
}

.card-icon.link {
  background: #0f8b8d;
}

.card-icon.xiangqi {
  background: var(--red);
}

.card-icon.weiqi {
  background: var(--green);
}

.card-icon.chess {
  background: var(--blue);
}

.card-icon.reversi {
  background: #0f766e;
}

.card-icon.checkers {
  background: #9f1239;
}

.card-icon.tic {
  background: #7c2d12;
}

.chess-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.chess-card b {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
}

.content-page {
  width: min(980px, 100%);
  margin: 28px auto 0;
  padding: 0 18px;
}

.content-page article {
  margin-bottom: 18px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content-page h1,
.content-page h2 {
  margin: 0 0 10px;
  line-height: 1.25;
}

.content-page h1 {
  font-size: 32px;
}

.content-page h2 {
  margin-top: 24px;
  font-size: 23px;
}

.content-page p,
.content-page li {
  color: var(--muted);
}

.content-page a {
  color: var(--accent);
  font-weight: 800;
}

.game-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.game-card {
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  text-decoration: none;
}

.game-card:hover,
.game-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.game-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.game-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.game-card-icon.snake {
  background: #15803d;
}

.game-card-icon.mine {
  background: #0f8b8d;
}

.game-card-icon.block {
  background: #172033;
}

.game-card-icon.gomoku {
  background: #111827;
}

.game-card-icon.spider {
  background: #166534;
}

.game-card-icon.tile {
  background: #2563eb;
  font-size: 12px;
}

.game-card-icon.jump {
  background: #d93a2f;
}

.game-card-icon.sudoku {
  background: #2f6f9f;
}

.game-card-icon.match {
  background: #e11d48;
}

.game-card-icon.link {
  background: #0f8b8d;
}

.game-card-icon.word {
  background: #7c3aed;
}

.game-card-icon.box {
  background: #d99a1b;
}

.site-footer {
  margin-top: 34px;
  padding: 22px 18px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 6px 0;
}

.site-footer a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 700px) {
  .site-header {
    height: 48px;
    grid-template-columns: minmax(0, 1fr) auto 40px;
    gap: 6px;
    padding: 0 8px;
  }

  .brand {
    font-size: 17px;
  }

  .desktop-nav {
    display: none;
  }

  .header-download {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 6px;
    background: #fff7e6;
    color: #68430d;
    border: 1px solid #e5c16b;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
  }

  .mobile-menu {
    display: block;
    position: relative;
  }

  .mobile-menu summary {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    list-style: none;
  }

  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu span {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 2px;
    background: #fff;
  }

  .mobile-menu nav {
    position: fixed;
    top: 48px;
    right: 8px;
    z-index: 90;
    width: min(220px, calc(100vw - 16px));
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
    background: #172033;
    box-shadow: var(--shadow);
  }

  .mobile-menu:not([open]) nav {
    display: none;
  }

  .mobile-menu nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
  }

  main {
    padding: 8px 8px 0;
  }

  .home-shell {
    overflow: visible;
  }

  .home-top {
    gap: 12px;
    padding: 16px 12px;
  }

  .home-top h1 {
    font-size: 28px;
  }

  .home-top p {
    font-size: 14px;
  }

  .client-notice {
    display: none;
  }

  .chess-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .chess-card {
    position: relative;
    min-height: 94px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px 76px 12px 12px;
  }

  .card-icon {
    width: 46px;
    height: 46px;
    font-size: 20px;
  }

  .chess-card strong {
    font-size: 19px;
  }

  .chess-card b {
    position: absolute;
    top: 10px;
    right: 10px;
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  .content-page {
    margin-top: 14px;
    padding: 0 10px;
  }

  .content-page article {
    padding: 20px;
  }

  .content-page h1 {
    font-size: 26px;
  }

  .game-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .game-card {
    min-height: 54px;
    padding: 8px;
  }

  .game-card-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .game-card strong {
    font-size: 15px;
  }

  .site-footer {
    margin-top: 20px;
    padding: 18px 12px;
    font-size: 13px;
  }
}
