:root{
  --bg:#EAF3FF; --surface:#FFFFFF; --ink:#1E2440; --muted:#59607A;
  --stroke:#1E2440; --soft:#D5E3FA; --primary:#2F6BFF; --on-primary:#FFFFFF;
  --good:#1E9E6A; --bad:#D9384F;
  --animaux:#FFC93C; --espace:#9C8CFF; --corps:#FF7F9C; --terre:#FF9447;
  --on-tile:#1E2440;
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#131731; --surface:#1E2348; --ink:#F2F4FF; --muted:#B1B6D6;
    --stroke:#05070F; --soft:#2A3060; --primary:#7FA2FF; --on-primary:#0C1030;
    --good:#4CD69B; --bad:#FF7A8C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --bg:#131731; --surface:#1E2348; --ink:#F2F4FF; --muted:#B1B6D6;
  --stroke:#05070F; --soft:#2A3060; --primary:#7FA2FF; --on-primary:#0C1030;
  --good:#4CD69B; --bad:#FF7A8C;
  color-scheme: dark;
}
:root{ box-sizing:border-box; padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px); }
*,*::before,*::after{ box-sizing:inherit; }
html{ scroll-padding-top:env(safe-area-inset-top,0px); }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font:400 1.0625rem/1.65 "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}
h1,h2,h3,.brand{ font-family:"Baloo 2", "Trebuchet MS", system-ui, sans-serif; line-height:1.15; margin:0; }
a{ color:var(--primary); }
button{ font:inherit; color:inherit; }
:focus-visible{ outline:3px solid var(--primary); outline-offset:3px; border-radius:12px; }
.wrap{ max-width:720px; margin:0 auto; padding:16px 18px 48px; }
img{ max-width:100%; }

