/* Shared styles for the generated mancala.fun pages. The palette matches the
   Flutter app's loading screen so the jump into /play/ is seamless. */

:root {
  color-scheme: dark;
  --bg: #2B1D12;
  --bg-raised: #3A2818;
  --text: #E8DCC8;
  --muted: #CBB89A;
  --accent: #E9C46A;
  --accent-bright: #F5EBDD;
  --rule: #4A3421;
  /* Wood texture shared with the Flutter board, used behind the CTAs. */
  --wood-image: url("/wood.webp");
  --wood-scrim: linear-gradient(rgba(43, 29, 18, 0.55), rgba(43, 29, 18, 0.55));
  --wood-scrim-light: linear-gradient(rgba(43, 29, 18, 0.35), rgba(43, 29, 18, 0.35));
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  line-height: 1.6;
}

#site-header,
#content,
#site-footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px;
}

#site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 14px;
}

#site-header .brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  text-decoration: none;
}

#site-nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 15px;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-bright);
}

#content {
  padding-top: 8px;
  padding-bottom: 32px;
}

#content h1 {
  font-size: 30px;
  line-height: 1.25;
  margin: 18px 0 8px;
}

#content h2 {
  font-size: 21px;
  margin: 30px 0 8px;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
}

#content h3 {
  font-size: 18px;
  margin: 22px 0 6px;
}

#content p,
#content li {
  margin: 8px 0;
}

#content ul,
#content ol {
  padding-left: 22px;
}

#content pre {
  overflow-x: auto;
  padding: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

#content blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: var(--bg-raised);
  color: var(--muted);
}

#content hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 24px 0;
}

.game-type {
  margin: 4px 0 14px;
  font-size: 15px;
  color: var(--muted);
}

.lead {
  font-size: 17px;
  color: var(--muted);
}

/* Table of contents. */
.toc {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 16px 0;
}

.toc h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 4px 0 6px;
  padding-top: 0;
  border-top: 0;
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 4px 0;
}

.toc ul ul {
  padding-left: 16px;
}

.toc li {
  margin: 3px 0;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* Language switcher. */
.language-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: 14px;
  margin: 14px 0;
  padding: 8px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.language-switcher .lang-label {
  color: var(--muted);
}

.language-switcher a {
  text-decoration: none;
}

.language-switcher a:hover {
  text-decoration: underline;
}

.language-switcher .lang-current {
  color: var(--accent-bright);
  font-weight: 600;
}

/* Play call to action + Android nudge. Both sit on the app's wood texture. */
.play-button {
  display: inline-block;
  padding: 10px 18px;
  background-color: var(--bg-raised);
  background-image: var(--wood-scrim), var(--wood-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--rule);
  color: var(--accent-bright);
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
}

.play-button:hover {
  background-image: var(--wood-scrim-light), var(--wood-image);
  border-color: var(--accent);
}

.play-nudge {
  margin: 22px 0;
  padding: 16px;
  background-color: var(--bg-raised);
  background-image: var(--wood-scrim), var(--wood-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-align: center;
}

.play-nudge .nudge-lead {
  margin: 0 0 4px;
  font-weight: 600;
}

.play-nudge .nudge-body {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.play-badge img {
  height: 84px;
  width: auto;
  vertical-align: middle;
}

/* Game index listing. */
.game-index {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  gap: 6px;
}

.game-index li {
  margin: 0;
}

.game-index a {
  display: block;
  padding: 9px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-decoration: none;
}

.game-index a:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.also-known {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 8px;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 15px;
}

/* Source footer inside a rules doc. */
.doc-source {
  color: var(--muted);
  font-size: 14px;
}

#site-footer {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  padding-bottom: 30px;
  font-size: 14px;
}

#site-footer .footer-links {
  font-size: 14px;
}

#site-footer .footer-links a {
  color: var(--muted);
  text-decoration: none;
}

#site-footer .footer-links a:hover {
  color: var(--accent-bright);
  text-decoration: underline;
}

.footer-tagline {
  margin: 14px 0 6px;
  color: var(--muted);
}

.copyright {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Ad containers: hidden until content-ads.js fills a slot. */
.ad-slot {
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 60px;
}

.ad-slot[data-visible="true"] {
  display: flex;
}
