/* =========================================================================
 * kidspace.css — Espace enfant : grille du tableau de bord, personnage à
 *   habiller, « mes mots à revoir », messagerie façon SMS.
 * ========================================================================= */

/* ---------- Tableau de bord : progression en haut, cartes en dessous ---------- */
.kid-top { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kid-top .progress-card { grid-column: 1 / -1; }
.kid-top .shop-card { position: relative; min-height: 92px; }

/* ---------- Personnage dans les pastilles ---------- */
.profile-avatar { overflow: hidden; }
.profile-avatar .avatar-svg { width: 100%; height: 100%; display: block; }
.kid-face { text-decoration: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .6); }
.look-mini { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; flex: none; }
.look-mini .avatar-svg { width: 100%; height: 100%; display: block; }

/* ---------- Garde-robe ---------- */
.av-layout { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 20px; align-items: start; }
.av-stage { position: sticky; top: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.av-big { width: 100%; max-width: 300px; aspect-ratio: 1; border-radius: 28px; overflow: hidden; box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .05); animation: avIdle 3.5s ease-in-out infinite; }
.av-big .avatar-svg { width: 100%; height: 100%; display: block; }
@keyframes avIdle { 50% { transform: translateY(-4px) rotate(-1deg); } }
.av-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; min-width: 0; }
.av-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.av-tab { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 84px; padding: 8px 10px; border: 0; border-radius: 16px; background: var(--line); font-family: inherit; font-size: .9rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.av-tab span { font-size: 1.5rem; }
.av-tab.on { background: var(--primary); color: #fff; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin-top: 8px; }
.av-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 20px; border: 4px solid transparent; background: #faf8ff; cursor: pointer; font-family: inherit; color: var(--ink); }
.av-item .avatar-svg { width: 100%; aspect-ratio: 1; border-radius: 14px; display: block; }
.av-item.on { border-color: var(--primary); background: #f1ebff; }
.av-item.locked .avatar-svg { filter: saturate(.55) brightness(.92); }
.av-item:active { transform: scale(.96); }
.av-name { font-weight: 600; font-size: .92rem; text-align: center; }
.av-price { position: absolute; top: 10px; right: 10px; background: #2a2350; color: #ffd84d; font-weight: 700; font-size: .85rem; border-radius: 99px; padding: 3px 9px; }
.av-rarity { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-radius: 99px; padding: 2px 8px; color: #fff; }
.r-commun { background: #7b8494; }
.r-rare { background: #3a86ff; }
.r-epique { background: #8b5cf6; }
.r-legendaire { background: linear-gradient(90deg, #ff9f43, #ff2f6d); box-shadow: 0 0 10px rgba(255, 159, 67, .7); }
.av-item:has(.r-legendaire) { border-color: #ffc46b; }
.av-collection { margin: 0; font-size: 1rem; color: var(--muted); text-align: center; }
.av-buy { width: 160px; height: 160px; margin: 0 auto 10px; border-radius: 24px; overflow: hidden; }

/* Effets animés du personnage (doux, lents) */
.avatar-svg .fx-twinkle { animation: fxTwinkle 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.avatar-svg .fx-float { animation: fxFloat 2.6s ease-in-out infinite; }
.avatar-svg .fx-rise { animation: fxRise 3.2s ease-in-out infinite; }
.avatar-svg .fx-blink { animation: fxBlink 1.6s steps(2) infinite; }
.avatar-svg .fx-pulse { animation: fxPulse 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.avatar-svg .fx-wings { animation: fxPulse 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes fxTwinkle { 50% { opacity: .25; transform: scale(.6); } }
@keyframes fxFloat { 50% { transform: translateY(-6px); } }
@keyframes fxRise { 50% { transform: translateY(-10px); opacity: .5; } }
@keyframes fxBlink { 50% { opacity: .3; } }
@keyframes fxPulse { 50% { transform: scale(1.05); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .avatar-svg * { animation: none !important; } }
.av-buy .avatar-svg { width: 100%; height: 100%; display: block; }

/* ---------- Boutique : rayons et idées ---------- */
.shop-aisle { margin-top: 26px; }
.shop-look-tip { text-align: center; margin: 4px 0 0; color: var(--muted); }
.reward-ideas { display: flex; flex-wrap: wrap; gap: 8px; }
.reward-ideas .chip-btn { background: #faf8ff; border: 2px dashed #d9cff5; box-shadow: none; }
.reward-ideas small { color: var(--muted); }

/* ---------- Mes mots à revoir ---------- */
.revision-card {
  display: flex; align-items: center; gap: 16px; margin: 16px 0 4px; padding: 16px 20px; border-radius: var(--radius); text-decoration: none; color: var(--ink);
  background: linear-gradient(135deg, #e7f7ff, #efe7ff); box-shadow: var(--shadow); border: 3px dashed #8b5cf6;
}
.rev-icon { font-size: 2.6rem; animation: revSpin 4s ease-in-out infinite; }
.rev-body { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: 1.2rem; }
.rev-body small { font-size: .95rem; color: var(--muted); }
.rev-go { font-size: 2rem; color: var(--primary); }
@keyframes revSpin { 0%, 70%, 100% { transform: rotate(0); } 85% { transform: rotate(-180deg); } }

@media (max-width: 800px) {
  .av-layout { grid-template-columns: 1fr; }
  .av-stage { position: static; }
  .av-big { max-width: 220px; }
}
@media (max-width: 700px) {
  .kid-top { grid-template-columns: 1fr 1fr; }
  .av-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .av-name { font-size: .8rem; }
}

/* ---------- Messagerie : carte du tableau de bord ---------- */
.msg-card.has-new { background: linear-gradient(135deg, #e6fff0, #fff6d6); animation: wiggle 2.5s infinite; }
.msg-dot { position: absolute; top: 8px; right: 10px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px; background: #ef4444; color: #fff; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 3px #fff; }
.msg-dot[hidden] { display: none; }

/* ---------- Messagerie enfant ---------- */
.kid-chat { display: flex; flex-direction: column; gap: 10px; }
.kid-chat-intro { font-size: 1.4rem; font-weight: 600; margin: 4px; }
.parent-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.parent-pick { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border-left: 10px solid var(--c); }
.parent-pick.away { opacity: .7; border-left-color: #b9b5cc; }
.pp-face { position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ff5c8a); }
.pp-face.sm { width: 42px; height: 42px; font-size: 1.2rem; }
.pp-face i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 1.2rem; }
.pp-face i.on { width: 18px; height: 18px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #fff; right: 0; bottom: 0; }
.pp-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 1.3rem; }
.pp-body small { font-size: .95rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-badge { margin-left: auto; min-width: 32px; height: 32px; border-radius: 99px; background: #ef4444; color: #fff; display: grid; place-items: center; font-weight: 700; }

.chat-status { background: #fff; border-radius: 16px; padding: 10px 14px; font-size: 1.1rem; box-shadow: var(--shadow); }
.chat-list { background: #f4f1ff; border-radius: 24px; padding: 14px 54px 14px 14px; height: min(52vh, 520px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { text-align: center; color: var(--muted); margin: auto; font-size: 1.1rem; }
.chat-day { align-self: center; font-size: .8rem; color: var(--muted); background: rgba(255, 255, 255, .8); border-radius: 99px; padding: 2px 12px; margin: 6px 0; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { position: relative; max-width: min(78%, 520px); padding: 10px 14px 8px; border-radius: 22px; background: #fff; box-shadow: 0 2px 0 rgba(42, 35, 80, .06); display: flex; flex-direction: column; gap: 4px; animation: bubbleIn .25s ease-out; }
.bubble-row.theirs .bubble { border-bottom-left-radius: 6px; }
.bubble-row.mine .bubble { background: var(--c, var(--primary)); color: #fff; border-bottom-right-radius: 6px; }
.bubble-text { font-size: 1.25rem; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-meta { font-size: .75rem; opacity: .75; align-self: flex-end; }
.bubble-say { position: absolute; right: -46px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); font-size: 1.2rem; cursor: pointer; }
.chat-photo { max-width: 100%; max-height: 260px; border-radius: 14px; cursor: zoom-in; display: block; }
@keyframes bubbleIn { from { transform: translateY(8px) scale(.96); opacity: 0; } }

.chat-compose { display: flex; flex-direction: column; gap: 8px; }
.chat-compose.disabled { opacity: .45; pointer-events: none; }
.chat-quick, .chat-emojis { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip-btn { flex: none; border: 0; border-radius: 99px; padding: 10px 16px; min-height: 46px; background: #fff; box-shadow: 0 3px 0 rgba(42, 35, 80, .1); font-family: inherit; font-size: 1.05rem; color: var(--ink); cursor: pointer; }
.emo { flex: none; width: 50px; height: 50px; border: 0; border-radius: 14px; background: #fff; font-size: 1.7rem; cursor: pointer; }
.chip-btn:active, .emo:active { transform: scale(.94); }
.chat-input { display: flex; gap: 10px; align-items: stretch; }
.chat-input textarea { flex: 1; min-width: 0; resize: none; border-radius: 20px; border: 3px solid var(--line); padding: 12px 16px; font-family: inherit; font-size: 1.2rem; min-height: 62px; }
.chat-input textarea:focus { outline: none; border-color: var(--c, var(--primary)); }
.btn-send { width: 72px; min-height: 62px; padding: 0; font-size: 1.8rem; border-radius: 20px; flex: none; }
.photo-zoom { position: fixed; inset: 0; z-index: 2147483200; background: rgba(20, 14, 40, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
.photo-zoom img { max-width: 100%; max-height: 80vh; border-radius: 16px; }

/* ---------- Messagerie parent ---------- */
.pm-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; align-items: start; }
.pm-convs { display: flex; flex-direction: column; gap: 6px; padding: 10px; margin: 0; }
.pm-conv { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; text-decoration: none; color: var(--ink); }
.pm-conv:hover { background: #f6f3ff; }
.pm-conv.on { background: #efe7ff; }
.pm-conv .profile-avatar { font-size: 1.6rem; width: 46px; height: 46px; flex: none; }
.pm-conv-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pm-conv-body small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-with { color: var(--primary) !important; }
.pm-chat { margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pm-chat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.2rem; }
.pm-chat-head .profile-avatar { font-size: 1.6rem; width: 46px; height: 46px; }
.pm-ro { font-size: .9rem; background: #fff7d6; border-radius: 99px; padding: 4px 12px; }
.pm-list { height: min(55vh, 560px); padding-right: 14px; --c: var(--primary); }
.pm-photo-btn { min-width: 62px; font-size: 1.6rem; display: grid; place-items: center; cursor: pointer; }
.pm-photo-prev, .sib-photo-prev { display: flex; align-items: center; gap: 10px; }
.pm-photo-prev[hidden], .sib-photo-prev[hidden] { display: none; }
.pm-photo-prev img, .sib-photo-prev img { max-height: 110px; border-radius: 12px; }
.pm-away { margin-bottom: 14px; }
.switch-line { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 1.1rem; position: relative; }
.switch-line input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-line .switch { position: relative; flex: none; width: 58px; height: 32px; border-radius: 99px; background: #c9c5d9; transition: background .2s; }
.switch-line .switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch-line input:checked + .switch { background: var(--green); }
.switch-line input:checked + .switch::after { transform: translateX(26px); }
.switch-line input:focus-visible + .switch { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- Réglages : parents de la famille ---------- */
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 8px 0; }
.row-form > label { flex: 1 1 240px; }
.row-form > input { flex: 1 1 200px; }
.parents-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.parents-list li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: #faf8ff; }
.parents-list li > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.parents-list li.pending { background: #fffbea; }
.ok-msg { background: #dcfce7; border-radius: 12px; padding: 10px 14px; }
.warn-msg { background: #fff7d6; border-radius: 12px; padding: 10px 14px; }
.copy-line { display: flex; gap: 8px; }
.copy-line input { flex: 1; min-width: 0; font-size: .9rem; }

/* ---------------- Émotes animées ---------------- */
/* Rangée d'émotes possédées dans la zone d'écriture de l'enfant */
.chat-emotes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px 2px; }
.chat-emotes .emote-btn { font-size: 1.8rem; line-height: 1; background: #fff; border: 2px solid #efeaff; border-radius: 14px; padding: 6px 9px; cursor: pointer; transition: transform .1s; }
.chat-emotes .emote-btn:active { transform: scale(.9); }
.chat-emotes .emote-shop { font-size: 1rem; font-weight: 700; color: var(--primary); text-decoration: none; background: #f3efff; border-radius: 14px; padding: 8px 12px; }
.chat-emotes-hint { font-size: .95rem; color: #7b7699; }
.chat-emotes-hint a { color: var(--primary); font-weight: 700; }

/* Émote affichée en grand dans une bulle */
.emote-big { font-size: 3.4rem; line-height: 1.1; display: inline-block; }
.emote-idle { animation: emote-idle 1.6s ease-in-out infinite; }
@keyframes emote-idle { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-6deg); } }

/* Boutique : grille d'achat des émotes */
.emote-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.emote-card { background: #fff; border: 2px solid #efeaff; border-radius: 18px; padding: 12px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.emote-card.owned { border-color: var(--green); background: #f0fdf4; }
.emote-card .ec-face { font-size: 2.6rem; line-height: 1; }
.emote-card b { font-size: .95rem; }
.emote-card .btn { width: 100%; font-size: .9rem; padding: 8px; }
.emote-card .ec-have { color: var(--green); font-weight: 700; font-size: .95rem; }

/* Animation plein écran */
.emote-host { position: fixed; inset: 0; z-index: 9000; pointer-events: none; overflow: hidden; }
.emote-host .emote-p { position: absolute; font-size: 3rem; will-change: transform, opacity; }
.emote-rise { bottom: -8vh; animation-name: emote-rise; animation-timing-function: ease-out; animation-fill-mode: forwards; }
.emote-fall { top: -8vh; animation-name: emote-fall; animation-timing-function: ease-in; animation-fill-mode: forwards; }
.emote-burst { left: 50%; top: 50%; animation-name: emote-burst; animation-timing-function: ease-out; animation-fill-mode: forwards; }
.emote-zoom { top: 38%; transform: translateX(-50%); font-size: 7rem; animation-name: emote-zoom; animation-timing-function: ease-in-out; animation-fill-mode: forwards; }
@keyframes emote-rise { 0% { transform: translateY(0) rotate(var(--r,0)); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(-96vh) rotate(var(--r,0)); opacity: 0; } }
@keyframes emote-fall { 0% { transform: translateY(0) rotate(var(--r,0)); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(108vh) rotate(var(--r,0)); opacity: 0; } }
@keyframes emote-burst { 0% { transform: translate(-50%,-50%) scale(.3); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx,0)), calc(-50% + var(--dy,0))) scale(1.1); opacity: 0; } }
@keyframes emote-zoom { 0% { transform: translateX(-50%) scale(.2); opacity: 0; } 30% { transform: translateX(-50%) scale(1.25); opacity: 1; } 70% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .emote-idle { animation: none; }
}

/* ---------------- Mon compagnon (tamagotchi) ---------------- */
.pet-wrap { max-width: 620px; margin: 0 auto; }
.food-card .food-have { color: var(--green); font-weight: 700; font-size: .85rem; }

.pet-stage { position: relative; margin: 10px auto; width: min(80vw, 300px); aspect-ratio: 1; border-radius: 28px;
  background: radial-gradient(circle at 50% 38%, #fff, #f3efff); box-shadow: inset 0 0 0 3px #efeaff; overflow: hidden; }
.pet-char { position: absolute; inset: 8%; display: grid; place-items: center; transform-origin: 50% 90%; }
.pet-char .avatar-svg, .pet-char .creature-svg { width: 100%; height: 100%; border-radius: 20px; }
.pet-noface { font-size: 7rem; }
.pet-name-line { text-align: center; font-size: 1.2rem; margin: 6px 0 2px; }
.pet-change { font-size: .9rem; color: var(--primary); text-decoration: none; margin-left: 6px; }
/* Écran d'adoption */
.pet-wrap.adopt .pet-stage { width: min(58vw, 220px); }
.adopt-kinds, .adopt-colors { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.adopt-kind { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.9rem; background: #fff; border: 2px solid #efeaff; border-radius: 16px; padding: 8px 12px; cursor: pointer; min-width: 86px; }
.adopt-kind small { font-size: .8rem; font-weight: 700; color: #4a4466; }
.adopt-kind.on { border-color: var(--primary); background: #f3efff; }
.adopt-color { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #e6e0f0; cursor: pointer; }
.adopt-color.on { box-shadow: 0 0 0 3px var(--primary); transform: scale(1.12); }
.adopt-name { display: block; width: min(90%, 320px); margin: 0 auto; text-align: center; font-size: 1.2rem; padding: 10px; border-radius: 14px; border: 2px solid #efeaff; }
.adopt-go { display: block; margin: 16px auto; }
.pet-idle { animation: pet-idle 2.6s ease-in-out infinite; }
.pet-bounce { animation: pet-bounce .6s ease; }
.pet-wiggle { animation: pet-wiggle .3s ease-in-out infinite; }
@keyframes pet-idle { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2%) scale(1.02); } }
@keyframes pet-bounce { 0%,100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-14%) scale(1.06); } 60% { transform: translateY(0) scale(.97); } }
@keyframes pet-wiggle { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

.pet-face-badge { position: absolute; top: 8px; left: 10px; font-size: 1.8rem; z-index: 3; }
.pet-mood { position: absolute; top: 6px; right: 10px; font-size: 1.6rem; z-index: 3; background: #fff; border-radius: 16px; padding: 2px 8px; box-shadow: 0 2px 8px rgba(0,0,0,.12); animation: pet-idle 2s ease-in-out infinite; }
.pet-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }

.pet-eat-fly { position: absolute; left: 50%; bottom: 6%; font-size: 2.6rem; transform: translateX(-50%); animation: pet-eat 1s ease forwards; }
@keyframes pet-eat { 0% { bottom: -10%; opacity: 0; } 25% { opacity: 1; } 70% { bottom: 42%; opacity: 1; transform: translateX(-50%) scale(1); } 100% { bottom: 46%; opacity: 0; transform: translateX(-50%) scale(.3); } }
.pet-shower { position: absolute; inset: 0; }
.pet-shower .ps-head { position: absolute; top: 2%; left: 50%; transform: translateX(-50%); font-size: 2.6rem; }
.pet-shower .ps-drop { position: absolute; top: 14%; font-size: 1.1rem; animation: ps-drop 1.1s linear infinite; }
@keyframes ps-drop { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(240%); opacity: 0; } }
.pet-shower .ps-bubbles { position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%); font-size: 2.4rem; animation: pet-idle 1s ease-in-out infinite; }
.pet-brush { position: absolute; inset: 0; }
.pet-brush .pb-brush { position: absolute; left: 52%; top: 46%; font-size: 2.6rem; transform-origin: bottom center; animation: pb-brush .35s ease-in-out infinite; }
@keyframes pb-brush { 0%,100% { transform: translateX(-10px) rotate(-12deg); } 50% { transform: translateX(10px) rotate(12deg); } }
.pet-brush .pb-foam { position: absolute; left: 44%; top: 42%; font-size: 1.6rem; animation: pet-idle 1s ease-in-out infinite; }
.pet-hearts span { position: absolute; bottom: 10%; font-size: 1.6rem; animation: pet-heart 1.4s ease-out forwards; }
@keyframes pet-heart { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-120px) scale(1.1); opacity: 0; } }

/* ---------------- Mots croisés ---------------- */
.cw-wrap { max-width: 560px; margin: 0 auto; }
.cw-intro { text-align: center; color: var(--muted); }
.cw-board { --cols: 5; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 3px; width: min(92vw, 420px); margin: 10px auto 14px; }
.cw-black { aspect-ratio: 1; }
.cw-cell { position: relative; display: block; aspect-ratio: 1; background: #fff; border: 2px solid #c9b8ff; border-radius: 8px; }
.cw-cell i { position: absolute; top: 1px; left: 4px; font-size: .55rem; font-style: normal; color: var(--muted); line-height: 1; pointer-events: none; }
.cw-cell input { width: 100%; height: 100%; border: 0; border-radius: 8px; background: transparent; text-align: center; text-transform: uppercase;
  font-family: inherit; font-weight: 700; font-size: clamp(.9rem, 4.5vw, 1.4rem); color: var(--ink); padding: 0; outline: none; }
.cw-cell input:focus { box-shadow: inset 0 0 0 2px #7c5cff; }
.cw-cell.ok { background: #d7f8e0; border-color: #22c55e; }
.cw-cell.ko { background: #ffd9d9; border-color: #ef4444; }
.cw-cell.hint input { color: #7c5cff; }
.cw-tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cw-msg { text-align: center; font-weight: 700; min-height: 1.4em; margin: 12px 0; }
.cw-msg.success { color: var(--green); }
.cw-clues { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.cw-clues h3 { font-size: 1rem; margin: 0 0 6px; }
.cw-clues ul { list-style: none; padding: 0; margin: 0; }
.cw-clues li { padding: 6px 8px; border-radius: 10px; margin-bottom: 4px; background: #f7f5ff; font-size: .95rem; }
.cw-clues li b { color: #7c5cff; margin-right: 4px; }
.cw-clues li.ok { background: #d7f8e0; }
.cw-clues li.ko { background: #ffd9d9; }
.cw-reward { text-align: center; margin-top: 14px; }
@media (max-width: 480px) { .cw-clues { grid-template-columns: 1fr; } }

.pet-tip { text-align: center; }
.pet-needs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 14px 4px; }
.pet-need { display: flex; flex-direction: column; gap: 4px; }
.pn-label { font-weight: 600; font-size: .95rem; }
.pn-bar { height: 16px; border-radius: 99px; background: #ece7fb; overflow: hidden; }
.pn-fill { height: 100%; width: 100%; border-radius: 99px; background: #22c55e; transition: width .4s ease, background .4s ease; }

.pet-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 4px 18px; }
.pet-act { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.9rem; padding: 12px 6px; background: #fff; border: 2px solid #efeaff; border-radius: 18px; cursor: pointer; }
.pet-act small { font-size: .85rem; font-weight: 700; color: #4a4466; }
.pet-act:active { transform: scale(.95); }
.pet-act-play { background: linear-gradient(135deg, #8b5cf6, #ff5c8a); color: #fff; border: none; }
.pet-act-play small { color: #fff; }

.pet-feed { margin: 4px; }
.pet-pantry { display: flex; flex-wrap: wrap; gap: 10px; }
.pet-food { position: relative; font-size: 2.2rem; background: #fff; border: 2px solid #efeaff; border-radius: 16px; padding: 8px 12px; cursor: pointer; }
.pet-food:active { transform: scale(.92); }
.pet-food .pf-n { position: absolute; right: -4px; bottom: -4px; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700; border-radius: 99px; padding: 1px 6px; }
.pet-empty { color: #7b7699; }
.pet-empty a, .pet-tip a { color: var(--primary); font-weight: 700; }

/* Jeu de saut d'obstacles */
.pet-game { position: fixed; inset: 0; z-index: 9500; background: linear-gradient(#cfeaff, #eef7ff 60%, #fff); display: flex; flex-direction: column; }
.pg-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; }
.pg-score { font-size: 2rem; font-weight: 800; color: #2a2350; font-variant-numeric: tabular-nums; }
.pg-close { font-size: 1.4rem; }
.pg-canvas { flex: 1; width: 100%; display: block; touch-action: none; }
.pg-hint { text-align: center; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); font-size: 1.1rem; color: #4a4466; }
.pg-hint.over { font-size: 1.3rem; font-weight: 700; color: #2a2350; }

@media (max-width: 800px) {
  .pm-layout { grid-template-columns: 1fr; }
  .chat-list { padding-right: 14px; }
  .bubble-say { position: static; transform: none; align-self: flex-start; width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .pet-idle, .pet-bounce, .pet-wiggle, .pet-mood { animation: none; }
}
