/* Le chat lecteur apparaît au centre après trente secondes d'immobilité. */
.cat-idle-reader{position:fixed;pointer-events:none;left:50%;top:50%;right:auto;bottom:auto;z-index:85;width:clamp(190px,25vw,280px);height:auto;aspect-ratio:12/11;opacity:0;transform:translate(-50%,-45%) scale(.92);transition:opacity .45s ease,transform .45s ease;filter:drop-shadow(0 13px 17px #091c2170)}
.cat-idle-reader.is-visible{opacity:1;transform:translate(-50%,-50%) scale(1)}
@media(max-width:620px){.cat-idle-reader{left:50%;top:50%;right:auto;bottom:auto;width:min(65vw,240px)}}
@media(prefers-reduced-motion:reduce){.cat-idle-reader{transition:none}}

/* Une invitation discrète dans le pied de page, également visible au clavier. */
.footer-brand{position:relative}
.footer-brand::after{content:attr(data-hint);position:absolute;bottom:calc(100% + 10px);left:0;width:max-content;max-width:min(75vw,260px);padding:8px 11px;border:1px solid #b69b72;border-radius:8px;background:#fff8e9;color:#303e3e;box-shadow:0 5px 14px #12292a2d;font:600 .78rem/1.25 system-ui,sans-serif;opacity:0;transform:translateY(5px);transition:opacity .16s,transform .16s;pointer-events:none}
.footer-brand:hover::after,.footer-brand:focus-visible::after{opacity:1;transform:translateY(0)}
html[data-theme="dark"] .footer-brand::after{background:#304043;color:#f7e9d5;border-color:#a98f70}

/* Le chat lecteur choisi au hasard lit sans masquer le texte ni les commandes. */
.cat-idle-reader{width:clamp(200px,25vw,270px);height:auto;aspect-ratio:1}
.cat-reading-image{display:block;width:100%;height:100%;object-fit:contain}
.cat-reading-frames{position:absolute;inset:0;display:block;width:100%;height:100%;opacity:0;pointer-events:none;object-fit:contain}
.cat-idle-scene{display:block;width:100%;height:100%;object-fit:contain}
.has-page-sprite .cat-reading-frames{opacity:1}
.has-page-sprite .cat-reading-image{opacity:0}
.cat-reader-companion{display:none;position:fixed;z-index:2147483000;inset:auto;margin:0;padding:0;border:0;background:transparent;pointer-events:none;overflow:visible;filter:drop-shadow(0 5px 8px #081c2466)}
.cat-reader-companion.is-visible{display:block}
.reader.reader-with-companion{overflow:visible}
@media(max-width:1380px){.reader.reader-with-companion{width:min(1100px,calc(100vw - 168px))}}
@media(max-width:700px){.reader.reader-with-companion{width:calc(100vw - 90px)}}
@media(max-width:360px){.reader.reader-with-companion{width:calc(100vw - 80px)}}
@media(prefers-reduced-motion:reduce){.cat-reading-frames,.cat-reading-image{animation:none}}
.cat-game{width:min(560px,calc(100vw - 28px));max-height:min(85vh,700px);border:1px solid #cfbfa7;border-radius:14px;padding:26px;background:#fffaf0;color:#23383b;box-shadow:0 24px 75px #102e3740}
.cat-game::backdrop{background:#102e37a8}
.cat-game-top{display:flex;align-items:center;justify-content:space-between}.cat-game-top .eyebrow{margin:0}.cat-game-top button{border:0;background:none;color:inherit;font-size:28px;line-height:1;min-width:40px;min-height:40px}
.cat-game h2{font:400 2rem Georgia,serif;margin:6px 0 12px}.cat-game p{line-height:1.55}
.cat-game-stage{display:flex;align-items:center;gap:20px;min-height:185px;padding:15px;background:#f2e7d4;border-radius:10px}
.cat-game-stage img{width:96px;height:96px;flex:none;border-radius:16px;object-fit:contain}
.cat-game-grades{display:flex;gap:10px;flex-wrap:wrap;align-content:center}
.cat-game-grade{min-width:66px;min-height:56px;border:1px solid #c5b393;border-radius:4px;background:#fffdf8;color:#283d40;font:600 1rem Georgia,serif;box-shadow:2px 3px 0 #a9987d5e;transition:transform .3s,opacity .3s}
.cat-game-grade:hover{transform:translateY(-3px);border-color:#344a4d}.cat-game-grade:focus-visible,.cat-game button:focus-visible,.footer-brand:focus-visible{outline:3px solid #af761e;outline-offset:3px}
.cat-game-eaten{opacity:0;transform:scale(.1) rotate(-25deg);pointer-events:none}.cat-game-grade.cat-game-eaten:hover{transform:scale(.1) rotate(-25deg)}
.cat-game-pounce{animation:cat-pounce .65s ease-in-out}.cat-game-refuse{animation:cat-refuse .5s ease-in-out}
.cat-game #cat-game-status{min-height:2.8em;color:#436157;font-weight:600}.cat-game-reset{border:1px solid #aab9a8;border-radius:5px;background:#e6eee2;padding:9px 14px;color:#244f45}
@keyframes cat-pounce{40%{transform:translate(18px,-12px) rotate(-9deg)}70%{transform:translate(18px,4px) rotate(5deg)}}
@keyframes cat-refuse{25%{transform:rotate(-10deg)}65%{transform:rotate(9deg)}}
@media(max-width:560px){.cat-game{padding:19px}.cat-game-stage{gap:10px}.cat-game-stage img{width:70px;height:70px}.cat-game-grade{min-width:59px;min-height:49px}}
@media(prefers-reduced-motion:reduce){.cat-game-pounce,.cat-game-refuse{animation:none}.cat-game-grade{transition:none}}
.footer-brand{border:0;background:none;color:inherit;padding:2px 0;cursor:pointer;font:1rem Georgia,serif}
html[data-theme="dark"] .cat-game{background:#243336;color:#f7ead4;border-color:#796d5c}html[data-theme="dark"] .cat-game-stage{background:#354445}

/* Le liseré est statique : il détache la silhouette sombre sans modifier son dessin. */
html[data-theme="dark"] .cat-idle-scene{filter:drop-shadow(0 0 1px #dac9a777)}
