/* ==========================================================================
   Accueil : bandeau du jour, panneau « Trouve ton activité » (recherche + filtres),
   catalogue rangé. Les univers ne colorent jamais les fonds de section : seule
   l'illustration des cartes (et les petites pastilles d'icône) porte la teinte.
   ========================================================================== */

.home { max-width: 1520px; margin: 0 auto; padding: var(--s3) var(--s3) var(--s4); }
.home-grid { display: grid; grid-template-columns: var(--plan-w) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.home-col { min-width: 0; display: flex; flex-direction: column; gap: var(--s3); }

/* ---------- Plan du catalogue (fixé à gauche sur ordinateur) ---------- */
.plan {
  position: sticky; top: calc(var(--nav-h) + var(--s3)); max-height: calc(100vh - var(--nav-h) - var(--s5));
  overflow: auto; padding: 4px 4px var(--s2) 0; scrollbar-width: thin;
}
.plan-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: .85rem; font-weight: 800; color: var(--muted); margin: 6px 12px 12px; letter-spacing: .02em; }
.plan-title .ic { width: 16px; height: 16px; }
.plan-list { display: flex; flex-direction: column; gap: 6px; }
.plan-list ul { margin: 2px 0 6px 27px; padding-left: 12px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.plan-u, .plan-c { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border-radius: var(--r-m); color: var(--ink); transition: background-color 120ms ease, color 120ms ease; }
.plan-u { padding: 6px 10px 6px 6px; min-height: 44px; font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.plan-u span:nth-child(2), .plan-c span { flex: 1; line-height: 1.3; }
.plan-u .iconpill { background: var(--u-bg); color: var(--u-strong); border-radius: 10px; }
.plan-c { padding: 6px 10px; min-height: 36px; font-size: .93rem; color: var(--text); font-weight: 700; }
.plan small { font-weight: 800; color: var(--muted); font-size: .8rem; min-width: 1.5em; text-align: right; }
.plan-u[aria-current='true'] { background: var(--paper); outline: 1px solid var(--line); }
@media (hover: hover) { .plan-u:hover, .plan-c:hover { background: var(--sunk); } .plan-c:hover { color: var(--ink); } }

/* ---------- Bandeau du jour : brume « aurore », formes décoratives discrètes ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  grid-template-areas: 'main riddle' 'quest stats';
  gap: var(--s2) var(--s3);
  background: var(--hero-bg); border-radius: var(--r-xl); padding: var(--s3) var(--s4) var(--s4);
  color: var(--hero-ink); position: relative; overflow: hidden; isolation: isolate;
}
.hero-deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-deco i { position: absolute; border-radius: 50%; background: var(--hero-shape); }
.hero-deco i:nth-child(1) { width: 300px; height: 300px; left: -90px; top: -120px; }
.hero-deco i:nth-child(2) { width: 120px; height: 120px; left: 46%; top: -56px; }
.hero-deco i:nth-child(3) { width: 16px; height: 16px; left: 50%; top: 30%; background: var(--gold); opacity: .55; }
.hero-main { grid-area: main; display: flex; gap: var(--s3); align-items: center; min-width: 0; }
.hero-owl { flex: none; width: 124px; margin: -4px 0 -8px; }
.hero-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; align-items: flex-start; }
.hero-date { font-size: .9rem; font-weight: 800; color: var(--hero-ink); }
.hero h1 { color: var(--ink); font-size: clamp(1.7rem, 2.6vw, 2.2rem); }
.hero-sub { font-size: 1.08rem; font-weight: 700; color: var(--hero-ink); margin-bottom: 8px; }
.hero-cta { max-width: 100%; min-width: 0; }
.hero-cta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.quest { grid-area: quest; background: var(--paper); border-radius: var(--r-l); padding: 14px 16px 16px; color: var(--text); }
.quest-head { display: flex; align-items: center; justify-content: space-between; color: var(--ink); }
.quest-head strong { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.quest-head .ic { color: var(--gold-deep); width: 20px; height: 20px; }
.quest-count { font-weight: 800; font-size: .9rem; color: var(--muted); }
.quest-meter { margin: 10px 0 12px; height: 6px; }
.quest-meter > i { background: var(--gold); }
.quest-list { display: flex; flex-wrap: wrap; gap: 8px; }
.quest-item {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 4px 12px 4px 5px; border-radius: var(--r-pill);
  background: var(--paper); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 800; font-size: .93rem; text-decoration: none !important;
  transition: border-color 120ms ease, transform var(--dur) var(--ease);
}
.quest-item .iconpill { background: var(--u-bg); color: var(--u-strong); width: 30px; height: 30px; }
.quest-item > .ic { width: 16px; height: 16px; color: var(--muted); }
.quest-item.done { color: var(--muted); }
.quest-item.done .quest-name { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.quest-item.done .iconpill { background: var(--ok-bg); color: var(--ok-strong); }
@media (hover: hover) { .quest-item:hover { border-color: var(--act); transform: translateY(var(--lift)); } }

.riddle { grid-area: riddle; background: var(--paper); border-radius: var(--r-l); padding: 18px 20px 12px; display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.riddle-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.riddle-state { font-size: .88rem; font-weight: 800; color: var(--muted); }
.riddle-head { display: flex; gap: 14px; align-items: center; }
.riddle-av { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--hero-chip); overflow: hidden; padding: 5px 2px 0; }
.riddle-q { font-family: var(--font-display); font-size: 1.22rem; color: var(--ink); line-height: 1.35; font-weight: 500; }
.riddle-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.riddle .tile { min-height: 58px; justify-content: center; text-align: center; padding: 8px 10px; position: relative; border-width: 1.5px; border-radius: var(--r-m); }
.riddle-fb { min-height: 1.5em; font-weight: 800; font-size: .95rem; }
.riddle-fb.ok { color: var(--ok-strong); }
.riddle-fb.rev { color: var(--rev-strong); }

.stats { grid-area: stats; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--paper); border-radius: var(--r-l); overflow: hidden; }
.stats li { padding: 12px 16px; display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.stats li:nth-child(2n) { border-left: 1px solid var(--line); }
.stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
.stats .iconpill { background: var(--hero-chip); color: var(--hero-ink); }
.stats strong { display: block; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--ink); line-height: 1.15; white-space: nowrap; }
.stats span:not(.iconpill) { font-size: .86rem; font-weight: 700; color: var(--muted); }

/* ---------- Panneau unique « Trouve ton activité » : recherche + filtres ---------- */
.finder {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: var(--s3) var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s2);
  scroll-margin-top: calc(var(--nav-h) + var(--s2)); position: relative; z-index: 5;
}
.fhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fhead h2 { font-size: 1.4rem; margin-right: auto; }
.fcount { font-weight: 800; font-size: .9rem; color: var(--act-text); background: var(--act-soft); border-radius: var(--r-pill); padding: 4px 14px; }

.searchblock { position: relative; }
.bigsearch { position: relative; }
.bigsearch > .ic { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; color: var(--act-text); pointer-events: none; }
.field-xl {
  min-height: 60px; font-size: 1.15rem; padding-left: 58px; padding-right: 60px;
  border-radius: 14px; background: var(--sunk); border-color: transparent;
}
.field-xl:hover { background: var(--paper); border-color: var(--line); }
.field-xl:focus { background: var(--paper); border-color: var(--act-line); }
.clearq { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.clearq:hover { transform: translateY(-50%) !important; }
.sugg {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--r-l); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.sugg button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: var(--r-m); font-weight: 800; color: var(--ink); text-align: left; }
.sugg button:hover, .sugg button:focus-visible { background: var(--act-soft); }
.sugg .pill { min-width: 92px; justify-content: center; }

.filters { display: flex; flex-direction: column; gap: var(--s2); }
.frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.u-chips { flex: 1 1 auto; }
.chip-u { min-height: 46px; padding: 0 18px 0 6px; font-size: 1rem; font-family: var(--font-display); font-weight: 600; }
.chip-u .iconpill { width: 34px; height: 34px; background: var(--u-bg); color: var(--u-strong); }
.chip-u .iconpill svg { width: 18px; height: 18px; color: currentColor; }
.chip-u[aria-pressed='true'] .iconpill { background: var(--paper); color: var(--act-text); }
.filters-toggle { margin-left: auto; }
.fbadge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--act); color: var(--act-ink); font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; }
.filters-more { display: none; flex-direction: column; gap: 12px; padding-top: var(--s2); border-top: 1px solid var(--line); }
.filters-more.open { display: flex; }
.fgroup { display: flex; align-items: flex-start; gap: var(--s2); }
.flabel { flex: 0 0 104px; padding-top: 9px; font-weight: 800; color: var(--muted); font-size: .9rem; }
.filters-more .chip { min-height: 38px; font-size: .93rem; padding: 0 14px; }
.plan-open { display: none; }
.filters-modal { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Catalogue : sections par univers, sans fond coloré ---------- */
#results { display: flex; flex-direction: column; gap: var(--s5); outline: none; padding-top: var(--s2); }
.usec, .shelf { scroll-margin-top: calc(var(--nav-h) + var(--s2)); }
.usec-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.usec-head h2 { color: var(--ink); font-size: clamp(1.4rem, 2vw, 1.7rem); }
.usec-head .iconpill { width: 44px; height: 44px; border-radius: var(--r-m); background: var(--u-bg); color: var(--u-strong); }
.usec-count { margin-left: auto; font-weight: 800; font-size: .9rem; color: var(--muted); }
/* Les compétences se rangent côte à côte sur une grille commune de 3 colonnes :
   une compétence de 1 ou 2 contenus ne laisse plus une rangée à moitié vide. */
.usec-body { --cols: 3; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--s4) 20px; margin-top: var(--s3); }
.usec-shelf { --cols: 4; }
.comp { --k: min(var(--n), var(--cols)); grid-column: span var(--k); min-width: 0; scroll-margin-top: calc(var(--nav-h) + var(--s2)); }
.comp-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-body); font-size: 1.02rem; font-weight: 800; color: var(--u-strong); margin-bottom: 14px; }
.comp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--u-strong); flex: none; }
.comp-title small { font-size: .82rem; font-weight: 800; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(var(--k, 3), minmax(0, 1fr)); gap: var(--s3) 20px; }

