:root{
  --ct-bg1:#ffffff;
  --ct-bg2:#ffffff;
  /* Saumon très clair (identique au menu) */
  /* Charte: jaune/crème très clair (dégradé doux) */
  --ct-cream-1:#ffffff;
  --ct-cream-2:#fbfbfb;
  --ct-salmon:linear-gradient(180deg,var(--ct-cream-1) 0%,var(--ct-cream-2) 100%);
  /* Couleur de fond des cartes/cadres */
  --ct-card:var(--ct-salmon);
  --ct-text:#1d1d1f;
  --ct-muted:#5b6168;
  --ct-line:rgba(0,0,0,.08);
  /* Palette pastel (rose / bleu canard / jaune) */
  --ct-accent:#00838F;      /* bleu canard */
  --ct-pink:#ffb8d2;        /* rose pastel */
  --ct-pink2:#ffe0ec;       /* rose très clair */
  --ct-yellow:#ffe08a;      /* jaune pastel */
  --ct-yellow2:#fff3cf;     /* jaune très clair */
  --ct-prem:#7a5a00;
  --ct-radius:22px;
  --ct-shadow:0 12px 30px rgba(0,0,0,.08);
}

*{box-sizing:border-box}
/* Scroll global uniquement (garde le scroll général, supprime les scrolls imbriqués) */
html, body{height:auto;min-height:100%;overflow-x:hidden}
html{overflow-y:auto}
body{overflow-y:visible}
/* Texte conservé "en interne" (SEO / accessibilité) mais invisible */
.ct-sr{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
body{
  margin:0;
  font-family:"Fredoka", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight:500;
  color:var(--ct-text);
  background: radial-gradient(900px 500px at 10% 10%, var(--ct-bg1), transparent 60%),
              radial-gradient(900px 500px at 90% 20%, var(--ct-bg2), transparent 60%),
              #fff;
}

/* Évite les petits scrolls internes (conteneurs qui auraient un overflow:auto/scroll ailleurs) */
.ct-tools-wrap,
.ct-hubLayout,
.ct-hubSide,
.ct-hubMain,
.ct-grid,
.ct-sectionDetails,
.ct-sectionInner{
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
}

/* Bandeau (même logique que Coloritext) */
.ct-top-notice{
  width:100%;
  text-align:center;
  padding:10px 12px;
  background:linear-gradient(90deg, rgba(0,131,143,.14), rgba(255,209,92,.18));
  border-bottom:1px solid rgba(0,0,0,.06);
  color:#0a4b50;
  font-weight:700;
  font-size:14px;
  position:sticky;
  top:0;
  z-index:1000;
  backdrop-filter: blur(6px);
}

.ct-tools-wrap{max-width:1220px;margin:18px auto;padding:0 16px 44px}

/* Header / Hero */
.ct-tools-hero{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:16px 16px 14px;
  border:1px solid var(--ct-line);
  border-radius:var(--ct-radius);
  background:rgba(255,255,255,.78);
  backdrop-filter: blur(6px);
  box-shadow:0 10px 22px rgba(0,0,0,.05);
}

.ct-tools-heroTop{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}

.ct-tools-brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:inherit}
.ct-tools-logo{width:44px;height:44px;object-fit:contain}
.ct-tools-title{margin:0;font-size:18px;letter-spacing:.01em}

