/* Game camera and HUD have independent viewports. No actor-only repositioning. */
.room-world { position:absolute; inset:0 auto auto 0; width:100%; height:100%; overflow:hidden; }
.room[data-care-mode="cleaning"] .room-world { display:none; }
.room[data-furniture-mode="designer"]:not([data-panel]) .amigo-stage { animation:none; transition:none; }
.room[data-furniture-mode="designer"]:not([data-panel]) .amigo-stage[data-action="listen"] img { animation:hud-breathe 1.8s ease-in-out infinite; transform-origin:50% 100%; }
.room[data-furniture-mode="designer"]:not([data-panel]) .amigo-stage:is([data-action="celebrate"],[data-action="train"]) img { animation:hud-nibble .5s ease-in-out 3; transform-origin:50% 100%; }
#room[data-furniture-mode="designer"][data-hud] .amigo-stage:not(.chair-mode) {
  display:block; visibility:visible; opacity:1; left:var(--slot-left); top:var(--slot-top);
  width:var(--slot-width); height:var(--slot-height); right:auto; bottom:auto;
  transform:none; animation:none; transition:none; pointer-events:auto;
}
.room[data-hud] .room-world :is(.furniture,.room-tarot-desk,.room-bath-basket,.room-led,.room-wardrobe) { visibility:hidden; pointer-events:none; }
#room[data-hud] #amigoCharacter { animation:hud-breathe 3s ease-in-out infinite; transform-origin:50% 100%; }
#room[data-hud] .amigo-stage[data-action="snack"] #amigoCharacter { animation:hud-nibble .45s ease-in-out 3; }
@keyframes hud-breathe { 50% { transform:scale(1.008); } }
@keyframes hud-nibble { 50% { transform:translateY(-3px) rotate(1deg); } }
@media (prefers-reduced-motion:reduce) { #room #amigoCharacter, #room[data-hud] #amigoCharacter, #room[data-hud] .amigo-stage[data-action="snack"] #amigoCharacter { animation:none; } }
.room[data-hud] .activity-panel {
  --panel-pad:12px; inset:auto 10px 10px; width:auto; max-height:60%;
  padding:12px; display:flex; flex-direction:column; gap:6px; overflow:hidden;
  border-radius:22px; transform:none; animation:none; background:#fffaf2;
  box-shadow:0 8px 24px #503c2420; backdrop-filter:none;
}
.room[data-hud] .activity-panel header { position:static; flex:none; align-items:center; margin:0; padding:0; background:none; gap:8px; }
.room[data-hud] .activity-panel header > div { min-width:0; }
.room[data-hud] #panelKicker { display:none; }
.room[data-hud] .activity-panel h2 { font-size:22px; line-height:1.15; }
.room[data-hud] .close-panel { width:44px; height:44px; flex-basis:44px; border-radius:50%; background:#efe9dd; }
.room[data-hud] .panel-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#c5c5b1 transparent; }
.room[data-hud] .panel-body .hud-hint { font-size:12px; line-height:1.35; margin:0 0 8px; }
.room[data-hud] .snack-row { gap:8px; }
.room[data-hud] .snack-card { min-height:64px; padding:6px; font-size:26px; touch-action:none; }
.room[data-hud] .snack-card small { margin-top:2px; font-size:12px; }
.snack-drag-ghost { position:fixed; z-index:100; font-size:38px; line-height:44px; width:44px; height:44px; pointer-events:none; transform:translate(-50%,-50%); filter:drop-shadow(0 3px 5px #61442a40); }
.room[data-hud] .speak-control { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:center; }
.room[data-hud] .hold-speak { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; height:48px; min-height:48px; border-radius:16px; box-shadow:none; font-size:14px; touch-action:none; }
.room[data-hud] .hold-speak span { display:inline; font-size:23px; margin:0; }
.room[data-hud] .ai-mode-button { min-height:48px; padding:6px 10px; font-size:12px; }
.room[data-hud] :is(.ai-connection,.speak-text-form,.voice-options,.fallback-actions) { grid-column:1/-1; width:100%; }
.room[data-hud] .ai-connection { margin:0; text-align:left; }
.room[data-hud] .speak-text-form { gap:6px; }
.room[data-hud] input { font-size:16px; } /* Avoid iOS focus zoom. */
.room[data-hud] .speak-text-form .secondary { min-width:56px; padding:6px 10px; }
.room[data-hud] :is(.voice-options,.playlist-options,.settings-options) summary { min-height:32px; display:flex; align-items:center; gap:6px; color:var(--muted); font-size:12px; cursor:pointer; }
.room[data-hud] :is(.voice-options,.playlist-options,.settings-options) summary::before { content:'›'; font-size:19px; }
.room[data-hud] .settings-options summary { min-height:44px; font-size:14px; }
.room[data-hud] .account-card { padding:10px; margin:0 0 8px; }
.room[data-hud] .account-card small { font-size:12px; }
.room[data-hud] .quiet-note { font-size:11px; margin:6px 0 0; }
.room[data-hud] details[open] > summary::before { transform:rotate(90deg); }
.room[data-hud] .fallback-actions { display:flex; gap:6px; flex-wrap:wrap; }
.room[data-hud] .fallback-actions button { flex:1; padding:6px; font-size:12px; }
.room[data-hud] .panel-choice { padding:10px; min-height:72px; }
.room[data-hud] .panel-grid { margin-top:8px; }
.room[data-hud][data-panel="music"] .panel-choice { min-height:48px; padding:8px; }
.room[data-hud][data-panel="music"] .panel-choice :is(span,small) { display:none; }
.room[data-hud][data-panel="music"] .panel-choice b { font-size:13px; }
.room[data-hud] #accountAction { font-size:14px; padding:10px; }
.room[data-hud] .setting-row { gap:12px; }
.room[data-hud] .setting-row > div { min-width:0; }
.room[data-hud] .setting-row small { line-height:1.35; }
.room[data-hud] .system-status { max-width:calc(100% - 24px); top:12px; bottom:auto; font-size:12px; }
@media (min-width:600px) {
  .room[data-hud] .activity-panel { top:12px; right:12px; left:auto; bottom:auto; width:min(330px,42%); max-height:calc(100% - 24px); }
}
/* Fit the actual viewport, including mobile browser bars. Special scenes retain
   their existing fullscreen contracts; ordinary room navigation never scrolls. */
.app:not([data-care-mode="cleaning"]):not([data-screen="game"]):not([data-screen="tarot"]) {
  height:100svh; height:var(--app-height,100dvh); min-height:0;
  padding-top:max(8px,env(safe-area-inset-top)); padding-bottom:max(8px,env(safe-area-inset-bottom));
  grid-template-rows:48px minmax(0,1fr) 64px; gap:8px;
}
.app:not([data-care-mode="cleaning"]):not([data-screen="game"]):not([data-screen="tarot"]) > .room { height:auto; min-height:0; }
.app:not([data-care-mode="cleaning"]):not([data-screen="game"]):not([data-screen="tarot"]) .topbar { min-height:0; }
.app:not([data-care-mode="cleaning"]):not([data-screen="game"]):not([data-screen="tarot"]) .action-dock { min-height:0; height:64px; padding:4px; }
.action-dock button { touch-action:manipulation; }
@media (max-height:500px) and (min-width:600px) {
  .app:not([data-care-mode="cleaning"]):not([data-screen="game"]):not([data-screen="tarot"]) { grid-template-rows:44px minmax(0,1fr) 52px; gap:4px; padding-top:4px; padding-bottom:max(4px,env(safe-area-inset-bottom)); }
  .app:not([data-care-mode="cleaning"]):not([data-screen="game"]):not([data-screen="tarot"]) .action-dock { height:52px; }
  .room[data-hud] .activity-panel { padding:10px; gap:4px; }
}
