/* 🐉 Mazlíček (mazlicek.js): scéna s obrázkem, ❓ dokud ho dítě nemá, vajíčko pod lampičkou, pelíšek a plyšáci */
.pet-scene { position: relative; display: flex; justify-content: center; align-items: flex-end; min-height: 220px; margin: 4px 0 10px; padding: 14px; border-radius: 22px; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, #9be27a 30%, var(--card)) 0 45%, transparent 70%); }
.pet-img { max-width: min(320px, 80%); max-height: 300px; animation: pop .5s ease; }
.pet-title { margin: 6px 0; text-align: center; font-size: 1.3rem; }
.pet-lead { margin: 8px 0; text-align: center; font-size: 1.05rem; }
.pet-when { margin: 6px 0; text-align: center; font: 800 1.1rem var(--font-head); }
.pet-note { text-align: center; }

/* ❓ ještě ho nemá: šedý otazník */
.pet-unknown { background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--muted) 18%, var(--card)) 0 40%, transparent 65%); }
/* šedé vajíčko s ❓ – stejné jako ve scéně u Matyho (.stage-pet.pet-none) */
.pet-question { position: relative; width: min(190px, 50%); line-height: 0; }
.pet-question img { display: block; width: 100%; height: auto; filter: grayscale(1) opacity(.55); }
.pet-question-mark { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 12%; font: 800 6rem var(--font-head); line-height: 1; color: #1f2a4d; text-shadow: 0 0 4px #fff, 0 0 10px #fff; }
html.dark .pet-question-mark { color: #fff; text-shadow: 0 0 4px #1f2a4d, 0 0 10px #1f2a4d; }

/* 🥚 vajíčko pod lampičkou – světlo jemně dýchá, po půlce času se vajíčko klepe */
/* (lampa.webp a vejce-na-lampe.webp jsou stejně velké – vajíčko leží přesně přes lampičku) */
.pet-egg-img { position: relative; z-index: 1; width: min(300px, 85%); }
.pet-egg-img img { display: block; width: 100%; height: auto; }
.pet-egg-img .pet-egg-egg { position: absolute; inset: 0; transform-origin: 71% 98%; }
.pet-lamp-glow { position: absolute; left: 50%; bottom: 10%; width: 60%; height: 70%; transform: translateX(-30%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 214, 102, .55), transparent 65%); animation: pet-glow 3s ease-in-out infinite; }
.pet-egg.wobble .pet-egg-egg { animation: pet-wobble 1.6s ease-in-out infinite; }
/* 🐱 kočička: vajíčko leží v pelíšku níž a víc vlevo – otáčí se kolem svého spodku (mazlicek.js .pet-egg-kocka, .pet-kocka) */
.pet-egg-kocka .pet-egg-img .pet-egg-egg { transform-origin: 66% 75%; }
/* ✨ jiskřičky kolem vzácného vajíčka (mazlicek.js drawPetEgg) – oblast vajíčka na lampě (dráček vpravo dole, kočička uprostřed vpravo) */
.pet-egg-sparks { position: absolute; z-index: 3; left: 50%; top: 35%; width: 45%; height: 60%; pointer-events: none; }
.pet-egg-kocka .pet-egg-sparks { left: 45%; top: 30%; width: 42%; height: 50%; }
.stage-pet.pet-kocka.pet-egg-small.wobble .stage-pet-egg { transform-origin: 66% 75%; }
/* 📎 sponka: vajíčko v pelíšku pod lampičkou (.tmp-tools/vejce/kocka-rozdel.js – střed otáčení) */
.pet-egg-sponka .pet-egg-img .pet-egg-egg { transform-origin: 64.7% 70.6%; }
.stage-pet.pet-sponka.pet-egg-small.wobble .stage-pet-egg { transform-origin: 64.7% 70.6%; }
/* 🐆 postup pro gepárdíka pod výsledkem rychlého kola matiky (mazlicek.js petFastNote) */
.pet-fast-note { margin: .4rem auto 0; max-width: 34rem; padding: .45rem .8rem; border-radius: 12px; background: #fff3d6; color: #6b4a00; font-weight: 700; }
html.dark .pet-fast-note { background: #4a3a12; color: #ffe2a0; }
/* 🐆 gepárdík: vajíčko v hnízdě pod lampičkou (.tmp-tools/gepard/sada.js – střed otáčení u spodku vajíčka v hnízdě) */
.pet-egg-gepard .pet-egg-img .pet-egg-egg { transform-origin: 67.3% 82%; }
.stage-pet.pet-gepard.pet-egg-small.wobble .stage-pet-egg { transform-origin: 67.3% 82%; }
/* před klepáním vajíčko pomalu „dýchá“ (celé se trochu zvětší a zmenší, spodek stojí na místě) */
.pet-egg:not(.wobble) .pet-egg-egg { animation: pet-egg-breathe 3s ease-in-out infinite; }
@keyframes pet-egg-breathe { 50% { transform: scale(1.05); } }
@keyframes pet-glow { 50% { opacity: .55; transform: translateX(-30%) scale(1.06); } }
@keyframes pet-wobble { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-2.5deg); } 80% { transform: rotate(2.5deg); } 90% { transform: rotate(-1.5deg); } }
.pet-fact { margin: 10px 0; padding: 12px 16px; border: 2px dashed #f6c445; border-radius: 16px; background: color-mix(in srgb, #fff4cf 70%, var(--card)); color: var(--text); }
.pet-fact-text { margin: 0 0 8px; }
.pet-fact-next { padding: 6px 14px; border-radius: 999px; font-size: .88rem; }
html.dark .pet-fact { background: #3d3214; }

/* 🐣 vylíhnutí a jméno */
.pet-hatch .pet-img { animation: pet-hatch .9s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pet-hatch { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.pet-name-form { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0; }
.pet-name-form input { min-width: 220px; }

/* 🌱 růst */
.pet-grow-fill { background: linear-gradient(90deg, #8fd36b, #3fa34d); }

/* 🛏️ pelíšek a 🧸 plyšáci */
.pet-bed { margin: 18px 0 8px; padding: 12px 14px; border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, #1f2a6b 14%, var(--card)), var(--card)); text-align: center; }
.pet-bed h3, .pet-shop-title { margin: 0 0 8px; font-size: 1.1rem; text-align: left; }
.pet-sleep { max-width: min(300px, 80%); max-height: 240px; }
.pet-plush-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
/* 🎨 katalog dráčků (mazlicek.js petCatalog) – pod tlačítkem náhodného vajíčka */
.pet-catalog { margin-top: 20px; }
.pet-plush { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border: 3px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.pet-plush img { width: 72px; height: 72px; object-fit: contain; }
.pet-plush:not(.owned) img { filter: saturate(.55); opacity: .8; }
.pet-plush-name { font-weight: 800; font-size: .85rem; }
.pet-plush-tag { font-size: .78rem; color: var(--muted); }
.pet-plush.owned { border-color: #8fd36b; }
.pet-plush.in-bed { border-color: #3fa34d; background: color-mix(in srgb, #8fd36b 22%, var(--card)); }
.pet-plush:focus-visible { outline: 3px solid var(--primary); }

/* 😴 spící mazlíček (mazlicek.js petSleeper / petZzz): pomalu dýchá (zvedá se od spodku) a nad hlavou stoupají z z Z */
.pet-sleeper { position: relative; display: inline-block; max-width: 100%; animation: pet-breathe 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
.pet-sleeper .pet-img, .pet-sleeper .pet-sleep { display: block; margin: 0 auto; }
.pet-scene .pet-sleeper { max-width: min(320px, 80%); }
.pet-scene .pet-sleeper .pet-img { max-width: 100%; }
.pet-bed .pet-sleeper { max-width: min(300px, 80%); }
.pet-bed .pet-sleeper .pet-sleep { max-width: 100%; }
@keyframes pet-breathe { 50% { transform: scale(1.015, 1.035); } }
.pet-zzz { position: absolute; right: 16%; top: 16%; font: 800 1.7rem var(--font-head); color: #5163e0; text-shadow: 0 0 4px #fff, 0 0 8px #fff; opacity: 0; pointer-events: none; animation: pet-zzz 3.6s ease-out infinite; }
.pet-zzz:nth-of-type(2) { animation-delay: 1.2s; font-size: 2.1rem; }
.pet-zzz:nth-of-type(3) { animation-delay: 2.4s; font-size: 2.6rem; }
@keyframes pet-zzz {
  0% { opacity: 0; transform: translate(0, 0) rotate(-10deg) scale(.6); }
  15%, 65% { opacity: 1; }
  100% { opacity: 0; transform: translate(34px, -60px) rotate(12deg) scale(1.15); }
}
html.dark .pet-zzz, .pet-night .pet-zzz { color: #dfe4ff; text-shadow: 0 0 6px #4b5aa8; }
/* malý mazlíček u Matyho: menší písmenka, dýchá celý obrázek */
.stage-pet .pet-zzz { right: 6%; top: 14%; font-size: 1rem; }
.stage-pet .pet-zzz:nth-of-type(2) { font-size: 1.2rem; }
.stage-pet .pet-zzz:nth-of-type(3) { font-size: 1.45rem; }
.stage-pet.sleeping img { animation: pet-breathe 3.6s ease-in-out infinite; transform-origin: 50% 100%; }

/* 🌙 noc: mazlíček spí – tmavší nebe s hvězdičkami */
.pet-scene.pet-night { background: radial-gradient(circle at 20% 25%, #fff8 0 2px, transparent 3px), radial-gradient(circle at 75% 18%, #fff8 0 2px, transparent 3px), radial-gradient(circle at 60% 40%, #fff6 0 1.5px, transparent 2.5px), linear-gradient(180deg, #24306b, #4b5aa8 70%, color-mix(in srgb, #4b5aa8 40%, var(--card))); }

/* 🏞️ pozadí za mazlíčkem (obrázek přes celou scénu; mazlíček stojí na volné ploše dole uprostřed) */
.pet-scene.pet-has-bg { min-height: clamp(240px, 42vw, 380px); background-size: cover; background-position: center 70%; overflow: hidden; }
.pet-scene.pet-has-bg .pet-img { filter: drop-shadow(0 10px 14px rgba(20, 30, 60, .35)); }
/* 🛏️ pelíšek: spící mazlíček na nočním pelíšku pod hvězdami (text pod ním v bílém) */
.pet-bed.pet-bed-night { background: var(--pet-bed-bg) center 75% / cover; color: #fff; }
.pet-bed.pet-bed-night h3, .pet-bed.pet-bed-night .muted { color: #fff; text-shadow: 0 1px 4px rgba(10, 15, 40, .8); }
/* 💚 smutný plyšák opodál (přizvaný si hraje ve scéně vedle mazlíčka) */
.pet-friend-card { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 10px 14px; border: 2px dashed #8fd36b; border-radius: 16px; background: color-mix(in srgb, #8fd36b 12%, var(--card)); }
.pet-friend-card p { margin: 0 0 8px; }
.pet-friend-card > p:only-child { margin: 0; text-align: center; flex: 1; }
.pet-friend-lonely { flex: none; }
.pet-friend-lonely .pet-friend { width: 84px; height: 84px; object-fit: contain; }
/* přizvaný plyšák: hned vpravo od dráčka (střed scény + kus), zrcadlově otočený k němu, skáče a kolem něj srdíčka */
.pet-friend-play { position: absolute; z-index: 1; left: calc(50% + clamp(70px, 17vw, 150px)); bottom: 14px; width: clamp(64px, 15vw, 110px); line-height: 0; }
.pet-friend-play .pet-friend { width: 100%; transform: scaleX(-1); filter: drop-shadow(0 6px 8px rgba(20, 30, 60, .3)); animation: pet-friend-hop 1.4s ease-in-out infinite; }
@keyframes pet-friend-hop { 0%, 100% { transform: scaleX(-1) translateY(0) rotate(3deg); } 50% { transform: scaleX(-1) translateY(-18px) rotate(-4deg); } }
.pet-friend-heart { position: absolute; left: 50%; top: 10%; font-size: clamp(1rem, 3vw, 1.5rem); line-height: 1; opacity: 0; pointer-events: none; animation: pet-friend-heart 2.4s ease-out infinite; }
.pet-friend-heart:nth-of-type(2) { left: 15%; animation-delay: .8s; }
.pet-friend-heart:nth-of-type(3) { left: 80%; animation-delay: 1.6s; }
@keyframes pet-friend-heart { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .pet-friend-play .pet-friend, .pet-friend-heart { animation: none; } }
/* 🧸 plyšáci po skupinách (cena) a 🎁 dárek k růstu */
.pet-plush-group { margin: 10px 0 6px; font-weight: 700; text-align: left; }
.pet-gift-note { margin: 4px 0 8px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, #f59e0b 16%, var(--card)); font-weight: 700; }
.pet-plush.pet-plush-gift { border-color: #f59e0b; box-shadow: 0 0 0 3px color-mix(in srgb, #f59e0b 30%, transparent); }
/* 🐾 Moji mazlíčci: dlaždice (aktivní zvýrazněný), ➕ další vajíčko; 💚 růst z péče a „+N 💚“ nad mazlíčkem */
.pet-collection { margin: 0 0 10px; }
.pet-collection-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; }
.pet-collection-tile { flex: 0 0 auto; width: 104px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border: 3px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.pet-collection-tile img { width: 72px; height: 72px; object-fit: contain; }
.pet-collection-tile.active { border-color: #22c55e; background: color-mix(in srgb, #22c55e 12%, var(--card)); cursor: default; }
.pet-collection-name { font-weight: 700; font-size: .85rem; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pet-collection-tag { font-size: .72rem; color: var(--muted); text-align: center; }
.pet-collection-add { border-style: dashed; justify-content: center; }
.pet-collection-plus { font-size: 2rem; line-height: 72px; height: 72px; }
.pet-collection-shop { margin-top: 8px; }
.pet-catalog-have { opacity: .55; cursor: default; }
.pet-rename { vertical-align: middle; }
.pet-care-how { margin: 6px 0 10px; }
.pet-care-how summary { cursor: pointer; font-weight: 700; }
.pet-care-how ul { margin: 6px 0; padding-left: 20px; }
.pet-care-how li.pet-care-done { color: var(--muted); }
.pet-care-pop { position: absolute; left: 50%; top: 18%; z-index: 3; transform: translate(-50%, 0); font: 800 1.6rem var(--font-head, inherit); color: #16a34a; text-shadow: 0 2px 6px rgba(255, 255, 255, .9); pointer-events: none; animation: pet-care-pop 1.8s ease-out forwards; }
@keyframes pet-care-pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -50px) scale(1); } }
@media (prefers-reduced-motion: reduce) { .pet-care-pop { animation: none; } }
/* 🩹 první pomoc (mazlicek-pomoc.js): úraz a ošetření přes obrázek (místo --x / --y v % obrázku), karta s otázkami */
.pet-aid-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pet-hugging .pet-aid-layer { opacity: 0; transition: opacity .3s; }
.pet-aid-item { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); font-size: clamp(20px, 6vw, 36px); line-height: 1; filter: drop-shadow(0 2px 3px rgba(20, 30, 60, .35)); }
.pet-aid-scratch { width: 13%; aspect-ratio: 2 / 1; border-radius: 45%; background: repeating-linear-gradient(-28deg, rgba(220, 38, 38, .9) 0 3px, rgba(252, 165, 165, .55) 3px 7px); box-shadow: 0 0 6px rgba(220, 38, 38, .5); }
.pet-aid-burn, .pet-aid-bump { width: 11%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(239, 68, 68, .85) 0 35%, rgba(248, 113, 113, .45) 55%, transparent 72%); animation: pet-aid-pulse 1.6s ease-in-out infinite; }
.pet-aid-tick { width: 3.2%; min-width: 9px; aspect-ratio: 1.2; border-radius: 50%; background: #3b2314; box-shadow: 0 0 0 2px rgba(255, 255, 255, .8), 0 0 0 5px rgba(239, 68, 68, .55); animation: pet-aid-pulse 1.4s ease-in-out infinite; }
.pet-aid-drip { font-size: clamp(14px, 4vw, 24px); animation: pet-aid-drip 1.8s ease-in infinite; }
.pet-aid-flame { font-size: clamp(16px, 4.5vw, 28px); animation: pet-aid-flicker .5s ease-in-out infinite alternate; }
.pet-aid-bee { font-size: clamp(16px, 4.5vw, 28px); animation: pet-aid-buzz 1.2s ease-in-out infinite; }
.pet-aid-ouch, .pet-aid-dizzy { animation: pet-aid-spin 2s linear infinite; }
.pet-aid-sun { font-size: clamp(30px, 9vw, 54px); animation: pet-aid-pulse 2.4s ease-in-out infinite; }
.pet-aid-tint { position: absolute; inset: 0; -webkit-mask: var(--pet-aid-mask) center / 100% 100% no-repeat; mask: var(--pet-aid-mask) center / 100% 100% no-repeat; mix-blend-mode: multiply; animation: pet-aid-tint 2.4s ease-in-out infinite; }
.pet-aid-frozen { background: rgba(96, 165, 250, .55); }
.pet-aid-hot { background: rgba(248, 113, 113, .4); }
@keyframes pet-aid-tint { 50% { opacity: .7; } }
.pet-aid-sweat, .pet-aid-shiver { font-size: clamp(16px, 4.5vw, 28px); animation: pet-aid-shake .35s ease-in-out infinite alternate; }
.pet-aid-snow { font-size: clamp(12px, 3.5vw, 20px); opacity: 0; animation: pet-aid-fall 2.8s linear infinite; }
.pet-aid-water { font-size: clamp(14px, 4vw, 24px); opacity: 0; animation: pet-aid-fall-short 1.4s ease-in 3; }
.pet-aid-plaster, .pet-aid-ice, .pet-aid-pinch, .pet-aid-clean, .pet-aid-lift, .pet-aid-drink, .pet-aid-blanket, .pet-aid-tea { animation: pet-aid-pop .5s ease-out both; }
/* (krátké úkony – opláchnutí, led, stisknutí nosu… – po chvíli vyblednou a zmizí; náplast a deka zůstanou) */
.pet-aid-temp:not(.pet-aid-water) { animation: pet-aid-pop .5s ease-out both, pet-aid-fade .6s ease-in 3.9s forwards; }
@keyframes pet-aid-fade { to { opacity: 0; } }
.pet-aid-plaster { transform: translate(-50%, -50%) rotate(-25deg); animation-name: pet-aid-pop-tilt; }
.pet-aid-blanket { font-size: clamp(34px, 11vw, 64px); }
.pet-aid-tree { font-size: clamp(44px, 14vw, 86px); animation: pet-aid-pop .6s ease-out both; }
.pet-aid-heart { font-size: clamp(16px, 4.5vw, 28px); opacity: 0; animation: pet-friend-heart 2.4s ease-out 2; }
@keyframes pet-aid-pulse { 50% { transform: translate(-50%, -50%) scale(1.15); } }
@keyframes pet-aid-drip { 0% { transform: translate(-50%, -60%) scale(.6); opacity: 0; } 25% { opacity: 1; } 100% { transform: translate(-50%, 90%) scale(1); opacity: 0; } }
@keyframes pet-aid-flicker { to { transform: translate(-50%, -58%) scale(1.15) rotate(6deg); } }
@keyframes pet-aid-buzz { 0%, 100% { transform: translate(-80%, -50%) rotate(-10deg); } 25% { transform: translate(-20%, -90%) rotate(8deg); } 50% { transform: translate(40%, -40%) rotate(-6deg); } 75% { transform: translate(-30%, -10%) rotate(10deg); } }
@keyframes pet-aid-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes pet-aid-shake { to { transform: translate(-42%, -50%); } }
@keyframes pet-aid-fall { 0% { opacity: 0; transform: translate(-50%, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 260%) rotate(90deg); } }
@keyframes pet-aid-fall-short { 0% { opacity: 0; transform: translate(-50%, -50%); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 160%); } }
@keyframes pet-aid-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.3); } }
@keyframes pet-aid-pop-tilt { from { opacity: 0; transform: translate(-50%, -50%) rotate(-25deg) scale(.3); } }
@media (prefers-reduced-motion: reduce) { .pet-aid-item { animation: none !important; opacity: 1 !important; } }
.pet-aid-card { margin: 10px 0; padding: 10px 14px; border: 2px dashed #f87171; border-radius: 16px; background: color-mix(in srgb, #f87171 10%, var(--card)); }
.pet-aid-card > p:only-child { margin: 0; text-align: center; }
.pet-aid-title { margin: 0 0 4px; font-size: 1.05rem; }
.pet-aid-story { margin: 0 0 8px; font-weight: 700; }
.pet-aid-q { margin: 8px 0 6px; font-weight: 700; }
.pet-aid-choices { display: grid; gap: 6px; }
.pet-aid-choice { padding: 9px 12px; border: 2px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pet-aid-choice:hover:not(:disabled) { border-color: #f87171; }
.pet-aid-choice.ok { border-color: #22c55e; background: color-mix(in srgb, #22c55e 18%, var(--card)); }
.pet-aid-choice.wrong { border-color: #ef4444; opacity: .6; text-decoration: line-through; }
.pet-aid-feedback { margin: 8px 0; }
.pet-aid-feedback.ok { color: #16a34a; font-weight: 700; }
.pet-aid-feedback.wrong { color: #dc2626; }
.pet-aid-step .primary { margin-top: 4px; }
.pet-bg-shop { margin: 18px 0 8px; }
.pet-bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pet-bg { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 6px 8px; border: 3px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.pet-bg-pic { width: 100%; aspect-ratio: 3 / 2; border-radius: 10px; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, #9be27a 45%, var(--card)) 0 45%, color-mix(in srgb, #9be27a 12%, var(--card)) 75%); background-size: cover; background-position: center; }
.pet-bg:not(.owned) .pet-bg-pic { filter: saturate(.6); opacity: .85; }
.pet-bg.owned { border-color: #8fd36b; }
.pet-bg.in-use { border-color: #3fa34d; background: color-mix(in srgb, #8fd36b 22%, var(--card)); }
.pet-bg:focus-visible { outline: 3px solid var(--primary); }

/* 🧪 náhled podob a denní doby (jen na testu) – vodorovné přepínače nad mazlíčkem */
.pet-test-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 10px; }
.pet-test-label { font: 700 .85rem var(--font-head); color: var(--muted); }
.pet-test-switch { flex-direction: row; }

/* 🐉 mazlíček ve scéně u Matyho / Terezky (mazlicek.js renderStagePet) – na počítači vpravo dole u kruhu */
.stage-pet { position: absolute; z-index: 2; right: 0; bottom: -6px; width: clamp(92px, 9vw, 132px); height: clamp(92px, 9vw, 132px); padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stage-pet img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 6px 10px rgba(40, 50, 110, .2)); transition: transform .2s ease; }
.stage-pet:hover img, .stage-pet:focus-visible img { transform: scale(1.08) rotate(-3deg); }
.stage-pet:focus-visible { outline: 3px solid var(--primary); border-radius: 16px; }
.stage-pet.pet-none img { filter: grayscale(1) opacity(.55); }
.stage-pet.pet-none::after { content: '?'; position: absolute; inset: 0; display: grid; place-items: center; padding-top: 12%; font: 800 2.6rem var(--font-head); color: #1f2a4d; text-shadow: 0 0 3px #fff, 0 0 6px #fff; }
html.dark .stage-pet.pet-none::after { color: #fff; text-shadow: 0 0 4px #1f2a4d, 0 0 8px #1f2a4d; }
.stage-pet .stage-pet-egg { position: absolute; inset: 0; }
/* ⏸️ pauza po sprostých slovech: malé ⏸️ u mazlíčka (bez kouzelných schopností) – nic víc, ať to neláká */
.stage-pet.pet-paused::before { content: '⏸️'; position: absolute; z-index: 3; left: 4px; top: 4px; font-size: .9rem; }
/* klepající se vajíčko by se při najetí myší rozjelo s lampičkou – lampička zůstane stát */
.stage-pet.pet-egg-small.wobble:hover img, .stage-pet.pet-egg-small.wobble:focus-visible img { transform: none; }
.stage-pet.pet-egg-small.wobble .stage-pet-egg { animation: pet-wobble 1.6s ease-in-out infinite; transform-origin: 71% 98%; }
.stage-pet:not(.sleeping):not(.pet-none):not(.pet-egg-small) img { animation: stage-pet-bob 3.2s ease-in-out infinite; }
@keyframes stage-pet-bob { 50% { transform: translateY(-4px); } }
/* tablet a telefon: v jednom řádku Maty / Terezka – bublina – mazlíček (bublina se zúží sama, scéna se neprodlouží,
   takže štítek „🏠 Vítej“ ukotvený ke spodku scény zůstane u kruhu s postavou) */
@media (max-width: 900px) {
  .stage-pet { position: relative; right: auto; bottom: auto; flex: none; align-self: flex-end; width: 76px; height: 76px; margin-left: -4px; }
}
@media (max-width: 640px) {
  .stage-pet { width: 60px; height: 60px; }
}

/* 💬 mazlíček se občas ozve (mazlicek.js petSay): malá bublina nad ním, ocásek dolů k němu */
.pet-say {
  position: absolute; z-index: 4; right: 2px; bottom: calc(100% + 6px); width: max-content; max-width: 170px;
  padding: 5px 10px; border: 2px solid #3fa34d; border-radius: 14px; background: var(--card); color: var(--text);
  font: 700 .85rem/1.2 var(--font-head); text-align: left; box-shadow: 0 4px 12px rgba(40, 50, 110, .15);
  animation: pet-say-in .3s ease-out;
}
.pet-say::after { content: ''; position: absolute; right: 22px; bottom: -8px; border-style: solid; border-width: 8px 7px 0 7px; border-color: #3fa34d transparent transparent; }
.pet-say.pet-say-action { cursor: pointer; border-color: var(--primary); }
.pet-say.pet-say-action::after { border-top-color: var(--primary); }
.pet-say.pet-say-out { opacity: 0; transform: translateY(-4px); transition: opacity .35s ease, transform .35s ease; }
@keyframes pet-say-in { from { opacity: 0; transform: translateY(6px) scale(.9); } }
@media (max-width: 640px) {
  .pet-say { max-width: 130px; font-size: .75rem; padding: 4px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage-pet img, .pet-say { animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .pet-lamp-glow, .pet-egg .pet-egg-egg, .pet-hatch .pet-img, .pet-img, .pet-sleeper { animation: none; }
  .pet-zzz { animation: none; opacity: .8; }
  .pet-zzz:nth-of-type(2) { transform: translate(14px, -22px); }
  .pet-zzz:nth-of-type(3) { transform: translate(28px, -44px); }
}

/* ✨ Vzácná vajíčka a draci: třpyt (zlatý, stříbrný) a 🌈 holografické přelévání (duhový). Obal kolem obrázku:
   <span class="pet-fx pet-fx-gold" style="--pet-fx-mask: url(mazlicek/drak-zlaty/vejce.webp)"><img …></span>
   – efekty jsou jen nad samotným obrázkem (maska = tvar obrázku), průhledné okolí zůstane čisté. */
.pet-fx { position: relative; display: inline-block; line-height: 0; }
.pet-fx > img { display: block; max-width: 100%; }
.pet-fx::before, .pet-fx::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: var(--pet-fx-mask) center / contain no-repeat; mask: var(--pet-fx-mask) center / contain no-repeat;
}
/* lesklý odlesk přejíždí přes vajíčko */
.pet-fx-gold::after, .pet-fx-silver::after {
  background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, .95) 47%, rgba(255, 255, 255, .45) 53%, transparent 64%) 0 0 / 300% 100% no-repeat;
  mix-blend-mode: overlay; animation: pet-fx-shine 3.2s ease-in-out infinite;
}
.pet-fx-silver::after { mix-blend-mode: screen; opacity: .8; }
@keyframes pet-fx-shine { 0%, 15% { background-position: 120% 0; } 70%, 100% { background-position: -40% 0; } }
/* třpytky: drobné hvězdičky, které se střídavě rozsvěcují */
.pet-fx-gold::before, .pet-fx-silver::before, .pet-fx-rainbow::before {
  --g: #fff7c2;
  background:
    radial-gradient(circle at 28% 32%, var(--g) 0 1.6%, color-mix(in srgb, var(--g) 55%, transparent) 2.6%, transparent 4.2%),
    radial-gradient(circle at 62% 22%, var(--g) 0 1.6%, color-mix(in srgb, var(--g) 55%, transparent) 2.6%, transparent 4.2%),
    radial-gradient(circle at 70% 58%, var(--g) 0 1.6%, color-mix(in srgb, var(--g) 55%, transparent) 2.6%, transparent 4.2%),
    radial-gradient(circle at 38% 70%, var(--g) 0 1.6%, color-mix(in srgb, var(--g) 55%, transparent) 2.6%, transparent 4.2%),
    radial-gradient(circle at 50% 45%, var(--g) 0 1.6%, color-mix(in srgb, var(--g) 55%, transparent) 2.6%, transparent 4.2%);
  z-index: 1; animation: pet-fx-twinkle 1.8s ease-in-out infinite alternate;
}
.pet-fx-silver::before { --g: #ffffff; }
.pet-fx-rainbow::before { --g: #ffffff; animation-duration: 1.3s; }
@keyframes pet-fx-twinkle { 0% { opacity: .15; transform: scale(.96) rotate(-2deg); } 50% { opacity: 1; } 100% { opacity: .35; transform: scale(1.03) rotate(2deg); } }
/* 🌈 holografické přelévání: duhový přeliv jemně přes kresbu (soft-light – kresba zůstane), pomalu se posouvá a mění odstín */
.pet-fx-rainbow::after {
  background: linear-gradient(120deg, #ff5f6d, #ffc371, #f9f871, #7bf1a8, #5ee7ff, #8f7bff, #ff7bd5, #ff5f6d) 0 0 / 300% 300%;
  mix-blend-mode: soft-light; opacity: .7; animation: pet-fx-holo 6s linear infinite;
}
.pet-fx-rainbow > img { filter: saturate(1.15) brightness(1.05); }
@keyframes pet-fx-holo { 0% { background-position: 0% 50%; filter: hue-rotate(0deg); } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; filter: hue-rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pet-fx::before, .pet-fx::after { animation: none; } }

/* 🥄 rozklepání vajíčka lžičkou (mazlicek.js drawPetCrack): praskliny přibývají, nakonec vršek odletí a vykoukne mládě */
.pet-crack { align-items: center; min-height: 300px; overflow: hidden; }
.pet-crack-egg { position: relative; z-index: 1; width: min(240px, 62%); padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; -webkit-tap-highlight-color: transparent; }
.pet-crack-egg:focus-visible { outline: 3px solid var(--primary); outline-offset: 6px; border-radius: 50%; }
.pet-crack-bottom { display: block; width: 100%; height: auto; }
.pet-crack-top { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .8s cubic-bezier(.3, 1.4, .5, 1), opacity .8s; }
.pet-crack-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; -webkit-mask: var(--pet-egg-mask) center / 100% 100% no-repeat; mask: var(--pet-egg-mask) center / 100% 100% no-repeat; }
.pet-crack-lines path { fill: none; stroke: #3b2a1a; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; transition: stroke-dashoffset .3s ease-out; }
.pet-crack-main { stroke-dashoffset: calc(100 - var(--crack, 0) * 100); }
.pet-crack-branch { stroke-dashoffset: 100; stroke-width: 1.1 !important; }
.pet-crack-branch.shown { stroke-dashoffset: 0; }
.pet-crack-egg.tap { animation: pet-crack-shake .35s ease-out; }
@keyframes pet-crack-shake { 20% { transform: rotate(-4deg) scale(.98); } 45% { transform: rotate(3deg); } 70% { transform: rotate(-1.5deg); } }
.pet-spoon { position: absolute; z-index: 2; left: calc(50% + min(60px, 14%)); top: 8%; width: clamp(64px, 20vw, 96px); height: clamp(85px, 27vw, 128px); line-height: 0; transform: rotate(-5deg); transform-origin: 80% 90%; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)); }
.pet-spoon.tap { animation: pet-spoon-tap .35s ease-out; }
@keyframes pet-spoon-tap { 40% { transform: rotate(-32deg) translate(-16px, 12px); } }
.pet-crack-baby { position: absolute; z-index: 0; bottom: 18%; left: 50%; width: min(220px, 56%); transform: translate(-50%, 30%) scale(.3); opacity: 0; transition: transform .8s .25s cubic-bezier(.3, 1.6, .5, 1), opacity .4s .25s; }
.pet-crack.open .pet-crack-top { transform: translate(-30%, -140%) rotate(-40deg); opacity: 0; }
.pet-crack.open .pet-crack-lines, .pet-crack.open .pet-spoon { opacity: 0; transition: opacity .3s; }
/* (obrázek mláděte má vlastní skořápku – spodek vajíčka zmizí, jak mládě vykoukne) */
.pet-crack-bottom { transition: opacity .35s .35s; }
.pet-crack.open .pet-crack-bottom { opacity: 0; }
.pet-crack.open .pet-crack-baby { z-index: 2; transform: translate(-50%, -8%) scale(1); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pet-crack-egg.tap, .pet-spoon.tap { animation: none; } .pet-crack-top, .pet-crack-baby { transition: none; } }

/* 🤗 mazlení přes den (mazlicek.js petHugRow): plyšáci z pelíšku jako tlačítka, při mazlení vyletí srdíčka */
.pet-hug-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 10px; }
.pet-hug-label { font-weight: 800; }
.pet-hug-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border: 2px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text); font: 700 .9rem var(--font-body, inherit); cursor: pointer; }
.pet-hug-btn img { width: 34px; height: 34px; object-fit: contain; }
.pet-hug-btn:hover, .pet-hug-btn:focus-visible { border-color: #f472b6; }
.pet-scene.pet-hugging .pet-img { animation: pet-hug-in .5s ease; }
@keyframes pet-hug-in { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } }
.pet-scene.pet-hugging::after { content: '💕'; position: absolute; left: 50%; top: 18%; font-size: 2.2rem; pointer-events: none; animation: pet-hug-heart 1.6s ease-out 2; }
@keyframes pet-hug-heart { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50px) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .pet-scene.pet-hugging .pet-img, .pet-scene.pet-hugging::after { animation: none; } }

/* 🩶 chybějící obrázek barevného draka = šedý zelený (mazlicek.js – dočasně, doplnit před ostrou) */
img.pet-missing { filter: grayscale(1) !important; opacity: .7; }
/* ✨ vrstva třpytu přes vajíčko (stejně velký obrázek pod ní); u rozklepávaného zmizí s otevřením */
.pet-fx.pet-fx-layer { position: absolute; inset: 0; display: block; pointer-events: none; }
.pet-crack.open .pet-crack-fx { opacity: 0; transition: opacity .3s; }
/* ✨ drak ve scéně v obalu s třpytem: obal má velikost obrázku */
.pet-scene > .pet-fx-wrap { max-width: min(320px, 80%); }
.pet-scene > .pet-fx-wrap > .pet-img { max-width: 100%; }

/* 🐉 dráček vzhůru (mazlicek.js .pet-awake): pomalu se pohupuje a naklání, občas se protáhne – ať vypadá živě */
.pet-awake { position: relative; display: inline-block; max-width: min(320px, 80%); line-height: 0; transform-origin: 50% 100%; animation: pet-idle 4.2s ease-in-out .5s infinite; }
.pet-awake > .pet-img, .pet-awake > .pet-fx-wrap { max-width: 100%; }
.pet-awake > .pet-fx-wrap > .pet-img { max-width: 100%; }
@keyframes pet-idle {
  0%, 100% { transform: translateY(0) rotate(0) scale(1, 1); }
  25% { transform: translateY(-6px) rotate(-1.5deg) scale(1.01, .99); }
  50% { transform: translateY(0) rotate(0) scale(1.02, .98); }
  70% { transform: translateY(-4px) rotate(1.5deg) scale(.99, 1.02); }
}
/* malý dráček u Matyho: místo jen nahoru-dolů i lehké kývání */
.stage-pet:not(.sleeping):not(.pet-none):not(.pet-egg-small) img { animation: stage-pet-idle 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes stage-pet-idle { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-5px) rotate(-3deg); } 60% { transform: translateY(0) rotate(0) scale(1.03, .97); } 80% { transform: translateY(-3px) rotate(2.5deg); } }

/* ✨ jiskřičky kolem vzácného draka (mazlicek.js petSparkles): náhodně se rozsvěcují a zhasínají */
.pet-spark { position: absolute; z-index: 3; left: var(--x); top: var(--y); font-size: calc(1.7rem * var(--s, 1)); line-height: 1; pointer-events: none; transform: translate(-50%, -50%) scale(0); opacity: 0; animation: pet-spark 2.6s ease-in-out var(--d, 0s) infinite; }
.pet-spark-gold { color: #fffdf0; text-shadow: 0 0 3px #ffb300, 0 0 9px #ff9800, 0 0 18px #ffd54a; }
.pet-spark-silver { color: #f4f8ff; text-shadow: 0 0 2px #6d7f9c, 0 0 8px #8fa3c4, 0 0 16px #c9d6ea; }
.pet-spark-rainbow { color: #fff; text-shadow: 0 0 6px #ff9ad5, 0 0 12px #8be0ff; animation-name: pet-spark, pet-spark-hue; animation-duration: 2.6s, 4s; animation-timing-function: ease-in-out, linear; animation-iteration-count: infinite, infinite; }
@keyframes pet-spark { 0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0); } 25%, 45% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(45deg); } 70% { opacity: 0; transform: translate(-50%, -62%) scale(.4) rotate(90deg); } }
@keyframes pet-spark-hue { to { filter: hue-rotate(360deg); } }
.stage-pet .pet-spark { font-size: calc(.95rem * var(--s, 1)); }
@media (prefers-reduced-motion: reduce) {
  .pet-awake, .pet-spark { animation: none; }
  .pet-spark { opacity: .7; transform: translate(-50%, -50%) scale(.8); }
}

/* 🏆 Mazlíčci za zásluhy (mazlicek.js petQuests): začouzené vajíčko, úkol s ukazatelem, schopnost */
.pet-quest { display: flex; gap: 12px; align-items: center; margin: 10px 0; padding: 10px 12px; border-radius: 16px; background: color-mix(in srgb, #c8a24a 10%, var(--card)); border: 1px solid color-mix(in srgb, #c8a24a 35%, transparent); text-align: left; }
.pet-quest img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.pet-quest.done:not(.owned) img { animation: pet-wobble 1.6s ease-in-out infinite; }
.pet-quest-text { flex: 1; min-width: 0; }
.pet-quest-text p { margin: 4px 0; }
.pet-quest-text .wallet-bar { margin: 6px 0 2px; }
.pet-quest-state { font-weight: 600; }
.pet-quest .primary { margin-top: 6px; }
/* ✨ schopnost místo pelíšku s plyšáky */
.pet-power { background: linear-gradient(180deg, color-mix(in srgb, #c8a24a 16%, var(--card)), var(--card)); }
/* 🐈‍⬛ tmavý mazlíček v noci nesplývá s nočním pozadím – jemná světlá záře */
.pet-dark .pet-img, .pet-dark .pet-sleep { filter: drop-shadow(0 0 10px rgba(255, 236, 200, .45)); }
