/* Vocabloot /games: the static page around the play surface.
 *
 * Tokens, chrome, buttons, header, footer and the signup card all come from
 * /learn/learn.css, which loads first. Nothing here restyles that chrome: this
 * file only adds the pieces a games page has and a lesson page does not: the
 * stage wrapper, the word table, the set grid and the FAQ.
 *
 * The neubrutalist rules are the same as the rest of the site: thick ink
 * outlines, hard offset shadows, never a blur.
 */

/* --- the hero band -------------------------------------------------------
 *
 * A page that opens with black text on one flat background reads as a
 * document. El Taxico opens with a full-bleed illustrated band, a 58px
 * headline with one accented word, and the play button in the first screen.
 * This is the neubrutalist equivalent: a saturated sun band edged in ink, the
 * headline beside the live game rather than above a box.
 */

.games-hero {
  background: var(--sun);
  border-bottom: var(--border);
  padding: clamp(20px, 4vw, 40px) 0 clamp(28px, 5vw, 52px);
  /* Paper grain so a big flat field of colour still feels handmade. */
  background-image: radial-gradient(var(--sun-deep) 1px, transparent 1px);
  background-size: 22px 22px;
}

.games-hero--short {
  padding-bottom: clamp(24px, 4vw, 40px);
}

.games-hero-inner {
  display: grid;
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
  grid-template-columns: 1fr;
}

/* The game comes first on a phone: play should never be below a paragraph. */
.games-hero-copy {
  order: 2;
}
.games-hero-stage {
  order: 1;
}

@media (min-width: 960px) {
  .games-hero-inner {
    grid-template-columns: 23fr 27fr;
  }
  .games-hero-copy {
    order: 1;
  }
  .games-hero-stage {
    order: 2;
  }
}

.games-title {
  margin: 14px 0 0;
  font-size: clamp(2.4rem, 6.4vw, 3.9rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

/* One accented phrase carries most of the hero's personality. */
.games-accent {
  color: var(--paper);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}

.games-intro {
  margin: 14px 0 0;
  max-width: 46ch;
  font-size: clamp(1.0625rem, 2.2vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.games-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.games-fact {
  border: var(--border);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  color: var(--ink);
}

.games-hero .crumbs {
  margin-bottom: 0;
}

/* --- sections ------------------------------------------------------------ */

.games-section {
  padding-top: clamp(28px, 6vw, 52px);
}

.games-section > h2 {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  line-height: 1.15;
  color: var(--ink);
}

/* --- the word set -------------------------------------------------------- */

/* Scroll container: the table may exceed a phone's width, and a page that
   * scrolls sideways clips its own left edge. The border lives on the table, so
   * the wrapper adds bottom padding to leave room for the hard offset shadow. */
.games-table-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
  /* Keep focus rings and the offset shadow from being sheared off. */
  padding-left: 2px;
  padding-right: 8px;
  margin-left: -2px;
}

.games-words {
  width: 100%;
  min-width: 20rem;
  border-collapse: collapse;
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  background: var(--paper);
  overflow: hidden;
  font-size: 1rem;
}

.games-words caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 10px;
  font-size: 0.9375rem;
  color: var(--ink-faint);
}

.games-words th {
  text-align: left;
  padding: 12px 16px;
  background: var(--canvas-dim);
  border-bottom: var(--border);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.games-words td {
  padding: 12px 16px;
  border-top: 2px solid var(--hairline);
  vertical-align: top;
  line-height: 1.45;
  color: var(--ink-soft);
}

.games-words tbody tr:first-child td {
  border-top: 0;
}

.games-word {
  font-weight: 700;
  color: var(--ink);
}

.games-reading {
  display: block;
  font-size: 0.875rem;
  color: var(--ink-faint);
}

/* Which of two right answers a prompt means: du versus Sie. */
.games-context {
  color: var(--mint-text);
  font-weight: 700;
}

.games-respell {
  font-family: var(--font-hand);
  font-size: 1.125rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.games-crosslink {
  margin: 16px 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* --- the lineup and the set grid ----------------------------------------- */

.games-lineup {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.games-lineup li {
  border: var(--border);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: 8px 16px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.games-lineup strong {
  color: var(--ink);
}

.games-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .games-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.games-card {
  display: block;
  height: 100%;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  text-decoration: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.games-card:hover {
  background: var(--sun-100);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}

.games-card:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

/* Not yet authored: present, honest, and clearly not a link. */
.games-card--soon {
  display: block;
  height: 100%;
  border: 3px dashed var(--hairline);
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
  padding: 18px 20px;
}

.games-card--soon .games-card-title,
.games-card--soon .games-card-meta {
  color: var(--ink-faint);
}

.games-card-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--ink);
}

.games-card-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.9375rem;
  color: var(--ink-faint);
}

/* --- FAQ ----------------------------------------------------------------- */

.games-faq {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  padding-top: clamp(28px, 6vw, 52px);
  /* Without this the next band butts against the last item and shears off its
     offset shadow. */
  padding-bottom: clamp(32px, 6vw, 56px);
}

.games-faq > h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  color: var(--ink);
}

.games-faq-item {
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
}

.games-faq-item + .games-faq-item {
  margin-top: 10px;
}

.games-faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
  /* A 44px target without pushing the closed row taller than it reads. */
  padding: 4px 0;
}

.games-faq-item summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.games-faq-item p {
  margin: 10px 0 0;
  line-height: 1.65;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .games-card {
    transition: none;
  }
  .games-card:hover,
  .games-card:active {
    transform: none;
  }
}
