/* ===========================================================================
   GUIDE — the words around the games.

   Under each game: what it is, how to play, controls, scoring, tips and a
   short FAQ (rendered by js/guide.js, into the static page and in-app alike).
   Under the menu: what this arcade is, every game by type, and a FAQ.
   Glass cards on the page's own theme — the arena above is the dark screen.
   =========================================================================== */

/* The cards are links now; they keep the card's own colours. */
a.game-card {
  color: inherit;
  font-weight: inherit;
}

.games-section {
  padding-bottom: 54px;
}

/* ===========================
   GUIDE (under a game)
   =========================== */
.guide {
  width: min(980px, calc(100% - 2 * var(--gutter)));
  margin: 6px auto 80px;
  display: grid;
  gap: 16px;
  color: var(--ink-2);
}

.guide[hidden] {
  display: none;
}

.guide__head,
.guide__card,
.guide__faq,
.guide__more,
.home-about,
.home-faq {
  position: relative;
  padding: 24px 26px;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.guide__head {
  overflow: hidden;
  padding: 30px 30px 26px;
}

.guide__head::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 120% at 0% 0%, var(--game-soft), transparent 60%);
}

.guide__head > * {
  position: relative;
}

.guide__kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--game-accent);
}

[data-theme="light"] .guide__kicker {
  color: color-mix(in srgb, var(--game-accent) 70%, #000);
}

.guide h1 {
  margin: 10px 0 12px;
  font-size: clamp(1.55rem, 3.6vw, 2.35rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.guide__intro {
  max-width: 72ch;
  font-size: 1.02rem;
  line-height: 1.7;
}

.guide__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.guide h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink);
}

.guide h2::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--game-accent);
  box-shadow: 0 0 10px var(--game-accent);
  flex-shrink: 0;
}

.guide p,
.guide li,
.guide dd {
  line-height: 1.65;
}

.guide ul {
  display: grid;
  gap: 8px;
  padding-left: 1.15em;
}

.guide ul li::marker {
  color: var(--game-accent);
}

/* Numbered steps, with the number in a little lit chip. */
.guide ol {
  display: grid;
  gap: 10px;
  list-style: none;
  counter-reset: step;
}

.guide ol li {
  position: relative;
  padding-left: 34px;
  counter-increment: step;
}

.guide ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--game-accent);
  background: var(--game-soft);
  border: 1px solid var(--game-faint);
}

.guide dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  align-items: baseline;
}

.guide dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.guide code,
.home-extra code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--line);
  color: var(--ink);
}

.guide kbd {
  font-size: 0.75rem;
}

/* --- FAQ, here and on the home page --- */
.guide__faq details,
.home-faq details {
  border-top: 1px solid var(--line);
}

.guide__faq details:first-of-type,
.home-faq details:first-of-type {
  border-top: none;
}

.guide__faq summary,
.home-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.guide__faq summary::-webkit-details-marker,
.home-faq summary::-webkit-details-marker {
  display: none;
}

.guide__faq summary::after,
.home-faq summary::after {
  content: '+';
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--game-accent, var(--accent));
  background: var(--line);
  transition: transform var(--t-base) var(--ease);
}

.guide__faq details[open] summary::after,
.home-faq details[open] summary::after {
  transform: rotate(45deg);
}

.guide__faq details p,
.home-faq details p {
  padding: 0 0 14px;
  max-width: 72ch;
  line-height: 1.65;
}

.guide a:not(.guide__link):not(.guide__all),
.home-extra p a,
.home-faq a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--game-accent, var(--accent));
  text-underline-offset: 3px;
}

/* --- More games --- */
.guide__links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide__link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--glass-strong, var(--glass));
  border: 1px solid var(--line);
  color: inherit;
  font-weight: inherit;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}

.guide__link b {
  font-family: var(--font-display);
  color: var(--ink);
}

.guide__link span {
  font-size: 0.85rem;
  color: var(--ink-3);
}

.guide__link:hover,
.guide__link:focus-visible {
  border-color: color-mix(in srgb, var(--game-accent) 60%, transparent);
  box-shadow: 0 14px 34px -18px var(--game-glow);
  transform: translateY(-2px);
}

.guide__all {
  display: inline-block;
  margin-top: 14px;
  font-weight: 600;
  color: var(--game-accent);
}

[data-theme="light"] .guide__all {
  color: color-mix(in srgb, var(--game-accent) 70%, #000);
}

/* ===========================
   HOME — about, by type, FAQ
   =========================== */
.home-extra {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter) 90px;
  display: grid;
  gap: 16px;
}

.home-extra:empty {
  display: none;
}

.home-extra h2 {
  margin-bottom: 12px;
  font-size: 1.3rem;
  color: var(--ink);
}

.home-about p {
  max-width: 76ch;
  margin-bottom: 10px;
  line-height: 1.7;
  color: var(--ink-2);
}

.home-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.home-type h3 {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.home-type ul {
  display: grid;
  gap: 6px;
  list-style: none;
}

.home-type a {
  color: var(--ink);
  font-weight: 500;
  transition: color var(--t-fast) var(--ease);
}

.home-type a:hover {
  color: var(--game-accent);
}

.home-faq {
  color: var(--ink-2);
}

/* ===========================
   Footer note + no-JavaScript fallback
   =========================== */
.footer-note {
  max-width: var(--container);
  margin: 10px auto 0;
  font-size: 0.78rem;
  color: var(--ink-3);
}

.noscript {
  max-width: 60ch;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 60px) var(--gutter) 40px;
  text-align: center;
  color: var(--ink-2);
}

/* ===========================
   Phones
   =========================== */
@media (max-width: 760px) {
  .guide {
    width: auto;
    margin: 0 0 40px;
    padding: 16px var(--gutter) 0;
  }

  .guide__head,
  .guide__card,
  .guide__faq,
  .guide__more,
  .home-about,
  .home-faq {
    padding: 20px 18px;
  }

  .guide__grid,
  .guide__links {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .guide dd {
    margin-bottom: 8px;
  }
}