/* En-tête */
.top{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.brand{ font-size:2rem; font-weight:800; color:var(--ink); text-decoration:none; letter-spacing:-.01em; }
.iconbtn{
  border:2.5px solid var(--stroke); background:var(--surface); border-radius:14px;
  padding:6px 12px; cursor:pointer; font-weight:700; font-size:1rem;
}

/* Recherche */
.search{ display:flex; gap:8px; margin-bottom:28px; }
.search input{
  flex:1; min-width:0; font:inherit; font-size:1.15rem; color:var(--ink);
  background:var(--surface); border:3px solid var(--stroke); border-radius:18px;
  padding:14px 16px; box-shadow:4px 4px 0 var(--stroke);
}
.search input::placeholder{ color:var(--muted); }
.search button{
  border:3px solid var(--stroke); background:var(--primary); color:var(--on-primary);
  border-radius:18px; padding:0 18px; font-weight:700; cursor:pointer; box-shadow:4px 4px 0 var(--stroke);
}

/* Autocollants de thèmes : l’élément signature */
.section-title{ font-size:1.5rem; font-weight:800; margin:0 0 12px; }
.themes{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:34px; }
.tile{
  display:flex; flex-direction:column; align-items:flex-start; gap:4px;
  text-align:left; border:3px solid var(--stroke); border-radius:22px;
  padding:14px 14px 16px; color:var(--on-tile); text-decoration:none;
  box-shadow:5px 5px 0 var(--stroke); transition:transform .12s, box-shadow .12s;
}
.tile:nth-child(odd){ transform:rotate(-0.6deg); }
.tile:nth-child(even){ transform:rotate(0.6deg); }
.tile:hover{ transform:rotate(0) translate(-2px,-2px); box-shadow:7px 7px 0 var(--stroke); }
.tile:active{ transform:translate(3px,3px); box-shadow:2px 2px 0 var(--stroke); }
.tile .emo{ font-size:2.2rem; line-height:1; }
.tile strong{ font-family:"Baloo 2", system-ui, sans-serif; font-size:1.3rem; font-weight:800; }
.tile small{ font-size:.95rem; }
.t-animaux{ background:var(--animaux); } .t-espace{ background:var(--espace); }
.t-corps{ background:var(--corps); } .t-terre{ background:var(--terre); }

/* Cartes calmes */
.card{ background:var(--surface); border:2px solid var(--soft); border-radius:20px; padding:18px; margin-bottom:18px; }
.daily{ display:flex; gap:16px; align-items:center; text-decoration:none; color:var(--ink); }
.daily .bubble{ flex:none; width:72px; height:72px; border-radius:50%; display:grid; place-items:center; font-size:2.4rem; border:3px solid var(--stroke); }
.daily h3{ font-size:1.4rem; }
.daily p{ margin:2px 0 0; color:var(--muted); font-size:1rem; }
.progress{ color:var(--muted); font-size:1rem; margin:8px 0 0; }
.list{ list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.list a{
  display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--ink);
  background:var(--surface); border:2px solid var(--soft); border-radius:16px; padding:12px 14px;
}
.list a:hover{ border-color:var(--stroke); }
.list .e{ font-size:1.8rem; }
.list b{ font-family:"Baloo 2", system-ui, sans-serif; font-size:1.2rem; }
.list span.d{ display:block; color:var(--muted); font-size:.95rem; }

/* Article */
.back{ display:inline-flex; align-items:center; gap:6px; margin-bottom:14px; text-decoration:none; font-weight:700; color:var(--ink); }
.hero{ display:flex; align-items:center; gap:16px; margin-bottom:16px; }
.hero .bubble{ flex:none; width:76px; height:76px; border-radius:50%; display:grid; place-items:center; font-size:2.6rem; border:3px solid var(--stroke); box-shadow:4px 4px 0 var(--stroke); }
.hero h1{ font-size:clamp(2.1rem, 8vw, 2.9rem); font-weight:800; }
.chip{ display:inline-block; font-size:.9rem; font-weight:700; padding:2px 10px; border-radius:99px; border:2px solid var(--stroke); color:var(--on-tile); margin-bottom:4px; text-decoration:none; }
.actions{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:20px; }
.actions button{
  border:2.5px solid var(--stroke); background:var(--surface); border-radius:14px;
  padding:8px 14px; font-weight:700; cursor:pointer;
}
.actions button[aria-pressed="true"]{ background:var(--animaux); color:var(--on-tile); }
.essentiel h2{ font-size:1.3rem; margin-bottom:6px; }
.essentiel ul{ margin:0; padding-left:1.2em; }
.essentiel li{ margin:4px 0; }
.body p{ margin:0 0 1em; max-width:65ch; }
.body a.int{ font-weight:700; text-decoration-thickness:2px; text-underline-offset:3px; }
.fact{ border:3px dashed var(--stroke); border-radius:20px; padding:16px 18px; margin:8px 0 26px; }
.fact h2{ font-size:1.25rem; margin-bottom:4px; }
.fact p{ margin:0; }

/* Quiz */
.quiz h2{ font-size:1.5rem; margin-bottom:12px; }
.q{ margin-bottom:18px; }
.q p{ font-weight:700; margin:0 0 8px; }
.opts{ display:grid; gap:8px; }
.opts button{
  text-align:left; border:2.5px solid var(--soft); background:var(--bg); border-radius:14px;
  padding:10px 14px; cursor:pointer;
}
.opts button:hover:not(:disabled){ border-color:var(--stroke); }
.opts button.ok{ border-color:var(--good); background:color-mix(in srgb, var(--good) 18%, var(--surface)); font-weight:700; }
.opts button.ko{ border-color:var(--bad); background:color-mix(in srgb, var(--bad) 14%, var(--surface)); }
.opts button:disabled{ cursor:default; }
.score{ font-family:"Baloo 2", system-ui, sans-serif; font-size:1.3rem; font-weight:800; margin:4px 0 0; }

.source{ font-size:.95rem; color:var(--muted); border-top:2px solid var(--soft); padding-top:14px; margin-top:28px; }
.source p{ margin:0 0 6px; }
.empty{ text-align:center; padding:28px 12px; }
.empty .big{ font-size:3rem; }
.foot{ font-size:.9rem; color:var(--muted); text-align:center; margin-top:40px; }

/* Sélecteur de niveau */
.m-animaux{ --mat:var(--animaux); } .m-espace{ --mat:var(--espace); } .m-corps{ --mat:var(--corps); } .m-terre{ --mat:var(--terre); }
.level{ position:relative; display:grid; grid-template-columns:1fr 1fr; background:var(--surface); border:3px solid var(--stroke); border-radius:18px; padding:4px; margin:0 0 6px; box-shadow:4px 4px 0 var(--stroke); }
.level::before{ content:""; position:absolute; top:4px; bottom:4px; left:4px; width:calc(50% - 4px); border-radius:13px; background:var(--mat); border:2.5px solid var(--stroke); transition:transform .2s ease; }
.level[data-l="p"]::before{ transform:translateX(100%); }
.level button{ position:relative; z-index:1; background:none; border:0; padding:8px 6px; cursor:pointer; text-align:center; border-radius:13px; }
.level b{ display:block; font-family:"Baloo 2", system-ui, sans-serif; font-size:1.15rem; font-weight:800; }
.level span{ font-size:.85rem; color:var(--muted); }
.level button[aria-pressed="true"], .level button[aria-pressed="true"] span{ color:var(--on-tile); }
.lvl-hint{ font-size:.95rem; color:var(--muted); margin:0 0 16px; }
dl.keys{ margin:0; display:grid; gap:10px; }
dl.keys dt{ font-weight:700; }
dl.keys dd{ margin:0; }
.q .lv{ font-weight:400; font-size:.8rem; color:var(--muted); margin-left:6px; }

@media (prefers-reduced-motion: reduce){
  .level::before{ transition:none; }
  .tile, .tile:hover, .tile:active{ transition:none; transform:none; }
}
@media (max-width:380px){
  .themes{ gap:12px; }
  .tile .emo{ font-size:2.2rem; }
}

/* Logo et titre repris d’AthenaBoard */
.brand{ display:inline-flex; align-items:center; gap:10px; }
.brand-logo{ flex:none; width:30px; height:35px; background:var(--primary);
  -webkit-mask:url("logo-mask.png") center/contain no-repeat; mask:url("logo-mask.png") center/contain no-repeat; }
.brand-name{ font:700 1.5rem/1.1 "Atkinson Hyperlegible","Segoe UI",system-ui,sans-serif; letter-spacing:-.01em; }
.brand-name b{ color:var(--primary); }

/* Image d’article et crédit */
.photo{ margin:0 0 16px; }
.photo img{ display:block; width:100%; max-height:380px; object-fit:contain; background:var(--soft); border:3px solid var(--stroke); border-radius:18px; box-shadow:4px 4px 0 var(--stroke); }
.photo figcaption{ margin-top:8px; font-size:.85rem; color:var(--muted); }

/* Pages légales */
.legal h1{ font-size:2rem; margin-bottom:12px; }
.legal h2{ font-size:1.25rem; margin:22px 0 6px; }
.legal p{ margin:0 0 10px; }
.foot a{ white-space:nowrap; }