/* Carte : vignette → pilules → notion → titre → accroche → bouton.
   Seule la vignette est teintée par l'univers. */
.cx {
  display: flex; flex-direction: column; background: var(--paper); border-radius: var(--r-l);
  border: 1px solid var(--line); overflow: hidden; text-decoration: none !important; color: var(--text);
  transition: transform var(--dur) var(--ease), border-color 120ms ease;
}
.cx-vig { position: relative; aspect-ratio: 16 / 10; margin: 8px 8px 0; border-radius: var(--r-m); overflow: hidden; background: var(--u-bg); }
.cx-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 18px; flex: 1; }
.cx-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.pill-u { background: var(--sunk); color: var(--text); }
.pill-u svg { color: var(--u-strong); }
.pill-lvl { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); padding: 2px 10px; }
.cx-notion { font-weight: 800; font-size: .88rem; color: var(--u-strong); margin-top: 4px; }
.cx-title { font-size: 1.22rem; color: var(--ink); line-height: 1.2; }
.cx-hook { color: var(--muted); font-size: .97rem; line-height: 1.5; min-height: 3em; }
.cx-state { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: .86rem; color: var(--muted); margin-top: 2px; }
.cx-state .meter { flex: 1; height: 6px; }
.cx-state .stars svg { width: 18px; height: 18px; }
.cx-btn { margin-top: auto; width: 100%; min-height: 44px; background: var(--act-soft); color: var(--act-text); font-size: 1rem; }
.cx-hook { margin-bottom: 8px; }
.cx-state { margin-bottom: 8px; }
@media (hover: hover) {
  .cx:hover, .cover:hover { transform: translateY(var(--lift)); border-color: var(--act); }
  .cx:hover .cx-btn { background: var(--act); color: var(--act-ink); }
}
.cx:focus-visible .cx-btn { background: var(--act); color: var(--act-ink); }
.badge-new {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); color: var(--act-text); font-weight: 800; font-size: .82rem; padding: 3px 12px 3px 9px; border-radius: var(--r-pill);
}
.badge-new .ic { width: 15px; height: 15px; }

