/* Word Burst landing site
 *
 * The landing page and the chrome around the game. Deliberately shares the game's warm,
 * ASD-friendly palette (apps/word-burst/static/styles.css): muted tones, no
 * pure black/white, rounded geometry, gentle motion. The header wordmark is
 * built from the same rounded letter tiles the player drags in the game, so
 * the page reads as one piece. Tokens are redefined here (not inherited from
 * game.css) so the chrome renders correctly even before the game stylesheet
 * loads.
 */

:root {
  --bg: #f0ece4;
  --bg-warm: #e8e2d8;
  --card-bg: #faf8f4;
  --text: #3d3832;
  --text-muted: #7a7268;
  --sage: #6b8f71;
  --accent-light: #c4b59a;
  --border: #d4cec4;
  --letter-bg: #e8e2d8;
  --radius: 14px;
  --radius-sm: 10px;
  --tile-shadow: 0 2px 6px rgba(61, 56, 50, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Header / tile wordmark ── */

.landing-header {
  text-align: center;
  padding: 2.75rem 1.5rem 1rem;
}

.wordmark {
  margin: 0 0 0.6rem;
}

.tiles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.tile-word {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  max-width: 100%;
}

.tile {
  --tile-bg: var(--letter-bg);
  --tile-text: var(--text);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 8vw, 3.3rem);
  line-height: 1;
  width: 1.3em;
  height: 1.4em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tile-text);
  background: var(--tile-bg);
  border: 2px solid var(--accent-light);
  border-radius: var(--radius);
  box-shadow: var(--tile-shadow);
  animation: tile-settle 0.5s ease both;
}

.t-clay {
  --tile-bg: var(--letter-bg);
}
.t-sage {
  --tile-bg: var(--sage);
  --tile-text: var(--card-bg);
  border-color: var(--sage);
}
.t-sand {
  --tile-bg: var(--accent-light);
}

/* Gentle settle: a slow fade and small rise, nothing sudden. */
@keyframes tile-settle {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tagline {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Embedded game ── */

.landing-game {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
}

/* ── Copy ── */

.landing-copy {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.description {
  margin: 0 0 1rem;
  padding: 1.4rem 1.6rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-muted);
  text-align: center;
  box-shadow: var(--tile-shadow);
}

/* The Play Store listing and the browser game, side by side as two buttons
   of the same size, stacking on a narrow phone. Equal flex bases, not
   fit-content, so the shorter label does not get the smaller button. */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 auto;
  max-width: 28rem;
}

.cta {
  flex: 1 1 12rem;
  padding: 0.8rem 1.4rem;
  background: var(--sage);
  color: var(--card-bg);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--tile-shadow);
}

.cta:hover {
  text-decoration: underline;
}

.cta:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

/* How a game goes: the same card as the description, below the buttons so
   they stay the first thing under the copy. */
.how-it-works {
  margin: 1.5rem 0 0;
  padding: 1.2rem 1.6rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--tile-shadow);
  color: var(--text-muted);
  line-height: 1.6;
}

.how-it-works h2 {
  margin: 0 0 0.6rem;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
  text-align: center;
}

.how-it-works ol {
  margin: 0;
  padding-left: 1.4rem;
}

.how-it-works li + li {
  margin-top: 0.4rem;
}

/* ── Footer ── */

/* The links are spaced by the gap alone, no separator glyphs, so a row that
   wraps on a phone never leaves a bullet hanging off either end. */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.5rem;
  padding: 1.5rem 1.5rem 3rem;
}

.footer-link {
  color: var(--sage);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-link:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Analytics consent panel ── */

/* The shared panel keeps its fixed placement from the library's fallback;
   this only dresses it as one of the site's cards. No display rule, so the
   [hidden] attribute still hides it. */
.consent-panel {
  background: var(--card-bg);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(61, 56, 50, 0.18);
  padding: 1.25rem 1.5rem;
  font: inherit;
  line-height: 1.5;
}

.consent-panel h2 {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
}

.consent-panel p {
  margin: 0 0 1rem;
}

.consent-panel button {
  font: inherit;
  font-weight: 700;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem 0.5rem 0;
  border-radius: var(--radius-sm);
  border: 2px solid var(--sage);
  background: transparent;
  color: var(--sage);
  cursor: pointer;
}

.consent-panel button[data-consent-choice="accepted"] {
  background: var(--sage);
  color: var(--card-bg);
}

.consent-panel a {
  color: var(--sage);
  font-weight: 700;
  white-space: nowrap;
}

.consent-panel button:focus-visible,
.consent-panel a:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

/* ── Compact header (the game and the policy pages) ── */

.compact-header {
  text-align: center;
  padding: 2rem 1.5rem 1.25rem;
}

.home-link {
  display: inline-block;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.home-link:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 4px;
}

/* The wordmark as a single row of small tiles: a way home, not a headline. */
.tiles-compact {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.tiles-compact .tile-word {
  gap: 0.25rem;
}

.tiles-compact .tile {
  font-size: 1.35rem;
  border-radius: var(--radius-sm);
}

/* ── Policy pages (privacy, cookies, terms) ── */

/* The card is the surface the policy sits on, matching the landing copy; the
   article inside it sets its own reading measure. */
.policy-card {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0.25rem 0.75rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--tile-shadow);
}

@media (max-width: 60rem) {
  .policy-card {
    margin: 0 1rem;
    padding: 0;
  }
}

/* Long URLs and email addresses in the policies break anywhere rather than
   pushing the card wider than a phone. */
.policy-content {
  max-width: 52rem;
  margin: 2rem auto;
  padding: 0 1rem;
  color: var(--text);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.policy-content h1,
.policy-content h2 {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  line-height: 1.2;
}

.policy-content h1 {
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  margin: 0 0 0.25rem;
}

/* The "Word Burst · Last updated" line straight under the title. */
.policy-content h1 + p {
  margin-top: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.policy-content h2 {
  font-size: 1.3rem;
  color: var(--sage);
  margin: 1.8rem 0 0.4rem;
}

.policy-content a {
  color: var(--sage);
  font-weight: 700;
}

.policy-content a:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 2px;
  border-radius: 4px;
}

.policy-content hr {
  border: 0;
  border-top: 2px solid var(--border);
  margin: 2rem 0 1rem;
}

/* The licence attribution: small print, not more policy. */
.policy-content hr + p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Motion preferences ── */

@media (prefers-reduced-motion: reduce) {
  .tile {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
