/* ==========================================================
   Caro & Guy — la classe, le tableau vert et l'horloge
   ========================================================== */

@font-face { font-family: "Andika"; src: url("../fonts/andika-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/andika-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Gochi Hand"; src: url("../fonts/gochi-hand-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --caro: #e0483c;
  --caro-fonce: #a92a20;
  --caro-clair: #ffe3df;
  --guy: #2f6fd6;
  --guy-fonce: #1d4c9e;
  --guy-clair: #dfeaff;
  --tableau: #2e5a43;
  --tableau-fonce: #1f4231;
  --bois: #9a6534;
  --bois-clair: #c88f57;
  --mur: #f6efdd;
  --papier: #fffdf7;
  --encre: #2b2b2b;
  --craie: #f3f0e6;
  --jaune: #ffd34d;
  --vert-ok: #2f9e55;
  --ombre: 0 3px 0 rgba(0,0,0,.06), 0 8px 24px rgba(60,40,10,.10);
  --rayon: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Andika", "Trebuchet MS", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--encre);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 40px, rgba(255,255,255,0) 40px 80px),
    var(--mur);
}
a { color: var(--guy-fonce); text-underline-offset: 3px; }
a:hover { color: var(--caro-fonce); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); margin-top: 1.4em; }
img, svg { max-width: 100%; }
.c-caro { color: var(--caro); font-weight: 700; }
.c-guy { color: var(--guy); font-weight: 700; }
.centre { text-align: center; }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 10; }