/* ---------- Bibliothèque : couvertures (seule la couverture est teintée) ---------- */
.covers { display: grid; grid-template-columns: repeat(var(--k, 4), minmax(0, 1fr)); gap: var(--s3) 20px; }
.cover { display: flex; flex-direction: column; border-radius: var(--r-l); overflow: hidden; background: var(--paper); border: 1px solid var(--line); text-decoration: none !important; transition: transform var(--dur) var(--ease), border-color 120ms ease; }
.cover-art { position: relative; aspect-ratio: 3 / 4; background: var(--u-mid); }
[data-theme='dark'] .cover-art { --u-mid: var(--u-bg); }
.cover-band { background: var(--paper); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; flex: 1; border-top: 1px solid var(--line); }
.cover-title { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 1.05rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover-band .meter { width: 100%; height: 6px; }

/* ---------- Aucun résultat ---------- */
.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s5) var(--s3); border-radius: var(--r-xl); }
.empty-owl { width: 132px; }
.center-chips { justify-content: center; }
.totop { align-self: center; margin-top: var(--s2); }

/* ---------- Tablette : plan derrière un bouton ---------- */
@media (max-width: 1239px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .plan { display: none; }
  .plan-open { display: inline-flex; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'main main' 'quest riddle' 'stats stats'; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats li:nth-child(n+3) { border-top: 0; }
  .stats li + li { border-left: 1px solid var(--line); }
}
@media (max-width: 1099px) { .usec-body { --cols: 2; } .usec-shelf { --cols: 3; } }
@media (max-width: 719px) {
  .home { padding: var(--s2) var(--s2) var(--s5); }
  .home-col { gap: var(--s2); }
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'main' 'quest' 'riddle' 'stats'; padding: var(--s2) var(--s2) var(--s2); border-radius: var(--r-l); gap: 12px; }
  .hero-main { position: relative; }
  .hero-owl { position: absolute; top: -6px; right: -4px; width: 78px; margin: 0; }
  .hero-copy h1, .hero-date, .hero-sub { padding-right: 80px; }
  .hero-cta { width: 100%; }
  .riddle { padding: var(--s2); }
  .riddle-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li { padding: 10px 12px; gap: 10px; }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stats strong { font-size: 1.1rem; }
  .finder { padding: var(--s2); border-radius: var(--r-l); }
  .fhead h2 { font-size: 1.2rem; }
  .plan-open { display: none; }
  .filters-toggle { margin-left: 0; }
  .fgroup { flex-direction: column; gap: 4px; }
  .flabel { flex: none; padding-top: 0; }
  #results { gap: var(--s4); }
  .usec-body { --cols: 1; gap: var(--s3); }
  .usec-shelf { --cols: 2; }
  .covers { gap: var(--s2); }
  .searchblock { display: none; }
}

