Spaces:
Running

laureen Claude Opus 5.5 commited on
Commit
eb2eb2d
·
1 Parent(s): 1ba8140

Compact phone layout and simpler companion panel

Browse files

On phones the header, needs and actions took most of the screen and hid
Microduck. Small screens now get a slim header, a one-line needs strip, a
smaller thought bubble and a single scrolling row of actions.
The Open journal and Reset to low needs buttons are removed (with the journal
panel, its JSON export and x12 control); the guides point to the console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MICRODUCK-PET.en.md CHANGED
@@ -58,8 +58,10 @@ The online version is published on the Hugging Face Space `FormaLau/DuckAgochi`.
58
  - **Coming back after a while**: real elapsed time is taken into account. Energy
59
  recovers while food, water, joy and affection slowly decrease. Nothing is
60
  irreversible.
61
- - **Journal and workshop**: decision journal, ×12 speed, JSON export and a
62
- **Reset to low needs** button to start a session over.
 
 
63
 
64
  This is a working prototype of explainable behavioural AI: need rules, refusal
65
  thresholds, timers and small preferences that change with care. It does not use
@@ -81,8 +83,9 @@ Browsers block sound until the user interacts with the page: click **Sound off**
81
  mutes sound again. No text is read aloud.
82
  **Close up** brings the camera closer to watch the beak and expressions;
83
  **Wide view** goes back to the overview. The needs panel is open by default:
84
- click the name and percentage at the top left to collapse or reopen it. The ×12
85
- speed accelerates the needs, not the sounds or physical motions. **Pause**
 
86
  suspends needs and decisions, disables care actions and mutes sound; a motion
87
  already under way finishes to keep the robot balanced.
88
 
@@ -93,10 +96,9 @@ already under way finishes to keep the robot balanced.
93
  2. **Feed**: watch him walk to the plate and take three bites. Food only goes up
94
  during the meal. Once full, he refuses with a sound and a head shake.
95
  3. **Drink**, then the same by the lake: he drinks directly from the shore.
96
- 4. **Throw ball**, **Score a goal** or **Somersault**, then **Cuddle**. Open the
97
- journal (**Open journal**) and export an observation; compare preferences
98
- before and after.
99
- 5. In **Open journal → Workshop · observe decisions**, choose *Demo ×12*. Watch
100
  fatigue build up. When energy is low, offer a game: he refuses and goes to
101
  sleep.
102
  6. **Pause**: needs and decisions are suspended, care actions disabled. Physics
