:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --border: #ececec;
  --text: #1c1c1c;
  --muted: #6b7280;
  --green: #0ea04b;
  --green-hover: #0b8a40;
  --green-deep: #167a3a;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 12px;
  --light-sq: #f3e6c8;
  --dark-sq: #8b5a2b;
  --blue: #2f6dff;
  --red: #d62828;
  --move: rgba(14, 160, 75, 0.88);
  --select: #f4c430;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, Tahoma, sans-serif;
}

body {
  min-height: 100vh;
}

.page {
  width: min(1080px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 40px;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.hero-icon {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  object-fit: cover;
  background: #111;
}

.hero-copy h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
}

.hero-dev,
.hero-version {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.btn-download,
.btn-bazaar,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}

.btn-download {
  min-width: 116px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 1rem;
}

.btn-download:hover { background: var(--green-hover); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  background: #f8f8f8;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.stat strong {
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 14px;
}

.grid h2,
.desc-card h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.muted {
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}

.screenshot-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.screenshot-row img {
  width: 148px;
  height: 264px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #eee;
  flex: 0 0 auto;
}

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.game-head h2 { margin: 0; }

.btn-ghost {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--text);
}

.game-status {
  margin: 0 0 12px;
  color: var(--muted);
  min-height: 1.5em;
}

.board {
  width: min(100%, 420px);
  margin: 0 auto;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: 10px;
  overflow: hidden;
  border: 6px solid #3b2414;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.sq {
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  user-select: none;
}

.sq.light { background: var(--light-sq); }
.sq.dark { background: var(--dark-sq); }
.sq.selected { box-shadow: inset 0 0 0 3px var(--select); }
.sq.hint::after {
  content: "";
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: var(--move);
}
.sq.capture::after {
  width: 34%;
  height: 34%;
  background: transparent;
  border: 3px solid #ffd166;
}

.piece {
  width: 72%;
  height: 72%;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.piece.blue { background: radial-gradient(circle at 32% 28%, #8fb4ff, var(--blue) 55%, #163b9c); }
.piece.red { background: radial-gradient(circle at 32% 28%, #ff8d8d, var(--red) 55%, #7a1010); }
.piece.king::before {
  content: "♔";
  display: grid;
  place-items: center;
  height: 100%;
  color: #fff7d6;
  font-size: 1.1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.description {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.9;
}

.bazaar-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.btn-bazaar {
  min-height: 56px;
  padding: 0 22px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1db954 0%, var(--green-deep) 100%);
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 8px 18px rgba(14, 160, 75, 0.22);
}

.btn-bazaar img {
  width: 36px;
  height: 36px;
}

.btn-bazaar:hover { filter: brightness(1.05); }

.bazaar-hint { font-size: 0.85rem; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 0 12px;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: auto 1fr;
  }

  .btn-download {
    grid-column: 1 / -1;
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}