/* ---------- Mode TV : rangées horizontales parcourues aux flèches ---------- */
[data-tv='1'] .home { max-width: none; padding: var(--s4) var(--s4) var(--s6) var(--s4); }
[data-tv='1'] .home-grid { grid-template-columns: minmax(0, 1fr); }
[data-tv='1'] .plan, [data-tv='1'] .totop, [data-tv='1'] .filters-more { display: none; }
[data-tv='1'] .filters-toggle { display: inline-flex; }
[data-tv='1'] .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'main main' 'quest riddle' 'stats stats'; }
[data-tv='1'] .hero-owl { width: 170px; }
[data-tv='1'] .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
[data-tv='1'] .stats li:nth-child(n+3) { border-top: 0; }
[data-tv='1'] .stats li + li { border-left: 1px solid var(--line); }
[data-tv='1'] .usec-body { display: block; }
[data-tv='1'] .comp + .comp { margin-top: var(--s3); }
[data-tv='1'] .chip-u { min-height: 60px; }
[data-tv='1'] .cards, [data-tv='1'] .covers {
  display: flex; overflow-x: auto; gap: var(--s3); padding: 14px 10px 24px; margin: 0 -10px; scroll-snap-type: x proximity; scrollbar-width: none;
}
[data-tv='1'] .cards::-webkit-scrollbar, [data-tv='1'] .covers::-webkit-scrollbar { display: none; }
[data-tv='1'] .cx { flex: 0 0 380px; scroll-snap-align: start; }
[data-tv='1'] .cover { flex: 0 0 250px; scroll-snap-align: start; }
[data-tv='1'] .cx-hook { font-size: 1.05rem; }
[data-tv='1'] .searchblock { display: none; }