.ct-tools-actions{display:flex;gap:10px;flex-wrap:wrap}
.ct-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid var(--ct-line);
  background:#fff;
  font-weight:800;
  color:var(--ct-text);
}
.ct-pill:hover{filter:brightness(.99)}
.ct-pill--primary{background:var(--ct-accent);color:#fff;border-color:rgba(0,131,143,.35)}
.ct-pill--active{background:rgba(0,131,143,.10);border-color:rgba(0,131,143,.25)}

/* Bandeau "Trousse" */
.ct-trousse-banner{
  display:grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap:14px;
  align-items:center;
  padding:12px;
  border-radius:var(--ct-radius);
  border:1px solid rgba(0,0,0,.06);
  background:linear-gradient(135deg, rgba(0,131,143,.08), rgba(255,209,92,.10));
  box-shadow:0 10px 22px rgba(0,0,0,.05);
}

.ct-trousse-img{
  width:100%;
  height:auto;
  border-radius:18px;
  box-shadow:0 10px 22px rgba(0,0,0,.10);
  background:rgba(255,255,255,.65);
}

.ct-trousse-title{
  margin:0;
  font-size:22px;
  font-weight:900;
  color:var(--ct-accent);
  letter-spacing:.01em;
}

.ct-trousse-sub{
  margin:6px 0 0;
  color:var(--ct-muted);
  font-size:14px;
  line-height:1.35;
}

.ct-trousse-badges{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.ct-miniBadge{
  font-size:12px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--ct-line);
  background:rgba(255,255,255,.92);
}
.ct-miniBadge--free{color:#0a6b26;border-color:rgba(0,160,60,.25)}
.ct-miniBadge--premium{color:var(--ct-prem);border-color:rgba(255,209,92,.65)}
.ct-miniBadge--tip{color:#063a3e;border-color:rgba(0,131,143,.25);background:rgba(0,131,143,.08)}

@media (max-width: 820px){
  .ct-trousse-banner{grid-template-columns:1fr;}
  .ct-trousse-img{max-width:520px;justify-self:center;}
}

/* Search */
.ct-tools-controls{display:flex;align-items:center;justify-content:flex-start;gap:10px;flex-wrap:wrap}

.ct-search{
  position: relative;
  display:flex;
  align-items:center;
  gap:8px;
  padding:12px 14px 12px 52px;
  border-radius:999px;
  border:1px solid var(--ct-line);
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,246,218,.70) 100%);
  min-width:min(560px, 100%);
  box-shadow:0 8px 18px rgba(0,0,0,.06);
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.ct-search::before{
  content: "🔎";
  position:absolute;
  left:14px;
  top:50%;
  transform: translateY(-50%);
  width:28px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(255,224,138,.55) 0%, rgba(0,131,143,.10) 100%);
  box-shadow: 0 6px 14px rgba(0,0,0,.06);
  font-size:16px;
}
.ct-search:focus-within{
  border-color: rgba(0,131,143,.35);
  box-shadow:0 12px 26px rgba(0,0,0,.09);
}
.ct-search input{
  border:0;
  outline:none;
  width:100%;
  background: transparent;
  font-family:inherit;
  font-size:15px;
}
.ct-search input::placeholder{
  color: rgba(0,0,0,.45);
}

/* Catégories : gros boutons ronds (ludiques) */
.ct-chips{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:center;
  width: 100%; /* garantit un centrage réel (responsive) */
}

/* Espace entre les ronds et la barre de recherche (évite tout "contact") */
.ct-chipsRow{ margin: 10px 0 18px; }

/* Wrapper : titre au-dessus du rond */
.ct-chipWrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  min-width:112px;
}

.ct-chipTitle{
  font-weight:900;
  font-size:17px;
  letter-spacing:.02em;
  color:#0a4b50;
  text-align:center;
  line-height:1.05;
  text-transform:uppercase;
}

.ct-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--ct-line);
  background:#fff;
  font-weight:900;
  cursor:pointer;
  user-select:none;
}

