/* Shared styling for the Jarana Spanish games section.
   Reuses the site's existing design tokens (see /_astro/index.*.css)
   so games look native rather than bolted on. No external fonts, no
   external assets — everything here is plain CSS. */

.games-hero { margin: 8px 0 28px; }
.games-hero p { color: var(--ink-2); max-width: var(--measure); }

/* A plain section heading above a game-grid (e.g. "Vocabulary games",
   "Grammar games") — not a card title, just groups the grids below it. */
.games-section-title { margin: 28px 0 4px; font-size: 1.05rem; }
.games-section-title:first-of-type { margin-top: 8px; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin: 12px 0 36px;
  list-style: none;
  padding: 0;
}
.game-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 18px 16px;
  background: var(--answer-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-card h2, .game-card h3 { margin: 0; font-size: 1.15rem; }
.game-card p { margin: 0; color: var(--ink-2); font-size: 0.92rem; flex-grow: 1; }
.game-card a.play-link {
  font-family: var(--f-ui); font-weight: 700; text-decoration: none;
  color: var(--accent); font-size: 0.9rem;
}
.game-card a.play-link:hover, .game-card a.play-link:focus-visible { text-decoration: underline; }
.game-card .game-meta { font-family: var(--f-ui); font-size: 0.75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }

.game-panel {
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 20px 20px 18px;
  background: var(--answer-bg);
  margin: 18px 0 24px;
}
.game-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center;
  font-family: var(--f-ui); font-size: 0.85rem; color: var(--ink-2);
  margin-bottom: 14px;
}
.game-toolbar strong { color: var(--ink); }
.game-difficulty {
  font-family: var(--f-ui); font-size: 0.82rem; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--field-rule);
  background: var(--paper); color: var(--ink); cursor: pointer;
}
.game-difficulty:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.difficulty-label { font-family: var(--f-ui); font-size: 0.82rem; color: var(--ink-2); }
.game-btn {
  font-family: var(--f-ui); font-weight: 700; font-size: 0.85rem;
  padding: 8px 16px; border-radius: 99px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); cursor: pointer;
}
.game-btn:hover, .game-btn:focus-visible { background: var(--accent); color: var(--accent-ink); }
.game-btn[disabled] { opacity: 0.45; cursor: default; }

/* Memory match */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 560px;
}
@media (max-width: 520px) { .memory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.memory-tile {
  aspect-ratio: 1 / 0.72;
  border: 1px solid var(--field-rule);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-ui); font-weight: 600; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 6px; cursor: pointer;
  overflow-wrap: anywhere; hyphens: auto; min-width: 0;
}
.memory-tile[data-hidden="true"] { background: var(--rule); color: transparent; }
.memory-tile[data-matched="true"] { border-color: var(--good); color: var(--good); background: var(--paper); cursor: default; }
.memory-tile[data-wrong="true"] { border-color: var(--bad); }

/* Word scramble / word guess */
.letters-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.letter-tile {
  min-width: 38px; height: 44px; padding: 0 6px;
  border: 1px solid var(--field-rule); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-ui); font-weight: 700; font-size: 1.05rem;
  background: var(--paper); color: var(--ink); cursor: pointer; user-select: none;
}
.letter-tile[disabled] { opacity: 0.3; cursor: default; }
.answer-slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; min-height: 44px; }
.answer-slot {
  min-width: 38px; height: 44px; padding: 0 6px;
  border-bottom: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-ui); font-weight: 700; font-size: 1.05rem;
  color: var(--ink); cursor: pointer;
}

