:root { color-scheme: light dark; --accent: #c0392b; }
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; line-height: 1.4; }
header { position: sticky; top: 0; background: Canvas; padding: 1rem;
  border-bottom: 1px solid #8884; z-index: 2; }
h1 { font-size: 1.1rem; margin: 0 0 .5rem; }
#q { width: 100%; padding: .6rem .8rem; font-size: 1.1rem; border-radius: 8px;
  border: 1px solid #8886; }

/* Onglets */
#tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
#tabs button { border: 1px solid #8886; background: transparent; border-radius: 999px;
  padding: .2rem .7rem; cursor: pointer; font-size: .85rem; color: inherit; }
#tabs button[aria-selected="true"] { background: var(--accent); color: white;
  border-color: var(--accent); }

#games { display: flex; gap: .3rem; margin-bottom: .5rem; }
#games button { border: 1px solid #8886; background: transparent; border-radius: 8px;
  padding: .25rem .9rem; cursor: pointer; font-size: .9rem; font-weight: 600; color: inherit; }
#games button[aria-selected="true"] { background: Canvas; border-color: var(--accent);
  color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

main { padding: 1rem; max-width: 900px; margin: 0 auto; }
#status { opacity: .7; margin: 0 0 .6rem; }

/* Listes de résultats */
#results, .rowlist { list-style: none; padding: 0; margin: 0; }
.row { padding: .4rem .6rem; border-radius: 8px; cursor: pointer; }
.row:hover { background: #8881; }
.row[aria-selected="true"] { background: #8882; }
.row-main { display: grid; grid-template-columns: 1fr 1fr auto; gap: .75rem;
  align-items: center; }
.row .cat { font-size: .7rem; text-transform: uppercase; opacity: .6; margin-right: .4rem; }
.row a.kira { color: var(--accent); text-decoration: none; white-space: nowrap; }
mark { background: #f1c40f66; color: inherit; border-radius: 2px; }

/* Détail dépliable */
.detail { display: none; font-size: .85rem; opacity: .8;
  grid-template-columns: 1fr 1fr; gap: .75rem; padding: .4rem 0 .2rem; }
.row.expanded .detail { display: grid; }

/* Accueil */
#home { display: flex; flex-direction: column; gap: 1.5rem; }
/* Le sélecteur id l'emporterait sur l'attribut `hidden` du navigateur → le forcer. */
#home[hidden] { display: none; }
#home .lead { opacity: .85; margin: 0; }
#home h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em;
  opacity: .6; margin: 0 0 .5rem; }
.counters { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .5rem; }
.counters button { text-align: left; border: 1px solid #8886; background: transparent;
  border-radius: 8px; padding: .5rem .7rem; cursor: pointer; color: inherit; }
.counters button:hover { border-color: var(--accent); }
.counters .n { font-size: 1.3rem; font-weight: 600; display: block; }
.counters .l { font-size: .8rem; opacity: .7; }

@media (max-width: 560px) {
  .row-main { grid-template-columns: 1fr 1fr; }
  .row-main .meta { grid-column: 1 / -1; }
  .detail { grid-template-columns: 1fr; }
}
