/* Salle112 · Portail d'entraînements mobile-first · v0.38.1
   Portée strictement limitée à public/entrainements.php.
   Les feuilles des exercices ne sont pas modifiées. */
:root{font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color-scheme:light;
  --ink:#15375f;--muted:#5a6f83;--line:#e2e9ef;--blue:#1d5395;--green:#24814b;
  --surface:#fff;--shadow:0 8px 24px rgba(21,55,95,.07)}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-width:320px;background:#fff;color:var(--ink)}
a{color:inherit}
button,input{font:inherit}
button{cursor:pointer}
a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid #e8a630;outline-offset:3px}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.skip{position:absolute;left:12px;top:-90px;padding:11px 15px;background:white;z-index:100}.skip:focus{top:9px}
.ribbon{height:5px;background:linear-gradient(90deg,#1e5798 0%,#239251 58%,#ffb83f 100%)}
.container{width:min(1130px,calc(100% - 44px));margin-inline:auto}
.header{min-height:75px;display:flex;align-items:center;justify-content:space-between;gap:15px}
.brand{display:flex;align-items:center;gap:9px;text-decoration:none;font-weight:850;font-size:1.3rem;letter-spacing:-.055em;color:#163967;white-space:nowrap}
.brand img{width:42px;height:40px;object-fit:contain}.brand span{color:#24814b}
.account{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap}
.account a{display:inline-flex;justify-content:center;align-items:center;min-height:40px;border-radius:11px;padding:10px 13px;text-decoration:none;font-size:.87rem;font-weight:760}
.account-main{background:#eaf3ff;color:#194e85}.account-main:hover{background:#dcecff}
.account-extra{color:#395776}.account-extra:hover{background:#f1f5fa}
h1,h2,h3,p{margin-top:0}h1,h2,h3{letter-spacing:-.043em}
.content{min-height:calc(100vh - 180px);padding:16px 0 64px}
.breadcrumbs{display:flex;align-items:center;gap:9px;font-size:.86rem;font-weight:780;margin:3px 0 18px;color:#718397}
.breadcrumbs a{color:#1d6680;text-decoration:none}.breadcrumbs a:hover{text-decoration:underline}
.breadcrumbs strong{color:var(--level-color)}
.level-6e{--level-color:#1e5a99;--level-soft:#e7f3ff;--level-border:#9dc4e9;--level-strong:#184c81}
.level-5e{--level-color:#176f41;--level-soft:#e4f6e9;--level-border:#91cfa7;--level-strong:#17613c}
.level-4e{--level-color:#986314;--level-soft:#fff1cf;--level-border:#edc56f;--level-strong:#82510b}
.level-3e{--level-color:#7551a6;--level-soft:#f0e6fb;--level-border:#c4a8e3;--level-strong:#623c90}
.level-all{--level-color:#1d5395;--level-soft:#e8f2ff;--level-border:#afcef0;--level-strong:#174875}
.hero{position:relative;display:flex;align-items:center;justify-content:space-between;gap:16px;border-radius:25px;background:linear-gradient(115deg,var(--level-soft) 0%,#fff 83%);border:1px solid #e2ebf2;overflow:hidden;padding:29px clamp(18px,3vw,36px);margin-bottom:19px}
.hero-text{position:relative;z-index:1;min-width:0}
.eyebrow{display:block;color:var(--level-color);font-weight:850;letter-spacing:.082em;font-size:.76rem;text-transform:uppercase;margin-bottom:10px}
.hero h1{font-size:clamp(2rem,4.2vw,3.5rem);line-height:1.08;margin:0 0 11px;max-width:22ch;font-weight:850;color:#153b70}
.hero p{font-size:1.05rem;line-height:1.5;margin:0;color:#4d6276}
.level-ink{color:var(--level-color)}
.level-switch{display:flex;gap:6px;flex:0 0 auto;align-self:flex-start;justify-content:flex-end;flex-wrap:wrap}
.level-switch a{display:grid;place-items:center;min-height:46px;min-width:48px;border-radius:13px;text-decoration:none;border:1px solid #d7e5f1;background:#fff;color:#6b8095;font-size:1rem;font-weight:850;transition:transform .15s,box-shadow .15s}
.level-switch a:hover{transform:translateY(-2px)}
.level-switch a.active{background:var(--level-color);color:#fff;border-color:var(--level-color);box-shadow:0 6px 15px rgba(21,55,95,.13)}
.hero-all{margin-top:12px;min-height:195px;background:linear-gradient(115deg,#eff7ff,#fff 72%,#f0fbf3)}
.hero-doodle{display:grid;place-items:center;flex:0 0 180px;min-height:120px;position:relative}
.hero-doodle span:first-child{background:#fff;box-shadow:0 10px 25px rgba(33,80,120,.09);border:1px solid #d9e7f3;border-radius:17px;padding:16px 20px;font-size:1.35rem;font-weight:860;color:#1c5a94;transform:rotate(-5deg)}
.hero-doodle span:last-child{position:absolute;right:2px;bottom:10px;display:grid;place-items:center;background:#e0f7e5;border:1px solid #b9e2c3;color:#1e7a43;font-weight:900;width:48px;height:48px;border-radius:50%;font-size:1.5rem}
.section-heading{margin:27px 0 17px}.section-heading h2{font-size:clamp(1.48rem,2.4vw,1.9rem);margin:0 0 5px;font-weight:820}
.section-heading p{margin:0;color:#667c8e;font-size:.95rem;line-height:1.45}
.level-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.level-card{position:relative;display:grid;place-items:center;min-height:112px;border-radius:19px;text-decoration:none;border:2px solid;box-shadow:var(--shadow);transition:transform .18s,box-shadow .18s}
.level-card:hover{transform:translateY(-3px);box-shadow:0 12px 24px rgba(21,55,95,.13)}
.level-card strong{font-weight:850;font-size:3rem;line-height:1;letter-spacing:-.055em}
.level-card span{position:absolute;right:15px;top:15px;font-size:1.23rem;font-weight:900;opacity:.65}
.level-card-6e{background:#daebff;border-color:#96bee8;color:#1e5a99}
.level-card-5e{background:#d8f2df;border-color:#8dcca3;color:#196c40}
.level-card-4e{background:#ffebbb;border-color:#e8bf64;color:#906011}
.level-card-3e{background:#eddffb;border-color:#bca0e0;color:#744fa2}
/* Au lieu d'afficher 20 chapitres, le choix démarre par 4 familles. */
.themes{margin-top:8px}
.themes-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:13px}
.theme{display:flex;flex-direction:column;align-items:flex-start;text-align:left;min-height:190px;padding:18px 18px 16px;border:2px solid var(--tile-border);border-radius:21px;background:var(--tile-bg);color:var(--tile-ink);box-shadow:0 6px 19px rgba(21,55,95,.055);transition:transform .17s,border-color .17s,box-shadow .17s}
.theme:not([hidden]):hover{transform:translateY(-3px);box-shadow:0 13px 26px rgba(21,55,95,.11)}
.theme[aria-pressed="true"]{box-shadow:0 0 0 3px #fff,0 0 0 6px var(--tile-border),0 10px 25px rgba(21,55,95,.1)}
.theme-icon{display:grid;place-items:center;width:61px;height:61px;margin-bottom:17px;border-radius:16px;background:#fff9;box-shadow:0 3px 10px rgba(20,57,95,.035)}
.theme-icon svg{width:48px;height:48px}
.theme strong{font-size:1.05rem;line-height:1.18;letter-spacing:-.02em;font-weight:850}
.theme-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;padding-top:15px;width:100%}
.theme-foot small{font-size:.8rem;font-weight:730}
.theme-foot > span{font-weight:900;font-size:1.3rem;line-height:1}
.theme-nombres{--tile-bg:#eaf3ff;--tile-ink:#21598e;--tile-border:#aecdf0}
.theme-geometrie{--tile-bg:#f1eafb;--tile-ink:#694b9b;--tile-border:#cbb6e9}
.theme-grandeurs{--tile-bg:#fff3d7;--tile-ink:#8c590f;--tile-border:#eac982}
.theme-scratch{--tile-bg:#e7f7eb;--tile-ink:#207348;--tile-border:#acdcb9}
.browse-all{display:flex;justify-content:center;margin:18px 0 0}
.browse-button{display:inline-flex;align-items:center;gap:12px;padding:10px 17px;border-radius:12px;background:#fff;color:#235587;border:1px solid #cadae9;font-size:.92rem;font-weight:800;min-height:44px}
.browse-button:hover{background:#f4f9ff}
/* La liste complète est un fallback HTML sans JS : aucun chapitre ne devient inaccessible. */
.chapters{scroll-margin-top:17px;margin-top:28px;background:linear-gradient(180deg,#f6f9ff,#fff 50%);border:1px solid #e4ecf5;border-radius:23px;padding:24px 22px 27px}
.chapters.is-pending{display:none}
.chapter-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:17px}
.chapter-header h2{font-size:clamp(1.4rem,2.4vw,1.85rem);margin:2px 0 5px;font-weight:850}
.chapter-header p{font-size:.89rem;color:#60768b;margin:0;line-height:1.4}
.chapter-step{color:var(--level-color);letter-spacing:.09em;font-size:.71rem;font-weight:900}
.chapter-count{font-size:.83rem;color:#47667b;font-weight:730;white-space:nowrap;border:1px solid #dae5ee;border-radius:999px;background:#fff;padding:7px 10px}
.chapter-search{display:flex;align-items:center;gap:11px;padding:0 13px;margin:0 0 18px;max-width:420px;border:1px solid #d2dfea;border-radius:12px;background:#fff;color:#67809a;min-height:47px}
.chapter-search:focus-within{outline:2px solid var(--level-border)}
.chapter-search input{height:46px;width:100%;min-width:0;border:0;outline:0;color:#14365e;background:transparent;font-size:.94rem}
.chapter-search input::placeholder{color:#7890a1}
.chapter-empty{padding:20px;color:#60758b;font-size:.94rem;background:#fff;border-radius:14px}
.chapter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.chapter-card,.chapter-card.new-program-card{position:relative;display:grid;grid-template-columns:77px minmax(0,1fr);align-items:stretch;gap:0;min-height:118px;border:1.5px solid #dbe6ef;border-radius:18px;overflow:hidden;background:#fff;box-shadow:0 5px 15px rgba(21,55,95,.045);text-decoration:none;transition:transform .16s,border-color .16s,box-shadow .16s}
.chapter-card:hover{border-color:var(--level-border);transform:translateY(-2px);box-shadow:0 11px 22px rgba(21,55,95,.10)}
.chapter-card:focus-visible{outline-offset:2px}
.chapter-icon{display:grid;place-items:center;padding:8px;background:var(--level-soft);color:var(--level-color)}
.chapter-icon svg{width:60px;height:60px;max-width:100%;stroke:currentColor;fill:none;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round}
.chapter-icon svg .accent{fill:var(--level-border);stroke:currentColor}
.chapter-icon svg .bars{stroke:currentColor;fill:none}
.chapter-icon svg text{fill:currentColor;stroke:none;font-size:12px;font-weight:850}
.chapter-icon.scratch-icon svg{stroke-width:2.5}
.chapter-copy{min-width:0;display:flex;flex-direction:column;justify-content:center;padding:15px 14px 14px 17px}
.chapter-kicker{display:block;font-weight:850;color:var(--level-color);font-size:.7rem;text-transform:uppercase;letter-spacing:.065em}
.chapter-copy h2{font-size:1.05rem;line-height:1.23;font-weight:830;letter-spacing:-.02em;margin:5px 0 12px;color:#17385e}
.chapter-copy p,.chapter-copy .program-badge{display:none}
.chapter-cta{display:inline-flex;align-items:center;gap:8px;color:var(--level-color);font-size:.84rem;font-weight:850;line-height:1}
.chapter-cta b{font-size:1rem}
.empty-level-card{padding:20px;border:1px dashed #aec9df;border-radius:18px;grid-column:1/-1}
.empty-level-card h2{font-size:1.2rem}.empty-level-card p{color:var(--muted)}
.footer{border-top:1px solid #ebf0f6;background:#153967;color:#eaf3ff}
.footer-inner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:15px;padding:24px 0;font-size:.83rem}
.footer-inner a{color:#fff;text-underline-offset:4px}
@media(max-width:920px){
  .themes-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .theme{min-height:152px;}
  .theme-icon{width:52px;height:52px;margin-bottom:10px}.theme-icon svg{width:41px;height:41px}
  .level-switch{align-self:center}
}
@media(max-width:650px){
  .container{width:calc(100% - 28px)}
  .header{min-height:65px}
  .brand{font-size:1.16rem}.brand img{width:36px;height:36px}
  .account a{font-size:.79rem;padding:8px 10px;min-height:38px}
  .account-extra{display:none!important}
  .content{padding:12px 0 44px}
  .breadcrumbs{margin:1px 0 13px}
  .hero{display:block;padding:23px 20px 22px;margin-bottom:15px;border-radius:19px}
  .hero h1{font-size:clamp(2rem,8vw,2.6rem);margin-bottom:10px}
  .hero p{font-size:.96rem}
  .eyebrow{font-size:.7rem}
  .hero-level .level-switch{justify-content:flex-start;margin-top:20px}
  .level-switch a{min-height:43px;min-width:50px}
  .hero-doodle{display:none}
  .level-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .level-card{min-height:115px}.level-card strong{font-size:2.5rem}
  .themes{margin-top:4px}.section-heading{margin:21px 0 13px}.section-heading h2{font-size:1.42rem}
  .section-heading p{font-size:.88rem}
  .themes-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .themes-grid.has-odd .theme.is-last-visible{grid-column:1/-1;min-height:126px}
  .theme{min-height:150px;padding:13px;border-radius:16px}
  .theme-icon{width:42px;height:42px;border-radius:12px;margin-bottom:13px}.theme-icon svg{width:32px;height:32px}
  .theme strong{font-size:.94rem}
  .theme-foot{padding-top:12px}.theme-foot small{font-size:.74rem}
  .browse-all{margin-top:12px}
  .chapters{padding:19px 14px 20px;border-radius:17px;margin-top:18px}
  .chapter-grid{grid-template-columns:1fr;gap:10px}
  .chapter-header h2{font-size:1.32rem}.chapter-header p{font-size:.8rem}
  .chapter-card,.chapter-card.new-program-card{grid-template-columns:65px minmax(0,1fr);min-height:108px;border-radius:15px}
  .chapter-icon svg{width:52px;height:52px}.chapter-copy{padding:12px 12px 12px 14px}
  .chapter-copy h2{font-size:1.01rem;margin:5px 0 10px}
  .chapter-cta{font-size:.8rem}
}
@media(max-width:370px){
  .container{width:calc(100% - 22px)}
  .hero{padding:19px 16px}
  .theme strong{font-size:.87rem}
  .theme{padding:12px;min-height:146px}
  .chapter-header{align-items:flex-start;flex-direction:column}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