.ct-chipCircle{
  width:118px;
  height:118px;
  border-radius:999px;
  flex-direction:column;
  gap:6px;
  padding:12px;
  box-shadow:0 10px 22px rgba(0,0,0,.06);
  transition:transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.ct-chipCircle:hover{transform:translateY(-2px);box-shadow:var(--ct-shadow)}

.ct-chipEmoji{font-size:34px;line-height:1;}
/* Ancien libellé dans le rond : on le garde au cas où il serait réutilisé ailleurs, mais il est désormais invisible dans les chips ronds */
.ct-chipLabel{font-size:12px;letter-spacing:.02em;}

@media (max-width: 520px){
  .ct-chipTitle{font-size:14px;}
  .ct-chipWrap{gap:8px;min-width:92px;}
  .ct-chipCircle{width:96px;height:96px;}
  .ct-chipEmoji{font-size:30px;}
}

/* Couleurs par catégorie (data-ct-cat) */
.ct-chipCircle[data-ct-cat="all"]{background:linear-gradient(135deg, var(--ct-yellow2), #fff);}
.ct-chipCircle[data-ct-cat="outils"]{background:linear-gradient(135deg, rgba(0,131,143,.14), #fff);}
.ct-chipCircle[data-ct-cat="lecture"]{background:linear-gradient(135deg, var(--ct-pink2), #fff);}
.ct-chipCircle[data-ct-cat="histoires"]{background:linear-gradient(135deg, rgba(0,131,143,.10), var(--ct-yellow2));}
.ct-chipCircle[data-ct-cat="jeux"]{background:linear-gradient(135deg, var(--ct-pink2), var(--ct-yellow2));}

/* Harmonisation : tous les boutons ronds en JAUNE clair dégradé (y compris nouvelles catégories) */
.ct-chipCircle{
  background:linear-gradient(135deg, var(--ct-yellow2), #fff) !important;
}

.ct-chip[aria-pressed="true"]{
  border-color:rgba(0,0,0,.14);
  box-shadow:0 14px 34px rgba(0,0,0,.10);
  filter:saturate(1.05);
}

@media (max-width: 520px){
  .ct-chipCircle{width:96px;height:96px;}
  .ct-chipEmoji{font-size:30px;}
  .ct-chipLabel{font-size:11px;}
}

@media (max-width: 720px){
  .ct-tools-heroTop{flex-direction:column;align-items:flex-start}
  .ct-tools-actions{justify-content:flex-start}
  .ct-search{min-width:100%}
}

/* Layout 2 colonnes : gauche (catégories) / droite (cartes) */
.ct-hubLayout{
  margin-top:14px;
  display:grid;
  grid-template-columns: 290px 1fr;
  gap:14px;
  align-items:start;
}

.ct-hubSide{
  position:sticky;
  top:64px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.ct-hubMain{min-width:0;}

.ct-sideLinkCard{
  display:block;
  text-decoration:none;
  color:inherit;
  border:1px solid var(--ct-line);
  border-radius:var(--ct-radius);
  background:rgba(255,255,255,.88);
  box-shadow:0 10px 22px rgba(0,0,0,.05);
  overflow:hidden;
  transition:transform .15s ease, box-shadow .15s ease;
}
.ct-sideLinkCard:hover{transform:translateY(-2px);box-shadow:var(--ct-shadow)}

.ct-sideLinkImg{width:100%;height:auto;display:block;background:#fff}

.ct-sideLinkBody{padding:12px 14px}
.ct-sideLinkTitle{font-weight:900;color:var(--ct-accent);font-size:16px}
.ct-sideLinkSub{margin-top:4px;color:var(--ct-muted);font-size:13px;line-height:1.25}

.ct-sideBlock{
  border:1px solid var(--ct-line);
  border-radius:var(--ct-radius);
  background:rgba(255,255,255,.78);
  box-shadow:0 10px 22px rgba(0,0,0,.05);
  padding:12px 12px;
}
.ct-sideBlockTitle{
  font-weight:900;
  color:#0a4b50;
  font-size:14px;
  margin:0 0 10px;
}

.ct-sideChips .ct-chip,
.ct-catList .ct-chip{
  width:100%;
  justify-content:flex-start;
  border-radius:16px;
}

.ct-sideChips,
.ct-catList{display:flex;flex-direction:column;gap:8px}

/* Ressources à la une */
.ct-featured{
  margin:0 0 14px;
}
.ct-featuredHead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 4px 10px}
.ct-featuredTitle{margin:0;font-size:16px}
.ct-featuredGrid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}
.ct-featuredGrid .ct-cardMedia{height:220px}
.ct-featuredGrid .ct-cardTitle{font-size:18px}

@media (max-width: 980px){
  .ct-hubLayout{grid-template-columns:1fr;}
  .ct-hubSide{position:relative;top:auto;}
  .ct-featuredGrid{grid-template-columns:repeat(2, minmax(0, 1fr));}
}
@media (max-width: 620px){
  .ct-featuredGrid{grid-template-columns:1fr;}
}

/* Sections */
.ct-grid{margin-top:0}
.ct-section{margin-top:12px}
.ct-sectionTitle{margin:0;font-size:16px}

/* Sections repliables (réduit le scroll, plus agréable) */
.ct-sectionDetails{
  border:1px solid var(--ct-line);
  border-radius:var(--ct-radius);
  /* Cadres des sections (capture) : saumon très clair */
  background:linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  box-shadow:0 10px 22px rgba(0,0,0,.05);
  overflow:hidden;
}
.ct-sectionSummary{
  list-style:none;
  cursor:default;
  user-select:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  font-weight:900;
  color:#0a4b50;
}
.ct-sectionSummary::-webkit-details-marker{display:none}
.ct-sectionSummary::after{
  content:"";
  display:none;
}
.ct-sectionDetails[open] .ct-sectionSummary::after{content:"";display:none;}
.ct-count{
  flex:0 0 auto;
  font-size:12px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(0,131,143,.08);
}
.ct-sectionInner{padding:0 14px 14px;}

.ct-sectionGrid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}
@media (min-width: 1180px){.ct-sectionGrid{grid-template-columns:repeat(4, minmax(0, 1fr));}}
@media (max-width: 980px){.ct-sectionGrid{grid-template-columns:repeat(2, minmax(0, 1fr));}}
@media (max-width: 620px){.ct-sectionGrid{grid-template-columns:1fr;}}

/* Card */
.ct-card{
  -webkit-appearance:none;
  appearance:none;
  display:block;
  width:100%;
  text-align:left;
  border:1px solid var(--ct-line);
  border-radius:var(--ct-radius);
  overflow:hidden;
  background:var(--ct-card);
  box-shadow:0 10px 22px rgba(0,0,0,.06);
  text-decoration:none;
  color:inherit;
  padding:0;
  cursor:pointer;
}
.ct-card:hover{box-shadow:var(--ct-shadow)}
.ct-card--premium{border-color:rgba(255,209,92,.55)}
.ct-card--locked{opacity:.92}

.ct-cardMedia{
  position:relative;
  aspect-ratio: 16 / 9;
  height:auto;
  min-height:150px;
  background:linear-gradient(135deg, rgba(0,131,143,.07), rgba(255,209,92,.10));
}
.ct-cardMedia img{
  width:100%;
  height:100%;
  object-fit:contain;
  background:rgba(255,255,255,.70);
  padding:8px;
  display:block;
}

/* Badges : affichage AU-DESSUS de l’image (ne masque plus le visuel) */
.ct-cardBadgesRow{
  padding:10px 12px 0;
}
.ct-cardBadgesRow .ct-cornerBadges{
  position:static;
  left:auto;
  top:auto;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
/* Petit souffle entre badges et image */
.ct-cardMedia{
  margin-top:8px;
}

@media (max-width: 620px){
  .ct-cardMedia{min-height:140px;}
}

.ct-cornerBadges{
  position:absolute;
  left:10px;
  top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.ct-badge{
  font-size:12px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--ct-line);
  background:rgba(255,255,255,.92);
}

.ct-badge--free{color:#0a6b26;border-color:rgba(0,160,60,.25)}
.ct-badge--premium{color:var(--ct-prem);border-color:rgba(255,209,92,.65)}
.ct-badge--unlocked{color:#0f5132;border-color:rgba(15,81,50,.18)}
.ct-badge--new{
  color:#7a1b4f;
  border-color:rgba(255,120,180,.55);
  background:linear-gradient(90deg, rgba(255,210,230,.92), rgba(240,220,255,.92));
}

.ct-lockOverlay{
  position:absolute;
  inset:0;
  background:rgba(255,255,255,.58);
  display:flex;
  align-items:center;
  justify-content:center;
}
.ct-lockPill{
  background:rgba(0,0,0,.70);
  color:#fff;
  width:52px;
  height:52px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
}

.ct-cardBody{padding:12px 14px 14px}
.ct-imagesOnly .ct-cardBody{
  /* On garde les textes dans le DOM (recherche/filtrage), mais on les masque visuellement */
  padding:0 !important;
  height:0 !important;
  overflow:hidden !important;
  opacity:0 !important;
}
.ct-imagesOnly .ct-cardTitleRow,
.ct-imagesOnly .ct-cardTitle,
.ct-imagesOnly .ct-tag{
  display:none !important;
}

.ct-cardTitleRow{display:flex;align-items:center;gap:10px;justify-content:space-between}
.ct-cardTitle{margin:0;font-size:16px;letter-spacing:.01em}
.ct-tag{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(0,131,143,.08);
  font-weight:900;
  font-size:12px;
  white-space:nowrap;
}

.ct-empty{margin:16px 6px;color:var(--ct-muted)}

/* Bloc "Comment ajouter une ressource" (optionnel) */
.ct-howto{
  margin-top:18px;
  border:1px solid var(--ct-line);
  border-radius:var(--ct-radius);
  background:rgba(255,255,255,.78);
  box-shadow:0 10px 22px rgba(0,0,0,.05);
  padding:12px 14px;
}
.ct-howto summary{cursor:pointer;font-weight:900}
.ct-howto p{margin:8px 0 0;color:var(--ct-muted);line-height:1.35}
.ct-code{
  margin-top:10px;
  background:#0b0f11;
  color:#e8f1f2;
  border-radius:16px;
  padding:10px 12px;
  overflow:auto;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:12px;
}

/* Modal */
.ct-modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.35);z-index:999}
.ct-modal[aria-hidden="true"]{display:none}
.ct-modalBox{width:min(520px, 100%);background:#fff;border-radius:22px;box-shadow:var(--ct-shadow);overflow:hidden}
.ct-modalHead{display:flex;gap:10px;justify-content:space-between;align-items:flex-start;padding:16px 16px 10px}
.ct-modalTitle{margin:0;font-size:18px}
.ct-modalText{margin:6px 0 0;color:var(--ct-muted)}
.ct-close{border:0;background:transparent;font-size:18px;cursor:pointer}
.ct-modalActions{display:flex;justify-content:flex-end;gap:10px;padding:0 16px 16px}
.ct-btn{display:inline-flex;align-items:center;gap:8px;text-decoration:none;border-radius:999px;padding:10px 14px;font-weight:900;border:1px solid var(--ct-line)}
.ct-btn--go{background:var(--ct-accent);color:#fff;border-color:rgba(0,131,143,.4)}

/* Footer */
.ct-footer{
  margin-top:18px;
  text-align:center;
  color:var(--ct-muted);
  font-size:13px;
}
.ct-footer a{color:inherit}