/* Fill in the blank */
.blank-sentence { font-size: 1.2rem; font-family: var(--f-body); margin: 6px 0 18px; }
.blank-input {
  font-family: var(--f-ui); font-size: 1rem; padding: 8px 12px;
  border: 1px solid var(--field-rule); border-radius: 6px;
  background: var(--paper); color: var(--ink); min-width: 200px;
}
.blank-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Word guess (hangman-style) */
.guess-word { font-family: var(--f-ui); font-weight: 700; font-size: 1.8rem; letter-spacing: .12em; margin: 10px 0 18px; }
.guess-letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.guess-letters button {
  width: 36px; height: 36px; border-radius: 6px;
  border: 1px solid var(--field-rule); background: var(--paper); color: var(--ink);
  font-family: var(--f-ui); font-weight: 700; cursor: pointer;
}
.guess-letters button[data-state="correct"] { background: var(--good); border-color: var(--good); color: var(--paper); }
.guess-letters button[data-state="wrong"] { background: var(--bad); border-color: var(--bad); color: var(--paper); }
.guess-letters button[disabled] { cursor: default; }
.lives-row { font-size: 1.3rem; letter-spacing: 4px; margin-bottom: 10px; }

/* Speed quiz */
.speed-timer { font-family: var(--f-ui); font-weight: 700; font-size: 1.4rem; }
.speed-timer[data-low="true"] { color: var(--bad); }
.speed-question { font-size: 1.25rem; margin: 14px 0 16px; }
.speed-opts { display: grid; gap: 10px; max-width: 460px; }
.speed-opt {
  text-align: left; font-family: var(--f-ui); font-size: 0.98rem; font-weight: 600;
  padding: 12px 14px; border: 1px solid var(--field-rule); border-radius: 8px;
  background: var(--paper); color: var(--ink); cursor: pointer;
}
.speed-opt:hover, .speed-opt:focus-visible { border-color: var(--accent); }
.speed-opt[data-correct="true"] { border-color: var(--good); background: var(--good); color: var(--good-ink); font-weight: 600; }
.speed-opt[data-wrong="true"] { border-color: var(--bad); background: var(--bad); color: var(--bad-ink); }
.speed-opt[data-correct="true"]::before { content:"\2713\00a0";content:"\2713\00a0" / ""; }
.speed-opt[data-wrong="true"]::before { content:"\2717\00a0";content:"\2717\00a0" / ""; }
.speed-opt[aria-disabled="true"] { cursor: default; }
.blank-input[data-state="correct"] { border: 2px solid var(--good); }
.blank-input[data-state="wrong"] { border: 2px solid var(--bad); }
.answer-slots[data-state="correct"] .answer-slot { border-color: var(--good); color: var(--good); }
.answer-slots[data-state="wrong"] .answer-slot { border-color: var(--bad); color: var(--bad); }

.game-feedback { font-family: var(--f-ui); font-weight: 700; margin: 10px 0; min-height: 1.3em; }
.game-feedback[data-tone="good"] { color: var(--good); }
.game-feedback[data-tone="bad"] { color: var(--bad); }
.game-over { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 16px; }
.game-over .big-score { font-family: var(--f-ui); font-weight: 700; font-size: 2rem; }

/* Review (spaced-repetition flashcards) */
.flashcard {
  border: 1px solid var(--field-rule); border-radius: 10px;
  background: var(--paper); padding: 32px 24px; text-align: center;
  min-height: 160px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
}
.flash-tag { font-family: var(--f-ui); font-size: 0.75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.flash-prompt { font-size: 1.6rem; font-family: var(--f-body); margin: 0; }
.flash-answer { font-size: 1.6rem; font-family: var(--f-body); margin: 0; color: var(--accent); }
.flash-answer-wrap.hidden { display: none; }
.flash-rate { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.rate-again { border-color: var(--bad); color: var(--bad); }
.rate-again:hover, .rate-again:focus-visible { background: var(--bad); color: var(--paper); }
.rate-good { border-color: var(--good); color: var(--good); }
.rate-good:hover, .rate-good:focus-visible { background: var(--good); color: var(--paper); }
.review-progress { font-family: var(--f-ui); font-size: 0.85rem; color: var(--ink-2); margin: 10px 0; }

/* Note: the shared .spk-btn "hear it" button is styled by pron.js itself
   (it injects its own <style> tag), so every page that loads pron.js gets
   consistent styling whether or not it also loads this stylesheet. */
