/* Shared look of the site's static pages: the blog, and the home description
   and game guides that the app serves as HTML.

   The values mirror the app's design tokens in client/lib/style/tokens.dart;
   change both together. Served at a stable URL that nginx revalidates, so
   pages can link it without a version. */

/* Bundled rather than loaded from Google Fonts, as the app bundles it too. */
@font-face {
  font-family: 'Permanent Marker';
  src: url('../fonts/PermanentMarker-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #0050bc;
  --primary-bright: #1d75fb;
  --primary-light: #e8f0fe;
  --bg: #F0E6FF;
  --bg-card: #fff;
  --ink: #352b42;
  --ink-muted: #6b5f7a;
  --border: #d8cfe6;
  --max-width: 720px;
  --heading-font: 'Permanent Marker', cursive;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* --primary-bright on --bg is 3.9:1, below WCAG AA for body text. */
a {
  color: var(--primary);
}

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

/* --- Header --- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.site-header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--heading-font);
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--primary);
  text-decoration: none;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.logo img {
  display: block;
}

.site-header nav > a:not(.logo):not(.cta-button):not(.lang-switch) {
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
}

.site-header nav > a:not(.logo):not(.cta-button):not(.lang-switch):hover {
  color: var(--primary-bright);
}

.lang-switch {
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
}

.lang-switch:hover {
  color: var(--primary-bright);
}

.cta-button {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, var(--primary-bright), var(--primary));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 80, 188, 0.25);
  transition: opacity 0.15s, box-shadow 0.15s;
}

.cta-button:hover {
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(0, 80, 188, 0.35);
  color: #fff;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  margin-top: 3rem;
}

.footer-games {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.footer-games a {
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
}

.footer-games a:hover {
  color: var(--primary-bright);
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

@media (max-width: 480px) {
  .footer-games {
    gap: 0.5rem;
  }
}

/* --- App static pages ---
   The home description and the game guides, which sit below the app in the
   same document and are shown in its place by game-guide.js. */
.seo {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

.seo h1 {
  font-family: var(--heading-font);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.2;
  margin: 1.5rem 0 0.75rem;
}

.seo h2 {
  font-family: var(--heading-font);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

.seo h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.25rem;
}

.seo p,
.seo ul,
.seo ol {
  margin-bottom: 1rem;
}

.seo ul,
.seo ol {
  padding-left: 1.5rem;
}

/* Screenshots in a game guide, side by side where the page is wide enough.
   The shots are phone portraits, so each stays near a phone's width. */
.seo .guide-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1rem;
}

.seo .guide-shots figure {
  flex: 1 1 260px;
  max-width: 360px;
  margin: 0;
}

.seo .guide-shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.seo .guide-shots figcaption {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.seo .game-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.seo .game-grid li {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.seo .game-grid a {
  font-weight: 600;
  text-decoration: none;
}

.seo .game-grid p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

/* The header returns to the app, which needs JavaScript. */
html:not(.js) .guide-header {
  display: none;
}

.guide-header {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 -1.5rem;
  background: rgba(240, 230, 255, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.guide-header.site-header nav {
  max-width: none;
}

#show-game {
  border: 0;
}

#show-game:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