/* ---------- En-tête ---------- */
.site-entete {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem;
  padding: .6rem clamp(1rem, 3vw, 2rem);
  background: var(--papier);
  border-bottom: 6px solid var(--bois);
  box-shadow: 0 2px 0 var(--bois-clair) inset;
}
.logo { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--encre); }
.horloge.logo-horloge { width: 54px; height: 54px; flex: none; }
.logo-horloge .num-h { font-size: 22px; }
.logo-texte { display: flex; flex-direction: column; line-height: 1.1; }
.logo-nom { font-family: "Gochi Hand", cursive; font-size: 1.75rem; }
.logo-slogan { font-size: .85rem; color: #6b6355; }
.nav-principale { display: flex; flex-wrap: wrap; gap: .35rem; }
.nav-principale a {
  text-decoration: none; color: var(--encre); font-weight: 700; font-size: .95rem;
  padding: .4rem .8rem; border-radius: 999px;
}
.nav-principale a:hover, .nav-principale a[aria-current] { background: var(--guy-clair); color: var(--guy-fonce); }
.nav-principale .nav-jour { background: var(--jaune); }
.nav-principale .nav-jour:hover, .nav-principale .nav-jour[aria-current] { background: #ffc61a; color: var(--encre); }

.fil { max-width: 1060px; margin: .8rem auto 0; padding: 0 1rem; font-size: .9rem; color: #6b6355; }
.fil a { color: #6b6355; }

main { padding: 1rem clamp(.6rem, 3vw, 1.5rem) 2rem; }
.carte {
  max-width: 1060px; margin: 1rem auto; padding: clamp(1rem, 3vw, 2rem);
  background: var(--papier); border-radius: var(--rayon); box-shadow: var(--ombre);
}
.carte.petits { font-size: .95rem; }
.intro { font-size: 1.05rem; color: #4a4438; }
.surtitre { margin: 0 0 .3rem; color: var(--caro-fonce); font-weight: 700; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.classe-badge { display: inline-block; font-size: .8rem; font-weight: 700; color: #5b4a2c; background: #f6e7c4; padding: .1rem .55rem; border-radius: 999px; margin: 0; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-block; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--guy); color: #fff; border: 0; border-radius: 12px;
  padding: .65rem 1.2rem; text-decoration: none; box-shadow: 0 4px 0 var(--guy-fonce);
  transition: transform .08s;
}
.bouton:hover { color: #fff; filter: brightness(1.07); }
.bouton:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--guy-fonce); }
.bouton-2 { background: #fff; color: var(--guy-fonce); box-shadow: 0 4px 0 #c9d7f2, inset 0 0 0 2px #c9d7f2; }
.bouton-2:hover { color: var(--guy-fonce); }
.appel { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.5rem 0; }

/* ---------- Horloge ---------- */
.horloge { display: block; width: 100%; height: auto; overflow: visible; }
.horloge .num-h { font: 700 17px "Andika", sans-serif; text-anchor: middle; fill: #2b2b2b; }
.horloge .num-m { font: 700 10.5px "Andika", sans-serif; text-anchor: middle; fill: var(--guy); }
.horloge.mini { width: 84px; }
.horloge.grande { max-width: 440px; margin: 0 auto; }
.horloge .rot-caro, .horloge .rot-guy { transition: transform .45s cubic-bezier(.3,1.4,.6,1); }
.horloge.manipulable .aiguille { cursor: grab; }
.horloge.manipulable.glisse .aiguille { cursor: grabbing; }
.horloge.manipulable { touch-action: none; user-select: none; }
.horloge.manipulable.glisse .rot-caro, .horloge.manipulable.glisse .rot-guy { transition: none; }

/* ---------- La classe (accueil) ---------- */
.classe { max-width: 1100px; margin: 0 auto; }
.mur { padding: 1rem 0 0; display: flex; flex-direction: column; align-items: center; }
.horloge-murale {
  width: clamp(150px, 22vw, 210px); margin-bottom: -18px; position: relative; z-index: 2;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.25));
}
.horloge-murale .horloge > circle:first-of-type { stroke: var(--bois); stroke-width: 8; }

.tableau {
  position: relative; width: 100%;
  color: var(--craie);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.08), transparent 60%),
    radial-gradient(ellipse at 75% 80%, rgba(255,255,255,.05), transparent 55%),
    linear-gradient(160deg, var(--tableau), var(--tableau-fonce));
  border: 14px solid var(--bois);
  border-radius: 8px;
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.25), inset 0 0 40px rgba(0,0,0,.35), 0 10px 22px rgba(60,40,10,.25), 0 0 0 3px var(--bois-clair);
  padding: clamp(2rem, 4vw, 2.8rem) clamp(1rem, 4vw, 3rem) 2.6rem;
  text-align: center;
}
.craie { font-family: "Gochi Hand", cursive; color: var(--craie); text-shadow: 0 0 1px rgba(255,255,255,.6), 0 0 6px rgba(255,255,255,.12); letter-spacing: .01em; }
h1.craie { font-weight: 400; font-size: clamp(1.9rem, 5vw, 3.2rem); margin: .2rem 0 .8rem; }
.craie-petit { font-size: 1.3rem; }
.craie-caro { color: #ff9e93; }
.craie-guy { color: #a8c9ff; }
.craie-classe { opacity: .8; }
.tableau-date { position: absolute; top: .4rem; left: 1rem; margin: 0; font-size: 1.15rem; opacity: .85; text-decoration: underline; text-decoration-thickness: 1px; }
.tableau-boutons { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin: 1.2rem 0 .4rem; }
.bouton-craie {
  font-family: "Gochi Hand", cursive; font-size: 1.35rem; text-decoration: none;
  color: var(--tableau-fonce); background: var(--craie); padding: .45rem 1.3rem; border-radius: 10px;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
}
.bouton-craie:hover { color: var(--tableau-fonce); background: #fff; }
.bouton-craie-2 { background: transparent; color: var(--craie); box-shadow: inset 0 0 0 2px var(--craie); }
.bouton-craie-2:hover { background: rgba(255,255,255,.1); color: #fff; }
.rebord {
  position: absolute; left: -14px; right: -14px; bottom: -26px; height: 14px;
  background: linear-gradient(var(--bois-clair), var(--bois)); border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 6px rgba(0,0,0,.2);
}
.craie-baton { position: absolute; bottom: 10px; left: 18%; width: 42px; height: 9px; background: #fff; border-radius: 3px; }
.craie-baton.jaune { left: calc(18% + 54px); width: 30px; background: var(--jaune); transform: rotate(-6deg); }
.eponge { position: absolute; bottom: 10px; right: 16%; width: 70px; height: 20px; background: #5a4a7a; border-radius: 4px; box-shadow: inset 0 -6px 0 #d9c58a; }

/* Présentation des personnages */
.presentation { max-width: 1060px; margin: 3rem auto 1rem; text-align: center; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.duo-carte { background: var(--papier); border-radius: var(--rayon); padding: 1.2rem; box-shadow: var(--ombre); border-top: 8px solid; }
.duo-caro { border-color: var(--caro); }
.duo-guy { border-color: var(--guy); }
.duo-carte .perso { width: 110px; height: 140px; }
.retenir { font-size: 1.25rem; margin-top: 1.2rem; }

/* Étapes / pupitres */
.etapes { max-width: 1060px; margin: 2rem auto; }
.etapes > h2, .etapes > .intro { text-align: center; }
.rangee-titre { margin: 1.6rem 0 .6rem; font-size: 1.1rem; color: #6b4b22; border-bottom: 3px dashed #d8c39b; padding-bottom: .3rem; }
.pupitres { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.pupitre {
  position: relative; background: var(--papier); border-radius: 12px; padding: 1rem .9rem .9rem;
  box-shadow: 0 6px 0 var(--bois-clair), 0 10px 18px rgba(60,40,10,.12);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem;
}
.pupitre-lien { text-decoration: none; color: var(--encre); transition: transform .12s; }
.pupitre-lien:hover { transform: translateY(-3px); color: var(--encre); }
.pupitre h4 { margin: .2rem 0 0; font-size: 1.05rem; }
.pupitre h4 a { color: var(--encre); text-decoration: none; }
.pupitre-num {
  position: absolute; top: -10px; left: -6px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--jaune); font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 0 #d6a800;
}
.pupitre-liens { font-size: .85rem; margin: 0; }
.etoiles { color: #e3a600; letter-spacing: .1em; font-size: 1.1rem; }
.pupitres-larges { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 1.2rem; }

/* Outils */
.outils { max-width: 1060px; margin: 2.5rem auto; }
.outils h2 { text-align: center; }
.outils-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.outil { display: flex; flex-direction: column; gap: .2rem; background: var(--papier); padding: 1.1rem; border-radius: var(--rayon); box-shadow: var(--ombre); text-decoration: none; color: var(--encre); }
.outil:hover { color: var(--encre); outline: 3px solid var(--guy-clair); }
.outil-icone { font-size: 2rem; }
.outil span:last-child { font-size: .9rem; color: #5d5648; }

/* Panneau de liège */
.liege-zone { max-width: 1060px; margin: 2.5rem auto; }
.liege-zone h2 { text-align: center; }
.liege {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.3rem;
  padding: 1.6rem; border-radius: 10px; border: 12px solid var(--bois);
  background:
    radial-gradient(circle at 20% 30%, rgba(90,50,10,.25) 0 1.5px, transparent 2px) 0 0/14px 14px,
    radial-gradient(circle at 70% 60%, rgba(255,240,200,.25) 0 1.5px, transparent 2px) 0 0/11px 11px,
    #c79a5e;
  box-shadow: inset 0 0 20px rgba(0,0,0,.25), var(--ombre);
}
.feuille {
  position: relative; display: flex; flex-direction: column; gap: .15rem;
  background: #fff; padding: 1.1rem .9rem .8rem; text-decoration: none; color: var(--encre);
  transform: rotate(var(--r, 0deg)); box-shadow: 0 6px 10px rgba(0,0,0,.2);
  background-image: repeating-linear-gradient(transparent 0 23px, #dfe8f5 23px 24px);
}
.feuille:hover { transform: rotate(0) scale(1.03); color: var(--encre); }
.punaise { position: absolute; top: -7px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a80, var(--caro-fonce)); box-shadow: 0 2px 2px rgba(0,0,0,.35); }
.feuille-date { font-size: .8rem; color: #6b6355; }
.feuille-titre { font-family: "Gochi Hand", cursive; font-size: 1.25rem; line-height: 1.15; }
.feuille-classe { font-size: .8rem; font-weight: 700; color: var(--caro-fonce); }

.texte-seo p { max-width: 75ch; }

/* ---------- Bulles Caro / Guy ---------- */
.bulle-ligne { display: flex; align-items: flex-start; gap: .8rem; margin: 1rem 0; }
.bulle-ligne .perso { width: 66px; height: 88px; flex: none; }
.bulle {
  position: relative; background: #fff; border: 3px solid; border-radius: 16px; padding: .7rem 1rem; flex: 1;
  margin-top: .4rem;
}
.bulle::before { content: ""; position: absolute; left: -12px; top: 18px; border: 9px solid transparent; border-right-color: inherit; border-left: 0; }
.bulle-caro .bulle { border-color: var(--caro); background: #fff8f7; }
.bulle-guy .bulle { border-color: var(--guy); background: #f7faff; }
.bulle p { margin: 0 0 .4rem; }
.bulle p:last-child { margin: 0; }

/* ---------- Leçon ---------- */
.lecon-texte { font-size: 1.08rem; }
.lecon-texte li { margin-bottom: .35rem; }
.exemples { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2rem; }
.exemples figure { margin: 0; text-align: center; }
.exemples .horloge { max-width: 210px; margin: 0 auto; }
.exemples figcaption { display: flex; flex-direction: column; align-items: center; gap: .2rem; margin-top: .4rem; }
.exemples-duree { grid-template-columns: 1fr auto 1fr; align-items: center; }
.fleche-duree { font-size: 1.3rem; text-align: center; color: var(--guy-fonce); }
.piege { background: #fff6dd; border-left: 6px solid var(--jaune); padding: .4rem 1.2rem; border-radius: 10px; margin-top: 1.8rem; }
.piege h2 { margin-top: .6rem; font-size: 1.25rem; }
.table-simple { border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.table-simple th, .table-simple td { border: 2px solid #e6dcc4; padding: .35rem .6rem; text-align: center; }
.table-simple th { background: #f6ecd4; text-align: left; }
.lecon .table-simple { display: block; overflow-x: auto; }
.prec-suiv { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1rem; border-top: 2px dashed #e6dcc4; font-weight: 700; }
.liste-etapes { list-style: none; padding: 0; }
.liste-etapes li { display: flex; gap: 1.2rem; align-items: flex-start; padding: 1.1rem 0; border-bottom: 2px dashed #eee3cc; }
.liste-etapes h2 { margin: 0 0 .3rem; font-size: 1.25rem; }
.liste-etapes h2 a { text-decoration: none; }
.liste-etapes p { margin: .3rem 0; }
.petits-liens { font-size: .9rem; }
details.rappel { margin: .8rem 0 1.2rem; }
details.rappel summary { cursor: pointer; font-weight: 700; color: var(--guy-fonce); }

/* ---------- Écran digital ---------- */
.ecran-digital {
  display: inline-block; font-family: "Courier New", ui-monospace, monospace; font-weight: 700;
  background: #1c1f1d; color: #ff5a4a; padding: .15rem .55rem; border-radius: 8px; letter-spacing: .08em;
  box-shadow: inset 0 0 0 3px #3c403d, 0 2px 0 rgba(0,0,0,.2); text-shadow: 0 0 6px rgba(255,90,74,.6); font-size: 1.15em;
}
.ecran-grand { font-size: 2.6rem; padding: .3rem 1.2rem; margin: .5rem 0; }

/* ---------- Page heure ---------- */
.heure-haut { display: grid; grid-template-columns: minmax(220px, 1.1fr) 1fr; gap: 1.5rem; align-items: center; }
.heure-dite { font-size: 1.4rem; }
.ecrans { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.ecrans div { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.ecrans .ecran-digital { font-size: 2rem; }
.table-dire th { width: 40%; }
.table-dire td { text-align: left; }
.explication-moins { background: var(--guy-clair); padding: .8rem 1rem; border-radius: 12px; }
.table-heures-wrap { overflow-x: auto; }
.table-heures { border-collapse: collapse; width: 100%; font-size: .85rem; }
.table-heures caption { text-align: left; font-weight: 700; margin-bottom: .4rem; }
.table-heures th, .table-heures td { border: 1px solid #eadfc6; padding: .25rem .3rem; text-align: center; white-space: nowrap; }
.table-heures th { background: #f6ecd4; }
.table-heures a { text-decoration: none; }
.table-heures a:hover { text-decoration: underline; }
.liste-colonnes { columns: 2 240px; }
.liste-archives { list-style: none; padding: 0; columns: 2 300px; }
.liste-archives li { margin: .2rem 0; break-inside: avoid; }
.liste-archives span { color: #6b6355; font-size: .9rem; }

/* ---------- Lecteur d'exercices ---------- */
.joueur { margin-top: 1rem; }
.joueur-haut { display: flex; align-items: center; gap: 1rem; font-weight: 700; margin-bottom: .6rem; }
.barre { flex: 1; height: 12px; background: #eee3cc; border-radius: 999px; overflow: hidden; }
.barre-plein { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--caro), var(--guy)); transition: width .4s; }
.tableau-joueur { padding: 1.4rem 1rem 1.6rem; border-width: 12px; }
.q-prompt { font-size: clamp(1.35rem, 3.5vw, 1.8rem); margin: 0 0 .8rem; }
.q-prompt strong { color: var(--jaune); font-weight: 400; }
.q-contexte { margin: 0 0 .3rem; }
.q-note { margin: .6rem 0 0; }
.q-visuel { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.q-visuel .horloge { width: min(300px, 70vw); }
.q-visuel figure { margin: 0; }
.q-visuel figure .horloge { width: min(220px, 38vw); }
.q-visuel figcaption { font-family: "Gochi Hand", cursive; font-size: 1.3rem; }
.q-visuel .ecran-digital { font-size: clamp(2.6rem, 9vw, 4rem); padding: .3rem 1.4rem; align-self: center; }
.q-choix { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin: 1.2rem 0 .8rem; }
.choix {
  font: inherit; font-size: 1.3rem; font-weight: 700; cursor: pointer;
  background: #fff; border: 3px solid #e2d6bb; border-radius: 14px; padding: .8rem .6rem;
  box-shadow: 0 4px 0 #e2d6bb; color: var(--encre); display: flex; align-items: center; justify-content: center; min-height: 64px;
}
.choix:hover:not(:disabled) { border-color: var(--guy); }
.choix .horloge { width: min(150px, 34vw); }
.choix .ecran-digital { font-size: 1.6rem; }
.choix.bon { background: #e5f7ea; border-color: var(--vert-ok); box-shadow: 0 4px 0 var(--vert-ok); }
.choix.faux { background: #ffeceb; border-color: var(--caro); box-shadow: 0 4px 0 var(--caro); animation: secoue .35s; }
.choix:disabled { cursor: default; }
@keyframes secoue { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.q-actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.q-retour { min-height: 2rem; }
.q-retour .bulle-ligne { animation: apparait .3s; }
@keyframes apparait { from { opacity: 0; transform: translateY(8px); } }
.joueur-fin { text-align: center; padding: 1rem; }
.fin-etoiles { font-size: 3.4rem; color: #e3a600; letter-spacing: .15em; }
.fin-texte { font-size: 1.3rem; font-weight: 700; }
.fin-boutons { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.placer-zone .horloge { cursor: grab; }

/* ---------- Fiches ---------- */
.grille-fiches { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
.grille-fiches li { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.vignette-fiche {
  width: 100%; aspect-ratio: 21 / 29.7; background: #fff; border: 2px solid #e6dcc4; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-decoration: none; color: var(--encre);
  background-image: repeating-linear-gradient(transparent 0 22px, #edf2fa 22px 23px); box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
.vignette-fiche:hover { border-color: var(--guy); color: var(--encre); }
.vignette-num { font-family: "Gochi Hand", cursive; font-size: 1.6rem; }
.vignette-type { font-size: .8rem; color: #6b6355; text-align: center; padding: 0 .4rem; }
.vignette-corr { font-size: .8rem; }

.barre-outils { max-width: 21cm; margin: 1rem auto; display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.feuille-a4 {
  max-width: 21cm; margin: 0 auto 2rem; background: #fff; padding: 1.2cm 1.2cm 1cm;
  box-shadow: 0 6px 24px rgba(0,0,0,.15); color: #111;
}
.fiche-champs { display: flex; justify-content: space-between; font-size: .95rem; }
.fiche-titre { display: flex; align-items: center; gap: .8rem; justify-content: center; text-align: center; margin: .4rem 0; }
.fiche-titre h1 { font-size: 1.45rem; margin: 0; }
.fiche-titre p { margin: 0; font-size: .85rem; color: #555; }
.fiche-perso { width: 44px; height: 58px; flex: none; }
.tag-corr { font-size: .8rem; vertical-align: middle; background: var(--caro); color: #fff; padding: .1rem .5rem; border-radius: 6px; }
.consigne { font-weight: 700; border: 2px solid #222; border-radius: 10px; padding: .35rem .7rem; margin: .4rem 0 .8rem; font-size: .98rem; }
.fiche-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5cm .6cm; }
.fiche-item { position: relative; text-align: center; }
.fiche-item .horloge { width: 3.9cm; margin: 0 auto; }
.item-num { position: absolute; left: 0; top: 0; font-weight: 700; font-size: .85rem; width: 1.5em; height: 1.5em; border: 1.5px solid #333; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.item-reponse, .item-cible { margin: .2rem 0 0; font-size: 1rem; }
.item-cible { font-weight: 700; font-size: 1.1rem; }
.item-contexte { font-size: .8rem; margin: 0 0 .15rem 1.6em; min-height: 2.4em; line-height: 1.2; }
.reponse { font-family: "Gochi Hand", cursive; color: var(--caro); font-size: 1.25rem; }
.ecran-vide { min-width: 3.4em; }
.fiche-probleme .fiche-grille { grid-template-columns: repeat(2, 1fr); }
.fiche-probleme .fiche-item { text-align: left; border: 1.5px solid #ccc; border-radius: 10px; padding: .4rem .5rem .4rem 2rem; }
.fiche-probleme .item-num { left: .4rem; top: .45rem; }
.item-texte { margin: 0 0 .2rem; font-size: .9rem; line-height: 1.3; }
.item-horloges { display: flex; justify-content: center; gap: .4cm; }
.item-horloges figure { margin: 0; text-align: center; font-size: .8rem; }
.fiche-probleme .item-horloges .horloge { width: 3.1cm; }
.fiche-pied { text-align: center; font-size: .8rem; color: #666; margin-top: .6cm; border-top: 1px solid #ddd; padding-top: .2cm; }

/* Horloge à découper (échelle réelle commune cadran + aiguilles) */
.decoupe h1 { text-align: center; font-size: 1.5rem; }
.decoupe-cadran .horloge { width: 15cm; margin: 0 auto; }
.decoupe-aiguilles { display: flex; justify-content: center; gap: 2cm; align-items: flex-end; margin: .4cm 0; }
.decoupe-aiguilles figure { margin: 0; text-align: center; font-size: .85rem; }
.aiguille-decoupe { display: block; margin: 0 auto; }
.decoupe-aiguilles figure:first-child .aiguille-decoupe { width: calc(40 * 15cm / 248); }
.decoupe-aiguilles figure:last-child .aiguille-decoupe { width: calc(28 * 15cm / 248); }
.decoupe-etapes { font-size: .9rem; }

/* ---------- Horloge TBI ---------- */
.tbi-zone { display: grid; grid-template-columns: minmax(260px, 1.3fr) 1fr; gap: 1.5rem; align-items: center; }
.tbi-lecture { position: relative; text-align: center; background: var(--tableau); color: var(--craie); border: 10px solid var(--bois); border-radius: 8px; padding: .8rem; }
.tbi-lecture p { margin: .2rem 0; }
.tbi-heure { font-family: "Gochi Hand", cursive; font-size: 3rem; line-height: 1.1; }
.tbi-mots { font-family: "Gochi Hand", cursive; font-size: 1.5rem; }
.tbi-lecture.cache > * { visibility: hidden; }
.tbi-lecture.cache::after { content: "?"; font-family: "Gochi Hand", cursive; font-size: 5rem; position: absolute; inset: 0; display: grid; place-items: center; }
.tbi-boutons { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .9rem; }
.tbi-boutons .bouton { padding: .5rem .8rem; font-size: .95rem; }
#tbi:fullscreen { max-width: none; margin: 0; border-radius: 0; display: flex; flex-direction: column; justify-content: center; background: var(--mur); }
#tbi:fullscreen .tbi-titre { display: none; }
#tbi:fullscreen .horloge.grande { max-width: 80vh; }

/* ---------- Pied de page ---------- */
.site-pied { background: #3c2f22; color: #eadfcb; padding: 2rem 1.5rem 1.2rem; margin-top: 2rem; border-top: 8px solid var(--bois); }
.pied-persos { display: flex; justify-content: center; gap: .6rem; margin: -4.2rem 0 1rem; }
.pied-persos .perso { width: 58px; height: 78px; }
.pied-colonnes { max-width: 1060px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.2rem; }
.pied-colonnes a { display: block; color: #eadfcb; text-decoration: none; padding: .15rem 0; }
.pied-colonnes a:hover { color: var(--jaune); }
.pied-titre { font-family: "Gochi Hand", cursive; font-size: 1.35rem; margin: 0 0 .3rem; color: #fff; }
.pied-note { text-align: center; font-size: .85rem; opacity: .8; margin: 1rem 0 0; }

/* ---------- Petits écrans ---------- */
@media (max-width: 720px) {
  body { font-size: 17px; }
  .site-entete { gap: .3rem; }
  .nav-principale { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: .2rem; scrollbar-width: none; }
  .nav-principale a { white-space: nowrap; font-size: .88rem; padding: .35rem .65rem; }
  .heure-haut, .tbi-zone { grid-template-columns: 1fr; }
  .q-choix { gap: .55rem; }
  .choix { font-size: 1.1rem; }
  .tableau-date { position: static; margin-bottom: .3rem; }
  .liste-etapes li { flex-direction: column; }
  .exemples-duree { grid-template-columns: 1fr; }
  .feuille-a4 { padding: .6cm; }
  .fiche-grille { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Impression ---------- */
@media print {
  @page { size: A4; margin: 9mm; }
  body { background: #fff; font-size: 12pt; }
  .site-entete, .site-pied, .fil, .barre-outils, .evitement, .nav-principale { display: none !important; }
  main { padding: 0; }
  .feuille-a4 { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .fiche-grille { grid-template-columns: repeat(3, 1fr); }
  .fiche-probleme .fiche-grille { grid-template-columns: repeat(2, 1fr); }
  .fiche-item, .fiche-probleme .fiche-item { break-inside: avoid; }
  .carte { box-shadow: none; }
  .ecran-digital { background: #fff; color: #000; text-shadow: none; box-shadow: inset 0 0 0 2px #000; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.carte > h2:first-child { margin-top: 0; }
