/* Chess uses the same palette, typography, and surfaces as the main landing. */
:root {
  color-scheme: dark;
  --bg: #0b0d0c;
  --bg-secondary: #101411;
  --card: #151a16;
  --text: #f4f7f2;
  --text-secondary: #aeb9ae;
  --accent: #9ed36a;
  --line: rgba(231, 242, 227, 0.1);
  --gradient-primary: linear-gradient(135deg, #a8db76 0%, #7db24d 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  background: radial-gradient(circle at 82% 4%, rgba(137, 185, 91, 0.1), transparent 28rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: 4px; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid #b5e289;
  outline-offset: 5px;
}
.container { width: min(100% - 48px, 1180px); margin-inline: auto; }
.skip-link { position: absolute; top: -80px; left: 24px; z-index: 2; }
.skip-link:focus { top: 12px; padding: 12px; background: var(--card); }
.bg-grid {
  position: absolute;
  inset: 0 0 auto;
  height: min(900px, 100vh);
  background-image: linear-gradient(90deg, rgba(213, 232, 204, 0.022) 1px, transparent 1px), linear-gradient(rgba(213, 232, 204, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000, transparent 92%);
  pointer-events: none;
}
.site-header { position: relative; padding-top: 26px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand::before {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid rgba(214, 239, 190, 0.24);
  border-radius: 8px;
  background: conic-gradient(from 90deg, var(--accent) 0 25%, #243021 0 50%, var(--accent) 0 75%, #243021 0);
  content: "";
}
#lang-suggestion-root { position: sticky; top: 0; z-index: 40; width: 100%; background: #f8f6f2; border-bottom: 1px solid rgba(87, 73, 56, 0.14); }
#lang-suggestion-root[hidden] { display: none; }
.lang-suggestion { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "content close"; align-items: center; gap: 0 16px; width: min(1280px, 100%); margin-inline: auto; padding: calc(env(safe-area-inset-top, 0px) + 9px) 20px 9px; background: #edf1e9; color: #252b23; opacity: 0; transform: translateY(-12px); transition: opacity 0.22s ease, transform 0.22s ease; }
#lang-suggestion-root.is-visible .lang-suggestion { opacity: 1; transform: translateY(0); }
.lang-suggestion__content { grid-area: content; min-width: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.lang-suggestion__title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.28; letter-spacing: -0.01em; }
.lang-suggestion__text { margin: 0; font-size: 13px; line-height: 1.45; color: #5a6557; }
.lang-suggestion__link { color: #476d2e; font-size: inherit; font-weight: 700; text-decoration: none; }
.lang-suggestion__link:hover, .lang-suggestion__link:focus-visible { color: #244f87; text-decoration: underline; }
.lang-suggestion__close { grid-area: close; align-self: center; justify-self: end; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: rgba(47, 42, 36, 0.44); font-size: 28px; line-height: 1; cursor: pointer; }
.lang-suggestion__close:hover, .lang-suggestion__close:focus-visible { background: rgba(47, 42, 36, 0.08); color: #252b23; }
.hero { position: relative; padding: 64px 0 84px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.86fr);
  grid-template-areas: "content board" "content reviews";
  column-gap: clamp(52px, 7vw, 100px);
  row-gap: 18px;
  align-items: center;
}
.hero-content { grid-area: content; min-width: 0; }
.hero h1 {
  margin-bottom: 22px;
  font-size: clamp(48px, 5.4vw, 70px);
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 0.99;
  text-wrap: balance;
}
.hero h1::after {
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin-left: 0.065em;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}
.hero-subtitle { margin-bottom: 32px; color: var(--text-secondary); font-size: clamp(17px, 1.6vw, 19px); line-height: 1.65; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border: 1px solid rgba(228, 252, 204, 0.36);
  border-radius: 12px;
  background: var(--gradient-primary);
  color: #14200f;
  font-weight: 720;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.hero-play-button { width: min(100%, 268px); min-height: 56px; margin-bottom: 28px; border-radius: 14px; font-size: 17px; }
.stats { display: flex; flex-wrap: wrap; gap: 9px; }
.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #c3ccc2;
  font-size: 12px;
}
.stat-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(158, 211, 106, 0.11); font-size: 14px; }
.hero-note { margin-top: 20px; color: var(--text-secondary); font-size: 13px; }
.app-store-download { --store-badge-height: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 22px; }
.app-store-download__link { display: inline-flex; height: var(--store-badge-height); width: auto; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; background: #060706; line-height: 0; }
.app-store-download__link img { display: block; width: auto; height: 100%; }
.hero-reviews { grid-area: reviews; min-width: 0; width: 100%; max-width: 500px; margin: 0; }
.reviews-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-height: 58px; padding: 11px 12px 11px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(21, 26, 22, 0.9); }
.reviews-summary-main { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.reviews-summary-stars { color: #ffd166; font-size: 0.95rem; letter-spacing: 1px; line-height: 1; }
.reviews-summary-value { color: var(--text); font-weight: 700; font-size: 0.86rem; }
.reviews-summary-divider { color: rgba(255, 255, 255, 0.45); }
.reviews-summary-count { color: var(--text-secondary); font-size: 0.86rem; }
.reviews-toggle-btn { min-height: 36px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.04); color: var(--text); font: inherit; font-size: 0.8rem; font-weight: 700; line-height: 1.4; cursor: pointer; }
.reviews-toggle-btn:hover { background: rgba(255, 255, 255, 0.08); }
.reviews-toggle-btn:disabled { cursor: wait; opacity: 0.75; }
.board-showcase { grid-area: board; min-width: 0; max-width: 500px; }
.board-showcase picture { display: block; }
.board-showcase img { display: block; width: 100%; height: auto; filter: saturate(0.88) contrast(1.04); }
.piece { display: block; width: 100%; height: 100%; background-image: url('/images/chess/pieces-classic.webp'); background-size: 600% 200%; background-repeat: no-repeat; }
.piece.k { background-position-x: 0%; }
.piece.q { background-position-x: 20%; }
.piece.b { background-position-x: 40%; }
.piece.n { background-position-x: 60%; }
.piece.r { background-position-x: 80%; }
.piece.p { background-position-x: 100%; }
.piece.black { background-position-y: 100%; }
.section { padding: 88px 0; }
.features-section, .pieces-section, .faq-section { background: var(--bg-secondary); border-block: 1px solid var(--line); }
.section-header { max-width: 760px; margin: 0 auto 42px; text-align: center; }
.section-label { margin-bottom: 14px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: 0.16em; text-transform: uppercase; }
.section-title { margin-bottom: 16px; font-size: clamp(34px, 4vw, 48px); font-weight: 750; letter-spacing: -0.045em; line-height: 1.1; text-wrap: balance; }
.section-subtitle { color: var(--text-secondary); font-size: 17px; }
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-card, .mode-card, .piece-card { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 26px; border: 1px solid rgba(158, 211, 106, 0.14); border-radius: 13px; background: rgba(158, 211, 106, 0.07); font-size: 23px; }
.feature-card h3, .mode-card h3, .piece-card h3 { margin-bottom: 10px; font-size: 19px; font-weight: 700; letter-spacing: -0.025em; }
.feature-card p, .mode-card p, .piece-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.75; }
.mode-card { display: flex; flex-direction: column; }
.mode-number { margin-bottom: 24px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.mode-card p { flex: 1; margin-bottom: 24px; }
.mode-card a { align-self: flex-start; font-size: 14px; font-weight: 650; text-decoration: none; }
.mode-card a:hover { text-decoration: underline; }
.mode-note { margin: 24px auto 0; color: var(--text-secondary); text-align: center; font-size: 13px; }
.piece-art { width: 68px; height: 68px; margin-bottom: 20px; border-radius: 12px; background: #96724f; }
.piece-card .piece { width: 100%; height: 100%; }
.seo-content { display: grid; gap: 20px; max-width: 920px; margin-inline: auto; }
.seo-card { padding: 34px 38px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.seo-card h3 { margin-bottom: 18px; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; }
.seo-card p, .seo-card li { color: var(--text-secondary); font-size: 15px; line-height: 1.85; }
.seo-card p + p, .seo-card p + ol, .seo-card li + li { margin-top: 14px; }
.seo-card strong { color: var(--text); font-weight: 650; }
.seo-card ol { padding-left: 22px; }
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.faq-item { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.faq-item summary { position: relative; padding: 22px 48px 22px 24px; list-style: none; cursor: pointer; font-size: 15px; font-weight: 650; line-height: 1.5; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { position: absolute; top: 21px; right: 23px; color: var(--accent); font-size: 21px; font-weight: 400; content: "+"; }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 24px 23px; color: var(--text-secondary); font-size: 14px; line-height: 1.8; }
.cta-wrap { padding-block: 70px; }
.cta-section { padding: 58px 36px; border: 1px solid rgba(158, 211, 106, 0.2); border-radius: 24px; background: radial-gradient(ellipse at top, rgba(158, 211, 106, 0.09), transparent 80%), var(--card); text-align: center; }
.cta-section h2 { margin-bottom: 16px; font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.045em; line-height: 1.15; }
.cta-section p { margin-bottom: 27px; color: var(--text-secondary); }
.footer { padding: 44px 0; border-top: 1px solid var(--line); text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; }
.footer a { color: var(--text-secondary); font-size: 13px; text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }
.footer p { margin-top: 24px; color: var(--text-secondary); font-size: 12px; }
.footer-legal { margin-top: 18px; }
.footer-consent { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 16px; font-size: 12px; }
.footer-languages { margin-top: 28px; }
.footer-languages p { margin-top: 0; margin-bottom: 14px; }
.language-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.language-links a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; }
.language-links a[aria-current="page"] { color: var(--accent); border-color: rgba(158, 211, 106, 0.4); }
.hero h1, .section-title { overflow-wrap: anywhere; }
[dir="rtl"] .brand { direction: ltr; }
[dir="rtl"] .faq-item summary { padding-right: 24px; padding-left: 48px; }
[dir="rtl"] .faq-item summary::after { right: auto; left: 23px; }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(100, 147, 62, 0.2); }
}
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr); gap: 36px; }
  .hero h1 { font-size: clamp(44px, 5.6vw, 60px); }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .lang-suggestion { align-items: flex-start; gap: 0 10px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px 16px; }
  .lang-suggestion__content { display: block; white-space: normal; }
  .lang-suggestion__title { font-size: 14px; line-height: 1.24; }
  .lang-suggestion__text { margin-top: 6px; }
  .lang-suggestion__close { font-size: 26px; }
  .hero-grid { grid-template-columns: 1fr; grid-template-areas: "content" "board" "reviews"; gap: 28px; }
  .hero-content { max-width: 620px; }
  .hero h1 { max-width: 620px; font-size: clamp(44px, 8vw, 60px); }
  .board-showcase { width: 100%; max-width: 500px; margin-inline: auto; }
  .hero-reviews { margin-inline: auto; }
  .hero { padding-top: 48px; }
  .faq-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .container { width: min(100% - 32px, 560px); }
  .bg-grid { display: none; }
  .site-header { padding-top: 18px; }
  .header-inner { flex-wrap: wrap; row-gap: 14px; }
  .brand { font-size: 17px; }
  .hero { padding: 38px 0 58px; }
  .hero h1 { font-size: clamp(38px, 12vw, 52px); }
  .hero-subtitle { margin-bottom: 26px; font-size: 16px; }
  .hero-play-button { width: 100%; min-height: 54px; margin-bottom: 24px; font-size: 16px; }
  .hero-grid { gap: 32px; }
  .stats { gap: 7px; }
  .stat-item { font-size: 11px; }
  .app-store-download { --store-badge-height: 38px; gap: 8px; }
  .reviews-summary { align-items: flex-start; padding: 13px; }
  .reviews-toggle-btn { width: 100%; }
  .section { padding: 68px 0; }
  .section-header { margin-bottom: 32px; text-align: left; }
  .section-title { font-size: clamp(32px, 10vw, 42px); }
  .section-subtitle { font-size: 16px; }
  .cards-grid { grid-template-columns: 1fr; }
  .feature-card, .mode-card, .piece-card { padding: 23px; }
  .feature-icon { margin-bottom: 22px; }
  .mode-note { text-align: left; }
  .seo-card { padding: 24px 21px; }
  .seo-card h3 { font-size: 21px; }
  .seo-card p, .seo-card li { font-size: 15px; }
  .faq-item summary { padding-left: 21px; }
  .faq-answer { padding-inline: 21px; }
  .cta-wrap { padding-block: 44px; }
  .cta-section { padding: 44px 22px; border-radius: 20px; text-align: left; }
  .cta-section .btn { width: 100%; }
  [dir="rtl"] .section-header,
  [dir="rtl"] .mode-note,
  [dir="rtl"] .cta-section { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
