/* Game guide (/game-guide): the in-game "what can I do" list as a public page.
   Farm-theme tokens only (farm-theme.css loads after this file and sets them). Compact on purpose: one row per
   activity, no cards. From 960px each area becomes a row of its own with the area sign stuck to the left while its
   activities scroll past, like signposts along a field path. */

.game-guide {
  --guide-nav-offset: 60px;   /* sticky .site-nav is 44px high, plus some air */
  padding-top: var(--space-6);
}

.game-guide__header {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.game-guide__header .page-title {
  margin-bottom: var(--space-2);
}

.game-guide__header .page-subtitle {
  max-width: 60ch;
}

.game-guide__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* /game-guide/together: numbered steps and plain text sections in the guide's rows */
.together .alert {
  margin-bottom: var(--space-5);
}

.together .alert a {
  margin-left: var(--space-2);
}

.together__number {
  font-weight: 800;
}

.together .guide-area > .guide-entry__how {
  max-width: 70ch;
}

/* ── Area jump links ──────────────────────────────────────────────────── */
.game-guide__areas {
  margin: 0 calc(-1 * var(--space-4)) var(--space-6);
  overflow-x: auto;
  padding: 0 var(--space-4) var(--space-2);
  scrollbar-width: thin;
}

.game-guide__areas ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.game-guide__areas a {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-weight: 650;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-2) 0 var(--space-4);
  white-space: nowrap;
}

.game-guide__areas a:hover {
  border-color: rgba(var(--meadow-rgb), 0.5);
  text-decoration: none;
}

.game-guide__areas a:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

/* The area the reader is in (js/game-guide.js): filled like a lit signpost */
.game-guide__areas a[aria-current="location"] {
  background: var(--meadow);
  border-color: var(--meadow);
  color: #fff;
}

.game-guide__areas a[aria-current="location"] .game-guide__count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.game-guide__count {
  background: var(--panel-soft);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  min-width: 1.9em;
  padding: 2px 8px;
  text-align: center;
}

/* ── Areas ────────────────────────────────────────────────────────────── */
.guide-area {
  border-top: 2px solid rgba(var(--meadow-rgb), 0.25);
  padding: var(--space-5) 0 var(--space-6);
  scroll-margin-top: var(--guide-nav-offset);
}

.guide-area__title {
  align-items: center;
  display: flex;
  font-family: var(--font-display);
  font-size: 1.35rem;
  gap: var(--space-3);
  line-height: 1.2;
  margin: 0 0 var(--space-4);
}

/* The area sign: the one bold shape on the page */
.guide-area__icon {
  align-items: center;
  background: var(--sun-soft);
  border: 2px solid var(--sun);
  border-radius: 50%;
  display: inline-flex;
  flex: none;
  font-size: 1.35rem;
  height: 2.6rem;
  justify-content: center;
  width: 2.6rem;
}

.guide-area__entries {
  display: grid;
  gap: 0 var(--space-6);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── One activity ─────────────────────────────────────────────────────── */
.guide-entry {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 2.25rem 1fr;
  padding: var(--space-3) 0;
}

.guide-entry__icon {
  font-size: 1.5rem;
  line-height: 1.6rem;
  text-align: center;
}

.guide-entry__body {
  min-width: 0;
}

.guide-entry__title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.3;
  margin: 0;
}

.guide-entry__how {
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.5;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

/* Needs a tool from Uncle Norbert first: a small wooden tag */
.guide-entry__tool {
  background: rgba(var(--sun-rgb), 0.22);
  border-radius: var(--radius-sm);
  color: var(--sun-ink);
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 650;
  margin: var(--space-2) 0 0;
  padding: 2px 8px;
}

.game-guide__empty,
.game-guide__footnote {
  color: var(--muted);
  margin: var(--space-5) 0 0;
  max-width: 65ch;
}

/* ── Wide: area sign on the left, activities on the right ─────────────── */
@media (min-width: 960px) {
  .guide-area {
    column-gap: var(--space-6);
    display: grid;
    grid-template-columns: 220px 1fr;
  }

  .guide-area__title {
    align-items: flex-start;
    align-self: start;
    flex-direction: column;
    margin: 0;
    position: sticky;
    top: var(--guide-nav-offset);
  }

  .guide-area__icon {
    font-size: 1.7rem;
    height: 3.25rem;
    width: 3.25rem;
  }

  .guide-entry:first-child,
  .guide-entry:nth-child(2) {
    padding-top: 0;
  }
}

@media (max-width: 560px) {
  .game-guide {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .game-guide__header .btn {
    width: 100%;
  }

  /* Phones: the page is long, so the area links stay under the site nav as one swipeable row, a second tier of
     the nav with the same frosted white; anchors land below both bars */
  .game-guide {
    --guide-nav-offset: 112px;  /* 44px site nav + 60px area row + some air */
  }

  .game-guide__areas {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    padding-top: var(--space-2);
    position: sticky;
    scroll-padding-inline: var(--space-4);
    scrollbar-width: none;
    top: 44px;
    z-index: 5;
  }

  .game-guide__areas::-webkit-scrollbar {
    display: none;
  }

  .game-guide__areas ul {
    flex-wrap: nowrap;
  }

  .guide-area:first-of-type {
    border-top: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html:has(.game-guide) {
    scroll-behavior: smooth;
  }
}
