/* Lessons: course map tiles, keycaps, stars and the results screen. */

/* Links to the screens around this one (back, lessons, progress). */
.screen-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem var(--space-lg);
  margin-bottom: var(--space-md);
}

.map-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
}

.map-header p {
  margin: 0;
}

.lesson-unit {
  margin-top: var(--space-lg);
}

.lesson-unit h2 {
  margin-bottom: var(--space-sm);
}

.lesson-unit__description {
  margin: -0.25rem 0 var(--space-sm);
}


.lesson-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Five per row on a laptop: most units have five lessons. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  gap: var(--space-sm);
}

.lesson-tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  height: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

a.lesson-tile:hover {
  border-color: var(--color-accent);
}

.lesson-tile--locked {
  opacity: 0.6;
  border-style: dashed;
}

.lesson-tile--completed {
  border-color: var(--color-correct);
}

.lesson-tile--recommended {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent);
}

.lesson-tile__number {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.lesson-tile__title {
  font-weight: 700;
  font-size: var(--text-lg);
}

.lesson-tile__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

.lesson-tile__status {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.lesson-tile--recommended .lesson-tile__status {
  color: var(--color-accent);
  font-weight: 700;
}

.keycaps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.keycaps kbd {
  min-width: 1.8em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--color-key-border);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--color-key);
  color: var(--color-key-text);
  font: 600 1em ui-monospace, "Cascadia Mono", Consolas, monospace;
  text-align: center;
}

.keycaps--review {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.stars {
  display: inline-flex;
  gap: 0.1em;
  font-size: var(--text-lg);
  line-height: 1;
}

/* Empty stars carry information (1 vs 3), so they need graphic contrast (≥ 3:1). */
.star {
  color: var(--color-text-muted);
}

.star--on {
  color: var(--color-star);
}

.stars--large {
  font-size: 3.2rem;
}

/* --- Results --- */

/* Results must fit a 1366×768 laptop without scrolling, medals included: summary and buttons
   on the left, the star goals on the right (stacked, the goals go last). */
main:has(> .results) {
  padding-block: var(--space-md);
}

.results {
  display: grid;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
  max-width: 36rem;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  background: var(--color-surface);
  border: 3px solid var(--color-border);
  text-align: center;
}

@media (min-width: 60rem) {
  .results {
    /* The summary is wider: its three buttons fit in one row. */
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    max-width: 64rem;
  }
}

.results__summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.results--passed {
  border-color: var(--color-correct);
}

.results h1,
.results p {
  margin: 0;
}

.results__lesson {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.results__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  font-size: var(--text-lg);
  font-weight: 700;
}

.results__details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  color: var(--color-text-muted);
}

.results__medals {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.results__record {
  color: var(--color-correct);
  font-weight: 700;
}

/* Kids: what the voice says about the next star, with its "Escuchar" button. */
.results__voice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-weight: 700;
}

/* "¿Cómo se ganan las estrellas?" */
.star-goals {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  text-align: left;
}

.star-goals__title {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-md);
  text-align: center;
}

.star-goals__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.star-goals__item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.star-goals__item--done {
  border-color: var(--color-correct);
}

/* Under what the star asks for. */
.star-goals__status {
  grid-column: 2;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.star-goals__item--done .star-goals__status {
  color: var(--color-correct);
  font-weight: 700;
}

.results__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}