@@ -120,8 +122,8 @@ s.setState(({ pet }) => ({ pet: {
120
 
121
  Use a separate browser profile for destructive tests, and only one DuckAgochi page
122
  per profile: syncing between tabs is not implemented. Memories belong to this
123
- browser and this address; clearing browser data erases them. The JSON export is
124
- an observation log, not a file that can be imported back. Companion mode does
125
  not join multiplayer sessions.
126
 
127
  ## Teaching plan
 
58
  - **Coming back after a while**: real elapsed time is taken into account. Energy
59
  recovers while food, water, joy and affection slowly decrease. Nothing is
60
  irreversible.
61
+ - **Uncluttered interface**: only needs, care and play are on screen. On phones
62
+ the gauges fit on one line and the buttons on one scrolling row, so Microduck
63
+ stays in view. For workshops, the browser console lets you inspect and change
64
+ the state (see below).
65
 
66
  This is a working prototype of explainable behavioural AI: need rules, refusal
67
  thresholds, timers and small preferences that change with care. It does not use
 
83
  mutes sound again. No text is read aloud.
84
  **Close up** brings the camera closer to watch the beak and expressions;
85
  **Wide view** goes back to the overview. The needs panel is open by default:
86
+ click the name and percentage at the top left to collapse or reopen it. In a workshop,
87
+ `window.__petStore.setState({ speed: 12 })` in the console speeds up the needs,
88
+ not the sounds or physical motions. **Pause**
89
  suspends needs and decisions, disables care actions and mutes sound; a motion
90
  already under way finishes to keep the robot balanced.
91
 
 
96
  2. **Feed**: watch him walk to the plate and take three bites. Food only goes up
97
  during the meal. Once full, he refuses with a sound and a head shake.
98
  3. **Drink**, then the same by the lake: he drinks directly from the shore.
99
+ 4. **Throw ball**, **Score a goal** or **Somersault**, then **Cuddle**, and watch
100
+ the gauges change.
101
+ 5. In the console, type `window.__petStore.setState({ speed: 12 })`. Watch
 
102
  fatigue build up. When energy is low, offer a game: he refuses and goes to
103
  sleep.
104
  6. **Pause**: needs and decisions are suspended, care actions disabled. Physics
 
122
 
123
  Use a separate browser profile for destructive tests, and only one DuckAgochi page
124
  per profile: syncing between tabs is not implemented. Memories belong to this
125
+ browser and this address; clearing browser data erases them. The saved state can be
126
+ read in the console with `window.__petStore.getState().pet`. Companion mode does
127
  not join multiplayer sessions.
128
 
129
  ## Teaching plan
MICRODUCK-PET.md CHANGED
@@ -59,8 +59,10 @@ La version en ligne est publiée sur le Space Hugging Face `FormaLau/DuckAgochi`
59
  - **Retour après absence** : le temps réellement écoulé est pris en compte.
60
  L’énergie remonte, tandis que la nourriture, l’eau, la joie et l’affection
61
  baissent lentement. Rien n’est irréversible.
62
- - **Carnet et atelier** : journal des décisions, accélération ×12, export JSON
63
- et bouton **Reset to low needs** pour recommencer une séance.
 
 
64
 
65
  Il s’agit d’un prototype fonctionnel d’IA comportementale explicable : règles de
66
  besoins, seuils de refus, temporisations et petites préférences qui évoluent
@@ -85,8 +87,8 @@ Le même bouton coupe le son. Aucun texte n’est lu à voix haute.
85
  **Close up** rapproche la caméra pour observer le bec et les expressions ;
86
  **Wide view** revient à la vue d’ensemble. Le panneau des besoins est ouvert
87
  par défaut : cliquer sur le prénom et le pourcentage en haut à gauche pour le
88
- replier ou le rouvrir. Le rythme ×12 accélère les besoins, pas les sons ni les
89
- gestes physiques. **Pause** suspend les besoins et les décisions, désactive les
90
  soins et coupe le son ; un mouvement déjà engagé se termine pour préserver
91
  l’équilibre.
92
 
@@ -99,10 +101,9 @@ l’équilibre.
99
  nourriture n’augmente que pendant le repas. Une fois rassasié, il refuse par
100
  un son et un mouvement de tête.
101
  3. **Drink**, puis la même chose au bord du lac : il boit directement sur la rive.
102
- 4. **Throw ball**, **Score a goal** ou **Somersault**, puis **Cuddle**. Ouvrir le
103
- carnet (**Open journal**) et exporter une observation ; comparer les
104
- préférences avant/après.
105
- 5. Dans **Open journal → Workshop · observe decisions**, choisir *Demo ×12*.
106
  Observer la fatigue qui monte. Quand l’énergie est basse, proposer un jeu :
107
  il refuse et part dormir.
108
  6. **Pause** : besoins et décisions sont suspendus, soins désactivés. La physique
@@ -129,8 +130,8 @@ s.setState(({ pet }) => ({ pet: {
129
  Utiliser un profil de navigateur séparé pour les essais destructifs, et une seule
130
  page DuckAgochi par profil : la synchronisation entre plusieurs onglets n’est pas
131
  implémentée. Les souvenirs restent propres à ce navigateur et à cette adresse ;
132
- effacer les données du navigateur les efface. L’export JSON est une trace
133
- d’observation, pas un fichier réimportable. Le mode compagnon ne rejoint pas les
134
  sessions multijoueurs.
135
 
136
  ## Organisation pédagogique
 
59
  - **Retour après absence** : le temps réellement écoulé est pris en compte.
60
  L’énergie remonte, tandis que la nourriture, l’eau, la joie et l’affection
61
  baissent lentement. Rien n’est irréversible.
62
+ - **Interface épurée** : seuls les besoins, les soins et les jeux sont à l’écran.
63
+ Sur téléphone, les jauges tiennent sur une ligne et les boutons sur une rangée
64
+ qui défile, pour laisser Microduck visible. Pour l’atelier, la console du
65
+ navigateur permet d’observer et de modifier l’état (voir plus bas).
66
 
67
  Il s’agit d’un prototype fonctionnel d’IA comportementale explicable : règles de
68
  besoins, seuils de refus, temporisations et petites préférences qui évoluent
 
87
  **Close up** rapproche la caméra pour observer le bec et les expressions ;
88
  **Wide view** revient à la vue d’ensemble. Le panneau des besoins est ouvert
89
  par défaut : cliquer sur le prénom et le pourcentage en haut à gauche pour le
90
+ replier ou le rouvrir. En atelier, `window.__petStore.setState({ speed: 12 })`
91
+ dans la console accélère les besoins, pas les sons ni les gestes physiques. **Pause** suspend les besoins et les décisions, désactive les
92
  soins et coupe le son ; un mouvement déjà engagé se termine pour préserver
93
  l’équilibre.
94
 
 
101
  nourriture n’augmente que pendant le repas. Une fois rassasié, il refuse par
102
  un son et un mouvement de tête.
103
  3. **Drink**, puis la même chose au bord du lac : il boit directement sur la rive.
104
+ 4. **Throw ball**, **Score a goal** ou **Somersault**, puis **Cuddle**, et observer
105
+ les jauges qui changent.
106
+ 5. Dans la console, taper `window.__petStore.setState({ speed: 12 })`.
 
107
  Observer la fatigue qui monte. Quand l’énergie est basse, proposer un jeu :
108
  il refuse et part dormir.
109
  6. **Pause** : besoins et décisions sont suspendus, soins désactivés. La physique
 
130
  Utiliser un profil de navigateur séparé pour les essais destructifs, et une seule
131
  page DuckAgochi par profil : la synchronisation entre plusieurs onglets n’est pas
132
  implémentée. Les souvenirs restent propres à ce navigateur et à cette adresse ;
133
+ effacer les données du navigateur les efface. Le contenu de la sauvegarde est lisible
134
+ dans la console avec `window.__petStore.getState().pet`. Le mode compagnon ne rejoint pas les
135
  sessions multijoueurs.
136
 
137
  ## Organisation pédagogique
app/src/pet/PetPanel.jsx CHANGED
@@ -1,51 +1,47 @@
1
- import { useEffect, useRef, useState } from 'react';
2
- import { useGame, gameApi, bootLog } from '../store.js';
3
- import { happiness } from './engine.js';
4
- import { usePet, advance, care, rename, savePet, resumePet, suspendPet, physicalEvent, configure, resetNeeds } from './store.js';
5
- import { petVoice } from './emotions.js';
6
  import './pet.css';
7
- import ThoughtBubble from './ThoughtBubble.jsx';
8
-
9
- const NEEDS = [['satiety','Food'],['hydration','Water'],['energy','Energy'],['stimulation','Joy'],['affection','Affection']];
10
- const ACTIONS = [['feed','◒','Feed','Fresh vegetables'],['drink','◉','Drink','Water on the table'],['treat','♧','Give a treat','A little delight'],['ball','⚽','Throw ball','Chase and kick'],['goal','⚑','Score a goal','Aim for the net'],['roll','↻','Somersault','A playful tumble'],['cuddle','♡','Cuddle','A little love'],['rest','☾','Sleep','Time to recharge']];
11
- export default function PetPanel() {
12
- const {pet,paused,speed,storageError,scene,soundEnabled,soundError,environment,subtitles}=usePet();
13
- const [games,setGames]=useState(false),[closeup,setCloseup]=useState(false),[profileOpen,setProfileOpen]=useState(true),[details,setDetails]=useState(false);
14
- const [ready,setReady]=useState(false),[editing,setEditing]=useState(false),[name,setName]=useState(pet.name);
15
- const bootDone=useGame(s=>s.bootDone),bootFailed=useGame(s=>s.bootFailed),started=useRef(false);
16
- async function unlockSound(){await petVoice.unlock();usePet.setState({soundEnabled:petVoice.enabled,soundError:petVoice.error});}
17
- async function action(key){setDetails(false);await unlockSound();if(key==='play'){setGames(!games);return;}care(key);setGames(false);}
18
- useEffect(()=>{document.title='DuckAgochi · Your little companion';document.documentElement.lang='en';if(bootDone&&!started.current){started.current=true;gameApi.startEntrance?.();}},[bootDone]);
19
- useEffect(()=>{
20
- let last=performance.now(),elapsed=0,framed=false;
21
- const timer=setInterval(()=>{const now=performance.now(),dt=Math.min((now-last)/1000,1);last=now;const live=!!gameApi.petReady?.();setReady(live);if(live&&!framed){gameApi.petCamera?.();framed=true;}if(live&&!document.hidden)advance(dt);elapsed+=dt;if(elapsed>=5){elapsed=0;savePet();}},250);
22
- const save=()=>{if(document.hidden){suspendPet();petVoice.stop();}else{resumePet();last=performance.now();}};window.addEventListener('pagehide',save);document.addEventListener('visibilitychange',save);
23
- return()=>{clearInterval(timer);savePet();window.removeEventListener('pagehide',save);document.removeEventListener('visibilitychange',save);};
24
- },[]);
25
- const exportPet=()=>{const url=URL.createObjectURL(new Blob([JSON.stringify({...pet,savedAt:Date.now()},null,2)],{type:'application/json'}));const a=document.createElement('a');a.href=url;a.download='duckagochi-observation.json';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);};
26
- return <div className="pet-app">
27
- <header className="pet-header"><a className="pet-brand" href="?">Duck<span>Agochi</span><i>Small moments. Real feelings.</i></a>
28
- <div className="pet-header-actions">
29
- <label className="pet-environment">Environment<select aria-label="Environment" value={environment} onChange={e=>{configure({environment:e.target.value});setCloseup(false);gameApi.petCamera?.();}}><option value="home">Cozy home</option><option value="bedroom">Child's bedroom</option><option value="lake">By the lake</option></select></label>
30
- <button className="pet-top-button" aria-pressed={subtitles} onClick={()=>configure({subtitles:!subtitles})}>{subtitles?'Hide thoughts':'Show thoughts'}</button>
31
- <button className="pet-top-button" onClick={async()=>{if(soundEnabled){petVoice.mute();usePet.setState({soundEnabled:false});}else{petVoice.userMuted=false;await unlockSound();petVoice.start('yes');}}}>{soundEnabled?'Sound on':'Sound off'}</button>
32
- <button className="pet-top-button" onClick={()=>{setCloseup(!closeup);gameApi.petCamera?.(!closeup);}}>{closeup?'Wide view':'Close up'}</button>
33
- </div>
34
- </header>
35
- <button className="pet-summary" aria-expanded={profileOpen} aria-label={profileOpen?'Hide needs':'Show needs'} onClick={()=>{setProfileOpen(!profileOpen);setDetails(false);}}>{pet.name} · {happiness(pet)}% <span>♡</span></button>
36
- {profileOpen&&<aside className="pet-card pet-profile"><div className="pet-eyebrow">YOUR LITTLE COMPANION</div>
37
- {editing?<form onSubmit={e=>{e.preventDefault();rename(name);setEditing(false);}}><label htmlFor="pet-name">Name</label><input id="pet-name" autoFocus maxLength={24} value={name} onChange={e=>setName(e.target.value)}/><button>Save</button></form>:<h1>{pet.name}<button className="pet-rename" aria-label="Rename" onClick={()=>setEditing(true)}>✎</button></h1>}
38
- <div className="pet-needs">{NEEDS.map(([key,label])=><div className="pet-need" key={key}><div><span>{label}</span><strong>{Math.round(pet.needs[key])}<small> / 100</small></strong></div><meter aria-label={label} min="0" max="100" low="30" optimum="85" value={pet.needs[key]}/></div>)}</div>
39
- <div className="pet-scores">⚽ {scene.goals} goals · ↻ {scene.rolls} somersaults</div><div className="pet-bond">Your bond <strong>{Math.round(pet.bond)}%</strong><p>Little moments make a friendship.</p></div>
40
- <button className="pet-details-button" onClick={()=>setDetails(!details)}>{details?'Close journal':'Open journal'}</button>
41
- <button className="pet-details-button" onClick={()=>{resetNeeds();setDetails(false);}}>Reset to low needs</button>
42
- </aside>}
43
  {subtitles&&<ThoughtBubble pet={pet} paused={paused}/>}
44
- {pet.task&&<button className="pet-cancel pet-top-button" onClick={()=>physicalEvent('finish',false)}>Stop activity ×</button>}
45
- {soundError&&<p className="pet-sound-error" role="status">Sound could not start. Try the sound button again.</p>}
46
- {games&&<section className="pet-card pet-games"><div className="pet-eyebrow">TIME TOGETHER</div><h2>What shall we play?</h2><button onClick={()=>action('ball')}><b>⚽ Throw ball</b><span>Chase it and kick · {scene.kicks} kicks · {scene.goals} goals</span></button><button onClick={()=>action('roll')}><b>↻ Somersault</b><span>A little tumble · {scene.rolls} completed</span></button><button onClick={()=>action('course')}><b>◎ Ring trail</b><span>Follow three rings · {scene.rings} reached</span></button><small>A tired duck needs sleep before playing.</small></section>}
47
- {!ready&&<div className="pet-loading" role="status">{bootFailed?<><strong>This little world could not start.</strong><p>{bootLog.filter(e=>e.raw).at(-1)?.label}</p><button onClick={()=>location.reload()}>Try again</button></>:bootDone?'Settling in…':'Preparing your little world…'}</div>}
48
- {details&&<aside className="pet-card pet-journal"><div className="pet-eyebrow">{pet.name.toUpperCase()}'S JOURNAL</div><h2>Growing together.</h2><p>{pet.interactions} shared moments.</p><ol>{pet.journal.slice(0,6).map((e,i)=><li key={`${e.at}-${i}`}><small>{Math.floor(e.at/60)} minutes old</small>{e.text}</li>)}</ol><details><summary>Workshop · observe decisions</summary><p>Needs, personality and your care shape your companion's choices.</p><label>Time speed<select value={speed} onChange={e=>usePet.setState({speed:Number(e.target.value)})}><option value="1">Normal ×1</option><option value="12">Demo ×12</option></select></label><button onClick={exportPet}>Export observation JSON</button></details></aside>}
49
- <footer className="pet-footer"><div className="pet-actions">{ACTIONS.map(([key,icon,label,hint])=><button key={key} aria-label={label} disabled={!ready||paused} onClick={()=>action(key)}><span className="pet-action-icon">{icon}</span><strong>{label}</strong><small>{key==='drink'&&environment==='lake'?'Fresh lake water':hint}</small></button>)}<button className="pet-pause" aria-label={paused?'Resume companion':'Pause companion'} onClick={()=>{petVoice.stop();usePet.setState({paused:!paused});}}><span className="pet-action-icon">{paused?'▷':'Ⅱ'}</span><strong>{paused?'Resume':'Pause'}</strong><small>Take your time</small></button></div><p>{storageError?'Local saving is unavailable. Export the journal to keep a record.':'Memories stay in this browser.'}</p></footer>
50
- </div>;
51
- }
 
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import { useGame, gameApi, bootLog } from '../store.js';
3
+ import { happiness } from './engine.js';
4
+ import { usePet, advance, care, rename, savePet, resumePet, suspendPet, physicalEvent, configure } from './store.js';
5
+ import { petVoice } from './emotions.js';
6
  import './pet.css';
7
+ import ThoughtBubble from './ThoughtBubble.jsx';
8
+
9
+ const NEEDS = [['satiety','Food'],['hydration','Water'],['energy','Energy'],['stimulation','Joy'],['affection','Affection']];
10
+ const ACTIONS = [['feed','◒','Feed','Fresh vegetables'],['drink','◉','Drink','Water on the table'],['treat','♧','Give a treat','A little delight'],['ball','⚽','Throw ball','Chase and kick'],['goal','⚑','Score a goal','Aim for the net'],['roll','↻','Somersault','A playful tumble'],['cuddle','♡','Cuddle','A little love'],['rest','☾','Sleep','Time to recharge']];
11
+ export default function PetPanel() {
12
+ const {pet,paused,storageError,scene,soundEnabled,soundError,environment,subtitles}=usePet();
13
+ const [games,setGames]=useState(false),[closeup,setCloseup]=useState(false),[profileOpen,setProfileOpen]=useState(true);
14
+ const [ready,setReady]=useState(false),[editing,setEditing]=useState(false),[name,setName]=useState(pet.name);
15
+ const bootDone=useGame(s=>s.bootDone),bootFailed=useGame(s=>s.bootFailed),started=useRef(false);
16
+ async function unlockSound(){await petVoice.unlock();usePet.setState({soundEnabled:petVoice.enabled,soundError:petVoice.error});}
17
+ async function action(key){await unlockSound();if(key==='play'){setGames(!games);return;}care(key);setGames(false);}
18
+ useEffect(()=>{document.title='DuckAgochi · Your little companion';document.documentElement.lang='en';if(bootDone&&!started.current){started.current=true;gameApi.startEntrance?.();}},[bootDone]);
19
+ useEffect(()=>{
20
+ let last=performance.now(),elapsed=0,framed=false;
21
+ const timer=setInterval(()=>{const now=performance.now(),dt=Math.min((now-last)/1000,1);last=now;const live=!!gameApi.petReady?.();setReady(live);if(live&&!framed){gameApi.petCamera?.();framed=true;}if(live&&!document.hidden)advance(dt);elapsed+=dt;if(elapsed>=5){elapsed=0;savePet();}},250);
22
+ const save=()=>{if(document.hidden){suspendPet();petVoice.stop();}else{resumePet();last=performance.now();}};window.addEventListener('pagehide',save);document.addEventListener('visibilitychange',save);
23
+ return()=>{clearInterval(timer);savePet();window.removeEventListener('pagehide',save);document.removeEventListener('visibilitychange',save);};
24
+ },[]);
25
+ return <div className="pet-app">
26
+ <header className="pet-header"><a className="pet-brand" href="?">Duck<span>Agochi</span><i>Small moments. Real feelings.</i></a>
27
+ <div className="pet-header-actions">
28
+ <label className="pet-environment">Environment<select aria-label="Environment" value={environment} onChange={e=>{configure({environment:e.target.value});setCloseup(false);gameApi.petCamera?.();}}><option value="home">Cozy home</option><option value="bedroom">Child's bedroom</option><option value="lake">By the lake</option></select></label>
29
+ <button className="pet-top-button" aria-pressed={subtitles} onClick={()=>configure({subtitles:!subtitles})}>{subtitles?'Hide thoughts':'Show thoughts'}</button>
30
+ <button className="pet-top-button" onClick={async()=>{if(soundEnabled){petVoice.mute();usePet.setState({soundEnabled:false});}else{petVoice.userMuted=false;await unlockSound();petVoice.start('yes');}}}>{soundEnabled?'Sound on':'Sound off'}</button>
31
+ <button className="pet-top-button" onClick={()=>{setCloseup(!closeup);gameApi.petCamera?.(!closeup);}}>{closeup?'Wide view':'Close up'}</button>
32
+ </div>
33
+ </header>
34
+ <button className="pet-summary" aria-expanded={profileOpen} aria-label={profileOpen?'Hide needs':'Show needs'} onClick={()=>setProfileOpen(!profileOpen)}>{pet.name} · {happiness(pet)}% <span>♡</span></button>
35
+ {profileOpen&&<aside className="pet-card pet-profile"><div className="pet-eyebrow">YOUR LITTLE COMPANION</div>
36
+ {editing?<form onSubmit={e=>{e.preventDefault();rename(name);setEditing(false);}}><label htmlFor="pet-name">Name</label><input id="pet-name" autoFocus maxLength={24} value={name} onChange={e=>setName(e.target.value)}/><button>Save</button></form>:<h1>{pet.name}<button className="pet-rename" aria-label="Rename" onClick={()=>setEditing(true)}>✎</button></h1>}
37
+ <div className="pet-needs">{NEEDS.map(([key,label])=><div className="pet-need" key={key}><div><span>{label}</span><strong>{Math.round(pet.needs[key])}<small> / 100</small></strong></div><meter aria-label={label} min="0" max="100" low="30" optimum="85" value={pet.needs[key]}/></div>)}</div>
38
+ <div className="pet-scores">⚽ {scene.goals} goals · ↻ {scene.rolls} somersaults</div><div className="pet-bond">Your bond <strong>{Math.round(pet.bond)}%</strong><p>Little moments make a friendship.</p></div>
39
+ </aside>}
 
 
 
40
  {subtitles&&<ThoughtBubble pet={pet} paused={paused}/>}
41
+ {pet.task&&<button className="pet-cancel pet-top-button" onClick={()=>physicalEvent('finish',false)}>Stop activity ×</button>}
42
+ {soundError&&<p className="pet-sound-error" role="status">Sound could not start. Try the sound button again.</p>}
43
+ {games&&<section className="pet-card pet-games"><div className="pet-eyebrow">TIME TOGETHER</div><h2>What shall we play?</h2><button onClick={()=>action('ball')}><b>⚽ Throw ball</b><span>Chase it and kick · {scene.kicks} kicks · {scene.goals} goals</span></button><button onClick={()=>action('roll')}><b>↻ Somersault</b><span>A little tumble · {scene.rolls} completed</span></button><button onClick={()=>action('course')}><b>◎ Ring trail</b><span>Follow three rings · {scene.rings} reached</span></button><small>A tired duck needs sleep before playing.</small></section>}
44
+ {!ready&&<div className="pet-loading" role="status">{bootFailed?<><strong>This little world could not start.</strong><p>{bootLog.filter(e=>e.raw).at(-1)?.label}</p><button onClick={()=>location.reload()}>Try again</button></>:bootDone?'Settling in…':'Preparing your little world…'}</div>}
45
+ <footer className="pet-footer"><div className="pet-actions">{ACTIONS.map(([key,icon,label,hint])=><button key={key} aria-label={label} disabled={!ready||paused} onClick={()=>action(key)}><span className="pet-action-icon">{icon}</span><strong>{label}</strong><small>{key==='drink'&&environment==='lake'?'Fresh lake water':hint}</small></button>)}<button className="pet-pause" aria-label={paused?'Resume companion':'Pause companion'} onClick={()=>{petVoice.stop();usePet.setState({paused:!paused});}}><span className="pet-action-icon">{paused?'▷':'Ⅱ'}</span><strong>{paused?'Resume':'Pause'}</strong><small>Take your time</small></button></div><p>{storageError?'Local saving is unavailable: progress will be lost when you leave.':'Memories stay in this browser.'}</p></footer>
46
+ </div>;
47
+ }
 
app/src/pet/pet.css CHANGED
@@ -1,39 +1,39 @@
1
- .pet-app{--cream:#f5f2e9;--muted:#a9b1a9;--green:#c9e9ad;font-family:Inter,system-ui,sans-serif;color:var(--cream);position:fixed;inset:0;z-index:12;pointer-events:none;background:linear-gradient(90deg,rgba(8,12,14,.74),transparent 46%)}
2
- .pet-app button,.pet-app a,.pet-app input,.pet-app select,.pet-app summary,.pet-card{pointer-events:auto}.pet-app button,.pet-app input,.pet-app select{font:inherit}.pet-app button,.pet-app a{touch-action:manipulation}.pet-app button{cursor:pointer}.pet-app button:focus-visible,.pet-app a:focus-visible,.pet-app summary:focus-visible{outline:3px solid var(--green);outline-offset:4px}.pet-app button:disabled{opacity:.4;cursor:wait}.pet-app a{color:inherit;text-decoration:none}.pet-header{display:flex;justify-content:space-between;align-items:center;padding:26px 34px}.pet-brand{font-size:27px;font-weight:800;letter-spacing:-1.4px}.pet-brand>span{color:#18231c;background:var(--green);border-radius:7px;padding:2px 7px;margin-left:7px;font-size:18px;letter-spacing:-.5px}.pet-brand i{display:block;font-size:11px;letter-spacing:.3px;font-weight:400;font-style:normal;color:var(--muted);margin-top:5px}.pet-header-actions{display:flex;align-items:center;gap:28px;font-size:12px}.pet-header-actions a{border:1px solid #ffffff30;padding:10px 15px;border-radius:30px}.pet-live{color:#c7d3c5}.pet-live b{display:inline-block;width:6px;height:6px;background:var(--green);border-radius:50%;margin-right:7px;box-shadow:0 0 14px #c9e9ad77}.pet-card{background:#18201fe8;border:1px solid #ffffff18;border-radius:22px;backdrop-filter:blur(18px);box-shadow:0 20px 60px #0003}.pet-profile{position:absolute;left:34px;top:125px;width:274px;padding:24px}.pet-eyebrow{font-size:9px;font-weight:700;letter-spacing:1.8px;color:var(--muted)}.pet-profile h1{font-size:40px;line-height:1.25;letter-spacing:-1.8px;margin:9px 0}.pet-rename{background:none;border:0;color:var(--muted);font-size:18px!important;margin-left:10px;vertical-align:middle}.pet-character{display:inline-block;font-size:11px;padding:5px 9px;border:1px solid #c9e9ad30;border-radius:6px;color:var(--green)}.pet-mood{margin:24px 0 22px;font-size:14px}.pet-mood small{display:block;margin-top:5px;color:var(--muted);font-size:10px}.pet-need{margin:15px 0}.pet-need>div{display:flex;justify-content:space-between;font-size:12px}.pet-need strong{font-size:11px;font-weight:500}.pet-need small{font-size:9px;color:var(--muted)}.pet-need meter{display:block;width:100%;height:6px;margin-top:9px;background:#ffffff16;border:0;border-radius:10px;overflow:hidden}.pet-need meter::-webkit-meter-bar{background:#ffffff16;border:0;height:6px}.pet-need meter::-webkit-meter-optimum-value{background:var(--green)}.pet-need meter::-webkit-meter-suboptimum-value{background:#edbf8e}.pet-need meter::-moz-meter-bar{background:var(--green)}.pet-bond{border-top:1px solid #ffffff14;margin-top:24px;padding-top:18px;font-size:11px}.pet-bond strong{float:right;color:var(--green)}.pet-bond p{font-size:10px;color:var(--muted);margin-top:7px}.pet-details-button{width:100%;margin-top:20px;padding:11px 0 0;border:0;border-top:1px solid #ffffff14;background:none;color:var(--cream);text-align:left;font-size:11px!important}.pet-details-button span{float:right}.pet-thought{position:absolute;top:128px;left:calc(50% - 110px);width:360px;text-align:center}.pet-thought>span{font-size:10px;text-transform:uppercase;letter-spacing:2px;color:var(--green)}.pet-thought p{font-size:19px;font-weight:400;line-height:1.5;margin-top:12px;text-shadow:0 2px 12px #000}.pet-footer{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 40px)}.pet-actions{display:flex;gap:5px;border:1px solid #ffffff20;padding:9px;border-radius:20px;background:#1c2424ed;backdrop-filter:blur(20px)}.pet-actions button{display:flex;flex-direction:column;align-items:center;gap:5px;border:0;border-radius:13px;min-width:112px;padding:12px 15px;background:transparent;color:var(--cream);transition:background .2s,transform .2s}.pet-actions button:hover:not(:disabled){background:#c9e9ad17;transform:translateY(-3px)}.pet-action-icon{font-size:24px;line-height:30px;color:var(--green)}.pet-actions strong{font-size:12px;font-weight:500}.pet-actions small{font-size:9px;color:var(--muted)}.pet-actions .pet-pause{border-left:1px solid #ffffff18;border-radius:0 13px 13px 0}.pet-footer>p{font-size:9px;text-align:center;color:var(--muted);margin-top:11px}.pet-footer>p span{margin-left:18px}.pet-loading{position:absolute;top:48%;left:50%;transform:translate(-30%,-50%);padding:22px;border-radius:16px;background:#18201ff0;max-width:450px;font-size:14px}.pet-journal{position:absolute;right:28px;top:125px;width:300px;max-height:calc(100% - 310px);overflow-y:auto;padding:23px}.pet-journal h2{font-size:22px;letter-spacing:-.6px;margin:12px 0}.pet-journal p{font-size:12px;color:var(--muted);line-height:1.7}.pet-journal h3{font-size:12px;margin-top:22px}.pet-journal ol{list-style:none;padding:0}.pet-journal li{font-size:11px;line-height:1.5;padding:10px 0;border-bottom:1px solid #ffffff12}.pet-journal li small{display:block;font-size:9px;color:var(--muted);margin-bottom:4px}.pet-journal details{font-size:11px;margin-top:20px}.pet-journal summary{cursor:pointer;color:var(--green);margin-bottom:10px}.pet-journal label{display:block;margin:12px 0}.pet-journal select,.pet-profile input{display:block;width:100%;border:1px solid #ffffff30;background:#27312d;color:var(--cream);border-radius:6px;padding:8px;margin-top:8px}.pet-journal button,.pet-profile form button,.pet-loading button{border:0;background:var(--green);color:#17251b;border-radius:8px;padding:9px 12px;font-size:11px;margin-top:10px}
3
- @media(max-height:780px) and (min-width:851px){.pet-profile{top:100px;padding:18px;width:250px}.pet-profile h1{font-size:32px}.pet-mood{margin:15px 0}.pet-need{margin:10px 0}.pet-bond{margin-top:15px;padding-top:12px}.pet-thought{top:105px}.pet-actions button{padding:8px 12px}.pet-journal{top:100px}}
4
- @media(max-width:850px){.pet-header{padding:18px}.pet-header-actions{gap:8px}.pet-live{display:none}.pet-profile{left:16px;top:100px;width:205px;padding:16px}.pet-profile h1{font-size:30px}.pet-mood{margin:15px 0}.pet-thought{left:auto;right:18px;top:118px;width:calc(100% - 260px)}.pet-thought p{font-size:15px}.pet-actions button{min-width:80px;padding:8px}.pet-actions small{display:none}.pet-journal{right:16px;top:95px;max-height:calc(100% - 245px);width:300px;z-index:2}.pet-footer>p span{display:none}}
5
- @media(max-width:540px){.pet-header{padding:14px 16px}.pet-brand{font-size:23px}.pet-brand i{font-size:9px}.pet-header-actions a{font-size:10px;padding:8px}.pet-profile{top:87px;width:175px;padding:14px}.pet-eyebrow{font-size:8px;letter-spacing:1px}.pet-profile h1{font-size:28px}.pet-character{font-size:9px}.pet-mood{font-size:11px;margin:12px 0}.pet-mood small{font-size:9px}.pet-need{margin:10px 0}.pet-need>div{font-size:10px}.pet-bond{margin-top:14px;padding-top:12px}.pet-bond p{font-size:9px}.pet-details-button{margin-top:14px}.pet-thought{right:14px;top:95px;width:calc(100% - 220px)}.pet-thought>span{font-size:8px;letter-spacing:1px}.pet-thought p{font-size:12px}.pet-footer{bottom:12px;width:calc(100% - 24px);max-width:none}.pet-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;padding:5px;border-radius:16px}.pet-actions button{min-width:0;padding:6px;gap:1px}.pet-action-icon{font-size:20px;line-height:24px}.pet-actions strong{font-size:10px}.pet-actions .pet-pause{border:0}.pet-footer>p{font-size:8px;margin-top:7px}.pet-journal{width:calc(100% - 32px);max-height:calc(100% - 270px)}.pet-loading{left:50%;transform:translate(-50%,-50%);width:80%}}
6
- @media(max-width:540px){.pet-profile{width:calc(100% - 32px);padding:12px 14px}.pet-profile h1{font-size:25px;margin:4px 0;max-width:55%;overflow-wrap:anywhere}.pet-character{position:absolute;right:14px;top:32px;max-width:44%}.pet-mood{display:none}.pet-needs{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:7px}.pet-need{margin:0}.pet-need>div{display:block;font-size:10px}.pet-need strong{display:block;font-size:10px;margin-top:3px}.pet-need strong small{display:none}.pet-need meter{margin-top:4px}.pet-bond{margin-top:10px;padding-top:8px;font-size:10px}.pet-bond p{display:none}.pet-details-button{margin-top:7px;padding-top:7px;font-size:10px!important}.pet-thought{top:288px;right:22px;width:calc(100% - 44px)}.pet-thought p{margin-top:5px;font-size:12px}}
7
- /* The companion now lives in a sunlit room; quiet cream panels replace the arcade HUD. */
8
- .pet-app{--cream:#403c31;--muted:#746f60;--green:#536e50;background:none}
9
- .pet-card,.pet-actions{background:#fffaf0ed;border-color:#d6c7af;box-shadow:0 10px 38px #523b1520}
10
- .pet-header{background:linear-gradient(#e7dcc9ed,transparent)}
11
- .pet-app .pet-brand{color:#493126;letter-spacing:-1.1px}.pet-brand>span{background:none;color:#a34f2f;border-radius:0;padding:0;margin-left:0;font-size:inherit;letter-spacing:inherit}.pet-header-actions a{border-color:#92836750}
12
- .pet-top-button{background:#fffaf0bb;color:#514e3f;border:1px solid #92836750;padding:10px 14px;border-radius:30px;font-size:12px!important}
13
- .pet-character{border-color:#81966e50}.pet-bond,.pet-details-button{border-color:#6a604c25}
14
- .pet-need meter,.pet-need meter::-webkit-meter-bar{background:#74624a20}.pet-need meter::-webkit-meter-optimum-value{background:#8fa77b}
15
- .pet-thought{top:103px;width:auto;left:50%;transform:translateX(-50%);white-space:nowrap}
16
- .pet-status>span{display:inline-block;background:#fff9e9e6;border:1px solid #d6c7af;border-radius:30px;padding:11px 18px;color:#635b48;font-size:11px;letter-spacing:.5px;text-transform:none;box-shadow:0 4px 20px #523b1515}
17
- .pet-stop{display:block;margin:9px auto;background:#fff9e9dd;border:0;border-radius:20px;color:#746c5c;padding:6px 12px;font-size:10px!important}
18
- .pet-actions button:hover:not(:disabled){background:#9da78425}.pet-actions .pet-pause{border-color:#7b6d5025}.pet-footer>p{color:#5c5648;background:#f2e7d6ce;border-radius:20px;padding:4px 10px}
19
- .pet-loading{background:#fffaf0f2}.pet-journal li{border-color:#83745825}.pet-journal select,.pet-profile input{background:#f2eddf;color:#4b4b38;border-color:#b7ad98}
20
- .pet-journal button,.pet-profile form button,.pet-loading button{background:#d5dfbb}
21
- .pet-games{position:absolute;right:28px;bottom:180px;width:295px;padding:23px}
22
- .pet-games h2{font-size:21px;margin:12px 0 18px}.pet-games button{width:100%;display:block;text-align:left;padding:14px;background:#f2eddf;border:1px solid #dacfb9;border-radius:12px;color:#494a38;margin:8px 0}
23
- .pet-games button:hover{background:#e5e9d2}.pet-games b{font-size:14px}.pet-games span{display:block;font-size:10px;margin-top:5px;color:#786e5b}.pet-games>small{display:block;font-size:10px;margin-top:15px;color:#786e5b}
24
- .pet-sound-error{position:absolute;right:28px;top:90px;background:#fff8e6;padding:10px;border-radius:10px;font-size:11px}
25
- @media(max-width:850px){.pet-header-actions{gap:5px}.pet-top-button{font-size:10px!important;padding:8px}.pet-status{top:100px;left:auto;right:20px;transform:none}.pet-games{bottom:155px;right:16px}}
26
- @media(max-width:540px){.pet-header{align-items:flex-start}.pet-header-actions{max-width:190px;justify-content:flex-end;flex-wrap:wrap}.pet-top-button{font-size:9px!important;padding:6px 8px}.pet-header-actions a{padding:6px;font-size:9px}.pet-profile{top:100px}.pet-status{top:305px;right:auto;left:50%;transform:translateX(-50%);width:max-content;max-width:95%}.pet-status>span{font-size:10px;padding:8px 12px}.pet-games{width:calc(100% - 32px);bottom:175px;z-index:3}.pet-sound-error{top:76px;font-size:9px}}
27
-
28
- .pet-summary{position:absolute;top:88px;left:24px;border:1px solid #d6c7af;border-radius:22px;padding:10px 15px;background:#fffaf0e6;color:#514e3f;font-size:12px!important;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
29
- .pet-summary span{margin-left:12px;color:#536e50}.pet-profile{top:140px;max-height:calc(100% - 320px);overflow-y:auto}
30
- @media(max-width:540px){.pet-summary{top:94px;left:16px;max-width:180px}.pet-profile{top:140px;max-height:calc(100% - 340px)}.pet-status{top:150px}.pet-profile~.pet-status{top:375px}}
31
  .pet-environment{pointer-events:auto;display:flex;flex-direction:column;gap:3px;font-size:10px;color:#514e3f}.pet-environment select{background:#fffaf0;color:#514e3f;border:1px solid #b6a88e;border-radius:16px;padding:7px;font-size:12px}.pet-header-actions{gap:10px}.pet-actions button{min-width:90px;padding:10px}.pet-status{max-width:420px;white-space:normal}.pet-status p{background:#fff9e9ed;padding:10px 15px;border-radius:16px;font-size:13px;text-shadow:none}.pet-cancel{position:absolute;right:24px;top:145px}.pet-needs{grid-template-columns:repeat(5,1fr)}
32
  @media(max-width:850px){.pet-header{align-items:flex-start}.pet-header-actions{max-width:300px;flex-wrap:wrap;justify-content:flex-end}.pet-actions{display:grid;grid-template-columns:repeat(4,1fr)}.pet-actions button{min-width:65px}.pet-footer{width:calc(100% - 24px)}.pet-status{top:170px}.pet-games{bottom:200px}}
33
- @media(max-width:540px){.pet-header-actions{max-width:210px;gap:5px}.pet-brand{font-size:20px}.pet-brand>span{font-size:15px}.pet-environment{width:100%;flex-direction:row;align-items:center;justify-content:flex-end}.pet-environment select{font-size:10px;padding:5px}.pet-summary{top:110px}.pet-status{top:155px;width:90%}.pet-status p{font-size:11px}.pet-cancel{top:115px;right:16px}.pet-profile{top:155px}.pet-games{bottom:185px}.pet-actions button{min-width:0;padding:7px 2px}.pet-header-actions .pet-top-button{font-size:9px!important}.pet-profile~.pet-status{top:370px}}
34
  .pet-profile{width:220px;padding:18px;max-height:calc(100% - 310px)}.pet-profile h1{font-size:30px}.pet-bond{margin-top:12px;padding-top:10px}.pet-need{margin:10px 0}.pet-scores{font-size:11px;color:#536e50;margin-top:15px}.pet-actions{display:grid;grid-template-columns:repeat(9,1fr)}.pet-actions button{min-width:85px;padding:10px 7px}.pet-status{top:105px}.pet-profile~.pet-status{top:105px}.pet-thought p{margin-top:7px}.pet-footer{bottom:12px}.pet-environment select{min-width:125px}
35
  @media(max-width:1050px){.pet-actions{grid-template-columns:repeat(5,1fr)}.pet-actions button{min-width:70px}.pet-actions small{display:none}.pet-footer{width:min(650px,calc(100% - 24px))}}
36
- @media(max-width:540px){.pet-profile{top:145px;width:calc(100% - 32px);padding:10px 14px;max-height:235px}.pet-profile h1{font-size:20px}.pet-needs{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.pet-need{margin:2px 0}.pet-scores{margin-top:7px}.pet-profile .pet-bond{margin-top:5px;padding-top:5px}.pet-details-button{display:inline-block;width:auto;margin-right:12px}.pet-profile~.pet-status{top:375px}.pet-status>span{font-size:10px}.pet-status p{font-size:10px;padding:7px}.pet-actions{grid-template-columns:repeat(5,1fr)}.pet-actions button{min-width:0;padding:5px 2px}.pet-actions strong{font-size:9px}.pet-summary{top:105px}.pet-cancel{top:110px}}
37
 
38
  /* Puffy duck-yellow toy lettering and wordless thought clouds. */
39
  .pet-app .pet-brand{font-family:Fredoka,"Trebuchet MS",system-ui,sans-serif;font-weight:700;font-style:normal;color:#ffc93c;letter-spacing:.5px;-webkit-text-stroke:1.5px #5a3418;paint-order:stroke fill;text-shadow:0 3px 0 #5a3418,0 6px 10px #5a341833}
@@ -47,3 +47,38 @@
47
  @media(max-width:540px){.pet-thought-bubble.pet-status{width:145px;max-width:145px;height:100px}.pet-thought-symbols{inset:12px 14px 28px;gap:9px}.pet-thought-symbols span{font-size:28px}}
48
  @media(max-height:500px) and (orientation:landscape){.pet-thought-bubble.pet-status{width:140px;max-width:140px;height:96px}}
49
  @media(prefers-reduced-motion:reduce){.pet-thought-symbols{animation:none}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .pet-app{--cream:#f5f2e9;--muted:#a9b1a9;--green:#c9e9ad;font-family:Inter,system-ui,sans-serif;color:var(--cream);position:fixed;inset:0;z-index:12;pointer-events:none;background:linear-gradient(90deg,rgba(8,12,14,.74),transparent 46%)}
2
+ .pet-app button,.pet-app a,.pet-app input,.pet-app select,.pet-app summary,.pet-card{pointer-events:auto}.pet-app button,.pet-app input,.pet-app select{font:inherit}.pet-app button,.pet-app a{touch-action:manipulation}.pet-app button{cursor:pointer}.pet-app button:focus-visible,.pet-app a:focus-visible,.pet-app summary:focus-visible{outline:3px solid var(--green);outline-offset:4px}.pet-app button:disabled{opacity:.4;cursor:wait}.pet-app a{color:inherit;text-decoration:none}.pet-header{display:flex;justify-content:space-between;align-items:center;padding:26px 34px}.pet-brand{font-size:27px;font-weight:800;letter-spacing:-1.4px}.pet-brand>span{color:#18231c;background:var(--green);border-radius:7px;padding:2px 7px;margin-left:7px;font-size:18px;letter-spacing:-.5px}.pet-brand i{display:block;font-size:11px;letter-spacing:.3px;font-weight:400;font-style:normal;color:var(--muted);margin-top:5px}.pet-header-actions{display:flex;align-items:center;gap:28px;font-size:12px}.pet-header-actions a{border:1px solid #ffffff30;padding:10px 15px;border-radius:30px}.pet-live{color:#c7d3c5}.pet-live b{display:inline-block;width:6px;height:6px;background:var(--green);border-radius:50%;margin-right:7px;box-shadow:0 0 14px #c9e9ad77}.pet-card{background:#18201fe8;border:1px solid #ffffff18;border-radius:22px;backdrop-filter:blur(18px);box-shadow:0 20px 60px #0003}.pet-profile{position:absolute;left:34px;top:125px;width:274px;padding:24px}.pet-eyebrow{font-size:9px;font-weight:700;letter-spacing:1.8px;color:var(--muted)}.pet-profile h1{font-size:40px;line-height:1.25;letter-spacing:-1.8px;margin:9px 0}.pet-rename{background:none;border:0;color:var(--muted);font-size:18px!important;margin-left:10px;vertical-align:middle}.pet-character{display:inline-block;font-size:11px;padding:5px 9px;border:1px solid #c9e9ad30;border-radius:6px;color:var(--green)}.pet-mood{margin:24px 0 22px;font-size:14px}.pet-mood small{display:block;margin-top:5px;color:var(--muted);font-size:10px}.pet-need{margin:15px 0}.pet-need>div{display:flex;justify-content:space-between;font-size:12px}.pet-need strong{font-size:11px;font-weight:500}.pet-need small{font-size:9px;color:var(--muted)}.pet-need meter{display:block;width:100%;height:6px;margin-top:9px;background:#ffffff16;border:0;border-radius:10px;overflow:hidden}.pet-need meter::-webkit-meter-bar{background:#ffffff16;border:0;height:6px}.pet-need meter::-webkit-meter-optimum-value{background:var(--green)}.pet-need meter::-webkit-meter-suboptimum-value{background:#edbf8e}.pet-need meter::-moz-meter-bar{background:var(--green)}.pet-bond{border-top:1px solid #ffffff14;margin-top:24px;padding-top:18px;font-size:11px}.pet-bond strong{float:right;color:var(--green)}.pet-bond p{font-size:10px;color:var(--muted);margin-top:7px}.pet-details-button{width:100%;margin-top:20px;padding:11px 0 0;border:0;border-top:1px solid #ffffff14;background:none;color:var(--cream);text-align:left;font-size:11px!important}.pet-details-button span{float:right}.pet-thought{position:absolute;top:128px;left:calc(50% - 110px);width:360px;text-align:center}.pet-thought>span{font-size:10px;text-transform:uppercase;letter-spacing:2px;color:var(--green)}.pet-thought p{font-size:19px;font-weight:400;line-height:1.5;margin-top:12px;text-shadow:0 2px 12px #000}.pet-footer{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 40px)}.pet-actions{display:flex;gap:5px;border:1px solid #ffffff20;padding:9px;border-radius:20px;background:#1c2424ed;backdrop-filter:blur(20px)}.pet-actions button{display:flex;flex-direction:column;align-items:center;gap:5px;border:0;border-radius:13px;min-width:112px;padding:12px 15px;background:transparent;color:var(--cream);transition:background .2s,transform .2s}.pet-actions button:hover:not(:disabled){background:#c9e9ad17;transform:translateY(-3px)}.pet-action-icon{font-size:24px;line-height:30px;color:var(--green)}.pet-actions strong{font-size:12px;font-weight:500}.pet-actions small{font-size:9px;color:var(--muted)}.pet-actions .pet-pause{border-left:1px solid #ffffff18;border-radius:0 13px 13px 0}.pet-footer>p{font-size:9px;text-align:center;color:var(--muted);margin-top:11px}.pet-footer>p span{margin-left:18px}.pet-loading{position:absolute;top:48%;left:50%;transform:translate(-30%,-50%);padding:22px;border-radius:16px;background:#18201ff0;max-width:450px;font-size:14px}.pet-journal{position:absolute;right:28px;top:125px;width:300px;max-height:calc(100% - 310px);overflow-y:auto;padding:23px}.pet-journal h2{font-size:22px;letter-spacing:-.6px;margin:12px 0}.pet-journal p{font-size:12px;color:var(--muted);line-height:1.7}.pet-journal h3{font-size:12px;margin-top:22px}.pet-journal ol{list-style:none;padding:0}.pet-journal li{font-size:11px;line-height:1.5;padding:10px 0;border-bottom:1px solid #ffffff12}.pet-journal li small{display:block;font-size:9px;color:var(--muted);margin-bottom:4px}.pet-journal details{font-size:11px;margin-top:20px}.pet-journal summary{cursor:pointer;color:var(--green);margin-bottom:10px}.pet-journal label{display:block;margin:12px 0}.pet-journal select,.pet-profile input{display:block;width:100%;border:1px solid #ffffff30;background:#27312d;color:var(--cream);border-radius:6px;padding:8px;margin-top:8px}.pet-journal button,.pet-profile form button,.pet-loading button{border:0;background:var(--green);color:#17251b;border-radius:8px;padding:9px 12px;font-size:11px;margin-top:10px}
3
+ @media(max-height:780px) and (min-width:851px){.pet-profile{top:100px;padding:18px;width:250px}.pet-profile h1{font-size:32px}.pet-mood{margin:15px 0}.pet-need{margin:10px 0}.pet-bond{margin-top:15px;padding-top:12px}.pet-thought{top:105px}.pet-actions button{padding:8px 12px}.pet-journal{top:100px}}
4
+ @media(max-width:850px){.pet-header{padding:18px}.pet-header-actions{gap:8px}.pet-live{display:none}.pet-profile{left:16px;top:100px;width:205px;padding:16px}.pet-profile h1{font-size:30px}.pet-mood{margin:15px 0}.pet-thought{left:auto;right:18px;top:118px;width:calc(100% - 260px)}.pet-thought p{font-size:15px}.pet-actions button{min-width:80px;padding:8px}.pet-actions small{display:none}.pet-journal{right:16px;top:95px;max-height:calc(100% - 245px);width:300px;z-index:2}.pet-footer>p span{display:none}}
5
+ @media(max-width:540px){.pet-header{padding:14px 16px}.pet-brand{font-size:23px}.pet-brand i{font-size:9px}.pet-header-actions a{font-size:10px;padding:8px}.pet-profile{top:87px;width:175px;padding:14px}.pet-eyebrow{font-size:8px;letter-spacing:1px}.pet-profile h1{font-size:28px}.pet-character{font-size:9px}.pet-mood{font-size:11px;margin:12px 0}.pet-mood small{font-size:9px}.pet-need{margin:10px 0}.pet-need>div{font-size:10px}.pet-bond{margin-top:14px;padding-top:12px}.pet-bond p{font-size:9px}.pet-details-button{margin-top:14px}.pet-thought{right:14px;top:95px;width:calc(100% - 220px)}.pet-thought>span{font-size:8px;letter-spacing:1px}.pet-thought p{font-size:12px}.pet-footer{bottom:12px;width:calc(100% - 24px);max-width:none}.pet-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;padding:5px;border-radius:16px}.pet-actions button{min-width:0;padding:6px;gap:1px}.pet-action-icon{font-size:20px;line-height:24px}.pet-actions strong{font-size:10px}.pet-actions .pet-pause{border:0}.pet-footer>p{font-size:8px;margin-top:7px}.pet-journal{width:calc(100% - 32px);max-height:calc(100% - 270px)}.pet-loading{left:50%;transform:translate(-50%,-50%);width:80%}}
6
+ @media(max-width:540px){.pet-profile{width:calc(100% - 32px);padding:12px 14px}.pet-profile h1{font-size:25px;margin:4px 0;max-width:55%;overflow-wrap:anywhere}.pet-character{position:absolute;right:14px;top:32px;max-width:44%}.pet-mood{display:none}.pet-needs{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:7px}.pet-need{margin:0}.pet-need>div{display:block;font-size:10px}.pet-need strong{display:block;font-size:10px;margin-top:3px}.pet-need strong small{display:none}.pet-need meter{margin-top:4px}.pet-bond{margin-top:10px;padding-top:8px;font-size:10px}.pet-bond p{display:none}.pet-details-button{margin-top:7px;padding-top:7px;font-size:10px!important}.pet-thought{top:288px;right:22px;width:calc(100% - 44px)}.pet-thought p{margin-top:5px;font-size:12px}}
7
+ /* The companion now lives in a sunlit room; quiet cream panels replace the arcade HUD. */
8
+ .pet-app{--cream:#403c31;--muted:#746f60;--green:#536e50;background:none}
9
+ .pet-card,.pet-actions{background:#fffaf0ed;border-color:#d6c7af;box-shadow:0 10px 38px #523b1520}
10
+ .pet-header{background:linear-gradient(#e7dcc9ed,transparent)}
11
+ .pet-app .pet-brand{color:#493126;letter-spacing:-1.1px}.pet-brand>span{background:none;color:#a34f2f;border-radius:0;padding:0;margin-left:0;font-size:inherit;letter-spacing:inherit}.pet-header-actions a{border-color:#92836750}
12
+ .pet-top-button{background:#fffaf0bb;color:#514e3f;border:1px solid #92836750;padding:10px 14px;border-radius:30px;font-size:12px!important}
13
+ .pet-character{border-color:#81966e50}.pet-bond,.pet-details-button{border-color:#6a604c25}
14
+ .pet-need meter,.pet-need meter::-webkit-meter-bar{background:#74624a20}.pet-need meter::-webkit-meter-optimum-value{background:#8fa77b}
15
+ .pet-thought{top:103px;width:auto;left:50%;transform:translateX(-50%);white-space:nowrap}
16
+ .pet-status>span{display:inline-block;background:#fff9e9e6;border:1px solid #d6c7af;border-radius:30px;padding:11px 18px;color:#635b48;font-size:11px;letter-spacing:.5px;text-transform:none;box-shadow:0 4px 20px #523b1515}
17
+ .pet-stop{display:block;margin:9px auto;background:#fff9e9dd;border:0;border-radius:20px;color:#746c5c;padding:6px 12px;font-size:10px!important}
18
+ .pet-actions button:hover:not(:disabled){background:#9da78425}.pet-actions .pet-pause{border-color:#7b6d5025}.pet-footer>p{color:#5c5648;background:#f2e7d6ce;border-radius:20px;padding:4px 10px}
19
+ .pet-loading{background:#fffaf0f2}.pet-journal li{border-color:#83745825}.pet-journal select,.pet-profile input{background:#f2eddf;color:#4b4b38;border-color:#b7ad98}
20
+ .pet-journal button,.pet-profile form button,.pet-loading button{background:#d5dfbb}
21
+ .pet-games{position:absolute;right:28px;bottom:180px;width:295px;padding:23px}
22
+ .pet-games h2{font-size:21px;margin:12px 0 18px}.pet-games button{width:100%;display:block;text-align:left;padding:14px;background:#f2eddf;border:1px solid #dacfb9;border-radius:12px;color:#494a38;margin:8px 0}
23
+ .pet-games button:hover{background:#e5e9d2}.pet-games b{font-size:14px}.pet-games span{display:block;font-size:10px;margin-top:5px;color:#786e5b}.pet-games>small{display:block;font-size:10px;margin-top:15px;color:#786e5b}
24
+ .pet-sound-error{position:absolute;right:28px;top:90px;background:#fff8e6;padding:10px;border-radius:10px;font-size:11px}
25
+ @media(max-width:850px){.pet-header-actions{gap:5px}.pet-top-button{font-size:10px!important;padding:8px}.pet-status{top:100px;left:auto;right:20px;transform:none}.pet-games{bottom:155px;right:16px}}
26
+ @media(max-width:540px){.pet-header{align-items:flex-start}.pet-header-actions{max-width:190px;justify-content:flex-end;flex-wrap:wrap}.pet-top-button{font-size:9px!important;padding:6px 8px}.pet-header-actions a{padding:6px;font-size:9px}.pet-profile{top:100px}.pet-status{top:305px;right:auto;left:50%;transform:translateX(-50%);width:max-content;max-width:95%}.pet-status>span{font-size:10px;padding:8px 12px}.pet-games{width:calc(100% - 32px);bottom:175px;z-index:3}.pet-sound-error{top:76px;font-size:9px}}
27
+
28
+ .pet-summary{position:absolute;top:88px;left:24px;border:1px solid #d6c7af;border-radius:22px;padding:10px 15px;background:#fffaf0e6;color:#514e3f;font-size:12px!important;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
29
+ .pet-summary span{margin-left:12px;color:#536e50}.pet-profile{top:140px;max-height:calc(100% - 320px);overflow-y:auto}
30
+ @media(max-width:540px){.pet-summary{top:94px;left:16px;max-width:180px}.pet-profile{top:140px;max-height:calc(100% - 340px)}.pet-status{top:150px}.pet-profile~.pet-status{top:375px}}
31
  .pet-environment{pointer-events:auto;display:flex;flex-direction:column;gap:3px;font-size:10px;color:#514e3f}.pet-environment select{background:#fffaf0;color:#514e3f;border:1px solid #b6a88e;border-radius:16px;padding:7px;font-size:12px}.pet-header-actions{gap:10px}.pet-actions button{min-width:90px;padding:10px}.pet-status{max-width:420px;white-space:normal}.pet-status p{background:#fff9e9ed;padding:10px 15px;border-radius:16px;font-size:13px;text-shadow:none}.pet-cancel{position:absolute;right:24px;top:145px}.pet-needs{grid-template-columns:repeat(5,1fr)}
32
  @media(max-width:850px){.pet-header{align-items:flex-start}.pet-header-actions{max-width:300px;flex-wrap:wrap;justify-content:flex-end}.pet-actions{display:grid;grid-template-columns:repeat(4,1fr)}.pet-actions button{min-width:65px}.pet-footer{width:calc(100% - 24px)}.pet-status{top:170px}.pet-games{bottom:200px}}
33
+ @media(max-width:540px){.pet-header-actions{max-width:210px;gap:5px}.pet-brand{font-size:20px}.pet-brand>span{font-size:15px}.pet-environment{width:100%;flex-direction:row;align-items:center;justify-content:flex-end}.pet-environment select{font-size:10px;padding:5px}.pet-summary{top:110px}.pet-status{top:155px;width:90%}.pet-status p{font-size:11px}.pet-cancel{top:115px;right:16px}.pet-profile{top:155px}.pet-games{bottom:185px}.pet-actions button{min-width:0;padding:7px 2px}.pet-header-actions .pet-top-button{font-size:9px!important}.pet-profile~.pet-status{top:370px}}
34
  .pet-profile{width:220px;padding:18px;max-height:calc(100% - 310px)}.pet-profile h1{font-size:30px}.pet-bond{margin-top:12px;padding-top:10px}.pet-need{margin:10px 0}.pet-scores{font-size:11px;color:#536e50;margin-top:15px}.pet-actions{display:grid;grid-template-columns:repeat(9,1fr)}.pet-actions button{min-width:85px;padding:10px 7px}.pet-status{top:105px}.pet-profile~.pet-status{top:105px}.pet-thought p{margin-top:7px}.pet-footer{bottom:12px}.pet-environment select{min-width:125px}
35
  @media(max-width:1050px){.pet-actions{grid-template-columns:repeat(5,1fr)}.pet-actions button{min-width:70px}.pet-actions small{display:none}.pet-footer{width:min(650px,calc(100% - 24px))}}
36
+ @media(max-width:540px){.pet-profile{top:145px;width:calc(100% - 32px);padding:10px 14px;max-height:235px}.pet-profile h1{font-size:20px}.pet-needs{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.pet-need{margin:2px 0}.pet-scores{margin-top:7px}.pet-profile .pet-bond{margin-top:5px;padding-top:5px}.pet-details-button{display:inline-block;width:auto;margin-right:12px}.pet-profile~.pet-status{top:375px}.pet-status>span{font-size:10px}.pet-status p{font-size:10px;padding:7px}.pet-actions{grid-template-columns:repeat(5,1fr)}.pet-actions button{min-width:0;padding:5px 2px}.pet-actions strong{font-size:9px}.pet-summary{top:105px}.pet-cancel{top:110px}}
37
 
38
  /* Puffy duck-yellow toy lettering and wordless thought clouds. */
39
  .pet-app .pet-brand{font-family:Fredoka,"Trebuchet MS",system-ui,sans-serif;font-weight:700;font-style:normal;color:#ffc93c;letter-spacing:.5px;-webkit-text-stroke:1.5px #5a3418;paint-order:stroke fill;text-shadow:0 3px 0 #5a3418,0 6px 10px #5a341833}
 
47
  @media(max-width:540px){.pet-thought-bubble.pet-status{width:145px;max-width:145px;height:100px}.pet-thought-symbols{inset:12px 14px 28px;gap:9px}.pet-thought-symbols span{font-size:28px}}
48
  @media(max-height:500px) and (orientation:landscape){.pet-thought-bubble.pet-status{width:140px;max-width:140px;height:96px}}
49
  @media(prefers-reduced-motion:reduce){.pet-thought-symbols{animation:none}}
50
+
51
+ /* Phones: keep Microduck in view with a slim header, a one-line needs strip, a small thought
52
+ bubble and a single row of actions (scrolls sideways when the screen is narrow). */
53
+ @media (max-width:600px),(max-height:500px){
54
+ .pet-header{padding:max(8px,env(safe-area-inset-top)) 10px 0!important;gap:6px;align-items:flex-start}
55
+ .pet-app .pet-brand{font-size:16px!important;white-space:nowrap;flex-shrink:0}.pet-brand i{display:none!important}
56
+ .pet-header-actions{gap:4px!important;max-width:none!important;flex-wrap:wrap;justify-content:flex-end}
57
+ .pet-environment{font-size:0!important;flex-direction:row!important;width:auto!important}
58
+ .pet-environment select{font-size:11px!important;padding:4px 6px!important;min-width:0!important;min-height:0!important;border-radius:14px}
59
+ .pet-top-button{font-size:10px!important;padding:5px 9px!important;min-height:0!important}
60
+ .pet-summary{top:52px!important;left:10px!important;padding:4px 10px!important;font-size:11px!important;min-height:0!important;max-width:none!important;border-radius:14px}
61
+ .pet-profile{top:82px!important;left:10px!important;right:10px!important;width:auto!important;max-height:none!important;padding:6px 10px 7px!important;border-radius:12px}
62
+ .pet-profile .pet-eyebrow,.pet-profile h1,.pet-profile form,.pet-profile .pet-scores,.pet-profile .pet-bond{display:none!important}
63
+ .pet-profile .pet-needs{display:grid!important;grid-template-columns:repeat(5,1fr);gap:8px;margin:0!important}
64
+ .pet-profile .pet-need{margin:0!important;padding:0!important}
65
+ .pet-profile .pet-need>div{display:flex!important;justify-content:space-between;font-size:9px!important}
66
+ .pet-profile .pet-need strong{display:inline!important;font-size:9px!important;margin:0!important}.pet-profile .pet-need strong small{display:none}
67
+ .pet-profile .pet-need meter{height:5px!important;margin-top:3px!important}
68
+ .pet-thought-bubble.pet-status,.pet-profile~.pet-thought-bubble.pet-status{top:128px!important;right:10px!important;left:auto!important;transform:none!important;width:100px!important;max-width:100px!important;height:70px!important}
69
+ .pet-thought-symbols{inset:9px 10px 20px!important;gap:6px!important}.pet-thought-symbols span{font-size:20px!important}
70
+ .pet-cancel{top:auto!important;bottom:calc(74px + env(safe-area-inset-bottom))!important;right:10px!important}
71
+ .pet-footer{bottom:max(6px,env(safe-area-inset-bottom))!important;left:8px!important;right:8px!important;width:auto!important;max-width:none!important;transform:none!important}
72
+ .pet-footer>p{display:none!important}
73
+ .pet-actions{display:flex!important;overflow-x:auto;gap:2px!important;padding:4px!important;border-radius:14px!important;scrollbar-width:none}
74
+ .pet-actions::-webkit-scrollbar{display:none}
75
+ .pet-actions button{flex:1 0 56px;min-width:56px!important;padding:5px 3px!important;gap:1px!important;min-height:0!important}
76
+ .pet-action-icon{font-size:17px!important;line-height:20px!important}
77
+ .pet-actions strong{font-size:9px!important;white-space:nowrap}.pet-actions small{display:none!important}
78
+ .pet-games{right:8px!important;left:8px!important;width:auto!important;bottom:calc(70px + env(safe-area-inset-bottom))!important}
79
+ }
80
+ @media (max-height:500px) and (orientation:landscape){
81
+ .pet-summary{top:8px!important;left:150px!important}
82
+ .pet-profile{top:40px!important;right:auto!important;width:330px!important}
83
+ .pet-thought-bubble.pet-status,.pet-profile~.pet-thought-bubble.pet-status{top:48px!important}
84
+ }