/* La Grille: three clubs across, three criteria down, nine album slots to fill with stickers.
   The album page, the stickers, the slots and the criterion labels are shared (assets/styles.css). */

.gr-help {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink-soft);
}

.gr-grid {
  display: grid;
  /* minmax(0, …): a long name or label never widens its column past the page. */
  grid-template-columns: minmax(0, 0.85fr) repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.gr-grid .crit.is-row,
.gr-cell {
  min-height: 90px;
}

.gr-cell {
  font: inherit;
}

/* The inside of a box never grows past its column, even for a long name (it shrinks instead). */
.gr-cell.stk,
.gr-cell .stk-foil {
  grid-template-columns: minmax(0, 1fr);
}

button.gr-cell {
  cursor: pointer;
}

.gr-cell.is-choice span {
  font-size: 13px;
  color: var(--ink);
}

.gr-cell.is-choice {
  border: 2px solid var(--ink);
  background: #fff6d6;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  animation: gr-pulse 1s ease-in-out infinite alternate;
}

button.gr-cell:hover,
button.gr-cell:focus-visible {
  border-color: var(--ink);
}

@keyframes gr-pulse {
  to { background: #f6d97a; }
}

.gr-cell.is-dim {
  opacity: 0.45;
}

/* After the game, a box left empty shows one answer it had, as a sticker not stuck. */
.gr-cell.is-revealed {
  opacity: 0.75;
  box-shadow: none;
  border-style: dashed;
}

.gr-cell.is-revealed .stk-foil {
  background: var(--card);
}

.gr-cell.is-revealed .stk-band {
  background: var(--ink-soft);
}

/* Filled after the last mistake (src/after-end.js): a green band, no points. */
.gr-cell.is-late {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.gr-cell.is-late .stk-band {
  background: var(--green);
}

.gr-feedback {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--red-strong);
}

.gr-feedback .ghost {
  margin-left: 6px;
  vertical-align: middle;
}

.gr-card .tried {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
}

.gr-card .tried li {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border: 2px solid currentColor;
  color: var(--red-strong);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* After the game: every box opens the list of its possible answers. */
button.gr-cell.stk {
  font: inherit;
  cursor: pointer;
  text-align: center;
}

.gr-cell.is-shown {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.gr-answers {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.gr-answers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gr-answers h3 {
  margin: 0;
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.gr-answers-count {
  margin: 6px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.gr-answers ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gr-answers li {
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--rule);
}

.gr-answers li.is-mine {
  background: linear-gradient(135deg, #f7e6a8 0%, #fff8dc 45%, #e3c96a 100%);
  border-color: var(--ink);
}

.gr-answers li em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-soft);
}

@media (max-width: 560px) {
  /* Phone: the row labels take less room, the boxes more, and everything in them is set larger. */
  .gr-grid {
    grid-template-columns: minmax(0, 0.72fr) repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .gr-grid .crit.is-row,
  .gr-cell {
    min-height: 100px;
  }

  .gr-grid .crit {
    padding: 6px 2px;
  }

  .gr-grid .crit b {
    font-size: 13px;
  }

  .gr-grid .crit small {
    font-size: 9px;
  }

  .gr-cell.stk {
    padding: 3px;
  }

  .gr-cell .stk-foil {
    padding: 6px 2px;
  }

  /* A word never breaks: a long name is set smaller instead (fitNames, grid/app.js). */
  .gr-cell .stk-name {
    max-width: 100%;
    font-size: 15px;
    overflow-wrap: normal;
  }

  .gr-cell .stk-sub {
    font-size: 9px;
    letter-spacing: 0.06em;
  }

  /* "19 réponses possibles" must fit a box a quarter of a phone wide. */
  .gr-cell .stk-band {
    padding: 3px 2px;
    font-size: 9px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }

  .gr-cell.stk-slot b {
    font-size: 26px;
  }

  .gr-cell .stk-slot span,
  .gr-cell.stk-slot span {
    font-size: 9px;
    letter-spacing: 0.08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gr-cell.is-choice {
    animation: none;
  }
}
