/* Backgammon Game Classic — shared site styles
   Palette derived from the app-icon direction (natural beech board,
   espresso points, red dice) so the site and the icon read as one brand. */

:root {
  /* Palette sampled directly from the approved App Store screenshot set,
     so the site and the screenshots read as one brand. */
  --cream: #EEF1F8;        /* page background — soft cool tint, not stark white */
  --walnut: #1B2A54;       /* primary text, headings, dark cards — sampled navy */
  --espresso: #4B547E;     /* secondary text — muted navy-gray */
  --dice-red: #FFC230;     /* accent, CTA, stat highlights — sampled gold */
  --gold: #FFC230;         /* stars, highlights */
  --white: #FFFFFF;
  --cream-2: #E2E9F5;      /* card / stripe background — pale blue */
  --link: #2E4FA3;         /* readable link color — gold fails contrast on light bg */
  --shadow: 0 8px 24px rgba(27, 42, 84, 0.10);
  --radius: 14px;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--walnut);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--walnut);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Header */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: var(--max);
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Poppins', sans-serif; font-weight: 600; color: var(--walnut); font-size: 1.05rem; }
.brand img { width: 40px; height: 40px; border-radius: 10px; display: block; }
nav.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
nav.site-nav a { color: var(--espresso); font-weight: 500; font-size: 0.95rem; }
nav.site-nav a:hover { color: var(--link); text-decoration: none; }

/* Point-motif divider — echoes the board's triangular points instead of a generic rule */
.points-divider {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 56px 0 40px;
  opacity: 0.9;
}
.points-divider svg { width: 220px; height: 22px; }

/* Hero */
.hero {
  text-align: center;
  padding: 40px 24px 20px;
  max-width: 760px;
  margin: 0 auto;
}
.hero img.icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.hero .tagline { font-size: 1.2rem; color: var(--espresso); max-width: 560px; margin: 0 auto 22px; }
.stars { color: var(--gold); font-size: 1.3rem; letter-spacing: 2px; margin-bottom: 18px; }
.store-badges { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 22px 0 14px; }
.store-badges img { height: 48px; }
.hero .subline { color: var(--espresso); font-size: 0.95rem; }

/* Fair-dice trust banner — the signature element */
.fair-dice-banner {
  max-width: var(--max);
  margin: 44px auto;
  padding: 28px 32px;
  background: var(--walnut);
  color: var(--cream);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.fair-dice-banner .stat {
  font-family: 'Poppins', sans-serif;
  color: var(--gold);
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--gold);
  border-radius: 50%;
  width: 150px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
  padding: 8px;
  box-sizing: border-box;
}
.fair-dice-banner .stat .stat-num { font-size: 2rem; font-weight: 700; white-space: nowrap; }
.fair-dice-banner .stat .stat-pct { font-size: 1.1rem; font-weight: 600; }
.fair-dice-banner .stat .stat-label { display:block; margin-top: 6px; font-size: 0.72rem; font-weight: 500; color: #C9D2EA; text-transform: uppercase; letter-spacing: 0.03em; }
.fair-dice-banner .copy h3 { color: var(--cream); margin-bottom: 6px; }
.fair-dice-banner .copy p { color: #D9CBB0; margin: 0; }

/* Features grid */
.features {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--dice-red);
}
.feature-card .glyph { font-size: 1.6rem; margin-bottom: 10px; display: block; }
.feature-card p { color: var(--espresso); margin: 0; font-size: 0.97rem; }

/* Section headers */
.section { max-width: var(--max); margin: 64px auto; padding: 0 24px; }
.section-intro { max-width: 620px; margin: 0 auto 36px; text-align: center; }
.section-intro p { color: var(--espresso); }

/* Screenshots */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  justify-items: center;
}
.shots figure { margin: 0; text-align: center; max-width: 280px; width: 100%; }
.shots img { width: 100%; border-radius: 18px; box-shadow: var(--shadow); }
.shots figcaption { margin-top: 10px; font-size: 0.9rem; color: var(--espresso); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--cream-2); padding: 20px 0; }
.faq-item h3 { margin-bottom: 8px; }
.faq-item p { color: var(--espresso); margin: 0; }

/* Guide TOC links row (homepage teaser) */
.guide-links { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: center; margin: 26px 0; }
.guide-links a {
  background: var(--cream-2);
  color: var(--walnut);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
}
.guide-links a:hover { background: var(--gold); color: var(--walnut); text-decoration: none; }

/* Buttons */
.btn-cta {
  display: inline-block;
  background: var(--gold);
  color: var(--walnut) !important;
  font-weight: 700;
  padding: 14px 30px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.btn-cta:hover { background: #E6AC1F; text-decoration: none; }

/* CTA band */
.cta-band {
  text-align: center;
  background: var(--cream-2);
  border-radius: var(--radius);
  max-width: var(--max);
  margin: 64px auto;
  padding: 48px 24px;
}

/* Footer */
footer.site {
  border-top: 1px solid var(--cream-2);
  margin-top: 60px;
  padding: 32px 24px 40px;
  text-align: center;
  color: var(--espresso);
  font-size: 0.88rem;
}
footer.site .flinks { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
footer.site a { color: var(--espresso); }
footer.site a:hover { color: var(--link); }

/* Tables (how-to-play, comparison) */
table.g-table { width: 100%; border-collapse: collapse; margin: 20px 0; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.g-table th, table.g-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--cream-2); font-size: 0.95rem; }
table.g-table th { background: var(--walnut); color: var(--cream); font-family: 'Poppins', sans-serif; font-weight: 600; }
table.g-table tr:last-child td { border-bottom: none; }

/* Guide page layout */
.guide-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 48px; max-width: var(--max); margin: 40px auto; padding: 0 24px; align-items: start; }
.toc { position: sticky; top: 24px; background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.toc h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--espresso); margin-bottom: 12px; }
.toc ol { margin: 0; padding-left: 20px; font-size: 0.92rem; }
.toc li { margin-bottom: 8px; }
.guide-body h2 { margin-top: 2.2em; scroll-margin-top: 20px; }
.guide-body h3 { margin-top: 1.6em; scroll-margin-top: 20px; }
.callout {
  background: var(--white);
  border-left: 4px solid var(--dice-red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.95rem;
}
.callout strong { color: var(--walnut); }
@media (max-width: 820px) {
  .guide-wrap { grid-template-columns: 1fr; }
  .toc { position: static; }
}

/* Breadcrumb */
.crumb { max-width: var(--max); margin: 18px auto 0; padding: 0 24px; font-size: 0.88rem; color: var(--espresso); }
.crumb a { color: var(--espresso); }
